@pipedream/salesforce_rest_api 1.7.0 → 1.9.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.
Files changed (58) hide show
  1. package/actions/add-contact-to-campaign/add-contact-to-campaign.mjs +1 -1
  2. package/actions/add-lead-to-campaign/add-lead-to-campaign.mjs +1 -1
  3. package/actions/common/batch-operation.mjs +86 -0
  4. package/actions/common/knowledge.mjs +19 -0
  5. package/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs +1 -1
  6. package/actions/create-account/create-account.mjs +1 -1
  7. package/actions/create-accounts-batch/create-accounts-batch.mjs +22 -0
  8. package/actions/create-attachment/create-attachment.mjs +1 -1
  9. package/actions/create-campaign/create-campaign.mjs +1 -1
  10. package/actions/create-case/create-case.mjs +1 -1
  11. package/actions/create-casecomment/create-casecomment.mjs +1 -1
  12. package/actions/create-contact/create-contact.mjs +1 -1
  13. package/actions/create-content-note/create-content-note.mjs +1 -1
  14. package/actions/create-event/create-event.mjs +1 -1
  15. package/actions/create-lead/create-lead.mjs +1 -1
  16. package/actions/create-note/create-note.mjs +1 -1
  17. package/actions/create-opportunities-batch/create-opportunities-batch.mjs +22 -0
  18. package/actions/create-opportunity/create-opportunity.mjs +1 -1
  19. package/actions/create-record/create-record.mjs +1 -1
  20. package/actions/create-task/create-task.mjs +1 -1
  21. package/actions/create-user/create-user.mjs +1 -1
  22. package/actions/delete-opportunity/delete-opportunity.mjs +1 -1
  23. package/actions/delete-record/delete-record.mjs +1 -1
  24. package/actions/find-records/find-records.mjs +1 -1
  25. package/actions/get-case/get-case.mjs +1 -1
  26. package/actions/get-knowledge-articles/get-knowledge-articles.mjs +108 -0
  27. package/actions/get-knowledge-data-category-groups/get-knowledge-data-category-groups.mjs +42 -0
  28. package/actions/get-user/get-user.mjs +1 -1
  29. package/actions/insert-blob-data/insert-blob-data.mjs +1 -1
  30. package/actions/list-case-comments/list-case-comments.mjs +1 -1
  31. package/actions/list-email-messages/list-email-messages.mjs +1 -1
  32. package/actions/list-email-templates/list-email-templates.mjs +1 -1
  33. package/actions/list-knowledge-articles/list-knowledge-articles.mjs +1 -1
  34. package/actions/post-feed-to-chatter/post-feed-to-chatter.mjs +1 -1
  35. package/actions/search-string/search-string.mjs +1 -1
  36. package/actions/send-email/send-email.mjs +1 -1
  37. package/actions/soql-search/soql-search.mjs +1 -1
  38. package/actions/sosl-search/sosl-search.mjs +1 -1
  39. package/actions/update-account/update-account.mjs +1 -1
  40. package/actions/update-accounts-batch/update-accounts-batch.mjs +22 -0
  41. package/actions/update-contact/update-contact.mjs +1 -1
  42. package/actions/update-email-template/update-email-template.mjs +1 -1
  43. package/actions/update-opportunities-batch/update-opportunities-batch.mjs +22 -0
  44. package/actions/update-opportunity/update-opportunity.mjs +1 -1
  45. package/actions/update-record/update-record.mjs +1 -1
  46. package/actions/upsert-record/upsert-record.mjs +1 -1
  47. package/package.json +1 -1
  48. package/salesforce_rest_api.app.mjs +87 -0
  49. package/sources/case-updated-instant/case-updated-instant.mjs +1 -1
  50. package/sources/email-template-updated-instant/email-template-updated-instant.mjs +1 -1
  51. package/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs +1 -1
  52. package/sources/new-case-instant/new-case-instant.mjs +1 -1
  53. package/sources/new-email-template-instant/new-email-template-instant.mjs +1 -1
  54. package/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs +1 -1
  55. package/sources/new-outbound-message/new-outbound-message.mjs +1 -1
  56. package/sources/new-record-instant/new-record-instant.mjs +1 -1
  57. package/sources/record-deleted-instant/record-deleted-instant.mjs +1 -1
  58. package/sources/record-updated-instant/record-updated-instant.mjs +1 -1
