@pipedream/salesforce_rest_api 0.3.3

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 (37) hide show
  1. package/LICENSE +7 -0
  2. package/actions/salesforce-create-account/salesforce-create-account.mjs +374 -0
  3. package/actions/salesforce-create-attachment/salesforce-create-attachment.mjs +73 -0
  4. package/actions/salesforce-create-campaign/salesforce-create-campaign.mjs +148 -0
  5. package/actions/salesforce-create-case/salesforce-create-case.mjs +179 -0
  6. package/actions/salesforce-create-casecomment/salesforce-create-casecomment.mjs +58 -0
  7. package/actions/salesforce-create-contact/salesforce-create-contact.mjs +340 -0
  8. package/actions/salesforce-create-event/salesforce-create-event.mjs +232 -0
  9. package/actions/salesforce-create-lead/salesforce-create-lead.mjs +267 -0
  10. package/actions/salesforce-create-note/salesforce-create-note.mjs +63 -0
  11. package/actions/salesforce-create-opportunity/salesforce-create-opportunity.mjs +170 -0
  12. package/actions/salesforce-create-record/salesforce-create-record.mjs +36 -0
  13. package/actions/salesforce-create-task/salesforce-create-task.mjs +219 -0
  14. package/actions/salesforce-delete-opportunity/salesforce-delete-opportunity.mjs +37 -0
  15. package/actions/salesforce-get-sobject-fields-values/salesforce-get-sobject-fields-values.mjs +37 -0
  16. package/actions/salesforce-insert-blob-data/salesforce-insert-blob-data.mjs +70 -0
  17. package/actions/salesforce-make-api-call/salesforce-make-api-call.mjs +56 -0
  18. package/actions/salesforce-soql-search/salesforce-soql-search.mjs +29 -0
  19. package/actions/salesforce-sosl-search/salesforce-sosl-search.mjs +30 -0
  20. package/actions/salesforce-update-account/salesforce-update-account.mjs +357 -0
  21. package/actions/salesforce-update-contact/salesforce-update-contact.mjs +345 -0
  22. package/actions/salesforce-update-opportunity/salesforce-update-opportunity.mjs +171 -0
  23. package/actions/salesforce-update-record/salesforce-update-record.mjs +40 -0
  24. package/package.json +21 -0
  25. package/salesforce_rest_api.app.mjs +247 -0
  26. package/sources/common-instant.mjs +134 -0
  27. package/sources/common.mjs +96 -0
  28. package/sources/new-object/new-object.mjs +69 -0
  29. package/sources/new-object-instant/new-object-instant.mjs +35 -0
  30. package/sources/new-outbound-message/new-outbound-message.mjs +105 -0
  31. package/sources/object-deleted/object-deleted.mjs +52 -0
  32. package/sources/object-deleted-instant/object-deleted-instant.mjs +36 -0
  33. package/sources/object-updated/object-updated.mjs +63 -0
  34. package/sources/object-updated-instant/object-updated-instant.mjs +36 -0
  35. package/sources/updated-field-on-record/updated-field-on-record.mjs +179 -0
  36. package/sources/updated-field-on-record-instant/updated-field-on-record-instant.mjs +76 -0
  37. package/utils.mjs +27 -0
