@segment/action-destinations 3.241.0 → 3.243.0-snap-connector

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 (222) hide show
  1. package/dist/destinations/accoil-analytics/generated-types.d.ts +3 -0
  2. package/dist/destinations/accoil-analytics/generated-types.js +3 -0
  3. package/dist/destinations/accoil-analytics/generated-types.js.map +1 -0
  4. package/dist/destinations/accoil-analytics/index.d.ts +4 -0
  5. package/dist/destinations/accoil-analytics/index.js +69 -0
  6. package/dist/destinations/accoil-analytics/index.js.map +1 -0
  7. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.d.ts +5 -0
  8. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js +3 -0
  9. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js.map +1 -0
  10. package/dist/destinations/accoil-analytics/postToAccoil/index.d.ts +5 -0
  11. package/dist/destinations/accoil-analytics/postToAccoil/index.js +27 -0
  12. package/dist/destinations/accoil-analytics/postToAccoil/index.js.map +1 -0
  13. package/dist/destinations/airship/utilities.js +8 -0
  14. package/dist/destinations/airship/utilities.js.map +1 -1
  15. package/dist/destinations/app-fit/index.js +1 -1
  16. package/dist/destinations/app-fit/index.js.map +1 -1
  17. package/dist/destinations/avo/generated-types.d.ts +5 -0
  18. package/dist/destinations/avo/generated-types.js +3 -0
  19. package/dist/destinations/avo/generated-types.js.map +1 -0
  20. package/dist/destinations/avo/index.d.ts +4 -0
  21. package/dist/destinations/avo/index.js +64 -0
  22. package/dist/destinations/avo/index.js.map +1 -0
  23. package/dist/destinations/avo/sendSchemaToInspector/AvoSchemaParser.d.ts +9 -0
  24. package/dist/destinations/avo/sendSchemaToInspector/AvoSchemaParser.js +97 -0
  25. package/dist/destinations/avo/sendSchemaToInspector/AvoSchemaParser.js.map +1 -0
  26. package/dist/destinations/avo/sendSchemaToInspector/avo-types.d.ts +26 -0
  27. package/dist/destinations/avo/sendSchemaToInspector/avo-types.js +10 -0
  28. package/dist/destinations/avo/sendSchemaToInspector/avo-types.js.map +1 -0
  29. package/dist/destinations/avo/sendSchemaToInspector/avo.d.ts +3 -0
  30. package/dist/destinations/avo/sendSchemaToInspector/avo.js +44 -0
  31. package/dist/destinations/avo/sendSchemaToInspector/avo.js.map +1 -0
  32. package/dist/destinations/avo/sendSchemaToInspector/generated-types.d.ts +11 -0
  33. package/dist/destinations/avo/sendSchemaToInspector/generated-types.js +3 -0
  34. package/dist/destinations/avo/sendSchemaToInspector/generated-types.js.map +1 -0
  35. package/dist/destinations/avo/sendSchemaToInspector/index.d.ts +5 -0
  36. package/dist/destinations/avo/sendSchemaToInspector/index.js +95 -0
  37. package/dist/destinations/avo/sendSchemaToInspector/index.js.map +1 -0
  38. package/dist/destinations/customerio/deleteObject/generated-types.d.ts +4 -0
  39. package/dist/destinations/customerio/deleteObject/generated-types.js +3 -0
  40. package/dist/destinations/customerio/deleteObject/generated-types.js.map +1 -0
  41. package/dist/destinations/customerio/deleteObject/index.d.ts +5 -0
  42. package/dist/destinations/customerio/deleteObject/index.js +48 -0
  43. package/dist/destinations/customerio/deleteObject/index.js.map +1 -0
  44. package/dist/destinations/customerio/deletePerson/generated-types.d.ts +3 -0
  45. package/dist/destinations/customerio/deletePerson/generated-types.js +3 -0
  46. package/dist/destinations/customerio/deletePerson/generated-types.js.map +1 -0
  47. package/dist/destinations/customerio/deletePerson/index.d.ts +5 -0
  48. package/dist/destinations/customerio/deletePerson/index.js +41 -0
  49. package/dist/destinations/customerio/deletePerson/index.js.map +1 -0
  50. package/dist/destinations/customerio/deleteRelationship/generated-types.d.ts +6 -0
  51. package/dist/destinations/customerio/deleteRelationship/generated-types.js +3 -0
  52. package/dist/destinations/customerio/deleteRelationship/generated-types.js.map +1 -0
  53. package/dist/destinations/customerio/deleteRelationship/index.d.ts +5 -0
  54. package/dist/destinations/customerio/deleteRelationship/index.js +82 -0
  55. package/dist/destinations/customerio/deleteRelationship/index.js.map +1 -0
  56. package/dist/destinations/customerio/index.js +12 -0
  57. package/dist/destinations/customerio/index.js.map +1 -1
  58. package/dist/destinations/customerio/mergePeople/generated-types.d.ts +4 -0
  59. package/dist/destinations/customerio/mergePeople/generated-types.js +3 -0
  60. package/dist/destinations/customerio/mergePeople/generated-types.js.map +1 -0
  61. package/dist/destinations/customerio/mergePeople/index.d.ts +5 -0
  62. package/dist/destinations/customerio/mergePeople/index.js +52 -0
  63. package/dist/destinations/customerio/mergePeople/index.js.map +1 -0
  64. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.d.ts +10 -0
  65. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js +3 -0
  66. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js.map +1 -0
  67. package/dist/destinations/customerio/reportDeliveryEvent/index.d.ts +5 -0
  68. package/dist/destinations/customerio/reportDeliveryEvent/index.js +121 -0
  69. package/dist/destinations/customerio/reportDeliveryEvent/index.js.map +1 -0
  70. package/dist/destinations/customerio/suppressPerson/generated-types.d.ts +3 -0
  71. package/dist/destinations/customerio/suppressPerson/generated-types.js +3 -0
  72. package/dist/destinations/customerio/suppressPerson/generated-types.js.map +1 -0
  73. package/dist/destinations/customerio/suppressPerson/index.d.ts +5 -0
  74. package/dist/destinations/customerio/suppressPerson/index.js +41 -0
  75. package/dist/destinations/customerio/suppressPerson/index.js.map +1 -0
  76. package/dist/destinations/customerio/test-helper.d.ts +6 -0
  77. package/dist/destinations/customerio/test-helper.js +84 -0
  78. package/dist/destinations/customerio/test-helper.js.map +1 -0
  79. package/dist/destinations/customerio/unsuppressPerson/generated-types.d.ts +3 -0
  80. package/dist/destinations/customerio/unsuppressPerson/generated-types.js +3 -0
  81. package/dist/destinations/customerio/unsuppressPerson/generated-types.js.map +1 -0
  82. package/dist/destinations/customerio/unsuppressPerson/index.d.ts +5 -0
  83. package/dist/destinations/customerio/unsuppressPerson/index.js +41 -0
  84. package/dist/destinations/customerio/unsuppressPerson/index.js.map +1 -0
  85. package/dist/destinations/display-video-360/errors.d.ts +2 -2
  86. package/dist/destinations/display-video-360/errors.js +12 -6
  87. package/dist/destinations/display-video-360/errors.js.map +1 -1
  88. package/dist/destinations/display-video-360/index.js +21 -3
  89. package/dist/destinations/display-video-360/index.js.map +1 -1
  90. package/dist/destinations/display-video-360/shared.d.ts +2 -0
  91. package/dist/destinations/display-video-360/shared.js +12 -4
  92. package/dist/destinations/display-video-360/shared.js.map +1 -1
  93. package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
  94. package/dist/destinations/engage/sendgrid/Profile.js +3 -0
  95. package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
  96. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +18 -0
  97. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +94 -0
  98. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
  99. package/dist/destinations/engage/utils/track.d.ts +17 -17
  100. package/dist/destinations/fullstory/index.js +4 -4
  101. package/dist/destinations/fullstory/index.js.map +1 -1
  102. package/dist/destinations/index.js +4 -0
  103. package/dist/destinations/index.js.map +1 -1
  104. package/dist/destinations/iterable/index.js +12 -0
  105. package/dist/destinations/iterable/index.js.map +1 -1
  106. package/dist/destinations/linkedin-conversions/api/index.d.ts +1 -1
  107. package/dist/destinations/linkedin-conversions/api/index.js +23 -13
  108. package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
  109. package/dist/destinations/linkedin-conversions/constants.d.ts +1 -1
  110. package/dist/destinations/linkedin-conversions/constants.js +1 -1
  111. package/dist/destinations/linkedin-conversions/streamConversion/index.js +26 -6
  112. package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
  113. package/dist/destinations/linkedin-conversions/types.d.ts +9 -0
  114. package/dist/destinations/linkedin-conversions/types.js.map +1 -1
  115. package/dist/destinations/mixpanel/incrementProperties/__test__/__snapshots__/snapshot.test.js.snap +18 -0
  116. package/dist/destinations/responsys/generated-types.d.ts +20 -0
  117. package/dist/destinations/responsys/generated-types.js +3 -0
  118. package/dist/destinations/responsys/generated-types.js.map +1 -0
  119. package/dist/destinations/responsys/index.d.ts +4 -0
  120. package/dist/destinations/responsys/index.js +197 -0
  121. package/dist/destinations/responsys/index.js.map +1 -0
  122. package/dist/destinations/responsys/sendAudience/generated-types.d.ts +14 -0
  123. package/dist/destinations/responsys/sendAudience/generated-types.js +3 -0
  124. package/dist/destinations/responsys/sendAudience/generated-types.js.map +1 -0
  125. package/dist/destinations/responsys/sendAudience/index.d.ts +5 -0
  126. package/dist/destinations/responsys/sendAudience/index.js +90 -0
  127. package/dist/destinations/responsys/sendAudience/index.js.map +1 -0
  128. package/dist/destinations/responsys/sendCustomTraits/generated-types.d.ts +9 -0
  129. package/dist/destinations/responsys/sendCustomTraits/generated-types.js +3 -0
  130. package/dist/destinations/responsys/sendCustomTraits/generated-types.js.map +1 -0
  131. package/dist/destinations/responsys/sendCustomTraits/index.d.ts +5 -0
  132. package/dist/destinations/responsys/sendCustomTraits/index.js +53 -0
  133. package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -0
  134. package/dist/destinations/responsys/shared_properties.d.ts +3 -0
  135. package/dist/destinations/responsys/shared_properties.js +19 -0
  136. package/dist/destinations/responsys/shared_properties.js.map +1 -0
  137. package/dist/destinations/responsys/types.d.ts +38 -0
  138. package/dist/destinations/responsys/types.js +3 -0
  139. package/dist/destinations/responsys/types.js.map +1 -0
  140. package/dist/destinations/responsys/upsertListMember/generated-types.d.ts +13 -0
  141. package/dist/destinations/responsys/upsertListMember/generated-types.js +3 -0
  142. package/dist/destinations/responsys/upsertListMember/generated-types.js.map +1 -0
  143. package/dist/destinations/responsys/upsertListMember/index.d.ts +5 -0
  144. package/dist/destinations/responsys/upsertListMember/index.js +78 -0
  145. package/dist/destinations/responsys/upsertListMember/index.js.map +1 -0
  146. package/dist/destinations/responsys/utils.d.ts +17 -0
  147. package/dist/destinations/responsys/utils.js +154 -0
  148. package/dist/destinations/responsys/utils.js.map +1 -0
  149. package/dist/destinations/schematic/identifyUser/generated-types.d.ts +3 -4
  150. package/dist/destinations/schematic/identifyUser/index.js +6 -35
  151. package/dist/destinations/schematic/identifyUser/index.js.map +1 -1
  152. package/dist/destinations/schematic/trackEvent/generated-types.d.ts +3 -3
  153. package/dist/destinations/schematic/trackEvent/index.js +7 -29
  154. package/dist/destinations/schematic/trackEvent/index.js.map +1 -1
  155. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +1 -0
  156. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +381 -0
  157. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +1 -0
  158. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +1 -0
  159. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +499 -0
  160. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -0
  161. package/dist/destinations/snap-conversions-api/_tests_/index.test.js +4 -352
  162. package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
  163. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +24 -20
  164. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
  165. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +4 -0
  166. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +97 -0
  167. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +1 -0
  168. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.d.ts +8 -0
  169. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +125 -0
  170. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -0
  171. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +19 -0
  172. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +62 -0
  173. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -0
  174. package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -5
  175. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +1 -86
  176. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
  177. package/dist/destinations/stackadapt/forwardEvent/generated-types.d.ts +33 -0
  178. package/dist/destinations/stackadapt/forwardEvent/generated-types.js +3 -0
  179. package/dist/destinations/stackadapt/forwardEvent/generated-types.js.map +1 -0
  180. package/dist/destinations/stackadapt/forwardEvent/index.d.ts +5 -0
  181. package/dist/destinations/stackadapt/forwardEvent/index.js +273 -0
  182. package/dist/destinations/stackadapt/forwardEvent/index.js.map +1 -0
  183. package/dist/destinations/stackadapt/generated-types.d.ts +3 -0
  184. package/dist/destinations/stackadapt/generated-types.js +3 -0
  185. package/dist/destinations/stackadapt/generated-types.js.map +1 -0
  186. package/dist/destinations/stackadapt/index.d.ts +4 -0
  187. package/dist/destinations/stackadapt/index.js +38 -0
  188. package/dist/destinations/stackadapt/index.js.map +1 -0
  189. package/dist/destinations/tiktok-conversions/common_fields.d.ts +2 -0
  190. package/dist/destinations/tiktok-conversions/common_fields.js +245 -0
  191. package/dist/destinations/tiktok-conversions/common_fields.js.map +1 -0
  192. package/dist/destinations/tiktok-conversions/formatter.d.ts +3 -0
  193. package/dist/destinations/tiktok-conversions/formatter.js +43 -0
  194. package/dist/destinations/tiktok-conversions/formatter.js.map +1 -0
  195. package/dist/destinations/tiktok-conversions/utils.d.ts +4 -0
  196. package/dist/destinations/tiktok-conversions/utils.js +65 -0
  197. package/dist/destinations/tiktok-conversions/utils.js.map +1 -0
  198. package/dist/destinations/tiktok-conversions-sandbox/index.js +2 -2
  199. package/dist/destinations/tiktok-conversions-sandbox/index.js.map +1 -1
  200. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
  201. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
  202. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
  203. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
  204. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +16 -0
  205. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
  206. package/dist/destinations/tiktok-offline-conversions/utils.d.ts +8 -0
  207. package/dist/destinations/tiktok-offline-conversions/utils.js +67 -0
  208. package/dist/destinations/tiktok-offline-conversions/utils.js.map +1 -0
  209. package/dist/destinations/tiktok-offline-conversions-sandbox/index.js +2 -2
  210. package/dist/destinations/tiktok-offline-conversions-sandbox/index.js.map +1 -1
  211. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js +1 -1
  212. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js.map +1 -1
  213. package/dist/destinations/trackey/group.types.d.ts +11 -0
  214. package/dist/destinations/trackey/group.types.js +3 -0
  215. package/dist/destinations/trackey/group.types.js.map +1 -0
  216. package/dist/destinations/trackey/identify.types.d.ts +11 -0
  217. package/dist/destinations/trackey/identify.types.js +3 -0
  218. package/dist/destinations/trackey/identify.types.js.map +1 -0
  219. package/dist/destinations/trackey/track.types.d.ts +12 -0
  220. package/dist/destinations/trackey/track.types.js +3 -0
  221. package/dist/destinations/trackey/track.types.js.map +1 -0
  222. package/package.json +4 -4
