@segment/action-destinations 3.188.0 → 3.189.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 (343) hide show
  1. package/dist/destinations/app-fit/index.js +2 -2
  2. package/dist/destinations/app-fit/index.js.map +1 -1
  3. package/dist/destinations/app-fit/track/index.js +1 -1
  4. package/dist/destinations/app-fit/track/index.js.map +1 -1
  5. package/dist/destinations/attio/index.js +1 -1
  6. package/dist/destinations/attio/index.js.map +1 -1
  7. package/dist/destinations/{engage-messaging-twilio/utils/types.js → engage/sendgrid/Profile.js} +1 -1
  8. package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
  9. package/dist/destinations/engage/sendgrid/destinationDefinition.d.ts +3 -0
  10. package/dist/destinations/engage/sendgrid/destinationDefinition.js +70 -0
  11. package/dist/destinations/engage/sendgrid/destinationDefinition.js.map +1 -0
  12. package/dist/destinations/engage/sendgrid/generated-types.d.ts +1 -0
  13. package/dist/destinations/engage/sendgrid/generated-types.js +14 -0
  14. package/dist/destinations/engage/sendgrid/generated-types.js.map +1 -0
  15. package/dist/destinations/engage/sendgrid/index.d.ts +2 -0
  16. package/dist/destinations/engage/sendgrid/index.js +5 -0
  17. package/dist/destinations/engage/sendgrid/index.js.map +1 -0
  18. package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup/index.d.ts → engage/sendgrid/previewApiLookup/actionDefinition.d.ts} +1 -2
  19. package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup/index.js → engage/sendgrid/previewApiLookup/actionDefinition.js} +4 -4
  20. package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +1 -0
  21. package/dist/destinations/{engage-messaging-sendgrid/utils → engage/sendgrid/previewApiLookup}/api-lookups.d.ts +2 -4
  22. package/dist/destinations/{engage-messaging-sendgrid/utils → engage/sendgrid/previewApiLookup}/api-lookups.js +1 -15
  23. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
  24. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.d.ts +1 -0
  25. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js +14 -0
  26. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js.map +1 -0
  27. package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +2 -0
  28. package/dist/destinations/{engage-messaging-twilio/utils → engage/sendgrid/previewApiLookup}/index.js +2 -6
  29. package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +1 -0
  30. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +42 -0
  31. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +318 -0
  32. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
  33. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.d.ts +12 -0
  34. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js +3 -0
  35. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
  36. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.d.ts +4 -0
  37. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +236 -0
  38. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +1 -0
  39. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.d.ts +1 -0
  40. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js +14 -0
  41. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js.map +1 -0
  42. package/dist/destinations/engage/sendgrid/sendEmail/index.d.ts +1 -0
  43. package/dist/destinations/engage/sendgrid/sendEmail/index.js +14 -0
  44. package/dist/destinations/engage/sendgrid/sendEmail/index.js.map +1 -0
  45. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.d.ts +1 -0
  46. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js +23 -0
  47. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
  48. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.d.ts +1 -0
  49. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js +14 -0
  50. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
  51. package/dist/destinations/engage/twilio/destinationDefinition.d.ts +3 -0
  52. package/dist/destinations/engage/twilio/destinationDefinition.js +172 -0
  53. package/dist/destinations/engage/twilio/destinationDefinition.js.map +1 -0
  54. package/dist/destinations/engage/twilio/generated-types.d.ts +1 -0
  55. package/dist/destinations/engage/twilio/generated-types.js +14 -0
  56. package/dist/destinations/engage/twilio/generated-types.js.map +1 -0
  57. package/dist/destinations/engage/twilio/index.d.ts +2 -0
  58. package/dist/destinations/engage/twilio/index.js +5 -0
  59. package/dist/destinations/engage/twilio/index.js.map +1 -0
  60. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +27 -0
  61. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +142 -0
  62. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -0
  63. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.d.ts +4 -0
  64. package/dist/destinations/{engage-messaging-twilio/sendMobilePush/index.js → engage/twilio/sendMobilePush/actionDefinition.js} +5 -5
  65. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -0
  66. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.d.ts +1 -0
  67. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js +14 -0
  68. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js.map +1 -0
  69. package/dist/destinations/engage/twilio/sendMobilePush/index.d.ts +1 -0
  70. package/dist/destinations/engage/twilio/sendMobilePush/index.js +14 -0
  71. package/dist/destinations/engage/twilio/sendMobilePush/index.js.map +1 -0
  72. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.d.ts +9 -0
  73. package/dist/destinations/{engage-messaging-twilio/sendSms/sms-sender.js → engage/twilio/sendSms/SmsMessageSender.js} +5 -32
  74. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -0
  75. package/dist/destinations/engage/twilio/sendSms/actionDefinition.d.ts +4 -0
  76. package/dist/destinations/{engage-messaging-twilio/sendSms/index.js → engage/twilio/sendSms/actionDefinition.js} +5 -5
  77. package/dist/destinations/engage/twilio/sendSms/actionDefinition.js.map +1 -0
  78. package/dist/destinations/engage/twilio/sendSms/generated-types.d.ts +1 -0
  79. package/dist/destinations/engage/twilio/sendSms/generated-types.js +14 -0
  80. package/dist/destinations/engage/twilio/sendSms/generated-types.js.map +1 -0
  81. package/dist/destinations/engage/twilio/sendSms/index.d.ts +1 -0
  82. package/dist/destinations/engage/twilio/sendSms/index.js +14 -0
  83. package/dist/destinations/engage/twilio/sendSms/index.js.map +1 -0
  84. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +8 -0
  85. package/dist/destinations/{engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js → engage/twilio/sendWhatsApp/WhatsAppMessageSender.js} +8 -4
  86. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
  87. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.d.ts +4 -0
  88. package/dist/destinations/{engage-messaging-twilio/sendWhatsApp/index.js → engage/twilio/sendWhatsApp/actionDefinition.js} +5 -5
  89. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js.map +1 -0
  90. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.d.ts +1 -0
  91. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js +14 -0
  92. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js.map +1 -0
  93. package/dist/destinations/engage/twilio/sendWhatsApp/index.d.ts +1 -0
  94. package/dist/destinations/engage/twilio/sendWhatsApp/index.js +14 -0
  95. package/dist/destinations/engage/twilio/sendWhatsApp/index.js.map +1 -0
  96. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.d.ts +16 -0
  97. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +57 -0
  98. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -0
  99. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.d.ts +16 -0
  100. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +109 -0
  101. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -0
  102. package/dist/destinations/engage/twilio/utils/index.d.ts +2 -0
  103. package/dist/destinations/engage/twilio/utils/index.js +15 -0
  104. package/dist/destinations/engage/twilio/utils/index.js.map +1 -0
  105. package/dist/destinations/{engage-messaging-twilio → engage/twilio}/utils/types.d.ts +0 -16
  106. package/dist/destinations/engage/twilio/utils/types.js.map +1 -0
  107. package/dist/destinations/engage/utils/AggregateError.d.ts +14 -0
  108. package/dist/destinations/engage/utils/AggregateError.js +26 -0
  109. package/dist/destinations/engage/utils/AggregateError.js.map +1 -0
  110. package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +41 -0
  111. package/dist/destinations/engage/utils/EngageActionPerformer.js +135 -0
  112. package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -0
  113. package/dist/destinations/{engage-messaging-twilio/utils/MessageLogger.d.ts → engage/utils/EngageLogger.d.ts} +8 -5
  114. package/dist/destinations/engage/utils/EngageLogger.js +52 -0
  115. package/dist/destinations/engage/utils/EngageLogger.js.map +1 -0
  116. package/dist/destinations/engage/utils/EngageStats.d.ts +18 -0
  117. package/dist/destinations/{engage-messaging-twilio/utils/MessageStats.js → engage/utils/EngageStats.js} +28 -14
  118. package/dist/destinations/engage/utils/EngageStats.js.map +1 -0
  119. package/dist/destinations/{engage-messaging-twilio → engage}/utils/IntegrationErrorWrapper.d.ts +2 -2
  120. package/dist/destinations/{engage-messaging-twilio → engage}/utils/IntegrationErrorWrapper.js +1 -1
  121. package/dist/destinations/engage/utils/IntegrationErrorWrapper.js.map +1 -0
  122. package/dist/destinations/engage/utils/MessageSendPerformer.d.ts +63 -0
  123. package/dist/destinations/engage/utils/MessageSendPerformer.js +191 -0
  124. package/dist/destinations/engage/utils/MessageSendPerformer.js.map +1 -0
  125. package/dist/destinations/engage/utils/ResponseError.d.ts +20 -0
  126. package/dist/destinations/engage/utils/ResponseError.js +17 -0
  127. package/dist/destinations/engage/utils/ResponseError.js.map +1 -0
  128. package/dist/destinations/engage/utils/getProfileApiEndpoint.d.ts +2 -0
  129. package/dist/destinations/engage/utils/getProfileApiEndpoint.js +10 -0
  130. package/dist/destinations/engage/utils/getProfileApiEndpoint.js.map +1 -0
  131. package/dist/destinations/engage/utils/index.d.ts +9 -0
  132. package/dist/destinations/engage/utils/index.js +22 -0
  133. package/dist/destinations/engage/utils/index.js.map +1 -0
  134. package/dist/destinations/engage/utils/isDestinationActionService.js.map +1 -0
  135. package/dist/destinations/engage/utils/isRetryableError.d.ts +2 -0
  136. package/dist/destinations/engage/utils/isRetryableError.js +33 -0
  137. package/dist/destinations/engage/utils/isRetryableError.js.map +1 -0
  138. package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js.map +1 -0
  139. package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js.map +1 -0
  140. package/dist/destinations/engage/utils/operationTracking/OperationDuration.js.map +1 -0
  141. package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js.map +1 -0
  142. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationFinallyHooks.d.ts +4 -0
  143. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationFinallyHooks.js +2 -0
  144. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -0
  145. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationLogger.d.ts +2 -1
  146. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationLogger.js +22 -25
  147. package/dist/destinations/engage/utils/operationTracking/OperationLogger.js.map +1 -0
  148. package/dist/destinations/engage/utils/operationTracking/OperationStats.js.map +1 -0
  149. package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js.map +1 -0
  150. package/dist/destinations/engage/utils/operationTracking/OperationTree.js.map +1 -0
  151. package/dist/destinations/engage/utils/operationTracking/TrackedError.js.map +1 -0
  152. package/dist/destinations/engage/utils/operationTracking/index.js.map +1 -0
  153. package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js.map +1 -0
  154. package/dist/destinations/engage/utils/testUtils.d.ts +6 -0
  155. package/dist/destinations/engage/utils/testUtils.js +26 -0
  156. package/dist/destinations/engage/utils/testUtils.js.map +1 -0
  157. package/dist/destinations/engage/utils/track.d.ts +52 -0
  158. package/dist/destinations/engage/utils/track.js +9 -0
  159. package/dist/destinations/engage/utils/track.js.map +1 -0
  160. package/dist/destinations/engage-messaging-sendgrid/index.d.ts +2 -3
  161. package/dist/destinations/engage-messaging-sendgrid/index.js +13 -67
  162. package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
  163. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js +3 -0
  164. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js.map +1 -0
  165. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js +3 -0
  166. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +1 -0
  167. package/dist/destinations/engage-messaging-twilio/index.d.ts +2 -3
  168. package/dist/destinations/engage-messaging-twilio/index.js +13 -169
  169. package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
  170. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js +3 -0
  171. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js.map +1 -0
  172. package/dist/destinations/engage-messaging-twilio/sendSms.types.js +3 -0
  173. package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +1 -0
  174. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js +3 -0
  175. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js.map +1 -0
  176. package/dist/destinations/hilo/generated-types.d.ts +3 -0
  177. package/dist/destinations/hilo/generated-types.js.map +1 -0
  178. package/dist/destinations/hilo/group/generated-types.d.ts +9 -0
  179. package/dist/destinations/hilo/group/generated-types.js.map +1 -0
  180. package/dist/destinations/hilo/group/index.js +59 -0
  181. package/dist/destinations/hilo/group/index.js.map +1 -0
  182. package/dist/destinations/hilo/identify/generated-types.d.ts +8 -0
  183. package/dist/destinations/hilo/identify/generated-types.js.map +1 -0
  184. package/dist/destinations/hilo/identify/index.js +51 -0
  185. package/dist/destinations/hilo/identify/index.js.map +1 -0
  186. package/dist/destinations/hilo/index.d.ts +4 -0
  187. package/dist/destinations/hilo/index.js +103 -0
  188. package/dist/destinations/hilo/index.js.map +1 -0
  189. package/dist/destinations/hilo/page/generated-types.d.ts +9 -0
  190. package/dist/destinations/hilo/page/generated-types.js.map +1 -0
  191. package/dist/destinations/{engage-messaging-sendgrid/sendEmail → hilo/page}/index.d.ts +1 -1
  192. package/dist/destinations/hilo/page/index.js +59 -0
  193. package/dist/destinations/hilo/page/index.js.map +1 -0
  194. package/dist/destinations/hilo/screen/generated-types.d.ts +9 -0
  195. package/dist/destinations/hilo/screen/generated-types.js.map +1 -0
  196. package/dist/destinations/{engage-messaging-twilio/sendMobilePush → hilo/screen}/index.d.ts +1 -1
  197. package/dist/destinations/hilo/screen/index.js +59 -0
  198. package/dist/destinations/hilo/screen/index.js.map +1 -0
  199. package/dist/destinations/hilo/track/generated-types.d.ts +9 -0
  200. package/dist/destinations/hilo/track/generated-types.js +3 -0
  201. package/dist/destinations/hilo/track/generated-types.js.map +1 -0
  202. package/dist/destinations/hilo/track/index.d.ts +5 -0
  203. package/dist/destinations/hilo/track/index.js +59 -0
  204. package/dist/destinations/hilo/track/index.js.map +1 -0
  205. package/dist/destinations/hubspot/api/index.d.ts +11 -5
  206. package/dist/destinations/hubspot/api/index.js +59 -24
  207. package/dist/destinations/hubspot/api/index.js.map +1 -1
  208. package/dist/destinations/hubspot/errors.d.ts +2 -0
  209. package/dist/destinations/hubspot/errors.js +3 -1
  210. package/dist/destinations/hubspot/errors.js.map +1 -1
  211. package/dist/destinations/hubspot/upsertCompany/index.js +1 -1
  212. package/dist/destinations/hubspot/upsertCompany/index.js.map +1 -1
  213. package/dist/destinations/hubspot/upsertCustomObjectRecord/generated-types.d.ts +5 -0
  214. package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +113 -22
  215. package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
  216. package/dist/destinations/hubspot/utils.d.ts +23 -0
  217. package/dist/destinations/hubspot/utils.js +7 -1
  218. package/dist/destinations/hubspot/utils.js.map +1 -1
  219. package/dist/destinations/index.js +5 -2
  220. package/dist/destinations/index.js.map +1 -1
  221. package/dist/destinations/iterable/generated-types.d.ts +1 -0
  222. package/dist/destinations/iterable/index.js +20 -1
  223. package/dist/destinations/iterable/index.js.map +1 -1
  224. package/dist/destinations/iterable/index.test.d.ts +1 -0
  225. package/dist/destinations/iterable/index.test.js +46 -0
  226. package/dist/destinations/iterable/index.test.js.map +1 -0
  227. package/dist/destinations/iterable/shared-fields.d.ts +1 -0
  228. package/dist/destinations/iterable/trackEvent/index.js +3 -2
  229. package/dist/destinations/iterable/trackEvent/index.js.map +1 -1
  230. package/dist/destinations/iterable/trackPurchase/index.js +3 -2
  231. package/dist/destinations/iterable/trackPurchase/index.js.map +1 -1
  232. package/dist/destinations/iterable/updateCart/index.js +3 -2
  233. package/dist/destinations/iterable/updateCart/index.js.map +1 -1
  234. package/dist/destinations/iterable/updateUser/index.js +3 -2
  235. package/dist/destinations/iterable/updateUser/index.js.map +1 -1
  236. package/dist/destinations/iterable/utils.d.ts +9 -1
  237. package/dist/destinations/iterable/utils.js +18 -1
  238. package/dist/destinations/iterable/utils.js.map +1 -1
  239. package/dist/destinations/rehook/generated-types.d.ts +4 -0
  240. package/dist/destinations/rehook/generated-types.js +3 -0
  241. package/dist/destinations/rehook/generated-types.js.map +1 -0
  242. package/dist/destinations/rehook/identifyUser/generated-types.d.ts +7 -0
  243. package/dist/destinations/rehook/identifyUser/generated-types.js +3 -0
  244. package/dist/destinations/rehook/identifyUser/generated-types.js.map +1 -0
  245. package/dist/destinations/rehook/identifyUser/index.d.ts +5 -0
  246. package/dist/destinations/rehook/identifyUser/index.js +44 -0
  247. package/dist/destinations/rehook/identifyUser/index.js.map +1 -0
  248. package/dist/destinations/rehook/index.d.ts +4 -0
  249. package/dist/destinations/rehook/index.js +47 -0
  250. package/dist/destinations/rehook/index.js.map +1 -0
  251. package/dist/destinations/rehook/trackEvent/generated-types.d.ts +7 -0
  252. package/dist/destinations/rehook/trackEvent/generated-types.js +3 -0
  253. package/dist/destinations/rehook/trackEvent/generated-types.js.map +1 -0
  254. package/dist/destinations/rehook/trackEvent/index.d.ts +5 -0
  255. package/dist/destinations/rehook/trackEvent/index.js +48 -0
  256. package/dist/destinations/rehook/trackEvent/index.js.map +1 -0
  257. package/package.json +2 -2
  258. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.js.map +0 -1
  259. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.js.map +0 -1
  260. package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js.map +0 -1
  261. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +0 -578
  262. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +0 -1
  263. package/dist/destinations/engage-messaging-sendgrid/utils/api-lookups.js.map +0 -1
  264. package/dist/destinations/engage-messaging-sendgrid/utils/types.js.map +0 -1
  265. package/dist/destinations/engage-messaging-twilio/operationTracking/GenericMethodDecorator.js.map +0 -1
  266. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationDecorator.js.map +0 -1
  267. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationDuration.js.map +0 -1
  268. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationErrorHandler.js.map +0 -1
  269. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationFinallyHooks.js.map +0 -1
  270. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationLogger.js.map +0 -1
  271. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationStats.js.map +0 -1
  272. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationTracker.test.js.map +0 -1
  273. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationTree.js.map +0 -1
  274. package/dist/destinations/engage-messaging-twilio/operationTracking/TrackedError.js.map +0 -1
  275. package/dist/destinations/engage-messaging-twilio/operationTracking/index.js.map +0 -1
  276. package/dist/destinations/engage-messaging-twilio/operationTracking/wrapTryCatchFinallyPromisable.js.map +0 -1
  277. package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js.map +0 -1
  278. package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.js.map +0 -1
  279. package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.d.ts +0 -17
  280. package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.js +0 -182
  281. package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.js.map +0 -1
  282. package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js.map +0 -1
  283. package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +0 -1
  284. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +0 -9
  285. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +0 -1
  286. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +0 -1
  287. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +0 -1
  288. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +0 -7
  289. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +0 -1
  290. package/dist/destinations/engage-messaging-twilio/utils/IntegrationErrorWrapper.js.map +0 -1
  291. package/dist/destinations/engage-messaging-twilio/utils/MessageLogger.js +0 -36
  292. package/dist/destinations/engage-messaging-twilio/utils/MessageLogger.js.map +0 -1
  293. package/dist/destinations/engage-messaging-twilio/utils/MessageStats.d.ts +0 -14
  294. package/dist/destinations/engage-messaging-twilio/utils/MessageStats.js.map +0 -1
  295. package/dist/destinations/engage-messaging-twilio/utils/index.d.ts +0 -6
  296. package/dist/destinations/engage-messaging-twilio/utils/index.js.map +0 -1
  297. package/dist/destinations/engage-messaging-twilio/utils/isDestinationActionService.js.map +0 -1
  298. package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +0 -43
  299. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +0 -203
  300. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +0 -1
  301. package/dist/destinations/engage-messaging-twilio/utils/phone-message.d.ts +0 -19
  302. package/dist/destinations/engage-messaging-twilio/utils/phone-message.js +0 -97
  303. package/dist/destinations/engage-messaging-twilio/utils/phone-message.js.map +0 -1
  304. package/dist/destinations/engage-messaging-twilio/utils/track.d.ts +0 -45
  305. package/dist/destinations/engage-messaging-twilio/utils/track.js +0 -9
  306. package/dist/destinations/engage-messaging-twilio/utils/track.js.map +0 -1
  307. package/dist/destinations/engage-messaging-twilio/utils/types.js.map +0 -1
  308. /package/dist/destinations/{engage-messaging-sendgrid/utils/types.d.ts → engage/sendgrid/Profile.d.ts} +0 -0
  309. /package/dist/destinations/{engage-messaging-sendgrid → engage/twilio}/utils/types.js +0 -0
  310. /package/dist/destinations/{engage-messaging-twilio → engage}/utils/isDestinationActionService.d.ts +0 -0
  311. /package/dist/destinations/{engage-messaging-twilio → engage}/utils/isDestinationActionService.js +0 -0
  312. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/GenericMethodDecorator.d.ts +0 -0
  313. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/GenericMethodDecorator.js +0 -0
  314. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDecorator.d.ts +0 -0
  315. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDecorator.js +0 -0
  316. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDuration.d.ts +0 -0
  317. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDuration.js +0 -0
  318. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationErrorHandler.d.ts +0 -0
  319. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationErrorHandler.js +0 -0
  320. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationStats.d.ts +0 -0
  321. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationStats.js +0 -0
  322. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTracker.test.d.ts +0 -0
  323. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTracker.test.js +0 -0
  324. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTree.d.ts +0 -0
  325. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTree.js +0 -0
  326. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/TrackedError.d.ts +0 -0
  327. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/TrackedError.js +0 -0
  328. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/index.d.ts +0 -0
  329. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/index.js +0 -0
  330. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/wrapTryCatchFinallyPromisable.d.ts +0 -0
  331. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/wrapTryCatchFinallyPromisable.js +0 -0
  332. /package/dist/destinations/engage-messaging-sendgrid/{previewApiLookup/generated-types.d.ts → previewApiLookup.types.d.ts} +0 -0
  333. /package/dist/destinations/engage-messaging-sendgrid/{sendEmail/generated-types.d.ts → sendEmail.types.d.ts} +0 -0
  334. /package/dist/destinations/engage-messaging-twilio/{sendMobilePush/generated-types.d.ts → sendMobilePush.types.d.ts} +0 -0
  335. /package/dist/destinations/engage-messaging-twilio/{sendSms/generated-types.d.ts → sendSms.types.d.ts} +0 -0
  336. /package/dist/destinations/engage-messaging-twilio/{sendWhatsApp/generated-types.d.ts → sendWhatsApp.types.d.ts} +0 -0
  337. /package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup → hilo}/generated-types.js +0 -0
  338. /package/dist/destinations/{engage-messaging-sendgrid/sendEmail → hilo/group}/generated-types.js +0 -0
  339. /package/dist/destinations/{engage-messaging-twilio/sendSms → hilo/group}/index.d.ts +0 -0
  340. /package/dist/destinations/{engage-messaging-twilio/sendMobilePush → hilo/identify}/generated-types.js +0 -0
  341. /package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → hilo/identify}/index.d.ts +0 -0
  342. /package/dist/destinations/{engage-messaging-twilio/sendSms → hilo/page}/generated-types.js +0 -0
  343. /package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → hilo/screen}/generated-types.js +0 -0
