@scopieflows/app-salesforce-marketing-cloud 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +18 -0
- package/src/index.js.map +1 -1
- package/src/lib/actions/activate-journey.d.ts +4 -0
- package/src/lib/actions/activate-journey.js +43 -0
- package/src/lib/actions/activate-journey.js.map +1 -0
- package/src/lib/actions/create-data-extension.d.ts +8 -0
- package/src/lib/actions/create-data-extension.js +75 -0
- package/src/lib/actions/create-data-extension.js.map +1 -0
- package/src/lib/actions/create-journey.d.ts +3 -0
- package/src/lib/actions/create-journey.js +38 -0
- package/src/lib/actions/create-journey.js.map +1 -0
- package/src/lib/actions/delete-data-extension.d.ts +3 -0
- package/src/lib/actions/delete-data-extension.js +34 -0
- package/src/lib/actions/delete-data-extension.js.map +1 -0
- package/src/lib/actions/get-automation-status.d.ts +3 -0
- package/src/lib/actions/get-automation-status.js +34 -0
- package/src/lib/actions/get-automation-status.js.map +1 -0
- package/src/lib/actions/pause-automation.d.ts +3 -0
- package/src/lib/actions/pause-automation.js +34 -0
- package/src/lib/actions/pause-automation.js.map +1 -0
- package/src/lib/actions/pause-journey.d.ts +4 -0
- package/src/lib/actions/pause-journey.js +43 -0
- package/src/lib/actions/pause-journey.js.map +1 -0
- package/src/lib/actions/send-transactional-email.d.ts +6 -0
- package/src/lib/actions/send-transactional-email.js +60 -0
- package/src/lib/actions/send-transactional-email.js.map +1 -0
- package/src/lib/actions/start-automation.d.ts +3 -0
- package/src/lib/actions/start-automation.js +34 -0
- package/src/lib/actions/start-automation.js.map +1 -0
package/package.json
CHANGED
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
|
|
|
@@ -82,11 +91,20 @@ exports.salesforceMarketingCloud = (0, pieces_framework_1.createPiece)({
|
|
|
82
91
|
upsert_data_extension_row_1.upsertDataExtensionRow,
|
|
83
92
|
get_data_extension_rows_1.getDataExtensionRows,
|
|
84
93
|
delete_data_extension_row_1.deleteDataExtensionRow,
|
|
94
|
+
create_data_extension_1.createDataExtension,
|
|
95
|
+
delete_data_extension_1.deleteDataExtension,
|
|
85
96
|
trigger_journey_event_1.triggerJourneyEvent,
|
|
86
97
|
get_journey_status_1.getJourneyStatus,
|
|
98
|
+
create_journey_1.createJourney,
|
|
99
|
+
activate_journey_1.activateJourney,
|
|
100
|
+
pause_journey_1.pauseJourney,
|
|
87
101
|
send_triggered_email_1.sendTriggeredEmail,
|
|
102
|
+
send_transactional_email_1.sendTransactionalEmail,
|
|
88
103
|
send_sms_message_1.sendSmsMessage,
|
|
89
104
|
create_update_contact_1.createUpdateContact,
|
|
105
|
+
start_automation_1.startAutomation,
|
|
106
|
+
pause_automation_1.pauseAutomation,
|
|
107
|
+
get_automation_status_1.getAutomationStatus,
|
|
90
108
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
91
109
|
baseUrl: (auth) => {
|
|
92
110
|
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;gBACtB,OAAO;oBACN,KAA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GAAG,IAAA,8BAAW,EAAC;IACnD,WAAW,EAAE,4BAA4B;IACzC,WAAW,EACV,mGAAmG;IACpG,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,wCAAwC;IACjD,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,IAAI,EAAE,gBAAQ;IACd,OAAO,EAAE,EAAE;IACX,OAAO,EAAE;QACR,kDAAsB;QACtB,8CAAoB;QACpB,kDAAsB;QACtB,2CAAmB;QACnB,2CAAmB;QACnB,2CAAmB;QACnB,qCAAgB;QAChB,8BAAa;QACb,kCAAe;QACf,4BAAY;QACZ,yCAAkB;QAClB,iDAAsB;QACtB,iCAAc;QACd,2CAAmB;QACnB,kCAAe;QACf,kCAAe;QACf,2CAAmB;QACnB,IAAA,yCAAyB,EAAC;YACzB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;;gBACjB,MAAM,eAAe,GAAG,MAAC,IAA4B,CAAC,IAAI,0CACzD,mBAAmB,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","sourceRoot":"","sources":["../../../../src/lib/actions/create-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,6DAA6D;IAC9D,KAAK,EAAE;QACN,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACV,0FAA0F;YAC3F,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACnB,CAAC;QACF,UAAU,EAAE,2BAA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: 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"}
|