@segment/action-destinations 3.259.0 → 3.260.0-staging.0
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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/index.js +0 -1
- package/dist/destinations/braze/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +2 -4
- package/dist/destinations/display-video-360/index.js.map +1 -1
- 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/utils/track.d.ts +17 -17
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +7 -0
- package/dist/destinations/google-enhanced-conversions/functions.js +7 -3
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +7 -4
- package/dist/destinations/klaviyo/functions.js +80 -1
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/types.d.ts +97 -0
- package/dist/destinations/klaviyo/upsertProfile/index.js +29 -19
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +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/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/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/segment/segment-properties.d.ts +1 -0
- package/dist/destinations/segment/segment-properties.js +8 -1
- package/dist/destinations/segment/segment-properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendGroup/index.js +2 -0
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendIdentify/index.js +2 -0
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendPage/index.js +2 -0
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendScreen/index.js +2 -0
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -0
- package/dist/destinations/segment/sendTrack/index.js +2 -0
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +381 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +1 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +581 -0
- package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +4 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +97 -0
- package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.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 +4 -4
|
@@ -99,6 +99,7 @@ export interface ProfileAttributes {
|
|
|
99
99
|
location?: Location | null;
|
|
100
100
|
properties?: Record<string, any>;
|
|
101
101
|
list_id?: string;
|
|
102
|
+
subscriptions?: Record<string, any>;
|
|
102
103
|
}
|
|
103
104
|
export interface ImportJobPayload {
|
|
104
105
|
type: string;
|
|
@@ -126,3 +127,99 @@ export interface Profile {
|
|
|
126
127
|
export interface GetProfileResponse {
|
|
127
128
|
data: Profile[];
|
|
128
129
|
}
|
|
130
|
+
export interface SubProfilePayload {
|
|
131
|
+
type: string;
|
|
132
|
+
attributes: {
|
|
133
|
+
email?: string;
|
|
134
|
+
phone_number?: string;
|
|
135
|
+
subscriptions?: {
|
|
136
|
+
email?: {};
|
|
137
|
+
sms?: {};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export interface SubscriptionData {
|
|
142
|
+
data: {
|
|
143
|
+
type: string;
|
|
144
|
+
attributes: {
|
|
145
|
+
custom_source: string;
|
|
146
|
+
profiles: {
|
|
147
|
+
data: Array<SubProfilePayload>;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
relationships?: {
|
|
151
|
+
list: {
|
|
152
|
+
data: {
|
|
153
|
+
type: 'list';
|
|
154
|
+
id: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export interface SubProfile {
|
|
161
|
+
email?: string;
|
|
162
|
+
phone_number?: string;
|
|
163
|
+
list_id: string;
|
|
164
|
+
}
|
|
165
|
+
export interface KlaviyoJobStatusResponse {
|
|
166
|
+
data: {
|
|
167
|
+
type: string;
|
|
168
|
+
id: string;
|
|
169
|
+
attributes: {
|
|
170
|
+
status: string;
|
|
171
|
+
created_at: string;
|
|
172
|
+
total_count: number;
|
|
173
|
+
completed_count: number;
|
|
174
|
+
failed_count: number;
|
|
175
|
+
completed_at: string | null;
|
|
176
|
+
started_at: string | null;
|
|
177
|
+
};
|
|
178
|
+
relationships: {};
|
|
179
|
+
links: {
|
|
180
|
+
self: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface KlaviyoImportJobData {
|
|
185
|
+
data: {
|
|
186
|
+
type: string;
|
|
187
|
+
id: string;
|
|
188
|
+
attributes: {
|
|
189
|
+
status: string;
|
|
190
|
+
created_at: string;
|
|
191
|
+
total_count: number;
|
|
192
|
+
completed_count: number;
|
|
193
|
+
failed_count: number;
|
|
194
|
+
completed_at: string | null;
|
|
195
|
+
expires_at: string;
|
|
196
|
+
started_at: string | null;
|
|
197
|
+
};
|
|
198
|
+
relationships: {
|
|
199
|
+
lists: {
|
|
200
|
+
data: Array<{
|
|
201
|
+
type: string;
|
|
202
|
+
id: string;
|
|
203
|
+
}>;
|
|
204
|
+
links: {
|
|
205
|
+
self: string;
|
|
206
|
+
related: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
profiles: {
|
|
210
|
+
links: {
|
|
211
|
+
self: string;
|
|
212
|
+
related: string;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
import_errors: {
|
|
216
|
+
links: {
|
|
217
|
+
related: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
links: {
|
|
222
|
+
self: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
}
|
|
@@ -159,9 +159,12 @@ const action = {
|
|
|
159
159
|
json: profileData
|
|
160
160
|
});
|
|
161
161
|
if (list_id) {
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
const subscriptionProfile = {
|
|
163
|
+
email: profileData.data.attributes.email,
|
|
164
|
+
phone_number: profileData.data.attributes.phone_number,
|
|
165
|
+
list_id
|
|
166
|
+
};
|
|
167
|
+
await functions_1.subscribeProfiles(request, subscriptionProfile);
|
|
165
168
|
}
|
|
166
169
|
return profile;
|
|
167
170
|
}
|
|
@@ -177,7 +180,12 @@ const action = {
|
|
|
177
180
|
json: profileData
|
|
178
181
|
});
|
|
179
182
|
if (list_id) {
|
|
180
|
-
|
|
183
|
+
const subscriptionProfile = {
|
|
184
|
+
email: profileData.data.attributes.email,
|
|
185
|
+
phone_number: profileData.data.attributes.phone_number,
|
|
186
|
+
list_id
|
|
187
|
+
};
|
|
188
|
+
await functions_1.subscribeProfiles(request, subscriptionProfile);
|
|
181
189
|
}
|
|
182
190
|
return profile;
|
|
183
191
|
}
|
|
@@ -187,23 +195,25 @@ const action = {
|
|
|
187
195
|
},
|
|
188
196
|
performBatch: async (request, { payload }) => {
|
|
189
197
|
payload = payload.filter((profile) => profile.email || profile.external_id || profile.phone_number);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
let importResponseWithList;
|
|
193
|
-
let importResponseWithoutList;
|
|
194
|
-
if (profilesWithList.length > 0) {
|
|
195
|
-
const listId = profilesWithList[0].list_id;
|
|
196
|
-
const importJobPayload = functions_1.createImportJobPayload(profilesWithList, listId);
|
|
197
|
-
importResponseWithList = await functions_1.sendImportJobRequest(request, importJobPayload);
|
|
198
|
+
if (payload.length === 0) {
|
|
199
|
+
throw new actions_core_1.PayloadValidationError(`'One of External ID, Phone Number and Email is required.'`);
|
|
198
200
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
const profilesForImport = payload.map(({ list_id, ...profile }) => profile);
|
|
202
|
+
const importJobResponse = await functions_1.sendImportJobRequest(request, functions_1.createImportJobPayload(profilesForImport));
|
|
203
|
+
const parsedData = JSON.parse(importJobResponse.data);
|
|
204
|
+
const jobId = parsedData.data.id;
|
|
205
|
+
if (jobId) {
|
|
206
|
+
const jobStatusResponse = await functions_1.pollKlaviyoJobStatus(request, jobId);
|
|
207
|
+
if (jobStatusResponse.data.attributes.status !== 'complete') {
|
|
208
|
+
throw new actions_core_1.APIError('Import job did not complete successfully.', 401);
|
|
209
|
+
}
|
|
210
|
+
const profilesWithListId = payload.filter((profile) => !!profile.list_id);
|
|
211
|
+
for (let i = 0; i < profilesWithListId.length; i += 100) {
|
|
212
|
+
const batch = profilesWithListId.slice(i, i + 100);
|
|
213
|
+
await functions_1.subscribeProfiles(request, batch);
|
|
214
|
+
}
|
|
202
215
|
}
|
|
203
|
-
return
|
|
204
|
-
withList: importResponseWithList,
|
|
205
|
-
withoutList: importResponseWithoutList
|
|
206
|
-
};
|
|
216
|
+
return importJobResponse;
|
|
207
217
|
}
|
|
208
218
|
};
|
|
209
219
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,wDAAwE;AAExE,4CAMqB;AACrB,8CAA0C;AAE1C,MAAM,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O,iBAAiB,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum ApiRegions {
|
|
2
|
+
US = "US \uD83C\uDDFA\uD83C\uDDF8",
|
|
3
|
+
EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
|
|
4
|
+
}
|
|
5
|
+
export declare enum StrictMode {
|
|
6
|
+
ON = "1",
|
|
7
|
+
OFF = "0"
|
|
8
|
+
}
|
|
9
|
+
export declare function getConcatenatedName(firstName: unknown, lastName: unknown, name: unknown): unknown;
|
|
10
|
+
export declare function getApiServerUrl(apiRegion: string | undefined): "https://api-eu.mixpanel.com" | "https://api.mixpanel.com";
|
|
11
|
+
export declare function getBrowser(userAgent: string): string;
|
|
12
|
+
export declare function getBrowserVersion(userAgent: string): string | undefined;
|
|
13
|
+
export declare function cheapGuid(maxlen?: number): string;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cheapGuid = exports.getBrowserVersion = exports.getBrowser = exports.getApiServerUrl = exports.getConcatenatedName = exports.StrictMode = exports.ApiRegions = void 0;
|
|
4
|
+
var ApiRegions;
|
|
5
|
+
(function (ApiRegions) {
|
|
6
|
+
ApiRegions["US"] = "US \uD83C\uDDFA\uD83C\uDDF8";
|
|
7
|
+
ApiRegions["EU"] = "EU \uD83C\uDDEA\uD83C\uDDFA";
|
|
8
|
+
})(ApiRegions = exports.ApiRegions || (exports.ApiRegions = {}));
|
|
9
|
+
var StrictMode;
|
|
10
|
+
(function (StrictMode) {
|
|
11
|
+
StrictMode["ON"] = "1";
|
|
12
|
+
StrictMode["OFF"] = "0";
|
|
13
|
+
})(StrictMode = exports.StrictMode || (exports.StrictMode = {}));
|
|
14
|
+
function getConcatenatedName(firstName, lastName, name) {
|
|
15
|
+
return name ?? (firstName && lastName ? `${firstName} ${lastName}` : undefined);
|
|
16
|
+
}
|
|
17
|
+
exports.getConcatenatedName = getConcatenatedName;
|
|
18
|
+
function getApiServerUrl(apiRegion) {
|
|
19
|
+
if (apiRegion == ApiRegions.EU) {
|
|
20
|
+
return 'https://api-eu.mixpanel.com';
|
|
21
|
+
}
|
|
22
|
+
return 'https://api.mixpanel.com';
|
|
23
|
+
}
|
|
24
|
+
exports.getApiServerUrl = getApiServerUrl;
|
|
25
|
+
function getBrowser(userAgent) {
|
|
26
|
+
if (userAgent.includes(' OPR/')) {
|
|
27
|
+
if (userAgent.includes('Mini')) {
|
|
28
|
+
return 'Opera Mini';
|
|
29
|
+
}
|
|
30
|
+
return 'Opera';
|
|
31
|
+
}
|
|
32
|
+
else if (/(BlackBerry|PlayBook|BB10)/i.test(userAgent)) {
|
|
33
|
+
return 'BlackBerry';
|
|
34
|
+
}
|
|
35
|
+
else if (userAgent.includes('IEMobile') || userAgent.includes('WPDesktop')) {
|
|
36
|
+
return 'Internet Explorer Mobile';
|
|
37
|
+
}
|
|
38
|
+
else if (userAgent.includes('SamsungBrowser/')) {
|
|
39
|
+
return 'Samsung Internet';
|
|
40
|
+
}
|
|
41
|
+
else if (userAgent.includes('Edge') || userAgent.includes('Edg/')) {
|
|
42
|
+
return 'Microsoft Edge';
|
|
43
|
+
}
|
|
44
|
+
else if (userAgent.includes('FBIOS')) {
|
|
45
|
+
return 'Facebook Mobile';
|
|
46
|
+
}
|
|
47
|
+
else if (userAgent.includes('Chrome')) {
|
|
48
|
+
return 'Chrome';
|
|
49
|
+
}
|
|
50
|
+
else if (userAgent.includes('CriOS')) {
|
|
51
|
+
return 'Chrome iOS';
|
|
52
|
+
}
|
|
53
|
+
else if (userAgent.includes('UCWEB') || userAgent.includes('UCBrowser')) {
|
|
54
|
+
return 'UC Browser';
|
|
55
|
+
}
|
|
56
|
+
else if (userAgent.includes('FxiOS')) {
|
|
57
|
+
return 'Firefox iOS';
|
|
58
|
+
}
|
|
59
|
+
else if (userAgent.includes('Safari')) {
|
|
60
|
+
return 'Safari';
|
|
61
|
+
}
|
|
62
|
+
else if (userAgent.includes('Android')) {
|
|
63
|
+
return 'Android Mobile';
|
|
64
|
+
}
|
|
65
|
+
else if (userAgent.includes('Konqueror')) {
|
|
66
|
+
return 'Konqueror';
|
|
67
|
+
}
|
|
68
|
+
else if (userAgent.includes('Firefox')) {
|
|
69
|
+
return 'Firefox';
|
|
70
|
+
}
|
|
71
|
+
else if (userAgent.includes('MSIE') || userAgent.includes('Trident/')) {
|
|
72
|
+
return 'Internet Explorer';
|
|
73
|
+
}
|
|
74
|
+
else if (userAgent.includes('Gecko')) {
|
|
75
|
+
return 'Mozilla';
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return '';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.getBrowser = getBrowser;
|
|
82
|
+
function getBrowserVersion(userAgent) {
|
|
83
|
+
const browser = getBrowser(userAgent);
|
|
84
|
+
const versionRegexs = {
|
|
85
|
+
'Internet Explorer Mobile': /rv:(\d+(\.\d+)?)/,
|
|
86
|
+
'Microsoft Edge': /Edge?\/(\d+(\.\d+)?)/,
|
|
87
|
+
Chrome: /Chrome\/(\d+(\.\d+)?)/,
|
|
88
|
+
'Chrome iOS': /CriOS\/(\d+(\.\d+)?)/,
|
|
89
|
+
'UC Browser': /(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,
|
|
90
|
+
Safari: /Version\/(\d+(\.\d+)?)/,
|
|
91
|
+
'Mobile Safari': /Version\/(\d+(\.\d+)?)/,
|
|
92
|
+
Opera: /(Opera|OPR)\/(\d+(\.\d+)?)/,
|
|
93
|
+
Firefox: /Firefox\/(\d+(\.\d+)?)/,
|
|
94
|
+
'Firefox iOS': /FxiOS\/(\d+(\.\d+)?)/,
|
|
95
|
+
Konqueror: /Konqueror:(\d+(\.\d+)?)/,
|
|
96
|
+
BlackBerry: /BlackBerry (\d+(\.\d+)?)/,
|
|
97
|
+
'Android Mobile': /android\s(\d+(\.\d+)?)/,
|
|
98
|
+
'Samsung Internet': /SamsungBrowser\/(\d+(\.\d+)?)/,
|
|
99
|
+
'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/,
|
|
100
|
+
Mozilla: /rv:(\d+(\.\d+)?)/
|
|
101
|
+
};
|
|
102
|
+
const regex = versionRegexs[browser];
|
|
103
|
+
if (!regex)
|
|
104
|
+
return regex;
|
|
105
|
+
const matches = regex.exec(userAgent);
|
|
106
|
+
if (!matches) {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
return matches[matches.length - 2];
|
|
110
|
+
}
|
|
111
|
+
exports.getBrowserVersion = getBrowserVersion;
|
|
112
|
+
function cheapGuid(maxlen) {
|
|
113
|
+
const guid = Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10);
|
|
114
|
+
return maxlen ? guid.substring(0, maxlen) : guid;
|
|
115
|
+
}
|
|
116
|
+
exports.cheapGuid = cheapGuid;
|
|
117
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/mixpanel/utils.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,gDAAc,CAAA;IACd,gDAAc,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sBAAQ,CAAA;IACR,uBAAS,CAAA;AACX,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,SAAgB,mBAAmB,CAAC,SAAkB,EAAE,QAAiB,EAAE,IAAa;IACtF,OAAO,IAAI,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACjF,CAAC;AAFD,kDAEC;AAED,SAAgB,eAA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D,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IACpC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,SAAS,CAAA;KACjB;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AACpC,CAAC;AA3BD,8CA2BC;AAED,SAAgB,SAAS,CAAC,MAAe;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACtG,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAClD,CAAC;AAHD,8BAGC"}
|
|
@@ -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;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,KAAK,EAAE,cAAc,EAAE;gBAChD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;gBACpD,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE;gBACpD,EAAE,KAAK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E,eAAe,IAAI,EAAE,CAAC,CAAA;QACtE,MAAM,WAAW,GAAmB;YAClC,UAAU,EAAE,UAAwB;YACpC,eAAe,EAAE,CAAC,CAAC,eAAe;YAClC,aAAa,EAAE,aAAa,IAAI,EAAE;YAClC,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE;YAC5D,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE;SAC7D,CAAA;QAID,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,mBAAmB,qBAAqB,UAAU,CAAA;QACzH,OAAO,MAAM,OAAO,CAAC,QAAQ,EAAE;YAC7B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;SAClC,CAAC,CAAA;IAkEJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
profileListName: 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":""}
|