@segment/action-destinations 3.187.1-TempPublishBranch.6 → 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 (378) 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/api/index.d.ts +30 -0
  6. package/dist/destinations/attio/api/index.js +28 -0
  7. package/dist/destinations/attio/api/index.js.map +1 -0
  8. package/dist/destinations/attio/assertRecord/generated-types.d.ts +8 -0
  9. package/dist/destinations/attio/assertRecord/generated-types.js.map +1 -0
  10. package/dist/destinations/attio/assertRecord/index.d.ts +6 -0
  11. package/dist/destinations/attio/assertRecord/index.js +84 -0
  12. package/dist/destinations/attio/assertRecord/index.js.map +1 -0
  13. package/dist/destinations/attio/generated-types.d.ts +2 -0
  14. package/dist/destinations/attio/generated-types.js.map +1 -0
  15. package/dist/destinations/attio/groupWorkspace/generated-types.d.ts +10 -0
  16. package/dist/destinations/attio/groupWorkspace/generated-types.js.map +1 -0
  17. package/dist/destinations/attio/groupWorkspace/index.js +82 -0
  18. package/dist/destinations/attio/groupWorkspace/index.js.map +1 -0
  19. package/dist/destinations/attio/identifyUser/generated-types.d.ts +10 -0
  20. package/dist/destinations/attio/identifyUser/generated-types.js.map +1 -0
  21. package/dist/destinations/attio/identifyUser/index.js +74 -0
  22. package/dist/destinations/attio/identifyUser/index.js.map +1 -0
  23. package/dist/destinations/attio/index.d.ts +4 -0
  24. package/dist/destinations/attio/index.js +48 -0
  25. package/dist/destinations/attio/index.js.map +1 -0
  26. package/dist/destinations/{engage-messaging-twilio/utils/types.js → engage/sendgrid/Profile.js} +1 -1
  27. package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
  28. package/dist/destinations/engage/sendgrid/destinationDefinition.d.ts +3 -0
  29. package/dist/destinations/engage/sendgrid/destinationDefinition.js +70 -0
  30. package/dist/destinations/engage/sendgrid/destinationDefinition.js.map +1 -0
  31. package/dist/destinations/engage/sendgrid/generated-types.d.ts +1 -0
  32. package/dist/destinations/engage/sendgrid/generated-types.js +14 -0
  33. package/dist/destinations/engage/sendgrid/generated-types.js.map +1 -0
  34. package/dist/destinations/engage/sendgrid/index.d.ts +2 -0
  35. package/dist/destinations/engage/sendgrid/index.js +5 -0
  36. package/dist/destinations/engage/sendgrid/index.js.map +1 -0
  37. package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup/index.d.ts → engage/sendgrid/previewApiLookup/actionDefinition.d.ts} +1 -2
  38. package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup/index.js → engage/sendgrid/previewApiLookup/actionDefinition.js} +4 -4
  39. package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +1 -0
  40. package/dist/destinations/{engage-messaging-sendgrid/utils → engage/sendgrid/previewApiLookup}/api-lookups.d.ts +2 -4
  41. package/dist/destinations/{engage-messaging-sendgrid/utils → engage/sendgrid/previewApiLookup}/api-lookups.js +1 -15
  42. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
  43. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.d.ts +1 -0
  44. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js +14 -0
  45. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js.map +1 -0
  46. package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +2 -0
  47. package/dist/destinations/{engage-messaging-twilio/utils → engage/sendgrid/previewApiLookup}/index.js +2 -6
  48. package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +1 -0
  49. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +42 -0
  50. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +318 -0
  51. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
  52. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.d.ts +12 -0
  53. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js +3 -0
  54. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
  55. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.d.ts +4 -0
  56. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +236 -0
  57. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +1 -0
  58. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.d.ts +1 -0
  59. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js +14 -0
  60. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js.map +1 -0
  61. package/dist/destinations/engage/sendgrid/sendEmail/index.d.ts +1 -0
  62. package/dist/destinations/engage/sendgrid/sendEmail/index.js +14 -0
  63. package/dist/destinations/engage/sendgrid/sendEmail/index.js.map +1 -0
  64. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.d.ts +1 -0
  65. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js +23 -0
  66. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
  67. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.d.ts +1 -0
  68. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js +14 -0
  69. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
  70. package/dist/destinations/engage/twilio/destinationDefinition.d.ts +3 -0
  71. package/dist/destinations/engage/twilio/destinationDefinition.js +172 -0
  72. package/dist/destinations/engage/twilio/destinationDefinition.js.map +1 -0
  73. package/dist/destinations/engage/twilio/generated-types.d.ts +1 -0
  74. package/dist/destinations/engage/twilio/generated-types.js +14 -0
  75. package/dist/destinations/engage/twilio/generated-types.js.map +1 -0
  76. package/dist/destinations/engage/twilio/index.d.ts +2 -0
  77. package/dist/destinations/engage/twilio/index.js +5 -0
  78. package/dist/destinations/engage/twilio/index.js.map +1 -0
  79. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +27 -0
  80. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +142 -0
  81. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -0
  82. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.d.ts +4 -0
  83. package/dist/destinations/{engage-messaging-twilio/sendMobilePush/index.js → engage/twilio/sendMobilePush/actionDefinition.js} +5 -5
  84. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -0
  85. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.d.ts +1 -0
  86. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js +14 -0
  87. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js.map +1 -0
  88. package/dist/destinations/engage/twilio/sendMobilePush/index.d.ts +1 -0
  89. package/dist/destinations/engage/twilio/sendMobilePush/index.js +14 -0
  90. package/dist/destinations/engage/twilio/sendMobilePush/index.js.map +1 -0
  91. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.d.ts +9 -0
  92. package/dist/destinations/{engage-messaging-twilio/sendSms/sms-sender.js → engage/twilio/sendSms/SmsMessageSender.js} +5 -32
  93. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -0
  94. package/dist/destinations/engage/twilio/sendSms/actionDefinition.d.ts +4 -0
  95. package/dist/destinations/{engage-messaging-twilio/sendSms/index.js → engage/twilio/sendSms/actionDefinition.js} +5 -5
  96. package/dist/destinations/engage/twilio/sendSms/actionDefinition.js.map +1 -0
  97. package/dist/destinations/engage/twilio/sendSms/generated-types.d.ts +1 -0
  98. package/dist/destinations/engage/twilio/sendSms/generated-types.js +14 -0
  99. package/dist/destinations/engage/twilio/sendSms/generated-types.js.map +1 -0
  100. package/dist/destinations/engage/twilio/sendSms/index.d.ts +1 -0
  101. package/dist/destinations/engage/twilio/sendSms/index.js +14 -0
  102. package/dist/destinations/engage/twilio/sendSms/index.js.map +1 -0
  103. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +8 -0
  104. package/dist/destinations/{engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js → engage/twilio/sendWhatsApp/WhatsAppMessageSender.js} +8 -4
  105. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
  106. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.d.ts +4 -0
  107. package/dist/destinations/{engage-messaging-twilio/sendWhatsApp/index.js → engage/twilio/sendWhatsApp/actionDefinition.js} +5 -5
  108. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js.map +1 -0
  109. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.d.ts +1 -0
  110. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js +14 -0
  111. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js.map +1 -0
  112. package/dist/destinations/engage/twilio/sendWhatsApp/index.d.ts +1 -0
  113. package/dist/destinations/engage/twilio/sendWhatsApp/index.js +14 -0
  114. package/dist/destinations/engage/twilio/sendWhatsApp/index.js.map +1 -0
  115. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.d.ts +16 -0
  116. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +57 -0
  117. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -0
  118. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.d.ts +16 -0
  119. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +109 -0
  120. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -0
  121. package/dist/destinations/engage/twilio/utils/index.d.ts +2 -0
  122. package/dist/destinations/engage/twilio/utils/index.js +15 -0
  123. package/dist/destinations/engage/twilio/utils/index.js.map +1 -0
  124. package/dist/destinations/{engage-messaging-twilio → engage/twilio}/utils/types.d.ts +0 -16
  125. package/dist/destinations/engage/twilio/utils/types.js.map +1 -0
  126. package/dist/destinations/engage/utils/AggregateError.d.ts +14 -0
  127. package/dist/destinations/engage/utils/AggregateError.js +26 -0
  128. package/dist/destinations/engage/utils/AggregateError.js.map +1 -0
  129. package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +41 -0
  130. package/dist/destinations/engage/utils/EngageActionPerformer.js +135 -0
  131. package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -0
  132. package/dist/destinations/{engage-messaging-twilio/utils/MessageLogger.d.ts → engage/utils/EngageLogger.d.ts} +8 -5
  133. package/dist/destinations/engage/utils/EngageLogger.js +52 -0
  134. package/dist/destinations/engage/utils/EngageLogger.js.map +1 -0
  135. package/dist/destinations/engage/utils/EngageStats.d.ts +18 -0
  136. package/dist/destinations/{engage-messaging-twilio/utils/MessageStats.js → engage/utils/EngageStats.js} +28 -14
  137. package/dist/destinations/engage/utils/EngageStats.js.map +1 -0
  138. package/dist/destinations/{engage-messaging-twilio → engage}/utils/IntegrationErrorWrapper.d.ts +2 -2
  139. package/dist/destinations/{engage-messaging-twilio → engage}/utils/IntegrationErrorWrapper.js +1 -1
  140. package/dist/destinations/engage/utils/IntegrationErrorWrapper.js.map +1 -0
  141. package/dist/destinations/engage/utils/MessageSendPerformer.d.ts +63 -0
  142. package/dist/destinations/engage/utils/MessageSendPerformer.js +191 -0
  143. package/dist/destinations/engage/utils/MessageSendPerformer.js.map +1 -0
  144. package/dist/destinations/engage/utils/ResponseError.d.ts +20 -0
  145. package/dist/destinations/engage/utils/ResponseError.js +17 -0
  146. package/dist/destinations/engage/utils/ResponseError.js.map +1 -0
  147. package/dist/destinations/engage/utils/getProfileApiEndpoint.d.ts +2 -0
  148. package/dist/destinations/engage/utils/getProfileApiEndpoint.js +10 -0
  149. package/dist/destinations/engage/utils/getProfileApiEndpoint.js.map +1 -0
  150. package/dist/destinations/engage/utils/index.d.ts +9 -0
  151. package/dist/destinations/engage/utils/index.js +22 -0
  152. package/dist/destinations/engage/utils/index.js.map +1 -0
  153. package/dist/destinations/engage/utils/isDestinationActionService.js.map +1 -0
  154. package/dist/destinations/engage/utils/isRetryableError.d.ts +2 -0
  155. package/dist/destinations/engage/utils/isRetryableError.js +33 -0
  156. package/dist/destinations/engage/utils/isRetryableError.js.map +1 -0
  157. package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js.map +1 -0
  158. package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js.map +1 -0
  159. package/dist/destinations/engage/utils/operationTracking/OperationDuration.js.map +1 -0
  160. package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js.map +1 -0
  161. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationFinallyHooks.d.ts +4 -0
  162. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationFinallyHooks.js +2 -0
  163. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -0
  164. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationLogger.d.ts +2 -1
  165. package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationLogger.js +22 -25
  166. package/dist/destinations/engage/utils/operationTracking/OperationLogger.js.map +1 -0
  167. package/dist/destinations/engage/utils/operationTracking/OperationStats.js.map +1 -0
  168. package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js.map +1 -0
  169. package/dist/destinations/engage/utils/operationTracking/OperationTree.js.map +1 -0
  170. package/dist/destinations/engage/utils/operationTracking/TrackedError.js.map +1 -0
  171. package/dist/destinations/engage/utils/operationTracking/index.js.map +1 -0
  172. package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js.map +1 -0
  173. package/dist/destinations/engage/utils/testUtils.d.ts +6 -0
  174. package/dist/destinations/engage/utils/testUtils.js +26 -0
  175. package/dist/destinations/engage/utils/testUtils.js.map +1 -0
  176. package/dist/destinations/engage/utils/track.d.ts +52 -0
  177. package/dist/destinations/engage/utils/track.js +9 -0
  178. package/dist/destinations/engage/utils/track.js.map +1 -0
  179. package/dist/destinations/engage-messaging-sendgrid/index.d.ts +2 -3
  180. package/dist/destinations/engage-messaging-sendgrid/index.js +13 -67
  181. package/dist/destinations/engage-messaging-sendgrid/index.js.map +1 -1
  182. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js +3 -0
  183. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js.map +1 -0
  184. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js +3 -0
  185. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +1 -0
  186. package/dist/destinations/engage-messaging-twilio/index.d.ts +2 -3
  187. package/dist/destinations/engage-messaging-twilio/index.js +13 -169
  188. package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
  189. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js +3 -0
  190. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js.map +1 -0
  191. package/dist/destinations/engage-messaging-twilio/sendSms.types.js +3 -0
  192. package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +1 -0
  193. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js +3 -0
  194. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js.map +1 -0
  195. package/dist/destinations/hilo/generated-types.d.ts +3 -0
  196. package/dist/destinations/hilo/generated-types.js.map +1 -0
  197. package/dist/destinations/hilo/group/generated-types.d.ts +9 -0
  198. package/dist/destinations/hilo/group/generated-types.js +3 -0
  199. package/dist/destinations/hilo/group/generated-types.js.map +1 -0
  200. package/dist/destinations/{engage-messaging-sendgrid/sendEmail → hilo/group}/index.d.ts +1 -1
  201. package/dist/destinations/hilo/group/index.js +59 -0
  202. package/dist/destinations/hilo/group/index.js.map +1 -0
  203. package/dist/destinations/hilo/identify/generated-types.d.ts +8 -0
  204. package/dist/destinations/hilo/identify/generated-types.js +3 -0
  205. package/dist/destinations/hilo/identify/generated-types.js.map +1 -0
  206. package/dist/destinations/{engage-messaging-twilio/sendMobilePush → hilo/identify}/index.d.ts +1 -1
  207. package/dist/destinations/hilo/identify/index.js +51 -0
  208. package/dist/destinations/hilo/identify/index.js.map +1 -0
  209. package/dist/destinations/hilo/index.d.ts +4 -0
  210. package/dist/destinations/hilo/index.js +103 -0
  211. package/dist/destinations/hilo/index.js.map +1 -0
  212. package/dist/destinations/hilo/page/generated-types.d.ts +9 -0
  213. package/dist/destinations/hilo/page/generated-types.js +3 -0
  214. package/dist/destinations/hilo/page/generated-types.js.map +1 -0
  215. package/dist/destinations/hilo/page/index.d.ts +5 -0
  216. package/dist/destinations/hilo/page/index.js +59 -0
  217. package/dist/destinations/hilo/page/index.js.map +1 -0
  218. package/dist/destinations/hilo/screen/generated-types.d.ts +9 -0
  219. package/dist/destinations/hilo/screen/generated-types.js +3 -0
  220. package/dist/destinations/hilo/screen/generated-types.js.map +1 -0
  221. package/dist/destinations/hilo/screen/index.d.ts +5 -0
  222. package/dist/destinations/hilo/screen/index.js +59 -0
  223. package/dist/destinations/hilo/screen/index.js.map +1 -0
  224. package/dist/destinations/hilo/track/generated-types.d.ts +9 -0
  225. package/dist/destinations/hilo/track/generated-types.js +3 -0
  226. package/dist/destinations/hilo/track/generated-types.js.map +1 -0
  227. package/dist/destinations/hilo/track/index.d.ts +5 -0
  228. package/dist/destinations/hilo/track/index.js +59 -0
  229. package/dist/destinations/hilo/track/index.js.map +1 -0
  230. package/dist/destinations/hubspot/api/index.d.ts +11 -5
  231. package/dist/destinations/hubspot/api/index.js +59 -24
  232. package/dist/destinations/hubspot/api/index.js.map +1 -1
  233. package/dist/destinations/hubspot/errors.d.ts +2 -0
  234. package/dist/destinations/hubspot/errors.js +3 -1
  235. package/dist/destinations/hubspot/errors.js.map +1 -1
  236. package/dist/destinations/hubspot/upsertCompany/index.js +1 -1
  237. package/dist/destinations/hubspot/upsertCompany/index.js.map +1 -1
  238. package/dist/destinations/hubspot/upsertCustomObjectRecord/generated-types.d.ts +5 -0
  239. package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +113 -22
  240. package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
  241. package/dist/destinations/hubspot/utils.d.ts +23 -0
  242. package/dist/destinations/hubspot/utils.js +7 -1
  243. package/dist/destinations/hubspot/utils.js.map +1 -1
  244. package/dist/destinations/index.js +5 -2
  245. package/dist/destinations/index.js.map +1 -1
  246. package/dist/destinations/iterable/generated-types.d.ts +1 -0
  247. package/dist/destinations/iterable/index.js +20 -1
  248. package/dist/destinations/iterable/index.js.map +1 -1
  249. package/dist/destinations/iterable/index.test.d.ts +1 -0
  250. package/dist/destinations/iterable/index.test.js +46 -0
  251. package/dist/destinations/iterable/index.test.js.map +1 -0
  252. package/dist/destinations/iterable/shared-fields.d.ts +1 -0
  253. package/dist/destinations/iterable/trackEvent/index.js +3 -2
  254. package/dist/destinations/iterable/trackEvent/index.js.map +1 -1
  255. package/dist/destinations/iterable/trackPurchase/index.js +3 -2
  256. package/dist/destinations/iterable/trackPurchase/index.js.map +1 -1
  257. package/dist/destinations/iterable/updateCart/index.js +3 -2
  258. package/dist/destinations/iterable/updateCart/index.js.map +1 -1
  259. package/dist/destinations/iterable/updateUser/index.js +3 -2
  260. package/dist/destinations/iterable/updateUser/index.js.map +1 -1
  261. package/dist/destinations/iterable/utils.d.ts +9 -1
  262. package/dist/destinations/iterable/utils.js +18 -1
  263. package/dist/destinations/iterable/utils.js.map +1 -1
  264. package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js +1 -1
  265. package/dist/destinations/pinterest-conversions/reportConversionEvent/index.js.map +1 -1
  266. package/dist/destinations/rehook/generated-types.d.ts +4 -0
  267. package/dist/destinations/rehook/generated-types.js +3 -0
  268. package/dist/destinations/rehook/generated-types.js.map +1 -0
  269. package/dist/destinations/rehook/identifyUser/generated-types.d.ts +7 -0
  270. package/dist/destinations/rehook/identifyUser/generated-types.js +3 -0
  271. package/dist/destinations/rehook/identifyUser/generated-types.js.map +1 -0
  272. package/dist/destinations/rehook/identifyUser/index.d.ts +5 -0
  273. package/dist/destinations/rehook/identifyUser/index.js +44 -0
  274. package/dist/destinations/rehook/identifyUser/index.js.map +1 -0
  275. package/dist/destinations/rehook/index.d.ts +4 -0
  276. package/dist/destinations/rehook/index.js +47 -0
  277. package/dist/destinations/rehook/index.js.map +1 -0
  278. package/dist/destinations/rehook/trackEvent/generated-types.d.ts +7 -0
  279. package/dist/destinations/rehook/trackEvent/generated-types.js +3 -0
  280. package/dist/destinations/rehook/trackEvent/generated-types.js.map +1 -0
  281. package/dist/destinations/rehook/trackEvent/index.d.ts +5 -0
  282. package/dist/destinations/rehook/trackEvent/index.js +48 -0
  283. package/dist/destinations/rehook/trackEvent/index.js.map +1 -0
  284. package/dist/destinations/the-trade-desk-crm/functions.js +4 -0
  285. package/dist/destinations/the-trade-desk-crm/functions.js.map +1 -1
  286. package/dist/destinations/the-trade-desk-crm/properties.d.ts +1 -0
  287. package/dist/destinations/the-trade-desk-crm/properties.js +8 -1
  288. package/dist/destinations/the-trade-desk-crm/properties.js.map +1 -1
  289. package/dist/destinations/the-trade-desk-crm/syncAudience/generated-types.d.ts +1 -0
  290. package/dist/destinations/the-trade-desk-crm/syncAudience/index.js +2 -1
  291. package/dist/destinations/the-trade-desk-crm/syncAudience/index.js.map +1 -1
  292. package/package.json +4 -4
  293. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/generated-types.js.map +0 -1
  294. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup/index.js.map +0 -1
  295. package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.js.map +0 -1
  296. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +0 -578
  297. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +0 -1
  298. package/dist/destinations/engage-messaging-sendgrid/utils/api-lookups.js.map +0 -1
  299. package/dist/destinations/engage-messaging-sendgrid/utils/types.js.map +0 -1
  300. package/dist/destinations/engage-messaging-twilio/operationTracking/GenericMethodDecorator.js.map +0 -1
  301. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationDecorator.js.map +0 -1
  302. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationDuration.js.map +0 -1
  303. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationErrorHandler.js.map +0 -1
  304. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationFinallyHooks.js.map +0 -1
  305. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationLogger.js.map +0 -1
  306. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationStats.js.map +0 -1
  307. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationTracker.test.js.map +0 -1
  308. package/dist/destinations/engage-messaging-twilio/operationTracking/OperationTree.js.map +0 -1
  309. package/dist/destinations/engage-messaging-twilio/operationTracking/TrackedError.js.map +0 -1
  310. package/dist/destinations/engage-messaging-twilio/operationTracking/index.js.map +0 -1
  311. package/dist/destinations/engage-messaging-twilio/operationTracking/wrapTryCatchFinallyPromisable.js.map +0 -1
  312. package/dist/destinations/engage-messaging-twilio/sendMobilePush/generated-types.js.map +0 -1
  313. package/dist/destinations/engage-messaging-twilio/sendMobilePush/index.js.map +0 -1
  314. package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.d.ts +0 -17
  315. package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.js +0 -182
  316. package/dist/destinations/engage-messaging-twilio/sendMobilePush/push-sender.js.map +0 -1
  317. package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.js.map +0 -1
  318. package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +0 -1
  319. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +0 -9
  320. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +0 -1
  321. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +0 -1
  322. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +0 -1
  323. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +0 -7
  324. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +0 -1
  325. package/dist/destinations/engage-messaging-twilio/utils/IntegrationErrorWrapper.js.map +0 -1
  326. package/dist/destinations/engage-messaging-twilio/utils/MessageLogger.js +0 -36
  327. package/dist/destinations/engage-messaging-twilio/utils/MessageLogger.js.map +0 -1
  328. package/dist/destinations/engage-messaging-twilio/utils/MessageStats.d.ts +0 -14
  329. package/dist/destinations/engage-messaging-twilio/utils/MessageStats.js.map +0 -1
  330. package/dist/destinations/engage-messaging-twilio/utils/index.d.ts +0 -6
  331. package/dist/destinations/engage-messaging-twilio/utils/index.js.map +0 -1
  332. package/dist/destinations/engage-messaging-twilio/utils/isDestinationActionService.js.map +0 -1
  333. package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +0 -43
  334. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +0 -203
  335. package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +0 -1
  336. package/dist/destinations/engage-messaging-twilio/utils/phone-message.d.ts +0 -19
  337. package/dist/destinations/engage-messaging-twilio/utils/phone-message.js +0 -97
  338. package/dist/destinations/engage-messaging-twilio/utils/phone-message.js.map +0 -1
  339. package/dist/destinations/engage-messaging-twilio/utils/track.d.ts +0 -45
  340. package/dist/destinations/engage-messaging-twilio/utils/track.js +0 -9
  341. package/dist/destinations/engage-messaging-twilio/utils/track.js.map +0 -1
  342. package/dist/destinations/engage-messaging-twilio/utils/types.js.map +0 -1
  343. /package/dist/destinations/{engage-messaging-sendgrid/previewApiLookup → attio/assertRecord}/generated-types.js +0 -0
  344. /package/dist/destinations/{engage-messaging-sendgrid/sendEmail → attio}/generated-types.js +0 -0
  345. /package/dist/destinations/{engage-messaging-twilio/sendMobilePush → attio/groupWorkspace}/generated-types.js +0 -0
  346. /package/dist/destinations/{engage-messaging-twilio/sendSms → attio/groupWorkspace}/index.d.ts +0 -0
  347. /package/dist/destinations/{engage-messaging-twilio/sendSms → attio/identifyUser}/generated-types.js +0 -0
  348. /package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → attio/identifyUser}/index.d.ts +0 -0
  349. /package/dist/destinations/{engage-messaging-sendgrid/utils/types.d.ts → engage/sendgrid/Profile.d.ts} +0 -0
  350. /package/dist/destinations/{engage-messaging-sendgrid → engage/twilio}/utils/types.js +0 -0
  351. /package/dist/destinations/{engage-messaging-twilio → engage}/utils/isDestinationActionService.d.ts +0 -0
  352. /package/dist/destinations/{engage-messaging-twilio → engage}/utils/isDestinationActionService.js +0 -0
  353. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/GenericMethodDecorator.d.ts +0 -0
  354. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/GenericMethodDecorator.js +0 -0
  355. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDecorator.d.ts +0 -0
  356. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDecorator.js +0 -0
  357. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDuration.d.ts +0 -0
  358. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationDuration.js +0 -0
  359. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationErrorHandler.d.ts +0 -0
  360. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationErrorHandler.js +0 -0
  361. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationStats.d.ts +0 -0
  362. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationStats.js +0 -0
  363. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTracker.test.d.ts +0 -0
  364. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTracker.test.js +0 -0
  365. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTree.d.ts +0 -0
  366. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/OperationTree.js +0 -0
  367. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/TrackedError.d.ts +0 -0
  368. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/TrackedError.js +0 -0
  369. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/index.d.ts +0 -0
  370. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/index.js +0 -0
  371. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/wrapTryCatchFinallyPromisable.d.ts +0 -0
  372. /package/dist/destinations/{engage-messaging-twilio → engage/utils}/operationTracking/wrapTryCatchFinallyPromisable.js +0 -0
  373. /package/dist/destinations/engage-messaging-sendgrid/{previewApiLookup/generated-types.d.ts → previewApiLookup.types.d.ts} +0 -0
  374. /package/dist/destinations/engage-messaging-sendgrid/{sendEmail/generated-types.d.ts → sendEmail.types.d.ts} +0 -0
  375. /package/dist/destinations/engage-messaging-twilio/{sendMobilePush/generated-types.d.ts → sendMobilePush.types.d.ts} +0 -0
  376. /package/dist/destinations/engage-messaging-twilio/{sendSms/generated-types.d.ts → sendSms.types.d.ts} +0 -0
  377. /package/dist/destinations/engage-messaging-twilio/{sendWhatsApp/generated-types.d.ts → sendWhatsApp.types.d.ts} +0 -0
  378. /package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → hilo}/generated-types.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionDefinition.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/actionDefinition.ts"],"names":[],"mappings":";;;AAGA,+CAAuE;AAG1D,QAAA,gBAAgB,GAAwC;IACnE,KAAK,EAAE,6BAA6B;IACpC,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE;QACN,GAAG,mCAAqB;QACxB,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE;QACtE,MAAM,WAAW,GAAG,YAAY,EAAE,WAAW,CAAA;QAC7C,MAAM,IAAI,GAAG,YAAY,EAAE,IAAI,IAAI,EAAE,CAAA;QACrC,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAA;QACnD,MAAM,OAAO,GAAY,EAAE,MAAM,EAAE,MAAgC,EAAE,CAAA;QACrE,MAAM,IAAI,GAAG,MAAM,8BAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC3G,OAAO;YACL,IAAI;SACL,CAAA;IACH,CAAC;CACF,CAAA"}
