@segment/action-destinations 3.331.6-staging.2 → 3.331.7-staging.1
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/absmartly/segment.d.ts +11 -0
- package/dist/destinations/absmartly/segment.js +3 -0
- package/dist/destinations/absmartly/segment.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap +208 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/display-video-360/addToAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/addToAudience/index.js +2 -3
- package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +3 -3
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/display-video-360/properties.d.ts +1 -1
- package/dist/destinations/display-video-360/properties.js +17 -14
- package/dist/destinations/display-video-360/properties.js.map +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/index.js +2 -3
- package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/shared.js +3 -3
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/dist/destinations/gleap/generated-types.d.ts +3 -0
- package/dist/destinations/gleap/generated-types.js +3 -0
- package/dist/destinations/gleap/generated-types.js.map +1 -0
- package/dist/destinations/gleap/identifyContact/generated-types.d.ts +18 -0
- package/dist/destinations/gleap/identifyContact/generated-types.js +3 -0
- package/dist/destinations/gleap/identifyContact/generated-types.js.map +1 -0
- package/dist/destinations/gleap/identifyContact/index.d.ts +5 -0
- package/dist/destinations/gleap/identifyContact/index.js +155 -0
- package/dist/destinations/gleap/identifyContact/index.js.map +1 -0
- package/dist/destinations/gleap/index.d.ts +4 -0
- package/dist/destinations/gleap/index.js +52 -0
- package/dist/destinations/gleap/index.js.map +1 -0
- package/dist/destinations/gleap/trackEvent/generated-types.d.ts +10 -0
- package/dist/destinations/gleap/trackEvent/generated-types.js +3 -0
- package/dist/destinations/gleap/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/gleap/trackEvent/index.d.ts +5 -0
- package/dist/destinations/gleap/trackEvent/index.js +111 -0
- package/dist/destinations/gleap/trackEvent/index.js.map +1 -0
- package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +2 -1
- package/dist/destinations/klaviyo/addProfileToList/index.js +7 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +8 -0
- package/dist/destinations/klaviyo/functions.js +34 -1
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/properties.d.ts +2 -1
- package/dist/destinations/klaviyo/properties.js +8 -3
- package/dist/destinations/klaviyo/properties.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.d.ts +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +41 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/upsertProfile/index.js +26 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +1 -1
- package/dist/destinations/linkedin-conversions/api/index.js +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.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/tiktok-audiences/properties.js +5 -4
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/tiktok-conversions/index.js +92 -3
- package/dist/destinations/tiktok-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +33 -24
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +12 -4
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +113 -40
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +199 -48
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- 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/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +317 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
- 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/identifyUser/generated-types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js +3 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/trackey/identifyUser/index.d.ts +5 -0
- package/dist/destinations/trackey/identifyUser/index.js +52 -0
- package/dist/destinations/trackey/identifyUser/index.js.map +1 -0
- package/dist/destinations/trackey/identifyUser.types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser.types.js +3 -0
- package/dist/destinations/trackey/identifyUser.types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/generated-types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js +3 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/index.d.ts +5 -0
- package/dist/destinations/trackey/registerCompany/index.js +60 -0
- package/dist/destinations/trackey/registerCompany/index.js.map +1 -0
- package/dist/destinations/trackey/registerCompany.types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany.types.js +3 -0
- package/dist/destinations/trackey/registerCompany.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/trackey/trackEvent/generated-types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js +3 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/index.d.ts +5 -0
- package/dist/destinations/trackey/trackEvent/index.js +68 -0
- package/dist/destinations/trackey/trackEvent/index.js.map +1 -0
- package/dist/destinations/trackey/trackEvent.types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent.types.js +3 -0
- package/dist/destinations/trackey/trackEvent.types.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,8EAAqD;AAErD,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE;QACL,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY;KACtB;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,YAAY;KACtB;IACD,UAAU,EAAE;QACV,OAAO,EAAE,cAAc;KACxB;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,QAAQ;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,SAAS;KACnB;CACF,CAAA;AAED,MAAM,qBAAqB,GAAG;IAC5B,GAAG,4BAAa,CAAC,4BAAkB,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,cAAc;YACd;gBACE,GAAG,iBAAiB;aACrB;SACF;KACF;CACF,CAAA;AAED,MAAM,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YAAY;oBACnB,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,EAAE;iBACZ;aACF,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE;gBACP,cAAc,EAAE,QAAQ,CAAC,WAAW;gBACpC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAA;IACH,CAAC;IACD,OAAO;IACP,OAAO,EAAE;QACP,kBAAkB,EAAlB,4BAAkB;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatPhones = exports.formatUserIds = exports.formatEmails = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const formatEmails = (email_addresses) => {
|
|
6
|
+
const result = [];
|
|
7
|
+
if (email_addresses) {
|
|
8
|
+
email_addresses.forEach((email) => {
|
|
9
|
+
result.push(hashAndEncode(email.toLowerCase()));
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
exports.formatEmails = formatEmails;
|
|
15
|
+
function formatUserIds(userIds) {
|
|
16
|
+
const result = [];
|
|
17
|
+
if (userIds) {
|
|
18
|
+
userIds.forEach((userId) => {
|
|
19
|
+
result.push(hashAndEncode(userId.toLowerCase()));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
exports.formatUserIds = formatUserIds;
|
|
25
|
+
const formatPhones = (phone_numbers) => {
|
|
26
|
+
const result = [];
|
|
27
|
+
if (!phone_numbers)
|
|
28
|
+
return result;
|
|
29
|
+
phone_numbers.forEach((phone) => {
|
|
30
|
+
const validatedPhone = phone.match(/[0-9]{0,14}/g);
|
|
31
|
+
if (validatedPhone === null) {
|
|
32
|
+
throw new Error(`${phone} is not a valid E.164 phone number.`);
|
|
33
|
+
}
|
|
34
|
+
const formattedPhone = `+${phone.replace(/[^0-9]/g, '')}`;
|
|
35
|
+
result.push(hashAndEncode(formattedPhone.substring(0, 15)));
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
exports.formatPhones = formatPhones;
|
|
40
|
+
function hashAndEncode(property) {
|
|
41
|
+
return crypto_1.createHash('sha256').update(property).digest('hex');
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAK5B,MAAM,YAAY,GAAG,CAAC,eAAqC,EAAY,EAAE;IAC9E,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,eAAe,EAAE;QACnB,eAAe,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE;YACxC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;KACH;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AARY,QAAA,YAAY,gBAQxB;AAOD,SAAgB,aAAa,CAAC,OAA6B;IACzD,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,OAAO,CAAC,CAAC,MAAc,EAAE,EAAE;YACjC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;KACH;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AARD,sCAQC;AAOM,MAAM,YAAY,GAAG,CAAC,aAAmC,EAAY,EAAE;IAC5E,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,CAAC,aAAa;QAAE,OAAO,MAAM,CAAA;IAEjC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE;QACtC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAClD,IAAI,cAAc,KAAK,IAAI,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qCAAqC,CAAC,CAAA;SAC/D;QAED,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAA;QAEzD,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAhBY,QAAA,YAAY,gBAgBxB;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event: string;
|
|
3
|
+
event_id?: string;
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
phone_numbers?: string[];
|
|
6
|
+
emails?: string[];
|
|
7
|
+
external_ids?: string[];
|
|
8
|
+
ttclid?: string;
|
|
9
|
+
ttp?: string;
|
|
10
|
+
lead_id?: string;
|
|
11
|
+
locale?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
referrer?: string;
|
|
14
|
+
ip?: string;
|
|
15
|
+
user_agent?: string;
|
|
16
|
+
contents?: {
|
|
17
|
+
price?: number;
|
|
18
|
+
quantity?: number;
|
|
19
|
+
content_category?: string;
|
|
20
|
+
content_id?: string;
|
|
21
|
+
content_name?: string;
|
|
22
|
+
brand?: string;
|
|
23
|
+
}[];
|
|
24
|
+
content_type?: string;
|
|
25
|
+
currency?: string;
|
|
26
|
+
value?: number;
|
|
27
|
+
description?: string;
|
|
28
|
+
query?: string;
|
|
29
|
+
order_id?: string;
|
|
30
|
+
shop_id?: string;
|
|
31
|
+
limited_data_use?: boolean;
|
|
32
|
+
test_event_code?: string;
|
|
33
|
+
}
|
package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
+
const formatter_1 = require("./formatter");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Track Payment Offline Conversion',
|
|
7
|
+
description: 'Send details of an in-store purchase or console purchase to the Tiktok Offline Events API',
|
|
8
|
+
fields: {
|
|
9
|
+
event: {
|
|
10
|
+
label: 'Event Name',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Conversion event name. Please refer to the "Offline Standard Events" section on in TikTok’s [Events API 2.0 documentation](https://business-api.tiktok.com/portal/docs?id=1771101186666498) for accepted event names.'
|
|
14
|
+
},
|
|
15
|
+
event_id: {
|
|
16
|
+
label: 'Event ID',
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'Any hashed ID that can identify a unique user/session.',
|
|
19
|
+
default: {
|
|
20
|
+
'@path': '$.messageId'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
timestamp: {
|
|
24
|
+
label: 'Event Timestamp',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Timestamp that the event took place, in ISO 8601 format.',
|
|
27
|
+
default: {
|
|
28
|
+
'@path': '$.timestamp'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
phone_numbers: {
|
|
32
|
+
label: 'Phone Numbers',
|
|
33
|
+
description: 'A single phone number or array of phone numbers in E.164 standard format. Segment will hash this value before sending to TikTok. At least one phone number is required if no value is provided in the Emails field.',
|
|
34
|
+
type: 'string',
|
|
35
|
+
multiple: true,
|
|
36
|
+
default: {
|
|
37
|
+
'@if': {
|
|
38
|
+
exists: { '@path': '$.properties.phone' },
|
|
39
|
+
then: { '@path': '$.properties.phone' },
|
|
40
|
+
else: { '@path': '$.traits.phone' }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
emails: {
|
|
45
|
+
label: 'Emails',
|
|
46
|
+
description: 'A single email address or an array of email addresses. Segment will hash this value before sending to TikTok. At least one email is required if no value is provided in the Phone Numbers field.',
|
|
47
|
+
type: 'string',
|
|
48
|
+
multiple: true,
|
|
49
|
+
default: {
|
|
50
|
+
'@if': {
|
|
51
|
+
exists: { '@path': '$.properties.email' },
|
|
52
|
+
then: { '@path': '$.properties.email' },
|
|
53
|
+
else: { '@path': '$.traits.email' }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
external_ids: {
|
|
58
|
+
label: 'External ID',
|
|
59
|
+
description: 'Uniquely identifies the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
|
|
60
|
+
type: 'string',
|
|
61
|
+
multiple: true,
|
|
62
|
+
default: {
|
|
63
|
+
'@if': {
|
|
64
|
+
exists: { '@path': '$.userId' },
|
|
65
|
+
then: { '@path': '$.userId' },
|
|
66
|
+
else: { '@path': '$.anonymousId' }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
ttclid: {
|
|
71
|
+
label: 'TikTok Click ID',
|
|
72
|
+
description: 'The value of the ttclid used to match website visitor events with TikTok ads. The ttclid is valid for 7 days. See [Set up ttclid](https://ads.tiktok.com/marketing_api/docs?rid=4eezrhr6lg4&id=1681728034437121) for details.',
|
|
73
|
+
type: 'string',
|
|
74
|
+
default: {
|
|
75
|
+
'@if': {
|
|
76
|
+
exists: { '@path': '$.properties.ttclid' },
|
|
77
|
+
then: { '@path': '$.properties.ttclid' },
|
|
78
|
+
else: { '@path': '$.traits.ttclid' }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
ttp: {
|
|
83
|
+
label: 'TikTok Cookie ID',
|
|
84
|
+
description: 'TikTok Cookie ID. If you also use Pixel SDK and have enabled cookies, Pixel SDK automatically saves a unique identifier in the `_ttp` cookie. The value of `_ttp` is used to match website visitor events with TikTok ads. You can extract the value of `_ttp` and attach the value here. To learn more about the `ttp` parameter, refer to [Events API 2.0 - Send TikTok Cookie](https://ads.tiktok.com/marketing_api/docs?id=%201771100936446977) (`_ttp`).',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: {
|
|
87
|
+
'@if': {
|
|
88
|
+
exists: { '@path': '$.properties.ttp' },
|
|
89
|
+
then: { '@path': '$.properties.ttp' },
|
|
90
|
+
else: { '@path': '$.integrations.TikTok Pixel.ttp' }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
lead_id: {
|
|
95
|
+
label: 'TikTok Lead ID',
|
|
96
|
+
description: 'ID of TikTok leads. Every lead will have its own lead_id when exported from TikTok. This feature is in Beta. Please contact your TikTok representative to inquire regarding availability',
|
|
97
|
+
type: 'string',
|
|
98
|
+
default: {
|
|
99
|
+
'@if': {
|
|
100
|
+
exists: { '@path': '$.properties.lead_id' },
|
|
101
|
+
then: { '@path': '$.properties.lead_id' },
|
|
102
|
+
else: { '@path': '$.traits.lead_id' }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
locale: {
|
|
107
|
+
label: 'Locale',
|
|
108
|
+
description: 'The BCP 47 language identifier. For reference, refer to the [IETF BCP 47 standardized code](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).',
|
|
109
|
+
type: 'string',
|
|
110
|
+
default: {
|
|
111
|
+
'@path': '$.context.locale'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
url: {
|
|
115
|
+
label: 'Page URL',
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'The page URL where the conversion event took place.',
|
|
118
|
+
default: {
|
|
119
|
+
'@path': '$.context.page.url'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
referrer: {
|
|
123
|
+
label: 'Page Referrer',
|
|
124
|
+
type: 'string',
|
|
125
|
+
description: 'The page referrer.',
|
|
126
|
+
default: {
|
|
127
|
+
'@path': '$.context.page.referrer'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
ip: {
|
|
131
|
+
label: 'IP Address',
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'IP address of the browser.',
|
|
134
|
+
default: {
|
|
135
|
+
'@path': '$.context.ip'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
user_agent: {
|
|
139
|
+
label: 'User Agent',
|
|
140
|
+
type: 'string',
|
|
141
|
+
description: 'User agent from the user’s device.',
|
|
142
|
+
default: {
|
|
143
|
+
'@path': '$.context.userAgent'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
contents: {
|
|
147
|
+
label: 'Contents',
|
|
148
|
+
type: 'object',
|
|
149
|
+
multiple: true,
|
|
150
|
+
description: 'Related items in a web event.',
|
|
151
|
+
properties: {
|
|
152
|
+
price: {
|
|
153
|
+
label: 'Price',
|
|
154
|
+
description: 'Price of the item.',
|
|
155
|
+
type: 'number'
|
|
156
|
+
},
|
|
157
|
+
quantity: {
|
|
158
|
+
label: 'Quantity',
|
|
159
|
+
description: 'Number of items.',
|
|
160
|
+
type: 'number'
|
|
161
|
+
},
|
|
162
|
+
content_category: {
|
|
163
|
+
label: 'Content Category',
|
|
164
|
+
description: 'Category of the product item.',
|
|
165
|
+
type: 'string'
|
|
166
|
+
},
|
|
167
|
+
content_id: {
|
|
168
|
+
label: 'Content ID',
|
|
169
|
+
description: 'ID of the product item.',
|
|
170
|
+
type: 'string'
|
|
171
|
+
},
|
|
172
|
+
content_name: {
|
|
173
|
+
label: 'Content Name',
|
|
174
|
+
description: 'Name of the product item.',
|
|
175
|
+
type: 'string'
|
|
176
|
+
},
|
|
177
|
+
brand: {
|
|
178
|
+
label: 'Brand',
|
|
179
|
+
description: 'Brand name of the product item.',
|
|
180
|
+
type: 'string'
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
content_type: {
|
|
185
|
+
label: 'Content Type',
|
|
186
|
+
description: 'Type of the product item. When the `content_id` in the `contents` parameter is specified as `sku_id`, set this field to `product`. When the `content_id` in the `contents` parameter is specified as `item_group_id`, set this field to `product_group`.',
|
|
187
|
+
type: 'string',
|
|
188
|
+
choices: ['product', 'product_group'],
|
|
189
|
+
default: 'product'
|
|
190
|
+
},
|
|
191
|
+
currency: {
|
|
192
|
+
label: 'Currency',
|
|
193
|
+
type: 'string',
|
|
194
|
+
description: 'Currency for the value specified as ISO 4217 code.',
|
|
195
|
+
default: {
|
|
196
|
+
'@path': '$.properties.currency'
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
value: {
|
|
200
|
+
label: 'Value',
|
|
201
|
+
type: 'number',
|
|
202
|
+
description: 'Value of the order or items sold.',
|
|
203
|
+
default: {
|
|
204
|
+
'@if': {
|
|
205
|
+
exists: { '@path': '$.properties.value' },
|
|
206
|
+
then: { '@path': '$.properties.value' },
|
|
207
|
+
else: { '@path': '$.properties.revenue' }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
description: {
|
|
212
|
+
label: 'Description',
|
|
213
|
+
type: 'string',
|
|
214
|
+
description: 'A string description of the web event.'
|
|
215
|
+
},
|
|
216
|
+
query: {
|
|
217
|
+
label: 'Query',
|
|
218
|
+
type: 'string',
|
|
219
|
+
description: 'The text string that was searched for.',
|
|
220
|
+
default: {
|
|
221
|
+
'@path': '$.properties.query'
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
order_id: {
|
|
225
|
+
label: 'Order ID',
|
|
226
|
+
type: 'string',
|
|
227
|
+
description: 'Order ID of the transaction.',
|
|
228
|
+
default: {
|
|
229
|
+
'@path': '$.properties.order_id'
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
shop_id: {
|
|
233
|
+
label: 'Shop ID',
|
|
234
|
+
type: 'string',
|
|
235
|
+
description: 'Shop ID of the transaction.',
|
|
236
|
+
default: {
|
|
237
|
+
'@path': '$.properties.shop_id'
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
limited_data_use: {
|
|
241
|
+
label: 'Limited Data Use',
|
|
242
|
+
type: 'boolean',
|
|
243
|
+
description: 'Use this field to flag an event for limited data processing. TikTok will recognize this parameter as a request for limited data processing, and will limit its processing activities accordingly if the event shared occurred in an eligible location. To learn more about the Limited Data Use feature, refer to [Events API 2.0 - Limited Data Use](https://ads.tiktok.com/marketing_api/docs?id=1771101204435970).',
|
|
244
|
+
default: {
|
|
245
|
+
'@path': '$.properties.limited_data_use'
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
test_event_code: {
|
|
249
|
+
label: 'Test Event Code',
|
|
250
|
+
type: 'string',
|
|
251
|
+
description: 'Use this field to specify that events should be test events rather than actual traffic. You can find your Test Event Code in your TikTok Events Manager under the "Test Event" tab. You\'ll want to remove your Test Event Code when sending real traffic through this integration.'
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
perform: (request, { payload, settings }) => {
|
|
255
|
+
const phone_numbers = formatter_1.formatPhones(payload.phone_numbers);
|
|
256
|
+
const emails = formatter_1.formatEmails(payload.emails);
|
|
257
|
+
const userIds = formatter_1.formatUserIds(payload.external_ids);
|
|
258
|
+
if (phone_numbers.length < 1 && emails.length < 1 && userIds.length < 1)
|
|
259
|
+
throw new actions_core_1.PayloadValidationError('TikTok Offline Conversions API requires an email address and/or phone number');
|
|
260
|
+
let payloadUrl, urlTtclid;
|
|
261
|
+
if (payload.url) {
|
|
262
|
+
try {
|
|
263
|
+
payloadUrl = new URL(payload.url);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (payloadUrl)
|
|
269
|
+
urlTtclid = payloadUrl.searchParams.get('ttclid');
|
|
270
|
+
return request('https://business-api.tiktok.com/open_api/v1.3/event/track/', {
|
|
271
|
+
method: 'post',
|
|
272
|
+
json: {
|
|
273
|
+
event_source: 'offline',
|
|
274
|
+
event_source_id: settings.eventSetID,
|
|
275
|
+
partner_name: 'Segment',
|
|
276
|
+
data: [
|
|
277
|
+
{
|
|
278
|
+
event: payload.event,
|
|
279
|
+
event_time: payload.timestamp
|
|
280
|
+
? Math.floor(new Date(payload.timestamp).getTime() / 1000)
|
|
281
|
+
: Math.floor(new Date().getTime() / 1000),
|
|
282
|
+
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
283
|
+
user: {
|
|
284
|
+
ttclid: payload.ttclid ? payload.ttclid : urlTtclid ? urlTtclid : undefined,
|
|
285
|
+
external_id: userIds,
|
|
286
|
+
phone_number: phone_numbers,
|
|
287
|
+
email: emails,
|
|
288
|
+
lead_id: payload.lead_id ? payload.lead_id : undefined,
|
|
289
|
+
ttp: payload.ttp ? payload.ttp : undefined,
|
|
290
|
+
ip: payload.ip ? payload.ip : undefined,
|
|
291
|
+
user_agent: payload.user_agent ? payload.user_agent : undefined,
|
|
292
|
+
locale: payload.locale ? payload.locale : undefined
|
|
293
|
+
},
|
|
294
|
+
properties: {
|
|
295
|
+
contents: payload.contents ? payload.contents : [],
|
|
296
|
+
content_type: payload.content_type ? payload.content_type : undefined,
|
|
297
|
+
currency: payload.currency ? payload.currency : undefined,
|
|
298
|
+
value: payload.value ? payload.value : undefined,
|
|
299
|
+
query: payload.query ? payload.query : undefined,
|
|
300
|
+
description: payload.description ? payload.description : undefined,
|
|
301
|
+
order_id: payload.order_id ? payload.order_id : undefined,
|
|
302
|
+
shop_id: payload.shop_id ? payload.shop_id : undefined
|
|
303
|
+
},
|
|
304
|
+
page: {
|
|
305
|
+
url: payload.url ? payload.url : undefined,
|
|
306
|
+
referrer: payload.referrer ? payload.referrer : undefined
|
|
307
|
+
},
|
|
308
|
+
limited_data_use: payload.limited_data_use ? payload.limited_data_use : false,
|
|
309
|
+
test_event_code: payload.test_event_code ? payload.test_event_code : undefined
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
exports.default = action;
|
|
317
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/reportOfflineEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAAgF;AAGhF,2CAAuE;AAEvE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kCAAkC;IACzC,WAAW,EAAE,2FAA2F;IACxG,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,uNAAuN;SAC1N;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wDAAwD;YACrE,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0DAA0D;YACvE,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QAED,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,qNAAqN;YACvN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB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AAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;yBACvD;wBACD,IAAI,EAAE;4BACJ,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;4BAC1C,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;yBAC1D;wBACD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;wBAC7E,eAAe,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;qBAC/E;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/group.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identify.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/identify.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/identifyUser/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const constants_1 = require("../constants");
|
|
4
|
+
const action = {
|
|
5
|
+
title: 'Identify User',
|
|
6
|
+
description: 'Identify a user',
|
|
7
|
+
defaultSubscription: 'type = "identify"',
|
|
8
|
+
fields: {
|
|
9
|
+
userId: {
|
|
10
|
+
label: 'User ID',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'The user identifier to associate the event with',
|
|
14
|
+
default: { '@path': '$.userId' }
|
|
15
|
+
},
|
|
16
|
+
messageId: {
|
|
17
|
+
label: 'Message ID',
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'A unique value for each event.',
|
|
20
|
+
default: {
|
|
21
|
+
'@path': '$.messageId'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
timestamp: {
|
|
25
|
+
label: 'Event Timestamp',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
29
|
+
default: { '@path': '$.timestamp' }
|
|
30
|
+
},
|
|
31
|
+
traits: {
|
|
32
|
+
label: 'User Traits',
|
|
33
|
+
type: 'object',
|
|
34
|
+
required: false,
|
|
35
|
+
description: 'User profile information',
|
|
36
|
+
default: { '@path': '$.traits' }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
perform: (request, { payload }) => {
|
|
40
|
+
return request(constants_1.baseUrl, {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
json: {
|
|
43
|
+
userId: payload.userId,
|
|
44
|
+
messageId: payload.messageId,
|
|
45
|
+
timestamp: payload.timestamp,
|
|
46
|
+
traits: payload.traits
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.default = action;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/identifyUser/index.ts"],"names":[],"mappings":";;AAGA,4CAAsC;AAEtC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,iBAAiB;IAC9B,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,iDAAiD;YAC9D,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gCAAgC;YAC7C,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wFAAwF;YACrG,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;QACD,MAAM,EAAE;YACN,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,0BAA0B;YACvC,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,mBAAO,EAAE;YACtB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifyUser.types.js","sourceRoot":"","sources":["../../../src/destinations/trackey/identifyUser.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/trackey/registerCompany/generated-types.ts"],"names":[],"mappings":""}
|