@scopieflows/app-salesforce-marketing-cloud 0.1.4 → 0.1.6

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 (30) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +161 -1
  3. package/src/index.js.map +1 -1
  4. package/src/lib/actions/activate-journey.d.ts +4 -0
  5. package/src/lib/actions/activate-journey.js +43 -0
  6. package/src/lib/actions/activate-journey.js.map +1 -0
  7. package/src/lib/actions/create-data-extension.d.ts +8 -0
  8. package/src/lib/actions/create-data-extension.js +75 -0
  9. package/src/lib/actions/create-data-extension.js.map +1 -0
  10. package/src/lib/actions/create-journey.d.ts +3 -0
  11. package/src/lib/actions/create-journey.js +38 -0
  12. package/src/lib/actions/create-journey.js.map +1 -0
  13. package/src/lib/actions/delete-data-extension.d.ts +3 -0
  14. package/src/lib/actions/delete-data-extension.js +34 -0
  15. package/src/lib/actions/delete-data-extension.js.map +1 -0
  16. package/src/lib/actions/get-automation-status.d.ts +3 -0
  17. package/src/lib/actions/get-automation-status.js +34 -0
  18. package/src/lib/actions/get-automation-status.js.map +1 -0
  19. package/src/lib/actions/pause-automation.d.ts +3 -0
  20. package/src/lib/actions/pause-automation.js +34 -0
  21. package/src/lib/actions/pause-automation.js.map +1 -0
  22. package/src/lib/actions/pause-journey.d.ts +4 -0
  23. package/src/lib/actions/pause-journey.js +43 -0
  24. package/src/lib/actions/pause-journey.js.map +1 -0
  25. package/src/lib/actions/send-transactional-email.d.ts +6 -0
  26. package/src/lib/actions/send-transactional-email.js +60 -0
  27. package/src/lib/actions/send-transactional-email.js.map +1 -0
  28. package/src/lib/actions/start-automation.d.ts +3 -0
  29. package/src/lib/actions/start-automation.js +34 -0
  30. package/src/lib/actions/start-automation.js.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scopieflows/app-salesforce-marketing-cloud",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "main": "./dist/src/index.js",
5
5
  "types": "./dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -8,11 +8,20 @@ const pieces_common_1 = require("@scopieflows/pieces-common");
8
8
  const upsert_data_extension_row_1 = require("./lib/actions/upsert-data-extension-row");
9
9
  const get_data_extension_rows_1 = require("./lib/actions/get-data-extension-rows");
10
10
  const delete_data_extension_row_1 = require("./lib/actions/delete-data-extension-row");
11
+ const create_data_extension_1 = require("./lib/actions/create-data-extension");
12
+ const delete_data_extension_1 = require("./lib/actions/delete-data-extension");
11
13
  const trigger_journey_event_1 = require("./lib/actions/trigger-journey-event");
12
14
  const get_journey_status_1 = require("./lib/actions/get-journey-status");
15
+ const create_journey_1 = require("./lib/actions/create-journey");
16
+ const activate_journey_1 = require("./lib/actions/activate-journey");
17
+ const pause_journey_1 = require("./lib/actions/pause-journey");
13
18
  const send_triggered_email_1 = require("./lib/actions/send-triggered-email");
19
+ const send_transactional_email_1 = require("./lib/actions/send-transactional-email");
14
20
  const send_sms_message_1 = require("./lib/actions/send-sms-message");
15
21
  const create_update_contact_1 = require("./lib/actions/create-update-contact");
