From 0e428ae4cfd8190897b6d132a46d1c2dae39f382 Mon Sep 17 00:00:00 2001 From: Lushang Date: Wed, 16 Dec 2020 15:22:39 +0800 Subject: [PATCH] Updated new Apex classes in release v50.0 --- completions.py | 6 +++- processor.py | 2 +- salesforce/lib/apex.py | 81 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 77 insertions(+), 12 deletions(-) diff --git a/completions.py b/completions.py index d16bed9..b75dddc 100644 --- a/completions.py +++ b/completions.py @@ -31,13 +31,17 @@ def load_sobject_cache(reload_cache=False, username=None): class PackageCompletions(sublime_plugin.EventListener): + """ + Completions for Package.xml + """ def on_query_completions(self, view, prefix, locations): if not view.match_selector(locations[0], "text.xml"): return [] # Check whether current file is package file pattern = "[\\s.*<>\\-\\w/\\%1-9]+" - if not view.find_all(pattern): return + if not view.find_all(pattern): + return location = locations[0] pt = locations[0] - len(prefix) - 1 diff --git a/processor.py b/processor.py index dc63f2a..82f744d 100644 --- a/processor.py +++ b/processor.py @@ -1466,7 +1466,7 @@ def handle_thread(thread, timeout): # Makedir for subscribed meta types for metadata_folder in settings["subscribed_metadata_folders"]: - outputdir = os.path.join(extract_to, "src", metadata_folder); + outputdir = os.path.join(extract_to, "src", metadata_folder) if not os.path.exists(outputdir): os.makedirs(outputdir) # Extract the zipFile to extract_to diff --git a/salesforce/lib/apex.py b/salesforce/lib/apex.py index d51c883..aa09a4a 100644 --- a/salesforce/lib/apex.py +++ b/salesforce/lib/apex.py @@ -697,6 +697,7 @@ "Separator" ], "System": [ + "AccessType", "XmlException", "RequiredFeatureMissingException", "SearchException", @@ -737,7 +738,8 @@ "ApexPages", "Approval", "QuickAction", - "SObject", + "SObject", + "SObjectAccessDecision", "AssertException", "Date", "Messaging", @@ -829,7 +831,8 @@ "QueueableContextImpl", "Site", "UserManagement", - "Callable" + "Callable", + "Security", ], "Canvas": [ "CanvasRenderException", @@ -864,14 +867,15 @@ "EmailFileAttachment", "AttachmentRetrievalOption", "InboundEmailResult", - "InboundEmail", - "RenderEmailTemplateError", + "InboundEmail", "EmailToSalesforceHandler", "SingleEmailMessage", "TextAttachment", "PushNotification", - "PushNotificationPayload", - "RenderEmailTemplateBodyResult", + "PushNotificationPayload", + "CustomNotification", + "RenderEmailTemplateBodyResult", + "RenderEmailTemplateError", "MassEmailMessage" ], "DataProtection": [ @@ -3082,7 +3086,25 @@ }, "namespace": "Messaging", "properties": {} - }, + }, + "customnotification": { + "constructors": { + "CustomNotification()\t": "CustomNotification()$0", + "CustomNotification(String typeId, String sender, String title, String body, String targetId, String targetPageRef)\t": "CustomNotification(${1:String typeId}, ${2:String sender}, ${3:String title}, ${4:String body}, ${5:String targetId}, ${6:String targetPageRef})$0" + }, + "name": "CustomNotification", + "methods": { + "send(Set users)\tvoid": "send(${1:Set users})$0", + "setNotificationTypeId(String id)\tvoid": "setNotificationTypeId(${1:String id})$0", + "setTitle(String title)\tvoid": "setTitle(${1:String title})$0", + "setBody(String body)\tvoid": "setBody(${1:String body})$0", + "setSenderId(String id)\tvoid": "setSenderId(${1:String id})$0", + "setTargetId(String targetId)\tvoid": "setTargetId(${1:String targetId})$0", + "setTargetPageRef(String pageRef)\tvoid": "setTargetPageRef(${1:String pageRef})$0", + }, + "namespace": "Messaging", + "properties": {} + }, "sortorder": [ { "constructors": {}, @@ -9658,7 +9680,13 @@ "getLimitFieldsDescribes()\tInteger": "getLimitFieldsDescribes()$0", "getChildRelationshipsDescribes()\tInteger": "getChildRelationshipsDescribes()$0", "getHeapSize()\tInteger": "getHeapSize()$0", - "getPickListDescribes()\tInteger": "getPickListDescribes()$0" + "getPickListDescribes()\tInteger": "getPickListDescribes()$0", + "getMobilePushApexCalls()\tInteger": "getMobilePushApexCalls()$0", + "getLimitMobilePushApexCalls()\tInteger": "getLimitMobilePushApexCalls()$0", + "getPublishImmediateDML()\tInteger": "getPublishImmediateDML()$0", + "getLimitPublishImmediateDML()\tInteger": "getLimitPublishImmediateDML()$0", + "getQueueableJobs()\tInteger": "getQueueableJobs()$0", + "getLimitQueueableJobs()\tInteger": "getLimitQueueableJobs()$0", }, "namespace": "Limits", "name": "Limits" @@ -23310,5 +23338,38 @@ "properties": { "fileCount": "fileCount$0" } - } -} \ No newline at end of file + }, + "security": { + "constructors": {}, + "name": "Security", + "methods": { + "stripInaccessible(System.AccessType accessCheckType, List sourceRecords, Boolean enforceRootObjectCRUD)\tSystem.SObjectAccessDecision": "stripInaccessible(${1:System.AccessType accessCheckType}, ${2:List sourceRecords}, ${3:Boolean enforceRootObjectCRUD})$0", + "stripInaccessible(System.AccessType accessCheckType, List sourceRecords)\tSystem.SObjectAccessDecision": "stripInaccessible(${1:System.AccessType accessCheckType}, ${2:List sourceRecords})$0", + }, + "namespace": "System", + "properties": {} + }, + "accesstype": { + "constructors": {}, + "name": "AccessType", + "methods": {}, + "namespace": "System", + "properties": { + "CREATABLE": "CREATABLE$0", + "READABLE": "READABLE$0", + "UPDATABLE": "UPDATABLE$0", + "UPSERTABLE": "UPSERTABLE$0", + } + }, + "sobjectaccessdecision": { + "constructors": {}, + "name": "SObjectAccessDecision", + "methods": { + "getModifiedIndexes()\tSet": "getModifiedIndexes()$0", + "getRecords()\tList": "getRecords()$0", + "getRemovedFields()\tMap>": "getRemovedFields()$0", + }, + "namespace": "System", + "properties": {} + }, +}