@@ -0,0 +1,170 @@
1
+ // legacy_hash_id: a_oViVbR
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-create-opportunity",
6
+ name: "Create Opportunity",
7
+ description: "Creates an opportunity, which represents an opportunity, which is a sale or pending deal.",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ CloseDate: {
16
+ type: "string",
17
+ description: "Date when the opportunity is expected to close.",
18
+ },
19
+ Name: {
20
+ type: "string",
21
+ description: "A name for this opportunity. Limit: 120 characters.",
22
+ },
23
+ StageName: {
24
+ type: "string",
25
+ description: "Current stage of this record. The StageName field controls several other fields on an opportunity. Each of the fields can be directly set or implied by changing the StageName field. In addition, the StageName field is a picklist, so it has additional members in the returned describeSObjectResult to indicate how it affects the other fields. To obtain the stage name values in the picklist, query the OpportunityStage object. If the StageName is updated, then the ForecastCategoryName, IsClosed, IsWon, and Probability are automatically updated based on the stage-category mapping.",
26
+ },
27
+ AccountId: {
28
+ type: "string",
29
+ description: "ID of the account associated with this opportunity.",
30
+ optional: true,
31
+ },
32
+ Amount: {
33
+ type: "string",
34
+ 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.",
35
+ optional: true,
36
+ },
37
+ CampaignId: {
38
+ type: "string",
39
+ 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.",
40
+ optional: true,
41
+ },
42
+ ContactId: {
43
+ type: "string",
44
+ 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.",
45
+ optional: true,
46
+ },
47
+ ContractId: {
48
+ type: "string",
49
+ description: "ID of the contract that's associated with this opportunity.",
50
+ optional: true,
51
+ },
52
+ CurrencyIsoCode: {
53
+ type: "string",
54
+ description: "Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization.",
55
+ optional: true,
56
+ },
57
+ Description: {
58
+ type: "string",
59
+ description: "Text description of the opportunity. Limit: 32,000 characters.",
60
+ optional: true,
61
+ },
62
+ ForecastCategoryName: {
63
+ type: "string",
64
+ description: "Available in API version 12.0 and later. The name of the forecast category. It is implied, but not directly controlled, by the StageName field. You can override this field to a different value than is implied by the StageName value.",
65
+ optional: true,
66
+ },
67
+ IsExcludedFromTerritory2Filter: {
68
+ type: "boolean",
69
+ description: "Used for Filter-Based Opportunity Territory Assignment (Pilot in Spring '15 / API version 33). Indicates whether the opportunity is excluded (True) or included (False) each time the APEX filter is executed.",
70
+ optional: true,
71
+ },
72
+ LeadSource: {
73
+ type: "string",
74
+ description: "Source of this opportunity, such as Advertisement or Trade Show.",
75
+ optional: true,
76
+ },
77
+ NextStep: {
78
+ type: "string",
79
+ description: "Description of next task in closing opportunity. Limit: 255 characters.",
80
+ optional: true,
81
+ },
82
+ OwnerId: {
83
+ type: "string",
84
+ description: "ID of the User who has been assigned to work this opportunity.If you update this field, the previous owner's access becomes Read Only or the access specified in your organization-wide default for opportunities, whichever is greater. If you have set up opportunity teams in your organization, updating this field has different consequences depending on your version of the API: For API version 12.0 and later, sharing records are kept, as they are for all objects. For API version before 12.0, sharing records are deleted. For API version 16.0 and later, users must have the “Transfer Record” permission in order to update (transfer) account ownership using this field.",
85
+ optional: true,
86
+ },
87
+ Pricebook2Id: {
88
+ type: "string",
89
+ description: "ID of a related Pricebook2 object. The Pricebook2Id field indicates which Pricebook2 applies to this opportunity. The Pricebook2Id field is defined only for those organizations that have products enabled as a feature. You can specify values for only one field (Pricebook2Id or PricebookId)—not both fields. For this reason, both fields are declared nillable.",
90
+ optional: true,
91
+ },
92
+ PricebookId: {
93
+ type: "string",
94
+ description: "Unavailable as of version 3.0. As of version 8.0, the Pricebook object is no longer available. Use the Pricebook2Id field instead, specifying the ID of the Pricebook2 record.",
95
+ optional: true,
96
+ },
97
+ Probability: {
98
+ type: "string",
99
+ description: "Percentage of estimated confidence in closing the opportunity. It is implied, but not directly controlled, by the StageName field. You can override this field to a different value than what is implied by the StageName. Note If you're changing the Probability field through the API using a partner WSDL call, or an Apex before trigger, and the value may have several decimal places, we recommend rounding the value to a whole number. For example, the following Apex in a before trigger uses the round method to change the field value: o.probability = o.probability.round();",
100
+ optional: true,
101
+ },
102
+ RecordTypeId: {
103
+ type: "string",
104
+ description: "ID of the record type assigned to this object.",
105
+ optional: true,
106
+ },
107
+ SyncedQuoteID: {
108
+ type: "string",
109
+ description: "Read only in an Apex trigger. The ID of the Quote that syncs with the opportunity. Setting this field lets you start and stop syncing between the opportunity and a quote. The ID has to be for a quote that is a child of the opportunity.",
110
+ optional: true,
111
+ },
112
+ Territory2Id: {
113
+ type: "string",
114
+ description: "The ID of the territory that is assigned to the opportunity. Available only if Enterprise Territory Management has been enabled for your organization.",
115
+ optional: true,
116
+ },
117
+ TotalOpportunityQuantity: {
118
+ type: "integer",
119
+ description: "Number of items included in this opportunity. Used in quantity-based forecasting.",
120
+ optional: true,
121
+ },
122
+ Type: {
123
+ type: "string",
124
+ description: "Type of opportunity. For example, Existing Business or New Business.",
125
+ optional: true,
126
+ },
127
+ },
128
+ async run({ $ }) {
129
+ // See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
130
+ // Opportunity object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_opportunity.htm
131
+
132
+ if (!this.CloseDate || !this.Name || !this.StageName) {
133
+ throw new Error("Must provide CloseDate, Name, and StageName parameters.");
134
+ }
135
+
136
+ return await axios($, {
137
+ "method": "post",
138
+ "url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Opportunity/`,
139
+ "Content-Type": "application/json",
140
+ "headers": {
141
+ Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
142
+ },
143
+ "data": {
144
+ AccountId: this.AccountId,
145
+ Amount: this.Amount,
146
+ CampaignId: this.CampaignId,
147
+ CloseDate: this.CloseDate,
148
+ ContactId: this.ContactId,
149
+ ContractId: this.ContractId,
150
+ CurrencyIsoCode: this.CurrencyIsoCode,
151
+ Description: this.Description,
152
+ ForecastCategoryName: this.ForecastCategoryName,
153
+ IsExcludedFromTerritory2Filter: this.IsExcludedFromTerritory2Filter,
154
+ LeadSource: this.LeadSource,
155
+ Name: this.Name,
156
+ NextStep: this.NextStep,
157
+ OwnerId: this.OwnerId,
158
+ Pricebook2Id: this.Pricebook2Id,
159
+ PricebookId: this.PricebookId,
160
+ Probability: this.Probability,
161
+ RecordTypeId: this.RecordTypeId,
162
+ StageName: this.StageName,
163
+ SyncedQuoteID: this.SyncedQuoteID,
164
+ Territory2Id: this.Territory2Id,
165
+ TotalOpportunityQuantity: this.TotalOpportunityQuantity,
166
+ Type: this.Type,
167
+ },
168
+ });
169
+ },
170
+ };
@@ -0,0 +1,36 @@
1
+ // legacy_hash_id: a_vgi4Kv
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-create-record",
6
+ name: "Create Record",
7
+ description: "Create new records of a given resource. Resource field values in the request data, and then use the POST method of the resource. The response body will contain the ID of the created record if the call is successful. Make user to include required fields of the resource you are creating.",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ sobject_name: {
16
+ type: "string",
17
+ description: "Salesforce standard object's name to retrive basic info for.",
18
+ },
19
+ sobject: {
20
+ type: "object",
21
+ description: "Data of the Salesforce standard object record to create.\nSalesforce standard objects are described in [Standard Objects](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_list.htm) section of the [SOAP API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm).",
22
+ },
23
+ },
24
+ async run({ $ }) {
25
+ //See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
26
+ return await axios($, {
27
+ "method": "post",
28
+ "url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/${this.sobject_name}/`,
29
+ "Content-Type": "application/json",
30
+ "headers": {
31
+ Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
32
+ },
33
+ "data": this.sobject,
34
+ });
35
+ },
36
+ };
@@ -0,0 +1,219 @@
1
+ // legacy_hash_id: a_RAiVGM
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-create-task",
6
+ name: "Create Task",
7
+ description: "Creates a task, which represents a business activity such as making a phone call or other to-do items.",
8
+ version: "0.3.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ Priority: {
16
+ type: "string",
17
+ description: "Required. Indicates the importance or urgency of a task, such as high or low.",
18
+ },
19
+ Status: {
20
+ type: "string",
21
+ description: "Required. The status of the task, such as In Progress or Completed. Each predefined Status field implies a value for the IsClosed flag. To obtain picklist values, query the TaskStatus object. Note This field can't be updated for recurring tasks (IsRecurrence is true).",
22
+ },
23
+ ActivityDate: {
24
+ type: "string",
25
+ 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).",
26
+ optional: true,
27
+ },
28
+ CallDisposition: {
29
+ type: "string",
30
+ description: "Represents the result of a given call, for example, “we'll call back,” or “call unsuccessful.” Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.",
31
+ optional: true,
32
+ },
33
+ CallDurationInSeconds: {
34
+ type: "integer",
35
+ description: "Duration of the call in seconds. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.",
36
+ optional: true,
37
+ },
38
+ CallObject: {
39
+ type: "string",
40
+ description: "Name of a call center. Limit is 255 characters. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center.",
41
+ optional: true,
42
+ },
43
+ CallType: {
44
+ type: "string",
45
+ description: "The type of call being answered: Inbound, Internal, or Outbound.",
46
+ optional: true,
47
+ options: [
48
+ "Inbound",
49
+ "Internal",
50
+ "Outbound",
51
+ ],
52
+ },
53
+ Description: {
54
+ type: "string",
55
+ description: "Contains a text description of the task.",
56
+ optional: true,
57
+ },
58
+ IsRecurrence: {
59
+ type: "boolean",
60
+ description: "Indicates whether the task is scheduled to repeat itself (true) or only occurs once (false). This field is read-only on update, but not on create. If this field value is true, then RecurrenceStartDateOnly, RecurrenceEndDateOnly, RecurrenceType, and any recurrence fields associated with the given recurrence type must be populated. See [Recurring Tasks](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_task.htm#RecurTasks).",
61
+ optional: true,
62
+ },
63
+ IsReminderSet: {
64
+ type: "boolean",
65
+ description: "Indicates whether a popup reminder has been set for the task (true) or not (false).",
66
+ optional: true,
67
+ },
68
+ OwnerId: {
69
+ type: "string",
70
+ description: "ID of the User or Group who owns the record. This field accepts Groups of type Queue only. In the user interface, Group IDs correspond with the queue's list view names. To create or update tasks assigned to Group, use v48.0 or later.",
71
+ optional: true,
72
+ },
73
+ RecurrenceDayOfMonth: {
74
+ type: "integer",
75
+ description: "The day of the month in which the task repeats.",
76
+ optional: true,
77
+ },
78
+ RecurrenceDayOfWeekMask: {
79
+ type: "integer",
80
+ description: "The day or days of the week on which the task repeats. This field contains a bitmask. The values are as follows: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday = 8 Thursday = 16 Friday = 32 Saturday = 64 Multiple days are represented as the sum of their numerical values. For example, Tuesday and Thursday = 4 + 16 = 20.",
81
+ optional: true,
82
+ },
83
+ RecurrenceEndDateOnly: {
84
+ type: "string",
85
+ description: "The last date on which the task repeats. 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.",
86
+ optional: true,
87
+ },
88
+ RecurrenceInstance: {
89
+ type: "string",
90
+ description: "The frequency of the recurring task. For example, “2nd” or “3rd.”",
91
+ optional: true,
92
+ },
93
+ RecurrenceInterval: {
94
+ type: "integer",
95
+ description: "The interval between recurring tasks.",
96
+ optional: true,
97
+ },
98
+ RecurrenceMonthOfYear: {
99
+ type: "string",
100
+ description: "The month of the year in which the task repeats.",
101
+ optional: true,
102
+ },
103
+ RecurrenceRegeneratedType: {
104
+ type: "string",
105
+ description: "Represents what triggers a repeating task to repeat. Add this field to a page layout together with the RecurrenceInterval field, which determines the number of days between the triggering date (due date or close date) and the due date of the next repeating task in the series.",
106
+ optional: true,
107
+ options: [
108
+ "None",
109
+ "After due date",
110
+ "After the task is closed",
111
+ "(Task closed)",
112
+ ],
113
+ },
114
+ RecurrenceStartDateOnly: {
115
+ type: "string",
116
+ description: "The date when the recurring task begins. Must be a date and time before RecurrenceEndDateOnly.",
117
+ optional: true,
118
+ },
119
+ RecurrenceTimeZoneSidKey: {
120
+ type: "string",
121
+ description: "The time zone associated with the recurring task. For example, “UTC-8:00” for Pacific Standard Time.",
122
+ optional: true,
123
+ },
124
+ RecurrenceType: {
125
+ type: "string",
126
+ description: "Indicates how often the task repeats. For example, daily, weekly, or every nth month (where “nth” is defined in RecurrenceInstance).",
127
+ optional: true,
128
+ },
129
+ ReminderDateTime: {
130
+ type: "string",
131
+ description: "Represents the time when the reminder is scheduled to fire, if IsReminderSet is set to true. If IsReminderSet is set to false, then the user may have deselected the reminder checkbox in the Salesforce user interface, or the reminder has already fired at the time indicated by the value.",
132
+ optional: true,
133
+ },
134
+ Subject: {
135
+ type: "string",
136
+ description: "The subject line of the task, such as “Call” or “Send Quote.” Limit: 255 characters.",
137
+ optional: true,
138
+ },
139
+ TaskSubtype: {
140
+ type: "string",
141
+ 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.",
142
+ optional: true,
143
+ options: [
144
+ "Task",
145
+ "Email",
146
+ "List Email",
147
+ "Cadence",
148
+ "Call",
149
+ ],
150
+ },
151
+ TaskWhoIds: {
152
+ type: "any",
153
+ description: "A string array of contact or lead IDs related to this task. This JunctionIdList field is linked to the TaskWhoRelations child relationship. TaskWhoIds is only available when the shared activities setting is enabled. The first contact or lead ID in the list becomes the primary WhoId if you don't specify a primary WhoId. If you set the EventWhoIds field to null, all entries in the list are deleted and the value of WhoId is added as the first entry. Warning Adding a JunctionIdList field name to the fieldsToNull property deletes all related junction records. This action can't be undone.",
154
+ optional: true,
155
+ },
156
+ Type: {
157
+ type: "string",
158
+ description: "The type of task, such as Call or Meeting.",
159
+ optional: true,
160
+ },
161
+ WhatId: {
162
+ type: "string",
163
+ description: "The WhatId represents nonhuman objects such as accounts, opportunities, campaigns, cases, or custom objects. WhatIds are polymorphic. Polymorphic means a WhatId is equivalent to the ID of a related object.",
164
+ optional: true,
165
+ },
166
+ WhoId: {
167
+ type: "string",
168
+ description: "The WhoId represents a human such as a lead or a contact. WhoIds are polymorphic. Polymorphic means a WhoId is equivalent to a contact's ID or a lead's ID. If Shared Activities is enabled, the value of this field is the ID of the related lead or primary contact. If you add, update, or remove the WhoId field, you might encounter problems with triggers, workflows, and data validation rules that are associated with the record. The label is Name ID. Beginning in API version 37.0, if the contact or lead ID in the WhoId field is not in the TaskWhoIds list, no error occurs and the ID is added to the TaskWhoIds as the primary WhoId. If WhoId is set to null, an arbitrary ID from the existing TaskWhoIds list is promoted to the primary position.",
169
+ optional: true,
170
+ },
171
+ },
172
+ async run({ $ }) {
173
+ // See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm
174
+ // Task object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_task.htm
175
+
176
+ if (!this.Priority || !this.Status) {
177
+ throw new Error("Must provide Priority and Status parameters.");
178
+ }
179
+
180
+ return await axios($, {
181
+ "method": "post",
182
+ "url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Task/`,
183
+ "Content-Type": "application/json",
184
+ "headers": {
185
+ Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
186
+ },
187
+ "data": {
188
+ ActivityDate: this.ActivityDate,
189
+ CallDisposition: this.CallDisposition,
190
+ CallDurationInSeconds: this.CallDurationInSeconds,
191
+ CallObject: this.CallObject,
192
+ CallType: this.CallType,
193
+ Description: this.Description,
194
+ IsRecurrence: this.IsRecurrence,
195
+ IsReminderSet: this.IsReminderSet,
196
+ OwnerId: this.OwnerId,
197
+ Priority: this.Priority,
198
+ RecurrenceDayOfMonth: this.RecurrenceDayOfMonth,
199
+ RecurrenceDayOfWeekMask: this.RecurrenceDayOfWeekMask,
200
+ RecurrenceEndDateOnly: this.RecurrenceEndDateOnly,
201
+ RecurrenceInstance: this.RecurrenceInstance,
202
+ RecurrenceInterval: this.RecurrenceInterval,
203
+ RecurrenceMonthOfYear: this.RecurrenceMonthOfYear,
204
+ RecurrenceRegeneratedType: this.RecurrenceRegeneratedType,
205
+ RecurrenceStartDateOnly: this.RecurrenceStartDateOnly,
206
+ RecurrenceTimeZoneSidKey: this.RecurrenceTimeZoneSidKey,
207
+ RecurrenceType: this.RecurrenceType,
208
+ ReminderDateTime: this.ReminderDateTime,
209
+ Status: this.Status,
210
+ Subject: this.Subject,
211
+ TaskSubtype: this.TaskSubtype,
212
+ TaskWhoIds: this.TaskWhoIds,
213
+ Type: this.Type,
214
+ WhatId: this.WhatId,
215
+ WhoId: this.WhoId,
216
+ },
217
+ });
218
+ },
219
+ };
@@ -0,0 +1,37 @@
1
+ // legacy_hash_id: a_xqiqkn
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-delete-opportunity",
6
+ name: "Delete Opportunity",
7
+ description: "Deletes an opportunity, which represents an opportunity, which is a sale or pending deal.",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ OpportunityId: {
16
+ type: "string",
17
+ description: "ID of the Opportunity to delete.",
18
+ },
19
+ },
20
+ async run({ $ }) {
21
+ // See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_delete_record.htm
22
+ // Opportunity object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_opportunity.htm
23
+
24
+ if (!this.OpportunityId) {
25
+ throw new Error("Must provide OpportunityId parameter.");
26
+ }
27
+
28
+ return await axios($, {
29
+ "method": "delete",
30
+ "url": `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/Opportunity/${this.OpportunityId}`,
31
+ "Content-Type": "application/json",
32
+ "headers": {
33
+ Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
34
+ },
35
+ });
36
+ },
37
+ };
@@ -0,0 +1,37 @@
1
+ // legacy_hash_id: a_Xzi1vA
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-get-sobject-fields-values",
6
+ name: "Get Field Values from a Standard Object Record",
7
+ description: "Retrieve field values from a record. You can specify the fields you want to retrieve.",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ sobject_name: {
16
+ type: "string",
17
+ description: "Salesforce standard object type of the record to get field values from.",
18
+ },
19
+ sobject_id: {
20
+ type: "string",
21
+ description: "Id of the Salesforce standard object to get field values from.",
22
+ },
23
+ sobject_fields: {
24
+ type: "string",
25
+ description: "Comma separated list of the Salesforce standard object's fields to get values from.",
26
+ },
27
+ },
28
+ async run({ $ }) {
29
+ //See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
30
+ return await axios($, {
31
+ url: `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/${encodeURI(this.sobject_name)}/${encodeURI(this.sobject_id)}?fields=${encodeURI(this.sobject_fields)}`,
32
+ headers: {
33
+ Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
34
+ },
35
+ });
36
+ },
37
+ };
@@ -0,0 +1,70 @@
1
+ // legacy_hash_id: a_a4i8Gv
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-insert-blob-data",
6
+ name: "Insert Blob Data",
7
+ description: "Inserts blob data in Salesforce standard objects.",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ entiy_name: {
16
+ type: "string",
17
+ description: "Name of the entity to insert as part of the form-data sent along the Salesforce API as a request with multipart/form-data content type. I.e. entity_document for Documents.",
18
+ },
19
+ entity_document: {
20
+ type: "string",
21
+ description: "Salesforce object entity to insert.",
22
+ },
23
+ form_content_name: {
24
+ type: "string",
25
+ description: "Name of the binary content to insert as part of the form-data sent along the Salesforce API as a request with multipart/form-data content type.",
26
+ },
27
+ filename: {
28
+ type: "string",
29
+ description: "Filename of the blob data to insert.",
30
+ },
31
+ content_type: {
32
+ type: "string",
33
+ description: "Mime type of the content to insert.",
34
+ },
35
+ attachment_binarycontent: {
36
+ type: "string",
37
+ description: "Binary content of the blob data to insert.",
38
+ },
39
+ sobject_name: {
40
+ type: "string",
41
+ description: "Salesforce standard object type to insert.",
42
+ },
43
+ },
44
+ async run({ $ }) {
45
+ //See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
46
+
47
+ const payloadPart1 = `----------------------------932677621329676389151855
48
+ \r\nContent-Disposition: form-data; name=\"${this.entiy_name}\""
49
+ \r\nContent-Type: application/json
50
+ \r\n\r\n${this.entity_document}\r\n\r\n
51
+ \r\n\r\n----------------------------932677621329676389151855
52
+ \r\nContent-Disposition: form-data; name=\"${this.form_content_name}\"; filename=\"${this.filename}\"
53
+ \r\nContent-Type: ${this.content_type}
54
+ \r\n\r\n`;
55
+
56
+ const payloadPart2 = "\r\n\r\n----------------------------932677621329676389151855--";
57
+
58
+ const data = `${payloadPart1}${this.attachment_binarycontent}${payloadPart2}`;
59
+
60
+ return await axios($, {
61
+ method: "post",
62
+ url: `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/sobjects/${this.sobject_name}/`,
63
+ headers: {
64
+ "Authorization": `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
65
+ "Content-Type": "multipart/form-data; boundary=--------------------------932677621329676389151855",
66
+ },
67
+ data,
68
+ });
69
+ },
70
+ };
@@ -0,0 +1,56 @@
1
+ // legacy_hash_id: a_vgi4Mb
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-make-api-call",
6
+ name: "Make API Call",
7
+ description: "Makes an aribitrary call to Salesforce API",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ query_string: {
16
+ type: "string",
17
+ description: "Query string of the request.",
18
+ optional: true,
19
+ },
20
+ request_method: {
21
+ type: "string",
22
+ description: "Http method to use in the request.",
23
+ options: [
24
+ "get",
25
+ "post",
26
+ "put",
27
+ "patch",
28
+ "delete",
29
+ ],
30
+ },
31
+ relative_url: {
32
+ type: "string",
33
+ description: "A path relative to the Salesforce instance to send the request against.",
34
+ },
35
+ headers: {
36
+ type: "object",
37
+ description: "Headers to send in the request.",
38
+ },
39
+ request_body: {
40
+ type: "object",
41
+ description: "Body of the request.",
42
+ optional: true,
43
+ },
44
+ },
45
+ async run({ $ }) {
46
+
47
+ this.query_string = this.query_string || "";
48
+
49
+ return await axios($, {
50
+ method: this.request_method,
51
+ url: `${this.salesforce_rest_api.$auth.instance_url}/services/data/${this.relative_url}${this.query_string}`,
52
+ headers: this.headers,
53
+ data: this.request_body,
54
+ });
55
+ },
56
+ };
@@ -0,0 +1,29 @@
1
+ // legacy_hash_id: a_RAiV1n
2
+ import { axios } from "@pipedream/platform";
3
+
4
+ export default {
5
+ key: "salesforce_rest_api-salesforce-soql-search",
6
+ name: "SOQL Search",
7
+ description: "Executes a SOQL query that returns all the results in a single response, or if needed, returns part of the results and an identifier used to retrieve the remaining results.",
8
+ version: "0.2.1",
9
+ type: "action",
10
+ props: {
11
+ salesforce_rest_api: {
12
+ type: "app",
13
+ app: "salesforce_rest_api",
14
+ },
15
+ soql_search_string: {
16
+ type: "string",
17
+ description: "The search string in SOQL.\nFor more information on [SOSL see the SOQL and SOSL Reference.](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm)\nExample: [Execute SOQL Query](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm).",
18
+ },
19
+ },
20
+ async run({ $ }) {
21
+ // See the API docs here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm
22
+ return await axios($, {
23
+ url: `${this.salesforce_rest_api.$auth.instance_url}/services/data/v20.0/query/?q=${encodeURI(this.soql_search_string)}`,
24
+ headers: {
25
+ Authorization: `Bearer ${this.salesforce_rest_api.$auth.oauth_access_token}`,
26
+ },
27
+ });
28
+ },
29
+ };