@segment/action-destinations 3.337.2-staging.1 → 3.337.7-staging.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.
Files changed (471) hide show
  1. package/README.md +1 -1
  2. package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js +6 -2
  3. package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js.map +1 -1
  4. package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js +7 -1
  5. package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js.map +1 -1
  6. package/dist/destinations/aggregations-io/generated-types.d.ts +4 -0
  7. package/dist/destinations/aggregations-io/generated-types.js.map +1 -0
  8. package/dist/destinations/aggregations-io/index.d.ts +4 -0
  9. package/dist/destinations/aggregations-io/index.js +58 -0
  10. package/dist/destinations/aggregations-io/index.js.map +1 -0
  11. package/dist/destinations/aggregations-io/send/generated-types.d.ts +7 -0
  12. package/dist/destinations/aggregations-io/send/generated-types.js.map +1 -0
  13. package/dist/destinations/aggregations-io/send/index.js +44 -0
  14. package/dist/destinations/aggregations-io/send/index.js.map +1 -0
  15. package/dist/destinations/aggregations-io/types.d.ts +8 -0
  16. package/dist/destinations/aggregations-io/types.js +8 -0
  17. package/dist/destinations/aggregations-io/types.js.map +1 -0
  18. package/dist/destinations/airship/registerAndAssociate/generated-types.d.ts +3 -0
  19. package/dist/destinations/airship/registerAndAssociate/index.js +35 -7
  20. package/dist/destinations/airship/registerAndAssociate/index.js.map +1 -1
  21. package/dist/destinations/airship/utilities.d.ts +3 -1
  22. package/dist/destinations/airship/utilities.js +76 -41
  23. package/dist/destinations/airship/utilities.js.map +1 -1
  24. package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +2 -2
  25. package/dist/destinations/algolia-insights/conversionEvents/index.js +7 -3
  26. package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -1
  27. package/dist/destinations/algolia-insights/index.js +7 -0
  28. package/dist/destinations/algolia-insights/index.js.map +1 -1
  29. package/dist/destinations/algolia-insights/productAddedEvents/generated-types.d.ts +2 -2
  30. package/dist/destinations/algolia-insights/productAddedEvents/index.js +7 -3
  31. package/dist/destinations/algolia-insights/productAddedEvents/index.js.map +1 -1
  32. package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +2 -2
  33. package/dist/destinations/algolia-insights/productClickedEvents/index.js +7 -3
  34. package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -1
  35. package/dist/destinations/algolia-insights/productListFilteredEvents/generated-types.d.ts +2 -2
  36. package/dist/destinations/algolia-insights/productListFilteredEvents/index.js +7 -3
  37. package/dist/destinations/algolia-insights/productListFilteredEvents/index.js.map +1 -1
  38. package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +2 -2
  39. package/dist/destinations/algolia-insights/productViewedEvents/index.js +7 -3
  40. package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -1
  41. package/dist/destinations/amazon-ads/generated-types.d.ts +3 -0
  42. package/dist/destinations/amazon-ads/generated-types.js +3 -0
  43. package/dist/destinations/amazon-ads/generated-types.js.map +1 -0
  44. package/dist/destinations/amazon-ads/index.d.ts +4 -0
  45. package/dist/destinations/amazon-ads/index.js +87 -0
  46. package/dist/destinations/amazon-ads/index.js.map +1 -0
  47. package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +2 -0
  48. package/dist/destinations/amazon-ads/syncAudiences/generated-types.js +3 -0
  49. package/dist/destinations/amazon-ads/syncAudiences/generated-types.js.map +1 -0
  50. package/dist/destinations/amazon-ads/syncAudiences/index.d.ts +5 -0
  51. package/dist/destinations/amazon-ads/syncAudiences/index.js +15 -0
  52. package/dist/destinations/amazon-ads/syncAudiences/index.js.map +1 -0
  53. package/dist/destinations/amazon-ads/types.d.ts +22 -0
  54. package/dist/destinations/amazon-ads/types.js +11 -0
  55. package/dist/destinations/amazon-ads/types.js.map +1 -0
  56. package/dist/destinations/avo/generated-types.d.ts +5 -0
  57. package/dist/destinations/avo/generated-types.js +3 -0
  58. package/dist/destinations/avo/generated-types.js.map +1 -0
  59. package/dist/destinations/avo/index.d.ts +4 -0
  60. package/dist/destinations/avo/index.js +54 -0
  61. package/dist/destinations/avo/index.js.map +1 -0
  62. package/dist/destinations/avo/sendSchemaToInspector/AvoSchemaParser.d.ts +9 -0
  63. package/dist/destinations/avo/sendSchemaToInspector/AvoSchemaParser.js +97 -0
  64. package/dist/destinations/avo/sendSchemaToInspector/AvoSchemaParser.js.map +1 -0
  65. package/dist/destinations/avo/sendSchemaToInspector/avo-types.d.ts +26 -0
  66. package/dist/destinations/avo/sendSchemaToInspector/avo-types.js +10 -0
  67. package/dist/destinations/avo/sendSchemaToInspector/avo-types.js.map +1 -0
  68. package/dist/destinations/avo/sendSchemaToInspector/avo.d.ts +3 -0
  69. package/dist/destinations/avo/sendSchemaToInspector/avo.js +44 -0
  70. package/dist/destinations/avo/sendSchemaToInspector/avo.js.map +1 -0
  71. package/dist/destinations/avo/sendSchemaToInspector/generated-types.d.ts +11 -0
  72. package/dist/destinations/avo/sendSchemaToInspector/generated-types.js +3 -0
  73. package/dist/destinations/avo/sendSchemaToInspector/generated-types.js.map +1 -0
  74. package/dist/destinations/avo/sendSchemaToInspector/index.d.ts +5 -0
  75. package/dist/destinations/avo/sendSchemaToInspector/index.js +95 -0
  76. package/dist/destinations/avo/sendSchemaToInspector/index.js.map +1 -0
  77. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
  78. package/dist/destinations/braze/trackEvent/generated-types.d.ts +1 -0
  79. package/dist/destinations/braze/trackEvent/index.js +8 -0
  80. package/dist/destinations/braze/trackEvent/index.js.map +1 -1
  81. package/dist/destinations/braze/trackPurchase/generated-types.d.ts +1 -0
  82. package/dist/destinations/braze/trackPurchase/index.js +8 -0
  83. package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
  84. package/dist/destinations/braze/utils.js +15 -11
  85. package/dist/destinations/braze/utils.js.map +1 -1
  86. package/dist/destinations/courier/generated-types.d.ts +4 -0
  87. package/dist/destinations/courier/generated-types.js +3 -0
  88. package/dist/destinations/courier/generated-types.js.map +1 -0
  89. package/dist/destinations/courier/index.d.ts +4 -0
  90. package/dist/destinations/courier/index.js +44 -0
  91. package/dist/destinations/courier/index.js.map +1 -0
  92. package/dist/destinations/courier/postToCourier/generated-types.d.ts +5 -0
  93. package/dist/destinations/courier/postToCourier/generated-types.js +3 -0
  94. package/dist/destinations/courier/postToCourier/generated-types.js.map +1 -0
  95. package/dist/destinations/courier/postToCourier/index.js +35 -0
  96. package/dist/destinations/courier/postToCourier/index.js.map +1 -0
  97. package/dist/destinations/criteo-audiences/addUserToAudience/index.js +5 -5
  98. package/dist/destinations/criteo-audiences/addUserToAudience/index.js.map +1 -1
  99. package/dist/destinations/criteo-audiences/criteo-audiences.js +13 -2
  100. package/dist/destinations/criteo-audiences/criteo-audiences.js.map +1 -1
  101. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js +5 -5
  102. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js.map +1 -1
  103. package/dist/destinations/customerio/deleteObject/generated-types.d.ts +4 -0
  104. package/dist/destinations/customerio/deleteObject/generated-types.js +3 -0
  105. package/dist/destinations/customerio/deleteObject/generated-types.js.map +1 -0
  106. package/dist/destinations/customerio/deleteObject/index.d.ts +5 -0
  107. package/dist/destinations/customerio/deleteObject/index.js +48 -0
  108. package/dist/destinations/customerio/deleteObject/index.js.map +1 -0
  109. package/dist/destinations/customerio/deletePerson/generated-types.d.ts +3 -0
  110. package/dist/destinations/customerio/deletePerson/generated-types.js +3 -0
  111. package/dist/destinations/customerio/deletePerson/generated-types.js.map +1 -0
  112. package/dist/destinations/customerio/deletePerson/index.d.ts +5 -0
  113. package/dist/destinations/customerio/deletePerson/index.js +41 -0
  114. package/dist/destinations/customerio/deletePerson/index.js.map +1 -0
  115. package/dist/destinations/customerio/deleteRelationship/generated-types.d.ts +6 -0
  116. package/dist/destinations/customerio/deleteRelationship/generated-types.js +3 -0
  117. package/dist/destinations/customerio/deleteRelationship/generated-types.js.map +1 -0
  118. package/dist/destinations/customerio/deleteRelationship/index.d.ts +5 -0
  119. package/dist/destinations/customerio/deleteRelationship/index.js +82 -0
  120. package/dist/destinations/customerio/deleteRelationship/index.js.map +1 -0
  121. package/dist/destinations/customerio/mergePeople/generated-types.d.ts +4 -0
  122. package/dist/destinations/customerio/mergePeople/generated-types.js +3 -0
  123. package/dist/destinations/customerio/mergePeople/generated-types.js.map +1 -0
  124. package/dist/destinations/customerio/mergePeople/index.d.ts +5 -0
  125. package/dist/destinations/customerio/mergePeople/index.js +52 -0
  126. package/dist/destinations/customerio/mergePeople/index.js.map +1 -0
  127. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.d.ts +10 -0
  128. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js +3 -0
  129. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js.map +1 -0
  130. package/dist/destinations/customerio/reportDeliveryEvent/index.d.ts +5 -0
  131. package/dist/destinations/customerio/reportDeliveryEvent/index.js +125 -0
  132. package/dist/destinations/customerio/reportDeliveryEvent/index.js.map +1 -0
  133. package/dist/destinations/customerio/suppressPerson/generated-types.d.ts +3 -0
  134. package/dist/destinations/customerio/suppressPerson/generated-types.js +3 -0
  135. package/dist/destinations/customerio/suppressPerson/generated-types.js.map +1 -0
  136. package/dist/destinations/customerio/suppressPerson/index.d.ts +5 -0
  137. package/dist/destinations/customerio/suppressPerson/index.js +41 -0
  138. package/dist/destinations/customerio/suppressPerson/index.js.map +1 -0
  139. package/dist/destinations/customerio/test-helper.d.ts +4 -0
  140. package/dist/destinations/customerio/test-helper.js +77 -0
  141. package/dist/destinations/customerio/test-helper.js.map +1 -0
  142. package/dist/destinations/customerio/unsuppressPerson/generated-types.d.ts +3 -0
  143. package/dist/destinations/customerio/unsuppressPerson/generated-types.js +3 -0
  144. package/dist/destinations/customerio/unsuppressPerson/generated-types.js.map +1 -0
  145. package/dist/destinations/customerio/unsuppressPerson/index.d.ts +5 -0
  146. package/dist/destinations/customerio/unsuppressPerson/index.js +41 -0
  147. package/dist/destinations/customerio/unsuppressPerson/index.js.map +1 -0
  148. package/dist/destinations/devrev/createRevUser/index.js +9 -6
  149. package/dist/destinations/devrev/createRevUser/index.js.map +1 -1
  150. package/dist/destinations/devrev/utils/types.d.ts +9 -0
  151. package/dist/destinations/display-video-360/index.js +1 -1
  152. package/dist/destinations/display-video-360/index.js.map +1 -1
  153. package/dist/destinations/display-video-360/properties.js +4 -4
  154. package/dist/destinations/display-video-360/properties.js.map +1 -1
  155. package/dist/destinations/display-video-360/proto/protofile.d.ts +1 -0
  156. package/dist/destinations/display-video-360/proto/protofile.js +1 -0
  157. package/dist/destinations/display-video-360/proto/protofile.js.map +1 -1
  158. package/dist/destinations/display-video-360/shared.js +7 -44
  159. package/dist/destinations/display-video-360/shared.js.map +1 -1
  160. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +2 -5
  161. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +18 -98
  162. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -1
  163. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +9 -3
  164. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
  165. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +0 -3
  166. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -1
  167. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +8 -2
  168. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -1
  169. package/dist/destinations/engage/utils/EngageStats.js +0 -4
  170. package/dist/destinations/engage/utils/EngageStats.js.map +1 -1
  171. package/dist/destinations/equals/generated-types.d.ts +3 -0
  172. package/dist/destinations/equals/generated-types.js +3 -0
  173. package/dist/destinations/equals/generated-types.js.map +1 -0
  174. package/dist/destinations/equals/index.d.ts +4 -0
  175. package/dist/destinations/equals/index.js +38 -0
  176. package/dist/destinations/equals/index.js.map +1 -0
  177. package/dist/destinations/equals/send/generated-types.d.ts +5 -0
  178. package/dist/destinations/equals/send/generated-types.js +3 -0
  179. package/dist/destinations/equals/send/generated-types.js.map +1 -0
  180. package/dist/destinations/equals/send/index.d.ts +5 -0
  181. package/dist/destinations/equals/send/index.js +38 -0
  182. package/dist/destinations/equals/send/index.js.map +1 -0
  183. package/dist/destinations/facebook-conversions-api/constants.d.ts +1 -1
  184. package/dist/destinations/facebook-conversions-api/constants.js +1 -1
  185. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.js +1 -1
  186. package/dist/destinations/google-enhanced-conversions/functions.d.ts +1 -1
  187. package/dist/destinations/google-enhanced-conversions/functions.js +1 -1
  188. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +0 -1
  189. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
  190. package/dist/destinations/hubspot/utils.d.ts +3 -3
  191. package/dist/destinations/index.js +9 -0
  192. package/dist/destinations/index.js.map +1 -1
  193. package/dist/destinations/kameleoon/index.js +1 -1
  194. package/dist/destinations/kameleoon/index.js.map +1 -1
  195. package/dist/destinations/kevel/generated-types.d.ts +4 -0
  196. package/dist/destinations/kevel/generated-types.js +3 -0
  197. package/dist/destinations/kevel/generated-types.js.map +1 -0
  198. package/dist/destinations/kevel/index.d.ts +4 -0
  199. package/dist/destinations/kevel/index.js +45 -0
  200. package/dist/destinations/kevel/index.js.map +1 -0
  201. package/dist/destinations/kevel/syncAudience/generated-types.d.ts +8 -0
  202. package/dist/destinations/kevel/syncAudience/generated-types.js +3 -0
  203. package/dist/destinations/kevel/syncAudience/generated-types.js.map +1 -0
  204. package/dist/destinations/kevel/syncAudience/index.d.ts +5 -0
  205. package/dist/destinations/kevel/syncAudience/index.js +64 -0
  206. package/dist/destinations/kevel/syncAudience/index.js.map +1 -0
  207. package/dist/destinations/kevel/syncTraits/generated-types.d.ts +6 -0
  208. package/dist/destinations/kevel/syncTraits/generated-types.js +3 -0
  209. package/dist/destinations/kevel/syncTraits/generated-types.js.map +1 -0
  210. package/dist/destinations/kevel/syncTraits/index.d.ts +5 -0
  211. package/dist/destinations/kevel/syncTraits/index.js +39 -0
  212. package/dist/destinations/kevel/syncTraits/index.js.map +1 -0
  213. package/dist/destinations/klaviyo/properties.js +1 -1
  214. package/dist/destinations/klaviyo/properties.js.map +1 -1
  215. package/dist/destinations/linkedin-conversions/api/api.test.js +43 -25
  216. package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
  217. package/dist/destinations/linkedin-conversions/api/index.d.ts +3 -2
  218. package/dist/destinations/linkedin-conversions/api/index.js +41 -15
  219. package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
  220. package/dist/destinations/linkedin-conversions/constants.d.ts +1 -1
  221. package/dist/destinations/linkedin-conversions/constants.js +1 -1
  222. package/dist/destinations/linkedin-conversions/streamConversion/generated-types.d.ts +1 -1
  223. package/dist/destinations/linkedin-conversions/streamConversion/index.js +2 -1
  224. package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
  225. package/dist/destinations/linkedin-conversions/types.d.ts +6 -7
  226. package/dist/destinations/marketo-static-lists/addToList/index.js +2 -2
  227. package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
  228. package/dist/destinations/marketo-static-lists/functions.js +7 -7
  229. package/dist/destinations/marketo-static-lists/functions.js.map +1 -1
  230. package/dist/destinations/marketo-static-lists/removeFromList/index.js +2 -2
  231. package/dist/destinations/marketo-static-lists/removeFromList/index.js.map +1 -1
  232. package/dist/destinations/mixpanel/incrementProperties/__test__/__snapshots__/snapshot.test.js.snap +18 -0
  233. package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.d.ts +1 -0
  234. package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.js +129 -0
  235. package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.js.map +1 -0
  236. package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.d.ts +1 -0
  237. package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.js +69 -0
  238. package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.js.map +1 -0
  239. package/dist/destinations/mixpanel/incrementProperties/generated-types.d.ts +8 -0
  240. package/dist/destinations/mixpanel/incrementProperties/generated-types.js +3 -0
  241. package/dist/destinations/mixpanel/incrementProperties/generated-types.js.map +1 -0
  242. package/dist/destinations/mixpanel/incrementProperties/index.d.ts +5 -0
  243. package/dist/destinations/mixpanel/incrementProperties/index.js +84 -0
  244. package/dist/destinations/mixpanel/incrementProperties/index.js.map +1 -0
  245. package/dist/destinations/mixpanel/index.js +3 -1
  246. package/dist/destinations/mixpanel/index.js.map +1 -1
  247. package/dist/destinations/mixpanel/mixpanel-types.d.ts +4 -0
  248. package/dist/destinations/moengage/trackEvent/generated-types.d.ts +1 -0
  249. package/dist/destinations/moengage/trackEvent/index.js +10 -2
  250. package/dist/destinations/moengage/trackEvent/index.js.map +1 -1
  251. package/dist/destinations/responsys/generated-types.d.ts +15 -0
  252. package/dist/destinations/responsys/index.js +141 -6
  253. package/dist/destinations/responsys/index.js.map +1 -1
  254. package/dist/destinations/responsys/sendAudience/generated-types.d.ts +14 -0
  255. package/dist/destinations/responsys/sendAudience/generated-types.js +3 -0
  256. package/dist/destinations/responsys/sendAudience/generated-types.js.map +1 -0
  257. package/dist/destinations/responsys/sendAudience/index.d.ts +5 -0
  258. package/dist/destinations/responsys/sendAudience/index.js +88 -0
  259. package/dist/destinations/responsys/sendAudience/index.js.map +1 -0
  260. package/dist/destinations/responsys/sendCustomTraits/generated-types.d.ts +9 -0
  261. package/dist/destinations/responsys/sendCustomTraits/generated-types.js +3 -0
  262. package/dist/destinations/responsys/sendCustomTraits/generated-types.js.map +1 -0
  263. package/dist/destinations/responsys/sendCustomTraits/index.d.ts +5 -0
  264. package/dist/destinations/responsys/sendCustomTraits/index.js +52 -0
  265. package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -0
  266. package/dist/destinations/responsys/{rsp-properties.d.ts → shared_properties.d.ts} +0 -1
  267. package/dist/destinations/responsys/{rsp-properties.js → shared_properties.js} +2 -10
  268. package/dist/destinations/responsys/shared_properties.js.map +1 -0
  269. package/dist/destinations/responsys/types.d.ts +23 -22
  270. package/dist/destinations/responsys/upsertListMember/generated-types.d.ts +13 -0
  271. package/dist/destinations/responsys/upsertListMember/generated-types.js +3 -0
  272. package/dist/destinations/responsys/upsertListMember/generated-types.js.map +1 -0
  273. package/dist/destinations/responsys/upsertListMember/index.d.ts +5 -0
  274. package/dist/destinations/responsys/upsertListMember/index.js +80 -0
  275. package/dist/destinations/responsys/upsertListMember/index.js.map +1 -0
  276. package/dist/destinations/responsys/utils.d.ts +18 -0
  277. package/dist/destinations/responsys/utils.js +151 -0
  278. package/dist/destinations/responsys/utils.js.map +1 -0
  279. package/dist/destinations/schematic/generated-types.d.ts +3 -0
  280. package/dist/destinations/schematic/generated-types.js +3 -0
  281. package/dist/destinations/schematic/generated-types.js.map +1 -0
  282. package/dist/destinations/schematic/identifyUser/generated-types.d.ts +18 -0
  283. package/dist/destinations/schematic/identifyUser/generated-types.js +3 -0
  284. package/dist/destinations/schematic/identifyUser/generated-types.js.map +1 -0
  285. package/dist/destinations/schematic/identifyUser/index.d.ts +5 -0
  286. package/dist/destinations/schematic/identifyUser/index.js +114 -0
  287. package/dist/destinations/schematic/identifyUser/index.js.map +1 -0
  288. package/dist/destinations/schematic/index.d.ts +4 -0
  289. package/dist/destinations/schematic/index.js +58 -0
  290. package/dist/destinations/schematic/index.js.map +1 -0
  291. package/dist/destinations/schematic/trackEvent/generated-types.d.ts +13 -0
  292. package/dist/destinations/schematic/trackEvent/generated-types.js +3 -0
  293. package/dist/destinations/schematic/trackEvent/generated-types.js.map +1 -0
  294. package/dist/destinations/schematic/trackEvent/index.d.ts +5 -0
  295. package/dist/destinations/schematic/trackEvent/index.js +89 -0
  296. package/dist/destinations/schematic/trackEvent/index.js.map +1 -0
  297. package/dist/destinations/segment/generated-types.d.ts +0 -1
  298. package/dist/destinations/segment/index.js +3 -13
  299. package/dist/destinations/segment/index.js.map +1 -1
  300. package/dist/destinations/segment/properties.d.ts +1 -1
  301. package/dist/destinations/segment/properties.js +3 -3
  302. package/dist/destinations/segment/properties.js.map +1 -1
  303. package/dist/destinations/segment/sendGroup/index.js +40 -15
  304. package/dist/destinations/segment/sendGroup/index.js.map +1 -1
  305. package/dist/destinations/segment/sendIdentify/index.js +40 -15
  306. package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
  307. package/dist/destinations/segment/sendPage/index.js +48 -15
  308. package/dist/destinations/segment/sendPage/index.js.map +1 -1
  309. package/dist/destinations/segment/sendScreen/index.js +41 -15
  310. package/dist/destinations/segment/sendScreen/index.js.map +1 -1
  311. package/dist/destinations/segment/sendTrack/index.js +45 -15
  312. package/dist/destinations/segment/sendTrack/index.js.map +1 -1
  313. package/dist/destinations/stackadapt/forwardEvent/generated-types.d.ts +33 -0
  314. package/dist/destinations/stackadapt/forwardEvent/generated-types.js +3 -0
  315. package/dist/destinations/stackadapt/forwardEvent/generated-types.js.map +1 -0
  316. package/dist/destinations/stackadapt/forwardEvent/index.d.ts +5 -0
  317. package/dist/destinations/stackadapt/forwardEvent/index.js +273 -0
  318. package/dist/destinations/stackadapt/forwardEvent/index.js.map +1 -0
  319. package/dist/destinations/stackadapt/generated-types.d.ts +3 -0
  320. package/dist/destinations/stackadapt/generated-types.js +3 -0
  321. package/dist/destinations/stackadapt/generated-types.js.map +1 -0
  322. package/dist/destinations/stackadapt/index.d.ts +4 -0
  323. package/dist/destinations/stackadapt/index.js +38 -0
  324. package/dist/destinations/stackadapt/index.js.map +1 -0
  325. package/dist/destinations/surveysparrow/createContact/generated-types.d.ts +10 -0
  326. package/dist/destinations/surveysparrow/createContact/generated-types.js +3 -0
  327. package/dist/destinations/surveysparrow/createContact/generated-types.js.map +1 -0
  328. package/dist/destinations/surveysparrow/createContact/index.d.ts +5 -0
  329. package/dist/destinations/surveysparrow/createContact/index.js +105 -0
  330. package/dist/destinations/surveysparrow/createContact/index.js.map +1 -0
  331. package/dist/destinations/surveysparrow/generated-types.d.ts +3 -0
  332. package/dist/destinations/surveysparrow/generated-types.js +3 -0
  333. package/dist/destinations/surveysparrow/generated-types.js.map +1 -0
  334. package/dist/destinations/surveysparrow/index.d.ts +4 -0
  335. package/dist/destinations/surveysparrow/index.js +40 -0
  336. package/dist/destinations/surveysparrow/index.js.map +1 -0
  337. package/dist/destinations/surveysparrow/triggerSurvey/generated-types.d.ts +10 -0
  338. package/dist/destinations/surveysparrow/triggerSurvey/generated-types.js +3 -0
  339. package/dist/destinations/surveysparrow/triggerSurvey/generated-types.js.map +1 -0
  340. package/dist/destinations/surveysparrow/triggerSurvey/index.d.ts +8 -0
  341. package/dist/destinations/surveysparrow/triggerSurvey/index.js +165 -0
  342. package/dist/destinations/surveysparrow/triggerSurvey/index.js.map +1 -0
  343. package/dist/destinations/tiktok-conversions/common_fields.d.ts +2 -0
  344. package/dist/destinations/tiktok-conversions/common_fields.js +245 -0
  345. package/dist/destinations/tiktok-conversions/common_fields.js.map +1 -0
  346. package/dist/destinations/tiktok-conversions/formatter.d.ts +3 -0
  347. package/dist/destinations/tiktok-conversions/formatter.js +43 -0
  348. package/dist/destinations/tiktok-conversions/formatter.js.map +1 -0
  349. package/dist/destinations/tiktok-conversions/index.js +3 -92
  350. package/dist/destinations/tiktok-conversions/index.js.map +1 -1
  351. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
  352. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +24 -33
  353. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
  354. package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +4 -12
  355. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +40 -113
  356. package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
  357. package/dist/destinations/tiktok-conversions/utils.d.ts +4 -0
  358. package/dist/destinations/tiktok-conversions/utils.js +65 -0
  359. package/dist/destinations/tiktok-conversions/utils.js.map +1 -0
  360. package/dist/destinations/tiktok-conversions-sandbox/common_fields.d.ts +2 -0
  361. package/dist/destinations/tiktok-conversions-sandbox/common_fields.js +244 -0
  362. package/dist/destinations/tiktok-conversions-sandbox/common_fields.js.map +1 -0
  363. package/dist/destinations/{tiktok-offline-conversions/reportOfflineEvent → tiktok-conversions-sandbox}/formatter.js +11 -11
  364. package/dist/destinations/tiktok-conversions-sandbox/formatter.js.map +1 -0
  365. package/dist/destinations/tiktok-conversions-sandbox/generated-types.d.ts +4 -0
  366. package/dist/destinations/tiktok-conversions-sandbox/generated-types.js +3 -0
  367. package/dist/destinations/tiktok-conversions-sandbox/generated-types.js.map +1 -0
  368. package/dist/destinations/tiktok-conversions-sandbox/index.d.ts +4 -0
  369. package/dist/destinations/tiktok-conversions-sandbox/index.js +247 -0
  370. package/dist/destinations/tiktok-conversions-sandbox/index.js.map +1 -0
  371. package/dist/destinations/tiktok-conversions-sandbox/reportWebEvent/generated-types.d.ts +33 -0
  372. package/dist/destinations/tiktok-conversions-sandbox/reportWebEvent/generated-types.js +3 -0
  373. package/dist/destinations/tiktok-conversions-sandbox/reportWebEvent/generated-types.js.map +1 -0
  374. package/dist/destinations/tiktok-conversions-sandbox/reportWebEvent/index.d.ts +5 -0
  375. package/dist/destinations/tiktok-conversions-sandbox/reportWebEvent/index.js +16 -0
  376. package/dist/destinations/tiktok-conversions-sandbox/reportWebEvent/index.js.map +1 -0
  377. package/dist/destinations/tiktok-conversions-sandbox/utils.d.ts +4 -0
  378. package/dist/destinations/tiktok-conversions-sandbox/utils.js +65 -0
  379. package/dist/destinations/tiktok-conversions-sandbox/utils.js.map +1 -0
  380. package/dist/destinations/tiktok-offline-conversions/common_fields.js +179 -20
  381. package/dist/destinations/tiktok-offline-conversions/common_fields.js.map +1 -1
  382. package/dist/destinations/tiktok-offline-conversions/formatter.d.ts +1 -0
  383. package/dist/destinations/tiktok-offline-conversions/formatter.js +11 -1
  384. package/dist/destinations/tiktok-offline-conversions/formatter.js.map +1 -1
  385. package/dist/destinations/tiktok-offline-conversions/index.js +156 -153
  386. package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
  387. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +3 -3
  388. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +4 -305
  389. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -1
  390. package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.d.ts +25 -2
  391. package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js +4 -29
  392. package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map +1 -1
  393. package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.d.ts +18 -5
  394. package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js +5 -126
  395. package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map +1 -1
  396. package/dist/destinations/tiktok-offline-conversions/utils.d.ts +8 -0
  397. package/dist/destinations/tiktok-offline-conversions/utils.js +67 -0
  398. package/dist/destinations/tiktok-offline-conversions/utils.js.map +1 -0
  399. package/dist/destinations/tiktok-offline-conversions-sandbox/common_fields.d.ts +2 -0
  400. package/dist/destinations/tiktok-offline-conversions-sandbox/common_fields.js +244 -0
  401. package/dist/destinations/tiktok-offline-conversions-sandbox/common_fields.js.map +1 -0
  402. package/dist/destinations/tiktok-offline-conversions-sandbox/formatter.d.ts +3 -0
  403. package/dist/destinations/tiktok-offline-conversions-sandbox/formatter.js +43 -0
  404. package/dist/destinations/tiktok-offline-conversions-sandbox/formatter.js.map +1 -0
  405. package/dist/destinations/tiktok-offline-conversions-sandbox/generated-types.d.ts +4 -0
  406. package/dist/destinations/tiktok-offline-conversions-sandbox/generated-types.js +3 -0
  407. package/dist/destinations/tiktok-offline-conversions-sandbox/generated-types.js.map +1 -0
  408. package/dist/destinations/tiktok-offline-conversions-sandbox/index.d.ts +4 -0
  409. package/dist/destinations/tiktok-offline-conversions-sandbox/index.js +251 -0
  410. package/dist/destinations/tiktok-offline-conversions-sandbox/index.js.map +1 -0
  411. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/generated-types.d.ts +33 -0
  412. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/generated-types.js +3 -0
  413. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/generated-types.js.map +1 -0
  414. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.d.ts +5 -0
  415. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js +16 -0
  416. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js.map +1 -0
  417. package/dist/destinations/tiktok-offline-conversions-sandbox/trackNonPaymentOfflineConversion/generated-types.d.ts +33 -0
  418. package/dist/destinations/tiktok-offline-conversions-sandbox/trackNonPaymentOfflineConversion/generated-types.js +3 -0
  419. package/dist/destinations/tiktok-offline-conversions-sandbox/trackNonPaymentOfflineConversion/generated-types.js.map +1 -0
  420. package/dist/destinations/tiktok-offline-conversions-sandbox/trackNonPaymentOfflineConversion/index.d.ts +5 -0
  421. package/dist/destinations/tiktok-offline-conversions-sandbox/trackNonPaymentOfflineConversion/index.js +16 -0
  422. package/dist/destinations/tiktok-offline-conversions-sandbox/trackNonPaymentOfflineConversion/index.js.map +1 -0
  423. package/dist/destinations/tiktok-offline-conversions-sandbox/trackPaymentOfflineConversion/generated-types.d.ts +33 -0
  424. package/dist/destinations/tiktok-offline-conversions-sandbox/trackPaymentOfflineConversion/generated-types.js +3 -0
  425. package/dist/destinations/tiktok-offline-conversions-sandbox/trackPaymentOfflineConversion/generated-types.js.map +1 -0
  426. package/dist/destinations/tiktok-offline-conversions-sandbox/trackPaymentOfflineConversion/index.d.ts +5 -0
  427. package/dist/destinations/tiktok-offline-conversions-sandbox/trackPaymentOfflineConversion/index.js +16 -0
  428. package/dist/destinations/tiktok-offline-conversions-sandbox/trackPaymentOfflineConversion/index.js.map +1 -0
  429. package/dist/destinations/tiktok-offline-conversions-sandbox/utils.d.ts +8 -0
  430. package/dist/destinations/tiktok-offline-conversions-sandbox/utils.js +68 -0
  431. package/dist/destinations/tiktok-offline-conversions-sandbox/utils.js.map +1 -0
  432. package/dist/destinations/trackey/group.types.d.ts +11 -0
  433. package/dist/destinations/trackey/group.types.js +3 -0
  434. package/dist/destinations/trackey/group.types.js.map +1 -0
  435. package/dist/destinations/trackey/identify.types.d.ts +11 -0
  436. package/dist/destinations/trackey/identify.types.js +3 -0
  437. package/dist/destinations/trackey/identify.types.js.map +1 -0
  438. package/dist/destinations/trackey/track.types.d.ts +12 -0
  439. package/dist/destinations/trackey/track.types.js +3 -0
  440. package/dist/destinations/trackey/track.types.js.map +1 -0
  441. package/dist/destinations/webhook-audiences/index.js +1 -3
  442. package/dist/destinations/webhook-audiences/index.js.map +1 -1
  443. package/dist/destinations/yahoo-audiences/index.js +9 -1
  444. package/dist/destinations/yahoo-audiences/index.js.map +1 -1
  445. package/dist/destinations/yahoo-audiences/updateSegment/generated-types.d.ts +6 -2
  446. package/dist/destinations/yahoo-audiences/updateSegment/index.js +36 -11
  447. package/dist/destinations/yahoo-audiences/updateSegment/index.js.map +1 -1
  448. package/dist/destinations/yahoo-audiences/utils-rt.js +3 -3
  449. package/dist/destinations/yahoo-audiences/utils-rt.js.map +1 -1
  450. package/package.json +3 -3
  451. package/dist/destinations/mixpanel/utils.d.ts +0 -13
  452. package/dist/destinations/mixpanel/utils.js +0 -117
  453. package/dist/destinations/mixpanel/utils.js.map +0 -1
  454. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.d.ts +0 -14
  455. package/dist/destinations/responsys/asyncMergePetRecords/generated-types.js.map +0 -1
  456. package/dist/destinations/responsys/asyncMergePetRecords/index.js +0 -113
  457. package/dist/destinations/responsys/asyncMergePetRecords/index.js.map +0 -1
  458. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.d.ts +0 -20
  459. package/dist/destinations/responsys/asyncMergeProfileListMembers/generated-types.js.map +0 -1
  460. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js +0 -174
  461. package/dist/destinations/responsys/asyncMergeProfileListMembers/index.js.map +0 -1
  462. package/dist/destinations/responsys/rsp-operations.d.ts +0 -14
  463. package/dist/destinations/responsys/rsp-operations.js +0 -33
  464. package/dist/destinations/responsys/rsp-operations.js.map +0 -1
  465. package/dist/destinations/responsys/rsp-properties.js.map +0 -1
  466. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +0 -1
  467. package/dist/destinations/{responsys/asyncMergePetRecords → aggregations-io}/generated-types.js +0 -0
  468. package/dist/destinations/{responsys/asyncMergeProfileListMembers → aggregations-io/send}/generated-types.js +0 -0
  469. package/dist/destinations/{responsys/asyncMergePetRecords → aggregations-io/send}/index.d.ts +0 -0
  470. package/dist/destinations/{responsys/asyncMergeProfileListMembers → courier/postToCourier}/index.d.ts +0 -0
  471. package/dist/destinations/{tiktok-offline-conversions/reportOfflineEvent → tiktok-conversions-sandbox}/formatter.d.ts +1 -1
