@segment/action-destinations 3.152.0 → 3.153.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/engage-messaging-sendgrid/sendEmail/index.js +74 -59
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +2 -2
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +3 -2
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +6 -2
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +2 -2
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +3 -2
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +6 -2
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +3 -2
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +27 -13
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/constants.d.ts +1 -1
- package/dist/destinations/facebook-conversions-api/constants.js +1 -1
- package/dist/destinations/the-trade-desk-crm/generated-types.d.ts +2 -0
- package/dist/destinations/the-trade-desk-crm/generated-types.js +3 -0
- package/dist/destinations/the-trade-desk-crm/generated-types.js.map +1 -0
- package/dist/destinations/the-trade-desk-crm/index.d.ts +4 -0
- package/dist/destinations/the-trade-desk-crm/index.js +14 -0
- package/dist/destinations/the-trade-desk-crm/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/common_fields.d.ts +2 -0
- package/dist/destinations/tiktok-offline-conversions/common_fields.js +85 -0
- package/dist/destinations/tiktok-offline-conversions/common_fields.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.d.ts +2 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.js +33 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/generated-types.d.ts +4 -0
- package/dist/destinations/tiktok-offline-conversions/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/index.d.ts +4 -0
- package/dist/destinations/tiktok-offline-conversions/index.js +93 -0
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.d.ts +10 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js +36 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.d.ts +20 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js +132 -0
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-sender.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/message-sender.ts"],"names":[],"mappings":";;;AAIA,wDAAwD;AAGxD,IAAK,iBAMJ;AAND,WAAK,iBAAiB;IACpB,sDAAiC,CAAA;IACjC,+CAA0B,CAAA;IAC1B,8CAAyB,CAAA;IACzB,mDAA8B,CAAA;IAC9B,8EAAyD,CAAA;AAC3D,CAAC,EANI,iBAAiB,KAAjB,iBAAiB,QAMrB;
|
|
1
|
+
{"version":3,"file":"message-sender.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/message-sender.ts"],"names":[],"mappings":";;;AAIA,wDAAwD;AAGxD,IAAK,iBAMJ;AAND,WAAK,iBAAiB;IACpB,sDAAiC,CAAA;IACjC,+CAA0B,CAAA;IAC1B,8CAAyB,CAAA;IACzB,mDAA8B,CAAA;IAC9B,8EAAyD,CAAA;AAC3D,CAAC,EANI,iBAAiB,KAAjB,iBAAiB,QAMrB;AAsBD,MAAsB,aAAa;IAKjC,YACW,OAAkB,EAClB,OAAmB,EACnB,QAAkB,EAClB,WAAoC,EACpC,IAA0B,EAC1B,MAA0B;QAL1B,YAAO,GAAP,OAAO,CAAW;QAClB,YAAO,GAAP,OAAO,CAAY;QACnB,aAAQ,GAAR,QAAQ,CAAU;QAClB,gBAAW,GAAX,WAAW,CAAyB;QACpC,SAAI,GAAJ,IAAI,CAAsB;QAC1B,WAAM,GAAN,MAAM,CAAoB;QAVpB,oBAAe,GAAG,OAAO,CAAA;QACzB,qBAAgB,GAAG,gBAAgB,CAAA;QACnC,iCAA4B,GAAG,aAAa,CAAA;QAe7D,SAAI,GAAG,KAAK,IAAI,EAAE;YAChB,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAA;YAEjE,IAAI,iBAAiB,KAAK,iBAAiB,CAAC,UAAU,IAAI,CAAC,KAAK,EAAE;gBAChE,OAAM;aACP;YAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK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,CAAC,UAAU,CAAC,EAAE;oBACzC,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;iBACvE;gBAED,oBAAoB,CAAC,IAAI,GAAG,mBAAmB,IAAI,IAAI,CAAC,4BAA4B,CAAA;gBAEpF,OAAO,oBAAoB,CAAC,QAAQ,EAAE,CAAA;aACvC;YAED,OAAO,IAAI,CAAA;QACb,CAAC,CAAA;IA5HE,CAAC;CA6HL;AAzID,sCAyIC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.COUNTRY_CODES = exports.US_STATE_CODES = exports.CURRENCY_ISO_CODES = exports.CANARY_API_VERSION = exports.API_VERSION = void 0;
|
|
4
|
-
exports.API_VERSION = '
|
|
4
|
+
exports.API_VERSION = '16.0';
|
|
5
5
|
exports.CANARY_API_VERSION = '16.0';
|
|
6
6
|
exports.CURRENCY_ISO_CODES = new Set([
|
|
7
7
|
'AED',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const destination = {
|
|
4
|
+
name: 'The Trade Desk Crm',
|
|
5
|
+
slug: 'actions-the-trade-desk-crm',
|
|
6
|
+
mode: 'cloud',
|
|
7
|
+
authentication: {
|
|
8
|
+
scheme: 'custom',
|
|
9
|
+
fields: {}
|
|
10
|
+
},
|
|
11
|
+
actions: {}
|
|
12
|
+
};
|
|
13
|
+
exports.default = destination;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/index.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;KACX;IAED,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonFields = void 0;
|
|
4
|
+
exports.commonFields = {
|
|
5
|
+
event: {
|
|
6
|
+
label: 'Event Name',
|
|
7
|
+
type: 'string',
|
|
8
|
+
required: true,
|
|
9
|
+
description: 'Conversion event name. Please refer to the "Supported Offline Events" section on in TikTok’s [Offline Events API documentation](https://ads.tiktok.com/marketing_api/docs?id=1758053486938113) for accepted event names.'
|
|
10
|
+
},
|
|
11
|
+
event_id: {
|
|
12
|
+
label: 'Event ID',
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'A unique value for each event. This ID can be used to match data between partner and TikTok. We suggest it is a String of 32 characters, including numeric digits (0-9), uppercase letters (A-Z), and lowercase letters (a-z).',
|
|
15
|
+
default: {
|
|
16
|
+
'@path': '$.messageId'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
timestamp: {
|
|
20
|
+
label: 'Event Timestamp',
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
24
|
+
default: {
|
|
25
|
+
'@path': '$.timestamp'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
phone_numbers: {
|
|
29
|
+
label: 'Phone Numbers',
|
|
30
|
+
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.',
|
|
31
|
+
type: 'string',
|
|
32
|
+
multiple: true,
|
|
33
|
+
default: {
|
|
34
|
+
'@if': {
|
|
35
|
+
exists: { '@path': '$.properties.phone' },
|
|
36
|
+
then: { '@path': '$.properties.phone' },
|
|
37
|
+
else: { '@path': '$.traits.phone' }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
email_addresses: {
|
|
42
|
+
label: 'Emails',
|
|
43
|
+
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.',
|
|
44
|
+
type: 'string',
|
|
45
|
+
multiple: true,
|
|
46
|
+
default: {
|
|
47
|
+
'@if': {
|
|
48
|
+
exists: { '@path': '$.properties.email' },
|
|
49
|
+
then: { '@path': '$.properties.email' },
|
|
50
|
+
else: { '@path': '$.traits.email' }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
order_id: {
|
|
55
|
+
label: 'Order ID',
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'The order id',
|
|
58
|
+
default: {
|
|
59
|
+
'@path': '$.properties.order_id'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
shop_id: {
|
|
63
|
+
label: 'Shop ID',
|
|
64
|
+
type: 'string',
|
|
65
|
+
description: 'The shop id',
|
|
66
|
+
default: {
|
|
67
|
+
'@path': '$.properties.shop_id'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
event_channel: {
|
|
71
|
+
label: 'Event channel',
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'Event channel of the offline conversion event. Accepted values are: email, website, phone_call, in_store, crm, other. Any other value will be rejected',
|
|
74
|
+
choices: [
|
|
75
|
+
{ label: 'Email', value: 'email' },
|
|
76
|
+
{ label: 'Website', value: 'website' },
|
|
77
|
+
{ label: 'Phone call', value: 'phone_call' },
|
|
78
|
+
{ label: 'In store', value: 'in_store' },
|
|
79
|
+
{ label: 'CRM', value: 'crm' },
|
|
80
|
+
{ label: 'Other', value: 'other' }
|
|
81
|
+
],
|
|
82
|
+
default: 'in_store'
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=common_fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common_fields.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/common_fields.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAA+B;IACtD,KAAK,EAAE;QACL,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,0NAA0N;KAC7N;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,gOAAgO;QAClO,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,SAAS,EAAE;QACT,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,wFAAwF;QACrG,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,qNAAqN;QACvN,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;gBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;gBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;aACpC;SACF;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,QAAQ;QACf,WAAW,EACT,kMAAkM;QACpM,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,KAAK,EAAE;gBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;gBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;gBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;aACpC;SACF;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE;YACP,OAAO,EAAE,uBAAuB;SACjC;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,aAAa;QAC1B,OAAO,EAAE;YACP,OAAO,EAAE,sBAAsB;SAChC;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,wJAAwJ;QAC1J,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;YAClC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;YACtC,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;YAC5C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;YACxC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;SACnC;QACD,OAAO,EAAE,UAAU;KACpB;CACF,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatPhones = 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
|
+
const formatPhones = (phone_numbers) => {
|
|
16
|
+
const result = [];
|
|
17
|
+
if (!phone_numbers)
|
|
18
|
+
return result;
|
|
19
|
+
phone_numbers.forEach((phone) => {
|
|
20
|
+
const validatedPhone = phone.match(/[0-9]{0,14}/g);
|
|
21
|
+
if (validatedPhone === null) {
|
|
22
|
+
throw new Error(`${phone} is not a valid E.164 phone number.`);
|
|
23
|
+
}
|
|
24
|
+
const formattedPhone = `+${phone.replace(/[^0-9]/g, '')}`;
|
|
25
|
+
result.push(hashAndEncode(formattedPhone.substring(0, 15)));
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
exports.formatPhones = formatPhones;
|
|
30
|
+
function hashAndEncode(property) {
|
|
31
|
+
return crypto_1.createHash('sha256').update(property).digest('hex');
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/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;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 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 trackPaymentOfflineConversion_1 = __importDefault(require("./trackPaymentOfflineConversion"));
|
|
8
|
+
const trackNonPaymentOfflineConversion_1 = __importDefault(require("./trackNonPaymentOfflineConversion"));
|
|
9
|
+
const destination = {
|
|
10
|
+
name: 'Tiktok Offline Conversions (Actions)',
|
|
11
|
+
slug: 'actions-tiktok-offline-conversions',
|
|
12
|
+
mode: 'cloud',
|
|
13
|
+
authentication: {
|
|
14
|
+
scheme: 'custom',
|
|
15
|
+
fields: {
|
|
16
|
+
accessToken: {
|
|
17
|
+
label: 'Access Token',
|
|
18
|
+
description: 'Your TikTok Access Token. Please see TikTok’s [Events API documentation](https://ads.tiktok.com/marketing_api/docs?rid=mcxl4tclmfa&id=1758051319816193) for information on how to generate an access token via the TikTok Ads Manager or API.',
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
eventSetID: {
|
|
23
|
+
label: 'Event Set ID',
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Your TikTok Offline Event Set ID. Please see TikTok’s [Events API documentation](https://ads.tiktok.com/marketing_api/docs?rid=mcxl4tclmfa&id=1758051319816193) for information on how to find this value.',
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
testAuthentication: (request, { settings }) => {
|
|
30
|
+
return request('https://business-api.tiktok.com/open_api/v1.3/offline/track/', {
|
|
31
|
+
method: 'post',
|
|
32
|
+
json: {
|
|
33
|
+
event_set_id: settings.eventSetID,
|
|
34
|
+
event: 'Test Event',
|
|
35
|
+
timestamp: '',
|
|
36
|
+
context: {}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
extendRequest({ settings }) {
|
|
42
|
+
return {
|
|
43
|
+
headers: {
|
|
44
|
+
'Access-Token': settings.accessToken,
|
|
45
|
+
'Content-Type': 'application/json'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
presets: [
|
|
50
|
+
{
|
|
51
|
+
name: 'Complete Payment',
|
|
52
|
+
subscribe: 'type = "track" and event = "Order Completed"',
|
|
53
|
+
partnerAction: 'trackOfflinePaymentConversion',
|
|
54
|
+
mapping: {
|
|
55
|
+
...actions_core_1.defaultValues(trackPaymentOfflineConversion_1.default.fields),
|
|
56
|
+
event: 'CompletePayment'
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Contact',
|
|
61
|
+
subscribe: 'type = "track" and event = "User Contacted Call Center"',
|
|
62
|
+
partnerAction: 'trackNonPaymentOfflineConversion',
|
|
63
|
+
mapping: {
|
|
64
|
+
...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
|
|
65
|
+
event: 'Contact'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Subscribe',
|
|
70
|
+
subscribe: 'type = "track" and event = "User Subscribed In Store"',
|
|
71
|
+
partnerAction: 'trackNonPaymentOfflineConversion',
|
|
72
|
+
mapping: {
|
|
73
|
+
...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
|
|
74
|
+
event: 'Subscribe'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'SubmitForm',
|
|
79
|
+
subscribe: 'type = "track" and event = "Form Submitted"',
|
|
80
|
+
partnerAction: 'trackNonPaymentOfflineConversion',
|
|
81
|
+
mapping: {
|
|
82
|
+
...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
|
|
83
|
+
event: 'SubmitForm'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
actions: {
|
|
88
|
+
trackPaymentOfflineConversion: trackPaymentOfflineConversion_1.default,
|
|
89
|
+
trackNonPaymentOfflineConversion: trackNonPaymentOfflineConversion_1.default
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
exports.default = destination;
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA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GAAG,4BAAa,CAAC,0CAAgC,CAAC,MAAM,CAAC;gBACzD,KAAK,EAAE,SAAS;aACjB;SACF;QACD;YACE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE,uDAAuD;YAClE,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE;gBACP,GAAG,4BAAa,CAAC,0CAAgC,CAAC,MAAM,CAAC;gBACzD,KAAK,EAAE,WAAW;aACnB;SACF;QACD;YACE,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,6CAA6C;YACxD,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE;gBACP,GAAG,4BAAa,CAAC,0CAAgC,CAAC,MAAM,CAAC;gBACzD,KAAK,EAAE,YAAY;aACpB;SACF;KACF;IACD,OAAO,EAAE;QACP,6BAA6B,EAA7B,uCAA6B;QAC7B,gCAAgC,EAAhC,0CAAgC;KACjC;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.ts"],"names":[],"mappings":""}
|
package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_fields_1 = require("../common_fields");
|
|
4
|
+
const formatter_1 = require("../formatter");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Track Non Payment Offline Conversion',
|
|
7
|
+
description: 'Send a non payment related event to the Tiktok Offline Conversions API',
|
|
8
|
+
fields: {
|
|
9
|
+
...common_fields_1.commonFields
|
|
10
|
+
},
|
|
11
|
+
perform: (request, { payload, settings }) => {
|
|
12
|
+
return request('https://business-api.tiktok.com/open_api/v1.3/offline/track/', {
|
|
13
|
+
method: 'post',
|
|
14
|
+
json: {
|
|
15
|
+
event_set_id: settings.eventSetID,
|
|
16
|
+
event: payload.event,
|
|
17
|
+
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
18
|
+
timestamp: payload.timestamp,
|
|
19
|
+
context: {
|
|
20
|
+
user: {
|
|
21
|
+
phone_numbers: formatter_1.formatPhones(payload.phone_numbers),
|
|
22
|
+
emails: formatter_1.formatEmails(payload.email_addresses)
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
properties: {
|
|
26
|
+
order_id: payload.order_id,
|
|
27
|
+
shop_id: payload.shop_id,
|
|
28
|
+
event_channel: payload.event_channel
|
|
29
|
+
},
|
|
30
|
+
partner_name: 'Segment'
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = action;
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,4CAAyD;AAEzD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,sCAAsC;IAC7C,WAAW,EAAE,wEAAwE;IACrF,MAAM,EAAE;QACN,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,OAAO,CAAC,8DAA8D,EAAE;YAC7E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,YAAY,EAAE,QAAQ,CAAC,UAAU;gBACjC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;gBAC9D,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,OAAO,EAAE;oBACP,IAAI,EAAE;wBACJ,aAAa,EAAE,wBAAY,CAAC,OAAO,CAAC,aAAa,CAAC;wBAClD,MAAM,EAAE,wBAAY,CAAC,OAAO,CAAC,eAAe,CAAC;qBAC9C;iBACF;gBACD,UAAU,EAAE;oBACV,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;oBACxB,aAAa,EAAE,OAAO,CAAC,aAAa;iBACrC;gBACD,YAAY,EAAE,SAAS;aACxB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event: string;
|
|
3
|
+
event_id?: string;
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
phone_numbers?: string[];
|
|
6
|
+
email_addresses?: string[];
|
|
7
|
+
order_id?: string;
|
|
8
|
+
shop_id?: string;
|
|
9
|
+
event_channel?: string;
|
|
10
|
+
contents?: {
|
|
11
|
+
price?: number;
|
|
12
|
+
quantity?: number;
|
|
13
|
+
content_type?: string;
|
|
14
|
+
content_id?: string;
|
|
15
|
+
content_name?: string;
|
|
16
|
+
content_category?: string;
|
|
17
|
+
}[];
|
|
18
|
+
currency: string;
|
|
19
|
+
value: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_fields_1 = require("../common_fields");
|
|
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
|
+
...common_fields_1.commonFields,
|
|
10
|
+
timestamp: {
|
|
11
|
+
label: 'Event Timestamp',
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
14
|
+
default: {
|
|
15
|
+
'@path': '$.timestamp'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
contents: {
|
|
19
|
+
label: 'Contents',
|
|
20
|
+
type: 'object',
|
|
21
|
+
multiple: true,
|
|
22
|
+
description: 'Array of product or content items for the offline event.',
|
|
23
|
+
properties: {
|
|
24
|
+
price: {
|
|
25
|
+
label: 'Price',
|
|
26
|
+
description: 'Price of the product or content item. Price is a required field for all content items.',
|
|
27
|
+
type: 'number'
|
|
28
|
+
},
|
|
29
|
+
quantity: {
|
|
30
|
+
label: 'Quantity',
|
|
31
|
+
description: 'Quantity of this product ot item in the offline event. Quantity is a required field for all content items.',
|
|
32
|
+
type: 'number'
|
|
33
|
+
},
|
|
34
|
+
content_type: {
|
|
35
|
+
label: 'Content Type',
|
|
36
|
+
description: 'Product type',
|
|
37
|
+
type: 'string'
|
|
38
|
+
},
|
|
39
|
+
content_id: {
|
|
40
|
+
label: 'Content ID',
|
|
41
|
+
description: 'Product or content item identifier. Content ID is a required field for all product or content items.',
|
|
42
|
+
type: 'string'
|
|
43
|
+
},
|
|
44
|
+
content_name: {
|
|
45
|
+
label: 'Content Name',
|
|
46
|
+
description: 'Name of the product or content item.',
|
|
47
|
+
type: 'string'
|
|
48
|
+
},
|
|
49
|
+
content_category: {
|
|
50
|
+
label: 'Content Category',
|
|
51
|
+
description: 'Category of the product or content item.',
|
|
52
|
+
type: 'string'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
default: {
|
|
56
|
+
'@arrayPath': [
|
|
57
|
+
'$.properties.products',
|
|
58
|
+
{
|
|
59
|
+
price: {
|
|
60
|
+
'@path': 'price'
|
|
61
|
+
},
|
|
62
|
+
quantity: {
|
|
63
|
+
'@path': 'quantity'
|
|
64
|
+
},
|
|
65
|
+
content_type: {
|
|
66
|
+
'@path': 'type'
|
|
67
|
+
},
|
|
68
|
+
content_id: {
|
|
69
|
+
'@path': 'product_id'
|
|
70
|
+
},
|
|
71
|
+
content_name: {
|
|
72
|
+
'@path': 'name'
|
|
73
|
+
},
|
|
74
|
+
content_category: {
|
|
75
|
+
'@path': 'category'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
currency: {
|
|
82
|
+
label: 'Currency',
|
|
83
|
+
type: 'string',
|
|
84
|
+
required: true,
|
|
85
|
+
description: 'ISO 4217 code. Required for revenue reporting. Example: "USD".List of currencies currently supported: AED, ARS, AUD, BDT, BHD, BIF, BOB, BRL, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DZD, EGP, EUR, GBP, GTQ, HKD, HNL, HUF, IDR, ILS, INR, ISK, JPY, KES, KHR, KRW, KWD, KZT, MAD, MOP, MXN, MYR, NGN, NIO, NOK, NZD, OMR, PEN, PHP, PHP, PKR, PLN, PYG, QAR, RON, RUB, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, VES, VND, ZAR.',
|
|
86
|
+
default: {
|
|
87
|
+
'@path': '$.properties.currency'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
value: {
|
|
91
|
+
label: 'Value',
|
|
92
|
+
type: 'number',
|
|
93
|
+
required: true,
|
|
94
|
+
description: 'Revenue of total products or content items. Required for revenue reporting. Must be a number. e.g. 101.99 and not "101.99 USD"',
|
|
95
|
+
default: {
|
|
96
|
+
'@if': {
|
|
97
|
+
exists: { '@path': '$.properties.value' },
|
|
98
|
+
then: { '@path': '$.properties.value' },
|
|
99
|
+
else: { '@path': '$.properties.revenue' }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
perform: (request, { payload, settings }) => {
|
|
105
|
+
return request('https://business-api.tiktok.com/open_api/v1.3/offline/track/', {
|
|
106
|
+
method: 'post',
|
|
107
|
+
json: {
|
|
108
|
+
event_set_id: settings.eventSetID,
|
|
109
|
+
event: payload.event,
|
|
110
|
+
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
111
|
+
timestamp: payload.timestamp,
|
|
112
|
+
context: {
|
|
113
|
+
user: {
|
|
114
|
+
phone_numbers: formatter_1.formatPhones(payload.phone_numbers),
|
|
115
|
+
emails: formatter_1.formatEmails(payload.email_addresses)
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
properties: {
|
|
119
|
+
order_id: payload.order_id,
|
|
120
|
+
shop_id: payload.shop_id,
|
|
121
|
+
contents: payload.contents,
|
|
122
|
+
currency: payload.currency,
|
|
123
|
+
value: payload.value,
|
|
124
|
+
event_channel: payload.event_channel
|
|
125
|
+
},
|
|
126
|
+
partner_name: 'Segment'
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
exports.default = action;
|
|
132
|
+
//# sourceMappingURL=index.js.map
|
package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,4CAAyD;AAEzD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kCAAkC;IACzC,WAAW,EAAE,2FAA2F;IACxG,MAAM,EAAE;QACN,GAAG,4BAAY;QACf,SAAS,EAAE;YACT,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wFAAwF;YACrG,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,QAAQ,EAAE;YACR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,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.153.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@amplitude/ua-parser-js": "^0.7.25",
|
|
41
41
|
"@segment/a1-notation": "^2.1.4",
|
|
42
|
-
"@segment/actions-core": "^3.
|
|
43
|
-
"@segment/actions-shared": "^1.
|
|
42
|
+
"@segment/actions-core": "^3.62.0",
|
|
43
|
+
"@segment/actions-shared": "^1.44.0",
|
|
44
44
|
"@types/node": "^18.11.15",
|
|
45
45
|
"cheerio": "^1.0.0-rc.10",
|
|
46
46
|
"dayjs": "^1.10.7",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"lcov"
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "2485eb4078ec48c942d232862f88c31a1b1220ee"
|
|
72
72
|
}
|