@pipedream/salesforce_rest_api 1.2.0 → 1.3.0
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/README.md +92 -0
- package/actions/add-contact-to-campaign/add-contact-to-campaign.mjs +25 -25
- package/actions/add-lead-to-campaign/add-lead-to-campaign.mjs +25 -24
- package/actions/common/base-create-update.mjs +108 -0
- package/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs +11 -3
- package/actions/create-account/create-account.mjs +33 -36
- package/actions/create-attachment/create-attachment.mjs +36 -50
- package/actions/create-campaign/create-campaign.mjs +41 -37
- package/actions/create-case/create-case.mjs +41 -37
- package/actions/create-casecomment/create-casecomment.mjs +26 -38
- package/actions/create-contact/create-contact.mjs +38 -35
- package/actions/create-event/create-event.mjs +57 -66
- package/actions/create-lead/create-lead.mjs +34 -42
- package/actions/create-note/create-note.mjs +24 -43
- package/actions/create-opportunity/create-opportunity.mjs +38 -47
- package/actions/create-record/create-record.mjs +49 -15
- package/actions/create-task/create-task.mjs +50 -42
- package/actions/create-user/create-user.mjs +33 -196
- package/actions/delete-opportunity/delete-opportunity.mjs +17 -13
- package/actions/delete-record/delete-record.mjs +18 -16
- package/actions/find-records/find-records.mjs +41 -26
- package/actions/insert-blob-data/insert-blob-data.mjs +3 -7
- package/actions/post-feed-to-chatter/post-feed-to-chatter.mjs +45 -20
- package/actions/search-string/search-string.mjs +22 -20
- package/actions/soql-search/soql-search.mjs +13 -8
- package/actions/sosl-search/sosl-search.mjs +19 -9
- package/actions/update-account/update-account.mjs +54 -41
- package/actions/update-contact/update-contact.mjs +59 -40
- package/actions/update-opportunity/update-opportunity.mjs +56 -54
- package/actions/update-record/update-record.mjs +67 -20
- package/common/all-sobjects.mjs +3812 -0
- package/common/constants-props.mjs +1539 -0
- package/common/props-async-options.mjs +154 -0
- package/common/props-utils.mjs +88 -31
- package/common/sobjects/account.mjs +349 -22
- package/common/sobjects/attachment.mjs +56 -17
- package/common/sobjects/campaign.mjs +125 -23
- package/common/sobjects/case.mjs +193 -13
- package/common/sobjects/caseComment.mjs +28 -4
- package/common/sobjects/contact.mjs +207 -43
- package/common/sobjects/event.mjs +218 -18
- package/common/sobjects/lead.mjs +245 -22
- package/common/sobjects/note.mjs +37 -14
- package/common/sobjects/opportunity.mjs +148 -22
- package/common/sobjects/task.mjs +240 -19
- package/common/sobjects/user.mjs +965 -0
- package/package.json +2 -2
- package/salesforce_rest_api.app.mjs +77 -254
- package/sources/common-webhook-methods.mjs +71 -0
- package/sources/common.mjs +85 -22
- package/sources/new-outbound-message/new-outbound-message.mjs +11 -3
- package/sources/new-record-instant/new-record-instant.mjs +77 -6
- package/sources/record-deleted-instant/record-deleted-instant.mjs +40 -5
- package/sources/record-updated-instant/record-updated-instant.mjs +168 -0
- package/actions/common/base.mjs +0 -18
- package/actions/find-create-record/find-create-record.mjs +0 -89
- package/actions/get-sobject-fields-values/get-sobject-fields-values.mjs +0 -57
- package/common/utils.mjs +0 -51
- package/sources/common-instant.mjs +0 -146
- package/sources/new-record/new-record.mjs +0 -91
- package/sources/object-updated/object-updated.mjs +0 -94
- package/sources/object-updated-instant/object-updated-instant.mjs +0 -36
- package/sources/record-deleted/record-deleted.mjs +0 -51
- package/sources/updated-field-on-record/updated-field-on-record.mjs +0 -161
- package/sources/updated-field-on-record-instant/updated-field-on-record-instant.mjs +0 -76
|
@@ -1,54 +1,58 @@
|
|
|
1
|
-
import common from "../common/base.mjs";
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
2
|
import campaign from "../../common/sobjects/campaign.mjs";
|
|
3
|
-
import {
|
|
4
|
-
pickBy, pick,
|
|
5
|
-
} from "lodash-es";
|
|
6
|
-
import { toSingleLineString } from "../../common/utils.mjs";
|
|
7
3
|
|
|
8
|
-
const
|
|
4
|
+
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaign.htm";
|
|
9
5
|
|
|
10
6
|
export default {
|
|
11
7
|
...common,
|
|
12
8
|
key: "salesforce_rest_api-create-campaign",
|
|
13
9
|
name: "Create Campaign",
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
See [Campaign SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaign.htm)
|
|
17
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
18
|
-
`),
|
|
19
|
-
version: "0.2.7",
|
|
10
|
+
description: `Creates a marketing campaign. [See the documentation](${docsLink})`,
|
|
11
|
+
version: "0.3.0",
|
|
20
12
|
type: "action",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
label: "Name",
|
|
26
|
-
description: "Required. Name of the campaign. Limit: is 80 characters.",
|
|
13
|
+
methods: {
|
|
14
|
+
...common.methods,
|
|
15
|
+
getObjectType() {
|
|
16
|
+
return "Campaign";
|
|
27
17
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
salesforce,
|
|
31
|
-
"fieldSelector",
|
|
32
|
-
],
|
|
33
|
-
description: `${salesforce.propDefinitions.fieldSelector.description} Campaign`,
|
|
34
|
-
options: () => Object.keys(campaign),
|
|
35
|
-
reloadProps: true,
|
|
36
|
-
optional: true,
|
|
18
|
+
getAdvancedProps() {
|
|
19
|
+
return campaign.extraProps;
|
|
37
20
|
},
|
|
38
21
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
props: getProps({
|
|
23
|
+
objType: campaign,
|
|
24
|
+
docsLink,
|
|
25
|
+
showDateInfo: true,
|
|
26
|
+
}),
|
|
42
27
|
async run({ $ }) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
/* eslint-disable no-unused-vars, max-len */
|
|
29
|
+
const {
|
|
30
|
+
salesforce,
|
|
31
|
+
getAdvancedProps,
|
|
32
|
+
getObjectType,
|
|
33
|
+
getAdditionalFields,
|
|
34
|
+
formatDateTimeProps,
|
|
35
|
+
useAdvancedProps,
|
|
36
|
+
docsInfo,
|
|
37
|
+
dateInfo,
|
|
38
|
+
additionalFields,
|
|
39
|
+
StartDate,
|
|
40
|
+
EndDate,
|
|
41
|
+
...data
|
|
42
|
+
} = this;
|
|
43
|
+
/* eslint-enable no-unused-vars, max-len */
|
|
44
|
+
const response = await salesforce.createRecord("Campaign", {
|
|
48
45
|
$,
|
|
49
|
-
data
|
|
46
|
+
data: {
|
|
47
|
+
...data,
|
|
48
|
+
...formatDateTimeProps({
|
|
49
|
+
StartDate,
|
|
50
|
+
EndDate,
|
|
51
|
+
}),
|
|
52
|
+
...getAdditionalFields(),
|
|
53
|
+
},
|
|
50
54
|
});
|
|
51
|
-
$.export("$summary", `
|
|
55
|
+
$.export("$summary", `Successfully created campaign "${this.Name}"`);
|
|
52
56
|
return response;
|
|
53
57
|
},
|
|
54
58
|
};
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import common from "../common/base.mjs";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
pickBy, pick,
|
|
5
|
-
} from "lodash-es";
|
|
6
|
-
import { toSingleLineString } from "../../common/utils.mjs";
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
|
+
import caseObj from "../../common/sobjects/case.mjs";
|
|
7
3
|
|
|
8
|
-
const
|
|
4
|
+
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_case.htm";
|
|
9
5
|
|
|
10
6
|
export default {
|
|
11
7
|
...common,
|
|
12
8
|
key: "salesforce_rest_api-create-case",
|
|
13
9
|
name: "Create Case",
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
See [Case SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_case.htm)
|
|
17
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
18
|
-
`),
|
|
19
|
-
version: "0.2.7",
|
|
10
|
+
description: `Creates a Case, which represents a customer issue or problem. [See the documentation](${docsLink})`,
|
|
11
|
+
version: "0.3.0",
|
|
20
12
|
type: "action",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
label: "Supplied email",
|
|
26
|
-
description: "The email address that was entered when the case was created. Label is Email.If your organization has an active auto-response rule, SuppliedEmail is required when creating a case via the API. Auto-response rules use the email in the contact specified by ContactId. If no email address is in the contact record, the email specified here is used.",
|
|
13
|
+
methods: {
|
|
14
|
+
...common.methods,
|
|
15
|
+
getObjectType() {
|
|
16
|
+
return "Case";
|
|
27
17
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
salesforce,
|
|
31
|
-
"fieldSelector",
|
|
32
|
-
],
|
|
33
|
-
description: `${salesforce.propDefinitions.fieldSelector.description} Case`,
|
|
34
|
-
options: () => Object.keys(salesforceCase),
|
|
35
|
-
reloadProps: true,
|
|
18
|
+
getAdvancedProps() {
|
|
19
|
+
return caseObj.extraProps;
|
|
36
20
|
},
|
|
37
21
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
props: getProps({
|
|
23
|
+
objType: caseObj,
|
|
24
|
+
docsLink,
|
|
25
|
+
showDateInfo: true,
|
|
26
|
+
}),
|
|
41
27
|
async run({ $ }) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
/* eslint-disable no-unused-vars */
|
|
29
|
+
const {
|
|
30
|
+
salesforce,
|
|
31
|
+
getAdvancedProps,
|
|
32
|
+
getObjectType,
|
|
33
|
+
getAdditionalFields,
|
|
34
|
+
formatDateTimeProps,
|
|
35
|
+
useAdvancedProps,
|
|
36
|
+
docsInfo,
|
|
37
|
+
dateInfo,
|
|
38
|
+
additionalFields,
|
|
39
|
+
SlaStartDate,
|
|
40
|
+
...data
|
|
41
|
+
} = this;
|
|
42
|
+
/* eslint-enable no-unused-vars */
|
|
43
|
+
const response = await salesforce.createRecord("Case", {
|
|
47
44
|
$,
|
|
48
|
-
data
|
|
45
|
+
data: {
|
|
46
|
+
...data,
|
|
47
|
+
...formatDateTimeProps({
|
|
48
|
+
SlaStartDate,
|
|
49
|
+
}),
|
|
50
|
+
...getAdditionalFields(),
|
|
51
|
+
},
|
|
49
52
|
});
|
|
50
|
-
|
|
53
|
+
const summary = (this.SuppliedName && ` "${this.SuppliedName}"`) ?? (this.SuppliedEmail && ` with email ${this.SuppliedEmail}`) ?? "";
|
|
54
|
+
$.export("$summary", `Successfully created case${summary}`);
|
|
51
55
|
return response;
|
|
52
56
|
},
|
|
53
57
|
};
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
import common from "../common/base.mjs";
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
2
|
import caseComment from "../../common/sobjects/caseComment.mjs";
|
|
3
|
-
import {
|
|
4
|
-
pickBy, pick,
|
|
5
|
-
} from "lodash-es";
|
|
6
|
-
import { toSingleLineString } from "../../common/utils.mjs";
|
|
7
3
|
|
|
8
|
-
const
|
|
4
|
+
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_casecomment.htm";
|
|
5
|
+
|
|
6
|
+
/* eslint-disable no-unused-vars */
|
|
7
|
+
const {
|
|
8
|
+
useAdvancedProps, ...props
|
|
9
|
+
} = getProps({
|
|
10
|
+
objType: caseComment,
|
|
11
|
+
docsLink,
|
|
12
|
+
});
|
|
13
|
+
/* eslint-enable no-unused-vars */
|
|
9
14
|
|
|
10
15
|
export default {
|
|
11
16
|
...common,
|
|
12
17
|
key: "salesforce_rest_api-create-casecomment",
|
|
13
|
-
name: "Create
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
See [CaseComment SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_casecomment.htm)
|
|
17
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
18
|
-
`),
|
|
19
|
-
version: "0.2.7",
|
|
18
|
+
name: "Create Case Comment",
|
|
19
|
+
description: `Creates a Case Comment on a selected Case. [See the documentation](${docsLink})`,
|
|
20
|
+
version: "0.3.0",
|
|
20
21
|
type: "action",
|
|
21
|
-
props
|
|
22
|
-
salesforce,
|
|
23
|
-
ParentId: {
|
|
24
|
-
type: "string",
|
|
25
|
-
label: "Parent ID",
|
|
26
|
-
description: "Required. ID of the parent Case of the CaseComment.",
|
|
27
|
-
},
|
|
28
|
-
selector: {
|
|
29
|
-
propDefinition: [
|
|
30
|
-
salesforce,
|
|
31
|
-
"fieldSelector",
|
|
32
|
-
],
|
|
33
|
-
description: `${salesforce.propDefinitions.fieldSelector.description} CaseComment`,
|
|
34
|
-
options: () => Object.keys(caseComment),
|
|
35
|
-
reloadProps: true,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
additionalProps() {
|
|
39
|
-
return this.additionalProps(this.selector, caseComment);
|
|
40
|
-
},
|
|
22
|
+
props,
|
|
41
23
|
async run({ $ }) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
24
|
+
/* eslint-disable no-unused-vars */
|
|
25
|
+
const {
|
|
26
|
+
salesforce,
|
|
27
|
+
getAdvancedProps,
|
|
28
|
+
getAdditionalFields,
|
|
29
|
+
formatDateTimeProps,
|
|
30
|
+
docsInfo,
|
|
31
|
+
...data
|
|
32
|
+
} = this;
|
|
33
|
+
/* eslint-enable no-unused-vars */
|
|
34
|
+
const response = await salesforce.createRecord("CaseComment", {
|
|
47
35
|
$,
|
|
48
36
|
data,
|
|
49
37
|
});
|
|
@@ -1,51 +1,54 @@
|
|
|
1
|
-
import common from "../common/base.mjs";
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
2
|
import contact from "../../common/sobjects/contact.mjs";
|
|
3
|
-
import {
|
|
4
|
-
pickBy, pick,
|
|
5
|
-
} from "lodash-es";
|
|
6
|
-
import { toSingleLineString } from "../../common/utils.mjs";
|
|
7
3
|
|
|
8
|
-
const
|
|
4
|
+
export const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contact.htm";
|
|
9
5
|
|
|
10
6
|
export default {
|
|
11
7
|
...common,
|
|
12
8
|
key: "salesforce_rest_api-create-contact",
|
|
13
9
|
name: "Create Contact",
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
See [Contact SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_contact.htm)
|
|
17
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
18
|
-
`),
|
|
19
|
-
version: "0.2.7",
|
|
10
|
+
description: `Creates a contact. [See the documentation](${docsLink})`,
|
|
11
|
+
version: "0.3.0",
|
|
20
12
|
type: "action",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
label: "Last name",
|
|
26
|
-
description: "Last name of the contact up to 80 characters.",
|
|
13
|
+
methods: {
|
|
14
|
+
...common.methods,
|
|
15
|
+
getObjectType() {
|
|
16
|
+
return "Contact";
|
|
27
17
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
salesforce,
|
|
31
|
-
"fieldSelector",
|
|
32
|
-
],
|
|
33
|
-
description: `${salesforce.propDefinitions.fieldSelector.description} Contact`,
|
|
34
|
-
options: () => Object.keys(contact),
|
|
35
|
-
reloadProps: true,
|
|
18
|
+
getAdvancedProps() {
|
|
19
|
+
return contact.extraProps;
|
|
36
20
|
},
|
|
37
21
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
props: getProps({
|
|
23
|
+
objType: contact,
|
|
24
|
+
docsLink,
|
|
25
|
+
showDateInfo: true,
|
|
26
|
+
}),
|
|
41
27
|
async run({ $ }) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
/* eslint-disable no-unused-vars */
|
|
29
|
+
const {
|
|
30
|
+
salesforce,
|
|
31
|
+
getAdvancedProps,
|
|
32
|
+
getObjectType,
|
|
33
|
+
getAdditionalFields,
|
|
34
|
+
formatDateTimeProps,
|
|
35
|
+
useAdvancedProps,
|
|
36
|
+
docsInfo,
|
|
37
|
+
dateInfo,
|
|
38
|
+
additionalFields,
|
|
39
|
+
Birthdate,
|
|
40
|
+
...data
|
|
41
|
+
} = this;
|
|
42
|
+
/* eslint-enable no-unused-vars */
|
|
43
|
+
const response = await salesforce.createRecord("Contact", {
|
|
47
44
|
$,
|
|
48
|
-
data
|
|
45
|
+
data: {
|
|
46
|
+
...data,
|
|
47
|
+
...formatDateTimeProps({
|
|
48
|
+
Birthdate,
|
|
49
|
+
}),
|
|
50
|
+
...getAdditionalFields(),
|
|
51
|
+
},
|
|
49
52
|
});
|
|
50
53
|
$.export("$summary", `Successfully created contact "${this.LastName}"`);
|
|
51
54
|
return response;
|
|
@@ -1,80 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
|
+
import event from "../../common/sobjects/event.mjs";
|
|
3
|
+
|
|
4
|
+
const docsLink =
|
|
5
|
+
"https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_event.htm";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
8
|
+
...common,
|
|
7
9
|
key: "salesforce_rest_api-create-event",
|
|
8
10
|
name: "Create Event",
|
|
9
|
-
description:
|
|
10
|
-
|
|
11
|
-
See [Event SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_event.htm)
|
|
12
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
13
|
-
`),
|
|
14
|
-
version: "0.2.7",
|
|
11
|
+
description: `Creates an event. [See the documentation](${docsLink})`,
|
|
12
|
+
version: "0.3.0",
|
|
15
13
|
type: "action",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
label: "All-Day Event",
|
|
21
|
-
description: "Indicates whether the ActivityDate field (true) or the ActivityDateTime field (false) is used to define the date or time of the event.",
|
|
22
|
-
reloadProps: true,
|
|
23
|
-
},
|
|
24
|
-
AcceptedEventInviteeIds: {
|
|
25
|
-
propDefinition: [
|
|
26
|
-
salesforce,
|
|
27
|
-
"AcceptedEventInviteeIds",
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
Description: {
|
|
31
|
-
type: "string",
|
|
32
|
-
label: "Description",
|
|
33
|
-
description: "Contains a text description of the event. Limit: 32,000 characters.",
|
|
14
|
+
methods: {
|
|
15
|
+
...common.methods,
|
|
16
|
+
getObjectType() {
|
|
17
|
+
return "Event";
|
|
34
18
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label: "Subject",
|
|
38
|
-
description: "The subject line of the event, such as Call, Email, or Meeting. Limit: 255 characters.",
|
|
19
|
+
getAdvancedProps() {
|
|
20
|
+
return event.extraProps;
|
|
39
21
|
},
|
|
40
22
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
label: "Due Date Only (YYYY/MM/DD)",
|
|
47
|
-
description: "Contains the event's due date if the IsAllDayEvent flag is set to true.",
|
|
48
|
-
};
|
|
49
|
-
} else {
|
|
50
|
-
props.ActivityDateTime = {
|
|
51
|
-
type: "string",
|
|
52
|
-
label: "Due Date Time",
|
|
53
|
-
description: "Contains the event's due date if the IsAllDayEvent flag is set to false. The time portion of this field is always transferred in the Coordinated Universal Time (UTC) time zone. Translate the time portion to or from a local time zone for the user or the application, as appropriate.",
|
|
54
|
-
};
|
|
55
|
-
props.DurationInMinutes = {
|
|
56
|
-
type: "integer",
|
|
57
|
-
label: "Duration in minutes",
|
|
58
|
-
description: "Contains the event length, in minutes.",
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return props;
|
|
62
|
-
},
|
|
23
|
+
props: getProps({
|
|
24
|
+
objType: event,
|
|
25
|
+
docsLink,
|
|
26
|
+
showDateInfo: true,
|
|
27
|
+
}),
|
|
63
28
|
async run({ $ }) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
29
|
+
/* eslint-disable no-unused-vars */
|
|
30
|
+
const {
|
|
31
|
+
salesforce,
|
|
32
|
+
getAdvancedProps,
|
|
33
|
+
getObjectType,
|
|
34
|
+
getAdditionalFields,
|
|
35
|
+
formatDateTimeProps,
|
|
36
|
+
useAdvancedProps,
|
|
37
|
+
docsInfo,
|
|
38
|
+
dateInfo,
|
|
39
|
+
additionalFields,
|
|
40
|
+
ActivityDate,
|
|
41
|
+
EndDateTime,
|
|
42
|
+
RecurrenceEndDateOnly,
|
|
43
|
+
RecurrenceStartDateTime,
|
|
44
|
+
ReminderDateTime,
|
|
45
|
+
StartDateTime,
|
|
46
|
+
RecurrenceDayOfWeekMask,
|
|
47
|
+
...data
|
|
48
|
+
} = this;
|
|
49
|
+
/* eslint-enable no-unused-vars */
|
|
50
|
+
const response = await salesforce.createRecord("Event", {
|
|
74
51
|
$,
|
|
75
|
-
data
|
|
52
|
+
data: {
|
|
53
|
+
...data,
|
|
54
|
+
...formatDateTimeProps({
|
|
55
|
+
ActivityDate,
|
|
56
|
+
EndDateTime,
|
|
57
|
+
RecurrenceEndDateOnly,
|
|
58
|
+
RecurrenceStartDateTime,
|
|
59
|
+
ReminderDateTime,
|
|
60
|
+
StartDateTime,
|
|
61
|
+
}),
|
|
62
|
+
RecurrenceDayOfWeekMask: RecurrenceDayOfWeekMask?.reduce?.((acc, val) => acc + val, 0),
|
|
63
|
+
...getAdditionalFields(),
|
|
64
|
+
},
|
|
76
65
|
});
|
|
77
|
-
$.export("$summary",
|
|
66
|
+
$.export("$summary", `Succcessfully created event${this.Subject
|
|
67
|
+
? ` "${this.Subject}"`
|
|
68
|
+
: ""}`);
|
|
78
69
|
return response;
|
|
79
70
|
},
|
|
80
71
|
};
|
|
@@ -1,59 +1,51 @@
|
|
|
1
|
-
import common from "../common/base.mjs";
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
2
|
import lead from "../../common/sobjects/lead.mjs";
|
|
3
|
-
import {
|
|
4
|
-
pickBy, pick,
|
|
5
|
-
} from "lodash-es";
|
|
6
|
-
import { toSingleLineString } from "../../common/utils.mjs";
|
|
7
3
|
|
|
8
|
-
const
|
|
4
|
+
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm";
|
|
9
5
|
|
|
10
6
|
export default {
|
|
11
7
|
...common,
|
|
12
8
|
key: "salesforce_rest_api-create-lead",
|
|
13
9
|
name: "Create Lead",
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
See [Lead SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_lead.htm)
|
|
17
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
18
|
-
`),
|
|
19
|
-
version: "0.2.7",
|
|
10
|
+
description: `Creates a lead. [See the documentation](${docsLink})`,
|
|
11
|
+
version: "0.3.0",
|
|
20
12
|
type: "action",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
label: "Company",
|
|
26
|
-
description: "The lead's company. Note If person account record types have been enabled, and if the value of Company is null, the lead converts to a person account.",
|
|
13
|
+
methods: {
|
|
14
|
+
...common.methods,
|
|
15
|
+
getObjectType() {
|
|
16
|
+
return "Lead";
|
|
27
17
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
label: "Last name",
|
|
31
|
-
description: "Required. Last name of the lead up to 80 characters.",
|
|
18
|
+
getAdvancedProps() {
|
|
19
|
+
return lead.extraProps;
|
|
32
20
|
},
|
|
33
|
-
selector: {
|
|
34
|
-
propDefinition: [
|
|
35
|
-
salesforce,
|
|
36
|
-
"fieldSelector",
|
|
37
|
-
],
|
|
38
|
-
description: `${salesforce.propDefinitions.fieldSelector.description} Lead`,
|
|
39
|
-
options: () => Object.keys(lead),
|
|
40
|
-
reloadProps: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
additionalProps() {
|
|
44
|
-
return this.additionalProps(this.selector, lead);
|
|
45
21
|
},
|
|
22
|
+
props: getProps({
|
|
23
|
+
objType: lead,
|
|
24
|
+
docsLink,
|
|
25
|
+
}),
|
|
46
26
|
async run({ $ }) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
27
|
+
/* eslint-disable no-unused-vars */
|
|
28
|
+
const {
|
|
29
|
+
salesforce,
|
|
30
|
+
getAdvancedProps,
|
|
31
|
+
getObjectType,
|
|
32
|
+
getAdditionalFields,
|
|
33
|
+
formatDateTimeProps,
|
|
34
|
+
useAdvancedProps,
|
|
35
|
+
docsInfo,
|
|
36
|
+
dateInfo,
|
|
37
|
+
additionalFields,
|
|
38
|
+
...data
|
|
39
|
+
} = this;
|
|
40
|
+
/* eslint-enable no-unused-vars */
|
|
41
|
+
const response = await salesforce.createRecord("Lead", {
|
|
53
42
|
$,
|
|
54
|
-
data
|
|
43
|
+
data: {
|
|
44
|
+
...data,
|
|
45
|
+
...getAdditionalFields(),
|
|
46
|
+
},
|
|
55
47
|
});
|
|
56
|
-
$.export("$summary", `Successfully created lead
|
|
48
|
+
$.export("$summary", `Successfully created lead "${this.LastName}"`);
|
|
57
49
|
return response;
|
|
58
50
|
},
|
|
59
51
|
};
|
|
@@ -1,55 +1,36 @@
|
|
|
1
|
-
import common from "../common/base.mjs";
|
|
1
|
+
import common, { getProps } from "../common/base-create-update.mjs";
|
|
2
2
|
import note from "../../common/sobjects/note.mjs";
|
|
3
|
-
import {
|
|
4
|
-
pickBy, pick,
|
|
5
|
-
} from "lodash-es";
|
|
6
|
-
import { toSingleLineString } from "../../common/utils.mjs";
|
|
7
3
|
|
|
8
|
-
const
|
|
4
|
+
const docsLink = "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_note.htm";
|
|
5
|
+
|
|
6
|
+
/* eslint-disable no-unused-vars */
|
|
7
|
+
const {
|
|
8
|
+
useAdvancedProps, ...props
|
|
9
|
+
} = getProps({
|
|
10
|
+
objType: note,
|
|
11
|
+
docsLink,
|
|
12
|
+
});
|
|
13
|
+
/* eslint-enable no-unused-vars */
|
|
9
14
|
|
|
10
15
|
export default {
|
|
11
16
|
...common,
|
|
12
17
|
key: "salesforce_rest_api-create-note",
|
|
13
18
|
name: "Create Note",
|
|
14
|
-
description:
|
|
15
|
-
|
|
16
|
-
See [Note SObject](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_note.htm)
|
|
17
|
-
and [Create Record](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_create.htm)
|
|
18
|
-
`),
|
|
19
|
-
version: "0.2.7",
|
|
19
|
+
description: `Creates a note. [See the documentation](${docsLink})`,
|
|
20
|
+
version: "0.3.0",
|
|
20
21
|
type: "action",
|
|
21
|
-
props
|
|
22
|
-
salesforce,
|
|
23
|
-
ParentId: {
|
|
24
|
-
type: "string",
|
|
25
|
-
label: "Parent ID",
|
|
26
|
-
description: "ID of the object associated with the note.",
|
|
27
|
-
},
|
|
28
|
-
Title: {
|
|
29
|
-
type: "string",
|
|
30
|
-
label: "Title",
|
|
31
|
-
description: "Title of the note.",
|
|
32
|
-
},
|
|
33
|
-
selector: {
|
|
34
|
-
propDefinition: [
|
|
35
|
-
salesforce,
|
|
36
|
-
"fieldSelector",
|
|
37
|
-
],
|
|
38
|
-
description: `${salesforce.propDefinitions.fieldSelector.description} Note`,
|
|
39
|
-
options: () => Object.keys(note),
|
|
40
|
-
reloadProps: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
additionalProps() {
|
|
44
|
-
return this.additionalProps(this.selector, note);
|
|
45
|
-
},
|
|
22
|
+
props,
|
|
46
23
|
async run({ $ }) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
24
|
+
/* eslint-disable no-unused-vars */
|
|
25
|
+
const {
|
|
26
|
+
salesforce,
|
|
27
|
+
getAdvancedProps,
|
|
28
|
+
getAdditionalFields,
|
|
29
|
+
formatDateTimeProps,
|
|
30
|
+
docsInfo, ...data
|
|
31
|
+
} = this;
|
|
32
|
+
/* eslint-enable no-unused-vars */
|
|
33
|
+
const response = await salesforce.createRecord("Note", {
|
|
53
34
|
$,
|
|
54
35
|
data,
|
|
55
36
|
});
|