@segment/action-destinations 3.331.7-staging → 3.331.8-staging

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/destinations/display-video-360/index.js +2 -0
  2. package/dist/destinations/display-video-360/index.js.map +1 -1
  3. package/dist/destinations/display-video-360/properties.js +3 -3
  4. package/dist/destinations/display-video-360/properties.js.map +1 -1
  5. package/dist/destinations/display-video-360/shared.js.map +1 -1
  6. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +3 -0
  7. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -1
  8. package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +2 -1
  9. package/dist/destinations/klaviyo/addProfileToList/index.js +7 -0
  10. package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
  11. package/dist/destinations/klaviyo/functions.d.ts +8 -0
  12. package/dist/destinations/klaviyo/functions.js +34 -1
  13. package/dist/destinations/klaviyo/functions.js.map +1 -1
  14. package/dist/destinations/klaviyo/properties.d.ts +2 -1
  15. package/dist/destinations/klaviyo/properties.js +8 -3
  16. package/dist/destinations/klaviyo/properties.js.map +1 -1
  17. package/dist/destinations/klaviyo/removeProfileFromList/generated-types.d.ts +1 -1
  18. package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +1 -0
  19. package/dist/destinations/klaviyo/upsertProfile/index.js +26 -1
  20. package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
  21. package/dist/destinations/linkedin-conversions/api/index.d.ts +1 -1
  22. package/dist/destinations/linkedin-conversions/api/index.js +1 -1
  23. package/dist/destinations/linkedin-conversions/streamConversion/index.js +1 -1
  24. package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
  25. package/dist/destinations/tiktok-audiences/properties.js +5 -4
  26. package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
  27. package/dist/destinations/tiktok-conversions/index.js +92 -3
  28. package/dist/destinations/tiktok-conversions/index.js.map +1 -1
  29. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
  30. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +33 -24
  31. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
  32. package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +12 -4
  33. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +113 -40
  34. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
  35. package/dist/destinations/tiktok-offline-conversions/index.js +199 -48
  36. package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
  37. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +3 -0
  38. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +43 -0
  39. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
  40. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
  41. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
  42. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
  43. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
  44. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +317 -0
  45. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
  46. package/package.json +1 -1
