@segment/action-destinations 3.361.0 → 3.362.1-remove-abort-controller.2

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 (380) hide show
  1. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.d.ts +5 -0
  2. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js +3 -0
  3. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js.map +1 -0
  4. package/dist/destinations/accoil-analytics/postToAccoil/index.d.ts +5 -0
  5. package/dist/destinations/accoil-analytics/postToAccoil/index.js +28 -0
  6. package/dist/destinations/accoil-analytics/postToAccoil/index.js.map +1 -0
  7. package/dist/destinations/braze/createAliasV2.types.d.ts +5 -0
  8. package/dist/destinations/braze/createAliasV2.types.js +3 -0
  9. package/dist/destinations/braze/createAliasV2.types.js.map +1 -0
  10. package/dist/destinations/braze/identifyUserV2.types.d.ts +8 -0
  11. package/dist/destinations/braze/identifyUserV2.types.js +3 -0
  12. package/dist/destinations/braze/identifyUserV2.types.js.map +1 -0
  13. package/dist/destinations/campaign-manager-360/common-fields.d.ts +3 -0
  14. package/dist/destinations/campaign-manager-360/common-fields.js +306 -0
  15. package/dist/destinations/campaign-manager-360/common-fields.js.map +1 -0
  16. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.d.ts +45 -0
  17. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js +3 -0
  18. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/generated-types.js.map +1 -0
  19. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.d.ts +5 -0
  20. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js +86 -0
  21. package/dist/destinations/campaign-manager-360/conversionAdjustmentUpload/index.js.map +1 -0
  22. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.d.ts +50 -0
  23. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js +3 -0
  24. package/dist/destinations/campaign-manager-360/conversionUpload/generated-types.js.map +1 -0
  25. package/dist/destinations/campaign-manager-360/conversionUpload/index.d.ts +5 -0
  26. package/dist/destinations/campaign-manager-360/conversionUpload/index.js +131 -0
  27. package/dist/destinations/campaign-manager-360/conversionUpload/index.js.map +1 -0
  28. package/dist/destinations/campaign-manager-360/generated-types.d.ts +5 -0
  29. package/dist/destinations/campaign-manager-360/generated-types.js +3 -0
  30. package/dist/destinations/campaign-manager-360/generated-types.js.map +1 -0
  31. package/dist/destinations/campaign-manager-360/index.d.ts +4 -0
  32. package/dist/destinations/campaign-manager-360/index.js +63 -0
  33. package/dist/destinations/campaign-manager-360/index.js.map +1 -0
  34. package/dist/destinations/campaign-manager-360/types.d.ts +116 -0
  35. package/dist/destinations/campaign-manager-360/types.js +23 -0
  36. package/dist/destinations/campaign-manager-360/types.js.map +1 -0
  37. package/dist/destinations/campaign-manager-360/utils.d.ts +21 -0
  38. package/dist/destinations/campaign-manager-360/utils.js +175 -0
  39. package/dist/destinations/campaign-manager-360/utils.js.map +1 -0
  40. package/dist/destinations/contentstack/customAttributesSync/generated-types.d.ts +7 -0
  41. package/dist/destinations/contentstack/customAttributesSync/generated-types.js +3 -0
  42. package/dist/destinations/contentstack/customAttributesSync/generated-types.js.map +1 -0
  43. package/dist/destinations/contentstack/customAttributesSync/index.d.ts +5 -0
  44. package/dist/destinations/contentstack/customAttributesSync/index.js +54 -0
  45. package/dist/destinations/contentstack/customAttributesSync/index.js.map +1 -0
  46. package/dist/destinations/contentstack/customAttributesSync/types.d.ts +14 -0
  47. package/dist/destinations/contentstack/customAttributesSync/types.js +3 -0
  48. package/dist/destinations/contentstack/customAttributesSync/types.js.map +1 -0
  49. package/dist/destinations/contentstack/customAttributesSync/utils.d.ts +4 -0
  50. package/dist/destinations/contentstack/customAttributesSync/utils.js +20 -0
  51. package/dist/destinations/contentstack/customAttributesSync/utils.js.map +1 -0
  52. package/dist/destinations/contentstack/types.d.ts +12 -0
  53. package/dist/destinations/contentstack/types.js +3 -0
  54. package/dist/destinations/contentstack/types.js.map +1 -0
  55. package/dist/destinations/customerio/utils.d.ts +1 -1
  56. package/dist/destinations/dynamic-yield-audiences/syncAudience/types.d.ts +22 -0
  57. package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js +3 -0
  58. package/dist/destinations/dynamic-yield-audiences/syncAudience/types.js.map +1 -0
  59. package/dist/destinations/dynamic-yield-audiences/types.d.ts +8 -0
  60. package/dist/destinations/dynamic-yield-audiences/types.js +12 -0
  61. package/dist/destinations/dynamic-yield-audiences/types.js.map +1 -0
  62. package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
  63. package/dist/destinations/engage/sendgrid/Profile.js +3 -0
  64. package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
  65. package/dist/destinations/engage/sendgrid/destinationDefinition.d.ts +3 -0
  66. package/dist/destinations/engage/sendgrid/destinationDefinition.js +70 -0
  67. package/dist/destinations/engage/sendgrid/destinationDefinition.js.map +1 -0
  68. package/dist/destinations/engage/sendgrid/generated-types.d.ts +1 -0
  69. package/dist/destinations/engage/sendgrid/generated-types.js +14 -0
  70. package/dist/destinations/engage/sendgrid/generated-types.js.map +1 -0
  71. package/dist/destinations/engage/sendgrid/index.d.ts +2 -0
  72. package/dist/destinations/engage/sendgrid/index.js +5 -0
  73. package/dist/destinations/engage/sendgrid/index.js.map +1 -0
  74. package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.d.ts +4 -0
  75. package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js +28 -0
  76. package/dist/destinations/engage/sendgrid/previewApiLookup/actionDefinition.js.map +1 -0
  77. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +21 -0
  78. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +174 -0
  79. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
  80. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.d.ts +1 -0
  81. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js +14 -0
  82. package/dist/destinations/engage/sendgrid/previewApiLookup/generated-types.js.map +1 -0
  83. package/dist/destinations/engage/sendgrid/previewApiLookup/index.d.ts +1 -0
  84. package/dist/destinations/engage/sendgrid/previewApiLookup/index.js +14 -0
  85. package/dist/destinations/engage/sendgrid/previewApiLookup/index.js.map +1 -0
  86. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +44 -0
  87. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +419 -0
  88. package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -0
  89. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.d.ts +12 -0
  90. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js +3 -0
  91. package/dist/destinations/engage/sendgrid/sendEmail/UnlayerResponse.js.map +1 -0
  92. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.d.ts +4 -0
  93. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js +257 -0
  94. package/dist/destinations/engage/sendgrid/sendEmail/actionDefinition.js.map +1 -0
  95. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.d.ts +1 -0
  96. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js +14 -0
  97. package/dist/destinations/engage/sendgrid/sendEmail/generated-types.js.map +1 -0
  98. package/dist/destinations/engage/sendgrid/sendEmail/index.d.ts +1 -0
  99. package/dist/destinations/engage/sendgrid/sendEmail/index.js +14 -0
  100. package/dist/destinations/engage/sendgrid/sendEmail/index.js.map +1 -0
  101. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.d.ts +1 -0
  102. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js +23 -0
  103. package/dist/destinations/engage/sendgrid/sendEmail/insertEmailPreviewText.js.map +1 -0
  104. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.d.ts +1 -0
  105. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js +14 -0
  106. package/dist/destinations/engage/sendgrid/sendEmail/isRestrictedDomain.js.map +1 -0
  107. package/dist/destinations/engage/twilio/destinationDefinition.d.ts +3 -0
  108. package/dist/destinations/engage/twilio/destinationDefinition.js +172 -0
  109. package/dist/destinations/engage/twilio/destinationDefinition.js.map +1 -0
  110. package/dist/destinations/engage/twilio/generated-types.d.ts +1 -0
  111. package/dist/destinations/engage/twilio/generated-types.js +14 -0
  112. package/dist/destinations/engage/twilio/generated-types.js.map +1 -0
  113. package/dist/destinations/engage/twilio/index.d.ts +2 -0
  114. package/dist/destinations/engage/twilio/index.js +5 -0
  115. package/dist/destinations/engage/twilio/index.js.map +1 -0
  116. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.d.ts +28 -0
  117. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js +151 -0
  118. package/dist/destinations/engage/twilio/sendMobilePush/PushSender.js.map +1 -0
  119. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.d.ts +4 -0
  120. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js +250 -0
  121. package/dist/destinations/engage/twilio/sendMobilePush/actionDefinition.js.map +1 -0
  122. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.d.ts +1 -0
  123. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js +14 -0
  124. package/dist/destinations/engage/twilio/sendMobilePush/generated-types.js.map +1 -0
  125. package/dist/destinations/engage/twilio/sendMobilePush/index.d.ts +1 -0
  126. package/dist/destinations/engage/twilio/sendMobilePush/index.js +14 -0
  127. package/dist/destinations/engage/twilio/sendMobilePush/index.js.map +1 -0
  128. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.d.ts +9 -0
  129. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +72 -0
  130. package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -0
  131. package/dist/destinations/engage/twilio/sendSms/actionDefinition.d.ts +4 -0
  132. package/dist/destinations/engage/twilio/sendSms/actionDefinition.js +162 -0
  133. package/dist/destinations/engage/twilio/sendSms/actionDefinition.js.map +1 -0
  134. package/dist/destinations/engage/twilio/sendSms/generated-types.d.ts +1 -0
  135. package/dist/destinations/engage/twilio/sendSms/generated-types.js +14 -0
  136. package/dist/destinations/engage/twilio/sendSms/generated-types.js.map +1 -0
  137. package/dist/destinations/engage/twilio/sendSms/index.d.ts +1 -0
  138. package/dist/destinations/engage/twilio/sendSms/index.js +14 -0
  139. package/dist/destinations/engage/twilio/sendSms/index.js.map +1 -0
  140. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.d.ts +9 -0
  141. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js +89 -0
  142. package/dist/destinations/engage/twilio/sendWhatsApp/WhatsAppMessageSender.js.map +1 -0
  143. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.d.ts +4 -0
  144. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js +136 -0
  145. package/dist/destinations/engage/twilio/sendWhatsApp/actionDefinition.js.map +1 -0
  146. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.d.ts +1 -0
  147. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js +14 -0
  148. package/dist/destinations/engage/twilio/sendWhatsApp/generated-types.js.map +1 -0
  149. package/dist/destinations/engage/twilio/sendWhatsApp/index.d.ts +1 -0
  150. package/dist/destinations/engage/twilio/sendWhatsApp/index.js +14 -0
  151. package/dist/destinations/engage/twilio/sendWhatsApp/index.js.map +1 -0
  152. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.d.ts +16 -0
  153. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +71 -0
  154. package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -0
  155. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.d.ts +16 -0
  156. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +115 -0
  157. package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -0
  158. package/dist/destinations/engage/twilio/utils/index.d.ts +2 -0
  159. package/dist/destinations/engage/twilio/utils/index.js +15 -0
  160. package/dist/destinations/engage/twilio/utils/index.js.map +1 -0
  161. package/dist/destinations/engage/twilio/utils/types.d.ts +23 -0
  162. package/dist/destinations/engage/twilio/utils/types.js +3 -0
  163. package/dist/destinations/engage/twilio/utils/types.js.map +1 -0
  164. package/dist/destinations/engage/utils/AggregateError.d.ts +14 -0
  165. package/dist/destinations/engage/utils/AggregateError.js +26 -0
  166. package/dist/destinations/engage/utils/AggregateError.js.map +1 -0
  167. package/dist/destinations/engage/utils/EngageActionPerformer.d.ts +42 -0
  168. package/dist/destinations/engage/utils/EngageActionPerformer.js +148 -0
  169. package/dist/destinations/engage/utils/EngageActionPerformer.js.map +1 -0
  170. package/dist/destinations/engage/utils/EngageLogger.d.ts +18 -0
  171. package/dist/destinations/engage/utils/EngageLogger.js +52 -0
  172. package/dist/destinations/engage/utils/EngageLogger.js.map +1 -0
  173. package/dist/destinations/engage/utils/EngageStats.d.ts +18 -0
  174. package/dist/destinations/engage/utils/EngageStats.js +95 -0
  175. package/dist/destinations/engage/utils/EngageStats.js.map +1 -0
  176. package/dist/destinations/engage/utils/IntegrationErrorWrapper.d.ts +12 -0
  177. package/dist/destinations/engage/utils/IntegrationErrorWrapper.js +31 -0
  178. package/dist/destinations/engage/utils/IntegrationErrorWrapper.js.map +1 -0
  179. package/dist/destinations/engage/utils/MessageSendPerformer.d.ts +65 -0
  180. package/dist/destinations/engage/utils/MessageSendPerformer.js +211 -0
  181. package/dist/destinations/engage/utils/MessageSendPerformer.js.map +1 -0
  182. package/dist/destinations/engage/utils/Profile.d.ts +6 -0
  183. package/dist/destinations/engage/utils/Profile.js +3 -0
  184. package/dist/destinations/engage/utils/Profile.js.map +1 -0
  185. package/dist/destinations/engage/utils/ResponseError.d.ts +25 -0
  186. package/dist/destinations/engage/utils/ResponseError.js +22 -0
  187. package/dist/destinations/engage/utils/ResponseError.js.map +1 -0
  188. package/dist/destinations/engage/utils/apiLookups.d.ts +22 -0
  189. package/dist/destinations/engage/utils/apiLookups.js +189 -0
  190. package/dist/destinations/engage/utils/apiLookups.js.map +1 -0
  191. package/dist/destinations/engage/utils/getProfileApiEndpoint.d.ts +2 -0
  192. package/dist/destinations/engage/utils/getProfileApiEndpoint.js +10 -0
  193. package/dist/destinations/engage/utils/getProfileApiEndpoint.js.map +1 -0
  194. package/dist/destinations/engage/utils/index.d.ts +9 -0
  195. package/dist/destinations/engage/utils/index.js +22 -0
  196. package/dist/destinations/engage/utils/index.js.map +1 -0
  197. package/dist/destinations/engage/utils/isDestinationActionService.d.ts +1 -0
  198. package/dist/destinations/engage/utils/isDestinationActionService.js +8 -0
  199. package/dist/destinations/engage/utils/isDestinationActionService.js.map +1 -0
  200. package/dist/destinations/engage/utils/isRetryableError.d.ts +2 -0
  201. package/dist/destinations/engage/utils/isRetryableError.js +33 -0
  202. package/dist/destinations/engage/utils/isRetryableError.js.map +1 -0
  203. package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.d.ts +1 -0
  204. package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js +3 -0
  205. package/dist/destinations/engage/utils/operationTracking/GenericMethodDecorator.js.map +1 -0
  206. package/dist/destinations/engage/utils/operationTracking/OperationDecorator.d.ts +46 -0
  207. package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js +46 -0
  208. package/dist/destinations/engage/utils/operationTracking/OperationDecorator.js.map +1 -0
  209. package/dist/destinations/engage/utils/operationTracking/OperationDuration.d.ts +12 -0
  210. package/dist/destinations/engage/utils/operationTracking/OperationDuration.js +23 -0
  211. package/dist/destinations/engage/utils/operationTracking/OperationDuration.js.map +1 -0
  212. package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.d.ts +12 -0
  213. package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js +35 -0
  214. package/dist/destinations/engage/utils/operationTracking/OperationErrorHandler.js.map +1 -0
  215. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.d.ts +14 -0
  216. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js +31 -0
  217. package/dist/destinations/engage/utils/operationTracking/OperationFinallyHooks.js.map +1 -0
  218. package/dist/destinations/engage/utils/operationTracking/OperationLogger.d.ts +31 -0
  219. package/dist/destinations/engage/utils/operationTracking/OperationLogger.js +104 -0
  220. package/dist/destinations/engage/utils/operationTracking/OperationLogger.js.map +1 -0
  221. package/dist/destinations/engage/utils/operationTracking/OperationStats.d.ts +39 -0
  222. package/dist/destinations/engage/utils/operationTracking/OperationStats.js +130 -0
  223. package/dist/destinations/engage/utils/operationTracking/OperationStats.js.map +1 -0
  224. package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.d.ts +1 -0
  225. package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js +377 -0
  226. package/dist/destinations/engage/utils/operationTracking/OperationTracker.test.js.map +1 -0
  227. package/dist/destinations/engage/utils/operationTracking/OperationTree.d.ts +23 -0
  228. package/dist/destinations/engage/utils/operationTracking/OperationTree.js +49 -0
  229. package/dist/destinations/engage/utils/operationTracking/OperationTree.js.map +1 -0
  230. package/dist/destinations/engage/utils/operationTracking/TrackedError.d.ts +6 -0
  231. package/dist/destinations/engage/utils/operationTracking/TrackedError.js +3 -0
  232. package/dist/destinations/engage/utils/operationTracking/TrackedError.js.map +1 -0
  233. package/dist/destinations/engage/utils/operationTracking/index.d.ts +10 -0
  234. package/dist/destinations/engage/utils/operationTracking/index.js +23 -0
  235. package/dist/destinations/engage/utils/operationTracking/index.js.map +1 -0
  236. package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.d.ts +21 -0
  237. package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js +99 -0
  238. package/dist/destinations/engage/utils/operationTracking/wrapTryCatchFinallyPromisable.js.map +1 -0
  239. package/dist/destinations/engage/utils/testUtils.d.ts +6 -0
  240. package/dist/destinations/engage/utils/testUtils.js +26 -0
  241. package/dist/destinations/engage/utils/testUtils.js.map +1 -0
  242. package/dist/destinations/engage/utils/track.d.ts +52 -0
  243. package/dist/destinations/engage/utils/track.js +9 -0
  244. package/dist/destinations/engage/utils/track.js.map +1 -0
  245. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.d.ts +16 -0
  246. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js +3 -0
  247. package/dist/destinations/engage-messaging-sendgrid/previewApiLookup.types.js.map +1 -0
  248. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.d.ts +56 -0
  249. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js +3 -0
  250. package/dist/destinations/engage-messaging-sendgrid/sendEmail.types.js.map +1 -0
  251. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.d.ts +39 -0
  252. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js +3 -0
  253. package/dist/destinations/engage-messaging-twilio/sendMobilePush.types.js.map +1 -0
  254. package/dist/destinations/engage-messaging-twilio/sendSms.types.d.ts +27 -0
  255. package/dist/destinations/engage-messaging-twilio/sendSms.types.js +3 -0
  256. package/dist/destinations/engage-messaging-twilio/sendSms.types.js.map +1 -0
  257. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.d.ts +25 -0
  258. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js +3 -0
  259. package/dist/destinations/engage-messaging-twilio/sendWhatsApp.types.js.map +1 -0
  260. package/dist/destinations/facebook-custom-audiences/add/generated-types.d.ts +2 -0
  261. package/dist/destinations/facebook-custom-audiences/add/generated-types.js +3 -0
  262. package/dist/destinations/facebook-custom-audiences/add/generated-types.js.map +1 -0
  263. package/dist/destinations/facebook-custom-audiences/add/index.d.ts +5 -0
  264. package/dist/destinations/facebook-custom-audiences/add/index.js +11 -0
  265. package/dist/destinations/facebook-custom-audiences/add/index.js.map +1 -0
  266. package/dist/destinations/facebook-custom-audiences/remove/generated-types.d.ts +2 -0
  267. package/dist/destinations/facebook-custom-audiences/remove/generated-types.js +3 -0
  268. package/dist/destinations/facebook-custom-audiences/remove/generated-types.js.map +1 -0
  269. package/dist/destinations/facebook-custom-audiences/remove/index.d.ts +5 -0
  270. package/dist/destinations/facebook-custom-audiences/remove/index.js +11 -0
  271. package/dist/destinations/facebook-custom-audiences/remove/index.js.map +1 -0
  272. package/dist/destinations/first-party-dv360/addToList/generated-types.d.ts +2 -0
  273. package/dist/destinations/first-party-dv360/addToList/generated-types.js +3 -0
  274. package/dist/destinations/first-party-dv360/addToList/generated-types.js.map +1 -0
  275. package/dist/destinations/first-party-dv360/addToList/index.d.ts +5 -0
  276. package/dist/destinations/first-party-dv360/addToList/index.js +11 -0
  277. package/dist/destinations/first-party-dv360/addToList/index.js.map +1 -0
  278. package/dist/destinations/hubspot/customEvent/dynamic-fields.d.ts +5 -0
  279. package/dist/destinations/hubspot/customEvent/dynamic-fields.js +112 -0
  280. package/dist/destinations/hubspot/customEvent/dynamic-fields.js.map +1 -0
  281. package/dist/destinations/hubspot/customEvent/event-completion.d.ts +3 -0
  282. package/dist/destinations/hubspot/customEvent/event-completion.js +17 -0
  283. package/dist/destinations/hubspot/customEvent/event-completion.js.map +1 -0
  284. package/dist/destinations/hubspot/customEvent/hubspot-api.d.ts +62 -0
  285. package/dist/destinations/hubspot/customEvent/hubspot-api.js +305 -0
  286. package/dist/destinations/hubspot/customEvent/hubspot-api.js.map +1 -0
  287. package/dist/destinations/hubspot/customEvent/utils.d.ts +14 -0
  288. package/dist/destinations/hubspot/customEvent/utils.js +303 -0
  289. package/dist/destinations/hubspot/customEvent/utils.js.map +1 -0
  290. package/dist/destinations/hubspot/customEvent/validation.d.ts +3 -0
  291. package/dist/destinations/hubspot/customEvent/validation.js +66 -0
  292. package/dist/destinations/hubspot/customEvent/validation.js.map +1 -0
  293. package/dist/destinations/hubspot/upsertObject/dynamic-fields.d.ts +7 -0
  294. package/dist/destinations/hubspot/upsertObject/dynamic-fields.js +222 -0
  295. package/dist/destinations/hubspot/upsertObject/dynamic-fields.js.map +1 -0
  296. package/dist/destinations/hubspot/upsertObject/hubspot-api.d.ts +219 -0
  297. package/dist/destinations/hubspot/upsertObject/hubspot-api.js +609 -0
  298. package/dist/destinations/hubspot/upsertObject/hubspot-api.js.map +1 -0
  299. package/dist/destinations/hubspot/upsertObject/utils.d.ts +13 -0
  300. package/dist/destinations/hubspot/upsertObject/utils.js +547 -0
  301. package/dist/destinations/hubspot/upsertObject/utils.js.map +1 -0
  302. package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +5 -0
  303. package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
  304. package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
  305. package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
  306. package/dist/destinations/klaviyo/removeProfileToList/index.js +62 -0
  307. package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
  308. package/dist/destinations/mixpanel/incrementProperties/__test__/__snapshots__/snapshot.test.js.snap +18 -0
  309. package/dist/destinations/mixpanel/utils.d.ts +13 -0
  310. package/dist/destinations/mixpanel/utils.js +117 -0
  311. package/dist/destinations/mixpanel/utils.js.map +1 -0
  312. package/dist/destinations/movable-ink/categoryView/generated-types.d.ts +22 -0
  313. package/dist/destinations/movable-ink/categoryView/generated-types.js +3 -0
  314. package/dist/destinations/movable-ink/categoryView/generated-types.js.map +1 -0
  315. package/dist/destinations/movable-ink/categoryView/index.d.ts +5 -0
  316. package/dist/destinations/movable-ink/categoryView/index.js +43 -0
  317. package/dist/destinations/movable-ink/categoryView/index.js.map +1 -0
  318. package/dist/destinations/movable-ink/conversion/generated-types.d.ts +20 -0
  319. package/dist/destinations/movable-ink/conversion/generated-types.js +3 -0
  320. package/dist/destinations/movable-ink/conversion/generated-types.js.map +1 -0
  321. package/dist/destinations/movable-ink/conversion/index.d.ts +5 -0
  322. package/dist/destinations/movable-ink/conversion/index.js +45 -0
  323. package/dist/destinations/movable-ink/conversion/index.js.map +1 -0
  324. package/dist/destinations/movable-ink/fields.d.ts +21 -0
  325. package/dist/destinations/movable-ink/fields.js +236 -0
  326. package/dist/destinations/movable-ink/fields.js.map +1 -0
  327. package/dist/destinations/movable-ink/identify/generated-types.d.ts +7 -0
  328. package/dist/destinations/movable-ink/identify/generated-types.js +3 -0
  329. package/dist/destinations/movable-ink/identify/generated-types.js.map +1 -0
  330. package/dist/destinations/movable-ink/identify/index.d.ts +5 -0
  331. package/dist/destinations/movable-ink/identify/index.js +32 -0
  332. package/dist/destinations/movable-ink/identify/index.js.map +1 -0
  333. package/dist/destinations/movable-ink/productAdded/generated-types.d.ts +22 -0
  334. package/dist/destinations/movable-ink/productAdded/generated-types.js +3 -0
  335. package/dist/destinations/movable-ink/productAdded/generated-types.js.map +1 -0
  336. package/dist/destinations/movable-ink/productAdded/index.d.ts +5 -0
  337. package/dist/destinations/movable-ink/productAdded/index.js +43 -0
  338. package/dist/destinations/movable-ink/productAdded/index.js.map +1 -0
  339. package/dist/destinations/movable-ink/productViewed/generated-types.d.ts +21 -0
  340. package/dist/destinations/movable-ink/productViewed/generated-types.js +3 -0
  341. package/dist/destinations/movable-ink/productViewed/generated-types.js.map +1 -0
  342. package/dist/destinations/movable-ink/productViewed/index.d.ts +5 -0
  343. package/dist/destinations/movable-ink/productViewed/index.js +43 -0
  344. package/dist/destinations/movable-ink/productViewed/index.js.map +1 -0
  345. package/dist/destinations/movable-ink/search/generated-types.d.ts +12 -0
  346. package/dist/destinations/movable-ink/search/generated-types.js +3 -0
  347. package/dist/destinations/movable-ink/search/generated-types.js.map +1 -0
  348. package/dist/destinations/movable-ink/search/index.d.ts +5 -0
  349. package/dist/destinations/movable-ink/search/index.js +43 -0
  350. package/dist/destinations/movable-ink/search/index.js.map +1 -0
  351. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.d.ts +25 -0
  352. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js +3 -0
  353. package/dist/destinations/movable-ink/sendCustomEvent/generated-types.js.map +1 -0
  354. package/dist/destinations/movable-ink/sendCustomEvent/index.d.ts +5 -0
  355. package/dist/destinations/movable-ink/sendCustomEvent/index.js +48 -0
  356. package/dist/destinations/movable-ink/sendCustomEvent/index.js.map +1 -0
  357. package/dist/destinations/responsys/shared_properties.d.ts +3 -0
  358. package/dist/destinations/responsys/shared_properties.js +19 -0
  359. package/dist/destinations/responsys/shared_properties.js.map +1 -0
  360. package/dist/destinations/salesforce/lead/index.js +1 -0
  361. package/dist/destinations/salesforce/lead/index.js.map +1 -1
  362. package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
  363. package/dist/destinations/salesforce/sf-properties.js +10 -1
  364. package/dist/destinations/salesforce/sf-properties.js.map +1 -1
  365. package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +35 -0
  366. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +401 -0
  367. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -0
  368. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -0
  369. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +34 -0
  370. package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -0
  371. package/dist/destinations/trackey/group.types.d.ts +11 -0
  372. package/dist/destinations/trackey/group.types.js +3 -0
  373. package/dist/destinations/trackey/group.types.js.map +1 -0
  374. package/dist/destinations/trackey/identify.types.d.ts +11 -0
  375. package/dist/destinations/trackey/identify.types.js +3 -0
  376. package/dist/destinations/trackey/identify.types.js.map +1 -0
  377. package/dist/destinations/trackey/track.types.d.ts +12 -0
  378. package/dist/destinations/trackey/track.types.js +3 -0
  379. package/dist/destinations/trackey/track.types.js.map +1 -0
  380. package/package.json +4 -4
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationStats = void 0;
4
+ const OperationDuration_1 = require("./OperationDuration");
5
+ const OperationDecorator_1 = require("./OperationDecorator");
6
+ class OperationStats {
7
+ static getTryCatchFinallyHook(_ctx) {
8
+ throw new Error('OperationStats.getTryCatchFinallyHook is abstract and must be implemented by derived class');
9
+ }
10
+ getMetricName(ctx) {
11
+ const opName = OperationDecorator_1.OperationDecorator.getOperationName(ctx);
12
+ if (!opName)
13
+ return undefined;
14
+ switch (ctx.stage) {
15
+ case 'try':
16
+ return `${opName}.try`;
17
+ case 'catch':
18
+ return `${opName}.catch`;
19
+ case 'finally':
20
+ default:
21
+ return `${opName}`;
22
+ }
23
+ }
24
+ onTry(ctx) {
25
+ ctx.tags = [];
26
+ if (!ctx.sharedContext.tags)
27
+ ctx.sharedContext.tags = [];
28
+ return () => {
29
+ const metricName = this.getMetricName(ctx);
30
+ if (metricName)
31
+ this.statsOperationEvent({
32
+ context: ctx,
33
+ event: 'try',
34
+ shouldStats: false,
35
+ stats: {
36
+ metric: metricName,
37
+ method: 'incr',
38
+ value: 1,
39
+ tags: this.mergeTags(ctx.sharedContext.tags, ctx.tags)
40
+ }
41
+ });
42
+ };
43
+ }
44
+ mergeTags(...tagSets) {
45
+ const res = [];
46
+ for (const tags of tagSets) {
47
+ if (tags)
48
+ res.push(...tags);
49
+ }
50
+ return res.filter((t) => t);
51
+ }
52
+ statsOperationEvent(args) {
53
+ if (args.context.decoratorArgs?.shouldStats) {
54
+ const shouldStats = args.context.decoratorArgs.shouldStats(args);
55
+ if (shouldStats !== undefined)
56
+ args.shouldStats = shouldStats;
57
+ }
58
+ if (args.shouldStats && args.stats) {
59
+ this.stats(args.stats);
60
+ }
61
+ }
62
+ onCatch(ctx) {
63
+ const metricName = this.getMetricName(ctx);
64
+ if (metricName)
65
+ this.statsOperationEvent({
66
+ context: ctx,
67
+ event: ctx.stage,
68
+ shouldStats: false,
69
+ stats: {
70
+ metric: metricName,
71
+ method: 'incr',
72
+ value: 1,
73
+ tags: this.mergeTags(ctx.sharedContext.tags, ctx.tags)
74
+ }
75
+ });
76
+ }
77
+ onFinally(ctx) {
78
+ const finallyTags = [];
79
+ if (ctx.stage == 'finally')
80
+ finallyTags.push(`error:${ctx.error ? 'true' : 'false'}`);
81
+ if (ctx.error) {
82
+ const error = ctx.error;
83
+ finallyTags.push(...(this.extractTagsFromError(error, ctx) || []));
84
+ }
85
+ ctx.tags.push(...finallyTags);
86
+ return () => {
87
+ const finallyTags = this.mergeTags(ctx.sharedContext.tags, ctx.tags);
88
+ const metricName = this.getMetricName(ctx);
89
+ if (metricName)
90
+ this.statsOperationEvent({
91
+ context: ctx,
92
+ event: 'finally',
93
+ shouldStats: true,
94
+ stats: { metric: metricName, method: 'incr', value: 1, tags: [...finallyTags] }
95
+ });
96
+ const duration = OperationDuration_1.OperationDuration.getDuration(ctx);
97
+ const histogramMetric = this.getHistogramMetric(ctx);
98
+ if (duration !== undefined && histogramMetric)
99
+ this.statsOperationEvent({
100
+ context: ctx,
101
+ event: 'duration',
102
+ shouldStats: true,
103
+ stats: { metric: histogramMetric, method: 'histogram', value: duration, tags: [...finallyTags] }
104
+ });
105
+ };
106
+ }
107
+ getHistogramMetric(ctx) {
108
+ const opName = OperationDecorator_1.OperationDecorator.getOperationName(ctx);
109
+ if (!opName)
110
+ return undefined;
111
+ return `${opName}.duration`;
112
+ }
113
+ extractTagsFromError(error, ctx) {
114
+ const res = [];
115
+ const errorOperation = this.getErrorOperationNameTag(error, ctx);
116
+ if (errorOperation)
117
+ res.push(`error_operation:${errorOperation}`);
118
+ res.push(`error_class:${error?.constructor?.name || typeof error}`);
119
+ return res;
120
+ }
121
+ getErrorOperationNameTag(error, ctx) {
122
+ const errorContext = error.trackedContext;
123
+ return errorContext ? this.getOperationNameTag(errorContext) : this.getOperationNameTag(ctx);
124
+ }
125
+ getOperationNameTag(ctx) {
126
+ return OperationDecorator_1.OperationDecorator.getOperationName(ctx);
127
+ }
128
+ }
129
+ exports.OperationStats = OperationStats;
130
+ //# sourceMappingURL=OperationStats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationStats.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationStats.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAEvD,6DAAyD;AA0BzD,MAAsB,cAAc;IAGlC,MAAM,CAAC,sBAAsB,CAAC,IAA2B;QACvD,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAA;IAC/G,CAAC;IAGD,aAAa,CAAC,GAA0B;QACtC,MAAM,MAAM,GAAG,uCAAkB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAA;QAE7B,QAAQ,GAAG,CAAC,KAAK,EAAE;YACjB,KAAK,KAAK;gBACR,OAAO,GAAG,MAAM,MAAM,CAAA;YACxB,KAAK,OAAO;gBACV,OAAO,GAAG,MAAM,QAAQ,CAAA;YAC1B,KAAK,SAAS,CAAC;YACf;gBACE,OAAO,GAAG,MAAM,EAAE,CAAA;SACrB;IACH,CAAC;IAED,KAAK,CAAC,GAA0B;QAC9B,GAAG,CAAC,IAAI,GAAG,EAAE,CAAA;QACb,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI;YAAE,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,EAAE,CAAA;QACxD,OAAO,GAAG,EAAE;YACV,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;YAC1C,IAAI,UAAU;gBACZ,IAAI,CAAC,mBAAmB,CAAC;oBACvB,OAAO,EAAE,GAAG;oBACZ,KAAK,EAAE,KAAK;oBACZ,WAAW,EAAE,KAAK;oBAClB,KAAK,EAAE;wBACL,MAAM,EAAE,UAAU;wBAClB,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,CAAC;wBACR,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC;qBACvD;iBACF,CAAC,CAAA;QACN,CAAC,CAAA;IACH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AM,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,EAAE;iBACjG,CAAC,CAAA;QACN,CAAC,CAAA;IACH,CAAC;IAED,kBAAkB,CAAC,GAA0B;QAC3C,MAAM,MAAM,GAAG,uCAAkB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAA;QAC7B,OAAO,GAAG,MAAM,WAAW,CAAA;IAC7B,CAAC;IAQD,oBAAoB,CAAC,KAAmB,EAAE,GAA0B;QAClE,MAAM,GAAG,GAAa,EAAE,CAAA;QACxB,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAChE,IAAI,cAAc;YAAE,GAAG,CAAC,IAAI,CAAC,mBAAmB,cAAc,EAAE,CAAC,CAAA;QACjE,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,EAAE,WAAW,EAAE,IAAI,IAAI,OAAO,KAAK,EAAE,CAAC,CAAA;QACnE,OAAO,GAAG,CAAA;IACZ,CAAC;IAQD,wBAAwB,CAAC,KAAmB,EAAE,GAA0B;QACtE,MAAM,YAAY,GAAG,KAAK,CAAC,cAAuC,CAAA;QAClE,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAA;IAC9F,CAAC;IAOD,mBAAmB,CAAC,GAA0B;QAC5C,OAAO,uCAAkB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;IACjD,CAAC;CACF;AAnJD,wCAmJC"}
@@ -0,0 +1,377 @@
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
+ const OperationLogger_1 = require("./OperationLogger");
10
+ const OperationStats_1 = require("./OperationStats");
11
+ const OperationDecorator_1 = require("./OperationDecorator");
12
+ class TestLogger extends OperationLogger_1.OperationLogger {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.logInfo = jest.fn();
16
+ this.logError = jest.fn();
17
+ }
18
+ static getTryCatchFinallyHook(ctx) {
19
+ return ctx.funcThis.logger;
20
+ }
21
+ }
22
+ class TestStats extends OperationStats_1.OperationStats {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.stats = jest.fn();
26
+ }
27
+ static getTryCatchFinallyHook(ctx) {
28
+ return ctx.funcThis.stats;
29
+ }
30
+ }
31
+ const testTrack = OperationDecorator_1.OperationDecorator.createDecoratorFactoryWithDefault(TestLogger, TestStats);
32
+ function createTestClass(decoratorArgs, testMethodImpl, asyncMethods) {
33
+ class MyTestTargetBase {
34
+ constructor() {
35
+ this.logger = new TestLogger();
36
+ this.stats = new TestStats();
37
+ this.testMethodImpl = jest.fn(testMethodImpl);
38
+ }
39
+ testMethod(...args) {
40
+ const instance = this;
41
+ if (asyncMethods)
42
+ return (async () => {
43
+ await new Promise((res) => setTimeout(res, 100));
44
+ return await testMethodImpl.apply(instance, args);
45
+ })();
46
+ return testMethodImpl.apply(instance, args);
47
+ }
48
+ }
49
+ __decorate([
50
+ testTrack(decoratorArgs)
51
+ ], MyTestTargetBase.prototype, "testMethod", null);
52
+ if (asyncMethods) {
53
+ class MyTestTargetAsync extends MyTestTargetBase {
54
+ async parentMethod(...args) {
55
+ return {
56
+ iAm: 'parent',
57
+ child: await this.childMethod(...args)
58
+ };
59
+ }
60
+ async childMethod(...args) {
61
+ return {
62
+ iAm: 'child',
63
+ testMethod: await this.testMethod(...args)
64
+ };
65
+ }
66
+ }
67
+ __decorate([
68
+ testTrack(decoratorArgs)
69
+ ], MyTestTargetAsync.prototype, "parentMethod", null);
70
+ __decorate([
71
+ testTrack(decoratorArgs)
72
+ ], MyTestTargetAsync.prototype, "childMethod", null);
73
+ return MyTestTargetAsync;
74
+ }
75
+ else {
76
+ class MyTestTargetSync extends MyTestTargetBase {
77
+ parentMethod(...args) {
78
+ return {
79
+ iAm: 'parent',
80
+ child: this.childMethod(...args)
81
+ };
82
+ }
83
+ childMethod(...args) {
84
+ return {
85
+ iAm: 'child',
86
+ testMethod: this.testMethod(...args)
87
+ };
88
+ }
89
+ }
90
+ __decorate([
91
+ testTrack(decoratorArgs)
92
+ ], MyTestTargetSync.prototype, "parentMethod", null);
93
+ __decorate([
94
+ testTrack(decoratorArgs)
95
+ ], MyTestTargetSync.prototype, "childMethod", null);
96
+ return MyTestTargetSync;
97
+ }
98
+ }
99
+ class MyCustomError extends Error {
100
+ constructor(msg) {
101
+ super(msg);
102
+ }
103
+ }
104
+ beforeEach(() => {
105
+ jest.clearAllMocks();
106
+ });
107
+ describe('pass through', () => {
108
+ describe.each([
109
+ ['async target method', true],
110
+ ['sync target method', false]
111
+ ])('%s', (_name, isAsync) => {
112
+ describe.each([
113
+ ['target method thows error', true],
114
+ ['target completes successfully', false]
115
+ ])('%s', (_name, throwError) => {
116
+ test.each([
117
+ undefined,
118
+ {},
119
+ { operation: 'test_method' },
120
+ {
121
+ onError(_e) { }
122
+ },
123
+ {
124
+ shouldLog: () => true,
125
+ shouldStats: () => true
126
+ },
127
+ {
128
+ shouldLog: () => false,
129
+ shouldStats: () => false
130
+ }
131
+ ])(`${throwError ? 'error' : 'result'} passed through. decoratorArgs: %s`, async (decoratorArgs) => {
132
+ const testMethod = function () {
133
+ if (throwError)
134
+ throw new MyCustomError('my custom error');
135
+ expect(this).toEqual(instance);
136
+ return {
137
+ instance: this,
138
+ result: 'success'
139
+ };
140
+ };
141
+ const TestClass = createTestClass(decoratorArgs, testMethod, isAsync);
142
+ const instance = new TestClass();
143
+ if (throwError) {
144
+ await expect(async () => await instance.testMethod()).rejects.toThrow('my custom error');
145
+ await expect(async () => await instance.parentMethod()).rejects.toThrow('my custom error');
146
+ }
147
+ else {
148
+ const resTestMethod = await instance.testMethod();
149
+ expect(resTestMethod.instance).toBe(instance);
150
+ expect(resTestMethod.result).toBe('success');
151
+ const resParentMethod = await instance.parentMethod();
152
+ expect(resParentMethod).toMatchObject({
153
+ iAm: 'parent',
154
+ child: { iAm: 'child', testMethod: { instance, result: 'success' } }
155
+ });
156
+ }
157
+ });
158
+ });
159
+ });
160
+ });
161
+ describe('log', () => {
162
+ describe.each([
163
+ ['async target method', true],
164
+ ['sync target method', false]
165
+ ])('%s', (_name, isAsync) => {
166
+ async function runTestMethod(args) {
167
+ const MyTestClass = createTestClass(args.decoratorArgs, args.testMethodImpl, isAsync);
168
+ const classInstance = new MyTestClass();
169
+ const testMethodMock = classInstance.testMethodImpl;
170
+ try {
171
+ const methodToRun = classInstance[args.methodToRun || 'testMethod'].bind(classInstance);
172
+ const testMethodResult = await methodToRun(...(args.methodArgs || []));
173
+ return { classInstance, testMethodResult, testMethodMock };
174
+ }
175
+ catch (e) {
176
+ return { classInstance, testMethodError: e, testMethodMock };
177
+ }
178
+ }
179
+ test('when method succeeds', async () => {
180
+ const testResult = await runTestMethod({ testMethodImpl: () => 'success' });
181
+ expect(testResult.testMethodResult).toBe('success');
182
+ expectLogInfo(testResult.classInstance.logger.logInfo, ['testMethod starting...'], ['testMethod succeeded after']);
183
+ expect(testResult.classInstance.logger.logError).toHaveBeenCalledTimes(0);
184
+ });
185
+ test('on method failing', async () => {
186
+ const testResult = await runTestMethod({
187
+ testMethodImpl: () => {
188
+ throw new MyCustomError('My custom error');
189
+ }
190
+ });
191
+ expect(testResult.testMethodError instanceof MyCustomError).toBe(true);
192
+ expectLogInfo(testResult.classInstance.logger.logInfo, ['testMethod starting...']);
193
+ expectLogError(testResult.classInstance.logger.logError, [
194
+ 'testMethod failed after',
195
+ 'MyCustomError',
196
+ testResult.testMethodError.message
197
+ ]);
198
+ });
199
+ test('shouldLog false', async () => {
200
+ const testResult = await runTestMethod({
201
+ decoratorArgs: { shouldLog: () => false },
202
+ testMethodImpl: () => 'success'
203
+ });
204
+ expect(testResult.testMethodResult).toBe('success');
205
+ expect(testResult.classInstance.logger.logInfo).toHaveBeenCalledTimes(0);
206
+ expect(testResult.classInstance.logger.logError).toHaveBeenCalledTimes(0);
207
+ });
208
+ test('shouldLog finally only', async () => {
209
+ const testResult = await runTestMethod({
210
+ decoratorArgs: { shouldLog: (t) => t.stage == 'finally' },
211
+ testMethodImpl: () => 'success'
212
+ });
213
+ expect(testResult.testMethodResult).toBe('success');
214
+ expectLogInfo(testResult.classInstance.logger.logInfo, ['testMethod succeeded after']);
215
+ });
216
+ test('onFinally hook to add extra data on error', async () => {
217
+ const myCustomError = new MyCustomError('My custom error');
218
+ const someExtraErrorMessage = 'some extra info about error';
219
+ const methodImpl = function (throwError) {
220
+ const op = testTrack.getCurrentOperation(this);
221
+ op?.onFinally.push(() => {
222
+ expect(!!op.error).toBe(throwError);
223
+ op.logs.push(someExtraErrorMessage);
224
+ });
225
+ if (throwError)
226
+ throw myCustomError;
227
+ else
228
+ return 'success';
229
+ };
230
+ const testResultSuccess = await runTestMethod({ testMethodImpl: methodImpl, methodArgs: [false] });
231
+ expect(testResultSuccess.testMethodResult).toBe('success');
232
+ expectLogInfo(testResultSuccess.classInstance.logger.logInfo, ['testMethod starting...'], ['testMethod succeeded after', someExtraErrorMessage]);
233
+ const testResultFailure = await runTestMethod({ testMethodImpl: methodImpl, methodArgs: [true] });
234
+ expect(testResultFailure.testMethodError).toBe(myCustomError);
235
+ expectLogInfo(testResultFailure.classInstance.logger.logInfo, ['testMethod starting...']);
236
+ expectLogError(testResultFailure.classInstance.logger.logError, [
237
+ 'testMethod failed after',
238
+ 'MyCustomError',
239
+ testResultFailure.testMethodError.message,
240
+ someExtraErrorMessage
241
+ ]);
242
+ });
243
+ test('onError for error wrapping', async () => {
244
+ const testResult = await runTestMethod({
245
+ decoratorArgs: {
246
+ onError: (ctx) => {
247
+ ctx.error = new MyCustomError('Wrapper error');
248
+ }
249
+ },
250
+ testMethodImpl: () => {
251
+ throw new MyCustomError('Child error');
252
+ }
253
+ });
254
+ expectLogError(testResult.classInstance.logger.logError, ['Wrapper error', 'Child error']);
255
+ expect(testResult.testMethodError.message).toBe('Wrapper error');
256
+ expect(testResult.testMethodError.underlyingError?.message).toBe('Child error');
257
+ });
258
+ test('child operations success: parentMethod > childMethod > testMethod', async () => {
259
+ const testRes = await runTestMethod({
260
+ testMethodImpl: () => 'test method',
261
+ methodToRun: 'parentMethod'
262
+ });
263
+ expect(testRes.testMethodResult).toMatchObject({
264
+ iAm: 'parent',
265
+ child: { iAm: 'child', testMethod: 'test method' }
266
+ });
267
+ const { logInfo } = testRes.classInstance.logger;
268
+ expectLogInfo(logInfo, ['parentMethod starting'], ['parentMethod > childMethod starting'], ['parentMethod > childMethod > testMethod starting'], ['parentMethod > childMethod > testMethod succeeded'], ['parentMethod > childMethod succeeded'], ['parentMethod succeeded']);
269
+ });
270
+ test('child operations failed: parentMethod > childMethod > testMethod', async () => {
271
+ const myCustomError = new MyCustomError('My custom error');
272
+ const testRes = await runTestMethod({
273
+ testMethodImpl: () => {
274
+ throw myCustomError;
275
+ },
276
+ methodToRun: 'parentMethod'
277
+ });
278
+ expect(testRes.testMethodError).toBe(myCustomError);
279
+ expectLogInfo(testRes.classInstance.logger.logInfo, ['parentMethod starting'], ['parentMethod > childMethod starting'], ['parentMethod > childMethod > testMethod starting']);
280
+ expectLogError(testRes.classInstance.logger.logError, ['parentMethod > childMethod > testMethod failed', myCustomError.message], ['parentMethod > childMethod failed'], ['parentMethod failed']);
281
+ });
282
+ });
283
+ });
284
+ describe('stats', () => {
285
+ describe.each([
286
+ ['async target method', true],
287
+ ['sync target method', false]
288
+ ])('%s', (_testName, isAsync) => {
289
+ describe.each([
290
+ ['target method thows error', true],
291
+ ['target completes successfully', false]
292
+ ])('%s', (_testName, _throwError) => {
293
+ const testMethod = jest.fn(function () {
294
+ if (_throwError)
295
+ throw new MyCustomError('My custom error');
296
+ return 'success';
297
+ });
298
+ test('try and finally. decoratorArgs undefined', async () => {
299
+ const TestClass = createTestClass(undefined, testMethod, isAsync);
300
+ const testInstance = new TestClass();
301
+ try {
302
+ await testInstance.testMethod();
303
+ }
304
+ catch (e) {
305
+ }
306
+ expect(testInstance.stats.stats).toHaveBeenCalledTimes(2);
307
+ const tags = [
308
+ _throwError ? 'error:true' : 'error:false',
309
+ ...(_throwError ? ['error_operation:testMethod', 'error_class:MyCustomError'] : [])
310
+ ];
311
+ expect(testInstance.stats.stats).toHaveBeenCalledWith({
312
+ metric: 'testMethod',
313
+ method: 'incr',
314
+ value: 1,
315
+ tags
316
+ });
317
+ expect(testInstance.stats.stats).toHaveBeenCalledWith({
318
+ metric: 'testMethod.duration',
319
+ method: 'histogram',
320
+ value: expect.any(Number),
321
+ tags
322
+ });
323
+ });
324
+ test('try and finally. shouldStats:only on try', async () => {
325
+ const TestClass = createTestClass({ shouldStats: (st) => st.event == 'try' }, testMethod, isAsync);
326
+ const testInstance = new TestClass();
327
+ try {
328
+ await testInstance.testMethod();
329
+ }
330
+ catch (e) {
331
+ }
332
+ expect(testInstance.stats.stats).toHaveBeenCalledTimes(1);
333
+ expect(testInstance.stats.stats).toHaveBeenCalledWith({
334
+ metric: 'testMethod.try',
335
+ method: 'incr',
336
+ value: 1,
337
+ tags: []
338
+ });
339
+ });
340
+ });
341
+ });
342
+ });
343
+ function expectLogInfo(logInfo, ...messagesContains) {
344
+ expect(logInfo).toHaveBeenCalledTimes(messagesContains.length);
345
+ if (!jest.isMockFunction(logInfo))
346
+ fail('logInfo is not a mock function');
347
+ else
348
+ for (const messageParts of messagesContains) {
349
+ const hasSomeMatches = logInfo.mock.calls.some((args) => {
350
+ const [message, _meta] = args;
351
+ return messageParts.every((part) => message.includes(part));
352
+ });
353
+ if (!hasSomeMatches) {
354
+ throw new Error(`expectLogInfo failed to match\nExpected: ${messageParts.join('*')}\nActual calls:\n${logInfo.mock.calls
355
+ .map((args) => args.join(', '))
356
+ .join('\n')}`);
357
+ }
358
+ }
359
+ }
360
+ function expectLogError(logError, ...messagesContains) {
361
+ expect(logError).toHaveBeenCalledTimes(messagesContains.length);
362
+ if (!jest.isMockFunction(logError))
363
+ fail('logInfo is not a mock function');
364
+ else
365
+ for (const messageParts of messagesContains) {
366
+ const hasSomeMatches = logError.mock.calls.some((args) => {
367
+ const [message, _meta] = args;
368
+ return messageParts.every((part) => message.includes(part));
369
+ });
370
+ if (!hasSomeMatches) {
371
+ throw new Error(`expectLogError failed to match\nExpected: ${messageParts.join('*')}\nActual calls:\n${logError.mock.calls
372
+ .map((args) => args.join(', '))
373
+ .join('\n')}`);
374
+ }
375
+ }
376
+ }
377
+ //# sourceMappingURL=OperationTracker.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationTracker.test.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationTracker.test.ts"],"names":[],"mappings":";;;;;;;;AAEA,uDAA2E;AAC3E,qDAAwE;AACxE,6DAA+E;AAI/E,MAAM,UAAW,SAAQ,iCAAe;IAAxC;;QACE,YAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;QACnB,aAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAItB,CAAC;IAHC,MAAM,CAAC,sBAAsB,CAAC,GAA2B;QACvD,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAA;IAC5B,CAAC;CACF;AAED,MAAM,SAAU,SAAQ,+BAAc;IAAtC;;QACE,UAAK,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAInB,CAAC;IAHC,MAAM,CAAC,sBAA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FromHookProviders, FuncFromHookProviders, OperationHookProvider } from './OperationDecorator';
2
+ import { TryCatchFinallyHook, TryCatchFinallyContext } from './wrapTryCatchFinallyPromisable';
3
+ declare type OperationTreeContext<TParentContext extends TryCatchFinallyContext = TryCatchFinallyContext> = TParentContext & {
4
+ parent?: OperationTreeContext<TParentContext>;
5
+ sharedContext: {};
6
+ };
7
+ export declare class OperationTree {
8
+ static getTryCatchFinallyHook(_ctx: OperationTreeContext): TryCatchFinallyHook<OperationTreeContext>;
9
+ static getPriority(): number;
10
+ static onTry(ctx: OperationTreeContext): void;
11
+ static onFinally(ctx: OperationTreeContext): () => void;
12
+ static getCurrentOperationFromTrackedClassInstance<TClassInstance>(classInstance: TClassInstance): OperationTreeContext<TryCatchFinallyContext<(this: any, ...args: any[]) => any>>;
13
+ static getCurrentOperationFromContext(ctx: OperationTreeContext): OperationTreeContext<TryCatchFinallyContext<(this: any, ...args: any[]) => any>>;
14
+ protected static setCurrentOperationToContext(ctx: OperationTreeContext, newCurrentOperation: OperationTreeContext | undefined): void;
15
+ static getOperationsStack<TContext extends OperationTreeContext>(ctx: TContext): TContext[];
16
+ static getDecoratorUtils(): {
17
+ getCurrentOperation(classInstance: any): OperationTreeContext | undefined;
18
+ };
19
+ }
20
+ export declare type CanGetCurrentOperation<TOperationHookProviders extends OperationHookProvider[]> = {
21
+ getCurrentOperation(classInstance: ThisParameterType<FuncFromHookProviders<TOperationHookProviders>>): ContextFromHookProviders<TOperationHookProviders> | undefined;
22
+ };
23
+ export {};
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationTree = void 0;
4
+ class OperationTree {
5
+ static getTryCatchFinallyHook(_ctx) {
6
+ return this;
7
+ }
8
+ static getPriority() {
9
+ return -1;
10
+ }
11
+ static onTry(ctx) {
12
+ const parent = this.getCurrentOperationFromContext(ctx);
13
+ ctx.sharedContext = parent?.sharedContext || {};
14
+ ctx.parent = parent;
15
+ this.setCurrentOperationToContext(ctx, ctx);
16
+ }
17
+ static onFinally(ctx) {
18
+ return () => {
19
+ this.setCurrentOperationToContext(ctx, ctx.parent);
20
+ };
21
+ }
22
+ static getCurrentOperationFromTrackedClassInstance(classInstance) {
23
+ return classInstance?.currentOperation;
24
+ }
25
+ static getCurrentOperationFromContext(ctx) {
26
+ return ctx.funcThis.currentOperation;
27
+ }
28
+ static setCurrentOperationToContext(ctx, newCurrentOperation) {
29
+ ctx.funcThis.currentOperation = newCurrentOperation;
30
+ }
31
+ static getOperationsStack(ctx) {
32
+ const stack = [];
33
+ let current = ctx;
34
+ while (current) {
35
+ stack.unshift(current);
36
+ current = current.parent;
37
+ }
38
+ return stack;
39
+ }
40
+ static getDecoratorUtils() {
41
+ return {
42
+ getCurrentOperation(classInstance) {
43
+ return classInstance?.currentOperation;
44
+ }
45
+ };
46
+ }
47
+ }
48
+ exports.OperationTree = OperationTree;
49
+ //# sourceMappingURL=OperationTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationTree.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/OperationTree.ts"],"names":[],"mappings":";;;AAWA,MAAa,aAAa;IACxB,MAAM,CAAC,sBAAsB,CAAC,IAA0B;QAEtD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,CAAC,WAAW;QAChB,OAAO,CAAC,CAAC,CAAA;IACX,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,GAAyB;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAA;QACvD,GAAG,CAAC,aAAa,GAAG,MAAM,EAAE,aAAa,IAAI,EAAE,CAAA;QAC/C,GAAG,CAAC,MAAM,GAAG,MAAM,CAAA;QACnB,IAAI,CAAC,4BAA4B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC7C,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,GAAyB;QACxC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,4BAA4B,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;QACpD,CAAC,CAAA;IACH,CAAC;IACD,MAAM,CAAC,2CAA2C,CAAiB,aAA6B;QAE9F,OAAQ,aAAqB,EAAE,gBAAwC,CAAA;IACzE,CAAC;IACD,MAAM,CAAC,8BAA8B,CAAC,GAAyB;QAC7D,OAAO,GAAG,CAAC,QAAQ,CAAC,gBAAwC,CAAA;IAC9D,CAAC;IACS,MAAM,CAAC,4BAA4B,CAC3C,GAAyB,EACzB,mBAAqD;QAErD,GAAG,CAAC,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAA;IACrD,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAwC,GAAa;QAC5E,MAAM,KAAK,GAAe,EAAE,CAAA;QAC5B,IAAI,OAAO,GAAG,GAAG,CAAA;QACjB,OAAO,OAAO,EAAE;YACd,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YAEtB,OAAO,GAAG,OAAO,CAAC,MAAkB,CAAA;SACrC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,CAAC,iBAAiB;QACtB,OAAO;YAEL,mBAAmB,CAAC,aAAkB;gBACpC,OAAO,aAAa,EAAE,gBAAgB,CAAA;YACxC,CAAC;SACF,CAAA;IACH,CAAC;CACF;AApDD,sCAoDC"}
@@ -0,0 +1,6 @@
1
+ import { TryCatchFinallyContext } from './wrapTryCatchFinallyPromisable';
2
+ export interface TrackedError<TContext extends TryCatchFinallyContext = TryCatchFinallyContext> extends Error {
3
+ underlyingError?: unknown;
4
+ trackedContext?: TContext;
5
+ [key: string]: any;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TrackedError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrackedError.js","sourceRoot":"","sources":["../../../../../src/destinations/engage/utils/operationTracking/TrackedError.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export * from './wrapTryCatchFinallyPromisable';
2
+ export * from './OperationDecorator';
3
+ export * from './GenericMethodDecorator';
4
+ export * from './OperationTree';
5
+ export * from './OperationFinallyHooks';
6
+ export * from './OperationLogger';
7
+ export * from './OperationDuration';
8
+ export * from './OperationStats';
9
+ export * from './OperationErrorHandler';
10
+ export * from './TrackedError';