22
+ const start_automation_1 = require("./lib/actions/start-automation");
23
+ const pause_automation_1 = require("./lib/actions/pause-automation");
24
+ const get_automation_status_1 = require("./lib/actions/get-automation-status");
16
25
  exports.sfmcAuth = pieces_framework_1.PieceAuth.OAuth2({
17
26
  description: `Connect your Salesforce Marketing Cloud account.
18
27
 
@@ -32,7 +41,149 @@ exports.sfmcAuth = pieces_framework_1.PieceAuth.OAuth2({
32
41
  },
33
42
  authUrl: '{authBaseUri}/v2/authorize',
34
43
  tokenUrl: '{authBaseUri}/v2/token',
35
- scope: ['offline'],
44
+ scope: [
45
+ 'offline',
46
+ // Email
47
+ 'email_read',
48
+ 'email_write',
49
+ 'email_send',
50
+ // OTT
51
+ 'ott_read',
52
+ 'ott_send',
53
+ // Push
54
+ 'push_read',
55
+ 'push_write',
56
+ 'push_send',
57
+ // SMS
58
+ 'sms_read',
59
+ 'sms_write',
60
+ 'sms_send',
61
+ // Social
62
+ 'social_read',
63
+ 'social_write',
64
+ 'social_publish',
65
+ 'social_post',
66
+ // Web
67
+ 'web_read',
68
+ 'web_write',
69
+ 'web_publish',
70
+ // Documents and Images
71
+ 'documents_and_images_read',
72
+ 'documents_and_images_write',
73
+ // Saved Content
74
+ 'saved_content_read',
75
+ 'saved_content_write',
76
+ // Automations
77
+ 'automations_read',
78
+ 'automations_write',
79
+ 'automations_execute',
80
+ // Journeys
81
+ 'journeys_read',
82
+ 'journeys_write',
83
+ 'journeys_execute',
84
+ 'journeys_activate',
85
+ 'journeys_stop',
86
+ 'journeys_pause',
87
+ 'journeys_resume',
88
+ 'journeys_send',
89
+ 'journeys_schedule',
90
+ 'journeys_delete',
91
+ // Audiences
92
+ 'audiences_read',
93
+ 'audiences_write',
94
+ // Contact to Business Unit Mapping
95
+ 'contact_to_business_unit_mapping_create',
96
+ 'contact_to_business_unit_mapping_view',
97
+ 'contact_to_business_unit_mapping_update',
98
+ 'contact_to_business_unit_mapping_delete',
99
+ // List and Subscribers
100
+ 'list_and_subscribers_read',
101
+ 'list_and_subscribers_write',
102
+ // Market Audience
103
+ 'market_audience_create',
104
+ 'market_audience_view',
105
+ 'market_audience_update',
106
+ 'market_audience_delete',
107
+ // Market Audience Member
108
+ 'market_audience_member_create',
109
+ 'market_audience_member_view',
110
+ 'market_audience_member_update',
111
+ 'market_audience_member_delete',
112
+ // Marketing Cloud Connect
113
+ 'marketing_cloud_connect_read',
114
+ 'marketing_cloud_connect_write',
115
+ 'marketing_cloud_connect_send',
116
+ // Data Extensions
117
+ 'data_extensions_read',
118
+ 'data_extensions_write',
119
+ // File Locations
120
+ 'file_locations_read',
121
+ 'file_locations_write',
122
+ // Tracking Events
123
+ 'tracking_events_read',
124
+ 'tracking_events_write',
125
+ // Manage Keys
126
+ 'manage_keys_view_status',
127
+ 'manage_keys_rotate',
128
+ 'manage_keys_revoke',
129
+ // Access
130
+ 'access_configure',
131
+ // Callbacks
132
+ 'callbacks_read',
133
+ 'callbacks_create',
134
+ 'callbacks_update',
135
+ 'callbacks_delete',
136
+ // Subscriptions
137
+ 'subscriptions_read',
138
+ 'subscriptions_create',
139
+ 'subscriptions_update',
140
+ 'subscriptions_delete',
141
+ // Approvals
142
+ 'approvals_read',
143
+ 'approvals_write',
144
+ // Calendar
145
+ 'calendar_read',
146
+ 'calendar_write',
147
+ // Campaign
148
+ 'campaign_read',
149
+ 'campaign_write',
150
+ // Tags
151
+ 'tags_read',
152
+ 'tags_write',
153
+ // Workflows
154
+ 'workflows_read',
155
+ 'workflows_write',
156
+ // Assets
157
+ 'assets_read',
158
+ 'assets_write',
159
+ 'assets_delete',
160
+ // Settings
161
+ 'settings_read',
162
+ 'settings_write',
163
+ // Accounts
164
+ 'accounts_read',
165
+ 'accounts_write',
166
+ // E360 Analytics Provisioning API
167
+ 'e360_analytics_provisioning_view',
168
+ 'e360_analytics_provisioning_update',
169
+ 'e360_analytics_provisioning_delete',
170
+ // OTT Channels
171
+ 'ott_channels_read',
172
+ 'ott_channels_write',
173
+ // Packages
174
+ 'packages_package',
175
+ 'packages_deploy',
176
+ // Users
177
+ 'users_read',
178
+ 'users_write',
179
+ // HTTP Headers
180
+ 'http_headers_view',
181
+ 'http_headers_update',
182
+ 'http_headers_delete',
183
+ // Webhooks
184
+ 'webhooks_read',
185
+ 'webhooks_write',
186
+ ],
36
187
  prompt: 'omit',
37
188
  validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
38
189
  var _b;
@@ -82,11 +233,20 @@ exports.salesforceMarketingCloud = (0, pieces_framework_1.createPiece)({
82
233
  upsert_data_extension_row_1.upsertDataExtensionRow,
83
234
  get_data_extension_rows_1.getDataExtensionRows,
84
235
  delete_data_extension_row_1.deleteDataExtensionRow,
236
+ create_data_extension_1.createDataExtension,
237
+ delete_data_extension_1.deleteDataExtension,
85
238
  trigger_journey_event_1.triggerJourneyEvent,
86
239
  get_journey_status_1.getJourneyStatus,
240
+ create_journey_1.createJourney,
241
+ activate_journey_1.activateJourney,
242
+ pause_journey_1.pauseJourney,
87
243
  send_triggered_email_1.sendTriggeredEmail,
244
+ send_transactional_email_1.sendTransactionalEmail,
88
245
  send_sms_message_1.sendSmsMessage,
89
246
  create_update_contact_1.createUpdateContact,
247
+ start_automation_1.startAutomation,
248
+ pause_automation_1.pauseAutomation,
249
+ get_automation_status_1.getAutomationStatus,
90
250
  (0, pieces_common_1.createCustomApiCallAction)({
91
251
  baseUrl: (auth) => {
92
252
  var _a;
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,oEAKuC;AACvC,gDAAoG;AACpG,8DAKoC;AACpC,uFAAiF;AACjF,mFAA6E;AAC7E,uFAAiF;AACjF,+EAA0E;AAC1E,yEAAoE;AACpE,6EAAwE;AACxE,qEAAgE;AAChE,+EAA0E;AAE7D,QAAA,QAAQ,GAAG,4BAAS,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE;;;;;;6FAM+E;IAC5F,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,uDAA8C;IACzD,KAAK,EAAE;QACN,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EACV,0LAA0L;YAC3L,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACD,OAAO,EAAE,4BAA4B;IACrC,QAAQ,EAAE,wBAAwB;IAClC,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACxB,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,IAA2B,CAAC;YAC9C,MAAM,eAAe,GAAG,MAAA,SAAS,CAAC,IAAI,0CAAG,mBAAmB,CAEhD,CAAC;YACb,IAAI,CAAC,eAAe,EAAE,CAAC;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AmB,CACG,CAAC;gBACxB,OAAO,eAAe;oBACrB,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;oBACpC,CAAC,CAAC,EAAE,CAAC;YACP,CAAC;YACD,IAAI,EAAE,gBAAQ;YACd,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC7B,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACrE,CAAC,CAAA;cAAA;SACF,CAAC;KACF;IACD,QAAQ,EAAE,EAAE;CACZ,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const activateJourney: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ journeyId: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ versionNumber: import("@scopieflows/pieces-framework").NumberProperty<false>;
4
+ }>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.activateJourney = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.activateJourney = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'activate_journey',
12
+ displayName: 'Activate Journey',
13
+ description: 'Activates a draft or paused journey in Journey Builder, making it live for contacts to enter.',
14
+ props: {
15
+ journeyId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Journey ID',
17
+ description: 'The unique ID of the journey to activate.',
18
+ required: true,
19
+ }),
20
+ versionNumber: pieces_framework_1.Property.Number({
21
+ displayName: 'Version Number',
22
+ description: 'The journey version to activate. Defaults to 1.',
23
+ required: false,
24
+ }),
25
+ },
26
+ run(context) {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ const { journeyId, versionNumber } = context.propsValue;
29
+ const auth = context.auth;
30
+ const version = versionNumber !== null && versionNumber !== void 0 ? versionNumber : 1;
31
+ const response = yield (0, common_1.sfmcApiCall)({
32
+ auth,
33
+ method: pieces_common_1.HttpMethod.POST,
34
+ path: `/interaction/v1/interactions/publishAsync/${encodeURIComponent(journeyId)}`,
35
+ queryParams: {
36
+ versionNumber: String(version),
37
+ },
38
+ });
39
+ return response.body;
40
+ });
41
+ },
42
+ });
43
+ //# sourceMappingURL=activate-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activate-journey.js","sourceRoot":"","sources":["../../../../src/lib/actions/activate-journey.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACV,+FAA+F;IAChG,KAAK,EAAE;QACN,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EACV,2CAA2C;YAC5C,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC9B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACV,iDAAiD;YAClD,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,OAAO,GAAG,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,6CAA6C,kBAAkB,CAAC,SAAS,CAAC,EAAE;gBAClF,WAAW,EAAE;oBACZ,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC;iBAC9B;aACD,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const createDataExtension: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ name: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ customerKey: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
4
+ description: import("@scopieflows/pieces-framework").LongTextProperty<false>;
5
+ isSendable: import("@scopieflows/pieces-framework").CheckboxProperty<false>;
6
+ isTestable: import("@scopieflows/pieces-framework").CheckboxProperty<false>;
7
+ fields: import("@scopieflows/pieces-framework").JsonProperty<true>;
8
+ }>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDataExtension = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.createDataExtension = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'create_data_extension',
12
+ displayName: 'Create Data Extension',
13
+ description: 'Creates a new Data Extension in Salesforce Marketing Cloud.',
14
+ props: {
15
+ name: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Name',
17
+ description: 'The name of the Data Extension.',
18
+ required: true,
19
+ }),
20
+ customerKey: pieces_framework_1.Property.ShortText({
21
+ displayName: 'External Key',
22
+ description: 'A unique external key for the Data Extension. If left empty, one will be auto-generated.',
23
+ required: false,
24
+ }),
25
+ description: pieces_framework_1.Property.LongText({
26
+ displayName: 'Description',
27
+ description: 'A description of the Data Extension.',
28
+ required: false,
29
+ }),
30
+ isSendable: pieces_framework_1.Property.Checkbox({
31
+ displayName: 'Sendable',
32
+ description: 'Whether this Data Extension can be used for sending emails.',
33
+ required: false,
34
+ defaultValue: false,
35
+ }),
36
+ isTestable: pieces_framework_1.Property.Checkbox({
37
+ displayName: 'Testable',
38
+ description: 'Whether this Data Extension can be used for test sends.',
39
+ required: false,
40
+ defaultValue: false,
41
+ }),
42
+ fields: pieces_framework_1.Property.Json({
43
+ displayName: 'Fields (JSON)',
44
+ description: 'A JSON array of field definitions. Each field should have "name", "fieldType" (Text, Number, Date, Boolean, EmailAddress, Phone, Decimal, Locale), and optionally "maxLength", "isPrimaryKey", "isRequired", "defaultValue".\n\nExample:\n```json\n[\n {"name": "EmailAddress", "fieldType": "EmailAddress", "isPrimaryKey": true, "isRequired": true, "maxLength": 254},\n {"name": "FirstName", "fieldType": "Text", "maxLength": 50},\n {"name": "Age", "fieldType": "Number"}\n]\n```',
45
+ required: true,
46
+ }),
47
+ },
48
+ run(context) {
49
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
50
+ const { name, customerKey, description, isSendable, isTestable, fields } = context.propsValue;
51
+ const auth = context.auth;
52
+ const parsedFields = typeof fields === 'string' ? JSON.parse(fields) : fields;
53
+ const body = {
54
+ name,
55
+ fields: parsedFields,
56
+ };
57
+ if (customerKey)
58
+ body['customerKey'] = customerKey;
59
+ if (description)
60
+ body['description'] = description;
61
+ if (isSendable)
62
+ body['isSendable'] = isSendable;
63
+ if (isTestable)
64
+ body['isTestable'] = isTestable;
65
+ const response = yield (0, common_1.sfmcApiCall)({
66
+ auth,
67
+ method: pieces_common_1.HttpMethod.POST,
68
+ path: '/data/v1/customobjectdata',
69
+ body,
70
+ });
71
+ return response.body;
72
+ });
73
+ },
74
+ });
75
+ //# sourceMappingURL=create-data-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-data-extension.js","sourceRo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MAAM,EAAE,GACvE,OAAO,CAAC,UAAU,CAAC;YACpB,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAE9E,MAAM,IAAI,GAA4B;gBACrC,IAAI;gBACJ,MAAM,EAAE,YAAY;aACpB,CAAC;YACF,IAAI,WAAW;gBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACnD,IAAI,WAAW;gBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACnD,IAAI,UAAU;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAChD,IAAI,UAAU;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAEhD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,2BAA2B;gBACjC,IAAI;aACJ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const createJourney: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ journeyDefinition: import("@scopieflows/pieces-framework").JsonProperty<true>;
3
+ }>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createJourney = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.createJourney = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'create_journey',
12
+ displayName: 'Create Journey',
13
+ description: 'Creates a new journey in Journey Builder using a JSON journey definition.',
14
+ props: {
15
+ journeyDefinition: pieces_framework_1.Property.Json({
16
+ displayName: 'Journey Definition (JSON)',
17
+ description: 'The full journey definition as JSON. See the SFMC Journey Builder REST API documentation for the schema. At minimum, include "name" and "key" fields.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { journeyDefinition } = context.propsValue;
24
+ const auth = context.auth;
25
+ const parsed = typeof journeyDefinition === 'string'
26
+ ? JSON.parse(journeyDefinition)
27
+ : journeyDefinition;
28
+ const response = yield (0, common_1.sfmcApiCall)({
29
+ auth,
30
+ method: pieces_common_1.HttpMethod.POST,
31
+ path: '/interaction/v1/interactions',
32
+ body: parsed,
33
+ });
34
+ return response.body;
35
+ });
36
+ },
37
+ });
38
+ //# sourceMappingURL=create-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-journey.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-journey.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACV,2EAA2E;IAC5E,KAAK,EAAE;QACN,iBAAiB,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAChC,WAAW,EAAE,2BAA2B;YACxC,WAAW,EACV,uJAAuJ;YACxJ,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACjD,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,MAAM,GACX,OAAO,iBAAiB,KAAK,QAAQ;gBACpC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;gBAC/B,CAAC,CAAC,iBAAiB,CAAC;YAEtB,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,8BAA8B;gBACpC,IAAI,EAAE,MAAM;aACZ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const deleteDataExtension: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ externalKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteDataExtension = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.deleteDataExtension = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'delete_data_extension',
12
+ displayName: 'Delete Data Extension',
13
+ description: 'Deletes a Data Extension from Salesforce Marketing Cloud.',
14
+ props: {
15
+ externalKey: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Data Extension External Key',
17
+ description: 'The external key of the Data Extension to delete.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { externalKey } = context.propsValue;
24
+ const auth = context.auth;
25
+ const response = yield (0, common_1.sfmcApiCall)({
26
+ auth,
27
+ method: pieces_common_1.HttpMethod.DELETE,
28
+ path: `/data/v1/customobjectdata/key/${encodeURIComponent(externalKey)}`,
29
+ });
30
+ return response.body;
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=delete-data-extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-data-extension.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-data-extension.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACV,2DAA2D;IAC5D,KAAK,EAAE;QACN,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EACV,mDAAmD;YACpD,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,IAAI,EAAE,iCAAiC,kBAAkB,CAAC,WAAW,CAAC,EAAE;aACxE,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getAutomationStatus: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ automationId: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAutomationStatus = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.getAutomationStatus = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'get_automation_status',
12
+ displayName: 'Get Automation Status',
13
+ description: 'Retrieves the current status and details of an automation in Automation Studio.',
14
+ props: {
15
+ automationId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Automation ID',
17
+ description: 'The unique ID of the automation. Find it in Automation Studio by opening the automation — the ID is in the URL.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { automationId } = context.propsValue;
24
+ const auth = context.auth;
25
+ const response = yield (0, common_1.sfmcApiCall)({
26
+ auth,
27
+ method: pieces_common_1.HttpMethod.GET,
28
+ path: `/automation/v1/automations/${encodeURIComponent(automationId)}`,
29
+ });
30
+ return response.body;
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=get-automation-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-automation-status.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-automation-status.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACV,iFAAiF;IAClF,KAAK,EAAE;QACN,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EACV,iHAAiH;YAClH,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,YAAY,CAAC,EAAE;aACtE,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const pauseAutomation: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ automationId: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pauseAutomation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.pauseAutomation = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'pause_automation',
12
+ displayName: 'Pause Automation',
13
+ description: 'Pauses a running automation in Automation Studio.',
14
+ props: {
15
+ automationId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Automation ID',
17
+ description: 'The unique ID of the automation to pause.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { automationId } = context.propsValue;
24
+ const auth = context.auth;
25
+ const response = yield (0, common_1.sfmcApiCall)({
26
+ auth,
27
+ method: pieces_common_1.HttpMethod.POST,
28
+ path: `/automation/v1/automations/${encodeURIComponent(automationId)}/actions/pause`,
29
+ });
30
+ return response.body;
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=pause-automation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-automation.js","sourceRoot":"","sources":["../../../../src/lib/actions/pause-automation.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACV,mDAAmD;IACpD,KAAK,EAAE;QACN,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EACV,2CAA2C;YAC5C,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,YAAY,CAAC,gBAAgB;aACpF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const pauseJourney: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ journeyId: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ versionNumber: import("@scopieflows/pieces-framework").NumberProperty<false>;
4
+ }>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pauseJourney = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.pauseJourney = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'pause_journey',
12
+ displayName: 'Pause Journey',
13
+ description: 'Pauses an active journey in Journey Builder. Contacts currently in the journey will be held at their current step.',
14
+ props: {
15
+ journeyId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Journey ID',
17
+ description: 'The unique ID of the journey to pause.',
18
+ required: true,
19
+ }),
20
+ versionNumber: pieces_framework_1.Property.Number({
21
+ displayName: 'Version Number',
22
+ description: 'The journey version to pause. Defaults to 1.',
23
+ required: false,
24
+ }),
25
+ },
26
+ run(context) {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ const { journeyId, versionNumber } = context.propsValue;
29
+ const auth = context.auth;
30
+ const version = versionNumber !== null && versionNumber !== void 0 ? versionNumber : 1;
31
+ const response = yield (0, common_1.sfmcApiCall)({
32
+ auth,
33
+ method: pieces_common_1.HttpMethod.POST,
34
+ path: `/interaction/v1/interactions/pause/${encodeURIComponent(journeyId)}`,
35
+ queryParams: {
36
+ versionNumber: String(version),
37
+ },
38
+ });
39
+ return response.body;
40
+ });
41
+ },
42
+ });
43
+ //# sourceMappingURL=pause-journey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-journey.js","sourceRoot":"","sources":["../../../../src/lib/actions/pause-journey.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACV,oHAAoH;IACrH,KAAK,EAAE;QACN,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EACV,wCAAwC;YACzC,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC9B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACV,8CAA8C;YAC/C,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,OAAO,GAAG,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,CAAC,CAAC;YAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,sCAAsC,kBAAkB,CAAC,SAAS,CAAC,EAAE;gBAC3E,WAAW,EAAE;oBACZ,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC;iBAC9B;aACD,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const sendTransactionalEmail: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ definitionKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ recipientEmail: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
4
+ recipientContactKey: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
5
+ attributes: import("@scopieflows/pieces-framework").ObjectProperty<false>;
6
+ }>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendTransactionalEmail = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.sendTransactionalEmail = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'send_transactional_email',
12
+ displayName: 'Send Transactional Email',
13
+ description: 'Sends a transactional email using the Transactional Messaging API. Use this for order confirmations, password resets, and other real-time messages.',
14
+ props: {
15
+ definitionKey: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Email Definition Key',
17
+ description: 'The key of the transactional email send definition. Create one in SFMC under Email Studio > Transactional Send.',
18
+ required: true,
19
+ }),
20
+ recipientEmail: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Recipient Email',
22
+ description: 'The email address to send to.',
23
+ required: true,
24
+ }),
25
+ recipientContactKey: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Recipient Contact Key',
27
+ description: 'The unique contact key for the recipient. If left empty, the email address is used.',
28
+ required: false,
29
+ }),
30
+ attributes: pieces_framework_1.Property.Object({
31
+ displayName: 'Personalization Attributes',
32
+ description: 'Key-value pairs for email personalization (e.g. {"FirstName": "John", "OrderNumber": "12345"}).',
33
+ required: false,
34
+ }),
35
+ },
36
+ run(context) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ const { definitionKey, recipientEmail, recipientContactKey, attributes } = context.propsValue;
39
+ const auth = context.auth;
40
+ const recipient = {
41
+ contactKey: recipientContactKey || recipientEmail,
42
+ to: recipientEmail,
43
+ };
44
+ if (attributes && Object.keys(attributes).length > 0) {
45
+ recipient['attributes'] = attributes;
46
+ }
47
+ const response = yield (0, common_1.sfmcApiCall)({
48
+ auth,
49
+ method: pieces_common_1.HttpMethod.POST,
50
+ path: `/messaging/v1/email/messages/${encodeURIComponent(definitionKey)}`,
51
+ body: {
52
+ definitionKey,
53
+ recipients: [recipient],
54
+ },
55
+ });
56
+ return response.body;
57
+ });
58
+ },
59
+ });
60
+ //# sourceMappingURL=send-transactional-email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-transactional-email.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-transactional-email.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,0BAA0B;IACvC,WAAW,EACV,qJAAqJ;IACtJ,KAAK,EAAE;QACN,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,sBAAsB;YACnC,WAAW,EACV,iHAAiH;YAClH,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,cAAc,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAClC,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,mBAAmB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvC,WAAW,EAAE,uBAAuB;YACpC,WAAW,EACV,qFAAqF;YACtF,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC3B,WAAW,EAAE,4BAA4B;YACzC,WAAW,EACV,iGAAiG;YAClG,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,UAAU,EAAE,GACvE,OAAO,CAAC,UAAU,CAAC;YACpB,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,SAAS,GAA4B;gBAC1C,UAAU,EAAE,mBAAmB,IAAI,cAAc;gBACjD,EAAE,EAAE,cAAc;aAClB,CAAC;YACF,IAAI,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtD,SAAS,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YACtC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,gCAAgC,kBAAkB,CAAC,aAAa,CAAC,EAAE;gBACzE,IAAI,EAAE;oBACL,aAAa;oBACb,UAAU,EAAE,CAAC,SAAS,CAAC;iBACvB;aACD,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const startAutomation: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
2
+ automationId: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startAutomation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@scopieflows/pieces-framework");
6
+ const pieces_common_1 = require("@scopieflows/pieces-common");
7
+ const __1 = require("../../");
8
+ const common_1 = require("../common");
9
+ exports.startAutomation = (0, pieces_framework_1.createAction)({
10
+ auth: __1.sfmcAuth,
11
+ name: 'start_automation',
12
+ displayName: 'Start Automation',
13
+ description: 'Starts an automation in Automation Studio. The automation must be in an active or stopped state.',
14
+ props: {
15
+ automationId: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Automation ID',
17
+ description: 'The unique ID of the automation. Find it in Automation Studio by opening the automation — the ID is in the URL.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { automationId } = context.propsValue;
24
+ const auth = context.auth;
25
+ const response = yield (0, common_1.sfmcApiCall)({
26
+ auth,
27
+ method: pieces_common_1.HttpMethod.POST,
28
+ path: `/automation/v1/automations/${encodeURIComponent(automationId)}/actions/start`,
29
+ });
30
+ return response.body;
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=start-automation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start-automation.js","sourceRoot":"","sources":["../../../../src/lib/actions/start-automation.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACV,kGAAkG;IACnG,KAAK,EAAE;QACN,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EACV,iHAAiH;YAClH,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,YAAY,CAAC,gBAAgB;aACpF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}