@scopieflows/app-salesforce-marketing-cloud 0.1.3 → 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 +28 -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/create-update-contact.d.ts +5 -0
- package/src/lib/actions/create-update-contact.js +71 -0
- package/src/lib/actions/create-update-contact.js.map +1 -0
- package/src/lib/actions/delete-data-extension-row.d.ts +4 -0
- package/src/lib/actions/delete-data-extension-row.js +46 -0
- package/src/lib/actions/delete-data-extension-row.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/get-journey-status.d.ts +4 -0
- package/src/lib/actions/get-journey-status.js +43 -0
- package/src/lib/actions/get-journey-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-sms-message.d.ts +7 -0
- package/src/lib/actions/send-sms-message.js +74 -0
- package/src/lib/actions/send-sms-message.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/send-triggered-email.d.ts +6 -0
- package/src/lib/actions/send-triggered-email.js +66 -0
- package/src/lib/actions/send-triggered-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
|
@@ -7,7 +7,21 @@ const shared_1 = require("@scopieflows/shared");
|
|
|
7
7
|
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
|
+
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");
|
|
10
13
|
const trigger_journey_event_1 = require("./lib/actions/trigger-journey-event");
|
|
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");
|
|
18
|
+
const send_triggered_email_1 = require("./lib/actions/send-triggered-email");
|
|
19
|
+
const send_transactional_email_1 = require("./lib/actions/send-transactional-email");
|
|
20
|
+
const send_sms_message_1 = require("./lib/actions/send-sms-message");
|
|
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");
|
|
11
25
|
exports.sfmcAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
12
26
|
description: `Connect your Salesforce Marketing Cloud account.
|
|
13
27
|
|
|
@@ -76,7 +90,21 @@ exports.salesforceMarketingCloud = (0, pieces_framework_1.createPiece)({
|
|
|
76
90
|
actions: [
|
|
77
91
|
upsert_data_extension_row_1.upsertDataExtensionRow,
|
|
78
92
|
get_data_extension_rows_1.getDataExtensionRows,
|
|
93
|
+
delete_data_extension_row_1.deleteDataExtensionRow,
|
|
94
|
+
create_data_extension_1.createDataExtension,
|
|
95
|
+
delete_data_extension_1.deleteDataExtension,
|
|
79
96
|
trigger_journey_event_1.triggerJourneyEvent,
|
|
97
|
+
get_journey_status_1.getJourneyStatus,
|
|
98
|
+
create_journey_1.createJourney,
|
|
99
|
+
activate_journey_1.activateJourney,
|
|
100
|
+
pause_journey_1.pauseJourney,
|
|
101
|
+
send_triggered_email_1.sendTriggeredEmail,
|
|
102
|
+
send_transactional_email_1.sendTransactionalEmail,
|
|
103
|
+
send_sms_message_1.sendSmsMessage,
|
|
104
|
+
create_update_contact_1.createUpdateContact,
|
|
105
|
+
start_automation_1.startAutomation,
|
|
106
|
+
pause_automation_1.pauseAutomation,
|
|
107
|
+
get_automation_status_1.getAutomationStatus,
|
|
80
108
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
81
109
|
baseUrl: (auth) => {
|
|
82
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,+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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,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,C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U;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,5 @@
|
|
|
1
|
+
export declare const createUpdateContact: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
|
|
2
|
+
contactKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
emailAddress: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
attributeValues: import("@scopieflows/pieces-framework").ObjectProperty<false>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createUpdateContact = 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.createUpdateContact = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.sfmcAuth,
|
|
11
|
+
name: 'create_update_contact',
|
|
12
|
+
displayName: 'Create or Update Contact',
|
|
13
|
+
description: 'Creates a new contact or updates an existing one in Salesforce Marketing Cloud.',
|
|
14
|
+
props: {
|
|
15
|
+
contactKey: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Contact Key',
|
|
17
|
+
description: 'The unique identifier for the contact (usually Subscriber Key).',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
emailAddress: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Email Address',
|
|
22
|
+
description: 'The contact email address.',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
attributeValues: pieces_framework_1.Property.Object({
|
|
26
|
+
displayName: 'Attribute Values',
|
|
27
|
+
description: 'Key-value pairs of contact attributes to set (e.g. {"FirstName": "John", "LastName": "Doe"}).',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
run(context) {
|
|
32
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const { contactKey, emailAddress, attributeValues } = context.propsValue;
|
|
34
|
+
const auth = context.auth;
|
|
35
|
+
const contactPayload = {
|
|
36
|
+
contactKey,
|
|
37
|
+
};
|
|
38
|
+
if (emailAddress) {
|
|
39
|
+
contactPayload['channels'] = [
|
|
40
|
+
{
|
|
41
|
+
channelType: 'email',
|
|
42
|
+
address: emailAddress,
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
if (attributeValues && Object.keys(attributeValues).length > 0) {
|
|
47
|
+
contactPayload['attributeSets'] = [
|
|
48
|
+
{
|
|
49
|
+
name: 'Email Addresses',
|
|
50
|
+
items: [
|
|
51
|
+
{
|
|
52
|
+
values: Object.entries(attributeValues).map(([key, value]) => ({
|
|
53
|
+
name: key,
|
|
54
|
+
value,
|
|
55
|
+
})),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
const response = yield (0, common_1.sfmcApiCall)({
|
|
62
|
+
auth,
|
|
63
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
64
|
+
path: '/contacts/v1/contacts',
|
|
65
|
+
body: contactPayload,
|
|
66
|
+
});
|
|
67
|
+
return response.body;
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=create-update-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-update-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-update-contact.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,0BAA0B;IACvC,WAAW,EACV,iFAAiF;IAClF,KAAK,EAAE;QACN,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACV,iEAAiE;YAClE,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;SACf,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAChC,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACV,+FAA+F;YAChG,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACzE,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,cAAc,GAA4B;gBAC/C,UAAU;aACV,CAAC;YAEF,IAAI,YAAY,EAAE,CAAC;gBAClB,cAAc,CAAC,UAAU,CAAC,GAAG;oBAC5B;wBACC,WAAW,EAAE,OAAO;wBACpB,OAAO,EAAE,YAAY;qBACrB;iBACD,CAAC;YACH,CAAC;YAED,IAAI,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChE,cAAc,CAAC,eAAe,CAAC,GAAG;oBACjC;wBACC,IAAI,EAAE,iBAAiB;wBACvB,KAAK,EAAE;4BACN;gCACC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,GAAG,CAC1C,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;oCAClB,IAAI,EAAE,GAAG;oCACT,KAAK;iCACL,CAAC,CACF;6BACD;yBACD;qBACD;iBACD,CAAC;YACH,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,cAAc;aACpB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACtB,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const deleteDataExtensionRow: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
|
|
2
|
+
externalKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
primaryKeys: import("@scopieflows/pieces-framework").ObjectProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteDataExtensionRow = 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.deleteDataExtensionRow = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.sfmcAuth,
|
|
11
|
+
name: 'delete_data_extension_row',
|
|
12
|
+
displayName: 'Delete Data Extension Row',
|
|
13
|
+
description: 'Deletes a row from a Data Extension by its primary key values.',
|
|
14
|
+
props: {
|
|
15
|
+
externalKey: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Data Extension External Key',
|
|
17
|
+
description: 'The external key of the Data Extension. Find it in SFMC under Email Studio > Subscribers > Data Extensions — click the Data Extension and copy the "External Key" value.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
primaryKeys: pieces_framework_1.Property.Object({
|
|
21
|
+
displayName: 'Primary Key Values',
|
|
22
|
+
description: 'Key-value pairs of the primary key columns that identify the row to delete (e.g. {"EmailAddress": "john@example.com"}).',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
run(context) {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const { externalKey, primaryKeys } = context.propsValue;
|
|
29
|
+
const auth = context.auth;
|
|
30
|
+
const keys = Object.entries(primaryKeys).map(([key, value]) => ({
|
|
31
|
+
Key: key,
|
|
32
|
+
Value: value,
|
|
33
|
+
}));
|
|
34
|
+
const response = yield (0, common_1.sfmcApiCall)({
|
|
35
|
+
auth,
|
|
36
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
37
|
+
path: `/hub/v1/dataevents/key:${externalKey}/rows`,
|
|
38
|
+
body: {
|
|
39
|
+
keys,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
return response.body;
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=delete-data-extension-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-data-extension-row.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-data-extension-row.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,2BAA2B;IACjC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EACV,gEAAgE;IACjE,KAAK,EAAE;QACN,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EACV,0KAA0K;YAC3K,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,oBAAoB;YACjC,WAAW,EACV,yHAAyH;YAC1H,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC/D,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,KAAK;aACZ,CAAC,CAAC,CAAC;YAEJ,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,IAAI,EAAE,0BAA0B,WAAW,OAAO;gBAClD,IAAI,EAAE;oBACL,IAAI;iBACJ;aACD,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,4 @@
|
|
|
1
|
+
export declare const getJourneyStatus: 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.getJourneyStatus = 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.getJourneyStatus = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.sfmcAuth,
|
|
11
|
+
name: 'get_journey_status',
|
|
12
|
+
displayName: 'Get Journey Status',
|
|
13
|
+
description: 'Retrieves the status and details of a Journey Builder journey.',
|
|
14
|
+
props: {
|
|
15
|
+
journeyId: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Journey ID',
|
|
17
|
+
description: 'The unique ID of the journey. Find it in Journey Builder by opening the journey — the ID is in the URL or in the journey details.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
versionNumber: pieces_framework_1.Property.Number({
|
|
21
|
+
displayName: 'Version Number',
|
|
22
|
+
description: 'The journey version number to check. Defaults to 1 if not specified.',
|
|
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.GET,
|
|
34
|
+
path: `/interaction/v1/interactions/${journeyId}`,
|
|
35
|
+
queryParams: {
|
|
36
|
+
versionNumber: String(version),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
return response.body;
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=get-journey-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-journey-status.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-journey-status.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACV,gEAAgE;IACjE,KAAK,EAAE;QACN,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EACV,mIAAmI;YACpI,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC9B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACV,sEAAsE;YACvE,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,GAAG;gBACtB,IAAI,EAAE,gCAAgC,SAAS,EAAE;gBACjD,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,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,7 @@
|
|
|
1
|
+
export declare const sendSmsMessage: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
|
|
2
|
+
definitionKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
subscriberKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
mobileNumber: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
subscriptionName: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
6
|
+
messageText: import("@scopieflows/pieces-framework").LongTextProperty<false>;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSmsMessage = 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.sendSmsMessage = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.sfmcAuth,
|
|
11
|
+
name: 'send_sms_message',
|
|
12
|
+
displayName: 'Send SMS Message',
|
|
13
|
+
description: 'Sends a transactional SMS message to a mobile number using a triggered send definition.',
|
|
14
|
+
props: {
|
|
15
|
+
definitionKey: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'API Event Definition Key',
|
|
17
|
+
description: 'The key of the transactional SMS send definition. Find it in SFMC under MobileConnect or Journey Builder.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
subscriberKey: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Subscriber Key',
|
|
22
|
+
description: 'The unique identifier for the subscriber receiving the SMS.',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
mobileNumber: pieces_framework_1.Property.ShortText({
|
|
26
|
+
displayName: 'Mobile Number',
|
|
27
|
+
description: 'The recipient mobile number in international format (e.g. "+15551234567").',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
subscriptionName: pieces_framework_1.Property.ShortText({
|
|
31
|
+
displayName: 'Keyword',
|
|
32
|
+
description: 'The keyword associated with the SMS short/long code.',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
messageText: pieces_framework_1.Property.LongText({
|
|
36
|
+
displayName: 'Message Text (Override)',
|
|
37
|
+
description: 'Optional override for the SMS message content. If left empty, the template from the definition is used.',
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
run(context) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const { definitionKey, subscriberKey, mobileNumber, subscriptionName, messageText } = context.propsValue;
|
|
44
|
+
const auth = context.auth;
|
|
45
|
+
const recipient = {
|
|
46
|
+
subscriberKey,
|
|
47
|
+
to: mobileNumber,
|
|
48
|
+
};
|
|
49
|
+
if (subscriptionName) {
|
|
50
|
+
recipient['attributes'] = { subscriptionName };
|
|
51
|
+
}
|
|
52
|
+
const body = {
|
|
53
|
+
definitionKey,
|
|
54
|
+
recipients: [recipient],
|
|
55
|
+
};
|
|
56
|
+
if (messageText) {
|
|
57
|
+
body['subscriptions'] = {
|
|
58
|
+
shortCode: subscriptionName !== null && subscriptionName !== void 0 ? subscriptionName : '',
|
|
59
|
+
};
|
|
60
|
+
body['content'] = {
|
|
61
|
+
message: messageText,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const response = yield (0, common_1.sfmcApiCall)({
|
|
65
|
+
auth,
|
|
66
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
67
|
+
path: '/messaging/v1/sms/messages',
|
|
68
|
+
body,
|
|
69
|
+
});
|
|
70
|
+
return response.body;
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=send-sms-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-sms-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-sms-message.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACV,yFAAyF;IAC1F,KAAK,EAAE;QACN,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,0BAA0B;YACvC,WAAW,EACV,2GAA2G;YAC5G,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACV,6DAA6D;YAC9D,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EACV,4EAA4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AC"}
|
|
@@ -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,IAA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AI,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,6 @@
|
|
|
1
|
+
export declare const sendTriggeredEmail: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").OAuth2Property<import("@scopieflows/pieces-framework").OAuth2Props>, {
|
|
2
|
+
triggeredSendKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
subscriberKey: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
emailAddress: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
5
|
+
attributes: import("@scopieflows/pieces-framework").ObjectProperty<false>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendTriggeredEmail = 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.sendTriggeredEmail = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.sfmcAuth,
|
|
11
|
+
name: 'send_triggered_email',
|
|
12
|
+
displayName: 'Send Triggered Email',
|
|
13
|
+
description: 'Sends a triggered email to one or more subscribers using a triggered send definition.',
|
|
14
|
+
props: {
|
|
15
|
+
triggeredSendKey: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Triggered Send Key',
|
|
17
|
+
description: 'The external key of the triggered send definition. Find it in SFMC under Email Studio > Interactions > Triggered Sends.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
subscriberKey: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Subscriber Key',
|
|
22
|
+
description: 'The unique identifier for the subscriber (usually Subscriber Key or email address).',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
emailAddress: pieces_framework_1.Property.ShortText({
|
|
26
|
+
displayName: 'Email Address',
|
|
27
|
+
description: 'The email address to send to.',
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
attributes: pieces_framework_1.Property.Object({
|
|
31
|
+
displayName: 'Subscriber Attributes',
|
|
32
|
+
description: 'Key-value pairs of subscriber attributes to personalize the email (e.g. {"FirstName": "John", "LastName": "Doe"}).',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
run(context) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const { triggeredSendKey, subscriberKey, emailAddress, attributes } = context.propsValue;
|
|
39
|
+
const auth = context.auth;
|
|
40
|
+
const subscriber = {
|
|
41
|
+
SubscriberKey: subscriberKey,
|
|
42
|
+
EmailAddress: emailAddress,
|
|
43
|
+
};
|
|
44
|
+
if (attributes && Object.keys(attributes).length > 0) {
|
|
45
|
+
subscriber['Attributes'] = attributes;
|
|
46
|
+
}
|
|
47
|
+
const response = yield (0, common_1.sfmcApiCall)({
|
|
48
|
+
auth,
|
|
49
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
50
|
+
path: `/messaging/v1/messageDefinitionSends/key:${triggeredSendKey}/send`,
|
|
51
|
+
body: {
|
|
52
|
+
From: { Address: emailAddress },
|
|
53
|
+
To: {
|
|
54
|
+
Address: emailAddress,
|
|
55
|
+
SubscriberKey: subscriberKey,
|
|
56
|
+
ContactAttributes: {
|
|
57
|
+
SubscriberAttributes: attributes !== null && attributes !== void 0 ? attributes : {},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
return response.body;
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=send-triggered-email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-triggered-email.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-triggered-email.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAAwD;AACxD,8BAAkC;AAClC,sCAAwC;AAG3B,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACV,uFAAuF;IACxF,KAAK,EAAE;QACN,gBAAgB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACpC,WAAW,EAAE,oBAAoB;YACjC,WAAW,EACV,yHAAyH;YAC1H,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACV,qFAAqF;YACtF,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;SACd,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC3B,WAAW,EAAE,uBAAuB;YACpC,WAAW,EACV,oHAAoH;YACrH,QAAQ,EAAE,KAAK;SACf,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,GAClE,OAAO,CAAC,UAAU,CAAC;YACpB,MAAM,IAAI,GAAG,OAAO,CAAC,IAA2B,CAAC;YAEjD,MAAM,UAAU,GAA4B;gBAC3C,aAAa,EAAE,aAAa;gBAC5B,YAAY,EAAE,YAAY;aAC1B,CAAC;YACF,IAAI,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtD,UAAU,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YACvC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAA0B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,4CAA4C,gBAAgB,OAAO;gBACzE,IAAI,EAAE;oBACL,IAAI,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;oBAC/B,EAAE,EAAE;wBACH,OAAO,EAAE,YAAY;wBACrB,aAAa,EAAE,aAAa;wBAC5B,iBAAiB,EAAE;4BAClB,oBAAoB,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE;yBACtC;qBACD;iBACD;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"}
|