@pipedream/salesforce_rest_api 0.3.3 → 0.4.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 (73) hide show
  1. package/actions/create-account/create-account.mjs +51 -0
  2. package/actions/create-attachment/create-attachment.mjs +62 -0
  3. package/actions/create-campaign/create-campaign.mjs +51 -0
  4. package/actions/create-case/create-case.mjs +50 -0
  5. package/actions/create-casecomment/create-casecomment.mjs +50 -0
  6. package/actions/create-contact/create-contact.mjs +50 -0
  7. package/actions/create-event/create-event.mjs +80 -0
  8. package/actions/create-lead/create-lead.mjs +56 -0
  9. package/actions/create-note/create-note.mjs +56 -0
  10. package/actions/create-opportunity/create-opportunity.mjs +62 -0
  11. package/actions/create-record/create-record.mjs +36 -0
  12. package/actions/create-task/create-task.mjs +56 -0
  13. package/actions/delete-opportunity/delete-opportunity.mjs +30 -0
  14. package/actions/delete-record/delete-record.mjs +37 -0
  15. package/actions/find-create-record/find-create-record.mjs +84 -0
  16. package/actions/find-records/find-records.mjs +48 -0
  17. package/actions/get-sobject-fields-values/get-sobject-fields-values.mjs +57 -0
  18. package/actions/insert-blob-data/insert-blob-data.mjs +77 -0
  19. package/actions/soql-search/soql-search.mjs +29 -0
  20. package/actions/sosl-search/sosl-search.mjs +29 -0
  21. package/actions/update-account/update-account.mjs +59 -0
  22. package/actions/update-contact/update-contact.mjs +58 -0
  23. package/actions/update-opportunity/update-opportunity.mjs +72 -0
  24. package/actions/update-record/update-record.mjs +46 -0
  25. package/common/constants.mjs +30 -0
  26. package/common/sobjects/account.mjs +27 -0
  27. package/common/sobjects/attachment.mjs +22 -0
  28. package/common/sobjects/campaign.mjs +27 -0
  29. package/common/sobjects/case.mjs +17 -0
  30. package/common/sobjects/caseComment.mjs +7 -0
  31. package/common/sobjects/contact.mjs +52 -0
  32. package/common/sobjects/event.mjs +22 -0
  33. package/common/sobjects/lead.mjs +32 -0
  34. package/common/sobjects/note.mjs +17 -0
  35. package/common/sobjects/opportunity.mjs +27 -0
  36. package/common/sobjects/task.mjs +25 -0
  37. package/common/utils.mjs +51 -0
  38. package/package.json +6 -3
  39. package/salesforce_rest_api.app.mjs +349 -37
  40. package/sources/common-instant.mjs +15 -9
  41. package/sources/common.mjs +3 -5
  42. package/sources/new-object/new-object.mjs +1 -1
  43. package/sources/new-object-instant/new-object-instant.mjs +1 -1
  44. package/sources/new-outbound-message/new-outbound-message.mjs +1 -1
  45. package/sources/object-deleted/object-deleted.mjs +2 -2
  46. package/sources/object-deleted-instant/object-deleted-instant.mjs +2 -2
  47. package/sources/object-updated/object-updated.mjs +2 -2
  48. package/sources/object-updated-instant/object-updated-instant.mjs +2 -2
  49. package/sources/updated-field-on-record/updated-field-on-record.mjs +2 -2
  50. package/sources/updated-field-on-record-instant/updated-field-on-record-instant.mjs +2 -2
  51. package/actions/salesforce-create-account/salesforce-create-account.mjs +0 -374
  52. package/actions/salesforce-create-attachment/salesforce-create-attachment.mjs +0 -73
  53. package/actions/salesforce-create-campaign/salesforce-create-campaign.mjs +0 -148
  54. package/actions/salesforce-create-case/salesforce-create-case.mjs +0 -179
  55. package/actions/salesforce-create-casecomment/salesforce-create-casecomment.mjs +0 -58
  56. package/actions/salesforce-create-contact/salesforce-create-contact.mjs +0 -340
  57. package/actions/salesforce-create-event/salesforce-create-event.mjs +0 -232
  58. package/actions/salesforce-create-lead/salesforce-create-lead.mjs +0 -267
  59. package/actions/salesforce-create-note/salesforce-create-note.mjs +0 -63
  60. package/actions/salesforce-create-opportunity/salesforce-create-opportunity.mjs +0 -170
  61. package/actions/salesforce-create-record/salesforce-create-record.mjs +0 -36
  62. package/actions/salesforce-create-task/salesforce-create-task.mjs +0 -219
  63. package/actions/salesforce-delete-opportunity/salesforce-delete-opportunity.mjs +0 -37
  64. package/actions/salesforce-get-sobject-fields-values/salesforce-get-sobject-fields-values.mjs +0 -37
  65. package/actions/salesforce-insert-blob-data/salesforce-insert-blob-data.mjs +0 -70
  66. package/actions/salesforce-make-api-call/salesforce-make-api-call.mjs +0 -56
  67. package/actions/salesforce-soql-search/salesforce-soql-search.mjs +0 -29
  68. package/actions/salesforce-sosl-search/salesforce-sosl-search.mjs +0 -30
  69. package/actions/salesforce-update-account/salesforce-update-account.mjs +0 -357
  70. package/actions/salesforce-update-contact/salesforce-update-contact.mjs +0 -345
  71. package/actions/salesforce-update-opportunity/salesforce-update-opportunity.mjs +0 -171
  72. package/actions/salesforce-update-record/salesforce-update-record.mjs +0 -40
  73. package/utils.mjs +0 -27