@@ -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,40 @@
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 createContact_1 = __importDefault(require("./createContact"));
7
+ const triggerSurvey_1 = __importDefault(require("./triggerSurvey"));
8
+ const destination = {
9
+ name: 'Surveysparrow',
10
+ slug: 'actions-surveysparrow',
11
+ mode: 'cloud',
12
+ description: 'Trigger Surveys and Create Contacts in SurveySparrow',
13
+ authentication: {
14
+ scheme: 'custom',
15
+ fields: {
16
+ apiToken: {
17
+ label: 'Access Token',
18
+ description: 'SurveySparrow Access Token can be found in Settings > Apps and Integrations > Create a Custom app',
19
+ type: 'password',
20
+ required: true
21
+ }
22
+ },
23
+ testAuthentication: (request) => {
24
+ return request(`https://api.surveysparrow.com/v3/users`, {
25
+ method: 'get'
26
+ });
27
+ }
28
+ },
29
+ extendRequest({ settings }) {
30
+ return {
31
+ headers: { Authorization: `Bearer ${settings.apiToken}` }
32
+ };
33
+ },
34
+ actions: {
35
+ createContact: createContact_1.default,
36
+ triggerSurvey: triggerSurvey_1.default
37
+ }
38
+ };
39
+ exports.default = destination;
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/surveysparrow/index.ts"],"names":[],"mappings":";;;;;AAGA,oEAA2C;AAE3C,oEAA2C;AAE3C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,sDAAsD;IAEnE,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,KAAK,EAAE,cAAc;gBACrB,WAAW,EACT,mGAAmG;gBACrG,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,wCAAwC,EAAE;gBACvD,MAAM,EAAE,KAAK;aACd,CAAC,CAAA;QACJ,CAAC;KACF;IACD,aAAa,CAAC,EAAE,QAAQ,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,CAAC,QAAQ,EAAE,EAAE;SAC1D,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ id: number;
3
+ share_type: string;
4
+ survey_id: number;
5
+ mobile?: string;
6
+ email?: string;
7
+ variables?: {
8
+ [k: string]: unknown;
9
+ };
10
+ }
@@ -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/surveysparrow/triggerSurvey/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import { DynamicFieldResponse } from '@segment/actions-core';
5
+ import { RequestClient } from '@segment/actions-core';
6
+ export declare function getSurveys(request: RequestClient): Promise<DynamicFieldResponse>;
7
+ declare const action: ActionDefinition<Settings, Payload>;
8
+ export default action;
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSurveys = void 0;
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ async function getSurveys(request) {
6
+ const choices = [];
7
+ try {
8
+ let has_next_page = false;
9
+ let page = 1;
10
+ do {
11
+ const response = await request(`https://api.surveysparrow.com/v3/surveys?page=${page}`, {
12
+ method: 'get'
13
+ });
14
+ const data = JSON.parse(response.content);
15
+ const surveys = data.data;
16
+ for (const survey of surveys) {
17
+ choices.push({
18
+ label: `${survey.name}`,
19
+ value: survey.id
20
+ });
21
+ }
22
+ page++;
23
+ has_next_page = data.has_next_page;
24
+ } while (has_next_page);
25
+ }
26
+ catch (err) {
27
+ return getError(err);
28
+ }
29
+ return {
30
+ choices
31
+ };
32
+ }
33
+ exports.getSurveys = getSurveys;
34
+ async function getError(err) {
35
+ const errResponse = err?.response;
36
+ const errorBody = await errResponse.json();
37
+ return {
38
+ choices: [],
39
+ error: {
40
+ message: errorBody?.meta?.error?.errorMessage ?? 'Unknown Error',
41
+ code: errResponse?.status.toString() ?? '500'
42
+ }
43
+ };
44
+ }
45
+ const action = {
46
+ title: 'Trigger Survey in SurveySparrow',
47
+ defaultSubscription: 'type=track and event="Trigger Survey"',
48
+ description: 'This Action will trigger a SurveySparrow survey to a user via Email, SMS or WhatsApp. The [Survey](https://support.surveysparrow.com/hc/en-us/articles/7079412445213-How-to-create-surveys-using-SurveySparrow) and required Share [Channel](https://support.surveysparrow.com/hc/en-us/articles/7078359450269-How-to-share-surveys-across-different-channels) should be created in SurveySparrow.',
49
+ fields: {
50
+ id: {
51
+ label: 'Channel ID',
52
+ type: 'number',
53
+ required: true,
54
+ description: 'Channel ID is the unique identifier for the Share Channel in SurveySparrow. This can be copied from the URL.',
55
+ default: {
56
+ '@path': '$.properties.channel_id'
57
+ }
58
+ },
59
+ share_type: {
60
+ label: 'Share Type',
61
+ type: 'string',
62
+ required: true,
63
+ description: 'Type of Survey Share to be triggered',
64
+ choices: [
65
+ {
66
+ label: 'Email',
67
+ value: 'Email'
68
+ },
69
+ {
70
+ label: 'SMS',
71
+ value: 'SMS'
72
+ },
73
+ {
74
+ label: 'WhatsApp',
75
+ value: 'WhatsApp'
76
+ }
77
+ ],
78
+ default: {
79
+ '@path': '$.properties.share_type'
80
+ }
81
+ },
82
+ survey_id: {
83
+ label: 'Survey',
84
+ type: 'number',
85
+ required: true,
86
+ description: 'Select the SurveySparrow Survey you want to trigger',
87
+ dynamic: true,
88
+ default: {
89
+ '@path': '$.properties.survey_id'
90
+ }
91
+ },
92
+ mobile: {
93
+ label: 'Mobile',
94
+ type: 'string',
95
+ description: 'Mobile number to send Survey to for either SMS or WhatsApp. This should include + followed by Country Code. For Example, +18004810410. Mobile is required for SMS or WhatsApp Shares',
96
+ default: {
97
+ '@if': {
98
+ exists: { '@path': '$.properties.mobile' },
99
+ then: { '@path': '$.properties.mobile' },
100
+ else: { '@path': '$.context.traits.mobile' }
101
+ }
102
+ }
103
+ },
104
+ email: {
105
+ label: 'Email',
106
+ type: 'string',
107
+ format: 'email',
108
+ description: 'Email address to send Survey to. This is required for an Email Share.',
109
+ default: {
110
+ '@if': {
111
+ exists: { '@path': '$.properties.email' },
112
+ then: { '@path': '$.properties.email' },
113
+ else: { '@path': '$.context.traits.email' }
114
+ }
115
+ }
116
+ },
117
+ variables: {
118
+ label: 'Variables',
119
+ type: 'object',
120
+ defaultObjectUI: 'keyvalue',
121
+ description: 'Variables you want to pass to SurveySparrow.',
122
+ default: {
123
+ '@path': '$.properties.variables'
124
+ }
125
+ }
126
+ },
127
+ dynamicFields: {
128
+ survey_id: getSurveys
129
+ },
130
+ perform: (request, data) => {
131
+ switch (data.payload.share_type) {
132
+ case 'Email': {
133
+ if (!data.payload.email) {
134
+ throw new actions_core_1.PayloadValidationError('Email is a Required Field Email Shares');
135
+ }
136
+ else
137
+ break;
138
+ }
139
+ case 'SMS':
140
+ case 'WhatsApp': {
141
+ if (!data.payload.mobile) {
142
+ throw new actions_core_1.PayloadValidationError(`Mobile is a Required Field for ${data.payload.share_type} Shares`);
143
+ }
144
+ else
145
+ break;
146
+ }
147
+ }
148
+ const payload = {
149
+ survey_id: data.payload.survey_id,
150
+ contacts: [
151
+ {
152
+ email: data.payload.email,
153
+ mobile: data.payload.mobile
154
+ }
155
+ ],
156
+ variables: data.payload.variables
157
+ };
158
+ return request(`https://api.surveysparrow.com/v3/channels/${data.payload.id}`, {
159
+ method: 'put',
160
+ json: payload
161
+ });
162
+ }
163
+ };
164
+ exports.default = action;
165
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/surveysparrow/triggerSurvey/index.ts"],"names":[],"mappings":";;;AAIA,wDAA6E;AAGtE,KAAK,UAAU,UAAU,CAAC,OAAsB;IACrD,MAAM,OAAO,GAAuB,EAAE,CA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AO;SACd,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,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.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A+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"],"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