@@ -1,203 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.MessageSender = void 0;
10
- const liquidjs_1 = require("liquidjs");
11
- const actions_core_1 = require("@segment/actions-core");
12
- const track_1 = require("./track");
13
- const isDestinationActionService_1 = require("./isDestinationActionService");
14
- const MessageLogger_1 = require("./MessageLogger");
15
- const MessageStats_1 = require("./MessageStats");
16
- const IntegrationErrorWrapper_1 = require("./IntegrationErrorWrapper");
17
- const Liquid = new liquidjs_1.Liquid();
18
- class MessageSender {
19
- constructor(requestRaw, executeInput) {
20
- this.requestRaw = requestRaw;
21
- this.executeInput = executeInput;
22
- this.logger = new MessageLogger_1.MessageLogger(this);
23
- this.statsClient = new MessageStats_1.MessageStats(this);
24
- this.payload = executeInput.payload;
25
- this.settings = executeInput.settings;
26
- if (!this.settings.region) {
27
- this.settings.region = 'us-west-1';
28
- }
29
- }
30
- async request(url, options) {
31
- const op = this.currentOperation;
32
- op?.onFinally.push(() => {
33
- const respError = op?.error;
34
- const response = respError?.response || op.result;
35
- const response_code = response?.data?.code || respError?.code;
36
- if (response_code)
37
- op.tags.push(`response_code:${response_code}`);
38
- const response_status = response?.data?.status || respError?.status;
39
- if (response_status)
40
- op.tags.push(`response_status:${response_status}`);
41
- });
42
- return this.requestRaw(url, options);
43
- }
44
- async perform() {
45
- this.beforeSend();
46
- return this.doSend();
47
- }
48
- async parseContent(content, profile) {
49
- const parsedEntries = await Promise.all(Object.entries(content).map(async ([key, val]) => {
50
- if (val == null) {
51
- return [key, val];
52
- }
53
- if (Array.isArray(val)) {
54
- val = await Promise.all(val.map((item) => Liquid.parseAndRender(item, { profile })));
55
- }
56
- else {
57
- val = await Liquid.parseAndRender(val, { profile });
58
- }
59
- return [key, val];
60
- }));
61
- return Object.fromEntries(parsedEntries);
62
- }
63
- redactPii(pii) {
64
- if (!pii) {
65
- return pii;
66
- }
67
- if (pii.length <= 8) {
68
- return '***';
69
- }
70
- return pii.substring(0, 3) + '***' + pii.substring(pii.length - 3);
71
- }
72
- isFeatureActive(featureName, getDefault) {
73
- if (isDestinationActionService_1.isDestinationActionService())
74
- return true;
75
- if (!this.executeInput.features || !(featureName in this.executeInput.features))
76
- return getDefault?.();
77
- return this.executeInput.features[featureName];
78
- }
79
- logInfo(msg, metadata) {
80
- this.logger.logInfo(msg, metadata);
81
- }
82
- logError(msg, metadata) {
83
- this.logger.logError(msg, metadata);
84
- }
85
- logOnError(logMessage) {
86
- const op = this.currentOperation;
87
- op?.onFinally.push(() => {
88
- if (op.error) {
89
- const msg = typeof logMessage === 'function' ? logMessage(op) : logMessage;
90
- op.logs.push(msg);
91
- }
92
- });
93
- }
94
- statsIncr(metric, value, tags) {
95
- this.statsClient.stats({ method: 'incr', metric, value, tags });
96
- }
97
- statsHistogram(metric, value, tags) {
98
- this.statsClient.stats({ method: 'histogram', metric, value, tags });
99
- }
100
- statsSet(metric, value, tags) {
101
- this.statsClient.stats({ method: 'set', metric, value, tags });
102
- }
103
- get logDetails() {
104
- return this.logger.logDetails;
105
- }
106
- get tags() {
107
- return this.statsClient.tags;
108
- }
109
- beforeSend() {
110
- Object.assign(this.logDetails, {
111
- externalIds: this.payload.externalIds?.map((eid) => ({ ...eid, id: this.redactPii(eid.id) })),
112
- shouldSend: this.payload.send,
113
- contentSid: this.payload.contentSid,
114
- sourceId: this.settings.sourceId,
115
- spaceId: this.settings.spaceId,
116
- twilioApiKeySID: this.settings.twilioApiKeySID,
117
- region: this.settings.region,
118
- messageId: this.executeInput['rawData']?.messageId,
119
- channelType: this.getChannelType()
120
- });
121
- if ('userId' in this.payload)
122
- this.logDetails.userId = this.payload.userId;
123
- if ('deliveryAttempt' in this.executeInput['rawData'])
124
- this.currentOperation?.tags.push(`delivery_attempt:${this.executeInput['rawData'].deliveryAttempt}`);
125
- }
126
- async getContentTemplateTypes() {
127
- if (!this.payload.contentSid) {
128
- throw new actions_core_1.PayloadValidationError('Content SID not in payload');
129
- }
130
- const twilioToken = Buffer.from(`${this.settings.twilioApiKeySID}:${this.settings.twilioApiKeySecret}`).toString('base64');
131
- const response = await this.request(`https://content.twilio.com/v1/Content/${this.payload.contentSid}`, {
132
- method: 'GET',
133
- headers: {
134
- authorization: `Basic ${twilioToken}`
135
- }
136
- });
137
- const template = (await response.json());
138
- return this.extractTemplateTypes(template);
139
- }
140
- extractTemplateTypes(template) {
141
- if (!template.types) {
142
- throw new actions_core_1.IntegrationError('Template from Twilio Content API does not contain any template types', `NO_CONTENT_TYPES`, 400);
143
- }
144
- const type = Object.keys(template.types)[0];
145
- if (this.supportedTemplateTypes.includes(type)) {
146
- return { body: template.types[type].body, media: template.types[type].media };
147
- }
148
- else {
149
- throw new actions_core_1.IntegrationError(`Sending templates with '${type}' content type is not supported by ${this.getChannelType()}`, 'UNSUPPORTED_CONTENT_TYPE', 400);
150
- }
151
- }
152
- getWebhookUrlWithParams(externalIdType, externalIdValue, defaultConnectionOverrides = 'rp=all&rc=5') {
153
- const webhookUrl = this.settings.webhookUrl;
154
- const connectionOverrides = this.settings.connectionOverrides;
155
- const customArgs = {
156
- ...this.payload.customArgs,
157
- space_id: this.settings.spaceId,
158
- __segment_internal_external_id_key__: externalIdType,
159
- __segment_internal_external_id_value__: externalIdValue
160
- };
161
- if (webhookUrl && customArgs) {
162
- this.logOnError(() => JSON.stringify(customArgs));
163
- const webhookUrlWithParams = new URL(webhookUrl);
164
- for (const key of Object.keys(customArgs)) {
165
- webhookUrlWithParams.searchParams.append(key, String(customArgs[key]));
166
- }
167
- webhookUrlWithParams.hash = connectionOverrides || defaultConnectionOverrides;
168
- return webhookUrlWithParams.toString();
169
- }
170
- return null;
171
- }
172
- rethrowIntegrationError(error, getWrapper) {
173
- throw IntegrationErrorWrapper_1.IntegrationErrorWrapper.wrap(error, getWrapper, this.currentOperation);
174
- }
175
- }
176
- MessageSender.nonSendableStatuses = ['unsubscribed', 'did not subscribed', 'false'];
177
- MessageSender.sendableStatuses = ['subscribed', 'true'];
178
- __decorate([
179
- track_1.track()
180
- ], MessageSender.prototype, "request", null);
181
- __decorate([
182
- track_1.track()
183
- ], MessageSender.prototype, "perform", null);
184
- __decorate([
185
- track_1.track({
186
- wrapIntegrationError: () => new actions_core_1.PayloadValidationError('Unable to parse templating, invalid liquid')
187
- })
188
- ], MessageSender.prototype, "parseContent", null);
189
- __decorate([
190
- track_1.track({
191
- wrapIntegrationError: () => ['Unable to fetch content template', 'Twilio Content API request failure', 500]
192
- })
193
- ], MessageSender.prototype, "getContentTemplateTypes", null);
194
- __decorate([
195
- track_1.track()
196
- ], MessageSender.prototype, "extractTemplateTypes", null);
197
- __decorate([
198
- track_1.track({
199
- wrapIntegrationError: () => new actions_core_1.PayloadValidationError('Invalid webhook url arguments')
200
- })
201
- ], MessageSender.prototype, "getWebhookUrlWithParams", null);
202
- exports.MessageSender = MessageSender;
203
- //# sourceMappingURL=message-sender.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message-sender.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/message-sender.ts"],"names":[],"mappings":";;;;;;;;;AAEA,uCAA6C;AAI7C,wDAAgG;AAGhG,mCAAiD;AACjD,6EAAyE;AACzE,mDAA+C;AAC/C,iDAA6C;AAC7C,uEAAmE;AAEnE,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AAE7B,MAAsB,aAAa;IAajC,YAAqB,UAAqB,EAAW,YAAoD;QAApF,eAAU,GAAV,UAAU,CAAW;QAAW,iBAAY,GAAZ,YAAY,CAAwC;QAZhG,WAAM,GAAkB,IAAI,6BAAa,CAAC,IAAI,CAAC,CAAA;QAC/C,gBAAW,GAAiB,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAA;QAYzD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAA;QACnC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAA;QACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,WAAW,CAAA;SACnC;IACH,CAAC;IAGD,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,OAAuB;QAChD,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;YAEtB,MAAM,SAAS,GAAG,EAAE,EAAE,KAAuB,CAAA;YAC7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iCD;AAzOH,sCAiPC"}
@@ -1,19 +0,0 @@
1
- import { MessageSender } from './message-sender';
2
- import type { Payload as SmsPayload } from '../sendSms/generated-types';
3
- import type { Payload as WhatsappPayload } from '../sendWhatsApp/generated-types';
4
- export declare enum SendabilityStatus {
5
- NoSenderPhone = "no_sender_phone",
6
- ShouldSend = "should_send",
7
- NotSubscribed = "not_subscribed",
8
- SendDisabled = "send_disabled",
9
- InvalidSubscriptionStatus = "invalid_subscription_status"
10
- }
11
- export declare abstract class PhoneMessage<Payload extends SmsPayload | WhatsappPayload> extends MessageSender<Payload> {
12
- private readonly EXTERNAL_ID_KEY;
13
- private readonly DEFAULT_HOSTNAME;
14
- private readonly DEFAULT_CONNECTION_OVERRIDES;
15
- abstract getBody(phone: string): Promise<URLSearchParams>;
16
- doSend(): Promise<Response | undefined>;
17
- isValidExternalId(externalId: NonNullable<Payload['externalIds']>[number]): boolean;
18
- private getSendabilityPayload;
19
- }
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PhoneMessage = exports.SendabilityStatus = void 0;
4
- const message_sender_1 = require("./message-sender");
5
- const operationTracking_1 = require("../operationTracking");
6
- var SendabilityStatus;
7
- (function (SendabilityStatus) {
8
- SendabilityStatus["NoSenderPhone"] = "no_sender_phone";
9
- SendabilityStatus["ShouldSend"] = "should_send";
10
- SendabilityStatus["NotSubscribed"] = "not_subscribed";
11
- SendabilityStatus["SendDisabled"] = "send_disabled";
12
- SendabilityStatus["InvalidSubscriptionStatus"] = "invalid_subscription_status";
13
- })(SendabilityStatus = exports.SendabilityStatus || (exports.SendabilityStatus = {}));
14
- class PhoneMessage extends message_sender_1.MessageSender {
15
- constructor() {
16
- super(...arguments);
17
- this.EXTERNAL_ID_KEY = 'phone';
18
- this.DEFAULT_HOSTNAME = 'api.twilio.com';
19
- this.DEFAULT_CONNECTION_OVERRIDES = 'rp=all&rc=5';
20
- }
21
- async doSend() {
22
- const { phone, sendabilityStatus } = this.getSendabilityPayload();
23
- this.currentOperation?.tags.push('sendability_status:' + sendabilityStatus);
24
- if (sendabilityStatus !== SendabilityStatus.ShouldSend) {
25
- this.currentOperation?.logs.push(`Not sending message, because sendabilityStatus: ${sendabilityStatus}, phone: ${this.redactPii(phone)}`);
26
- return;
27
- }
28
- else {
29
- this.currentOperation?.logs.push(`Sending message to phone: ${this.redactPii(phone)}`);
30
- }
31
- const op = this.currentOperation;
32
- this.currentOperation?.onFinally.push(() => {
33
- const error = op.error;
34
- if (error)
35
- op.tags.push('not_sent_reason:error_operation_' + operationTracking_1.OperationDecorator.getOperationName(error.trackedContext || op));
36
- });
37
- const body = await this.getBody(phone);
38
- const webhookUrlWithParams = this.getWebhookUrlWithParams(this.EXTERNAL_ID_KEY, phone, this.DEFAULT_CONNECTION_OVERRIDES);
39
- if (webhookUrlWithParams)
40
- body.append('StatusCallback', webhookUrlWithParams);
41
- const twilioHostname = this.settings.twilioHostname ?? this.DEFAULT_HOSTNAME;
42
- const twilioToken = Buffer.from(`${this.settings.twilioApiKeySID}:${this.settings.twilioApiKeySecret}`).toString('base64');
43
- this.statsSet('message_body_size', body?.toString().length);
44
- const response = await this.request(`https://${twilioHostname}/2010-04-01/Accounts/${this.settings.twilioAccountSID}/Messages.json`, {
45
- method: 'POST',
46
- headers: {
47
- authorization: `Basic ${twilioToken}`
48
- },
49
- body
50
- });
51
- if (this.payload.eventOccurredTS != undefined) {
52
- this.statsHistogram('eventDeliveryTS', Date.now() - new Date(this.payload.eventOccurredTS).getTime());
53
- }
54
- this.logDetails['twilio-request-id'] = response.headers?.get('twilio-request-id');
55
- return response;
56
- }
57
- isValidExternalId(externalId) {
58
- return externalId.type === 'phone' && this.getChannelType() === externalId.channelType?.toLowerCase();
59
- }
60
- getSendabilityPayload() {
61
- if (!this.payload.send) {
62
- return { sendabilityStatus: SendabilityStatus.SendDisabled, phone: undefined };
63
- }
64
- const validExtIds = this.payload.externalIds?.filter((extId) => this.isValidExternalId(extId));
65
- const firstSubscribedExtId = validExtIds?.find((extId) => extId.subscriptionStatus &&
66
- message_sender_1.MessageSender.sendableStatuses.includes(extId.subscriptionStatus?.toString()?.toLowerCase()));
67
- const invalidStatuses = validExtIds?.filter((extId) => {
68
- const subStatus = extId.subscriptionStatus?.toString()?.toLowerCase();
69
- if (!subStatus)
70
- return false;
71
- return !(message_sender_1.MessageSender.nonSendableStatuses.includes(subStatus) || message_sender_1.MessageSender.sendableStatuses.includes(subStatus));
72
- });
73
- const hasInvalidStatuses = invalidStatuses && invalidStatuses.length > 0;
74
- if (hasInvalidStatuses) {
75
- this.logInfo(`Invalid subscription statuses found in externalIds: ${invalidStatuses
76
- .map((extId) => extId.subscriptionStatus)
77
- .join(', ')}`);
78
- }
79
- let status = SendabilityStatus.NotSubscribed;
80
- const phone = this.payload.toNumber || firstSubscribedExtId?.id;
81
- if (firstSubscribedExtId) {
82
- status = phone ? SendabilityStatus.ShouldSend : SendabilityStatus.NoSenderPhone;
83
- }
84
- else if (hasInvalidStatuses) {
85
- status = SendabilityStatus.InvalidSubscriptionStatus;
86
- }
87
- else if (validExtIds && validExtIds.length > 0) {
88
- status = SendabilityStatus.NotSubscribed;
89
- }
90
- else {
91
- status = SendabilityStatus.NoSenderPhone;
92
- }
93
- return { sendabilityStatus: status, phone };
94
- }
95
- }
96
- exports.PhoneMessage = PhoneMessage;
97
- //# sourceMappingURL=phone-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"phone-message.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/phone-message.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAGhD,4DAAuE;AAGvE,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,sDAAiC,CAAA;IACjC,+CAA0B,CAAA;IAC1B,qDAAgC,CAAA;IAChC,mDAA8B,CAAA;IAC9B,8EAAyD,CAAA;AAC3D,CAAC,EANW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAM5B;AAID,MAAsB,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AG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,oBAAoB,EAAE,EAAE,CAAA;QAE/D,IAAI,oBAAoB,EAAE;YACxB,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,aAAa,CAAA;SAChF;aAAM,IAAI,kBAAkB,EAAE;YAC7B,MAAM,GAAG,iBAAiB,CAAC,yBAAyB,CAAA;SACrD;aAAM,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAChD,MAAM,GAAG,iBAAiB,CAAC,aAAa,CAAA;SACzC;aAAM;YACL,MAAM,GAAG,iBAAiB,CAAC,aAAa,CAAA;SACzC;QAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;IAC7C,CAAC;CACF;AA/HD,oCA+HC"}
@@ -1,45 +0,0 @@
1
- import { ContextFromDecorator } from '../operationTracking';
2
- export declare const track: ((decoratorArgs?: ({
3
- onError?: ((ctx: import("../operationTracking").OperationErrorHandlerContext<import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
4
- } & import("../operationTracking").OperationLoggerDecoratorArgs & {
5
- shouldStats?: ((args: import("../operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
6
- } & {
7
- wrapIntegrationError?: ((ctx: import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
8
- }) | undefined) => import("../operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
9
- getCurrentOperation(classInstance: any): (import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
10
- parent?: (import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
11
- sharedContext: {};
12
- }) | undefined;
13
- } & {
14
- _contextType: import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
15
- start?: number | undefined;
16
- duration?: number | undefined;
17
- } & {
18
- decoratorArgs?: {
19
- onError?: ((ctx: import("../operationTracking").OperationErrorHandlerContext<import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
20
- } | undefined;
21
- } & {
22
- parent?: (import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
23
- sharedContext: {};
24
- } & {
25
- logs: string[];
26
- logMetadata?: Record<string, unknown> | undefined;
27
- decoratorArgs?: import("../operationTracking").OperationLoggerDecoratorArgs | undefined;
28
- sharedContext: import("../operationTracking").OperationLoggerSharedContext;
29
- } & {
30
- onFinally: (() => void)[];
31
- } & {
32
- tags: string[];
33
- sharedContext: {
34
- tags: string[];
35
- };
36
- decoratorArgs?: {
37
- shouldStats?: ((args: import("../operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
38
- } | undefined;
39
- } & {
40
- decoratorArgs?: {
41
- wrapIntegrationError?: ((ctx: import("../operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
42
- } | undefined;
43
- };
44
- };
45
- export declare type OperationContext = ContextFromDecorator<typeof track>;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.track = void 0;
4
- const operationTracking_1 = require("../operationTracking");
5
- const MessageStats_1 = require("./MessageStats");
6
- const MessageLogger_1 = require("./MessageLogger");
7
- const IntegrationErrorWrapper_1 = require("./IntegrationErrorWrapper");
8
- exports.track = operationTracking_1.OperationDecorator.createDecoratorFactoryWithDefault(MessageLogger_1.MessageLogger, MessageStats_1.MessageStats, IntegrationErrorWrapper_1.IntegrationErrorWrapper);
9
- //# sourceMappingURL=track.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"track.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/track.ts"],"names":[],"mappings":";;;AAEA,4DAA+E;AAC/E,iDAA6C;AAC7C,mDAA+C;AAC/C,uEAAmE;AAEtD,QAAA,KAAK,GAAG,sCAAkB,CAAC,iCAAiC,CACvE,6BAAa,EACb,2BAAY,EACZ,iDAAuB,CACxB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/utils/types.ts"],"names":[],"mappings":""}