@segment/action-destinations 3.331.1-staging.2 → 3.331.2-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/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/devrev/createRevUser/index.js +1 -1
- package/dist/destinations/devrev/createRevUser/index.js.map +1 -1
- package/dist/destinations/devrev/mocks/index.d.ts +1 -1
- package/dist/destinations/devrev/mocks/index.js +1 -1
- package/dist/destinations/devrev/mocks/index.js.map +1 -1
- package/dist/destinations/display-video-360/addToAudience/generated-types.d.ts +5 -0
- package/dist/destinations/display-video-360/addToAudience/index.d.ts +2 -2
- package/dist/destinations/display-video-360/addToAudience/index.js +19 -4
- package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/constants.d.ts +2 -0
- package/dist/destinations/display-video-360/constants.js +4 -2
- package/dist/destinations/display-video-360/constants.js.map +1 -1
- package/dist/destinations/display-video-360/errors.d.ts +2 -0
- package/dist/destinations/display-video-360/errors.js +40 -0
- package/dist/destinations/display-video-360/errors.js.map +1 -0
- package/dist/destinations/display-video-360/generated-types.d.ts +2 -1
- package/dist/destinations/display-video-360/index.js +57 -51
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/display-video-360/listManagement.d.ts +9 -0
- package/dist/destinations/display-video-360/listManagement.js +16 -0
- package/dist/destinations/display-video-360/listManagement.js.map +1 -0
- package/dist/destinations/display-video-360/properties.d.ts +6 -0
- package/dist/destinations/display-video-360/properties.js +52 -0
- package/dist/destinations/display-video-360/properties.js.map +1 -0
- package/dist/destinations/display-video-360/proto/protofile.d.ts +104 -0
- package/dist/destinations/display-video-360/proto/protofile.js +251 -0
- package/dist/destinations/display-video-360/proto/protofile.js.map +1 -0
- package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +5 -0
- package/dist/destinations/display-video-360/removeFromAudience/index.d.ts +2 -2
- package/dist/destinations/display-video-360/removeFromAudience/index.js +18 -3
- package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/shared.d.ts +16 -0
- package/dist/destinations/display-video-360/shared.js +138 -0
- package/dist/destinations/display-video-360/shared.js.map +1 -0
- package/dist/destinations/display-video-360/types.d.ts +27 -0
- package/dist/destinations/display-video-360/types.js +3 -0
- package/dist/destinations/display-video-360/types.js.map +1 -0
- package/dist/destinations/engage/utils/track.d.ts +10 -10
- package/dist/destinations/hyperengage/group/generated-types.d.ts +1 -0
- package/dist/destinations/hyperengage/group/index.js +20 -2
- package/dist/destinations/hyperengage/group/index.js.map +1 -1
- package/dist/destinations/hyperengage/identify/index.js +7 -1
- package/dist/destinations/hyperengage/identify/index.js.map +1 -1
- package/dist/destinations/hyperengage/track/generated-types.d.ts +1 -1
- package/dist/destinations/hyperengage/track/index.js +9 -9
- package/dist/destinations/hyperengage/track/index.js.map +1 -1
- package/dist/destinations/hyperengage/validateInput.js +5 -2
- package/dist/destinations/hyperengage/validateInput.js.map +1 -1
- package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/addProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/addProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/addProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js +24 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -0
- package/dist/destinations/klaviyo/functions.d.ts +10 -10
- package/dist/destinations/klaviyo/functions.js +62 -43
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/index.d.ts +2 -2
- package/dist/destinations/klaviyo/index.js +52 -6
- package/dist/destinations/klaviyo/index.js.map +1 -1
- package/dist/destinations/klaviyo/properties.d.ts +3 -0
- package/dist/destinations/klaviyo/properties.js +23 -0
- package/dist/destinations/klaviyo/properties.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileFromList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileFromList/index.js +27 -0
- package/dist/destinations/klaviyo/removeProfileFromList/index.js.map +1 -0
- package/dist/destinations/klaviyo/types.d.ts +9 -0
- package/dist/destinations/klaviyo/types.js.map +1 -1
- package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +0 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js +3 -34
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/operations.js +13 -19
- package/dist/destinations/liveramp-audiences/operations.js.map +1 -1
- package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
- package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
- package/dist/destinations/movable-ink/categoryView/index.js +43 -0
- package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
- package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
- package/dist/destinations/movable-ink/conversion/index.js +45 -0
- package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
- package/dist/destinations/movable-ink/fields.d.ts +21 -0
- package/dist/destinations/movable-ink/fields.js +236 -0
- package/dist/destinations/movable-ink/fields.js.map +1 -0
- package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
- package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
- package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
- package/dist/destinations/movable-ink/identify/index.js +32 -0
- package/dist/destinations/movable-ink/identify/index.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productAdded/index.js +43 -0
- package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
- package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
- package/dist/destinations/movable-ink/productViewed/index.js +43 -0
- package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
- package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
- package/dist/destinations/movable-ink/search/generated-types.js +3 -0
- package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/search/index.d.ts +5 -0
- package/dist/destinations/movable-ink/search/index.js +43 -0
- package/dist/destinations/movable-ink/search/index.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
- package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
- package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +8 -2
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
- package/dist/destinations/tiktok-audiences/properties.js +4 -5
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/webhook-audiences/index.js +3 -1
- package/dist/destinations/webhook-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/generated-types.d.ts +1 -2
- package/dist/destinations/yahoo-audiences/index.js +11 -21
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/updateSegment/generated-types.d.ts +1 -1
- package/dist/destinations/yahoo-audiences/updateSegment/index.js +23 -23
- package/dist/destinations/yahoo-audiences/updateSegment/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/utils-rt.js +15 -5
- package/dist/destinations/yahoo-audiences/utils-rt.js.map +1 -1
- package/dist/destinations/yahoo-audiences/utils-tax.js +2 -2
- package/dist/destinations/yahoo-audiences/utils-tax.js.map +1 -1
- package/package.json +4 -1
- package/dist/destinations/mixpanel/utils.d.ts +0 -13
- package/dist/destinations/mixpanel/utils.js +0 -117
- package/dist/destinations/mixpanel/utils.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const functions_1 = require("../functions");
|
|
5
|
+
const properties_1 = require("../properties");
|
|
6
|
+
const action = {
|
|
7
|
+
title: 'Remove profile from list',
|
|
8
|
+
description: 'Remove profile from list',
|
|
9
|
+
defaultSubscription: 'event = "Audience Exited"',
|
|
10
|
+
fields: {
|
|
11
|
+
email: { ...properties_1.email },
|
|
12
|
+
external_id: { ...properties_1.external_id }
|
|
13
|
+
},
|
|
14
|
+
perform: async (request, { payload }) => {
|
|
15
|
+
const { email, external_id } = payload;
|
|
16
|
+
if (!email) {
|
|
17
|
+
throw new actions_core_1.PayloadValidationError('Missing Email');
|
|
18
|
+
}
|
|
19
|
+
const profileData = await functions_1.getProfile(request, email);
|
|
20
|
+
const v = profileData.data;
|
|
21
|
+
if (v && v.length !== 0) {
|
|
22
|
+
return await functions_1.removeProfileFromList(request, v[0].id, external_id);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.default = action;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/removeProfileFromList/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAIhF,4CAAgE;AAChE,8CAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,0BAA0B;IACvC,mBAAmB,EAAE,2BAA2B;IAChD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE,GAAG,kBAAK,EAAE;QACnB,WAAW,EAAE,EAAE,GAAG,wBAAW,EAAE;KAChC;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACtC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QACtC,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,qCAAsB,CAAC,eAAe,CAAC,CAAA;SAClD;QACD,MAAM,WAAW,GAAG,MAAM,sBAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACpD,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAA;QAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,OAAO,MAAM,iCAAqB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,CAAA;SAClE;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -59,6 +59,15 @@ export interface EventData {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
export interface listData {
|
|
63
|
+
data: {
|
|
64
|
+
type: string;
|
|
65
|
+
id?: string;
|
|
66
|
+
}[];
|
|
67
|
+
}
|
|
68
|
+
export interface ListIdResponse {
|
|
69
|
+
content: string;
|
|
70
|
+
}
|
|
62
71
|
export interface GetListResultContent {
|
|
63
72
|
data: {
|
|
64
73
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/klaviyo/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;AACjD,MAAa,eAAgB,SAAQ,wBAAS;CAmB7C;AAnBD,0CAmBC"}
|
|
@@ -15,11 +15,6 @@ const action = {
|
|
|
15
15
|
format: 'email',
|
|
16
16
|
default: { '@path': '$.traits.email' }
|
|
17
17
|
},
|
|
18
|
-
enable_batching: {
|
|
19
|
-
type: 'boolean',
|
|
20
|
-
label: 'Batch Data to Klaviyo',
|
|
21
|
-
description: 'When enabled, the action will use the klaviyo batch API.'
|
|
22
|
-
},
|
|
23
18
|
phone_number: {
|
|
24
19
|
label: 'Phone Number',
|
|
25
20
|
description: `Individual's phone number in E.164 format. If SMS is not enabled and if you use Phone Number as identifier, then you have to provide one of Email or External ID.`,
|
|
@@ -131,12 +126,12 @@ const action = {
|
|
|
131
126
|
}
|
|
132
127
|
},
|
|
133
128
|
dynamicFields: {
|
|
134
|
-
list_id: async (request
|
|
135
|
-
return functions_1.getListIdDynamicData(request
|
|
129
|
+
list_id: async (request) => {
|
|
130
|
+
return functions_1.getListIdDynamicData(request);
|
|
136
131
|
}
|
|
137
132
|
},
|
|
138
133
|
perform: async (request, { payload }) => {
|
|
139
|
-
const { email, external_id, phone_number, list_id,
|
|
134
|
+
const { email, external_id, phone_number, list_id, ...otherAttributes } = payload;
|
|
140
135
|
if (!email && !phone_number && !external_id) {
|
|
141
136
|
throw new actions_core_1.PayloadValidationError('One of External ID, Phone Number and Email is required.');
|
|
142
137
|
}
|
|
@@ -182,32 +177,6 @@ const action = {
|
|
|
182
177
|
}
|
|
183
178
|
throw new actions_core_1.APIError('An error occurred while processing the request', 400);
|
|
184
179
|
}
|
|
185
|
-
},
|
|
186
|
-
performBatch: async (request, { payload }) => {
|
|
187
|
-
payload = payload.filter((profile) => profile.email || profile.external_id || profile.phone_number);
|
|
188
|
-
const profilesWithList = payload.filter((profile) => profile.list_id);
|
|
189
|
-
const profilesWithoutList = payload.filter((profile) => !profile.list_id);
|
|
190
|
-
let importResponseWithList;
|
|
191
|
-
let importResponseWithoutList;
|
|
192
|
-
try {
|
|
193
|
-
if (profilesWithList.length > 0) {
|
|
194
|
-
const listId = profilesWithList[0].list_id;
|
|
195
|
-
const importJobPayload = functions_1.createImportJobPayload(profilesWithList, listId);
|
|
196
|
-
importResponseWithList = await functions_1.sendImportJobRequest(request, importJobPayload);
|
|
197
|
-
}
|
|
198
|
-
if (profilesWithoutList.length > 0) {
|
|
199
|
-
const importJobPayload = functions_1.createImportJobPayload(profilesWithoutList);
|
|
200
|
-
importResponseWithoutList = await functions_1.sendImportJobRequest(request, importJobPayload);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
catch (error) {
|
|
204
|
-
console.error('Error processing batch:', error);
|
|
205
|
-
throw new Error('An error occurred while processing the request');
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
withList: importResponseWithList,
|
|
209
|
-
withoutList: importResponseWithoutList
|
|
210
|
-
};
|
|
211
180
|
}
|
|
212
181
|
};
|
|
213
182
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,wDAAwE;AAExE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/klaviyo/upsertProfile/index.ts"],"names":[],"mappings":";;AAIA,sCAAmC;AACnC,wDAAwE;AAExE,4CAAqE;AAErE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,sBAAsB;IACnC,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,kFAAkF;YAC/F,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;SACvC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,mKAAmK;YAChL,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;SAC/C;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+JAA+J;YAC5K,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;SAC3C;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;SAC1C;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,uFAAuF;YACpG,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;SAC9C;QACD,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I,EAAE,WAAW;aAClB,CAAC,CAAA;YACF,IAAI,OAAO,EAAE;gBACX,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;gBAC5C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;gBAC1B,MAAM,4BAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;aAC7C;YACD,OAAO,OAAO,CAAA;SACf;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAwB,CAAA;YAE7C,IAAI,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE;gBAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;gBAC7C,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAA;gBAEzD,IAAI,EAAE,EAAE;oBACN,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;oBAExB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,gBAAO,aAAa,EAAE,EAAE,EAAE;wBACzD,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW;qBAClB,CAAC,CAAA;oBAEF,IAAI,OAAO,EAAE;wBACX,MAAM,4BAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;qBAC7C;oBACD,OAAO,OAAO,CAAA;iBACf;aACF;YAED,MAAM,IAAI,uBAAQ,CAAC,gDAAgD,EAAE,GAAG,CAAC,CAAA;SAC1E;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,37 +3,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalize = exports.enquoteIdentifier = exports.generateFile = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
5
|
function generateFile(payloads) {
|
|
6
|
-
const headers =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
headers.push(identifier);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
if (payloads[0].unhashed_identifier_data) {
|
|
13
|
-
for (const identifier of Object.getOwnPropertyNames(payloads[0].unhashed_identifier_data)) {
|
|
14
|
-
headers.push(identifier);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
let rows = Buffer.from(headers.join(payloads[0].delimiter) + '\n');
|
|
6
|
+
const headers = new Set();
|
|
7
|
+
headers.add('audience_key');
|
|
8
|
+
let rows = Buffer.from('');
|
|
18
9
|
for (let i = 0; i < payloads.length; i++) {
|
|
19
10
|
const payload = payloads[i];
|
|
20
11
|
const row = [enquoteIdentifier(payload.audience_key)];
|
|
21
|
-
if (payload.identifier_data) {
|
|
22
|
-
for (const key in payload.identifier_data) {
|
|
23
|
-
if (Object.prototype.hasOwnProperty.call(payload.identifier_data, key)) {
|
|
24
|
-
row.push(enquoteIdentifier(String(payload.identifier_data[key])));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
12
|
if (payload.unhashed_identifier_data) {
|
|
29
13
|
for (const key in payload.unhashed_identifier_data) {
|
|
30
14
|
if (Object.prototype.hasOwnProperty.call(payload.unhashed_identifier_data, key)) {
|
|
15
|
+
headers.add(key);
|
|
31
16
|
row.push(`"${hash(normalize(key, String(payload.unhashed_identifier_data[key])))}"`);
|
|
32
17
|
}
|
|
33
18
|
}
|
|
34
19
|
}
|
|
20
|
+
if (payload.identifier_data) {
|
|
21
|
+
for (const key in payload.identifier_data) {
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(payload.identifier_data, key) && !headers.has(key)) {
|
|
23
|
+
headers.add(key);
|
|
24
|
+
row.push(enquoteIdentifier(String(payload.identifier_data[key])));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
35
28
|
rows = Buffer.concat([rows, Buffer.from(row.join(payload.delimiter) + (i + 1 === payloads.length ? '' : '\n'))]);
|
|
36
29
|
}
|
|
30
|
+
rows = Buffer.concat([Buffer.from(Array.from(headers).join(payloads[0].delimiter) + '\n'), rows]);
|
|
37
31
|
const filename = payloads[0].filename;
|
|
38
32
|
return { filename, fileContents: rows };
|
|
39
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/destinations/liveramp-audiences/operations.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AAgCnC,SAAS,YAAY,CAAC,QAAqC;
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/destinations/liveramp-audiences/operations.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AAgCnC,SAAS,YAAY,CAAC,QAAqC;IAEzD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAA;IACjC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IAG3B,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAG1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC3B,MAAM,GAAG,GAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA;QAG/D,IAAI,OAAO,CAAC,wBAAwB,EAAE;YACpC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE;gBAClD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,GAAG,CAAC,EAAE;oBAC/E,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBAChB,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,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AM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAA;AACtD,CAAC;AAoCsB,8CAAiB;AAlCxC,MAAM,IAAI,GAAG,CAAC,KAAa,EAAU,EAAE;IACrC,MAAM,IAAI,GAAG,mBAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC,CAAA;AAMD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,KAAa,EAAU,EAAE;IACvD,QAAQ,GAAG,EAAE;QACX,KAAK,cAAc,CAAC,CAAC;YAMnB,MAAM,UAAU,GAAG,qDAAqD,CAAA;YACxE,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACpC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAA;YAG5C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SAC/B;QAED,KAAK,OAAO,CAAC,CAAC;YACZ,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;SAClC;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAEyC,8BAAS"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
movable_ink_url?: string;
|
|
3
|
+
user_id?: string;
|
|
4
|
+
anonymous_id?: string;
|
|
5
|
+
timestamp: string | number;
|
|
6
|
+
timezone?: string;
|
|
7
|
+
products_required_false?: {
|
|
8
|
+
id: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
price?: number;
|
|
11
|
+
url?: string;
|
|
12
|
+
quantity?: number;
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
}[];
|
|
15
|
+
categories: {
|
|
16
|
+
id: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
}[];
|
|
19
|
+
meta?: {
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/categoryView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const fields_1 = require("../fields");
|
|
8
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Category View',
|
|
11
|
+
description: 'Send a "Category View" event to Movable Ink',
|
|
12
|
+
defaultSubscription: 'type = "track" and event = "Category Viewed"',
|
|
13
|
+
fields: {
|
|
14
|
+
movable_ink_url: fields_1.movable_ink_url,
|
|
15
|
+
user_id: fields_1.user_id,
|
|
16
|
+
anonymous_id: fields_1.anonymous_id,
|
|
17
|
+
timestamp: fields_1.timestamp,
|
|
18
|
+
timezone: fields_1.timezone,
|
|
19
|
+
products_required_false: fields_1.products_required_false,
|
|
20
|
+
categories: fields_1.categories,
|
|
21
|
+
meta: fields_1.meta
|
|
22
|
+
},
|
|
23
|
+
perform: (request, { settings, payload }) => {
|
|
24
|
+
const url = payload?.movable_ink_url ?? settings?.movable_ink_url;
|
|
25
|
+
if (!url)
|
|
26
|
+
throw new actions_core_1.IntegrationError('"Movable Ink URL" setting or "Movable Ink URL" field must be populated', 'MISSING_DESTINATION_URL', 400);
|
|
27
|
+
return request(url, {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
json: {
|
|
30
|
+
event_name: 'Category View',
|
|
31
|
+
user_id: payload.user_id,
|
|
32
|
+
anonymous_id: payload.anonymous_id,
|
|
33
|
+
timestamp: payload.timestamp,
|
|
34
|
+
timezone: payload.timezone,
|
|
35
|
+
product: payload.products_required_false,
|
|
36
|
+
categories: payload.categories,
|
|
37
|
+
metadata: { ...omit_1.default(payload.meta, ['products_required_false', 'categories']) }
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.default = action;
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/categoryView/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAG1E,sCASkB;AAClB,uDAA8B;AAE9B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,6CAA6C;IAC1D,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,eAAe,EAAf,wBAAe;QACf,OAAO,EAAP,gBAAO;QACP,YAAY,EAAZ,qBAAY;QACZ,SAAS,EAAT,kBAAS;QACT,QAAQ,EAAR,iBAAQ;QACR,uBAAuB,EAAvB,gCAAuB;QACvB,UAAU,EAAV,mBAAU;QACV,IAAI,EAAJ,aAAI;KACL;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,eAAe,CAAA;QACjE,IAAI,CAAC,GAAG;YACN,MAAM,IAAI,+BAAgB,CACxB,wEAAwE,EACxE,yBAAyB,EACzB,GAAG,CACJ,CAAA;QAEH,OAAO,OAAO,CAAC,GAAG,EAAE;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,eAAe;gBAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,uBAAuB;gBACxC,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,QAAQ,EAAE,EAAE,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC,EAAE;aAC/E;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
movable_ink_url?: string;
|
|
3
|
+
user_id?: string;
|
|
4
|
+
anonymous_id?: string;
|
|
5
|
+
timestamp: string | number;
|
|
6
|
+
timezone?: string;
|
|
7
|
+
products: {
|
|
8
|
+
id: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
price?: number;
|
|
11
|
+
url?: string;
|
|
12
|
+
quantity?: number;
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
}[];
|
|
15
|
+
order_id: string;
|
|
16
|
+
revenue: number;
|
|
17
|
+
meta?: {
|
|
18
|
+
[k: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/conversion/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 actions_core_1 = require("@segment/actions-core");
|
|
7
|
+
const fields_1 = require("../fields");
|
|
8
|
+
const omit_1 = __importDefault(require("lodash/omit"));
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Conversion',
|
|
11
|
+
description: 'Send a Conversion event Movable Ink',
|
|
12
|
+
defaultSubscription: 'type = "track" and event = "Order Completed"',
|
|
13
|
+
fields: {
|
|
14
|
+
movable_ink_url: fields_1.movable_ink_url,
|
|
15
|
+
user_id: fields_1.user_id,
|
|
16
|
+
anonymous_id: fields_1.anonymous_id,
|
|
17
|
+
timestamp: fields_1.timestamp,
|
|
18
|
+
timezone: fields_1.timezone,
|
|
19
|
+
products: fields_1.products,
|
|
20
|
+
order_id: fields_1.order_id,
|
|
21
|
+
revenue: fields_1.revenue,
|
|
22
|
+
meta: fields_1.meta
|
|
23
|
+
},
|
|
24
|
+
perform: (request, { settings, payload }) => {
|
|
25
|
+
const url = payload?.movable_ink_url ?? settings?.movable_ink_url;
|
|
26
|
+
if (!url)
|
|
27
|
+
throw new actions_core_1.IntegrationError('"Movable Ink URL" setting or "Movable Ink URL" field must be populated', 'MISSING_DESTINATION_URL', 400);
|
|
28
|
+
return request(url, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
json: {
|
|
31
|
+
event_name: 'Conversion',
|
|
32
|
+
user_id: payload.user_id,
|
|
33
|
+
anonymous_id: payload.anonymous_id,
|
|
34
|
+
timestamp: payload.timestamp,
|
|
35
|
+
timezone: payload.timezone,
|
|
36
|
+
products: payload.products,
|
|
37
|
+
order_id: payload.order_id,
|
|
38
|
+
revenue: payload.revenue,
|
|
39
|
+
metadata: { ...omit_1.default(payload.meta, ['products', 'order_id', 'revenue']) }
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.default = action;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/movable-ink/conversion/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAG1E,sCAUkB;AAClB,uDAA8B;AAE9B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/destination-kit/types';
|
|
2
|
+
export declare const movable_ink_url: InputField;
|
|
3
|
+
export declare const timestamp: InputField;
|
|
4
|
+
export declare const timezone: InputField;
|
|
5
|
+
export declare const event_name: InputField;
|
|
6
|
+
export declare const user_id: InputField;
|
|
7
|
+
export declare const anonymous_id: InputField;
|
|
8
|
+
export declare const meta: InputField;
|
|
9
|
+
export declare const query_url: InputField;
|
|
10
|
+
export declare const revenue: InputField;
|
|
11
|
+
export declare const revenue_required_false: InputField;
|
|
12
|
+
export declare const query: InputField;
|
|
13
|
+
export declare const order_id: InputField;
|
|
14
|
+
export declare const order_id_required_false: InputField;
|
|
15
|
+
export declare const product_quantity: InputField;
|
|
16
|
+
export declare const product: InputField;
|
|
17
|
+
export declare const product_with_quantity: InputField;
|
|
18
|
+
export declare const products: InputField;
|
|
19
|
+
export declare const products_required_false: InputField;
|
|
20
|
+
export declare const categories: InputField;
|
|
21
|
+
export declare const categories_required_false: InputField;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categories_required_false = exports.categories = exports.products_required_false = exports.products = exports.product_with_quantity = exports.product = exports.product_quantity = exports.order_id_required_false = exports.order_id = exports.query = exports.revenue_required_false = exports.revenue = exports.query_url = exports.meta = exports.anonymous_id = exports.user_id = exports.event_name = exports.timezone = exports.timestamp = exports.movable_ink_url = void 0;
|
|
4
|
+
exports.movable_ink_url = {
|
|
5
|
+
label: 'Movable Ink URL',
|
|
6
|
+
description: 'The Movable Ink URL to send data to. This field overrides the "Movable Ink URL" setting.',
|
|
7
|
+
type: 'string',
|
|
8
|
+
required: false,
|
|
9
|
+
format: 'uri'
|
|
10
|
+
};
|
|
11
|
+
exports.timestamp = {
|
|
12
|
+
label: 'timestamp',
|
|
13
|
+
description: "Timestamp for the event. Must be in ISO 8601 format. For example '2023-09-18T11:45:59.533Z'. Segment will convert to Unix time before sending to Movable Ink.",
|
|
14
|
+
type: 'datetime',
|
|
15
|
+
required: true,
|
|
16
|
+
default: { '@path': '$.timestamp' }
|
|
17
|
+
};
|
|
18
|
+
exports.timezone = {
|
|
19
|
+
label: 'Timezone',
|
|
20
|
+
description: 'The timezone of where the event took place (TZ database name in the IANA Time Zone Database)',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: false,
|
|
23
|
+
default: {
|
|
24
|
+
'@if': {
|
|
25
|
+
exists: { '@path': '$.context.timezone' },
|
|
26
|
+
then: { '@path': '$.context.timezone' },
|
|
27
|
+
else: { '@path': '$.properties.timezone' }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.event_name = {
|
|
32
|
+
label: 'Event Name',
|
|
33
|
+
description: 'The name of the event to send',
|
|
34
|
+
type: 'string',
|
|
35
|
+
required: true,
|
|
36
|
+
default: { '@path': '$.event' }
|
|
37
|
+
};
|
|
38
|
+
exports.user_id = {
|
|
39
|
+
label: 'User ID',
|
|
40
|
+
description: 'The unique identifier of the profile that triggered this event.',
|
|
41
|
+
type: 'string',
|
|
42
|
+
required: false,
|
|
43
|
+
default: { '@path': '$.userId' }
|
|
44
|
+
};
|
|
45
|
+
exports.anonymous_id = {
|
|
46
|
+
label: 'Anonymous ID',
|
|
47
|
+
description: 'A unique identifier of the anonymous profile that triggered this event.',
|
|
48
|
+
type: 'string',
|
|
49
|
+
required: false,
|
|
50
|
+
default: { '@path': '$.anonymousId' }
|
|
51
|
+
};
|
|
52
|
+
exports.meta = {
|
|
53
|
+
label: 'Metadata',
|
|
54
|
+
description: 'A map of meta data to provide additional context about the event.',
|
|
55
|
+
type: 'object',
|
|
56
|
+
defaultObjectUI: 'keyvalue',
|
|
57
|
+
additionalProperties: true,
|
|
58
|
+
required: false,
|
|
59
|
+
default: { '@path': '$.properties' }
|
|
60
|
+
};
|
|
61
|
+
exports.query_url = {
|
|
62
|
+
label: 'Query URL',
|
|
63
|
+
description: 'The URL of a query the user searched with',
|
|
64
|
+
type: 'string',
|
|
65
|
+
required: false,
|
|
66
|
+
default: { '@path': '$.properties.url' }
|
|
67
|
+
};
|
|
68
|
+
exports.revenue = {
|
|
69
|
+
label: 'Revenue',
|
|
70
|
+
description: 'The revenue generated by the purchase',
|
|
71
|
+
type: 'number',
|
|
72
|
+
required: true,
|
|
73
|
+
default: { '@path': '$.properties.revenue' }
|
|
74
|
+
};
|
|
75
|
+
exports.revenue_required_false = {
|
|
76
|
+
...exports.revenue,
|
|
77
|
+
required: false
|
|
78
|
+
};
|
|
79
|
+
exports.query = {
|
|
80
|
+
label: 'Query',
|
|
81
|
+
description: 'Query the user searched with',
|
|
82
|
+
type: 'string',
|
|
83
|
+
required: true,
|
|
84
|
+
default: { '@path': '$.properties.query' }
|
|
85
|
+
};
|
|
86
|
+
exports.order_id = {
|
|
87
|
+
label: 'Order ID',
|
|
88
|
+
description: 'Unique ID for the purchase',
|
|
89
|
+
type: 'string',
|
|
90
|
+
required: true,
|
|
91
|
+
default: { '@path': '$.properties.order_id' }
|
|
92
|
+
};
|
|
93
|
+
exports.order_id_required_false = {
|
|
94
|
+
...exports.order_id,
|
|
95
|
+
required: false
|
|
96
|
+
};
|
|
97
|
+
exports.product_quantity = {
|
|
98
|
+
label: 'Product Quantity',
|
|
99
|
+
description: 'The quantity of the product.',
|
|
100
|
+
type: 'integer',
|
|
101
|
+
required: false,
|
|
102
|
+
default: { '@path': '$.properties.quantity' }
|
|
103
|
+
};
|
|
104
|
+
exports.product = {
|
|
105
|
+
label: 'Product Details',
|
|
106
|
+
description: 'Product details to associate with the event',
|
|
107
|
+
type: 'object',
|
|
108
|
+
required: true,
|
|
109
|
+
multiple: false,
|
|
110
|
+
additionalProperties: true,
|
|
111
|
+
properties: {
|
|
112
|
+
id: {
|
|
113
|
+
label: 'Product ID',
|
|
114
|
+
description: 'The unique identifier of the product.',
|
|
115
|
+
type: 'string',
|
|
116
|
+
required: true
|
|
117
|
+
},
|
|
118
|
+
title: {
|
|
119
|
+
label: 'Product title',
|
|
120
|
+
description: 'The title or name of the product.',
|
|
121
|
+
type: 'string',
|
|
122
|
+
required: false
|
|
123
|
+
},
|
|
124
|
+
price: {
|
|
125
|
+
label: 'Product price',
|
|
126
|
+
description: 'The product price.',
|
|
127
|
+
type: 'number',
|
|
128
|
+
required: false
|
|
129
|
+
},
|
|
130
|
+
url: {
|
|
131
|
+
label: 'Product URL',
|
|
132
|
+
description: 'The URL of the product.',
|
|
133
|
+
type: 'string',
|
|
134
|
+
required: false
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
default: {
|
|
138
|
+
id: { '@path': '$.properties.product_id' },
|
|
139
|
+
title: { '@path': '$.properties.name' },
|
|
140
|
+
price: { '@path': '$.properties.price' },
|
|
141
|
+
url: { '@path': '$.properties.url' }
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
exports.product_with_quantity = {
|
|
145
|
+
...exports.product,
|
|
146
|
+
properties: {
|
|
147
|
+
...exports.product.properties,
|
|
148
|
+
quantity: {
|
|
149
|
+
label: 'Quantity',
|
|
150
|
+
description: 'The quantity of the product.',
|
|
151
|
+
type: 'integer',
|
|
152
|
+
required: false
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
default: {
|
|
156
|
+
...exports.product.default,
|
|
157
|
+
quantity: { '@path': '$.quantity' }
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
exports.products = {
|
|
161
|
+
label: 'Products',
|
|
162
|
+
description: 'Product details to associate with the event.',
|
|
163
|
+
type: 'object',
|
|
164
|
+
required: true,
|
|
165
|
+
multiple: true,
|
|
166
|
+
additionalProperties: true,
|
|
167
|
+
properties: {
|
|
168
|
+
id: {
|
|
169
|
+
label: 'Product ID',
|
|
170
|
+
description: 'The unique identifier of the product.',
|
|
171
|
+
type: 'string',
|
|
172
|
+
required: true
|
|
173
|
+
},
|
|
174
|
+
title: {
|
|
175
|
+
label: 'Product title',
|
|
176
|
+
description: 'The title or name of the product.',
|
|
177
|
+
type: 'string',
|
|
178
|
+
required: false
|
|
179
|
+
},
|
|
180
|
+
price: {
|
|
181
|
+
label: 'Product price',
|
|
182
|
+
description: 'The product price.',
|
|
183
|
+
type: 'number',
|
|
184
|
+
required: false
|
|
185
|
+
},
|
|
186
|
+
url: {
|
|
187
|
+
label: 'Product URL',
|
|
188
|
+
description: 'The URL of the product.',
|
|
189
|
+
type: 'string',
|
|
190
|
+
required: false
|
|
191
|
+
},
|
|
192
|
+
quantity: {
|
|
193
|
+
label: 'Product Quantity',
|
|
194
|
+
description: 'The quantity of the product.',
|
|
195
|
+
type: 'integer',
|
|
196
|
+
required: false
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
default: {
|
|
200
|
+
'@arrayPath': [
|
|
201
|
+
'$.properties.products',
|
|
202
|
+
{
|
|
203
|
+
id: { '@path': '$.product_id' },
|
|
204
|
+
title: { '@path': '$.name' },
|
|
205
|
+
price: { '@path': '$.price' },
|
|
206
|
+
url: { '@path': '$.url' },
|
|
207
|
+
quantity: { '@path': '$.quantity' }
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
exports.products_required_false = {
|
|
213
|
+
...exports.products,
|
|
214
|
+
required: false
|
|
215
|
+
};
|
|
216
|
+
exports.categories = {
|
|
217
|
+
label: 'Categories',
|
|
218
|
+
description: 'Product Category details',
|
|
219
|
+
type: 'object',
|
|
220
|
+
multiple: true,
|
|
221
|
+
required: true,
|
|
222
|
+
defaultObjectUI: 'keyvalue',
|
|
223
|
+
additionalProperties: false,
|
|
224
|
+
properties: {
|
|
225
|
+
id: { label: 'Category ID', description: 'The unique identifier of the Category.', type: 'string', required: true },
|
|
226
|
+
url: { label: 'Category URL', description: 'The URL of the Category', type: 'string' }
|
|
227
|
+
},
|
|
228
|
+
default: {
|
|
229
|
+
'@arrayPath': ['$.properties.categories', { id: { '@path': '$.id' }, url: { '@path': '$.url' } }]
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
exports.categories_required_false = {
|
|
233
|
+
...exports.categories,
|
|
234
|
+
required: false
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=fields.js.map
|