@segment/action-destinations 3.251.0 → 3.251.1-staging
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/engage/sendgrid/Profile.d.ts +6 -0
- package/dist/destinations/engage/sendgrid/Profile.js +3 -0
- package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +21 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +174 -0
- package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +1 -0
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js +19 -11
- package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -1
- package/dist/destinations/engage/utils/track.d.ts +17 -17
- package/dist/destinations/klaviyo/index.js +1 -1
- package/dist/destinations/klaviyo/properties.js +1 -1
- package/dist/destinations/linkedin-conversions/api/api.test.js +32 -14
- package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +8 -6
- package/dist/destinations/linkedin-conversions/api/index.js +66 -17
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/constants.d.ts +7 -0
- package/dist/destinations/linkedin-conversions/constants.js +45 -1
- package/dist/destinations/linkedin-conversions/constants.js.map +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +6 -2
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +74 -43
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/types.d.ts +5 -0
- package/dist/destinations/marketo-static-lists/addToList/generated-types.d.ts +13 -1
- package/dist/destinations/marketo-static-lists/addToList/index.js +69 -2
- package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/constants.d.ts +10 -3
- package/dist/destinations/marketo-static-lists/constants.js +2 -14
- package/dist/destinations/marketo-static-lists/constants.js.map +1 -1
- package/dist/destinations/marketo-static-lists/functions.d.ts +18 -1
- package/dist/destinations/marketo-static-lists/functions.js +87 -1
- package/dist/destinations/marketo-static-lists/functions.js.map +1 -1
- package/dist/destinations/marketo-static-lists/index.js +4 -42
- package/dist/destinations/marketo-static-lists/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/properties.js +1 -2
- package/dist/destinations/marketo-static-lists/properties.js.map +1 -1
- package/dist/destinations/marketo-static-lists/removeFromList/generated-types.d.ts +1 -1
- package/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToCart/generated-types.d.ts +28 -0
- package/dist/destinations/moloco-rmp/addToCart/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/addToCart/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToCart/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/addToCart/index.js +44 -0
- package/dist/destinations/moloco-rmp/addToCart/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToWishlist/generated-types.d.ts +32 -0
- package/dist/destinations/moloco-rmp/addToWishlist/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/addToWishlist/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/addToWishlist/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/addToWishlist/index.js +45 -0
- package/dist/destinations/moloco-rmp/addToWishlist/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/convert.d.ts +9 -0
- package/dist/destinations/moloco-rmp/common/convert.js +83 -0
- package/dist/destinations/moloco-rmp/common/convert.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/event.d.ts +10 -0
- package/dist/destinations/moloco-rmp/common/event.js +15 -0
- package/dist/destinations/moloco-rmp/common/event.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/fields.d.ts +14 -0
- package/dist/destinations/moloco-rmp/common/fields.js +348 -0
- package/dist/destinations/moloco-rmp/common/fields.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/payload/moloco.d.ts +35 -0
- package/dist/destinations/moloco-rmp/common/payload/moloco.js +3 -0
- package/dist/destinations/moloco-rmp/common/payload/moloco.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/payload/segment.d.ts +40 -0
- package/dist/destinations/moloco-rmp/common/payload/segment.js +3 -0
- package/dist/destinations/moloco-rmp/common/payload/segment.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/request-client.d.ts +11 -0
- package/dist/destinations/moloco-rmp/common/request-client.js +28 -0
- package/dist/destinations/moloco-rmp/common/request-client.js.map +1 -0
- package/dist/destinations/moloco-rmp/common/settings.d.ts +4 -0
- package/dist/destinations/moloco-rmp/common/settings.js +3 -0
- package/dist/destinations/moloco-rmp/common/settings.js.map +1 -0
- package/dist/destinations/moloco-rmp/generated-types.d.ts +5 -0
- package/dist/destinations/moloco-rmp/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/home/generated-types.d.ts +28 -0
- package/dist/destinations/moloco-rmp/home/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/home/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/home/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/home/index.js +29 -0
- package/dist/destinations/moloco-rmp/home/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/index.d.ts +4 -0
- package/dist/destinations/moloco-rmp/index.js +117 -0
- package/dist/destinations/moloco-rmp/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/itemPageView/generated-types.d.ts +28 -0
- package/dist/destinations/moloco-rmp/itemPageView/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/itemPageView/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/itemPageView/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/itemPageView/index.js +44 -0
- package/dist/destinations/moloco-rmp/itemPageView/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/land/generated-types.d.ts +29 -0
- package/dist/destinations/moloco-rmp/land/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/land/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/land/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/land/index.js +33 -0
- package/dist/destinations/moloco-rmp/land/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/pageView/generated-types.d.ts +29 -0
- package/dist/destinations/moloco-rmp/pageView/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/pageView/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/pageView/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/pageView/index.js +36 -0
- package/dist/destinations/moloco-rmp/pageView/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/purchase/generated-types.d.ts +36 -0
- package/dist/destinations/moloco-rmp/purchase/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/purchase/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/purchase/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/purchase/index.js +37 -0
- package/dist/destinations/moloco-rmp/purchase/index.js.map +1 -0
- package/dist/destinations/moloco-rmp/search/generated-types.d.ts +30 -0
- package/dist/destinations/moloco-rmp/search/generated-types.js +3 -0
- package/dist/destinations/moloco-rmp/search/generated-types.js.map +1 -0
- package/dist/destinations/moloco-rmp/search/index.d.ts +5 -0
- package/dist/destinations/moloco-rmp/search/index.js +34 -0
- package/dist/destinations/moloco-rmp/search/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +14 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js +113 -0
- package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +20 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js +3 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +1 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.d.ts +5 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +174 -0
- package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +1 -0
- package/dist/destinations/responsys/index.d.ts +1 -1
- package/dist/destinations/responsys/index.js +12 -2
- package/dist/destinations/responsys/index.js.map +1 -1
- package/dist/destinations/responsys/rsp-operations.d.ts +14 -0
- package/dist/destinations/responsys/rsp-operations.js +33 -0
- package/dist/destinations/responsys/rsp-operations.js.map +1 -0
- package/dist/destinations/responsys/rsp-properties.d.ts +4 -0
- package/dist/destinations/responsys/rsp-properties.js +27 -0
- package/dist/destinations/responsys/rsp-properties.js.map +1 -0
- package/dist/destinations/responsys/sendAudience/generated-types.d.ts +2 -0
- package/dist/destinations/responsys/sendAudience/index.js +25 -6
- package/dist/destinations/responsys/sendAudience/index.js.map +1 -1
- package/dist/destinations/responsys/sendCustomTraits/generated-types.d.ts +2 -0
- package/dist/destinations/responsys/sendCustomTraits/index.js +25 -6
- package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -1
- package/dist/destinations/responsys/upsertListMember/generated-types.d.ts +1 -0
- package/dist/destinations/responsys/upsertListMember/index.js +8 -1
- package/dist/destinations/responsys/upsertListMember/index.js.map +1 -1
- package/dist/destinations/responsys/utils.d.ts +3 -1
- package/dist/destinations/responsys/utils.js +23 -7
- package/dist/destinations/responsys/utils.js.map +1 -1
- package/dist/destinations/segment-profiles/index.js +3 -1
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +2 -0
- package/dist/destinations/segment-profiles/segment-properties.js +14 -1
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendTrack/generated-types.d.ts +11 -0
- package/dist/destinations/segment-profiles/sendTrack/generated-types.js +3 -0
- package/dist/destinations/segment-profiles/sendTrack/generated-types.js.map +1 -0
- package/dist/destinations/segment-profiles/sendTrack/index.d.ts +5 -0
- package/dist/destinations/segment-profiles/sendTrack/index.js +42 -0
- package/dist/destinations/segment-profiles/sendTrack/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +43 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Page View',
|
|
9
|
+
description: 'Represents a user viewing a certain page that is pertinent to sequence-based ML model training (Ex. a user browsing sneakers)',
|
|
10
|
+
defaultSubscription: 'type = "page" and properties.name != "Home" and properties.name != "Land"',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: fields_1.items,
|
|
19
|
+
page_id: {
|
|
20
|
+
...fields_1.page_id,
|
|
21
|
+
description: fields_1.page_id.description + ' Either page_id or page_identifier_tokens is required.'
|
|
22
|
+
},
|
|
23
|
+
page_identifier_tokens: {
|
|
24
|
+
...fields_1.page_identifier_tokens,
|
|
25
|
+
description: fields_1.page_identifier_tokens.description + ' Either page_id or page_identifier_tokens is required.'
|
|
26
|
+
},
|
|
27
|
+
referrer_page_id: fields_1.referrer_page_id
|
|
28
|
+
},
|
|
29
|
+
perform: (request, { payload, settings }) => {
|
|
30
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
31
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.PageView, payload, settings });
|
|
32
|
+
return client.sendEvent(body);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = action;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/pageView/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAWyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EACT,+HAA+H;IACjI,mBAAmB,EAAE,2EAA2E;IAChG,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAL,cAAK;QACL,OAAO,EAAE;YACP,GAAG,gBAAO;YACV,WAAW,EAAE,gBAAO,CAAC,WAAW,GAAG,wDAAwD;SAC5F;QACD,sBAAsB,EAAE;YACtB,GAAG,+BAAsB;YACzB,WAAW,EAAE,+BAAsB,CAAC,WAAW,GAAG,wDAAwD;SAC3G;QACD,gBAAgB,EAAhB,yBAAgB;KACjB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC/E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
revenue: {
|
|
25
|
+
price: number;
|
|
26
|
+
currency: string;
|
|
27
|
+
};
|
|
28
|
+
page_id?: string;
|
|
29
|
+
page_identifier_tokens?: {
|
|
30
|
+
[k: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
shipping_charge?: {
|
|
33
|
+
price: number;
|
|
34
|
+
currency: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/purchase/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Purchase',
|
|
9
|
+
description: 'Represents a user purchasing an item',
|
|
10
|
+
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: {
|
|
19
|
+
...fields_1.items,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
revenue: {
|
|
23
|
+
...fields_1.revenue,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
page_id: fields_1.page_id,
|
|
27
|
+
page_identifier_tokens: fields_1.page_identifier_tokens,
|
|
28
|
+
shipping_charge: fields_1.shipping_charge
|
|
29
|
+
},
|
|
30
|
+
perform: (request, { payload, settings }) => {
|
|
31
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
32
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.Purchase, payload, settings });
|
|
33
|
+
return client.sendEvent(body);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.default = action;
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/purchase/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAYyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,sCAAsC;IACnD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAE;YACL,GAAG,cAAK;YACR,QAAQ,EAAE,IAAI;SACf;QACD,OAAO,EAAE;YACP,GAAG,gBAAO;YACV,QAAQ,EAAE,IAAI;SACf;QACD,OAAO,EAAP,gBAAO;QACP,sBAAsB,EAAtB,+BAAsB;QACtB,eAAe,EAAf,wBAAe;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC/E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_id?: string;
|
|
3
|
+
timestamp: string | number;
|
|
4
|
+
user_id?: string;
|
|
5
|
+
device?: {
|
|
6
|
+
os?: string;
|
|
7
|
+
os_version?: string;
|
|
8
|
+
advertising_id?: string;
|
|
9
|
+
unique_device_id?: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
ua?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
ip?: string;
|
|
14
|
+
};
|
|
15
|
+
session_id?: string;
|
|
16
|
+
default_currency?: string;
|
|
17
|
+
items?: {
|
|
18
|
+
id: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
currency?: string;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
seller_id?: string;
|
|
23
|
+
}[];
|
|
24
|
+
search_query: string;
|
|
25
|
+
page_id?: string;
|
|
26
|
+
page_identifier_tokens?: {
|
|
27
|
+
[k: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
referrer_page_id?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/search/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const event_1 = require("../common/event");
|
|
4
|
+
const fields_1 = require("../common/fields");
|
|
5
|
+
const request_client_1 = require("../common/request-client");
|
|
6
|
+
const convert_1 = require("../common/convert");
|
|
7
|
+
const action = {
|
|
8
|
+
title: 'Search',
|
|
9
|
+
defaultSubscription: 'type = "track" and event = "Products Searched"',
|
|
10
|
+
description: 'Represents a user searching for an item',
|
|
11
|
+
fields: {
|
|
12
|
+
event_id: fields_1.event_id,
|
|
13
|
+
timestamp: fields_1.timestamp,
|
|
14
|
+
user_id: fields_1.user_id,
|
|
15
|
+
device: fields_1.device,
|
|
16
|
+
session_id: fields_1.session_id,
|
|
17
|
+
default_currency: fields_1.default_currency,
|
|
18
|
+
items: fields_1.items,
|
|
19
|
+
search_query: {
|
|
20
|
+
...fields_1.search_query,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
page_id: fields_1.page_id,
|
|
24
|
+
page_identifier_tokens: fields_1.page_identifier_tokens,
|
|
25
|
+
referrer_page_id: fields_1.referrer_page_id
|
|
26
|
+
},
|
|
27
|
+
perform: (request, { payload, settings }) => {
|
|
28
|
+
const client = new request_client_1.MolocoAPIClient(request, settings);
|
|
29
|
+
const body = convert_1.convertEvent({ eventType: event_1.EventType.Search, payload, settings });
|
|
30
|
+
return client.sendEvent(body);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.default = action;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/moloco-rmp/search/index.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,6CAYyB;AACzB,6DAA0D;AAC1D,+CAAgD;AAIhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,QAAQ;IACf,mBAAmB,EAAE,gDAAgD;IACrE,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,SAAS,EAAT,kBAAS;QACT,OAAO,EAAP,gBAAO;QACP,MAAM,EAAN,eAAM;QACN,UAAU,EAAV,mBAAU;QACV,gBAAgB,EAAhB,yBAAgB;QAChB,KAAK,EAAL,cAAK;QACL,YAAY,EAAE;YACZ,GAAG,qBAAY;YACf,QAAQ,EAAE,IAAI;SACf;QACD,OAAO,EAAP,gBAAO;QACP,sBAAsB,EAAtB,+BAAsB;QACtB,gBAAgB,EAAhB,yBAAgB;KACjB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,MAAM,MAAM,GAAG,IAAI,gCAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACrD,MAAM,IAAI,GAAG,sBAAY,CAAC,EAAE,SAAS,EAAE,iBAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC7E,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
profileListName: string;
|
|
3
|
+
profileExtensionTable: string;
|
|
4
|
+
userData: {
|
|
5
|
+
[k: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
mapTemplateName?: string;
|
|
8
|
+
insertOnNoMatch?: boolean;
|
|
9
|
+
matchColumnName1?: string;
|
|
10
|
+
matchColumnName2?: string;
|
|
11
|
+
updateOnMatch: string;
|
|
12
|
+
enable_batching?: boolean;
|
|
13
|
+
batch_size?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/responsys/asyncMergePetRecords/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const rsp_properties_1 = require("../rsp-properties");
|
|
4
|
+
const rsp_operations_1 = require("../rsp-operations");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Async Merge PET Records',
|
|
7
|
+
description: '',
|
|
8
|
+
defaultSubscription: 'type = "identify"',
|
|
9
|
+
fields: {
|
|
10
|
+
profileListName: {
|
|
11
|
+
label: 'List Name',
|
|
12
|
+
description: "Name of the profile extension table's parent profile list.",
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
profileExtensionTable: {
|
|
17
|
+
label: 'Pet Name',
|
|
18
|
+
description: 'Name of the profile extension table.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
userData: rsp_properties_1.userData,
|
|
23
|
+
mapTemplateName: {
|
|
24
|
+
label: 'Map Template Name',
|
|
25
|
+
description: 'The Map Template in Responsys that can be used to map Field Names of the Profile List to Column Names.',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
insertOnNoMatch: {
|
|
30
|
+
label: 'Insert On No Match',
|
|
31
|
+
description: 'Indicates what should be done for records where a match is not found.',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
matchColumnName1: {
|
|
36
|
+
label: 'First Column Match',
|
|
37
|
+
description: 'First match column for determining whether an insert or update should occur.',
|
|
38
|
+
type: 'string',
|
|
39
|
+
choices: [
|
|
40
|
+
{ label: 'RIID_', value: 'RIID_' },
|
|
41
|
+
{ label: 'CUSTOMER_ID_', value: 'CUSTOMER_ID_' },
|
|
42
|
+
{ label: 'EMAIL_ADDRESS_', value: 'EMAIL_ADDRESS_' },
|
|
43
|
+
{ label: 'MOBILE_NUMBER_', value: 'MOBILE_NUMBER_' },
|
|
44
|
+
{ label: 'EMAIL_MD5_HASH_', value: 'EMAIL_MD5_HASH_' },
|
|
45
|
+
{ label: 'EMAIL_SHA256_HASH_', value: 'EMAIL_SHA256_HASH_' }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
matchColumnName2: {
|
|
49
|
+
label: 'Second Column Match',
|
|
50
|
+
description: 'Second match column for determining whether an insert or update should occur.',
|
|
51
|
+
type: 'string',
|
|
52
|
+
choices: [
|
|
53
|
+
{ label: 'RIID_', value: 'RIID_' },
|
|
54
|
+
{ label: 'CUSTOMER_ID_', value: 'CUSTOMER_ID_' },
|
|
55
|
+
{ label: 'EMAIL_ADDRESS_', value: 'EMAIL_ADDRESS_' },
|
|
56
|
+
{ label: 'MOBILE_NUMBER_', value: 'MOBILE_NUMBER_' },
|
|
57
|
+
{ label: 'EMAIL_MD5_HASH_', value: 'EMAIL_MD5_HASH_' },
|
|
58
|
+
{ label: 'EMAIL_SHA256_HASH_', value: 'EMAIL_SHA256_HASH_' }
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
updateOnMatch: {
|
|
62
|
+
label: 'Update On Match',
|
|
63
|
+
description: 'Controls how the existing record should be updated.',
|
|
64
|
+
type: 'string',
|
|
65
|
+
required: true,
|
|
66
|
+
choices: [
|
|
67
|
+
{ label: 'Replace All', value: 'REPLACE_ALL' },
|
|
68
|
+
{ label: 'No Update', value: 'NO_UPDATE' }
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
enable_batching: rsp_properties_1.enable_batching,
|
|
72
|
+
batch_size: rsp_properties_1.batch_size
|
|
73
|
+
},
|
|
74
|
+
perform: async (request, { settings, payload }) => {
|
|
75
|
+
if (payload && payload.profileListName) {
|
|
76
|
+
const { profileListName, profileExtensionTable, insertOnNoMatch, matchColumnName1, matchColumnName2, updateOnMatch, userData, mapTemplateName } = payload;
|
|
77
|
+
const baseUrl = (settings.baseUrl?.startsWith('https://') ? settings.baseUrl : `https://${settings.baseUrl}`)?.replace(/\/$/, '');
|
|
78
|
+
const endpoint = `${baseUrl}/rest/asyncApi/v1.3/lists/${profileListName}/listExtensions/${profileExtensionTable}/members`;
|
|
79
|
+
const recordData = rsp_operations_1.buildRecordData(userData, mapTemplateName ?? '');
|
|
80
|
+
const requestBody = {
|
|
81
|
+
recordData: recordData,
|
|
82
|
+
insertOnNoMatch: !!insertOnNoMatch,
|
|
83
|
+
updateOnMatch: updateOnMatch || '',
|
|
84
|
+
matchColumnName1: matchColumnName1?.replace(/_+$/, '') || '',
|
|
85
|
+
matchColumnName2: matchColumnName2?.replace(/_+$/, '') || ''
|
|
86
|
+
};
|
|
87
|
+
return request(endpoint, {
|
|
88
|
+
method: 'POST',
|
|
89
|
+
body: JSON.stringify(requestBody)
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
performBatch: async (request, { settings, payload }) => {
|
|
94
|
+
const { profileListName, profileExtensionTable, insertOnNoMatch, matchColumnName1, matchColumnName2, updateOnMatch, mapTemplateName } = payload[0];
|
|
95
|
+
const payloadData = payload.map((obj) => obj.userData);
|
|
96
|
+
const recordData = rsp_operations_1.buildRecordData(payloadData, mapTemplateName ?? '');
|
|
97
|
+
const requestBody = {
|
|
98
|
+
recordData: recordData,
|
|
99
|
+
insertOnNoMatch: !!insertOnNoMatch,
|
|
100
|
+
updateOnMatch: updateOnMatch || '',
|
|
101
|
+
matchColumnName1: matchColumnName1?.replace(/_+$/, '') || '',
|
|
102
|
+
matchColumnName2: matchColumnName2?.replace(/_+$/, '') || ''
|
|
103
|
+
};
|
|
104
|
+
const baseUrl = (settings.baseUrl?.startsWith('https://') ? settings.baseUrl : `https://${settings.baseUrl}`)?.replace(/\/$/, '');
|
|
105
|
+
const endpoint = `${baseUrl}/rest/asyncApi/v1.3/lists/${profileListName}/listExtensions/${profileExtensionTable}/members`;
|
|
106
|
+
return await request(endpoint, {
|
|
107
|
+
method: 'POST',
|
|
108
|
+
body: JSON.stringify(requestBody)
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
exports.default = action;
|
|
113
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/responsys/asyncMergePetRecords/index.ts"],"names":[],"mappings":";;AAGA,sDAAyE;AAEzE,sDAAmD;AAEnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,EAAE;IACf,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,4DAA4D;YACzE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,QAAQ,EAAE,yBAAQ;QAClB,eAAe,EAAE;YACf,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,wGAAwG;YAC1G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;QACD,eAAe,EAAE;YACf,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,uEAAuE;YACpF,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;SACd;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,oBAAoB;Y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Name: string;
|
|
3
|
+
userData: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
mapTemplateName?: string;
|
|
7
|
+
defaultPermissionStatus?: string;
|
|
8
|
+
htmlValue?: string;
|
|
9
|
+
insertOnNoMatch?: boolean;
|
|
10
|
+
matchColumnName1?: string;
|
|
11
|
+
matchColumnName2?: string;
|
|
12
|
+
matchOperator?: string;
|
|
13
|
+
optinValue?: string;
|
|
14
|
+
optoutValue?: string;
|
|
15
|
+
rejectRecordIfChannelEmpty?: string;
|
|
16
|
+
textValue?: string;
|
|
17
|
+
updateOnMatch: string;
|
|
18
|
+
enable_batching?: boolean;
|
|
19
|
+
batch_size?: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/responsys/asyncMergeProfileListMembers/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const rsp_properties_1 = require("../rsp-properties");
|
|
4
|
+
const rsp_operations_1 = require("../rsp-operations");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Async Merge Profile List Members',
|
|
7
|
+
description: 'Asynchronous Merge Profile List Members API',
|
|
8
|
+
fields: {
|
|
9
|
+
profileListName: {
|
|
10
|
+
label: 'List Name',
|
|
11
|
+
description: "Name of the profile extension table's parent profile list.",
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
userData: rsp_properties_1.userData,
|
|
16
|
+
mapTemplateName: {
|
|
17
|
+
label: 'Map Template Name',
|
|
18
|
+
description: 'The Map Template in Responsys that can be used to map Field Names of the Profile List to Column Names.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
default: ''
|
|
21
|
+
},
|
|
22
|
+
defaultPermissionStatus: {
|
|
23
|
+
label: 'Default Permission Status',
|
|
24
|
+
description: 'This value must be specified as either OPTIN or OPTOUT and would be applied to all of the records contained in the API call. If this value is not explicitly specified, then it is set to OPTOUT.',
|
|
25
|
+
type: 'string',
|
|
26
|
+
choices: [
|
|
27
|
+
{ label: 'Opt In', value: 'OPTIN' },
|
|
28
|
+
{ label: 'Opt Out', value: 'OPTOUT' }
|
|
29
|
+
],
|
|
30
|
+
default: 'OPTOUT'
|
|
31
|
+
},
|
|
32
|
+
htmlValue: {
|
|
33
|
+
label: 'Preferred Email Format',
|
|
34
|
+
description: "Value of incoming preferred email format data. For example, 'H' may represent a preference for HTML formatted email.",
|
|
35
|
+
type: 'string'
|
|
36
|
+
},
|
|
37
|
+
insertOnNoMatch: {
|
|
38
|
+
label: 'Insert On No Match',
|
|
39
|
+
description: 'Indicates what should be done for records where a match is not found.',
|
|
40
|
+
type: 'boolean',
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
matchColumnName1: {
|
|
44
|
+
label: 'First Column Match',
|
|
45
|
+
description: 'First match column for determining whether an insert or update should occur.',
|
|
46
|
+
type: 'string',
|
|
47
|
+
choices: [
|
|
48
|
+
{ label: 'RIID_', value: 'RIID_' },
|
|
49
|
+
{ label: 'CUSTOMER_ID_', value: 'CUSTOMER_ID_' },
|
|
50
|
+
{ label: 'EMAIL_ADDRESS_', value: 'EMAIL_ADDRESS_' },
|
|
51
|
+
{ label: 'MOBILE_NUMBER_', value: 'MOBILE_NUMBER_' },
|
|
52
|
+
{ label: 'EMAIL_MD5_HASH_', value: 'EMAIL_MD5_HASH_' },
|
|
53
|
+
{ label: 'EMAIL_SHA256_HASH_', value: 'EMAIL_SHA256_HASH_' }
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
matchColumnName2: {
|
|
57
|
+
label: 'Second Column Match',
|
|
58
|
+
description: 'Second match column for determining whether an insert or update should occur.',
|
|
59
|
+
type: 'string',
|
|
60
|
+
choices: [
|
|
61
|
+
{ label: 'RIID_', value: 'RIID_' },
|
|
62
|
+
{ label: 'CUSTOMER_ID_', value: 'CUSTOMER_ID_' },
|
|
63
|
+
{ label: 'EMAIL_ADDRESS_', value: 'EMAIL_ADDRESS_' },
|
|
64
|
+
{ label: 'MOBILE_NUMBER_', value: 'MOBILE_NUMBER_' },
|
|
65
|
+
{ label: 'EMAIL_MD5_HASH_', value: 'EMAIL_MD5_HASH_' },
|
|
66
|
+
{ label: 'EMAIL_SHA256_HASH_', value: 'EMAIL_SHA256_HASH_' }
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
matchOperator: {
|
|
70
|
+
label: 'Match Operator',
|
|
71
|
+
description: 'Operator to join match column names.',
|
|
72
|
+
type: 'string',
|
|
73
|
+
choices: [
|
|
74
|
+
{ label: 'None', value: 'NONE' },
|
|
75
|
+
{ label: 'And', value: 'AND' }
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
optinValue: {
|
|
79
|
+
label: 'Optin Value',
|
|
80
|
+
description: "Value of incoming opt-in status data that represents an opt-in status. For example, 'I' may represent an opt-in status.",
|
|
81
|
+
type: 'string'
|
|
82
|
+
},
|
|
83
|
+
optoutValue: {
|
|
84
|
+
label: 'Optout Value',
|
|
85
|
+
description: "Value of incoming opt-out status data that represents an optout status. For example, '0' may represent an opt-out status.",
|
|
86
|
+
type: 'string'
|
|
87
|
+
},
|
|
88
|
+
rejectRecordIfChannelEmpty: {
|
|
89
|
+
label: 'Reject Record If Channel Empty',
|
|
90
|
+
description: "String containing comma-separated channel codes that if specified will result in record rejection when the channel address field is null. Channel codes are 'E' (Email), 'M' (Mobile), 'P' (Postal Code). For example 'E,M' would indicate that a record that has a null for Email or Mobile Number value should be rejected. This parameter can also be set to null or to an empty string, which will cause the validation to not be performed for any channel, except if the matchColumnName1 parameter is set to EMAIL_ADDRESS_ or MOBILE_NUMBER_. When matchColumnName1 is set to EMAIL_ADDRESS_ or MOBILE_NUMBER_, then the null or empty string setting is effectively ignored for that channel.",
|
|
91
|
+
type: 'string'
|
|
92
|
+
},
|
|
93
|
+
textValue: {
|
|
94
|
+
label: 'Text Value',
|
|
95
|
+
description: "Value of incoming preferred email format data. For example, 'T' may represent a preference for Text formatted email.",
|
|
96
|
+
type: 'string'
|
|
97
|
+
},
|
|
98
|
+
updateOnMatch: {
|
|
99
|
+
label: 'Update On Match',
|
|
100
|
+
description: 'Controls how the existing record should be updated.',
|
|
101
|
+
type: 'string',
|
|
102
|
+
required: true,
|
|
103
|
+
choices: [
|
|
104
|
+
{ label: 'Replace All', value: 'REPLACE_ALL' },
|
|
105
|
+
{ label: 'No Update', value: 'NO_UPDATE' }
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
enable_batching: rsp_properties_1.enable_batching,
|
|
109
|
+
batch_size: rsp_properties_1.batch_size
|
|
110
|
+
},
|
|
111
|
+
perform: async (request, { settings, payload, auth }) => {
|
|
112
|
+
if (payload && payload.profileListName) {
|
|
113
|
+
const { profileListName, defaultPermissionStatus, htmlValue, insertOnNoMatch, matchColumnName1, matchColumnName2, matchOperator, optinValue, optoutValue, rejectRecordIfChannelEmpty, textValue, updateOnMatch, userData, mapTemplateName } = payload;
|
|
114
|
+
const baseUrl = (settings.baseUrl?.startsWith('https://') ? settings.baseUrl : `https://${settings.baseUrl}`)?.replace(/\/$/, '');
|
|
115
|
+
const endpoint = `${baseUrl}/rest/asyncApi/v1.3/lists/${profileListName}/members`;
|
|
116
|
+
const recordData = rsp_operations_1.buildRecordData(userData, mapTemplateName ?? '');
|
|
117
|
+
const requestBody = {
|
|
118
|
+
recordData: recordData,
|
|
119
|
+
mergeRule: {
|
|
120
|
+
defaultPermissionStatus,
|
|
121
|
+
htmlValue,
|
|
122
|
+
insertOnNoMatch,
|
|
123
|
+
matchColumnName1,
|
|
124
|
+
matchColumnName2,
|
|
125
|
+
matchOperator,
|
|
126
|
+
optinValue,
|
|
127
|
+
optoutValue,
|
|
128
|
+
rejectRecordIfChannelEmpty,
|
|
129
|
+
textValue,
|
|
130
|
+
updateOnMatch
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const token = auth?.accessToken ?? '';
|
|
134
|
+
const response = request(endpoint, {
|
|
135
|
+
method: 'POST',
|
|
136
|
+
headers: {
|
|
137
|
+
Authorization: token,
|
|
138
|
+
'Content-Type': 'application/json'
|
|
139
|
+
},
|
|
140
|
+
body: JSON.stringify(requestBody)
|
|
141
|
+
});
|
|
142
|
+
return response;
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
performBatch: async (request, { settings, payload }) => {
|
|
146
|
+
const { profileListName, defaultPermissionStatus, htmlValue, insertOnNoMatch, matchColumnName1, matchColumnName2, matchOperator, optinValue, optoutValue, rejectRecordIfChannelEmpty, textValue, updateOnMatch, mapTemplateName } = payload[0];
|
|
147
|
+
const payloadData = payload.map((obj) => obj.userData);
|
|
148
|
+
const recordData = rsp_operations_1.buildRecordData(payloadData, mapTemplateName ?? '');
|
|
149
|
+
const requestBody = {
|
|
150
|
+
recordData: recordData,
|
|
151
|
+
mergeRule: {
|
|
152
|
+
defaultPermissionStatus,
|
|
153
|
+
htmlValue,
|
|
154
|
+
insertOnNoMatch,
|
|
155
|
+
matchColumnName1,
|
|
156
|
+
matchColumnName2,
|
|
157
|
+
matchOperator,
|
|
158
|
+
optinValue,
|
|
159
|
+
optoutValue,
|
|
160
|
+
rejectRecordIfChannelEmpty,
|
|
161
|
+
textValue,
|
|
162
|
+
updateOnMatch
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
const baseUrl = (settings.baseUrl?.startsWith('https://') ? settings.baseUrl : `https://${settings.baseUrl}`)?.replace(/\/$/, '');
|
|
166
|
+
const endpoint = `${baseUrl}/rest/asyncApi/v1.3/lists/${profileListName}/members`;
|
|
167
|
+
return await request(endpoint, {
|
|
168
|
+
method: 'POST',
|
|
169
|
+
body: JSON.stringify(requestBody)
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
exports.default = action;
|
|
174
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/responsys/asyncMergeProfileListMembers/index.ts"],"names":[],"mappings":";;AAGA,sDAAyE;AAGzE,sDAAmD;AAEnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kCAAkC;IACzC,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE;QACN,eAAe,EAAE;YACf,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,4DAA4D;YACzE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,QAAQ,EAAE,yBAAQ;QAClB,eAAe,EAAE;YACf,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,wGAAwG;YAC1G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;SACZ;QACD,uBAAuB,EAAE;YACvB,KAAK,EAAE,2BAA2B;YAClC,WAAW,EACT,mMAAmM;YACrM,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;gBACnC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE;aACtC;YACD,OAAO,EAAE,QAAQ;SAClB;QACD,SAAS,EAAE;YACT,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EACT,sHAAsH;YACxH,IAAI,EAAE,QAAQ;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,uEAAuE;YACpF,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;SACd;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,8EAA8E;YAC3F,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;gBAClC,EAAE,KAAK,EAAE,cAAc,EAAE,KA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Aa;gBACb,UAAU;gBACV,WAAW;gBACX,0BAA0B;gBAC1B,SAAS;gBACT,aAAa;aACd;SACF,CAAA;QAKD,MAAM,OAAO,GAAG,CACd,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,QAAQ,CAAC,OAAO,EAAE,CAC5F,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACrB,MAAM,QAAQ,GAAG,GAAG,OAAO,6BAA6B,eAAe,UAAU,CAAA;QAEjF,OAAO,MAAM,OAAO,CAAC,QAAQ,EAAE;YAC7B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;SAClC,CAAC,CAAA;IA0FJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DestinationDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from './generated-types';
|
|
3
3
|
declare const destination: DestinationDefinition<Settings>;
|
|
4
4
|
export default destination;
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
6
7
|
const sendCustomTraits_1 = __importDefault(require("./sendCustomTraits"));
|
|
7
8
|
const sendAudience_1 = __importDefault(require("./sendAudience"));
|
|
8
9
|
const upsertListMember_1 = __importDefault(require("./upsertListMember"));
|
|
@@ -157,13 +158,22 @@ const destination = {
|
|
|
157
158
|
},
|
|
158
159
|
testAuthentication: (_, { settings }) => {
|
|
159
160
|
if (settings.profileListName.toUpperCase() !== settings.profileListName) {
|
|
160
|
-
|
|
161
|
+
throw new actions_core_1.IntegrationError('List Name field must be in Uppercase', 'INVALID_PROFILE_LIST_NAME', 400);
|
|
162
|
+
}
|
|
163
|
+
if (settings.profileExtensionTable) {
|
|
164
|
+
if (settings.profileExtensionTable.toUpperCase() !== settings.profileExtensionTable) {
|
|
165
|
+
throw new actions_core_1.IntegrationError('PET Name field must be in Uppercase', 'INVALID_PET_NAME', 400);
|
|
166
|
+
}
|
|
167
|
+
const regex = /^[A-Z0-9_]+$/;
|
|
168
|
+
if (!regex.test(settings.profileExtensionTable)) {
|
|
169
|
+
throw new actions_core_1.IntegrationError('The PET Name field must be capitalized and may only contain letters from A to Z, numbers from 0 to 9, and underscore characters.', 'INVALID_PET_NAME', 400);
|
|
170
|
+
}
|
|
161
171
|
}
|
|
162
172
|
if (settings.baseUrl.startsWith('https://'.toLowerCase())) {
|
|
163
173
|
return Promise.resolve('Success');
|
|
164
174
|
}
|
|
165
175
|
else {
|
|
166
|
-
|
|
176
|
+
throw new actions_core_1.IntegrationError('Responsys endpoint URL must start with https://', 'INVALID_URL', 400);
|
|
167
177
|
}
|
|
168
178
|
},
|
|
169
179
|
refreshAccessToken: async (request, { settings }) => {
|