@segment/action-destinations 3.132.1-intercom-fix.12 → 3.132.1-staging.183
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/dist/destinations/actable-predictive/index.js +1 -1
- package/dist/destinations/actable-predictive/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js +13 -13
- package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js +20 -20
- package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +28 -28
- package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
- package/dist/destinations/actable-predictive/sendWebEvent/index.js +25 -25
- package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
- package/dist/destinations/actions-bingads/functions.d.ts +0 -0
- package/dist/destinations/actions-bingads/functions.js +2 -0
- package/dist/destinations/actions-bingads/functions.js.map +1 -0
- package/dist/destinations/actions-bingads/generated-types.d.ts +10 -0
- package/dist/destinations/actions-bingads/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/index.d.ts +4 -0
- package/dist/destinations/actions-bingads/index.js +77 -0
- package/dist/destinations/actions-bingads/index.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.d.ts +8 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js +33 -0
- package/dist/destinations/actions-bingads/offlineConversions/formatter.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.d.ts +7 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js +3 -0
- package/dist/destinations/actions-bingads/offlineConversions/generated-types.js.map +1 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.d.ts +5 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js +131 -0
- package/dist/destinations/actions-bingads/offlineConversions/index.js.map +1 -0
- package/dist/destinations/braze/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/braze/trackEvent/index.js +35 -11
- package/dist/destinations/braze/trackEvent/index.js.map +1 -1
- package/dist/destinations/braze/trackPurchase/index.js +43 -2
- package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
- package/dist/destinations/braze-cohorts/cohortChanges.d.ts +10 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js +3 -0
- package/dist/destinations/braze-cohorts/cohortChanges.js.map +1 -0
- package/dist/destinations/clevertap/userDelete/index.js +4 -4
- package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
- package/dist/destinations/cordial/addContactToList/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/addContactToList/index.js +2 -7
- package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
- package/dist/destinations/cordial/addProductToCart/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/addProductToCart/index.js +3 -8
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/cordial-client.d.ts +11 -0
- package/dist/destinations/cordial/cordial-client.js +36 -8
- package/dist/destinations/cordial/cordial-client.js.map +1 -1
- package/dist/destinations/cordial/createContactactivity/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/createContactactivity/index.js +2 -7
- package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
- package/dist/destinations/cordial/generated-types.d.ts +1 -0
- package/dist/destinations/cordial/identities-fields.d.ts +3 -0
- package/dist/destinations/cordial/identities-fields.js +28 -0
- package/dist/destinations/cordial/identities-fields.js.map +1 -0
- package/dist/destinations/cordial/index.js +10 -2
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/mergeContacts/generated-types.d.ts +5 -0
- package/dist/destinations/cordial/mergeContacts/generated-types.js +3 -0
- package/dist/destinations/cordial/mergeContacts/generated-types.js.map +1 -0
- package/dist/destinations/cordial/mergeContacts/index.d.ts +5 -0
- package/dist/destinations/cordial/mergeContacts/index.js +40 -0
- package/dist/destinations/cordial/mergeContacts/index.js.map +1 -0
- package/dist/destinations/cordial/removeContactFromList/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/removeContactFromList/index.js +2 -7
- package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js +2 -7
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertContact/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/upsertContact/index.js +2 -7
- package/dist/destinations/cordial/upsertContact/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/generated-types.d.ts +3 -1
- package/dist/destinations/cordial/upsertOrder/index.js +10 -15
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/emarsys/addToContactList/generated-types.d.ts +5 -0
- package/dist/destinations/emarsys/addToContactList/generated-types.js +3 -0
- package/dist/destinations/emarsys/addToContactList/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/addToContactList/index.d.ts +5 -0
- package/dist/destinations/emarsys/addToContactList/index.js +116 -0
- package/dist/destinations/emarsys/addToContactList/index.js.map +1 -0
- package/dist/destinations/emarsys/emarsys-helper.d.ts +63 -0
- package/dist/destinations/emarsys/emarsys-helper.js +88 -0
- package/dist/destinations/emarsys/emarsys-helper.js.map +1 -0
- package/dist/destinations/emarsys/generated-types.d.ts +4 -0
- package/dist/destinations/emarsys/generated-types.js +3 -0
- package/dist/destinations/emarsys/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/index.d.ts +4 -0
- package/dist/destinations/emarsys/index.js +60 -0
- package/dist/destinations/emarsys/index.js.map +1 -0
- package/dist/destinations/emarsys/removeFromContactList/generated-types.d.ts +5 -0
- package/dist/destinations/emarsys/removeFromContactList/generated-types.js +3 -0
- package/dist/destinations/emarsys/removeFromContactList/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/removeFromContactList/index.d.ts +5 -0
- package/dist/destinations/emarsys/removeFromContactList/index.js +115 -0
- package/dist/destinations/emarsys/removeFromContactList/index.js.map +1 -0
- package/dist/destinations/emarsys/triggerEvent/generated-types.d.ts +8 -0
- package/dist/destinations/emarsys/triggerEvent/generated-types.js +3 -0
- package/dist/destinations/emarsys/triggerEvent/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/triggerEvent/index.d.ts +5 -0
- package/dist/destinations/emarsys/triggerEvent/index.js +126 -0
- package/dist/destinations/emarsys/triggerEvent/index.js.map +1 -0
- package/dist/destinations/emarsys/upsertContact/generated-types.d.ts +9 -0
- package/dist/destinations/emarsys/upsertContact/generated-types.js +3 -0
- package/dist/destinations/emarsys/upsertContact/generated-types.js.map +1 -0
- package/dist/destinations/emarsys/upsertContact/index.d.ts +5 -0
- package/dist/destinations/emarsys/upsertContact/index.js +129 -0
- package/dist/destinations/emarsys/upsertContact/index.js.map +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +5 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +1 -0
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.d.ts +1 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +8 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +6 -0
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +5 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +1 -0
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +1 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +1 -1
- package/dist/destinations/google-sheets-partner/constants.d.ts +3 -0
- package/dist/destinations/google-sheets-partner/constants.js +7 -0
- package/dist/destinations/google-sheets-partner/constants.js.map +1 -0
- package/dist/destinations/google-sheets-partner/generated-types.d.ts +2 -0
- package/dist/destinations/google-sheets-partner/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.d.ts +17 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js +34 -0
- package/dist/destinations/google-sheets-partner/googleapis/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/index.d.ts +4 -0
- package/dist/destinations/google-sheets-partner/index.js +43 -0
- package/dist/destinations/google-sheets-partner/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.d.ts +11 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js +3 -0
- package/dist/destinations/google-sheets-partner/postSheet/generated-types.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.d.ts +5 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js +79 -0
- package/dist/destinations/google-sheets-partner/postSheet/index.js.map +1 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.d.ts +10 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js +96 -0
- package/dist/destinations/google-sheets-partner/postSheet/operations.js.map +1 -0
- package/dist/destinations/index.js +3 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/livelike-cloud/trackEvent/generated-types.d.ts +1 -1
- package/dist/destinations/livelike-cloud/trackEvent/index.js +6 -12
- package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/index.js +1 -1
- package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
- package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/dist/destinations/saleswings/index.js +1 -1
- package/dist/destinations/saleswings/index.js.map +1 -1
- package/dist/destinations/segment/segment-properties.js +1 -2
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -1
- package/dist/destinations/tiktok-audiences/api/index.d.ts +11 -0
- package/dist/destinations/tiktok-audiences/api/index.js +38 -0
- package/dist/destinations/tiktok-audiences/api/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/constants.d.ts +2 -0
- package/dist/destinations/tiktok-audiences/constants.js +6 -0
- package/dist/destinations/tiktok-audiences/constants.js.map +1 -0
- package/dist/destinations/tiktok-audiences/generated-types.d.ts +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/index.d.ts +4 -0
- package/dist/destinations/tiktok-audiences/index.js +35 -0
- package/dist/destinations/tiktok-audiences/index.js.map +1 -0
- package/dist/destinations/tiktok-audiences/types.d.ts +33 -0
- package/dist/destinations/tiktok-audiences/types.js +3 -0
- package/dist/destinations/tiktok-audiences/types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/updateAudience/generated-types.d.ts +9 -0
- package/dist/destinations/tiktok-audiences/updateAudience/generated-types.js +3 -0
- package/dist/destinations/tiktok-audiences/updateAudience/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-audiences/updateAudience/index.d.ts +5 -0
- package/dist/destinations/tiktok-audiences/updateAudience/index.js +160 -0
- package/dist/destinations/tiktok-audiences/updateAudience/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/braze/utils.d.ts +0 -6
- package/dist/destinations/braze/utils.js +0 -81
- package/dist/destinations/braze/utils.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userIdentityFields = void 0;
|
|
4
|
+
exports.userIdentityFields = {
|
|
5
|
+
segmentId: {
|
|
6
|
+
label: 'Segment User ID',
|
|
7
|
+
description: 'Segment User ID value',
|
|
8
|
+
type: 'hidden',
|
|
9
|
+
required: false,
|
|
10
|
+
default: { '@path': '$.userId' }
|
|
11
|
+
},
|
|
12
|
+
anonymousId: {
|
|
13
|
+
label: 'Segment Anonymous ID',
|
|
14
|
+
description: 'Segment Anonymous ID value',
|
|
15
|
+
type: 'hidden',
|
|
16
|
+
required: false,
|
|
17
|
+
default: { '@path': '$.anonymousId' }
|
|
18
|
+
},
|
|
19
|
+
userIdentities: {
|
|
20
|
+
label: 'User Identities',
|
|
21
|
+
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. If a contact is found using the identifiers it is updated, otherwise a new contact is created.',
|
|
22
|
+
type: 'object',
|
|
23
|
+
required: false,
|
|
24
|
+
defaultObjectUI: 'keyvalue:only'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.default = exports.userIdentityFields;
|
|
28
|
+
//# sourceMappingURL=identities-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identities-fields.js","sourceRoot":"","sources":["../../../src/destinations/cordial/identities-fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAA+B;IAC5D,SAAS,EAAE;QACT,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;KACjC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,4BAA4B;QACzC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;KACtC;IACD,cAAc,EAAE;QACd,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,6RAA6R;QAC/R,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,eAAe,EAAE,eAAe;KACjC;CACF,CAAA;AAED,kBAAe,0BAAkB,CAAA"}
|
|
@@ -10,6 +10,7 @@ const removeContactFromList_1 = __importDefault(require("./removeContactFromList
|
|
|
10
10
|
const addProductToCart_1 = __importDefault(require("./addProductToCart"));
|
|
11
11
|
const removeProductFromCart_1 = __importDefault(require("./removeProductFromCart"));
|
|
12
12
|
const upsertOrder_1 = __importDefault(require("./upsertOrder"));
|
|
13
|
+
const mergeContacts_1 = __importDefault(require("./mergeContacts"));
|
|
13
14
|
const destination = {
|
|
14
15
|
name: 'Cordial (Actions)',
|
|
15
16
|
description: 'Sync Segment Users, Groups and Events to Cordial',
|
|
@@ -31,6 +32,12 @@ const destination = {
|
|
|
31
32
|
required: true,
|
|
32
33
|
format: 'uri',
|
|
33
34
|
default: 'https://integrations-ingest-svc.usw1.cordial.com'
|
|
35
|
+
},
|
|
36
|
+
segmentIdKey: {
|
|
37
|
+
label: 'User ID attribute key',
|
|
38
|
+
description: 'Cordial string unique attribute key to store Segment User ID in (e.g. `segment_id`)',
|
|
39
|
+
type: 'string',
|
|
40
|
+
required: false
|
|
34
41
|
}
|
|
35
42
|
},
|
|
36
43
|
testAuthentication: (request, { settings }) => {
|
|
@@ -39,7 +46,7 @@ const destination = {
|
|
|
39
46
|
},
|
|
40
47
|
extendRequest({ settings }) {
|
|
41
48
|
return {
|
|
42
|
-
headers: { 'x-api-key': `${settings.apiKey}`,
|
|
49
|
+
headers: { 'x-api-key': `${settings.apiKey}`, Accept: 'application/json' }
|
|
43
50
|
};
|
|
44
51
|
},
|
|
45
52
|
actions: {
|
|
@@ -49,7 +56,8 @@ const destination = {
|
|
|
49
56
|
removeContactFromList: removeContactFromList_1.default,
|
|
50
57
|
addProductToCart: addProductToCart_1.default,
|
|
51
58
|
removeProductFromCart: removeProductFromCart_1.default,
|
|
52
|
-
upsertOrder: upsertOrder_1.default
|
|
59
|
+
upsertOrder: upsertOrder_1.default,
|
|
60
|
+
mergeContacts: mergeContacts_1.default
|
|
53
61
|
}
|
|
54
62
|
};
|
|
55
63
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/cordial/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAC3D,oEAA2C;AAC3C,0EAAiD;AACjD,oFAA2D;AAC3D,0EAAiD;AACjD,oFAA2D;AAC3D,gEAAuC;AAEvC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/cordial/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAC3D,oEAA2C;AAC3C,0EAAiD;AACjD,oFAA2D;AAC3D,0EAAiD;AACjD,oFAA2D;AAC3D,gEAAuC;AAEvC,oEAA2C;AAE3C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,UAAU;gBACjB,WAAW,EACT,mMAAmM;gBACrM,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,kDAAkD;aAC5D;YACD,YAAY,EAAE;gBACZ,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,qFAAqF;gBAClG,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAChB;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,GAAG,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAC3G,CAAC;KACF;IAED,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,EAAE,WAAW,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;SAC3E,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;QACrB,aAAa,EAAb,uBAAa;QACb,gBAAgB,EAAhB,0BAAgB;QAChB,qBAAqB,EAArB,+BAAqB;QACrB,gBAAgB,EAAhB,0BAAgB;QAChB,qBAAqB,EAArB,+BAAqB;QACrB,WAAW,EAAX,qBAAW;QACX,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/mergeContacts/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Merge Contacts',
|
|
9
|
+
description: 'Merge contacts in Cordial.',
|
|
10
|
+
defaultSubscription: 'type = "alias"',
|
|
11
|
+
fields: {
|
|
12
|
+
segmentId: {
|
|
13
|
+
label: 'New Segment User ID',
|
|
14
|
+
description: 'New Segment User ID value',
|
|
15
|
+
type: 'string',
|
|
16
|
+
required: false,
|
|
17
|
+
default: { '@path': '$.userId' }
|
|
18
|
+
},
|
|
19
|
+
anonymousId: {
|
|
20
|
+
label: 'New Segment Anonymous ID',
|
|
21
|
+
description: 'New Segment Anonymous ID value',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: false,
|
|
24
|
+
default: { '@path': '$.anonymousId' }
|
|
25
|
+
},
|
|
26
|
+
previousId: {
|
|
27
|
+
label: 'Previous Segment ID',
|
|
28
|
+
description: 'Previous Segment User or Anonymous ID value',
|
|
29
|
+
type: 'string',
|
|
30
|
+
required: true,
|
|
31
|
+
default: { '@path': '$.previousId' }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
perform: async (request, { settings, payload }) => {
|
|
35
|
+
const client = new cordial_client_1.default(settings, request);
|
|
36
|
+
return client.mergeContacts(payload);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.default = action;
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/mergeContacts/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAE7C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,4BAA4B;IACzC,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;SACtC;QACD,UAAU,EAAE;YACV,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IACtC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,17 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Remove Contact from List',
|
|
9
10
|
description: 'Remove Contact from Cordial List',
|
|
10
11
|
fields: {
|
|
11
|
-
|
|
12
|
-
label: 'User Identities',
|
|
13
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> userId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
14
|
-
type: 'object',
|
|
15
|
-
required: true,
|
|
16
|
-
defaultObjectUI: 'keyvalue:only'
|
|
17
|
-
},
|
|
12
|
+
...identities_fields_1.default,
|
|
18
13
|
groupId: {
|
|
19
14
|
label: 'Group ID',
|
|
20
15
|
description: 'Segment group id. Required.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeContactFromList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeContactFromList/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,kCAAkC;IAC/C,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,18 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Remove Product from Cart',
|
|
9
10
|
description: 'Removes product from Cordial contact cart',
|
|
10
11
|
defaultSubscription: 'type = "track" and event = "Product Removed"',
|
|
11
12
|
fields: {
|
|
12
|
-
|
|
13
|
-
label: 'User Identities',
|
|
14
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
-
type: 'object',
|
|
16
|
-
required: true,
|
|
17
|
-
defaultObjectUI: 'keyvalue:only'
|
|
18
|
-
},
|
|
13
|
+
...identities_fields_1.default,
|
|
19
14
|
productID: {
|
|
20
15
|
label: 'Product ID',
|
|
21
16
|
description: 'Internal identifier of a product',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeProductFromCart/index.ts"],"names":[],"mappings":";;;;;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/removeProductFromCart/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,2CAA2C;IACxD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,yBAAyB;aACnC;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,18 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Upsert Contact',
|
|
9
10
|
description: 'Create or update a contact in Cordial.',
|
|
10
11
|
defaultSubscription: 'type = "identify"',
|
|
11
12
|
fields: {
|
|
12
|
-
|
|
13
|
-
label: 'User Identities',
|
|
14
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. If a contact is found using the identifiers it is updated, otherwise a new contact is created.',
|
|
15
|
-
type: 'object',
|
|
16
|
-
required: true,
|
|
17
|
-
defaultObjectUI: 'keyvalue:only'
|
|
18
|
-
},
|
|
13
|
+
...identities_fields_1.default,
|
|
19
14
|
attributes: {
|
|
20
15
|
label: 'Contact Attributes',
|
|
21
16
|
description: 'Contact attributes to update. Optional. Contact attributes must exist in Cordial prior to updating. Attributes that do not exist in Cordial will be ignored. Complex attribute types to be mapped via dot notation, for example, `cordialPerson.first_name -> traits.segmentPerson.firstName`, `cordialPerson.last_name -> traits.segmentPerson.lastName`. Segment trait address can be mapped directly to geo Cordial attribute: `geo_cordial_attribute -> traits.address`.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertContact/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertContact/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,UAAU,EAAE;YACV,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EACT,8cAA8c;YAChd,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,eAAe;SACjC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,MAAM,MAAM,GAAG,IAAI,wBAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IACtC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,18 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const cordial_client_1 = __importDefault(require("../cordial-client"));
|
|
7
|
+
const identities_fields_1 = __importDefault(require("../identities-fields"));
|
|
7
8
|
const action = {
|
|
8
9
|
title: 'Upsert Order',
|
|
9
10
|
description: 'Upserts order to Cordial',
|
|
10
11
|
defaultSubscription: 'event = "Order Completed" or event = "Order Updated" or event = "Order Refunded" or event = "Order Cancelled"',
|
|
11
12
|
fields: {
|
|
12
|
-
|
|
13
|
-
label: 'User Identities',
|
|
14
|
-
description: 'An ordered list of contact identifiers in Cordial. Each item in the list represents an identifier. For example, `channels.email.address -> userId` and/or `customerId -> traits.customerId`. At least one identifier should be valid otherwise the contact will not be identified and the request will be ignored.',
|
|
15
|
-
type: 'object',
|
|
16
|
-
required: true,
|
|
17
|
-
defaultObjectUI: 'keyvalue:only'
|
|
18
|
-
},
|
|
13
|
+
...identities_fields_1.default,
|
|
19
14
|
orderID: {
|
|
20
15
|
label: 'Order ID',
|
|
21
16
|
description: 'Internal identifier of an order',
|
|
@@ -101,32 +96,32 @@ const action = {
|
|
|
101
96
|
manufacturerName: {
|
|
102
97
|
label: 'Manufacturer name',
|
|
103
98
|
description: 'Manufacturer name of the purchased item.',
|
|
104
|
-
type: 'string'
|
|
99
|
+
type: 'string'
|
|
105
100
|
},
|
|
106
101
|
itemPrice: {
|
|
107
102
|
label: 'Price',
|
|
108
103
|
description: 'Price of the purchased item.',
|
|
109
|
-
type: 'number'
|
|
104
|
+
type: 'number'
|
|
110
105
|
},
|
|
111
106
|
qty: {
|
|
112
107
|
label: 'Quantity',
|
|
113
108
|
description: 'Quantity of the purchased item.',
|
|
114
|
-
type: 'integer'
|
|
109
|
+
type: 'integer'
|
|
115
110
|
},
|
|
116
111
|
url: {
|
|
117
112
|
label: 'URL',
|
|
118
113
|
description: 'URL of the purchased item.',
|
|
119
|
-
type: 'string'
|
|
114
|
+
type: 'string'
|
|
120
115
|
},
|
|
121
116
|
imageUrl: {
|
|
122
117
|
label: 'Image URL',
|
|
123
118
|
description: 'Image URL of the purchased item.',
|
|
124
|
-
type: 'string'
|
|
119
|
+
type: 'string'
|
|
125
120
|
},
|
|
126
121
|
properties: {
|
|
127
122
|
label: 'Properties',
|
|
128
123
|
description: 'Additional properties of the purchased item.',
|
|
129
|
-
type: 'object'
|
|
124
|
+
type: 'object'
|
|
130
125
|
}
|
|
131
126
|
},
|
|
132
127
|
default: {
|
|
@@ -163,12 +158,12 @@ const action = {
|
|
|
163
158
|
properties: {
|
|
164
159
|
variant: { '@path': '$.variant' },
|
|
165
160
|
coupon: { '@path': '$.coupon' }
|
|
166
|
-
}
|
|
161
|
+
}
|
|
167
162
|
}
|
|
168
163
|
]
|
|
169
164
|
},
|
|
170
165
|
defaultObjectUI: 'keyvalue:only'
|
|
171
|
-
}
|
|
166
|
+
}
|
|
172
167
|
},
|
|
173
168
|
perform: (request, { settings, payload }) => {
|
|
174
169
|
const client = new cordial_client_1.default(settings, request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertOrder/index.ts"],"names":[],"mappings":";;;;;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/cordial/upsertOrder/index.ts"],"names":[],"mappings":";;;;;AAGA,uEAA6C;AAC7C,6EAAqD;AAErD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EACjB,+GAA+G;IACjH,MAAM,EAAE;QACN,GAAG,2BAAkB;QACrB,OAAO,EAAE;YACP,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,uBAAuB;aACjC;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,SAAS;aACnB;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,4DAA4D;YACzE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,WAAW,EAAE,EAAE,OAAO,EAAE,0BA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CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/addToContactList/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const emarsys_helper_1 = require("../emarsys-helper");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Add to Contact List',
|
|
7
|
+
description: 'Add a contact to a contact list. The contact must exist before it can be added.',
|
|
8
|
+
fields: {
|
|
9
|
+
contactlistid: {
|
|
10
|
+
label: 'Id of the contact list',
|
|
11
|
+
description: 'The Id of the contactlist',
|
|
12
|
+
type: 'integer',
|
|
13
|
+
required: true,
|
|
14
|
+
dynamic: true
|
|
15
|
+
},
|
|
16
|
+
key_field: {
|
|
17
|
+
label: 'Key field',
|
|
18
|
+
description: 'The field to use to find the contact',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true,
|
|
21
|
+
dynamic: true
|
|
22
|
+
},
|
|
23
|
+
key_value: {
|
|
24
|
+
label: 'Key value',
|
|
25
|
+
description: 'Value for the key field used to find the contact. E.g. the email address ',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
dynamic: false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
dynamicFields: {
|
|
32
|
+
contactlistid: async (request) => {
|
|
33
|
+
return emarsys_helper_1.getContactLists(request);
|
|
34
|
+
},
|
|
35
|
+
key_field: async (request) => {
|
|
36
|
+
return emarsys_helper_1.getFields(request);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
perform: async (request, data) => {
|
|
40
|
+
if (!data?.payload?.key_field)
|
|
41
|
+
throw new actions_core_1.IntegrationError('Missing key field');
|
|
42
|
+
if (!data?.payload?.key_value)
|
|
43
|
+
throw new actions_core_1.IntegrationError('Missing key value');
|
|
44
|
+
data.payload.contactlistid = parseInt(data.payload.contactlistid.toString().replace(/[^0-9]/g, ''));
|
|
45
|
+
if (data.payload.contactlistid > 0) {
|
|
46
|
+
const payload = {
|
|
47
|
+
key_id: data.payload.key_field,
|
|
48
|
+
external_ids: [data.payload.key_value]
|
|
49
|
+
};
|
|
50
|
+
const response = await request(`${emarsys_helper_1.API_BASE}contactlist/${data.payload.contactlistid}/add`, {
|
|
51
|
+
method: 'post',
|
|
52
|
+
json: payload,
|
|
53
|
+
throwHttpErrors: false
|
|
54
|
+
});
|
|
55
|
+
switch (response?.status) {
|
|
56
|
+
case 200:
|
|
57
|
+
try {
|
|
58
|
+
const body = await response.json();
|
|
59
|
+
if (body.replyCode === 0)
|
|
60
|
+
return response;
|
|
61
|
+
else
|
|
62
|
+
throw new actions_core_1.IntegrationError('Something went wrong while adding to contact list');
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
throw new actions_core_1.IntegrationError('Invalid JSON response');
|
|
66
|
+
}
|
|
67
|
+
case 400:
|
|
68
|
+
throw new actions_core_1.IntegrationError('The contact could not be removed from the contact list');
|
|
69
|
+
case 429:
|
|
70
|
+
throw new actions_core_1.RetryableError('Rate limit reached.');
|
|
71
|
+
default:
|
|
72
|
+
throw new actions_core_1.RetryableError('There seems to be an API issue.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
throw new actions_core_1.IntegrationError('ContactlistId must be >0');
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
performBatch: async (request, data) => {
|
|
80
|
+
if (data && data.payload && Array.isArray(data.payload)) {
|
|
81
|
+
const batches = {};
|
|
82
|
+
data.payload.forEach((payload) => {
|
|
83
|
+
if (!batches[`${payload.contactlistid}-${payload.key_field}`]) {
|
|
84
|
+
batches[`${payload.contactlistid}-${payload.key_field}`] = {
|
|
85
|
+
contactlistid: payload.contactlistid,
|
|
86
|
+
key_id: payload.key_field,
|
|
87
|
+
external_ids: []
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (payload.key_value && payload.key_value != '') {
|
|
91
|
+
batches[`${payload.contactlistid}-${payload.key_field}`].external_ids.push(payload.key_value);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const requests = [];
|
|
95
|
+
for (const key in batches) {
|
|
96
|
+
const batch = batches[key];
|
|
97
|
+
const payload = {
|
|
98
|
+
key_id: batch.key_id,
|
|
99
|
+
external_ids: batch.external_ids
|
|
100
|
+
};
|
|
101
|
+
const response = request(`${emarsys_helper_1.API_BASE}contactlist/${batch.contactlistid}/add`, {
|
|
102
|
+
method: 'post',
|
|
103
|
+
json: payload,
|
|
104
|
+
throwHttpErrors: true
|
|
105
|
+
});
|
|
106
|
+
requests.push(response);
|
|
107
|
+
}
|
|
108
|
+
if (requests.length > 0) {
|
|
109
|
+
return Promise.all(requests);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
exports.default = action;
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/addToContactList/index.ts"],"names":[],"mappings":";;AAAA,wDAAwE;AAIxE,sDAO0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,iFAAiF;IAC9F,MAAM,EAAE;QACN,aAAa,EAAE;YACb,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,E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ACzB,YAAY,EAAE,EAAE;qBACjB,CAAA;iBACF;gBACD,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,IAAI,EAAE,EAAE;oBAChD,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;iBAC9F;YACH,CAAC,CAAC,CAAA;YAEF,MAAM,QAAQ,GAAG,EAAE,CAAA;YACnB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;gBACzB,MAAM,KAAK,GAA+B,OAAO,CAAC,GAAG,CAAC,CAAA;gBACtD,MAAM,OAAO,GAA0B;oBACrC,MAAM,EAAE,KAAK,CAAC,MAAM;oBACpB,YAAY,EAAE,KAAK,CAAC,YAAY;iBACjC,CAAA;gBACD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,yBAAQ,eAAe,KAAK,CAAC,aAAa,MAAM,EAAE;oBAC5E,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,OAAO;oBACb,eAAe,EAAE,IAAI;iBACtB,CAAC,CAAA;gBACF,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACxB;YACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;aAC7B;SACF;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Settings } from './generated-types';
|
|
2
|
+
import type { RequestClient } from '@segment/actions-core';
|
|
3
|
+
import { DynamicFieldResponse } from '@segment/actions-core';
|
|
4
|
+
export declare const API_HOST = "https://api.emarsys.net";
|
|
5
|
+
export declare const API_PATH = "/api/v2/";
|
|
6
|
+
export declare const API_BASE: string;
|
|
7
|
+
export interface TriggerEventData {
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface BufferBatchTriggerEventItem {
|
|
11
|
+
event_id: number;
|
|
12
|
+
key_id: string;
|
|
13
|
+
keys: {
|
|
14
|
+
external_id: string;
|
|
15
|
+
data?: TriggerEventData;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
export interface TriggerEventApiPayload {
|
|
19
|
+
key_id: string;
|
|
20
|
+
external_id: string;
|
|
21
|
+
data?: TriggerEventData;
|
|
22
|
+
}
|
|
23
|
+
export interface TriggerEventsApiPayload {
|
|
24
|
+
key_id: string;
|
|
25
|
+
contacts: {
|
|
26
|
+
external_id: string;
|
|
27
|
+
data?: TriggerEventData;
|
|
28
|
+
}[];
|
|
29
|
+
}
|
|
30
|
+
export interface BufferBatchTriggerEvent {
|
|
31
|
+
[k: string]: BufferBatchTriggerEventItem;
|
|
32
|
+
}
|
|
33
|
+
export interface ContactListApiPayload {
|
|
34
|
+
contactlistid?: number;
|
|
35
|
+
key_id: string;
|
|
36
|
+
external_ids: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface BufferBatchContactListItem {
|
|
39
|
+
contactlistid: number;
|
|
40
|
+
key_id: string;
|
|
41
|
+
external_ids: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface BufferBatchContactList {
|
|
44
|
+
[k: string]: BufferBatchContactListItem;
|
|
45
|
+
}
|
|
46
|
+
export interface ContactData {
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
export interface BufferBatchContactItem {
|
|
50
|
+
key_id: string;
|
|
51
|
+
contacts: ContactData[];
|
|
52
|
+
}
|
|
53
|
+
export interface BufferBatchContacts {
|
|
54
|
+
[k: string]: BufferBatchContactItem;
|
|
55
|
+
}
|
|
56
|
+
export interface ContactsApiPayload {
|
|
57
|
+
key_id: string;
|
|
58
|
+
contacts: ContactData[];
|
|
59
|
+
}
|
|
60
|
+
export declare const createWsseHeader: (settings: Settings) => string;
|
|
61
|
+
export declare const getEvents: (request: RequestClient) => Promise<DynamicFieldResponse>;
|
|
62
|
+
export declare const getFields: (request: RequestClient) => Promise<DynamicFieldResponse>;
|
|
63
|
+
export declare const getContactLists: (request: RequestClient) => Promise<DynamicFieldResponse>;
|