@@ -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.0",
8
+ version: "0.1.2",
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.0",
8
+ version: "0.1.2",
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
+ };
@@ -0,0 +1,19 @@
1
+ import app from "../../salesforce_rest_api.app.mjs";
2
+
3
+ export default {
4
+ props: {
5
+ app,
6
+ // eslint-disable-next-line pipedream/props-label, pipedream/props-description
7
+ info: {
8
+ type: "alert",
9
+ alertType: "info",
10
+ content: "Please keep in mind that Salesforce Knowledge is available for an additional cost in: Professional Enterprise, Performance, and Developer Editions. For more information, contact your Salesforce representative. [See the documentation](https://help.salesforce.com/s/articleView?id=service.knowledge_map.htm&type=5)",
11
+ },
12
+ language: {
13
+ type: "string",
14
+ label: "Language",
15
+ description: "The language code. Defaults to `en-US`.",
16
+ optional: true,
17
+ },
18
+ },
19
+ };
@@ -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.6",
8
+ version: "0.0.8",
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.1",
11
+ version: "0.3.3",
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.2",
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.1",
21
+ version: "0.5.3",
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.1",
11
+ version: "0.3.3",
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.1",
11
+ version: "0.3.3",
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.1",
20
+ version: "0.3.3",
21
21
  type: "action",
22
22
  props,