@@ -4,8 +4,201 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const actions_core_1 = require("@segment/actions-core");
7
- const trackPaymentOfflineConversion_1 = __importDefault(require("./trackPaymentOfflineConversion"));
8
- const trackNonPaymentOfflineConversion_1 = __importDefault(require("./trackNonPaymentOfflineConversion"));
7
+ const reportOfflineEvent_1 = __importDefault(require("./reportOfflineEvent"));
8
+ const productProperties = {
9
+ price: {
10
+ '@path': '$.price'
11
+ },
12
+ quantity: {
13
+ '@path': '$.quantity'
14
+ },
15
+ content_category: {
16
+ '@path': '$.category'
17
+ },
18
+ content_id: {
19
+ '@path': '$.product_id'
20
+ },
21
+ content_name: {
22
+ '@path': '$.name'
23
+ },
24
+ brand: {
25
+ '@path': '$.brand'
26
+ }
27
+ };
28
+ const singleProductContents = {
29
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
30
+ contents: {
31
+ '@arrayPath': [
32
+ '$.properties',
33
+ {
34
+ ...productProperties
35
+ }
36
+ ]
37
+ }
38
+ };
39
+ const multiProductContents = {
40
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
41
+ contents: {
42
+ '@arrayPath': [
43
+ '$.properties.products',
44
+ {
45
+ ...productProperties
46
+ }
47
+ ]
48
+ }
49
+ };
50
+ const presets = [
51
+ {
52
+ name: 'Page View',
53
+ subscribe: 'type="page"',
54
+ partnerAction: 'reportWebEvent',
55
+ mapping: {
56
+ ...multiProductContents,
57
+ event: 'PageView'
58
+ },
59
+ type: 'automatic'
60
+ },
61
+ {
62
+ name: 'View Content',
63
+ subscribe: 'event = "Product Viewed"',
64
+ partnerAction: 'reportWebEvent',
65
+ mapping: {
66
+ ...singleProductContents,
67
+ event: 'ViewContent'
68
+ },
69
+ type: 'automatic'
70
+ },
71
+ {
72
+ name: 'Click Button',
73
+ subscribe: 'event = "Product Clicked"',
74
+ partnerAction: 'reportWebEvent',
75
+ mapping: {
76
+ ...singleProductContents,
77
+ event: 'ClickButton'
78
+ },
79
+ type: 'automatic'
80
+ },
81
+ {
82
+ name: 'Search',
83
+ subscribe: 'event = "Products Searched"',
84
+ partnerAction: 'reportWebEvent',
85
+ mapping: {
86
+ ...singleProductContents,
87
+ event: 'Search'
88
+ },
89
+ type: 'automatic'
90
+ },
91
+ {
92
+ name: 'Add to Wishlist',
93
+ subscribe: 'event = "Product Added to Wishlist"',
94
+ partnerAction: 'reportWebEvent',
95
+ mapping: {
96
+ ...singleProductContents,
97
+ event: 'AddToWishlist'
98
+ },
99
+ type: 'automatic'
100
+ },
101
+ {
102
+ name: 'Add to Cart',
103
+ subscribe: 'event = "Product Added"',
104
+ partnerAction: 'reportWebEvent',
105
+ mapping: {
106
+ ...singleProductContents,
107
+ event: 'AddToCart'
108
+ },
109
+ type: 'automatic'
110
+ },
111
+ {
112
+ name: 'Initiate Checkout',
113
+ subscribe: 'event = "Checkout Started"',
114
+ partnerAction: 'reportWebEvent',
115
+ mapping: {
116
+ ...multiProductContents,
117
+ event: 'InitiateCheckout'
118
+ },
119
+ type: 'automatic'
120
+ },
121
+ {
122
+ name: 'Add Payment Info',
123
+ subscribe: 'event = "Payment Info Entered"',
124
+ partnerAction: 'reportWebEvent',
125
+ mapping: {
126
+ ...multiProductContents,
127
+ event: 'AddPaymentInfo'
128
+ },
129
+ type: 'automatic'
130
+ },
131
+ {
132
+ name: 'Place an Order',
133
+ subscribe: 'event = "Order Completed"',
134
+ partnerAction: 'reportWebEvent',
135
+ mapping: {
136
+ ...multiProductContents,
137
+ event: 'PlaceAnOrder'
138
+ },
139
+ type: 'automatic'
140
+ },
141
+ {
142
+ name: 'Complete Payment',
143
+ subscribe: 'event = "Payment Completed"',
144
+ partnerAction: 'reportWebEvent',
145
+ mapping: {
146
+ ...multiProductContents,
147
+ event: 'CompletePayment'
148
+ },
149
+ type: 'automatic'
150
+ },
151
+ {
152
+ name: 'Contact',
153
+ subscribe: 'event = "Callback Started"',
154
+ partnerAction: 'reportWebEvent',
155
+ mapping: {
156
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
157
+ event: 'Contact'
158
+ },
159
+ type: 'automatic'
160
+ },
161
+ {
162
+ name: 'Download',
163
+ subscribe: 'event = "Download Link Clicked"',
164
+ partnerAction: 'reportWebEvent',
165
+ mapping: {
166
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
167
+ event: 'Download'
168
+ },
169
+ type: 'automatic'
170
+ },
171
+ {
172
+ name: 'Submit Form',
173
+ subscribe: 'event = "Form Submitted"',
174
+ partnerAction: 'reportWebEvent',
175
+ mapping: {
176
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
177
+ event: 'SubmitForm'
178
+ },
179
+ type: 'automatic'
180
+ },
181
+ {
182
+ name: 'Complete Registration',
183
+ subscribe: 'event = "Signed Up"',
184
+ partnerAction: 'reportWebEvent',
185
+ mapping: {
186
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
187
+ event: 'CompleteRegistration'
188
+ },
189
+ type: 'automatic'
190
+ },
191
+ {
192
+ name: 'Subscribe',
193
+ subscribe: 'event = "Subscription Created"',
194
+ partnerAction: 'reportWebEvent',
195
+ mapping: {
196
+ ...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
197
+ event: 'Subscribe'
198
+ },
199
+ type: 'automatic'
200
+ }
201
+ ];
9
202
  const destination = {
10
203
  name: 'TikTok Offline Conversions',
11
204
  slug: 'actions-tiktok-offline-conversions',
@@ -15,14 +208,14 @@ const destination = {
15
208
  fields: {
16
209
  accessToken: {
17
210
  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.',
211
+ description: 'Your TikTok Access Token. Please see TikTok’s [Events API 2.0 documentation](https://business-api.tiktok.com/portal/docs?id=1771101130925058) for information on how to generate an access token via the TikTok Ads Manager or API.',
19
212
  type: 'string',
20
213
  required: true
21
214
  },
22
215
  eventSetID: {
23
216
  label: 'Event Set ID',
24
217
  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.',
218
+ description: 'Your TikTok Offline Event Set ID. Please see TikTok’s [Events API 2.0 documentation](https://business-api.tiktok.com/portal/docs?id=1771101027431425) for information on how to find this value.',
26
219
  required: true
27
220
  }
28
221
  },
@@ -46,51 +239,9 @@ const destination = {
46
239
  }
47
240
  };
48
241
  },
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
- type: 'automatic'
59
- },
60
- {
61
- name: 'Contact',
62
- subscribe: 'type = "track" and event = "User Contacted Call Center"',
63
- partnerAction: 'trackNonPaymentOfflineConversion',
64
- mapping: {
65
- ...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
66
- event: 'Contact'
67
- },
68
- type: 'automatic'
69
- },
70
- {
71
- name: 'Subscribe',
72
- subscribe: 'type = "track" and event = "User Subscribed In Store"',
73
- partnerAction: 'trackNonPaymentOfflineConversion',
74
- mapping: {
75
- ...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
76
- event: 'Subscribe'
77
- },
78
- type: 'automatic'
79
- },
80
- {
81
- name: 'Submit Form',
82
- subscribe: 'type = "track" and event = "Form Submitted"',
83
- partnerAction: 'trackNonPaymentOfflineConversion',
84
- mapping: {
85
- ...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
86
- event: 'SubmitForm'
87
- },
88
- type: 'automatic'
89
- }
90
- ],
242
+ presets,
91
243
  actions: {
92
- trackPaymentOfflineConversion: trackPaymentOfflineConversion_1.default,
93
- trackNonPaymentOfflineConversion: trackNonPaymentOfflineConversion_1.default
244
+ reportOfflineEvent: reportOfflineEvent_1.default
94
245
  }
95
246
  };
96
247
  exports.default = destination;
@@ -1 +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;I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CAAC;gBACzD,KAAK,EAAE,SAAS;aACjB;YACD,IAAI,EAAE,WAAW;SAClB;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;YACD,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,6CAA6C;YACxD,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE;gBACP,GAAG,4BAAa,CAAC,0CAAgC,CAAC,MAAM,CAAC;gBACzD,KAAK,EAAE,YAAY;aACpB;YACD,IAAI,EAAE,WAAW;SAClB;KACF;IACD,OAAO,EAAE;QACP,6BAA6B,EAA7B,uCAA6B;QAC7B,gCAAgC,EAAhC,0CAAgC;KACjC;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
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;AA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K,EAAE,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,3 @@
1
+ export declare const formatEmails: (email_addresses: string[] | undefined) => string[];
2
+ export declare function formatUserIds(userIds: string[] | undefined): string[];
3
+ export declare const formatPhones: (phone_numbers: string[] | undefined) => string[];
@@ -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
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -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,5 @@
1
+ import { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;