@@ -0,0 +1,27 @@
1
+ export default {
2
+ AccountNumber: {
3
+ type: "string",
4
+ label: "Account Number",
5
+ description: "Account number assigned to this account (not the unique, system-generated ID assigned during creation). Maximum size is 40 characters.",
6
+ },
7
+ AccountSource: {
8
+ type: "string",
9
+ label: "Account Source",
10
+ description: "The source of the account record. For example, Advertisement, Data.com, or Trade Show. The source is selected from a picklist of available values, which are set by an administrator in Salesforce. Each picklist value can have up to 40 characters.",
11
+ },
12
+ AnnualRevenue: {
13
+ type: "string",
14
+ label: "Annual Revenue",
15
+ description: "Estimated annual revenue of the account.",
16
+ },
17
+ BillingCity: {
18
+ type: "string",
19
+ label: "Billing City",
20
+ description: "Details for the billing address of this account. Maximum size is 40 characters.",
21
+ },
22
+ BillingCountry: {
23
+ type: "string",
24
+ label: "Billing Country",
25
+ description: "Details for the billing address of this account. Maximum size is 80 characters.",
26
+ },
27
+ };
@@ -0,0 +1,22 @@
1
+ export default {
2
+ ContentType: {
3
+ type: "string",
4
+ label: "Content Type",
5
+ description: "The content type of the attachment. If the Don't allow HTML uploads as attachments or document records security setting is enabled for your organization, you cannot upload files with the following file extensions: .htm, .html, .htt, .htx, .mhtm, .mhtml, .shtm, .shtml, .acgi, .svg. When you insert a document or attachment through the API, make sure that this field is set to the appropriate MIME type.",
6
+ },
7
+ Description: {
8
+ type: "string",
9
+ label: "Description",
10
+ description: "Description of the attachment. Maximum size is 500 characters. This field is available in API version 18.0 and later.",
11
+ },
12
+ IsPrivate: {
13
+ type: "boolean",
14
+ label: "Is Private?",
15
+ description: "Indicates whether this record is viewable only by the owner and administrators (true) or viewable by all otherwise-allowed users (false). During a create or update call, it is possible to mark an Attachment record as private even if you are not the owner. This can result in a situation in which you can no longer access the record that you just inserted or updated. Label is Private.Attachments on tasks or events can't be marked private.",
16
+ },
17
+ OwnerId: {
18
+ type: "string",
19
+ label: "Owner ID",
20
+ description: "ID of the User who owns the attachment. This field was required previous to release 9.0. Beginning with release 9.0, it can be null on create. The owner of an attachment on a task or event must be the same as the owner of the task or event.",
21
+ },
22
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ ActualCost: {
3
+ type: "string",
4
+ label: "Actual Cost",
5
+ description: "Amount of money spent to run the campaign.",
6
+ },
7
+ BudgetedCost: {
8
+ type: "string",
9
+ label: "Budgeted Cost",
10
+ description: "Amount of money budgeted for the campaign.",
11
+ },
12
+ CampaignImageId: {
13
+ type: "string",
14
+ label: "Campaign Image ID",
15
+ description: "ID of the campaign image. Available in API version 42.0 and later.",
16
+ },
17
+ CampaignMemberRecordTypeId: {
18
+ type: "string",
19
+ label: "Campaign Member Record Type ID",
20
+ description: "The record type ID for CampaignMember records associated with the campaign.",
21
+ },
22
+ Description: {
23
+ type: "string",
24
+ label: "Description",
25
+ description: "Description of the campaign. Limit: 32 KB. Only the first 255 characters display in reports.",
26
+ },
27
+ };
@@ -0,0 +1,17 @@
1
+ export default {
2
+ AccountId: {
3
+ type: "string",
4
+ label: "Account ID",
5
+ description: "ID of the account associated with this case.",
6
+ },
7
+ Description: {
8
+ type: "string",
9
+ label: "Description",
10
+ description: "A text description of the case. Limit: 32 KB.",
11
+ },
12
+ IsEscalated: {
13
+ type: "boolean",
14
+ label: "Is Escalated?",
15
+ description: "Indicates whether the case has been escalated (true) or not. A case's escalated state does not affect how you can use a case, or whether you can query, delete, or update it. You can set this flag via the API. Label is Escalated.",
16
+ },
17
+ };
@@ -0,0 +1,7 @@
1
+ export default {
2
+ CommentBody: {
3
+ type: "string",
4
+ label: "Comment Body",
5
+ description: "Text of the CaseComment. The maximum size of the comment body is 4,000 bytes. Label is Body.",
6
+ },
7
+ };
@@ -0,0 +1,52 @@
1
+ export default {
2
+ AccountId: {
3
+ type: "string",
4
+ label: "Account ID",
5
+ description: "ID of the account that's the parent of this contact. We recommend that you update up to 50 contacts simultaneously when changing the accounts on contacts enabled for a Customer Portal or partner portal. We also recommend that you make this update after business hours.",
6
+ },
7
+ Birthdate: {
8
+ type: "string",
9
+ label: "Birth Date",
10
+ description: "The contact's birth date.Filter criteria for report filters, list view filters, and SOQL queries ignore the year portion of the Birthdate field. For example, this SOQL query returns contacts with birthdays later in the year than today:view sourceprint?1SELECT Name, Birthdate2FROM Contact3WHERE Birthdate > TODAY",
11
+ },
12
+ Department: {
13
+ type: "string",
14
+ label: "Department",
15
+ description: "The contact's department.",
16
+ },
17
+ Description: {
18
+ type: "string",
19
+ label: "Description",
20
+ description: "A description of the contact. Label is Contact Description up to 32 KB.",
21
+ },
22
+ Email: {
23
+ type: "string",
24
+ label: "Email",
25
+ description: "The contact's email address.",
26
+ },
27
+ FirstName: {
28
+ type: "string",
29
+ label: "First Name",
30
+ description: "The contact's first name up to 40 characters.",
31
+ },
32
+ MiddleName: {
33
+ type: "string",
34
+ label: "Middle Name",
35
+ description: "The contact's middle name up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
36
+ },
37
+ Phone: {
38
+ type: "string",
39
+ label: "Phone",
40
+ description: "Telephone number for the contact. Label is Business Phone.",
41
+ },
42
+ Suffix: {
43
+ type: "string",
44
+ label: "Suffix",
45
+ description: "Name suffix of the contact up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
46
+ },
47
+ Title: {
48
+ type: "string",
49
+ label: "Title",
50
+ description: "Title of the contact, such as CEO or Vice President.",
51
+ },
52
+ };
@@ -0,0 +1,22 @@
1
+ export default {
2
+ AcceptedEventInviteeIds: {
3
+ type: "string",
4
+ label: "Accepted Event Invitee IDs",
5
+ description: "A string array of contact or lead IDs who accepted this event. This JunctionIdList is linked to the AcceptedEventRelation child relationship. Warning Adding a JunctionIdList field name to the fieldsToNull property deletes all related junction records. This action can't be undone.",
6
+ },
7
+ ActivityDate: {
8
+ type: "string",
9
+ label: "Activity Date",
10
+ description: "Contains the event's due date if the IsAllDayEvent flag is set to true. This field is a date field with a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. Don't attempt to alter the timestamp to account for time zone differences. Label is Due Date Only.This field is required in versions 12.0 and earlier if the IsAllDayEvent flag is set to true. The value for this field and StartDateTime must match, or one of them must be null.",
11
+ },
12
+ Description: {
13
+ type: "string",
14
+ label: "Description",
15
+ description: "Contains a text description of the event. Limit: 32,000 characters.",
16
+ },
17
+ Subject: {
18
+ type: "string",
19
+ label: "Subject",
20
+ description: "The subject line of the event, such as Call, Email, or Meeting. Limit: 255 characters.",
21
+ },
22
+ };
@@ -0,0 +1,32 @@
1
+ export default {
2
+ City: {
3
+ type: "string",
4
+ label: "City",
5
+ description: "City for the lead's address.",
6
+ },
7
+ Country: {
8
+ type: "string",
9
+ label: "Country",
10
+ description: "The lead's country.",
11
+ },
12
+ Description: {
13
+ type: "string",
14
+ label: "Description",
15
+ description: "The lead's description.",
16
+ },
17
+ Email: {
18
+ type: "string",
19
+ label: "Email",
20
+ description: "The lead's email address.",
21
+ },
22
+ FirstName: {
23
+ type: "string",
24
+ label: "First Name",
25
+ description: "The lead's first name up to 40 characters.",
26
+ },
27
+ MiddleName: {
28
+ type: "string",
29
+ label: "Middle Name",
30
+ description: "The lead's middle name up to 40 characters. To enable this field, ask Salesforce Customer Support for help.",
31
+ },
32
+ };
@@ -0,0 +1,17 @@
1
+ export default {
2
+ Body: {
3
+ type: "string",
4
+ label: "Body",
5
+ description: "Body of the note. Limited to 32 KB.",
6
+ },
7
+ IsPrivate: {
8
+ type: "boolean",
9
+ label: "Is Private",
10
+ description: "If true, only the note owner or a user with the “Modify All Data” permission can view the note or query it via the API. Note that if a user who does not have the “Modify All Data” permission sets this field to true on a note that they do not own, then they can no longer query, delete, or update the note.",
11
+ },
12
+ OwnerId: {
13
+ type: "string",
14
+ label: "Owner ID",
15
+ description: "ID of the user who owns the note.",
16
+ },
17
+ };
@@ -0,0 +1,27 @@
1
+ export default {
2
+ AccountId: {
3
+ type: "string",
4
+ label: "Account ID",
5
+ description: "ID of the account associated with this opportunity.",
6
+ },
7
+ Amount: {
8
+ type: "string",
9
+ label: "Amount",
10
+ description: "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products. Any attempt to update this field, if the record has products, will be ignored. The update call will not be rejected, and other fields will be updated as specified, but the Amount will be unchanged.",
11
+ },
12
+ CampaignId: {
13
+ type: "string",
14
+ label: "Campaign ID",
15
+ description: "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled. The User must have read access rights to the cross-referenced Campaign object in order to create or update that campaign into this field on the opportunity.",
16
+ },
17
+ ContactId: {
18
+ type: "string",
19
+ label: "Contact ID",
20
+ description: "ID of the contact associated with this opportunity, set as the primary contact. Read-only field that is derived from the opportunity contact role, which is created at the same time the opportunity is created. This field can only be populated when it's created, and can't be updated. To update the value in this field, change the IsPrimary flag on the OpportunityContactRole associated with this opportunity. Available in API version 46.0 and later.",
21
+ },
22
+ ContractId: {
23
+ type: "string",
24
+ label: "Contract ID",
25
+ description: "ID of the contract that's associated with this opportunity.",
26
+ },
27
+ };
@@ -0,0 +1,25 @@
1
+ import constants from "../constants.mjs";
2
+
3
+ export default {
4
+ ActivityDate: {
5
+ type: "string",
6
+ label: "Activity date",
7
+ description: "Represents the due date of the task. This field has a timestamp that is always set to midnight in the Coordinated Universal Time (UTC) time zone. The timestamp is not relevant; do not attempt to alter it to accommodate time zone differences. Note This field can't be set or updated for a recurring task (IsRecurrence is true).",
8
+ },
9
+ Description: {
10
+ type: "string",
11
+ label: "Description",
12
+ description: "Contains a text description of the task.",
13
+ },
14
+ Subject: {
15
+ type: "string",
16
+ label: "Subject",
17
+ description: "The subject line of the task, such as “Call” or “Send Quote.” Limit: 255 characters.",
18
+ },
19
+ TaskSubtype: {
20
+ type: "string",
21
+ label: "Task sub-type",
22
+ description: "Provides standard subtypes to facilitate creating and searching for specific task subtypes. This field isn't updateable. TaskSubtype values: Task Email List Email Cadence Call Note The Cadence subtype is an internal value used by High Velocity Sales, and can't be set manually.",
23
+ options: constants.TASK_SUB_TYPES,
24
+ },
25
+ };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A utility function that accepts a string as an argument and reformats it in
3
+ * order to remove newline characters and consecutive spaces. Useful when
4
+ * dealing with very long templated strings that are split into multiple lines.
5
+ *
6
+ * @example
7
+ * // returns "This is a much cleaner string"
8
+ * toSingleLineString(`
9
+ * This is a much
10
+ * cleaner string
11
+ * `);
12
+ *
13
+ * @param {string} multiLineString the input string to reformat
14
+ * @returns a formatted string based on the content of the input argument,
15
+ * without newlines and multiple spaces
16
+ * Source: {@linkcode ../aws/sources/common/utils.mjs utils.mjs}
17
+ */
18
+ function toSingleLineString(multiLineString) {
19
+ return multiLineString
20
+ .trim()
21
+ .replace(/\n/g, " ")
22
+ .replace(/\s{2,}/g, " ");
23
+ }
24
+
25
+ const removeNullEntries = (obj) =>
26
+ obj && Object.entries(obj).reduce((acc, [
27
+ key,
28
+ value,
29
+ ]) => {
30
+ const isNumber = typeof value === "number";
31
+ const isBoolean = typeof value === "boolean";
32
+ const isNotEmpyString = typeof value === "string" && value.trim() !== "";
33
+ const isNotEmptyArray = Array.isArray(value) && value.length;
34
+ const isNotEmptyObject =
35
+ typeof value === "object" &&
36
+ value !== null &&
37
+ !Array.isArray(value) &&
38
+ Object.keys(value).length !== 0;
39
+ isNotEmptyObject && (value = removeNullEntries(value));
40
+ return ((value || value === false) &&
41
+ (isNotEmpyString || isNotEmptyArray || isNotEmptyObject || isBoolean || isNumber))
42
+ ? {
43
+ ...acc,
44
+ [key]: value,
45
+ }
46
+ : acc;
47
+ }, {});
48
+
49
+ export {
50
+ toSingleLineString, removeNullEntries,
51
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pipedream/salesforce_rest_api",
3
- "version": "0.3.3",
4
- "description": "Pipedream Salesforce_rest_api Components",
3
+ "version": "0.4.0",
4
+ "description": "Pipedream Salesforce (REST API) Components",
5
5
  "main": "salesforce_rest_api.app.mjs",
6
6
  "keywords": [
7
7
  "pipedream",
@@ -12,7 +12,10 @@
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
14
  "@pipedream/platform": "^0.9.0",
15
- "salesforce-webhooks": "^1.1.4"
15
+ "handlebars": "^4.7.7",
16
+ "lodash": "^4.17.21",
17
+ "salesforce-webhooks": "^1.1.4",
18
+ "lodash-es": "^4.17.21"
16
19
  },
17
20
  "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
18
21
  "publishConfig": {