@@ -2,8 +2,8 @@ import { InputField } from '@segment/actions-core';
2
2
  import { RequestClient } from '@segment/actions-core';
3
3
  import { Logger, StatsClient } from '@segment/actions-core/destination-kit';
4
4
  import type { Settings } from '../generated-types';
5
- import { Profile } from './types';
6
- declare type ApiLookupConfig = {
5
+ import { Profile } from '../Profile';
6
+ export declare type ApiLookupConfig = {
7
7
  id?: string | undefined;
8
8
  name: string;
9
9
  url: string;
@@ -14,7 +14,5 @@ declare type ApiLookupConfig = {
14
14
  responseType: string;
15
15
  };
16
16
  export declare const performApiLookup: (request: RequestClient, { id, url, method, body, headers }: ApiLookupConfig, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined) => Promise<unknown>;
17
- export declare const performApiLookups: (request: RequestClient, apiLookups: ApiLookupConfig[] | undefined, profile: Profile, statsClient: StatsClient | undefined, tags: string[], settings: Settings, logger?: Logger | undefined) => Promise<Record<string, unknown>>;
18
17
  export declare const apiLookupActionFields: Record<string, InputField>;
19
18
  export declare const apiLookupLiquidKey = "lookups";
20
- export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookups = exports.performApiLookup = void 0;
3
+ exports.apiLookupLiquidKey = exports.apiLookupActionFields = exports.performApiLookup = void 0;
4
4
  const actions_core_1 = require("@segment/actions-core");
5
5
  const liquidjs_1 = require("liquidjs");
6
6
  const Liquid = new liquidjs_1.Liquid();
@@ -43,20 +43,6 @@ const performApiLookup = async (request, { id, url, method, body, headers }, pro
43
43
  }
44
44
  };
45
45
  exports.performApiLookup = performApiLookup;
46
- const performApiLookups = async (request, apiLookups, profile, statsClient, tags, settings, logger) => {
47
- if (!apiLookups) {
48
- return {};
49
- }
50
- const data = await Promise.all(apiLookups.map(async (apiLookup) => {
51
- const data = await exports.performApiLookup(request, apiLookup, profile, statsClient, tags, settings, logger);
52
- return { name: apiLookup.name, data };
53
- }));
54
- return data.reduce((acc, { name, data }) => {
55
- acc[name] = data;
56
- return acc;
57
- }, {});
58
- };
59
- exports.performApiLookups = performApiLookups;
60
46
  exports.apiLookupActionFields = {
61
47
  id: {
62
48
  label: 'ID',
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-lookups.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/api-lookups.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AAKxD,uCAA6C;AAG7C,MAAM,MAAM,GAAG,IAAI,iBAAQ,EAAE,CAAA;AActB,MAAM,gBAAgB,GAAG,KAAK,EACnC,OAAsB,EACtB,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAmB,EACnD,OAAgB,EAChB,WAAoC,EACpC,IAAc,EACd,QAAkB,EAClB,MAA2B,EAC3B,EAAE;IACF,IAAI,WAAmB,CAAA;IACvB,IAAI,YAAgC,CAAA;IACpC,IAAI;QACF,WAAW,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,OAAO,E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ookup.types';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("../../../engage-messaging-sendgrid/previewApiLookup.types"), exports);
14
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/generated-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4FAAyE"}
@@ -0,0 +1,2 @@
1
+ export * from './actionDefinition';
2
+ export * from './api-lookups';
@@ -10,10 +10,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./message-sender"), exports);
14
- __exportStar(require("./phone-message"), exports);
15
- __exportStar(require("./MessageLogger"), exports);
16
- __exportStar(require("./MessageStats"), exports);
17
- __exportStar(require("./track"), exports);
18
- __exportStar(require("./isDestinationActionService"), exports);
13
+ __exportStar(require("./actionDefinition"), exports);
14
+ __exportStar(require("./api-lookups"), exports);
19
15
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/previewApiLookup/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkC;AAClC,gDAA6B"}
@@ -0,0 +1,42 @@
1
+ import { ExtId, MessageSendPerformer, OperationContext, ResponseError } from '../../utils';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ import { Profile } from '../Profile';
5
+ import { Liquid as LiquidJs } from 'liquidjs';
6
+ import { ApiLookupConfig, apiLookupLiquidKey } from '../previewApiLookup';
7
+ export declare const EXTERNAL_ID_KEY = "email";
8
+ export declare const Liquid: LiquidJs;
9
+ export declare class SendEmailPerformer extends MessageSendPerformer<Settings, Payload> {
10
+ getIntegrationStatsName(): string;
11
+ getChannelType(): string;
12
+ getDefaultSettingsRegion(): string;
13
+ isSupportedExternalId(externalId: ExtId<Payload>): boolean;
14
+ isExternalIdSubscribed(extId: ExtId<Payload>): boolean | undefined;
15
+ getRecepients(): ExtId<Payload>[];
16
+ parseTemplating(content: string, liquidData: {
17
+ profile: Profile;
18
+ [apiLookupLiquidKey]?: Record<string, unknown>;
19
+ }, contentType: string): Promise<any>;
20
+ sendToRecepient(emailProfile: ExtId<Payload>): Promise<import("@segment/actions-core").ModifiedResponse<unknown> | undefined>;
21
+ getBodyHtml(profile: Profile, apiLookupData: Record<string, unknown>, emailProfile: {
22
+ id?: string | undefined;
23
+ type?: string | undefined;
24
+ subscriptionStatus?: string | undefined;
25
+ unsubscribeLink?: string | undefined;
26
+ preferencesLink?: string | undefined;
27
+ groups?: {
28
+ id?: string | undefined;
29
+ isSubscribed?: boolean | undefined;
30
+ groupUnsubscribeLink?: string | undefined;
31
+ }[] | undefined;
32
+ }): Promise<string>;
33
+ generateEmailHtml(design: string): Promise<string>;
34
+ performApiLookups(this: SendEmailPerformer, apiLookups: ApiLookupConfig[] | undefined, profile: Profile): Promise<Record<string, unknown>>;
35
+ insertUnsubscribeLinks(html: string, emailProfile: EmailProfile): string;
36
+ onResponse(args: {
37
+ response?: Response;
38
+ error?: ResponseError;
39
+ operation: OperationContext;
40
+ }): void;
41
+ }
42
+ export declare type EmailProfile = ExtId<Payload>;
@@ -0,0 +1,318 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SendEmailPerformer = exports.Liquid = exports.EXTERNAL_ID_KEY = void 0;
13
+ const utils_1 = require("../../utils");
14
+ const liquidjs_1 = require("liquidjs");
15
+ const actions_core_1 = require("@segment/actions-core");
16
+ const previewApiLookup_1 = require("../previewApiLookup");
17
+ const insertEmailPreviewText_1 = require("./insertEmailPreviewText");
18
+ const cheerio_1 = __importDefault(require("cheerio"));
19
+ const isRestrictedDomain_1 = require("./isRestrictedDomain");
20
+ exports.EXTERNAL_ID_KEY = 'email';
21
+ exports.Liquid = new liquidjs_1.Liquid();
22
+ class SendEmailPerformer extends utils_1.MessageSendPerformer {
23
+ getIntegrationStatsName() {
24
+ return 'actions_personas_messaging_sendgrid';
25
+ }
26
+ getChannelType() {
27
+ return 'email';
28
+ }
29
+ getDefaultSettingsRegion() {
30
+ return 'us-west-2';
31
+ }
32
+ isSupportedExternalId(externalId) {
33
+ return externalId.type === 'email';
34
+ }
35
+ isExternalIdSubscribed(extId) {
36
+ const bypass_subscription = this.payload.byPassSubscription !== undefined && this.payload.byPassSubscription;
37
+ if (bypass_subscription) {
38
+ this.currentOperation?.logs.push('Bypassing subscription');
39
+ return true;
40
+ }
41
+ const isSubscribed = super.isExternalIdSubscribed(extId);
42
+ if (!isSubscribed)
43
+ return isSubscribed;
44
+ if (!this.payload.groupId)
45
+ return isSubscribed;
46
+ const recepientGroup = extId.groups?.find((g) => g.id === this.payload.groupId);
47
+ if (!recepientGroup) {
48
+ this.statsClient.incr('group_notfound', 1);
49
+ return false;
50
+ }
51
+ if (!recepientGroup.isSubscribed) {
52
+ this.statsClient.incr('group_notsubscribed', 1);
53
+ return false;
54
+ }
55
+ return true;
56
+ }
57
+ getRecepients() {
58
+ if (this.payload.toEmail)
59
+ return [
60
+ {
61
+ id: this.payload.toEmail,
62
+ type: 'email',
63
+ groups: [
64
+ {
65
+ id: this.payload.groupId
66
+ }
67
+ ]
68
+ }
69
+ ];
70
+ const res = super.getRecepients();
71
+ if (res.length > 0)
72
+ return [res[0]];
73
+ return res;
74
+ }
75
+ async parseTemplating(content, liquidData, contentType) {
76
+ const parsedContent = await exports.Liquid.parseAndRender(content, liquidData);
77
+ this.logOnError(() => 'Content type: ' + contentType);
78
+ return parsedContent;
79
+ }
80
+ async sendToRecepient(emailProfile) {
81
+ const traits = await this.getProfileTraits();
82
+ const profile = {
83
+ email: emailProfile?.id,
84
+ traits
85
+ };
86
+ const toEmail = profile.email;
87
+ if (!toEmail) {
88
+ return;
89
+ }
90
+ if (isRestrictedDomain_1.isRestrictedDomain(toEmail)) {
91
+ this.tags.push('reason:restricted_domain');
92
+ throw new actions_core_1.IntegrationError('Emails with gmailx.com, yahoox.com, aolx.com, and hotmailx.com domains are blocked.', 'Invalid input', 400);
93
+ }
94
+ let name;
95
+ if (traits.first_name && traits.last_name) {
96
+ name = `${traits.first_name} ${traits.last_name}`;
97
+ }
98
+ else if (traits.firstName && traits.lastName) {
99
+ name = `${traits.firstName} ${traits.lastName}`;
100
+ }
101
+ else if (traits.name) {
102
+ name = traits.name;
103
+ }
104
+ else {
105
+ name = traits.first_name || traits.last_name || traits.firstName || traits.lastName || 'User';
106
+ }
107
+ const bcc = JSON.parse(this.payload.bcc ?? '[]');
108
+ const [parsedSubject, apiLookupData] = await Promise.all([
109
+ this.parseTemplating(this.payload.subject, { profile }, 'Subject'),
110
+ this.performApiLookups(this.payload.apiLookups, profile)
111
+ ]);
112
+ const parsedBodyHtml = await this.getBodyHtml(profile, apiLookupData, emailProfile);
113
+ const mailContentSubscriptionHonored = {
114
+ personalizations: [
115
+ {
116
+ to: [
117
+ {
118
+ email: toEmail,
119
+ name: name
120
+ }
121
+ ],
122
+ bcc: bcc.length > 0 ? bcc : undefined,
123
+ custom_args: {
124
+ ...this.payload.customArgs,
125
+ source_id: this.settings.sourceId,
126
+ space_id: this.settings.spaceId,
127
+ user_id: this.payload.userId ?? undefined,
128
+ __segment_internal_external_id_key__: exports.EXTERNAL_ID_KEY,
129
+ __segment_internal_external_id_value__: profile[exports.EXTERNAL_ID_KEY]
130
+ }
131
+ }
132
+ ],
133
+ from: {
134
+ email: this.payload.fromEmail,
135
+ name: this.payload.fromName
136
+ },
137
+ reply_to: {
138
+ email: this.payload.replyToEmail,
139
+ name: this.payload.replyToName
140
+ },
141
+ subject: parsedSubject,
142
+ content: [
143
+ {
144
+ type: 'text/html',
145
+ value: parsedBodyHtml
146
+ }
147
+ ],
148
+ tracking_settings: {
149
+ subscription_tracking: {
150
+ enable: true,
151
+ substitution_tag: '[unsubscribe]'
152
+ }
153
+ }
154
+ };
155
+ let mailContent;
156
+ if (this.payload.byPassSubscription) {
157
+ mailContent = {
158
+ ...mailContentSubscriptionHonored,
159
+ mail_settings: {
160
+ bypass_list_management: {
161
+ enable: true
162
+ }
163
+ }
164
+ };
165
+ this.statsClient?.incr('request.by_pass_subscription', 1);
166
+ }
167
+ else {
168
+ mailContent = mailContentSubscriptionHonored;
169
+ this.statsClient?.incr('request.dont_pass_subscription', 1);
170
+ }
171
+ const req = {
172
+ method: 'post',
173
+ headers: {
174
+ authorization: `Bearer ${this.settings.sendGridApiKey}`
175
+ },
176
+ json: mailContent
177
+ };
178
+ this.statsClient?.set('message_body_size', JSON.stringify(req).length);
179
+ const response = await this.request('https://api.sendgrid.com/v3/mail/send', req);
180
+ if (this.payload?.eventOccurredTS != undefined) {
181
+ this.statsClient?.histogram('eventDeliveryTS', Date.now() - new Date(this.payload?.eventOccurredTS).getTime(), this.tags);
182
+ }
183
+ return response;
184
+ }
185
+ async getBodyHtml(profile, apiLookupData, emailProfile) {
186
+ let parsedBodyHtml;
187
+ if (this.payload.bodyUrl && this.settings.unlayerApiKey) {
188
+ const { content: body } = await this.request(this.payload.bodyUrl, { method: 'GET', skipResponseCloning: true });
189
+ const bodyHtml = this.payload.bodyType === 'html' ? body : await this.generateEmailHtml(body);
190
+ parsedBodyHtml = await this.parseTemplating(bodyHtml, { profile, [previewApiLookup_1.apiLookupLiquidKey]: apiLookupData }, 'Body');
191
+ }
192
+ else {
193
+ parsedBodyHtml = await this.parseTemplating(this.payload.bodyHtml ?? '', { profile, [previewApiLookup_1.apiLookupLiquidKey]: apiLookupData }, 'Body HTML');
194
+ }
195
+ if (this.payload.bodyType === 'design' && this.payload.previewText) {
196
+ const parsedPreviewText = await this.parseTemplating(this.payload.previewText, { profile }, 'Preview text');
197
+ parsedBodyHtml = insertEmailPreviewText_1.insertEmailPreviewText(parsedBodyHtml, parsedPreviewText);
198
+ }
199
+ parsedBodyHtml = this.insertUnsubscribeLinks(parsedBodyHtml, emailProfile);
200
+ return parsedBodyHtml;
201
+ }
202
+ async generateEmailHtml(design) {
203
+ this.statsClient.incr('unlayer_request', 1);
204
+ const response = await this.request('https://api.unlayer.com/v2/export/html', {
205
+ method: 'POST',
206
+ headers: {
207
+ authorization: `Basic ${Buffer.from(`${this.settings.unlayerApiKey}:`).toString('base64')}`,
208
+ 'content-type': 'application/json'
209
+ },
210
+ body: JSON.stringify({
211
+ displayMode: 'email',
212
+ design: JSON.parse(design)
213
+ })
214
+ });
215
+ const body = await response.json();
216
+ return body.data.html;
217
+ }
218
+ async performApiLookups(apiLookups, profile) {
219
+ if (!apiLookups) {
220
+ return {};
221
+ }
222
+ const request = this.request.bind(this);
223
+ const data = await Promise.all(apiLookups.map(async (apiLookup) => {
224
+ const data = await previewApiLookup_1.performApiLookup(request, apiLookup, profile, this.statsClient.statsClient, this.tags, this.settings, this.logger.loggerClient);
225
+ return { name: apiLookup.name, data };
226
+ }));
227
+ return data.reduce((acc, { name, data }) => {
228
+ acc[name] = data;
229
+ return acc;
230
+ }, {});
231
+ }
232
+ insertUnsubscribeLinks(html, emailProfile) {
233
+ const spaceId = this.settings.spaceId;
234
+ const groupId = this.payload.groupId;
235
+ const globalUnsubscribeLink = emailProfile?.unsubscribeLink;
236
+ const preferencesLink = emailProfile?.preferencesLink;
237
+ const unsubscribeLinkRef = 'a[href*="[upa_unsubscribe_link]"]';
238
+ const preferencesLinkRef = 'a[href*="[upa_preferences_link]"]';
239
+ const sendgridUnsubscribeLinkTag = '[unsubscribe]';
240
+ const $ = cheerio_1.default.load(html);
241
+ const _this = this;
242
+ if (groupId) {
243
+ const group = emailProfile.groups?.find((grp) => grp.id === groupId);
244
+ const groupUnsubscribeLink = group?.groupUnsubscribeLink;
245
+ $(unsubscribeLinkRef).each(function () {
246
+ if (!groupUnsubscribeLink) {
247
+ _this.logger.info(`Group Unsubscribe link missing`);
248
+ _this.statsClient.incr('group_unsubscribe_link_missing', 1);
249
+ $(this).attr('href', sendgridUnsubscribeLinkTag);
250
+ }
251
+ else {
252
+ $(this).attr('href', groupUnsubscribeLink);
253
+ _this.logger?.info(`Group Unsubscribe link replaced`);
254
+ _this.statsClient?.incr('replaced_group_unsubscribe_link', 1);
255
+ }
256
+ });
257
+ }
258
+ else {
259
+ $(unsubscribeLinkRef).each(function () {
260
+ if (!globalUnsubscribeLink) {
261
+ _this.logger?.info(`Global Unsubscribe link missing`);
262
+ _this.statsClient?.incr('global_unsubscribe_link_missing', 1);
263
+ $(this).attr('href', sendgridUnsubscribeLinkTag);
264
+ }
265
+ else {
266
+ $(this).attr('href', globalUnsubscribeLink);
267
+ _this.logger?.info(`Global Unsubscribe link replaced`);
268
+ _this.statsClient?.incr('replaced_global_unsubscribe_link', 1);
269
+ }
270
+ });
271
+ }
272
+ $(preferencesLinkRef).each(function () {
273
+ if (!preferencesLink) {
274
+ $(this.parent?.children).each(function () {
275
+ if ($(this).text() == ' | ') {
276
+ $(this).remove();
277
+ }
278
+ });
279
+ $(this).remove();
280
+ _this.logger?.info(`Preferences link removed from the html body - ${spaceId}`);
281
+ _this.statsClient?.incr('removed_preferences_link', 1);
282
+ }
283
+ else {
284
+ $(this).attr('href', preferencesLink);
285
+ _this.logger?.info(`Preferences link replaced - ${spaceId}`);
286
+ _this.statsClient?.incr('replaced_preferences_link', 1);
287
+ }
288
+ });
289
+ return $.html();
290
+ }
291
+ onResponse(args) {
292
+ const headers = args.response?.headers || args.error?.response.headers;
293
+ const sgMsgId = headers?.get('X-Message-ID');
294
+ if (sgMsgId)
295
+ args.operation.logs.push('[sendgrid]X-Message-ID: ' + sgMsgId);
296
+ }
297
+ }
298
+ __decorate([
299
+ utils_1.track({
300
+ wrapIntegrationError: () => [`Unable to parse templating in email`, `templating parse failure`, 400]
301
+ })
302
+ ], SendEmailPerformer.prototype, "parseTemplating", null);
303
+ __decorate([
304
+ utils_1.track()
305
+ ], SendEmailPerformer.prototype, "getBodyHtml", null);
306
+ __decorate([
307
+ utils_1.track({
308
+ wrapIntegrationError: () => ['Unable to export email as HTML', 'Export HTML failure', 400]
309
+ })
310
+ ], SendEmailPerformer.prototype, "generateEmailHtml", null);
311
+ __decorate([
312
+ utils_1.track()
313
+ ], SendEmailPerformer.prototype, "performApiLookups", null);
314
+ __decorate([
315
+ utils_1.track()
316
+ ], SendEmailPerformer.prototype, "insertUnsubscribeLinks", null);
317
+ exports.SendEmailPerformer = SendEmailPerformer;
318
+ //# sourceMappingURL=SendEmailPerformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SendEmailPerformer.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,u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CAAC,CAAA;QAEF,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;IACjB,CAAC;IAED,UAAU,CAAC,IAAiF;QAC1F,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAA;QAEtE,MAAM,OAAO,GAAG,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;QAC5C,IAAI,OAAO;YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,CAAA;IAC7E,CAAC;CACF;AAlSC;IAHC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,qCAAqC,EAAE,0BAA0B,EAAE,GAAG,CAAC;KACrG,CAAC;yDAYD;AAwHD;IADC,aAAK,EAAE;qDAqCP;AAKD;IAHC,aAAK,CAAC;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,gCAAgC,EAAE,qBAAqB,EAAE,GAAG,CAAC;KAC3F,CAAC;2DAiBD;AASD;IADC,aAAK,EAAE;2DA0BP;AAGD;IADC,aAAK,EAAE;gEA0DP;AA3VH,gDAmWC"}
@@ -0,0 +1,12 @@
1
+ export interface UnlayerResponse {
2
+ success: boolean;
3
+ data: {
4
+ html: string;
5
+ chunks: {
6
+ css: string;
7
+ js: string;
8
+ fonts: string[];
9
+ body: string;
10
+ };
11
+ };
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=UnlayerResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnlayerResponse.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/sendgrid/sendEmail/UnlayerResponse.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ export declare const actionDefinition: ActionDefinition<Settings, Payload>;