23
23
  async run({ $ }) {
@@ -8,7 +8,7 @@ export default {
8
8
  key: "salesforce_rest_api-create-contact",
9
9
  name: "Create Contact",
10
10
  description: `Creates a contact. [See the documentation](${docsLink})`,
11
- version: "0.3.1",
11
+ version: "0.3.3",
12
12
  type: "action",
13
13
  methods: {
14
14
  ...common.methods,
@@ -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.1",
30
+ version: "0.0.3",
31
31
  type: "action",
32
32
  props: {
33
33
  ...contentNoteProps,
@@ -9,7 +9,7 @@ export default {
9
9
  key: "salesforce_rest_api-create-event",
10
10
  name: "Create Event",
11
11
  description: `Creates an event. [See the documentation](${docsLink})`,
12
- version: "0.3.1",
12
+ version: "0.3.3",
13
13
  type: "action",
14
14
  methods: {
15
15
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  key: "salesforce_rest_api-create-lead",
9
9
  name: "Create Lead",
10
10
  description: `Creates a lead. [See the documentation](${docsLink})`,
11
- version: "0.3.1",
11
+ version: "0.3.3",
12
12
  type: "action",
13
13
  methods: {
14
14
  ...common.methods,
@@ -17,7 +17,7 @@ export default {
17
17
  key: "salesforce_rest_api-create-note",
18
18
  name: "Create Note",
19
19
  description: `Creates a note. [See the documentation](${docsLink})`,
20
- version: "0.3.1",
20
+ version: "0.3.3",
21
21
  type: "action",
22
22
  props,
23
23
  async run({ $ }) {
@@ -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.2",
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.1",
11
+ version: "0.3.3",
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.1",
11
+ version: "0.3.3",
12
12
  type: "action",
13
13
  props: {
14
14
  salesforce,
@@ -9,7 +9,7 @@ export default {
9
9
  key: "salesforce_rest_api-create-task",
10
10
  name: "Create Task",
11
11
  description: `Creates a task. [See the documentation](${docsLink})`,
12
- version: "0.4.1",
12
+ version: "0.4.3",
13
13
  type: "action",
14
14
  methods: {
15
15
  ...common.methods,
@@ -9,7 +9,7 @@ export default {
9
9
  key: "salesforce_rest_api-create-user",
10
10
  name: "Create User",
11
11
  description: `Creates a Salesforce user. [See the documentation](${docsLink})`,
12
- version: "0.1.1",
12
+ version: "0.1.3",
13
13
  type: "action",
14
14
  methods: {
15
15
  ...common.methods,
@@ -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.0",
7
+ version: "0.3.2",
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.0",
8
+ version: "0.2.2",
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.0",
8
+ version: "0.2.2",
9
9
  type: "action",
10
10
  props: {
11
11
  salesforce,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-get-case",
5
5
  name: "Get Case",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -0,0 +1,108 @@
1
+ import common from "../common/knowledge.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "salesforce_rest_api-get-knowledge-articles",
6
+ name: "Get Knowledge Articles",
7
+ description: "Get a page of online articles for the given language and category through either search or query. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/sforce_api_rest_retrieve_article_list.htm)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ q: {
13
+ type: "string",
14
+ label: "Search Term",
15
+ description: "Performs an SOSL search. If this property is not set, an SOQL query runs. The characters `?` and `*` are used for wildcard searches. The characters `(`, `)`, and `\"` are used for complex search terms. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_find.htm).",
16
+ optional: true,
17
+ },
18
+ channel: {
19
+ type: "string",
20
+ label: "Channel",
21
+ description: "Where articles are visible (App, Pkb, Csp, Prm).",
22
+ optional: true,
23
+ options: [
24
+ {
25
+ label: "Internal Knowledge App",
26
+ value: "App",
27
+ },
28
+ {
29
+ label: "Public Knowledge Base",
30
+ value: "Pkb",
31
+ },
32
+ {
33
+ label: "Customer Portal",
34
+ value: "Csp",
35
+ },
36
+ {
37
+ label: "Partner Portal",
38
+ value: "Prm",
39
+ },
40
+ ],
41
+ },
42
+ categories: {
43
+ type: "string",
44
+ label: "Categories",
45
+ description: "This should be a map in json format `{\"group1\": \"category1\", \"group2\": \"category2\", ...}`. It must be unique in each group:category pair, otherwise you get `ARGUMENT_OBJECT_PARSE_ERROR`. There is a limit of three data category conditions, otherwise you get `INVALID_FILTER_VALUE`.",
46
+ optional: true,
47
+ },
48
+ queryMethod: {
49
+ type: "string",
50
+ label: "Query Method",
51
+ description: "Only valid when categories are specified, defaults to `ABOVE_OR_BELOW`.",
52
+ optional: true,
53
+ options: [
54
+ "AT",
55
+ "BELOW",
56
+ "ABOVE",
57
+ "ABOVE_OR_BELOW",
58
+ ],
59
+ },
60
+ sort: {
61
+ type: "string",
62
+ label: "Sort By",
63
+ description: "Field to sort results by. Defaults to `LastPublishedDate` for query and relevance for search",
64
+ optional: true,
65
+ options: [
66
+ "LastPublishedDate",
67
+ "CreatedDate",
68
+ "Title",
69
+ "ViewScore",
70
+ ],
71
+ },
72
+ },
73
+ async run({ $ }) {
74
+ const {
75
+ app,
76
+ q,
77
+ channel,
78
+ language,
79
+ categories,
80
+ queryMethod,
81
+ sort,
82
+ } = this;
83
+
84
+ const items = await app.paginate({
85
+ resultsKey: "articles",
86
+ requester: app.getKnowledgeArticles,
87
+ requesterArgs: {
88
+ $,
89
+ headers: {
90
+ ...app._makeRequestHeaders(),
91
+ "Accept": "application/json",
92
+ "Accept-Language": language || "en-US",
93
+ },
94
+ params: {
95
+ q,
96
+ channel,
97
+ categories,
98
+ queryMethod,
99
+ sort,
100
+ },
101
+ },
102
+ });
103
+
104
+ $.export("$summary", `Successfully fetched \`${items.length}\` articles`);
105
+
106
+ return items;
107
+ },
108
+ };
@@ -0,0 +1,42 @@
1
+ import common from "../common/knowledge.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "salesforce_rest_api-get-knowledge-data-category-groups",
6
+ name: "Get Knowledge Data Category Groups",
7
+ description: "Fetch data category groups visible to the current user. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/resources_knowledge_support_dcgroups.htm)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ ...common.props,
12
+ topCategoriesOnly: {
13
+ type: "boolean",
14
+ label: "Top Categories Only",
15
+ description: "Return only top-level categories if `true`, entire tree if `false`.",
16
+ optional: true,
17
+ },
18
+ },
19
+ async run({ $ }) {
20
+ const {
21
+ app,
22
+ topCategoriesOnly,
23
+ language,
24
+ } = this;
25
+
26
+ const response = await app.getKnowledgeDataCategoryGroups({
27
+ $,
28
+ params: {
29
+ sObjectName: "KnowledgeArticleVersion",
30
+ topCategoriesOnly,
31
+ },
32
+ headers: {
33
+ ...app._makeRequestHeaders(),
34
+ "Accept": "application/json",
35
+ "Accept-Language": language || "en-US",
36
+ },
37
+ });
38
+
39
+ $.export("$summary", `Successfully fetched \`${response.categoryGroups?.length || 0}\` data category groups`);
40
+ return response;
41
+ },
42
+ };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-get-user",
5
5
  name: "Get User",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -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.8",
7
+ version: "0.2.10",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-list-case-comments",
5
5
  name: "List Case Comments",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-list-email-messages",
5
5
  name: "List Email Messages",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-list-email-templates",
5
5
  name: "List Email Templates",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-list-knowledge-articles",
5
5
  name: "List Knowledge Articles",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -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.0",
8
+ version: "0.1.2",
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.2",
8
+ version: "0.0.4",
9
9
  type: "action",
10
10
  props: {
11
11
  salesforce,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "salesforce_rest_api-send-email",
5
5
  name: "Send Email",
6
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.1",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  props: {
10
10
  salesforce,
@@ -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.9",
10
+ version: "0.2.11",
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.8",
15
+ version: "0.2.10",
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.1",
18
+ version: "0.3.3",
19
19
  type: "action",
20
20
  methods: {
21
21
  ...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-update-accounts-batch",
6
+ name: "Update Accounts (Batch)",
7
+ description: "Update 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.2",
9
+ type: "action",
10
+ methods: {
11
+ ...common.methods,
12
+ getObject() {
13
+ return "Account";
14
+ },
15
+ getOperation() {
16
+ return "update";
17
+ },
18
+ getSummary() {
19
+ return "Successfully updated Accounts";
20
+ },
21
+ },
22
+ };
@@ -16,7 +16,7 @@ export default {
16
16
  key: "salesforce_rest_api-update-contact",
17
17
  name: "Update Contact",
18
18
  description: `Updates a contact. [See the documentation](${docsLink})`,
19
- version: "0.3.1",
19
+ version: "0.3.3",
20
20
  type: "action",
21
21
  methods: {
22
22
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  key: "salesforce_rest_api-update-email-template",
9
9
  name: "Update Email Template",
10
10
  description: "Updates an email template. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_update_fields.htm)",
11
- version: "0.0.1",
11
+ version: "0.0.3",
12
12
  type: "action",
13
13
  props: {
14
14
  salesforce,
@@ -0,0 +1,22 @@
1
+ import common from "../common/batch-operation.mjs";
2
+
3
+ export default {
4
+ ...common,
5
+ key: "salesforce_rest_api-update-opportunities-batch",
6
+ name: "Update Opportunities (Batch)",
7
+ description: "Update 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.2",
9
+ type: "action",
10
+ methods: {
11
+ ...common.methods,
12
+ getObject() {
13
+ return "Opportunity";
14
+ },
15
+ getOperation() {
16
+ return "update";
17
+ },
18
+ getSummary() {
19
+ return "Successfully updated Opportunities";
20
+ },
21
+ },
22
+ };
@@ -16,7 +16,7 @@ export default {
16
16
  key: "salesforce_rest_api-update-opportunity",
17
17
  name: "Update Opportunity",
18
18
  description: `Updates an opportunity. [See the documentation](${docsLink})`,
19
- version: "0.3.1",
19
+ version: "0.3.3",
20
20
  type: "action",
21
21
  methods: {
22
22
  ...common.methods,
@@ -8,7 +8,7 @@ export default {
8
8
  key: "salesforce_rest_api-update-record",
9
9
  name: "Update Record",
10
10
  description: "Update fields of a record. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_update_fields.htm)",
11
- version: "0.3.1",
11
+ version: "0.3.3",
12
12
  type: "action",
13
13
  props: {
14
14
  salesforce,
@@ -8,7 +8,7 @@ export default {
8
8
  key: "salesforce_rest_api-upsert-record",
9
9
  name: "Upsert Record",
10
10
  description: "Create or update a record of a given object. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm)",
11
- version: "0.0.2",
11
+ version: "0.0.4",
12
12
  type: "action",
13
13
  props: {
14
14
  salesforce,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/salesforce_rest_api",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Pipedream Salesforce (REST API) Components",
5
5
  "main": "salesforce_rest_api.app.mjs",
6
6
  "keywords": [
@@ -366,5 +366,92 @@ export default {
366
366
  ...args,
367
367
  });
368
368
  },
369
+ createBulkJob(args = {}) {
370
+ return this._makeRequest({
371
+ ...args,
372
+ method: "POST",
373
+ url: `${this._baseApiVersionUrl()}/jobs/ingest`,
374
+ data: {
375
+ contentType: "CSV",
376
+ columnDelimiter: "COMMA",
377
+ lineEnding: "LF",
378
+ ...args?.data,
379
+ },
380
+ });
381
+ },
382
+ uploadBulkJobData({
383
+ jobId, ...args
384
+ } = {}) {
385
+ return this._makeRequest({
386
+ ...args,
387
+ method: "PUT",
388
+ url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}/batches`,
389
+ headers: {
390
+ ...this._makeRequestHeaders(),
391
+ "Content-Type": "text/csv",
392
+ },
393
+ });
394
+ },
395
+ patchBulkJob({
396
+ jobId, ...args
397
+ } = {}) {
398
+ return this._makeRequest({
399
+ ...args,
400
+ method: "PATCH",
401
+ url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}`,
402
+ });
403
+ },
404
+ getBulkJobInfo({
405
+ jobId, ...args
406
+ } = {}) {
407
+ return this._makeRequest({
408
+ ...args,
409
+ url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}`,
410
+ });
411
+ },
412
+ getKnowledgeArticles(args = {}) {
413
+ return this._makeRequest({
414
+ url: `${this._baseApiVersionUrl()}/support/knowledgeArticles`,
415
+ ...args,
416
+ });
417
+ },
418
+ getKnowledgeDataCategoryGroups(args = {}) {
419
+ return this._makeRequest({
420
+ url: `${this._baseApiVersionUrl()}/support/dataCategoryGroups`,
421
+ ...args,
422
+ });
423
+ },
424
+ async paginate({
425
+ requester, requesterArgs, resultsKey = "articles",
426
+ maxRequests = 3, pageSize = 100,
427
+ } = {}) {
428
+ let allItems = [];
429
+ let currentPage = 1;
430
+ let hasMore = true;
431
+
432
+ while (hasMore && currentPage <= maxRequests) {
433
+ const response = await requester({
434
+ ...requesterArgs,
435
+ params: {
436
+ ...requesterArgs?.params,
437
+ pageSize,
438
+ pageNumber: currentPage,
439
+ },
440
+ });
441
+
442
+ const items = response[resultsKey];
443
+ if (items?.length) {
444
+ allItems = [
445
+ ...allItems,
446
+ ...items,
447
+ ];
448
+ }
449
+
450
+ hasMore = !!response.nextPageUrl;
451
+ currentPage++;
452
+ }
453
+
454
+ return allItems;
455
+ },
369
456
  },
370
457
  };
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Case Updated (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-case-updated-instant",
9
9
  description: "Emit new event when a case is updated. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.0.1",
10
+ version: "0.0.3",
11
11
  props: {
12
12
  salesforce: common.props.salesforce,
13
13
  db: "$.service.db",
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Email Template Updated (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-email-template-updated-instant",
9
9
  description: "Emit new event when an email template is updated. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.0.1",
10
+ version: "0.0.3",
11
11
  props: {
12
12
  salesforce: common.props.salesforce,
13
13
  db: "$.service.db",
@@ -7,7 +7,7 @@ export default {
7
7
  name: "Knowledge Article Updated (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-knowledge-article-updated-instant",
9
9
  description: "Emit new event when a knowledge article is updated. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.0.1",
10
+ version: "0.0.3",
11
11
  props: {
12
12
  salesforce: common.props.salesforce,
13
13
  db: "$.service.db",
@@ -7,7 +7,7 @@ export default {
7
7
  name: "New Case (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-new-case-instant",
9
9
  description: "Emit new event when a case is created. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.0.1",
10
+ version: "0.0.3",
11
11
  props: {
12
12
  salesforce: common.props.salesforce,
13
13
  db: "$.service.db",
@@ -7,7 +7,7 @@ export default {
7
7
  name: "New Email Template (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-new-email-template-instant",
9
9
  description: "Emit new event when an email template is created. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.0.1",
10
+ version: "0.0.3",
11
11
  props: {
12
12
  salesforce: common.props.salesforce,
13
13
  db: "$.service.db",
@@ -7,7 +7,7 @@ export default {
7
7
  name: "New Knowledge Article (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-new-knowledge-article-instant",
9
9
  description: "Emit new event when a knowledge article is created. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.0.1",
10
+ version: "0.0.3",
11
11
  props: {
12
12
  salesforce: common.props.salesforce,
13
13
  db: "$.service.db",
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Outbound Message (Instant)",
7
7
  key: "salesforce_rest_api-new-outbound-message",
8
8
  description: "Emit new event when a new outbound message is received in Salesforce.",
9
- version: "0.1.7",
9
+ version: "0.1.9",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  db: "$.service.db",
@@ -6,7 +6,7 @@ export default {
6
6
  name: "New Record (Instant, of Selectable Type)",
7
7
  key: "salesforce_rest_api-new-record-instant",
8
8
  description: "Emit new event when a record of the selected object type is created. [See the documentation](https://sforce.co/3yPSJZy)",
9
- version: "0.2.1",
9
+ version: "0.2.3",
10
10
  props: {
11
11
  ...common.props,
12
12
  fieldsToObtain: {
@@ -7,7 +7,7 @@ export default {
7
7
  name: "New Deleted Record (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-record-deleted-instant",
9
9
  description: "Emit new event when a record of the selected object type is deleted. [See the documentation](https://sforce.co/3msDDEE)",
10
- version: "0.1.1",
10
+ version: "0.1.3",
11
11
  methods: {
12
12
  ...common.methods,
13
13
  generateWebhookMeta(data) {
@@ -7,7 +7,7 @@ export default {
7
7
  name: "New Updated Record (Instant, of Selectable Type)",
8
8
  key: "salesforce_rest_api-record-updated-instant",
9
9
  description: "Emit new event when a record of the selected type is updated. [See the documentation](https://sforce.co/3yPSJZy)",
10
- version: "0.2.1",
10
+ version: "0.2.3",
11
11
  props: {
12
12
  ...common.props,
13
13
  fields: {