@@ -0,0 +1,273 @@
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 isEmpty_1 = __importDefault(require("lodash/isEmpty"));
7
+ const action = {
8
+ title: 'Forward Event',
9
+ description: 'Forward Segment events to StackAdapt for conversion tracking',
10
+ defaultSubscription: 'type = "identify" or type = "page" or type = "screen" or type = "track"',
11
+ fields: {
12
+ user_id: {
13
+ label: 'Segment User ID',
14
+ description: 'The ID of the user in Segment',
15
+ type: 'string',
16
+ required: true,
17
+ default: {
18
+ '@if': {
19
+ exists: { '@path': '$.userId' },
20
+ then: { '@path': '$.userId' },
21
+ else: { '@path': '$.anonymousId' }
22
+ }
23
+ }
24
+ },
25
+ event_type: {
26
+ label: 'Event Type',
27
+ description: 'The Segment event type (page, track, etc.)',
28
+ type: 'string',
29
+ default: {
30
+ '@path': '$.type'
31
+ }
32
+ },
33
+ ip_fwd: {
34
+ description: 'IP address of the user',
35
+ label: 'IP Address',
36
+ type: 'string',
37
+ default: {
38
+ '@path': '$.context.ip'
39
+ }
40
+ },
41
+ title: {
42
+ type: 'string',
43
+ description: 'The title of the page where the event occurred.',
44
+ label: 'Page Title',
45
+ default: { '@path': '$.context.page.title' }
46
+ },
47
+ url: {
48
+ type: 'string',
49
+ description: 'The URL of the page where the event occurred.',
50
+ label: 'URL',
51
+ default: { '@path': '$.context.page.url' }
52
+ },
53
+ referrer: {
54
+ type: 'string',
55
+ description: 'The referrer of the page where the event occurred.',
56
+ label: 'Referrer',
57
+ default: { '@path': '$.context.page.referrer' }
58
+ },
59
+ utm_source: {
60
+ type: 'string',
61
+ format: 'text',
62
+ label: 'UTM Source',
63
+ description: 'UTM source parameter associated with event',
64
+ default: { '@path': '$.context.campaign.source' }
65
+ },
66
+ user_agent: {
67
+ description: 'User-Agent of the user',
68
+ label: 'User Agent',
69
+ type: 'string',
70
+ default: {
71
+ '@path': '$.context.userAgent'
72
+ }
73
+ },
74
+ email: {
75
+ label: 'Email',
76
+ description: 'Email address of the individual who triggered the event.',
77
+ type: 'string',
78
+ format: 'email',
79
+ default: {
80
+ '@if': {
81
+ exists: { '@path': '$.traits.email' },
82
+ then: { '@path': '$.traits.email' },
83
+ else: { '@path': '$.properties.email' }
84
+ }
85
+ }
86
+ },
87
+ phone: {
88
+ label: 'Phone Number',
89
+ description: 'Phone number of the individual who triggered the event',
90
+ type: 'string',
91
+ default: {
92
+ '@if': {
93
+ exists: { '@path': '$.traits.phone' },
94
+ then: { '@path': '$.traits.phone' },
95
+ else: { '@path': '$.properties.phone' }
96
+ }
97
+ }
98
+ },
99
+ first_name: {
100
+ label: 'First Name',
101
+ description: 'First name of the individual who triggered the event.',
102
+ type: 'string',
103
+ default: {
104
+ '@if': {
105
+ exists: { '@path': '$.traits.first_name' },
106
+ then: { '@path': '$.traits.first_name' },
107
+ else: { '@path': '$.properties.first_name' }
108
+ }
109
+ }
110
+ },
111
+ last_name: {
112
+ label: 'Last Name',
113
+ description: 'Last name of the individual who triggered the event.',
114
+ type: 'string',
115
+ default: {
116
+ '@if': {
117
+ exists: { '@path': '$.traits.last_name' },
118
+ then: { '@path': '$.traits.last_name' },
119
+ else: { '@path': '$.properties.last_name' }
120
+ }
121
+ }
122
+ },
123
+ ecommerce_data: {
124
+ label: 'Ecommerce Data',
125
+ description: 'Additional ecommerce fields that are included in the pixel payload.',
126
+ type: 'object',
127
+ additionalProperties: true,
128
+ properties: {
129
+ action: {
130
+ label: 'Event Name',
131
+ description: 'The event name (e.g. Order Completed)',
132
+ type: 'string'
133
+ },
134
+ revenue: {
135
+ label: 'Revenue',
136
+ type: 'number',
137
+ description: 'The revenue generated from the event.'
138
+ },
139
+ order_id: {
140
+ label: 'Order ID',
141
+ type: 'string',
142
+ description: 'The ID of the order.'
143
+ },
144
+ product_price: {
145
+ label: 'Price',
146
+ type: 'number',
147
+ description: 'The price of the product.'
148
+ },
149
+ product_quantity: {
150
+ label: 'Quantity',
151
+ type: 'integer',
152
+ description: 'The quantity of the product.'
153
+ },
154
+ product_id: {
155
+ label: 'Product ID',
156
+ type: 'string',
157
+ description: 'An identifier for the product.'
158
+ },
159
+ product_category: {
160
+ label: 'Product Category',
161
+ type: 'string',
162
+ description: 'A category for the product.'
163
+ },
164
+ product_name: {
165
+ label: 'Product Name',
166
+ type: 'string',
167
+ description: 'The name of the product.'
168
+ }
169
+ },
170
+ default: {
171
+ action: { '@path': '$.event' },
172
+ revenue: { '@path': '$.properties.revenue' },
173
+ order_id: { '@path': '$.properties.order_id' },
174
+ product_price: { '@path': '$.properties.price' },
175
+ product_quantity: { '@path': '$.properties.quantity' },
176
+ product_id: { '@path': '$.properties.product_id' },
177
+ product_category: { '@path': '$.properties.category' },
178
+ product_name: { '@path': '$.properties.name' }
179
+ }
180
+ },
181
+ ecommerce_products: {
182
+ label: 'Products',
183
+ description: 'The list of products associated with the event (for events with multiple products, such as Order Completed)',
184
+ type: 'object',
185
+ multiple: true,
186
+ additionalProperties: true,
187
+ properties: {
188
+ product_price: {
189
+ label: 'Price',
190
+ type: 'number',
191
+ description: 'The price of the product.'
192
+ },
193
+ product_quantity: {
194
+ label: 'Quantity',
195
+ type: 'integer',
196
+ description: 'The quantity of the product.'
197
+ },
198
+ product_id: {
199
+ label: 'Product ID',
200
+ type: 'string',
201
+ description: 'An identifier for the product.'
202
+ },
203
+ product_category: {
204
+ label: 'Product Category',
205
+ type: 'string',
206
+ description: 'A category for the product.'
207
+ },
208
+ product_name: {
209
+ label: 'Product Name',
210
+ type: 'string',
211
+ description: 'The name of the product.'
212
+ }
213
+ },
214
+ default: {
215
+ '@arrayPath': [
216
+ '$.properties.products',
217
+ {
218
+ product_price: {
219
+ '@path': 'price'
220
+ },
221
+ product_quantity: {
222
+ '@path': 'quantity'
223
+ },
224
+ product_id: {
225
+ '@path': 'product_id'
226
+ },
227
+ product_category: {
228
+ '@path': 'category'
229
+ },
230
+ product_name: {
231
+ '@path': 'name'
232
+ }
233
+ }
234
+ ]
235
+ }
236
+ }
237
+ },
238
+ perform: async (request, { payload, settings }) => {
239
+ return request(`https://tags.srv.stackadapt.com/saq_pxl`, {
240
+ method: 'GET',
241
+ searchParams: getAvailableData(payload, settings),
242
+ headers: {
243
+ 'Content-Type': 'application/json',
244
+ 'X-Forwarded-For': payload.ip_fwd ?? '',
245
+ 'User-Agent': payload.user_agent ?? ''
246
+ }
247
+ });
248
+ }
249
+ };
250
+ function getAvailableData(payload, settings) {
251
+ const ecommerceData = {
252
+ ...payload.ecommerce_data,
253
+ ...(!isEmpty_1.default(payload.ecommerce_products) && { products: payload.ecommerce_products })
254
+ };
255
+ return {
256
+ segment_ss: '1',
257
+ event_type: payload.event_type ?? '',
258
+ title: payload.title ?? '',
259
+ url: payload.url ?? '',
260
+ ref: payload.referrer ?? '',
261
+ ip_fwd: payload.ip_fwd ?? '',
262
+ utm_source: payload.utm_source ?? '',
263
+ user_id: payload.user_id,
264
+ uid: settings.pixelId,
265
+ first_name: payload.first_name ?? '',
266
+ last_name: payload.last_name ?? '',
267
+ email: payload.email ?? '',
268
+ phone: payload.phone ?? '',
269
+ ...(!isEmpty_1.default(ecommerceData) && { args: JSON.stringify(ecommerceData) })
270
+ };
271
+ }
272
+ exports.default = action;
273
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/stackadapt/forwardEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,6DAAoC;AAEpC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,8DAA8D;IAC3E,mBAAmB,EAAE,yEAAyE;IAC9F,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBAGP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,4CAA4C;YACzD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ;aAClB;SACF;QACD,MAAM,EAAE;YACN,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ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C5D,MAAM,aAAa,GAAG;QACpB,GAAG,OAAO,CAAC,cAAc;QACzB,GAAG,CAAC,CAAC,iBAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;KACtF,CAAA;IACD,OAAO;QACL,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,EAAE;QACtB,GAAG,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE;QAC3B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,EAAE,QAAQ,CAAC,OAAO;QACrB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;QAC1B,GAAG,CAAC,CAAC,iBAAO,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC;KACxE,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,3 @@
1
+ export interface Settings {
2
+ pixelId: string;
3
+ }
@@ -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/stackadapt/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,38 @@
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 forwardEvent_1 = __importDefault(require("./forwardEvent"));
8
+ const destination = {
9
+ name: 'StackAdapt Cloud (Actions)',
10
+ slug: 'actions-stackadapt-cloud',
11
+ mode: 'cloud',
12
+ description: 'Forward Segment events to StackAdapt for tracking ad conversions, and generating lookalike and retargeting Audiences',
13
+ authentication: {
14
+ scheme: 'custom',
15
+ fields: {
16
+ pixelId: {
17
+ label: 'Universal Pixel ID',
18
+ description: 'Your StackAdapt Universal Pixel ID',
19
+ type: 'string',
20
+ required: true
21
+ }
22
+ }
23
+ },
24
+ presets: [
25
+ {
26
+ name: 'Forward Event',
27
+ subscribe: 'type = "identify" or type = "page" or type = "screen" or type = "track"',
28
+ partnerAction: 'forwardEvent',
29
+ mapping: actions_core_1.defaultValues(forwardEvent_1.default.fields),
30
+ type: 'automatic'
31
+ }
32
+ ],
33
+ actions: {
34
+ forwardEvent: forwardEvent_1.default
35
+ }
36
+ };
37
+ exports.default = destination;
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/stackadapt/index.ts"],"names":[],"mappings":";;;;;AAGA,wDAAqD;AACrD,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,WAAW,EACT,sHAAsH;IACxH,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,oCAAoC;gBACjD,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,OAAO,EAAE;QACP;YACE,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,yEAAyE;YACpF,aAAa,EAAE,cAAc;YAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;YAC3C,IAAI,EAAE,WAAW;SAClB;KACF;IACD,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { InputField } from '@segment/actions-core';
2
+ export declare const commonFields: Record<string, InputField>;
@@ -0,0 +1,245 @@
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 Web Events" section on in TikTok’s [Events API documentation](https://ads.tiktok.com/marketing_api/docs?id=1701890979375106) for accepted event names.'
10
+ },
11
+ event_id: {
12
+ label: 'Event ID',
13
+ type: 'string',
14
+ description: 'Any hashed ID that can identify a unique user/session.',
15
+ default: {
16
+ '@path': '$.messageId'
17
+ }
18
+ },
19
+ timestamp: {
20
+ label: 'Event Timestamp',
21
+ type: 'string',
22
+ description: 'Timestamp that the event took place, in ISO 8601 format.',
23
+ default: {
24
+ '@path': '$.timestamp'
25
+ }
26
+ },
27
+ phone_number: {
28
+ label: 'Phone Number',
29
+ description: 'A single phone number or array of phone numbers in E.164 standard format. Segment will hash this value before sending to TikTok. e.g. +14150000000. Segment will hash this value before sending to TikTok.',
30
+ type: 'string',
31
+ multiple: true,
32
+ default: {
33
+ '@if': {
34
+ exists: { '@path': '$.properties.phone' },
35
+ then: { '@path': '$.properties.phone' },
36
+ else: { '@path': '$.context.traits.phone' }
37
+ }
38
+ }
39
+ },
40
+ email: {
41
+ label: 'Email',
42
+ description: 'A single email address or an array of email addresses. Segment will hash this value before sending to TikTok.',
43
+ type: 'string',
44
+ format: 'email',
45
+ multiple: true,
46
+ default: {
47
+ '@if': {
48
+ exists: { '@path': '$.properties.email' },
49
+ then: { '@path': '$.properties.email' },
50
+ else: { '@path': '$.context.traits.email' }
51
+ }
52
+ }
53
+ },
54
+ order_id: {
55
+ label: 'Order ID',
56
+ type: 'string',
57
+ description: 'Order ID of the transaction.',
58
+ default: {
59
+ '@path': '$.properties.order_id'
60
+ }
61
+ },
62
+ shop_id: {
63
+ label: 'Shop ID',
64
+ type: 'string',
65
+ description: 'Shop ID of the transaction.',
66
+ default: {
67
+ '@path': '$.properties.shop_id'
68
+ }
69
+ },
70
+ external_id: {
71
+ label: 'External ID',
72
+ description: 'Uniquely identifies the user who triggered the conversion event. Segment will hash this value before sending to TikTok. TikTok Conversions Destination supports both string and string[] types for sending external ID(s).',
73
+ type: 'string',
74
+ multiple: true,
75
+ default: {
76
+ '@if': {
77
+ exists: { '@path': '$.userId' },
78
+ then: { '@path': '$.userId' },
79
+ else: { '@path': '$.anonymousId' }
80
+ }
81
+ }
82
+ },
83
+ ttclid: {
84
+ label: 'TikTok Click ID',
85
+ 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.',
86
+ type: 'string',
87
+ default: {
88
+ '@if': {
89
+ exists: { '@path': '$.properties.ttclid' },
90
+ then: { '@path': '$.properties.ttclid' },
91
+ else: { '@path': '$.integrations.TikTok Conversions.ttclid' }
92
+ }
93
+ }
94
+ },
95
+ ttp: {
96
+ label: 'TikTok Cookie ID',
97
+ 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`).',
98
+ type: 'string',
99
+ default: {
100
+ '@if': {
101
+ exists: { '@path': '$.properties.ttp' },
102
+ then: { '@path': '$.properties.ttp' },
103
+ else: { '@path': '$.integrations.TikTok Conversions.ttp' }
104
+ }
105
+ }
106
+ },
107
+ lead_id: {
108
+ label: 'TikTok Lead ID',
109
+ 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',
110
+ type: 'string',
111
+ default: { '@path': '$.properties.lead_id' }
112
+ },
113
+ locale: {
114
+ label: 'Locale',
115
+ 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).',
116
+ type: 'string',
117
+ default: {
118
+ '@path': '$.context.locale'
119
+ }
120
+ },
121
+ url: {
122
+ label: 'Page URL',
123
+ type: 'string',
124
+ description: 'The page URL where the conversion event took place.',
125
+ default: {
126
+ '@path': '$.context.page.url'
127
+ }
128
+ },
129
+ referrer: {
130
+ label: 'Page Referrer',
131
+ type: 'string',
132
+ description: 'The page referrer.',
133
+ default: {
134
+ '@path': '$.context.page.referrer'
135
+ }
136
+ },
137
+ ip: {
138
+ label: 'IP Address',
139
+ type: 'string',
140
+ description: 'IP address of the browser.',
141
+ default: {
142
+ '@path': '$.context.ip'
143
+ }
144
+ },
145
+ user_agent: {
146
+ label: 'User Agent',
147
+ type: 'string',
148
+ description: 'User agent from the user’s device.',
149
+ default: {
150
+ '@path': '$.context.userAgent'
151
+ }
152
+ },
153
+ contents: {
154
+ label: 'Contents',
155
+ type: 'object',
156
+ multiple: true,
157
+ description: 'Related item details for the event.',
158
+ properties: {
159
+ price: {
160
+ label: 'Price',
161
+ description: 'Price of the item.',
162
+ type: 'number'
163
+ },
164
+ quantity: {
165
+ label: 'Quantity',
166
+ description: 'Number of items.',
167
+ type: 'number'
168
+ },
169
+ content_category: {
170
+ label: 'Content Category',
171
+ description: 'Category of the product item.',
172
+ type: 'string'
173
+ },
174
+ content_id: {
175
+ label: 'Content ID',
176
+ description: 'ID of the product item.',
177
+ type: 'string'
178
+ },
179
+ content_name: {
180
+ label: 'Content Name',
181
+ description: 'Name of the product item.',
182
+ type: 'string'
183
+ },
184
+ brand: {
185
+ label: 'Brand',
186
+ description: 'Brand name of the product item.',
187
+ type: 'string'
188
+ }
189
+ }
190
+ },
191
+ content_type: {
192
+ label: 'Content Type',
193
+ description: 'Type of the product item. When the `content_id` in the `Contents` field is specified as a `sku_id`, set this field to `product`. When the `content_id` in the `Contents` field is specified as an `item_group_id`, set this field to `product_group`.',
194
+ type: 'string',
195
+ choices: ['product', 'product_group'],
196
+ default: 'product'
197
+ },
198
+ currency: {
199
+ label: 'Currency',
200
+ type: 'string',
201
+ description: 'Currency for the value specified as ISO 4217 code.',
202
+ default: {
203
+ '@path': '$.properties.currency'
204
+ }
205
+ },
206
+ value: {
207
+ label: 'Value',
208
+ type: 'number',
209
+ description: 'Value of the order or items sold.',
210
+ default: {
211
+ '@if': {
212
+ exists: { '@path': '$.properties.value' },
213
+ then: { '@path': '$.properties.value' },
214
+ else: { '@path': '$.properties.revenue' }
215
+ }
216
+ }
217
+ },
218
+ description: {
219
+ label: 'Description',
220
+ type: 'string',
221
+ description: 'A string description of the web event.'
222
+ },
223
+ query: {
224
+ label: 'Query',
225
+ type: 'string',
226
+ description: 'The text string that was searched for.',
227
+ default: {
228
+ '@path': '$.properties.query'
229
+ }
230
+ },
231
+ limited_data_use: {
232
+ label: 'Limited Data Use',
233
+ type: 'boolean',
234
+ 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).',
235
+ default: {
236
+ '@path': '$.properties.limited_data_use'
237
+ }
238
+ },
239
+ test_event_code: {
240
+ label: 'Test Event Code',
241
+ type: 'string',
242
+ 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.'
243
+ }
244
+ };
245
+ //# sourceMappingURL=common_fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common_fields.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-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,8MAA8M;KACjN;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wDAAwD;QACrE,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,SAAS,EAAE;QACT,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0DAA0D;QACvE,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,4MAA4M;QAC9M,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,wBAAwB,EAAE;aAC5C;SACF;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,WAAW,EACT,+GAA+G;QACjH,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,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EAAE,wCAAwC;KACtD;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE;YACP,OAAO,EAAE,oBAAoB;SAC9B;KACF;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,SAAS;QACf,WAAW,EACT,uZAAuZ;QACzZ,OAAO,EAAE;YACP,OAAO,EAAE,+BAA+B;SACzC;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,qRAAqR;KACxR;CACF,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const formatEmails: (email_addresses: string[] | undefined) => string[];
2
+ export declare const formatPhones: (phone_numbers: string[] | undefined) => string[];
3
+ export declare function formatUserIds(userIds: string[] | undefined): string[];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatUserIds = 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 formatUserIds(userIds) {
31
+ const result = [];
32
+ if (userIds) {
33
+ userIds.forEach((userId) => {
34
+ result.push(hashAndEncode(userId.toLowerCase()));
35
+ });
36
+ }
37
+ return result;
38
+ }
39
+ exports.formatUserIds = formatUserIds;
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-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;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;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,4 @@
1
+ import { RequestClient } from '@segment/actions-core';
2
+ import { Settings } from './generated-types';
3
+ import { Payload } from './reportWebEvent/generated-types';
4
+ export declare function performWebEvent(request: RequestClient, settings: Settings, payload: Payload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;