@pipedream/salesforce_rest_api 1.6.1 → 1.8.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/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/batch-operation.mjs +86 -0
- package/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs +1 -1
- package/actions/create-account/create-account.mjs +1 -1
- package/actions/create-accounts-batch/create-accounts-batch.mjs +22 -0
- package/actions/create-attachment/create-attachment.mjs +1 -1
- package/actions/create-campaign/create-campaign.mjs +1 -1
- package/actions/create-case/create-case.mjs +1 -1
- package/actions/create-casecomment/create-casecomment.mjs +1 -1
- package/actions/create-contact/create-contact.mjs +1 -1
- package/actions/create-content-note/create-content-note.mjs +1 -1
- package/actions/create-event/create-event.mjs +1 -1
- package/actions/create-lead/create-lead.mjs +1 -1
- package/actions/create-note/create-note.mjs +1 -1
- package/actions/create-opportunities-batch/create-opportunities-batch.mjs +22 -0
- package/actions/create-opportunity/create-opportunity.mjs +1 -1
- package/actions/create-record/create-record.mjs +1 -1
- package/actions/create-task/create-task.mjs +1 -1
- package/actions/create-user/create-user.mjs +1 -1
- package/actions/delete-opportunity/delete-opportunity.mjs +1 -1
- package/actions/delete-record/delete-record.mjs +1 -1
- package/actions/find-records/find-records.mjs +1 -1
- package/actions/get-case/get-case.mjs +36 -0
- package/actions/get-user/get-user.mjs +34 -0
- package/actions/insert-blob-data/insert-blob-data.mjs +1 -1
- package/actions/list-case-comments/list-case-comments.mjs +32 -0
- package/actions/list-email-messages/list-email-messages.mjs +38 -0
- package/actions/list-email-templates/list-email-templates.mjs +23 -0
- package/actions/list-knowledge-articles/list-knowledge-articles.mjs +23 -0
- 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 +60 -0
- package/actions/soql-search/soql-search.mjs +1 -1
- package/actions/sosl-search/sosl-search.mjs +1 -1
- package/actions/update-account/update-account.mjs +1 -1
- package/actions/update-accounts-batch/update-accounts-batch.mjs +22 -0
- package/actions/update-contact/update-contact.mjs +1 -1
- package/actions/update-email-template/update-email-template.mjs +81 -0
- package/actions/update-opportunities-batch/update-opportunities-batch.mjs +22 -0
- package/actions/update-opportunity/update-opportunity.mjs +1 -1
- package/actions/update-record/update-record.mjs +1 -1
- package/actions/upsert-record/upsert-record.mjs +1 -1
- package/package.json +1 -1
- package/salesforce_rest_api.app.mjs +43 -0
- package/sources/case-updated-instant/case-updated-instant.mjs +43 -0
- package/sources/common/common-new-record.mjs +157 -0
- package/sources/common/common-updated-record.mjs +198 -0
- package/sources/{common.mjs → common/common.mjs} +2 -2
- package/sources/email-template-updated-instant/email-template-updated-instant.mjs +43 -0
- package/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs +43 -0
- package/sources/new-case-instant/new-case-instant.mjs +43 -0
- package/sources/new-email-template-instant/new-email-template-instant.mjs +43 -0
- package/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs +43 -0
- package/sources/new-outbound-message/new-outbound-message.mjs +1 -1
- package/sources/new-record-instant/new-record-instant.mjs +4 -118
- package/sources/record-deleted-instant/record-deleted-instant.mjs +2 -2
- package/sources/record-updated-instant/record-updated-instant.mjs +4 -138
- /package/sources/{common-webhook-methods.mjs → common/common-webhook-methods.mjs} +0 -0
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "salesforce_rest_api-add-contact-to-campaign",
|
|
6
6
|
name: "Add Contact to Campaign",
|
|
7
7
|
description: "Adds an existing contact to an existing campaign. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaignmember.htm)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "salesforce_rest_api-add-lead-to-campaign",
|
|
6
6
|
name: "Add Lead to Campaign",
|
|
7
7
|
description: "Adds an existing lead to an existing campaign. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.object_reference.meta/object_reference/sforce_api_objects_campaignmember.htm)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce,
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigurationError,
|
|
3
|
+
getFileStream,
|
|
4
|
+
} from "@pipedream/platform";
|
|
5
|
+
import app from "../../salesforce_rest_api.app.mjs";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
props: {
|
|
9
|
+
app,
|
|
10
|
+
csvFilePath: {
|
|
11
|
+
type: "string",
|
|
12
|
+
label: "CSV File Path Or URL",
|
|
13
|
+
description: "The path to the CSV file to process. Provide a path to a file in the `/tmp` directory (for example, `/tmp/data.csv`). If a URL is provided, the file will be downloaded to the `/tmp` directory. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_data.htm)",
|
|
14
|
+
},
|
|
15
|
+
syncDir: {
|
|
16
|
+
type: "dir",
|
|
17
|
+
accessMode: "read",
|
|
18
|
+
sync: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
getObject() {
|
|
23
|
+
throw new ConfigurationError("getObject method not implemented");
|
|
24
|
+
},
|
|
25
|
+
getOperation() {
|
|
26
|
+
throw new ConfigurationError("getOperation method not implemented");
|
|
27
|
+
},
|
|
28
|
+
getSummary() {
|
|
29
|
+
throw new ConfigurationError("getSummary method not implemented");
|
|
30
|
+
},
|
|
31
|
+
async processBulkOperation({
|
|
32
|
+
object, operation, csvData, externalIdFieldName, ...args
|
|
33
|
+
} = {}) {
|
|
34
|
+
const { app } = this;
|
|
35
|
+
const job = await app.createBulkJob({
|
|
36
|
+
...args,
|
|
37
|
+
data: {
|
|
38
|
+
object,
|
|
39
|
+
operation,
|
|
40
|
+
externalIdFieldName,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
await app.uploadBulkJobData({
|
|
45
|
+
...args,
|
|
46
|
+
jobId: job.id,
|
|
47
|
+
data: csvData,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
await app.patchBulkJob({
|
|
51
|
+
...args,
|
|
52
|
+
jobId: job.id,
|
|
53
|
+
data: {
|
|
54
|
+
state: "UploadComplete",
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return app.getBulkJobInfo({
|
|
59
|
+
...args,
|
|
60
|
+
jobId: job.id,
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
async run({ $ }) {
|
|
65
|
+
const {
|
|
66
|
+
processBulkOperation,
|
|
67
|
+
getObject,
|
|
68
|
+
getOperation,
|
|
69
|
+
getSummary,
|
|
70
|
+
csvFilePath,
|
|
71
|
+
} = this;
|
|
72
|
+
|
|
73
|
+
const csvData = await getFileStream(csvFilePath);
|
|
74
|
+
|
|
75
|
+
const result = await processBulkOperation({
|
|
76
|
+
$,
|
|
77
|
+
object: getObject(),
|
|
78
|
+
operation: getOperation(),
|
|
79
|
+
csvData,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
$.export("$summary", getSummary());
|
|
83
|
+
|
|
84
|
+
return result;
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "salesforce_rest_api-convert-soap-xml-to-json",
|
|
6
6
|
name: "Convert SOAP XML Object to JSON",
|
|
7
7
|
description: "Converts a SOAP XML Object received from Salesforce to JSON",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce_rest_api,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "salesforce_rest_api-create-account",
|
|
9
9
|
name: "Create Account",
|
|
10
10
|
description: `Creates a Salesforce account. [See the documentation](${docsLink})`,
|
|
11
|
-
version: "0.3.
|
|
11
|
+
version: "0.3.2",
|
|
12
12
|
type: "action",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import common from "../common/batch-operation.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "salesforce_rest_api-create-accounts-batch",
|
|
6
|
+
name: "Create Accounts (Batch)",
|
|
7
|
+
description: "Create multiple Accounts in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
methods: {
|
|
11
|
+
...common.methods,
|
|
12
|
+
getObject() {
|
|
13
|
+
return "Account";
|
|
14
|
+
},
|
|
15
|
+
getOperation() {
|
|
16
|
+
return "insert";
|
|
17
|
+
},
|
|
18
|
+
getSummary() {
|
|
19
|
+
return "Successfully created Accounts";
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
key: "salesforce_rest_api-create-attachment",
|
|
19
19
|
name: "Create Attachment",
|
|
20
20
|
description: `Creates an Attachment on a parent object. [See the documentation](${docsLink})`,
|
|
21
|
-
version: "0.5.
|
|
21
|
+
version: "0.5.2",
|
|
22
22
|
type: "action",
|
|
23
23
|
props,
|
|
24
24
|
async run({ $ }) {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "salesforce_rest_api-create-campaign",
|
|
9
9
|
name: "Create Campaign",
|
|
10
10
|
description: `Creates a marketing campaign. [See the documentation](${docsLink})`,
|
|
11
|
-
version: "0.3.
|
|
11
|
+
version: "0.3.2",
|
|
12
12
|
type: "action",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "salesforce_rest_api-create-case",
|
|
9
9
|
name: "Create Case",
|
|
10
10
|
description: `Creates a Case, which represents a customer issue or problem. [See the documentation](${docsLink})`,
|
|
11
|
-
version: "0.3.
|
|
11
|
+
version: "0.3.2",
|
|
12
12
|
type: "action",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
key: "salesforce_rest_api-create-casecomment",
|
|
18
18
|
name: "Create Case Comment",
|
|
19
19
|
description: `Creates a Case Comment on a selected Case. [See the documentation](${docsLink})`,
|
|
20
|
-
version: "0.3.
|
|
20
|
+
version: "0.3.2",
|
|
21
21
|
type: "action",
|
|
22
22
|
props,
|
|
23
23
|
async run({ $ }) {
|
|
@@ -27,7 +27,7 @@ export default {
|
|
|
27
27
|
key: "salesforce_rest_api-create-content-note",
|
|
28
28
|
name: "Create Content Note",
|
|
29
29
|
description: `Creates a content note. [See the documentation](${docsLink}) and [Set Up Notes](https://help.salesforce.com/s/articleView?id=sales.notes_admin_setup.htm&type=5).`,
|
|
30
|
-
version: "0.0.
|
|
30
|
+
version: "0.0.2",
|
|
31
31
|
type: "action",
|
|
32
32
|
props: {
|
|
33
33
|
...contentNoteProps,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import common from "../common/batch-operation.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
...common,
|
|
5
|
+
key: "salesforce_rest_api-create-opportunities-batch",
|
|
6
|
+
name: "Create Opportunities (Batch)",
|
|
7
|
+
description: "Create multiple Opportunities in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
type: "action",
|
|
10
|
+
methods: {
|
|
11
|
+
...common.methods,
|
|
12
|
+
getObject() {
|
|
13
|
+
return "Opportunity";
|
|
14
|
+
},
|
|
15
|
+
getOperation() {
|
|
16
|
+
return "insert";
|
|
17
|
+
},
|
|
18
|
+
getSummary() {
|
|
19
|
+
return "Successfully created Opportunities";
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "salesforce_rest_api-create-opportunity",
|
|
9
9
|
name: "Create Opportunity",
|
|
10
10
|
description: `Creates an opportunity. [See the documentation](${docsLink})`,
|
|
11
|
-
version: "0.3.
|
|
11
|
+
version: "0.3.2",
|
|
12
12
|
type: "action",
|
|
13
13
|
methods: {
|
|
14
14
|
...common.methods,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
key: "salesforce_rest_api-create-record",
|
|
9
9
|
name: "Create Record",
|
|
10
10
|
description: "Create a record of a given object. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm)",
|
|
11
|
-
version: "0.3.
|
|
11
|
+
version: "0.3.2",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
salesforce,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "salesforce_rest_api-delete-opportunity",
|
|
5
5
|
name: "Delete Opportunity",
|
|
6
6
|
description: "Deletes an opportunity. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_delete_record.htm)",
|
|
7
|
-
version: "0.3.
|
|
7
|
+
version: "0.3.1",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
salesforce,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Delete Record",
|
|
6
6
|
description:
|
|
7
7
|
"Deletes an existing record in an object. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_retrieve_delete.htm)",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Find Records",
|
|
6
6
|
description:
|
|
7
7
|
"Retrieves selected fields for some or all records of a selected object. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm)",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-get-case",
|
|
5
|
+
name: "Get Case",
|
|
6
|
+
description: "Retrieves a case by its ID. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
caseId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
salesforce,
|
|
14
|
+
"recordId",
|
|
15
|
+
() => ({
|
|
16
|
+
objType: "Case",
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
label: "Case ID",
|
|
20
|
+
description: "The case ID to retrieve",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async run({ $ }) {
|
|
24
|
+
const fields = (await this.salesforce.getFieldsForObjectType("Case")).map(({ name }) => name);
|
|
25
|
+
|
|
26
|
+
let query = `SELECT ${fields.join(", ")} FROM Case WHERE Id = '${this.caseId}'`;
|
|
27
|
+
|
|
28
|
+
const { records } = await this.salesforce.query({
|
|
29
|
+
$,
|
|
30
|
+
query,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
$.export("$summary", `Successfully retrieved case with ID ${this.caseId}`);
|
|
34
|
+
return records[0];
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-get-user",
|
|
5
|
+
name: "Get User",
|
|
6
|
+
description: "Retrieves a user by their ID. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
userId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
salesforce,
|
|
14
|
+
"recordId",
|
|
15
|
+
() => ({
|
|
16
|
+
objType: "User",
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
async run({ $ }) {
|
|
22
|
+
const fields = (await this.salesforce.getFieldsForObjectType("User")).map(({ name }) => name);
|
|
23
|
+
|
|
24
|
+
let query = `SELECT ${fields.join(", ")} FROM User WHERE Id = '${this.userId}'`;
|
|
25
|
+
|
|
26
|
+
const { records } = await this.salesforce.query({
|
|
27
|
+
$,
|
|
28
|
+
query,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
$.export("$summary", `Sucessfully retrieved user with ID ${this.userId}`);
|
|
32
|
+
return records[0];
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "salesforce_rest_api-insert-blob-data",
|
|
5
5
|
name: "Insert Blob Data",
|
|
6
6
|
description: "Inserts blob data in Salesforce standard objects. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.228.0.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm)",
|
|
7
|
-
version: "0.2.
|
|
7
|
+
version: "0.2.9",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
salesforce,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-list-case-comments",
|
|
5
|
+
name: "List Case Comments",
|
|
6
|
+
description: "Lists all comments for a case. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
caseId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
salesforce,
|
|
14
|
+
"recordId",
|
|
15
|
+
() => ({
|
|
16
|
+
objType: "Case",
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
async run({ $ }) {
|
|
22
|
+
const fields = (await this.salesforce.getFieldsForObjectType("CaseComment")).map(({ name }) => name);
|
|
23
|
+
let query = `SELECT ${fields.join(", ")} FROM CaseComment WHERE ParentId = '${this.caseId}'`;
|
|
24
|
+
|
|
25
|
+
const { records } = await this.salesforce.query({
|
|
26
|
+
$,
|
|
27
|
+
query,
|
|
28
|
+
});
|
|
29
|
+
$.export("$summary", `Sucessfully retrieved ${records.length} comments for case with ID ${this.caseId}`);
|
|
30
|
+
return records;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-list-email-messages",
|
|
5
|
+
name: "List Email Messages",
|
|
6
|
+
description: "Lists all email messages for a case. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
caseId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
salesforce,
|
|
14
|
+
"recordId",
|
|
15
|
+
() => ({
|
|
16
|
+
objType: "Case",
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
label: "Case ID",
|
|
20
|
+
description: "The ID of the case to retrieve email messages for",
|
|
21
|
+
optional: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const fields = (await this.salesforce.getFieldsForObjectType("EmailMessage")).map(({ name }) => name);
|
|
26
|
+
let query = `SELECT ${fields.join(", ")} FROM EmailMessage`;
|
|
27
|
+
if (this.caseId) {
|
|
28
|
+
query += ` WHERE RelatedToId = '${this.caseId}'`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const { records } = await this.salesforce.query({
|
|
32
|
+
$,
|
|
33
|
+
query,
|
|
34
|
+
});
|
|
35
|
+
$.export("$summary", `Sucessfully retrieved ${records.length} email messages for case with ID ${this.caseId}`);
|
|
36
|
+
return records;
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-list-email-templates",
|
|
5
|
+
name: "List Email Templates",
|
|
6
|
+
description: "Lists all email templates. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailtemplate.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
},
|
|
12
|
+
async run({ $ }) {
|
|
13
|
+
const fields = (await this.salesforce.getFieldsForObjectType("EmailTemplate")).map(({ name }) => name);
|
|
14
|
+
const query = `SELECT ${fields.join(", ")} FROM EmailTemplate`;
|
|
15
|
+
|
|
16
|
+
const { records } = await this.salesforce.query({
|
|
17
|
+
$,
|
|
18
|
+
query,
|
|
19
|
+
});
|
|
20
|
+
$.export("$summary", `Sucessfully retrieved ${records.length} email templates`);
|
|
21
|
+
return records;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-list-knowledge-articles",
|
|
5
|
+
name: "List Knowledge Articles",
|
|
6
|
+
description: "Lists all knowledge articles. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_knowledgearticle.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
},
|
|
12
|
+
async run({ $ }) {
|
|
13
|
+
const fields = (await this.salesforce.getFieldsForObjectType("KnowledgeArticle")).map(({ name }) => name);
|
|
14
|
+
const query = `SELECT ${fields.join(", ")} FROM KnowledgeArticle`;
|
|
15
|
+
|
|
16
|
+
const { records } = await this.salesforce.query({
|
|
17
|
+
$,
|
|
18
|
+
query,
|
|
19
|
+
});
|
|
20
|
+
$.export("$summary", `Sucessfully retrieved ${records.length} knowledge articles`);
|
|
21
|
+
return records;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Post a Message to Chatter Feed",
|
|
6
6
|
description:
|
|
7
7
|
"Post a feed item in Chatter. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_item.htm)",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Search Object Records",
|
|
6
6
|
description:
|
|
7
7
|
"Searches for records in an object using a parameterized search. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_search_parameterized_get.htm)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
salesforce,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import salesforce from "../../salesforce_rest_api.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "salesforce_rest_api-send-email",
|
|
5
|
+
name: "Send Email",
|
|
6
|
+
description: "Sends an email. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_action.meta/api_action/actions_obj_email_simple.htm)",
|
|
7
|
+
version: "0.0.2",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
salesforce,
|
|
11
|
+
emailAddress: {
|
|
12
|
+
type: "string",
|
|
13
|
+
label: "Email Address",
|
|
14
|
+
description: "The email address to send the email to",
|
|
15
|
+
},
|
|
16
|
+
emailSubject: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Subject",
|
|
19
|
+
description: "The subject of the email",
|
|
20
|
+
},
|
|
21
|
+
emailBody: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Body",
|
|
24
|
+
description: "The body of the email",
|
|
25
|
+
},
|
|
26
|
+
logEmailOnSend: {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
label: "Log Email on Send",
|
|
29
|
+
description: "Indicates whether to log the email on the specified records’ activity time lines",
|
|
30
|
+
optional: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
sendEmail(opts = {}) {
|
|
35
|
+
return this.salesforce._makeRequest({
|
|
36
|
+
url: `${this.salesforce._baseApiVersionUrl()}/actions/standard/emailSimple`,
|
|
37
|
+
method: "POST",
|
|
38
|
+
...opts,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
async run({ $ }) {
|
|
43
|
+
const response = await this.sendEmail({
|
|
44
|
+
$,
|
|
45
|
+
data: {
|
|
46
|
+
inputs: [
|
|
47
|
+
{
|
|
48
|
+
emailAddresses: this.emailAddress,
|
|
49
|
+
emailSubject: this.emailSubject,
|
|
50
|
+
emailBody: this.emailBody,
|
|
51
|
+
senderType: "CurrentUser",
|
|
52
|
+
logEmailOnSend: this.logEmailOnSend,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
$.export("$summary", `Email sent to ${this.emailAddress}`);
|
|
58
|
+
return response;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "salesforce_rest_api-soql-search",
|
|
8
8
|
name: "SOQL Query (Object Query)",
|
|
9
9
|
description: `Executes a [Salesforce Object Query Language (SOQL)](${docsLink}) query-based, SQL-like search.`,
|
|
10
|
-
version: "0.2.
|
|
10
|
+
version: "0.2.10",
|
|
11
11
|
type: "action",
|
|
12
12
|
props: {
|
|
13
13
|
salesforce,
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
key: "salesforce_rest_api-sosl-search",
|
|
13
13
|
name: "SOSL Search (Object Search)",
|
|
14
14
|
description: `Executes a [Salesforce Object Search Language (SOSL)](${docsLink}) text-based search query.`,
|
|
15
|
-
version: "0.2.
|
|
15
|
+
version: "0.2.9",
|
|
16
16
|
type: "action",
|
|
17
17
|
props: {
|
|
18
18
|
salesforce,
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
key: "salesforce_rest_api-update-account",
|
|
16
16
|
name: "Update Account",
|
|
17
17
|
description: `Updates a Salesforce account. [See the documentation](${docsLink})`,
|
|
18
|
-
version: "0.3.
|
|
18
|
+
version: "0.3.2",
|
|
19
19
|
type: "action",
|
|
20
20
|
methods: {
|
|
21
21
|
...common.methods,
|