@segment/action-destinations 3.154.3-ttd.0 → 3.155.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/generated-types.d.ts +12 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/index.js +56 -20
- package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/index.js.map +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/generated-types.d.ts +19 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/index.js +92 -12
- package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/index.js.map +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.d.ts +12 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js +230 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js.map +1 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.d.ts +19 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js +22 -1
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js.map +1 -1
- 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/generated-types.d.ts +2 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +9 -3
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +6 -2
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +67 -7
- 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/google-enhanced-conversions/functions.d.ts +7 -1
- package/dist/destinations/google-enhanced-conversions/functions.js +15 -3
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +3 -3
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +3 -3
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +2 -2
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
- package/dist/destinations/gwen/index.js +3 -3
- package/dist/destinations/gwen/index.js.map +1 -1
- package/dist/destinations/index.js +1 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/livelike-cloud/properties.d.ts +1 -1
- package/dist/destinations/livelike-cloud/properties.js +1 -1
- package/dist/destinations/livelike-cloud/properties.js.map +1 -1
- package/dist/destinations/pinterest-conversions/index.js +29 -17
- package/dist/destinations/pinterest-conversions/index.js.map +1 -1
- package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js +3 -2
- package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js.map +1 -1
- package/dist/destinations/pinterest-conversions/types.d.ts +8 -0
- package/dist/destinations/pinterest-conversions/types.js +8 -0
- package/dist/destinations/pinterest-conversions/types.js.map +1 -0
- package/dist/destinations/the-trade-desk-crm/generated-types.d.ts +0 -2
- package/dist/destinations/the-trade-desk-crm/index.js +2 -21
- package/dist/destinations/the-trade-desk-crm/index.js.map +1 -1
- 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.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.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/dist/destinations/webhook/__test__/webhook.test.js +20 -0
- package/dist/destinations/webhook/__test__/webhook.test.js.map +1 -1
- package/dist/destinations/webhook/send/index.js +26 -11
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/the-trade-desk-crm/functions.d.ts +0 -23
- package/dist/destinations/the-trade-desk-crm/functions.js +0 -113
- package/dist/destinations/the-trade-desk-crm/functions.js.map +0 -1
- package/dist/destinations/the-trade-desk-crm/properties.d.ts +0 -8
- package/dist/destinations/the-trade-desk-crm/properties.js +0 -59
- package/dist/destinations/the-trade-desk-crm/properties.js.map +0 -1
- package/dist/destinations/the-trade-desk-crm/syncAudience/generated-types.d.ts +0 -9
- package/dist/destinations/the-trade-desk-crm/syncAudience/generated-types.js.map +0 -1
- package/dist/destinations/the-trade-desk-crm/syncAudience/index.js +0 -26
- package/dist/destinations/the-trade-desk-crm/syncAudience/index.js.map +0 -1
- /package/dist/destinations/{the-trade-desk-crm/syncAudience → tiktok-offline-conversions}/generated-types.js +0 -0
- /package/dist/destinations/{the-trade-desk-crm/syncAudience → tiktok-offline-conversions/trackNonPaymentOfflineConversion}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/pinterest-conversions/reportConversionEvent/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAwD;AACxD,4CAAwD;AAExD,8EAAiE;AACjE,0EAA6E;AAE7E,6DAAoC;AACpC,+DAAsC;AAEtC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/pinterest-conversions/re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AAQ,EAAE,OAAO,CAAC,WAAW,EAAE,QAAQ;gBACvC,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,aAAa;gBACjD,YAAY,EAAE,OAAO,CAAC,WAAW,EAAE,YAAY;aAChD;YACD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B;KACF,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PinterestConversionsTestAuthenticationError = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
class PinterestConversionsTestAuthenticationError extends actions_core_1.HTTPError {
|
|
6
|
+
}
|
|
7
|
+
exports.PinterestConversionsTestAuthenticationError = PinterestConversionsTestAuthenticationError;
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/destinations/pinterest-conversions/types.ts"],"names":[],"mappings":";;;AAAA,wDAAiD;AAEjD,MAAa,2CAA4C,SAAQ,wBAAS;CAMzE;AAND,kGAMC"}
|
|
@@ -1,33 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const syncAudience_1 = __importDefault(require("./syncAudience"));
|
|
7
3
|
const destination = {
|
|
8
4
|
name: 'The Trade Desk Crm',
|
|
9
5
|
slug: 'actions-the-trade-desk-crm',
|
|
10
6
|
mode: 'cloud',
|
|
11
7
|
authentication: {
|
|
12
8
|
scheme: 'custom',
|
|
13
|
-
fields: {
|
|
14
|
-
auth_token: {
|
|
15
|
-
label: 'Authentication Token',
|
|
16
|
-
description: 'Your long-lived Trade Desk authentication token. Please see The Trade Desk’s [authentication documentation](https://api.thetradedesk.com/v3/portal/api/doc/Authentication) for information on how to generate a long-lived API Token via the Manage API Tokens in the developer Portal.',
|
|
17
|
-
type: 'string',
|
|
18
|
-
required: true
|
|
19
|
-
},
|
|
20
|
-
advertiser_id: {
|
|
21
|
-
label: 'Advertiser ID',
|
|
22
|
-
description: 'The platform ID of the advertiser for which to retrieve the status of the specified CRM data segment.',
|
|
23
|
-
type: 'string',
|
|
24
|
-
required: true
|
|
25
|
-
}
|
|
26
|
-
}
|
|
9
|
+
fields: {}
|
|
27
10
|
},
|
|
28
|
-
actions: {
|
|
29
|
-
syncAudience: syncAudience_1.default
|
|
30
|
-
}
|
|
11
|
+
actions: {}
|
|
31
12
|
};
|
|
32
13
|
exports.default = destination;
|
|
33
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/the-trade-desk-crm/index.ts"],"names":[],"mappings":"
|
|
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":["../../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AC3B,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: 'trackPaymentOfflineConversion',
|
|
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,wDAA4E;AAE5E,oGAA2E;AAC3E,0GAAiF;AAEjF,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sCAAsC;IAC5C,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,c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D,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,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,0DAA0D;YACvE,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,WAAW,EAAE,wFAAwF;oBACrG,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE;oBACR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E,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE;iBAC1C;aACF;SACF;KACF;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,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;oBACpB,aAAa,EAAE,OAAO,CAAC,aAAa;iBACrC;gBACD,YAAY,EAAE,SAAS;aACxB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -112,6 +112,26 @@ describe('Webhook', () => {
|
|
|
112
112
|
expect(responses.length).toBe(1);
|
|
113
113
|
expect(responses[0].status).toBe(200);
|
|
114
114
|
});
|
|
115
|
+
it('should throw an error when header value is invalid', async () => {
|
|
116
|
+
const url = 'https://example.build';
|
|
117
|
+
const event = actions_core_1.createTestEvent();
|
|
118
|
+
const headerField = 'Custom-Header';
|
|
119
|
+
const headerValue = 'هيثم';
|
|
120
|
+
const data = { cool: true };
|
|
121
|
+
nock_1.default(url)
|
|
122
|
+
.put('/', data)
|
|
123
|
+
.matchHeader(headerField, headerValue)
|
|
124
|
+
.replyWithError('TypeError: هيثم is not a legal HTTP header value');
|
|
125
|
+
await expect(testDestination.testAction('send', {
|
|
126
|
+
event,
|
|
127
|
+
mapping: {
|
|
128
|
+
url,
|
|
129
|
+
method: 'PUT',
|
|
130
|
+
headers: { [headerField]: headerValue },
|
|
131
|
+
data
|
|
132
|
+
}
|
|
133
|
+
})).rejects.toThrow(actions_core_1.PayloadValidationError);
|
|
134
|
+
});
|
|
115
135
|
});
|
|
116
136
|
});
|
|
117
137
|
//# sourceMappingURL=webhook.test.js.map
|