@pipedream/salesforce_rest_api 1.14.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/add-contact-to-campaign/add-contact-to-campaign.mjs +1 -1
- package/actions/add-lead-to-campaign/add-lead-to-campaign.mjs +1 -1
- package/actions/common/base-create-update.mjs +2 -34
- package/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs +1 -1
- package/actions/create-account/create-account.mjs +1 -11
- package/actions/create-accounts-batch/create-accounts-batch.mjs +1 -1
- package/actions/create-attachment/create-attachment.mjs +8 -13
- package/actions/create-campaign/create-campaign.mjs +1 -17
- package/actions/create-case/create-case.mjs +1 -16
- package/actions/create-casecomment/create-casecomment.mjs +13 -13
- package/actions/create-contact/create-contact.mjs +1 -16
- package/actions/create-content-note/create-content-note.mjs +43 -33
- package/actions/create-crm-record/create-crm-record.mjs +2 -2
- package/actions/create-event/create-event.mjs +27 -25
- package/actions/create-lead/create-lead.mjs +1 -11
- package/actions/create-note/create-note.mjs +13 -9
- package/actions/create-opportunities-batch/create-opportunities-batch.mjs +1 -1
- package/actions/create-opportunity/create-opportunity.mjs +1 -11
- package/actions/create-record/create-record.mjs +15 -54
- package/actions/create-task/create-task.mjs +2 -21
- package/actions/create-user/create-user.mjs +1 -11
- package/actions/delete-crm-record/delete-crm-record.mjs +2 -2
- package/actions/delete-note/delete-note.mjs +1 -1
- package/actions/delete-opportunity/delete-opportunity.mjs +1 -1
- package/actions/delete-record/delete-record.mjs +1 -1
- package/actions/describe-object/describe-object.mjs +1 -1
- package/actions/find-records/find-records.mjs +1 -1
- package/actions/get-case/get-case.mjs +1 -1
- package/actions/get-current-user/get-current-user.mjs +1 -1
- package/actions/get-knowledge-articles/get-knowledge-articles.mjs +1 -1
- package/actions/get-knowledge-data-category-groups/get-knowledge-data-category-groups.mjs +1 -1
- package/actions/get-record-by-id/get-record-by-id.mjs +1 -1
- package/actions/get-related-records/get-related-records.mjs +1 -1
- package/actions/get-user/get-user.mjs +1 -1
- package/actions/get-user-info/get-user-info.mjs +1 -1
- package/actions/insert-blob-data/insert-blob-data.mjs +1 -1
- package/actions/list-case-comments/list-case-comments.mjs +1 -1
- package/actions/list-case-feed-items/list-case-feed-items.mjs +1 -1
- package/actions/list-cases/list-cases.mjs +1 -1
- package/actions/list-email-messages/list-email-messages.mjs +1 -1
- package/actions/list-email-templates/list-email-templates.mjs +1 -1
- package/actions/list-knowledge-articles/list-knowledge-articles.mjs +1 -1
- package/actions/list-object-fields/list-object-fields.mjs +1 -1
- package/actions/list-objects/list-objects.mjs +1 -1
- package/actions/post-feed-to-chatter/post-feed-to-chatter.mjs +1 -1
- package/actions/search-string/search-string.mjs +1 -1
- package/actions/send-email/send-email.mjs +1 -1
- package/actions/soql-query/soql-query.mjs +1 -1
- package/actions/soql-search/soql-search.mjs +1 -1
- package/actions/sosl-search/sosl-search.mjs +1 -1
- package/actions/text-search/text-search.mjs +1 -1
- package/actions/update-account/update-account.mjs +8 -22
- package/actions/update-accounts-batch/update-accounts-batch.mjs +1 -1
- package/actions/update-contact/update-contact.mjs +8 -27
- package/actions/update-content-note/update-content-note.mjs +8 -19
- package/actions/update-crm-record/update-crm-record.mjs +2 -2
- package/actions/update-email-template/update-email-template.mjs +13 -62
- package/actions/update-note/update-note.mjs +8 -19
- package/actions/update-opportunities-batch/update-opportunities-batch.mjs +1 -1
- package/actions/update-opportunity/update-opportunity.mjs +8 -22
- package/actions/update-record/update-record.mjs +24 -80
- package/actions/upsert-record/upsert-record.mjs +32 -76
- package/common/sobjects/attachment.mjs +2 -11
- package/common/sobjects/caseComment.mjs +2 -11
- package/common/sobjects/content-note.mjs +3 -11
- package/common/sobjects/event.mjs +3 -17
- package/common/sobjects/note.mjs +3 -12
- package/common/sobjects/opportunity.mjs +2 -10
- package/common/sobjects/user.mjs +2 -10
- package/package.json +1 -1
- package/salesforce_rest_api.app.mjs +0 -16
- package/sources/case-updated-instant/case-updated-instant.mjs +1 -1
- package/sources/common/common-feed.mjs +65 -6
- package/sources/email-template-updated-instant/email-template-updated-instant.mjs +1 -1
- package/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs +1 -1
- package/sources/new-case-instant/new-case-instant.mjs +1 -1
- package/sources/new-email-template-instant/new-email-template-instant.mjs +1 -1
- package/sources/new-feed-comment/new-feed-comment.mjs +3 -3
- package/sources/new-feed-item/new-feed-item.mjs +2 -2
- package/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs +1 -1
- package/sources/new-outbound-message/new-outbound-message.mjs +1 -1
- package/sources/new-record-instant/new-record-instant.mjs +1 -1
- package/sources/record-deleted-instant/record-deleted-instant.mjs +1 -1
- package/sources/record-updated-instant/record-updated-instant.mjs +1 -1
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " The contact must already exist - use **Create Contact** if it does not."
|
|
11
11
|
+ " "
|
|
12
12
|
+ "[See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaignmember.htm)",
|
|
13
|
-
version: "0.1.
|
|
13
|
+
version: "0.1.7",
|
|
14
14
|
annotations: {
|
|
15
15
|
destructiveHint: false,
|
|
16
16
|
openWorldHint: true,
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " The lead must already exist - use **Create Lead** if it does not."
|
|
11
11
|
+ " "
|
|
12
12
|
+ "[See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaignmember.htm)",
|
|
13
|
-
version: "0.1.
|
|
13
|
+
version: "0.1.7",
|
|
14
14
|
annotations: {
|
|
15
15
|
destructiveHint: false,
|
|
16
16
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export const additionalFields = {
|
|
|
6
6
|
type: "object",
|
|
7
7
|
label: "Additional Fields",
|
|
8
8
|
description:
|
|
9
|
-
|
|
9
|
+
"Other fields to set for this record as name -> value pairs. Values are parsed as JSON where applicable. Example: `{\"Industry\": \"Technology\", \"AnnualRevenue\": 1000000}`. Use **Describe Object** to discover valid field names.",
|
|
10
10
|
optional: true,
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -16,7 +16,6 @@ export function getProps({
|
|
|
16
16
|
docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_concepts.htm",
|
|
17
17
|
showDocsInfo = true,
|
|
18
18
|
showDateInfo = false,
|
|
19
|
-
advancedProps = true,
|
|
20
19
|
}) {
|
|
21
20
|
let { initialProps } = objType;
|
|
22
21
|
if (initialProps && createOrUpdate === "update") {
|
|
@@ -54,29 +53,12 @@ export function getProps({
|
|
|
54
53
|
? "createProps"
|
|
55
54
|
: "updateProps"],
|
|
56
55
|
...initialProps,
|
|
57
|
-
|
|
58
|
-
? {
|
|
59
|
-
useAdvancedProps: {
|
|
60
|
-
propDefinition: [
|
|
61
|
-
salesforce,
|
|
62
|
-
"useAdvancedProps",
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
: {
|
|
67
|
-
...objType.extraProps,
|
|
68
|
-
},
|
|
56
|
+
additionalFields,
|
|
69
57
|
};
|
|
70
58
|
}
|
|
71
59
|
|
|
72
60
|
export default {
|
|
73
61
|
methods: {
|
|
74
|
-
getObjectType() {
|
|
75
|
-
return "";
|
|
76
|
-
},
|
|
77
|
-
getAdvancedProps() {
|
|
78
|
-
return {};
|
|
79
|
-
},
|
|
80
62
|
getAdditionalFields,
|
|
81
63
|
formatDateTimeProps(props = {}) {
|
|
82
64
|
// https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_valid_date_formats.htm
|
|
@@ -101,18 +83,4 @@ export default {
|
|
|
101
83
|
}));
|
|
102
84
|
},
|
|
103
85
|
},
|
|
104
|
-
async additionalProps() {
|
|
105
|
-
const objectType = this.getObjectType();
|
|
106
|
-
if (!this.useAdvancedProps || !objectType) return {};
|
|
107
|
-
|
|
108
|
-
const fields = (await this.salesforce.getFieldsForObjectType(objectType));
|
|
109
|
-
const fieldNames = fields.map((f) => f.name);
|
|
110
|
-
const filteredProps = Object.fromEntries(Object.entries(this.getAdvancedProps()).filter(([
|
|
111
|
-
key,
|
|
112
|
-
]) => fieldNames.includes(key) || key[0] === key[0].toLowerCase()));
|
|
113
|
-
return {
|
|
114
|
-
...filteredProps,
|
|
115
|
-
additionalFields,
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
86
|
};
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
+ " Every other Salesforce action already returns JSON, so this is only needed for outbound-message workflows."
|
|
11
11
|
+ " "
|
|
12
12
|
+ "[See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_om_outboundmessaging.htm)",
|
|
13
|
-
version: "0.0.
|
|
13
|
+
version: "0.0.12",
|
|
14
14
|
annotations: {
|
|
15
15
|
destructiveHint: false,
|
|
16
16
|
openWorldHint: true,
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
+ " For example, `Name` `Acme Corp` creates a minimal account and returns its new record ID."
|
|
14
14
|
+ " "
|
|
15
15
|
+ `[See the documentation](${docsLink})`,
|
|
16
|
-
version: "0.
|
|
16
|
+
version: "0.4.0",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
|
@@ -22,12 +22,6 @@ export default {
|
|
|
22
22
|
type: "action",
|
|
23
23
|
methods: {
|
|
24
24
|
...common.methods,
|
|
25
|
-
getObjectType() {
|
|
26
|
-
return "Account";
|
|
27
|
-
},
|
|
28
|
-
getAdvancedProps() {
|
|
29
|
-
return account.extraProps;
|
|
30
|
-
},
|
|
31
25
|
},
|
|
32
26
|
props: getProps({
|
|
33
27
|
objType: account,
|
|
@@ -37,13 +31,9 @@ export default {
|
|
|
37
31
|
/* eslint-disable no-unused-vars */
|
|
38
32
|
const {
|
|
39
33
|
salesforce,
|
|
40
|
-
getAdvancedProps,
|
|
41
|
-
getObjectType,
|
|
42
34
|
getAdditionalFields,
|
|
43
35
|
formatDateTimeProps,
|
|
44
|
-
useAdvancedProps,
|
|
45
36
|
docsInfo,
|
|
46
|
-
dateInfo,
|
|
47
37
|
additionalFields,
|
|
48
38
|
...data
|
|
49
39
|
} = this;
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
+ " Input is a CSV file - supply a path under `/tmp` or a URL to download it from, with a header row of Salesforce field API names."
|
|
12
12
|
+ " "
|
|
13
13
|
+ "[See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
|
|
14
|
-
version: "0.0.
|
|
14
|
+
version: "0.0.7",
|
|
15
15
|
annotations: {
|
|
16
16
|
destructiveHint: false,
|
|
17
17
|
openWorldHint: true,
|
|
@@ -5,15 +5,6 @@ import { getFileStream } from "@pipedream/platform";
|
|
|
5
5
|
|
|
6
6
|
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_attachment.htm";
|
|
7
7
|
|
|
8
|
-
/* eslint-disable no-unused-vars */
|
|
9
|
-
const {
|
|
10
|
-
useAdvancedProps, ...props
|
|
11
|
-
} = getProps({
|
|
12
|
-
objType: attachment,
|
|
13
|
-
docsLink,
|
|
14
|
-
});
|
|
15
|
-
/* eslint-enable no-unused-vars */
|
|
16
|
-
|
|
17
8
|
export default {
|
|
18
9
|
...common,
|
|
19
10
|
key: "salesforce_rest_api-create-attachment",
|
|
@@ -23,23 +14,26 @@ export default {
|
|
|
23
14
|
+ " For newer orgs prefer Salesforce Files - use **Insert Blob Data** with `ContentVersion` instead."
|
|
24
15
|
+ " "
|
|
25
16
|
+ `[See the documentation](${docsLink})`,
|
|
26
|
-
version: "0.
|
|
17
|
+
version: "0.6.0",
|
|
27
18
|
annotations: {
|
|
28
19
|
destructiveHint: false,
|
|
29
20
|
openWorldHint: true,
|
|
30
21
|
readOnlyHint: false,
|
|
31
22
|
},
|
|
32
23
|
type: "action",
|
|
33
|
-
props
|
|
24
|
+
props: getProps({
|
|
25
|
+
objType: attachment,
|
|
26
|
+
docsLink,
|
|
27
|
+
}),
|
|
34
28
|
async run({ $ }) {
|
|
35
29
|
/* eslint-disable no-unused-vars */
|
|
36
30
|
const {
|
|
37
31
|
salesforce,
|
|
38
|
-
getAdvancedProps,
|
|
39
32
|
getAdditionalFields,
|
|
40
33
|
formatDateTimeProps,
|
|
41
34
|
docsInfo,
|
|
42
35
|
filePathOrContent,
|
|
36
|
+
additionalFields,
|
|
43
37
|
...data
|
|
44
38
|
} = this;
|
|
45
39
|
/* eslint-enable no-unused-vars */
|
|
@@ -59,8 +53,9 @@ export default {
|
|
|
59
53
|
const response = await salesforce.createRecord("Attachment", {
|
|
60
54
|
$,
|
|
61
55
|
data: {
|
|
62
|
-
Body: body,
|
|
63
56
|
...data,
|
|
57
|
+
...getAdditionalFields(),
|
|
58
|
+
Body: body,
|
|
64
59
|
},
|
|
65
60
|
});
|
|
66
61
|
$.export("$summary", `Successfully created attachment "${this.Name}"`);
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
+ " For example, `Name: \"Summer 2026 Webinar\"` creates the campaign and returns its ID."
|
|
14
14
|
+ " "
|
|
15
15
|
+ `[See the documentation](${docsLink})`,
|
|
16
|
-
version: "0.3.
|
|
16
|
+
version: "0.3.8",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
|
@@ -22,32 +22,20 @@ export default {
|
|
|
22
22
|
type: "action",
|
|
23
23
|
methods: {
|
|
24
24
|
...common.methods,
|
|
25
|
-
getObjectType() {
|
|
26
|
-
return "Campaign";
|
|
27
|
-
},
|
|
28
|
-
getAdvancedProps() {
|
|
29
|
-
return campaign.extraProps;
|
|
30
|
-
},
|
|
31
25
|
},
|
|
32
26
|
props: getProps({
|
|
33
27
|
objType: campaign,
|
|
34
28
|
docsLink,
|
|
35
|
-
showDateInfo: true,
|
|
36
29
|
}),
|
|
37
30
|
async run({ $ }) {
|
|
38
31
|
/* eslint-disable no-unused-vars, max-len */
|
|
39
32
|
const {
|
|
40
33
|
salesforce,
|
|
41
|
-
getAdvancedProps,
|
|
42
|
-
getObjectType,
|
|
43
34
|
getAdditionalFields,
|
|
44
35
|
formatDateTimeProps,
|
|
45
|
-
useAdvancedProps,
|
|
46
36
|
docsInfo,
|
|
47
37
|
dateInfo,
|
|
48
38
|
additionalFields,
|
|
49
|
-
StartDate,
|
|
50
|
-
EndDate,
|
|
51
39
|
...data
|
|
52
40
|
} = this;
|
|
53
41
|
/* eslint-enable no-unused-vars, max-len */
|
|
@@ -55,10 +43,6 @@ export default {
|
|
|
55
43
|
$,
|
|
56
44
|
data: {
|
|
57
45
|
...data,
|
|
58
|
-
...formatDateTimeProps({
|
|
59
|
-
StartDate,
|
|
60
|
-
EndDate,
|
|
61
|
-
}),
|
|
62
46
|
...getAdditionalFields(),
|
|
63
47
|
},
|
|
64
48
|
});
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
+ " After creating, use **Create Case Comment** to add notes or **List Case Feed Items** to read its activity."
|
|
14
14
|
+ " "
|
|
15
15
|
+ `[See the documentation](${docsLink})`,
|
|
16
|
-
version: "0.
|
|
16
|
+
version: "1.0.0",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
|
@@ -22,31 +22,19 @@ export default {
|
|
|
22
22
|
type: "action",
|
|
23
23
|
methods: {
|
|
24
24
|
...common.methods,
|
|
25
|
-
getObjectType() {
|
|
26
|
-
return "Case";
|
|
27
|
-
},
|
|
28
|
-
getAdvancedProps() {
|
|
29
|
-
return caseObj.extraProps;
|
|
30
|
-
},
|
|
31
25
|
},
|
|
32
26
|
props: getProps({
|
|
33
27
|
objType: caseObj,
|
|
34
28
|
docsLink,
|
|
35
|
-
showDateInfo: true,
|
|
36
29
|
}),
|
|
37
30
|
async run({ $ }) {
|
|
38
31
|
/* eslint-disable no-unused-vars */
|
|
39
32
|
const {
|
|
40
33
|
salesforce,
|
|
41
|
-
getAdvancedProps,
|
|
42
|
-
getObjectType,
|
|
43
34
|
getAdditionalFields,
|
|
44
35
|
formatDateTimeProps,
|
|
45
|
-
useAdvancedProps,
|
|
46
36
|
docsInfo,
|
|
47
|
-
dateInfo,
|
|
48
37
|
additionalFields,
|
|
49
|
-
SlaStartDate,
|
|
50
38
|
...data
|
|
51
39
|
} = this;
|
|
52
40
|
/* eslint-enable no-unused-vars */
|
|
@@ -54,9 +42,6 @@ export default {
|
|
|
54
42
|
$,
|
|
55
43
|
data: {
|
|
56
44
|
...data,
|
|
57
|
-
...formatDateTimeProps({
|
|
58
|
-
SlaStartDate,
|
|
59
|
-
}),
|
|
60
45
|
...getAdditionalFields(),
|
|
61
46
|
},
|
|
62
47
|
});
|
|
@@ -4,15 +4,6 @@ import caseComment from "../../common/sobjects/caseComment.mjs";
|
|
|
4
4
|
|
|
5
5
|
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_casecomment.htm";
|
|
6
6
|
|
|
7
|
-
/* eslint-disable no-unused-vars */
|
|
8
|
-
const {
|
|
9
|
-
useAdvancedProps, ...props
|
|
10
|
-
} = getProps({
|
|
11
|
-
objType: caseComment,
|
|
12
|
-
docsLink,
|
|
13
|
-
});
|
|
14
|
-
/* eslint-enable no-unused-vars */
|
|
15
|
-
|
|
16
7
|
export default {
|
|
17
8
|
...common,
|
|
18
9
|
key: "salesforce_rest_api-create-casecomment",
|
|
@@ -22,28 +13,37 @@ export default {
|
|
|
22
13
|
+ " Comments are visible in the case feed - **List Case Feed Items** shows them as `CaseCommentPost` entries."
|
|
23
14
|
+ " "
|
|
24
15
|
+ `[See the documentation](${docsLink})`,
|
|
25
|
-
version: "0.3.
|
|
16
|
+
version: "0.3.8",
|
|
26
17
|
annotations: {
|
|
27
18
|
destructiveHint: false,
|
|
28
19
|
openWorldHint: true,
|
|
29
20
|
readOnlyHint: false,
|
|
30
21
|
},
|
|
31
22
|
type: "action",
|
|
32
|
-
|
|
23
|
+
methods: {
|
|
24
|
+
...common.methods,
|
|
25
|
+
},
|
|
26
|
+
props: getProps({
|
|
27
|
+
objType: caseComment,
|
|
28
|
+
docsLink,
|
|
29
|
+
}),
|
|
33
30
|
async run({ $ }) {
|
|
34
31
|
/* eslint-disable no-unused-vars */
|
|
35
32
|
const {
|
|
36
33
|
salesforce,
|
|
37
|
-
getAdvancedProps,
|
|
38
34
|
getAdditionalFields,
|
|
39
35
|
formatDateTimeProps,
|
|
40
36
|
docsInfo,
|
|
37
|
+
additionalFields,
|
|
41
38
|
...data
|
|
42
39
|
} = this;
|
|
43
40
|
/* eslint-enable no-unused-vars */
|
|
44
41
|
const response = await salesforce.createRecord("CaseComment", {
|
|
45
42
|
$,
|
|
46
|
-
data
|
|
43
|
+
data: {
|
|
44
|
+
...data,
|
|
45
|
+
...getAdditionalFields(),
|
|
46
|
+
},
|
|
47
47
|
});
|
|
48
48
|
$.export("$summary", `Successfully created case comment for ${this.ParentId}`);
|
|
49
49
|
return response;
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
+ " Use **Describe Object** on `Contact` to discover which fields your org requires."
|
|
14
14
|
+ " "
|
|
15
15
|
+ `[See the documentation](${docsLink})`,
|
|
16
|
-
version: "0.3.
|
|
16
|
+
version: "0.3.8",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
|
@@ -22,31 +22,19 @@ export default {
|
|
|
22
22
|
type: "action",
|
|
23
23
|
methods: {
|
|
24
24
|
...common.methods,
|
|
25
|
-
getObjectType() {
|
|
26
|
-
return "Contact";
|
|
27
|
-
},
|
|
28
|
-
getAdvancedProps() {
|
|
29
|
-
return contact.extraProps;
|
|
30
|
-
},
|
|
31
25
|
},
|
|
32
26
|
props: getProps({
|
|
33
27
|
objType: contact,
|
|
34
28
|
docsLink,
|
|
35
|
-
showDateInfo: true,
|
|
36
29
|
}),
|
|
37
30
|
async run({ $ }) {
|
|
38
31
|
/* eslint-disable no-unused-vars */
|
|
39
32
|
const {
|
|
40
33
|
salesforce,
|
|
41
|
-
getAdvancedProps,
|
|
42
|
-
getObjectType,
|
|
43
34
|
getAdditionalFields,
|
|
44
35
|
formatDateTimeProps,
|
|
45
|
-
useAdvancedProps,
|
|
46
36
|
docsInfo,
|
|
47
|
-
dateInfo,
|
|
48
37
|
additionalFields,
|
|
49
|
-
Birthdate,
|
|
50
38
|
...data
|
|
51
39
|
} = this;
|
|
52
40
|
/* eslint-enable no-unused-vars */
|
|
@@ -54,9 +42,6 @@ export default {
|
|
|
54
42
|
$,
|
|
55
43
|
data: {
|
|
56
44
|
...data,
|
|
57
|
-
...formatDateTimeProps({
|
|
58
|
-
Birthdate,
|
|
59
|
-
}),
|
|
60
45
|
...getAdditionalFields(),
|
|
61
46
|
},
|
|
62
47
|
});
|
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
// x-pd-ai: optimized
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import contentNote from "../../common/sobjects/content-note.mjs";
|
|
5
|
-
import contentDocumentLink from "../../common/sobjects/content-document-link.mjs";
|
|
2
|
+
import common from "../common/base-create-update.mjs";
|
|
3
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
6
4
|
import { NOTE_INFO_PROP } from "../../common/props-info.mjs";
|
|
7
5
|
|
|
8
6
|
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contentnote.htm";
|
|
9
7
|
|
|
10
|
-
const {
|
|
11
|
-
useAdvancedProps: contentNoteUseAdvancedProps,
|
|
12
|
-
...contentNoteProps
|
|
13
|
-
} = getProps({
|
|
14
|
-
objType: contentNote,
|
|
15
|
-
docsLink,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
useAdvancedProps: contentDocumentLinkUseAdvancedProps,
|
|
20
|
-
...contentDocumentLinkProps
|
|
21
|
-
} = getProps({
|
|
22
|
-
objType: contentDocumentLink,
|
|
23
|
-
docsLink,
|
|
24
|
-
showDocsInfo: false,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
8
|
export default {
|
|
28
9
|
...common,
|
|
29
10
|
key: "salesforce_rest_api-create-content-note",
|
|
@@ -35,7 +16,7 @@ export default {
|
|
|
35
16
|
+ "Notes must be enabled in the org first - see [Set Up Notes](https://help.salesforce.com/s/articleView?id=sales.notes_admin_setup.htm&type=5)."
|
|
36
17
|
+ " "
|
|
37
18
|
+ `[See the documentation](${docsLink})`,
|
|
38
|
-
version: "0.0
|
|
19
|
+
version: "1.0.0",
|
|
39
20
|
annotations: {
|
|
40
21
|
destructiveHint: false,
|
|
41
22
|
openWorldHint: true,
|
|
@@ -43,9 +24,32 @@ export default {
|
|
|
43
24
|
},
|
|
44
25
|
type: "action",
|
|
45
26
|
props: {
|
|
27
|
+
salesforce,
|
|
46
28
|
noteInfo: NOTE_INFO_PROP,
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
Title: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Title",
|
|
32
|
+
description: "Title of the content note.",
|
|
33
|
+
},
|
|
34
|
+
Content: {
|
|
35
|
+
type: "string",
|
|
36
|
+
label: "Content",
|
|
37
|
+
description: "Body content of the note, as plain text. Any markup characters (`&`, `<`, `>`, `\"`, `'`) are HTML-escaped, then the result is base64-encoded before send.",
|
|
38
|
+
},
|
|
39
|
+
LinkedEntityId: {
|
|
40
|
+
type: "string",
|
|
41
|
+
label: "Linked Entity ID",
|
|
42
|
+
description:
|
|
43
|
+
"Optional ID of a record to link this note to (Salesforce's 15- or 18-character record ID, e.g. `001XX000003DHP0` for an Account). Use **SOQL Query** to find the ID.",
|
|
44
|
+
optional: true,
|
|
45
|
+
},
|
|
46
|
+
additionalFields: {
|
|
47
|
+
type: "object",
|
|
48
|
+
label: "Additional Fields",
|
|
49
|
+
description:
|
|
50
|
+
"Other ContentNote/ContentDocumentLink fields as name -> value pairs. Use for OwnerId, IsReadOnly, etc. - use **Describe Object** on `ContentNote` to discover other valid field names. `ShareType` (`V`=Viewer, `C`=Collaborator, `I`=Inferred permission; default `I`) and `Visibility` (`AllUsers`, `InternalUsers`, `SharedUsers`) only take effect when `LinkedEntityId` is also set - they're ignored otherwise. Example: `{\"OwnerId\": \"005xxx\", \"ShareType\": \"V\", \"Visibility\": \"AllUsers\"}`.",
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
49
53
|
},
|
|
50
54
|
methods: {
|
|
51
55
|
...common.methods,
|
|
@@ -60,22 +64,28 @@ export default {
|
|
|
60
64
|
},
|
|
61
65
|
async run({ $ }) {
|
|
62
66
|
const {
|
|
63
|
-
salesforce,
|
|
64
|
-
escapeHtml4,
|
|
65
67
|
Title,
|
|
66
68
|
Content,
|
|
67
|
-
OwnerId,
|
|
68
69
|
LinkedEntityId,
|
|
69
|
-
|
|
70
|
-
Visibility,
|
|
70
|
+
additionalFields: af,
|
|
71
71
|
} = this;
|
|
72
72
|
|
|
73
|
-
const
|
|
73
|
+
const {
|
|
74
|
+
OwnerId,
|
|
75
|
+
IsReadOnly,
|
|
76
|
+
ShareType = "I",
|
|
77
|
+
Visibility,
|
|
78
|
+
...otherFields
|
|
79
|
+
} = af ?? {};
|
|
80
|
+
|
|
81
|
+
const contentNoteResponse = await this.salesforce.createRecord("ContentNote", {
|
|
74
82
|
$,
|
|
75
83
|
data: {
|
|
84
|
+
...otherFields,
|
|
76
85
|
Title,
|
|
77
|
-
Content: Buffer.from(escapeHtml4(Content)).toString("base64"),
|
|
78
|
-
OwnerId
|
|
86
|
+
Content: Buffer.from(this.escapeHtml4(Content)).toString("base64"),
|
|
87
|
+
OwnerId,
|
|
88
|
+
IsReadOnly,
|
|
79
89
|
},
|
|
80
90
|
});
|
|
81
91
|
|
|
@@ -86,7 +96,7 @@ export default {
|
|
|
86
96
|
};
|
|
87
97
|
}
|
|
88
98
|
|
|
89
|
-
const contentDocumentLinkResponse = await salesforce.createRecord("ContentDocumentLink", {
|
|
99
|
+
const contentDocumentLinkResponse = await this.salesforce.createRecord("ContentDocumentLink", {
|
|
90
100
|
$,
|
|
91
101
|
data: {
|
|
92
102
|
ContentDocumentId: contentNoteResponse.id,
|
|
@@ -3,7 +3,7 @@ import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
key: "salesforce_rest_api-create-crm-record",
|
|
6
|
-
name: "Create Record",
|
|
6
|
+
name: "Create CRM Record",
|
|
7
7
|
description:
|
|
8
8
|
"Create a new Salesforce record of any object type."
|
|
9
9
|
+ " Use **Describe Object** first if you're unsure what fields are available or required."
|
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
+ " `{\"CampaignId\": \"701xxx\", \"ContactId\": \"003xxx\"}` or `{\"CampaignId\": \"701xxx\", \"LeadId\": \"00Qxxx\"}`."
|
|
23
23
|
+ " "
|
|
24
24
|
+ "[See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm)",
|
|
25
|
-
version: "0.0.
|
|
25
|
+
version: "0.0.3",
|
|
26
26
|
type: "action",
|
|
27
27
|
annotations: {
|
|
28
28
|
readOnlyHint: false,
|
|
@@ -5,6 +5,15 @@ import event from "../../common/sobjects/event.mjs";
|
|
|
5
5
|
const docsLink =
|
|
6
6
|
"https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_event.htm";
|
|
7
7
|
|
|
8
|
+
const {
|
|
9
|
+
additionalFields,
|
|
10
|
+
...baseProps
|
|
11
|
+
} = getProps({
|
|
12
|
+
objType: event,
|
|
13
|
+
docsLink,
|
|
14
|
+
showDateInfo: true,
|
|
15
|
+
});
|
|
16
|
+
|
|
8
17
|
export default {
|
|
9
18
|
...common,
|
|
10
19
|
key: "salesforce_rest_api-create-event",
|
|
@@ -14,7 +23,7 @@ export default {
|
|
|
14
23
|
+ " Use **Find Records** to get the `WhoId` (contact or lead) and `WhatId` (related record) you want to link."
|
|
15
24
|
+ " "
|
|
16
25
|
+ `[See the documentation](${docsLink})`,
|
|
17
|
-
version: "0.
|
|
26
|
+
version: "0.4.0",
|
|
18
27
|
annotations: {
|
|
19
28
|
destructiveHint: false,
|
|
20
29
|
openWorldHint: true,
|
|
@@ -23,36 +32,30 @@ export default {
|
|
|
23
32
|
type: "action",
|
|
24
33
|
methods: {
|
|
25
34
|
...common.methods,
|
|
26
|
-
getObjectType() {
|
|
27
|
-
return "Event";
|
|
28
|
-
},
|
|
29
|
-
getAdvancedProps() {
|
|
30
|
-
return event.extraProps;
|
|
31
|
-
},
|
|
32
35
|
},
|
|
33
|
-
props:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
props: {
|
|
37
|
+
...baseProps,
|
|
38
|
+
Subject: event.extraProps.Subject,
|
|
39
|
+
StartDateTime: event.extraProps.StartDateTime,
|
|
40
|
+
RecurrenceStartDateTime: event.extraProps.RecurrenceStartDateTime,
|
|
41
|
+
RecurrenceEndDateOnly: event.extraProps.RecurrenceEndDateOnly,
|
|
42
|
+
RecurrenceDayOfWeekMask: event.extraProps.RecurrenceDayOfWeekMask,
|
|
43
|
+
additionalFields,
|
|
44
|
+
},
|
|
38
45
|
async run({ $ }) {
|
|
39
46
|
/* eslint-disable no-unused-vars */
|
|
40
47
|
const {
|
|
41
48
|
salesforce,
|
|
42
|
-
getAdvancedProps,
|
|
43
|
-
getObjectType,
|
|
44
49
|
getAdditionalFields,
|
|
45
50
|
formatDateTimeProps,
|
|
46
|
-
useAdvancedProps,
|
|
47
51
|
docsInfo,
|
|
48
52
|
dateInfo,
|
|
49
53
|
additionalFields,
|
|
50
54
|
ActivityDate,
|
|
51
55
|
EndDateTime,
|
|
52
|
-
RecurrenceEndDateOnly,
|
|
53
|
-
RecurrenceStartDateTime,
|
|
54
|
-
ReminderDateTime,
|
|
55
56
|
StartDateTime,
|
|
57
|
+
RecurrenceStartDateTime,
|
|
58
|
+
RecurrenceEndDateOnly,
|
|
56
59
|
RecurrenceDayOfWeekMask,
|
|
57
60
|
...data
|
|
58
61
|
} = this;
|
|
@@ -64,18 +67,17 @@ export default {
|
|
|
64
67
|
...formatDateTimeProps({
|
|
65
68
|
ActivityDate,
|
|
66
69
|
EndDateTime,
|
|
67
|
-
RecurrenceEndDateOnly,
|
|
68
|
-
RecurrenceStartDateTime,
|
|
69
|
-
ReminderDateTime,
|
|
70
70
|
StartDateTime,
|
|
71
|
+
RecurrenceStartDateTime,
|
|
72
|
+
RecurrenceEndDateOnly,
|
|
73
|
+
}),
|
|
74
|
+
...(RecurrenceDayOfWeekMask?.length && {
|
|
75
|
+
RecurrenceDayOfWeekMask: RecurrenceDayOfWeekMask.reduce((mask, day) => mask | day, 0),
|
|
71
76
|
}),
|
|
72
|
-
RecurrenceDayOfWeekMask: RecurrenceDayOfWeekMask?.reduce?.((acc, val) => acc + val, 0),
|
|
73
77
|
...getAdditionalFields(),
|
|
74
78
|
},
|
|
75
79
|
});
|
|
76
|
-
$.export("$summary",
|
|
77
|
-
? ` "${this.Subject}"`
|
|
78
|
-
: ""}`);
|
|
80
|
+
$.export("$summary", "Successfully created event");
|
|
79
81
|
return response;
|
|
80
82
|
},
|
|
81
83
|
};
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
+ " Use **Add Lead to Campaign** afterwards to attribute the lead to a campaign."
|
|
14
14
|
+ " "
|
|
15
15
|
+ `[See the documentation](${docsLink})`,
|
|
16
|
-
version: "0.
|
|
16
|
+
version: "0.4.0",
|
|
17
17
|
annotations: {
|
|
18
18
|
destructiveHint: false,
|
|
19
19
|
openWorldHint: true,
|
|
@@ -22,12 +22,6 @@ export default {
|
|
|
22
22
|
type: "action",
|
|
23
23
|
methods: {
|
|
24
24
|
...common.methods,
|
|
25
|
-
getObjectType() {
|
|
26
|
-
return "Lead";
|
|
27
|
-
},
|
|
28
|
-
getAdvancedProps() {
|
|
29
|
-
return lead.extraProps;
|
|
30
|
-
},
|
|
31
25
|
},
|
|
32
26
|
props: getProps({
|
|
33
27
|
objType: lead,
|
|
@@ -37,13 +31,9 @@ export default {
|
|
|
37
31
|
/* eslint-disable no-unused-vars */
|
|
38
32
|
const {
|
|
39
33
|
salesforce,
|
|
40
|
-
getAdvancedProps,
|
|
41
|
-
getObjectType,
|
|
42
34
|
getAdditionalFields,
|
|
43
35
|
formatDateTimeProps,
|
|
44
|
-
useAdvancedProps,
|
|
45
36
|
docsInfo,
|
|
46
|
-
dateInfo,
|
|
47
37
|
additionalFields,
|
|
48
38
|
...data
|
|
49
39
|
} = this;
|