@segment/action-destinations 3.134.1-staging.1 → 3.136.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 (358) hide show
  1. package/dist/destinations/actable-predictive/index.js +1 -1
  2. package/dist/destinations/actable-predictive/index.js.map +1 -1
  3. package/dist/destinations/actable-predictive/sendCustomEvent/index.js +13 -13
  4. package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
  5. package/dist/destinations/actable-predictive/sendEmailEvent/index.js +20 -20
  6. package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
  7. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +28 -28
  8. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
  9. package/dist/destinations/actable-predictive/sendWebEvent/index.js +25 -25
  10. package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
  11. package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.d.ts +18 -12
  12. package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js +305 -32
  13. package/dist/destinations/blackbaud-raisers-edge-nxt/api/index.js.map +1 -1
  14. package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.d.ts +3 -1
  15. package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js +4 -2
  16. package/dist/destinations/blackbaud-raisers-edge-nxt/constants/index.js.map +1 -1
  17. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/fixtures.d.ts +4 -0
  18. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/fixtures.js +30 -0
  19. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/fixtures.js.map +1 -0
  20. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/generated-types.d.ts +53 -0
  21. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/generated-types.js.map +1 -0
  22. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/index.d.ts +5 -0
  23. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/index.js +146 -0
  24. package/dist/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/index.js.map +1 -0
  25. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/fixtures.d.ts +27 -0
  26. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/fixtures.js +60 -0
  27. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/fixtures.js.map +1 -0
  28. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/generated-types.d.ts +63 -0
  29. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/generated-types.js.map +1 -0
  30. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/index.js +230 -0
  31. package/dist/destinations/blackbaud-raisers-edge-nxt/createGift/index.js.map +1 -0
  32. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js +1 -1
  33. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/fixtures.js.map +1 -1
  34. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/generated-types.d.ts +1 -0
  35. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.d.ts +3 -1
  36. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js +277 -550
  37. package/dist/destinations/blackbaud-raisers-edge-nxt/createOrUpdateIndividualConstituent/index.js.map +1 -1
  38. package/dist/destinations/blackbaud-raisers-edge-nxt/index.js +4 -0
  39. package/dist/destinations/blackbaud-raisers-edge-nxt/index.js.map +1 -1
  40. package/dist/destinations/blackbaud-raisers-edge-nxt/types/index.d.ts +81 -8
  41. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +10 -1
  42. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js +195 -5
  43. package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.js.map +1 -1
  44. package/dist/destinations/braze/trackEvent/generated-types.d.ts +1 -0
  45. package/dist/destinations/braze/trackEvent/index.js +11 -35
  46. package/dist/destinations/braze/trackEvent/index.js.map +1 -1
  47. package/dist/destinations/braze/trackPurchase/index.js +2 -43
  48. package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
  49. package/dist/destinations/braze/utils.d.ts +7 -0
  50. package/dist/destinations/braze/utils.js +103 -0
  51. package/dist/destinations/braze/utils.js.map +1 -0
  52. package/dist/destinations/braze-cohorts/syncAudiences/index.js +1 -1
  53. package/dist/destinations/braze-cohorts/syncAudiences/index.js.map +1 -1
  54. package/dist/destinations/clevertap/userDelete/index.js +4 -4
  55. package/dist/destinations/clevertap/userDelete/index.js.map +1 -1
  56. package/dist/destinations/cordial/addContactToList/index.js.map +1 -1
  57. package/dist/destinations/cordial/addProductToCart/index.js +1 -1
  58. package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
  59. package/dist/destinations/cordial/cordial-client.js +2 -2
  60. package/dist/destinations/cordial/createContactactivity/index.js.map +1 -1
  61. package/dist/destinations/cordial/identities-fields.d.ts +1 -1
  62. package/dist/destinations/cordial/identities-fields.js +1 -1
  63. package/dist/destinations/cordial/identities-fields.js.map +1 -1
  64. package/dist/destinations/cordial/index.js +1 -1
  65. package/dist/destinations/cordial/index.js.map +1 -1
  66. package/dist/destinations/cordial/mergeContacts/index.js.map +1 -1
  67. package/dist/destinations/cordial/removeContactFromList/index.js.map +1 -1
  68. package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
  69. package/dist/destinations/cordial/upsertOrder/index.js +8 -8
  70. package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
  71. package/dist/destinations/criteo-audiences/addUserToAudience/generated-types.d.ts +1 -0
  72. package/dist/destinations/criteo-audiences/addUserToAudience/index.js +11 -2
  73. package/dist/destinations/criteo-audiences/addUserToAudience/index.js.map +1 -1
  74. package/dist/destinations/criteo-audiences/criteo-audiences.d.ts +1 -0
  75. package/dist/destinations/criteo-audiences/criteo-audiences.js +11 -2
  76. package/dist/destinations/criteo-audiences/criteo-audiences.js.map +1 -1
  77. package/dist/destinations/criteo-audiences/removeUserFromAudience/generated-types.d.ts +1 -0
  78. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js +11 -2
  79. package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js.map +1 -1
  80. package/dist/destinations/emarsys/triggerEvent/index.js +1 -0
  81. package/dist/destinations/emarsys/triggerEvent/index.js.map +1 -1
  82. package/dist/destinations/emarsys/upsertContact/generated-types.d.ts +1 -0
  83. package/dist/destinations/emarsys/upsertContact/index.js +1 -0
  84. package/dist/destinations/emarsys/upsertContact/index.js.map +1 -1
  85. package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +1 -1
  86. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +5 -2
  87. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
  88. package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.d.ts +1 -1
  89. package/dist/destinations/engage-messaging-twilio/sendSms/index.js +0 -1
  90. package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
  91. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +4 -1
  92. package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +1 -1
  93. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +1 -1
  94. package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +1 -1
  95. package/dist/destinations/facebook-conversions-api/addToCart/generated-types.d.ts +2 -0
  96. package/dist/destinations/facebook-conversions-api/custom/generated-types.d.ts +2 -0
  97. package/dist/destinations/facebook-conversions-api/fb-capi-properties.d.ts +2 -2
  98. package/dist/destinations/facebook-conversions-api/fb-capi-properties.js +2 -2
  99. package/dist/destinations/facebook-conversions-api/fb-capi-properties.js.map +1 -1
  100. package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +13 -1
  101. package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +1 -1
  102. package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.d.ts +2 -0
  103. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js.map +1 -1
  104. package/dist/destinations/facebook-conversions-api/pageView/generated-types.d.ts +2 -0
  105. package/dist/destinations/facebook-conversions-api/purchase/generated-types.d.ts +2 -0
  106. package/dist/destinations/facebook-conversions-api/purchase/index.js +3 -3
  107. package/dist/destinations/facebook-conversions-api/purchase/index.js.map +1 -1
  108. package/dist/destinations/facebook-conversions-api/search/generated-types.d.ts +2 -0
  109. package/dist/destinations/facebook-conversions-api/viewContent/generated-types.d.ts +2 -0
  110. package/dist/destinations/google-analytics-4/addPaymentInfo/generated-types.d.ts +3 -1
  111. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +14 -10
  112. package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
  113. package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +3 -1
  114. package/dist/destinations/google-analytics-4/addToCart/index.js +11 -7
  115. package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
  116. package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +3 -1
  117. package/dist/destinations/google-analytics-4/addToWishlist/index.js +13 -9
  118. package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
  119. package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +3 -1
  120. package/dist/destinations/google-analytics-4/beginCheckout/index.js +11 -7
  121. package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
  122. package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +3 -1
  123. package/dist/destinations/google-analytics-4/customEvent/index.js +10 -6
  124. package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
  125. package/dist/destinations/google-analytics-4/ga4-functions.d.ts +7 -0
  126. package/dist/destinations/google-analytics-4/ga4-functions.js +44 -7
  127. package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
  128. package/dist/destinations/google-analytics-4/ga4-properties.d.ts +2 -0
  129. package/dist/destinations/google-analytics-4/ga4-properties.js +17 -3
  130. package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
  131. package/dist/destinations/google-analytics-4/ga4-types.d.ts +14 -0
  132. package/dist/destinations/google-analytics-4/ga4-types.js +6 -0
  133. package/dist/destinations/google-analytics-4/ga4-types.js.map +1 -1
  134. package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +3 -1
  135. package/dist/destinations/google-analytics-4/generateLead/index.js +11 -7
  136. package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
  137. package/dist/destinations/google-analytics-4/generated-types.d.ts +2 -1
  138. package/dist/destinations/google-analytics-4/index.js +16 -11
  139. package/dist/destinations/google-analytics-4/index.js.map +1 -1
  140. package/dist/destinations/google-analytics-4/login/generated-types.d.ts +3 -1
  141. package/dist/destinations/google-analytics-4/login/index.js +10 -6
  142. package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
  143. package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +3 -1
  144. package/dist/destinations/google-analytics-4/pageView/index.js +10 -6
  145. package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
  146. package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +3 -1
  147. package/dist/destinations/google-analytics-4/purchase/index.js +11 -7
  148. package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
  149. package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +3 -1
  150. package/dist/destinations/google-analytics-4/refund/index.js +13 -9
  151. package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
  152. package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +3 -1
  153. package/dist/destinations/google-analytics-4/removeFromCart/index.js +13 -9
  154. package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
  155. package/dist/destinations/google-analytics-4/search/generated-types.d.ts +3 -1
  156. package/dist/destinations/google-analytics-4/search/index.js +10 -6
  157. package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
  158. package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +3 -1
  159. package/dist/destinations/google-analytics-4/selectItem/index.js +11 -7
  160. package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
  161. package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +3 -1
  162. package/dist/destinations/google-analytics-4/selectPromotion/index.js +11 -7
  163. package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
  164. package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +3 -1
  165. package/dist/destinations/google-analytics-4/signUp/index.js +10 -6
  166. package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
  167. package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +3 -1
  168. package/dist/destinations/google-analytics-4/viewCart/index.js +13 -9
  169. package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
  170. package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +3 -1
  171. package/dist/destinations/google-analytics-4/viewItem/index.js +11 -7
  172. package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
  173. package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +3 -1
  174. package/dist/destinations/google-analytics-4/viewItemList/index.js +11 -7
  175. package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
  176. package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +3 -1
  177. package/dist/destinations/google-analytics-4/viewPromotion/index.js +11 -7
  178. package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
  179. package/dist/destinations/google-enhanced-conversions/postConversion/index.js +2 -2
  180. package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
  181. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +1 -1
  182. package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
  183. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +1 -1
  184. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
  185. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +1 -1
  186. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
  187. package/dist/destinations/google-sheets-dev/index.js +3 -10
  188. package/dist/destinations/google-sheets-dev/index.js.map +1 -1
  189. package/dist/destinations/hubspot/errors.d.ts +2 -1
  190. package/dist/destinations/hubspot/errors.js +2 -1
  191. package/dist/destinations/hubspot/errors.js.map +1 -1
  192. package/dist/destinations/index.js +2 -2
  193. package/dist/destinations/index.js.map +1 -1
  194. package/dist/destinations/intercom/groupIdentifyContact/index.js +1 -0
  195. package/dist/destinations/intercom/groupIdentifyContact/index.js.map +1 -1
  196. package/dist/destinations/ironclad/recordAction.types.d.ts +12 -0
  197. package/dist/destinations/{braze-cohorts/cohortChanges.js → ironclad/recordAction.types.js} +1 -1
  198. package/dist/destinations/ironclad/recordAction.types.js.map +1 -0
  199. package/dist/destinations/linkedin-audiences/index.js +2 -2
  200. package/dist/destinations/linkedin-audiences/index.js.map +1 -1
  201. package/dist/destinations/mixpanel/index.js +1 -1
  202. package/dist/destinations/mixpanel/mixpanel-properties.js +0 -8
  203. package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
  204. package/dist/destinations/mixpanel/trackEvent/functions.js +1 -1
  205. package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
  206. package/dist/destinations/mixpanel/trackEvent/generated-types.d.ts +0 -3
  207. package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
  208. package/dist/destinations/mixpanel/trackPurchase/generated-types.d.ts +0 -3
  209. package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
  210. package/dist/destinations/outfunnel/forwardGroupEvent/generated-types.d.ts +14 -0
  211. package/dist/destinations/outfunnel/forwardGroupEvent/generated-types.js.map +1 -0
  212. package/dist/destinations/outfunnel/forwardGroupEvent/index.d.ts +5 -0
  213. package/dist/destinations/outfunnel/forwardGroupEvent/index.js +83 -0
  214. package/dist/destinations/outfunnel/forwardGroupEvent/index.js.map +1 -0
  215. package/dist/destinations/outfunnel/forwardIdentifyEvent/generated-types.d.ts +13 -0
  216. package/dist/destinations/outfunnel/forwardIdentifyEvent/generated-types.js.map +1 -0
  217. package/dist/destinations/outfunnel/forwardIdentifyEvent/index.d.ts +5 -0
  218. package/dist/destinations/outfunnel/forwardIdentifyEvent/index.js +76 -0
  219. package/dist/destinations/outfunnel/forwardIdentifyEvent/index.js.map +1 -0
  220. package/dist/destinations/outfunnel/forwardTrackEvent/generated-types.d.ts +15 -0
  221. package/dist/destinations/outfunnel/forwardTrackEvent/generated-types.js.map +1 -0
  222. package/dist/destinations/outfunnel/forwardTrackEvent/index.d.ts +5 -0
  223. package/dist/destinations/outfunnel/forwardTrackEvent/index.js +96 -0
  224. package/dist/destinations/outfunnel/forwardTrackEvent/index.js.map +1 -0
  225. package/dist/destinations/outfunnel/generated-types.d.ts +4 -0
  226. package/dist/destinations/outfunnel/generated-types.js.map +1 -0
  227. package/dist/destinations/outfunnel/index.js +54 -0
  228. package/dist/destinations/outfunnel/index.js.map +1 -0
  229. package/dist/destinations/outfunnel/presets.d.ts +2 -0
  230. package/dist/destinations/outfunnel/presets.js +31 -0
  231. package/dist/destinations/outfunnel/presets.js.map +1 -0
  232. package/dist/destinations/outfunnel/utils.d.ts +1 -0
  233. package/dist/destinations/outfunnel/utils.js +7 -0
  234. package/dist/destinations/outfunnel/utils.js.map +1 -0
  235. package/dist/destinations/qualtrics/qualtricsApiClient.js +3 -1
  236. package/dist/destinations/qualtrics/qualtricsApiClient.js.map +1 -1
  237. package/dist/destinations/ripe/group/index.js +0 -1
  238. package/dist/destinations/ripe/group/index.js.map +1 -1
  239. package/dist/destinations/ripe/identify/index.js +0 -1
  240. package/dist/destinations/ripe/identify/index.js.map +1 -1
  241. package/dist/destinations/ripe/page/index.js +0 -1
  242. package/dist/destinations/ripe/page/index.js.map +1 -1
  243. package/dist/destinations/ripe/track/index.js +0 -1
  244. package/dist/destinations/ripe/track/index.js.map +1 -1
  245. package/dist/destinations/salesforce/sf-properties.d.ts +0 -1
  246. package/dist/destinations/salesforce/sf-properties.js.map +1 -1
  247. package/dist/destinations/segment/errors.d.ts +3 -3
  248. package/dist/destinations/segment/errors.js +2 -2
  249. package/dist/destinations/segment/errors.js.map +1 -1
  250. package/dist/destinations/segment/segment-properties.js +2 -1
  251. package/dist/destinations/segment/segment-properties.js.map +1 -1
  252. package/dist/destinations/segment/sendTrack/generated-types.d.ts +1 -1
  253. package/dist/destinations/segment-profiles/errors.d.ts +3 -3
  254. package/dist/destinations/segment-profiles/errors.js +2 -2
  255. package/dist/destinations/segment-profiles/errors.js.map +1 -1
  256. package/dist/destinations/segment-profiles/segment-properties.js +1 -1
  257. package/dist/destinations/toplyne/constants.d.ts +1 -0
  258. package/dist/destinations/toplyne/constants.js +5 -0
  259. package/dist/destinations/toplyne/constants.js.map +1 -0
  260. package/dist/destinations/{google-sheets-partner → toplyne}/generated-types.d.ts +1 -0
  261. package/dist/destinations/toplyne/generated-types.js.map +1 -0
  262. package/dist/destinations/{tiktok-audiences → toplyne}/index.d.ts +1 -1
  263. package/dist/destinations/toplyne/index.js +69 -0
  264. package/dist/destinations/toplyne/index.js.map +1 -0
  265. package/dist/destinations/toplyne/sendAccountProfiles/generated-types.d.ts +7 -0
  266. package/dist/destinations/toplyne/sendAccountProfiles/generated-types.js +3 -0
  267. package/dist/destinations/toplyne/sendAccountProfiles/generated-types.js.map +1 -0
  268. package/dist/destinations/toplyne/sendAccountProfiles/index.js +49 -0
  269. package/dist/destinations/toplyne/sendAccountProfiles/index.js.map +1 -0
  270. package/dist/destinations/toplyne/sendEvents/generated-types.d.ts +10 -0
  271. package/dist/destinations/toplyne/sendEvents/generated-types.js +3 -0
  272. package/dist/destinations/toplyne/sendEvents/generated-types.js.map +1 -0
  273. package/dist/destinations/toplyne/sendEvents/index.js +70 -0
  274. package/dist/destinations/toplyne/sendEvents/index.js.map +1 -0
  275. package/dist/destinations/toplyne/sendUserProfiles/generated-types.d.ts +8 -0
  276. package/dist/destinations/toplyne/sendUserProfiles/generated-types.js +3 -0
  277. package/dist/destinations/toplyne/sendUserProfiles/generated-types.js.map +1 -0
  278. package/dist/destinations/toplyne/sendUserProfiles/index.js +56 -0
  279. package/dist/destinations/toplyne/sendUserProfiles/index.js.map +1 -0
  280. package/dist/destinations/twilio/sendSMS.types.d.ts +1 -0
  281. package/dist/destinations/voucherify/index.js +1 -1
  282. package/dist/destinations/voucherify/index.js.map +1 -1
  283. package/package.json +5 -4
  284. package/dist/destinations/actions-bingads/functions.d.ts +0 -0
  285. package/dist/destinations/actions-bingads/functions.js +0 -2
  286. package/dist/destinations/actions-bingads/functions.js.map +0 -1
  287. package/dist/destinations/actions-bingads/generated-types.d.ts +0 -10
  288. package/dist/destinations/actions-bingads/generated-types.js.map +0 -1
  289. package/dist/destinations/actions-bingads/index.js +0 -77
  290. package/dist/destinations/actions-bingads/index.js.map +0 -1
  291. package/dist/destinations/actions-bingads/offlineConversions/formatter.d.ts +0 -8
  292. package/dist/destinations/actions-bingads/offlineConversions/formatter.js +0 -33
  293. package/dist/destinations/actions-bingads/offlineConversions/formatter.js.map +0 -1
  294. package/dist/destinations/actions-bingads/offlineConversions/generated-types.d.ts +0 -7
  295. package/dist/destinations/actions-bingads/offlineConversions/generated-types.js.map +0 -1
  296. package/dist/destinations/actions-bingads/offlineConversions/index.js +0 -131
  297. package/dist/destinations/actions-bingads/offlineConversions/index.js.map +0 -1
  298. package/dist/destinations/braze-cohorts/cohortChanges.d.ts +0 -10
  299. package/dist/destinations/braze-cohorts/cohortChanges.js.map +0 -1
  300. package/dist/destinations/google-sheets-partner/constants.d.ts +0 -3
  301. package/dist/destinations/google-sheets-partner/constants.js +0 -7
  302. package/dist/destinations/google-sheets-partner/constants.js.map +0 -1
  303. package/dist/destinations/google-sheets-partner/generated-types.js.map +0 -1
  304. package/dist/destinations/google-sheets-partner/googleapis/index.d.ts +0 -17
  305. package/dist/destinations/google-sheets-partner/googleapis/index.js +0 -34
  306. package/dist/destinations/google-sheets-partner/googleapis/index.js.map +0 -1
  307. package/dist/destinations/google-sheets-partner/index.d.ts +0 -4
  308. package/dist/destinations/google-sheets-partner/index.js +0 -43
  309. package/dist/destinations/google-sheets-partner/index.js.map +0 -1
  310. package/dist/destinations/google-sheets-partner/postSheet/generated-types.d.ts +0 -11
  311. package/dist/destinations/google-sheets-partner/postSheet/generated-types.js.map +0 -1
  312. package/dist/destinations/google-sheets-partner/postSheet/index.js +0 -79
  313. package/dist/destinations/google-sheets-partner/postSheet/index.js.map +0 -1
  314. package/dist/destinations/google-sheets-partner/postSheet/operations.d.ts +0 -10
  315. package/dist/destinations/google-sheets-partner/postSheet/operations.js +0 -96
  316. package/dist/destinations/google-sheets-partner/postSheet/operations.js.map +0 -1
  317. package/dist/destinations/tiktok-audiences/addUser/generated-types.d.ts +0 -12
  318. package/dist/destinations/tiktok-audiences/addUser/generated-types.js.map +0 -1
  319. package/dist/destinations/tiktok-audiences/addUser/index.js +0 -47
  320. package/dist/destinations/tiktok-audiences/addUser/index.js.map +0 -1
  321. package/dist/destinations/tiktok-audiences/api/api.test.d.ts +0 -1
  322. package/dist/destinations/tiktok-audiences/api/api.test.js +0 -118
  323. package/dist/destinations/tiktok-audiences/api/api.test.js.map +0 -1
  324. package/dist/destinations/tiktok-audiences/api/index.d.ts +0 -13
  325. package/dist/destinations/tiktok-audiences/api/index.js +0 -93
  326. package/dist/destinations/tiktok-audiences/api/index.js.map +0 -1
  327. package/dist/destinations/tiktok-audiences/constants.d.ts +0 -2
  328. package/dist/destinations/tiktok-audiences/constants.js +0 -6
  329. package/dist/destinations/tiktok-audiences/constants.js.map +0 -1
  330. package/dist/destinations/tiktok-audiences/functions.d.ts +0 -14
  331. package/dist/destinations/tiktok-audiences/functions.js +0 -116
  332. package/dist/destinations/tiktok-audiences/functions.js.map +0 -1
  333. package/dist/destinations/tiktok-audiences/generated-types.d.ts +0 -3
  334. package/dist/destinations/tiktok-audiences/generated-types.js.map +0 -1
  335. package/dist/destinations/tiktok-audiences/index.js +0 -38
  336. package/dist/destinations/tiktok-audiences/index.js.map +0 -1
  337. package/dist/destinations/tiktok-audiences/properties.d.ts +0 -11
  338. package/dist/destinations/tiktok-audiences/properties.js +0 -80
  339. package/dist/destinations/tiktok-audiences/properties.js.map +0 -1
  340. package/dist/destinations/tiktok-audiences/removeUser/generated-types.d.ts +0 -12
  341. package/dist/destinations/tiktok-audiences/removeUser/generated-types.js.map +0 -1
  342. package/dist/destinations/tiktok-audiences/removeUser/index.js +0 -47
  343. package/dist/destinations/tiktok-audiences/removeUser/index.js.map +0 -1
  344. package/dist/destinations/tiktok-audiences/types.d.ts +0 -33
  345. package/dist/destinations/tiktok-audiences/types.js +0 -3
  346. package/dist/destinations/tiktok-audiences/types.js.map +0 -1
  347. /package/dist/destinations/{actions-bingads → blackbaud-raisers-edge-nxt/createConstituentAction}/generated-types.js +0 -0
  348. /package/dist/destinations/{actions-bingads/offlineConversions → blackbaud-raisers-edge-nxt/createGift}/generated-types.js +0 -0
  349. /package/dist/destinations/{google-sheets-partner/postSheet → blackbaud-raisers-edge-nxt/createGift}/index.d.ts +0 -0
  350. /package/dist/destinations/{google-sheets-partner → outfunnel/forwardGroupEvent}/generated-types.js +0 -0
  351. /package/dist/destinations/{google-sheets-partner/postSheet → outfunnel/forwardIdentifyEvent}/generated-types.js +0 -0
  352. /package/dist/destinations/{tiktok-audiences/addUser → outfunnel/forwardTrackEvent}/generated-types.js +0 -0
  353. /package/dist/destinations/{tiktok-audiences → outfunnel}/generated-types.js +0 -0
  354. /package/dist/destinations/{actions-bingads → outfunnel}/index.d.ts +0 -0
  355. /package/dist/destinations/{tiktok-audiences/removeUser → toplyne}/generated-types.js +0 -0
  356. /package/dist/destinations/{actions-bingads/offlineConversions → toplyne/sendAccountProfiles}/index.d.ts +0 -0
  357. /package/dist/destinations/{tiktok-audiences/addUser → toplyne/sendEvents}/index.d.ts +0 -0
  358. /package/dist/destinations/{tiktok-audiences/removeUser → toplyne/sendUserProfiles}/index.d.ts +0 -0
@@ -1,133 +1,406 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BlackbaudSkyApi = void 0;
4
+ const actions_core_1 = require("@segment/actions-core");
4
5
  const constants_1 = require("../constants");
6
+ const utils_1 = require("../utils");
5
7
  class BlackbaudSkyApi {
6
8
  constructor(request) {
7
9
  this.request = request;
8
10
  }
9
- async getExistingConstituents(searchField, searchText) {
10
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents/search?search_field=${searchField}&search_text=${searchText}`, {
11
+ async searchForConstituents(searchField, searchText) {
12
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents/search?search_field=${searchField}&search_text=${searchText}`, {
11
13
  method: 'get'
12
14
  });
13
15
  }
16
+ async getExistingConstituent(emailData, lookupId) {
17
+ let constituentId = undefined;
18
+ let searchField = 'email_address';
19
+ let searchText = emailData?.address || '';
20
+ if (lookupId) {
21
+ searchField = 'lookup_id';
22
+ searchText = lookupId;
23
+ }
24
+ const constituentSearchResponse = await this.searchForConstituents(searchField, searchText);
25
+ const constituentSearchResults = await constituentSearchResponse.json();
26
+ if (constituentSearchResults.count > 1) {
27
+ throw new actions_core_1.IntegrationError('Multiple records returned for given traits', 'MULTIPLE_EXISTING_RECORDS', 400);
28
+ }
29
+ else if (constituentSearchResults.count === 1) {
30
+ constituentId = constituentSearchResults.value[0].id;
31
+ }
32
+ else if (constituentSearchResults.count !== 0) {
33
+ throw new actions_core_1.IntegrationError('Unexpected constituent record count for given traits', 'UNEXPECTED_RECORD_COUNT', 500);
34
+ }
35
+ return Promise.resolve({
36
+ id: constituentId
37
+ });
38
+ }
14
39
  async createConstituent(constituentData) {
15
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents`, {
40
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents`, {
16
41
  method: 'post',
17
42
  json: constituentData
18
43
  });
19
44
  }
45
+ async createConstituentWithRelatedObjects(constituentData, addressData, emailData, onlinePresenceData, phoneData) {
46
+ constituentData.type = 'Individual';
47
+ if (!constituentData.last) {
48
+ throw new actions_core_1.IntegrationError('Missing last name value', 'MISSING_REQUIRED_FIELD', 400);
49
+ }
50
+ if (Object.keys(addressData).length > 0) {
51
+ constituentData.address = addressData;
52
+ }
53
+ if (Object.keys(emailData).length > 0) {
54
+ constituentData.email = emailData;
55
+ }
56
+ if (Object.keys(onlinePresenceData).length > 0) {
57
+ constituentData.online_presence = onlinePresenceData;
58
+ }
59
+ if (Object.keys(phoneData).length > 0) {
60
+ constituentData.phone = phoneData;
61
+ }
62
+ const createConstituentResponse = await this.createConstituent(constituentData);
63
+ const constituentResult = await createConstituentResponse.json();
64
+ return Promise.resolve({
65
+ id: constituentResult.id
66
+ });
67
+ }
20
68
  async updateConstituent(constituentId, constituentData) {
21
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents/${constituentId}`, {
69
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents/${constituentId}`, {
22
70
  method: 'patch',
23
71
  json: constituentData,
24
72
  throwHttpErrors: false
25
73
  });
26
74
  }
27
75
  async getConstituentAddressList(constituentId) {
28
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents/${constituentId}/addresses?include_inactive=true`, {
76
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents/${constituentId}/addresses?include_inactive=true`, {
29
77
  method: 'get',
30
78
  throwHttpErrors: false
31
79
  });
32
80
  }
33
- async createConstituentAddress(constituentId, constituentAddressData) {
34
- return this.request(`${constants_1.SKY_API_BASE_URL}/addresses`, {
81
+ async createConstituentAddress(constituentId, addressData) {
82
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/addresses`, {
35
83
  method: 'post',
36
84
  json: {
37
- ...constituentAddressData,
85
+ ...addressData,
38
86
  constituent_id: constituentId
39
87
  },
40
88
  throwHttpErrors: false
41
89
  });
42
90
  }
43
- async updateConstituentAddressById(addressId, constituentAddressData) {
44
- return this.request(`${constants_1.SKY_API_BASE_URL}/addresses/${addressId}`, {
91
+ async updateConstituentAddressById(addressId, addressData) {
92
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/addresses/${addressId}`, {
45
93
  method: 'patch',
46
94
  json: {
47
- ...constituentAddressData,
95
+ ...addressData,
48
96
  inactive: false
49
97
  },
50
98
  throwHttpErrors: false
51
99
  });
52
100
  }
53
101
  async getConstituentEmailList(constituentId) {
54
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents/${constituentId}/emailaddresses?include_inactive=true`, {
102
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents/${constituentId}/emailaddresses?include_inactive=true`, {
55
103
  method: 'get',
56
104
  throwHttpErrors: false
57
105
  });
58
106
  }
59
- async createConstituentEmail(constituentId, constituentEmailData) {
60
- return this.request(`${constants_1.SKY_API_BASE_URL}/emailaddresses`, {
107
+ async createConstituentEmail(constituentId, emailData) {
108
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/emailaddresses`, {
61
109
  method: 'post',
62
110
  json: {
63
- ...constituentEmailData,
111
+ ...emailData,
64
112
  constituent_id: constituentId
65
113
  },
66
114
  throwHttpErrors: false
67
115
  });
68
116
  }
69
- async updateConstituentEmailById(emailId, constituentEmailData) {
70
- return this.request(`${constants_1.SKY_API_BASE_URL}/emailaddresses/${emailId}`, {
117
+ async updateConstituentEmailById(emailId, emailData) {
118
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/emailaddresses/${emailId}`, {
71
119
  method: 'patch',
72
120
  json: {
73
- ...constituentEmailData,
121
+ ...emailData,
74
122
  inactive: false
75
123
  },
76
124
  throwHttpErrors: false
77
125
  });
78
126
  }
79
127
  async getConstituentOnlinePresenceList(constituentId) {
80
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents/${constituentId}/onlinepresences?include_inactive=true`, {
128
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents/${constituentId}/onlinepresences?include_inactive=true`, {
81
129
  method: 'get',
82
130
  throwHttpErrors: false
83
131
  });
84
132
  }
85
- async createConstituentOnlinePresence(constituentId, constituentOnlinePresenceData) {
86
- return this.request(`${constants_1.SKY_API_BASE_URL}/onlinepresences`, {
133
+ async createConstituentOnlinePresence(constituentId, onlinePresenceData) {
134
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/onlinepresences`, {
87
135
  method: 'post',
88
136
  json: {
89
- ...constituentOnlinePresenceData,
137
+ ...onlinePresenceData,
90
138
  constituent_id: constituentId
91
139
  },
92
140
  throwHttpErrors: false
93
141
  });
94
142
  }
95
- async updateConstituentOnlinePresenceById(onlinePresenceId, constituentOnlinePresenceData) {
96
- return this.request(`${constants_1.SKY_API_BASE_URL}/onlinepresences/${onlinePresenceId}`, {
143
+ async updateConstituentOnlinePresenceById(onlinePresenceId, onlinePresenceData) {
144
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/onlinepresences/${onlinePresenceId}`, {
97
145
  method: 'patch',
98
146
  json: {
99
- ...constituentOnlinePresenceData,
147
+ ...onlinePresenceData,
100
148
  inactive: false
101
149
  },
102
150
  throwHttpErrors: false
103
151
  });
104
152
  }
105
153
  async getConstituentPhoneList(constituentId) {
106
- return this.request(`${constants_1.SKY_API_BASE_URL}/constituents/${constituentId}/phones?include_inactive=true`, {
154
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/constituents/${constituentId}/phones?include_inactive=true`, {
107
155
  method: 'get',
108
156
  throwHttpErrors: false
109
157
  });
110
158
  }
111
- async createConstituentPhone(constituentId, constituentPhoneData) {
112
- return this.request(`${constants_1.SKY_API_BASE_URL}/phones`, {
159
+ async createConstituentPhone(constituentId, phoneData) {
160
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/phones`, {
113
161
  method: 'post',
114
162
  json: {
115
- ...constituentPhoneData,
163
+ ...phoneData,
116
164
  constituent_id: constituentId
117
165
  },
118
166
  throwHttpErrors: false
119
167
  });
120
168
  }
121
- async updateConstituentPhoneById(phoneId, constituentPhoneData) {
122
- return this.request(`${constants_1.SKY_API_BASE_URL}/phones/${phoneId}`, {
169
+ async updateConstituentWithRelatedObjects(constituentId, constituentData, addressData, emailData, onlinePresenceData, phoneData) {
170
+ const integrationErrors = [];
171
+ if (Object.keys(constituentData).length > 0) {
172
+ const updateConstituentResponse = await this.updateConstituent(constituentId, constituentData);
173
+ if (updateConstituentResponse.status !== 200) {
174
+ const statusCode = updateConstituentResponse.status;
175
+ const errorMessage = statusCode
176
+ ? `${statusCode} error occurred when updating constituent`
177
+ : 'Error occurred when updating constituent';
178
+ if (utils_1.isRequestErrorRetryable(statusCode)) {
179
+ throw new actions_core_1.RetryableError(errorMessage);
180
+ }
181
+ else {
182
+ integrationErrors.push(errorMessage);
183
+ }
184
+ }
185
+ }
186
+ if (Object.keys(addressData).length > 0) {
187
+ const getConstituentAddressListResponse = await this.getConstituentAddressList(constituentId);
188
+ let updateAddressErrorCode = undefined;
189
+ if (getConstituentAddressListResponse.status !== 200) {
190
+ updateAddressErrorCode = getConstituentAddressListResponse.status;
191
+ }
192
+ else {
193
+ const constituentAddressListResults = await getConstituentAddressListResponse.json();
194
+ let existingAddress = undefined;
195
+ if (constituentAddressListResults.count > 0) {
196
+ existingAddress = utils_1.filterObjectListByMatchFields(constituentAddressListResults.value, addressData, [
197
+ 'address_lines',
198
+ 'city',
199
+ 'postal_code',
200
+ 'state'
201
+ ]);
202
+ }
203
+ if (!existingAddress) {
204
+ if (addressData.primary !== false && constituentAddressListResults.count === 0) {
205
+ addressData.primary = true;
206
+ }
207
+ const createConstituentAddressResponse = await this.createConstituentAddress(constituentId, addressData);
208
+ if (createConstituentAddressResponse.status !== 200) {
209
+ updateAddressErrorCode = createConstituentAddressResponse.status;
210
+ }
211
+ }
212
+ else {
213
+ if (existingAddress.inactive ||
214
+ (addressData.do_not_mail !== undefined && addressData.do_not_mail !== existingAddress.do_not_mail) ||
215
+ (addressData.primary !== undefined &&
216
+ addressData.primary &&
217
+ addressData.primary !== existingAddress.primary) ||
218
+ addressData.type !== existingAddress.type) {
219
+ const updateConstituentAddressByIdResponse = await this.updateConstituentAddressById(existingAddress.id, addressData);
220
+ if (updateConstituentAddressByIdResponse.status !== 200) {
221
+ updateAddressErrorCode = updateConstituentAddressByIdResponse.status;
222
+ }
223
+ }
224
+ }
225
+ }
226
+ if (updateAddressErrorCode) {
227
+ const errorMessage = updateAddressErrorCode
228
+ ? `${updateAddressErrorCode} error occurred when updating constituent address`
229
+ : 'Error occurred when updating constituent address';
230
+ if (utils_1.isRequestErrorRetryable(updateAddressErrorCode)) {
231
+ throw new actions_core_1.RetryableError(errorMessage);
232
+ }
233
+ else {
234
+ integrationErrors.push(errorMessage);
235
+ }
236
+ }
237
+ }
238
+ if (Object.keys(emailData).length > 0) {
239
+ const getConstituentEmailListResponse = await this.getConstituentEmailList(constituentId);
240
+ let updateEmailErrorCode = undefined;
241
+ if (getConstituentEmailListResponse.status !== 200) {
242
+ updateEmailErrorCode = getConstituentEmailListResponse.status;
243
+ }
244
+ else {
245
+ const constituentEmailListResults = await getConstituentEmailListResponse.json();
246
+ let existingEmail = undefined;
247
+ if (constituentEmailListResults.count > 0) {
248
+ existingEmail = utils_1.filterObjectListByMatchFields(constituentEmailListResults.value, emailData, ['address']);
249
+ }
250
+ if (!existingEmail) {
251
+ if (emailData.primary !== false && constituentEmailListResults.count === 0) {
252
+ emailData.primary = true;
253
+ }
254
+ const createConstituentEmailResponse = await this.createConstituentEmail(constituentId, emailData);
255
+ if (createConstituentEmailResponse.status !== 200) {
256
+ updateEmailErrorCode = createConstituentEmailResponse.status;
257
+ }
258
+ }
259
+ else {
260
+ if (existingEmail.inactive ||
261
+ (emailData.do_not_email !== undefined && emailData.do_not_email !== existingEmail.do_not_email) ||
262
+ (emailData.primary !== undefined && emailData.primary && emailData.primary !== existingEmail.primary) ||
263
+ emailData.type !== existingEmail.type) {
264
+ const updateConstituentEmailByIdResponse = await this.updateConstituentEmailById(existingEmail.id, emailData);
265
+ if (updateConstituentEmailByIdResponse.status !== 200) {
266
+ updateEmailErrorCode = updateConstituentEmailByIdResponse.status;
267
+ }
268
+ }
269
+ }
270
+ }
271
+ if (updateEmailErrorCode) {
272
+ const errorMessage = updateEmailErrorCode
273
+ ? `${updateEmailErrorCode} error occurred when updating constituent email`
274
+ : 'Error occurred when updating constituent email';
275
+ if (utils_1.isRequestErrorRetryable(updateEmailErrorCode)) {
276
+ throw new actions_core_1.RetryableError(errorMessage);
277
+ }
278
+ else {
279
+ integrationErrors.push(errorMessage);
280
+ }
281
+ }
282
+ }
283
+ if (Object.keys(onlinePresenceData).length > 0) {
284
+ const getConstituentOnlinePresenceListResponse = await this.getConstituentOnlinePresenceList(constituentId);
285
+ let updateOnlinePresenceErrorCode = undefined;
286
+ if (getConstituentOnlinePresenceListResponse.status !== 200) {
287
+ updateOnlinePresenceErrorCode = getConstituentOnlinePresenceListResponse.status;
288
+ }
289
+ else {
290
+ const constituentOnlinePresenceListResults = await getConstituentOnlinePresenceListResponse.json();
291
+ let existingOnlinePresence = undefined;
292
+ if (constituentOnlinePresenceListResults.count > 0) {
293
+ existingOnlinePresence = utils_1.filterObjectListByMatchFields(constituentOnlinePresenceListResults.value, onlinePresenceData, ['address']);
294
+ }
295
+ if (!existingOnlinePresence) {
296
+ if (onlinePresenceData.primary !== false && constituentOnlinePresenceListResults.count === 0) {
297
+ onlinePresenceData.primary = true;
298
+ }
299
+ const createConstituentOnlinePresenceResponse = await this.createConstituentOnlinePresence(constituentId, onlinePresenceData);
300
+ if (createConstituentOnlinePresenceResponse.status !== 200) {
301
+ updateOnlinePresenceErrorCode = createConstituentOnlinePresenceResponse.status;
302
+ }
303
+ }
304
+ else {
305
+ if (existingOnlinePresence.inactive ||
306
+ (onlinePresenceData.primary !== undefined &&
307
+ onlinePresenceData.primary !== existingOnlinePresence.primary) ||
308
+ onlinePresenceData.type !== existingOnlinePresence.type) {
309
+ const updateConstituentOnlinePresenceByIdResponse = await this.updateConstituentOnlinePresenceById(existingOnlinePresence.id, onlinePresenceData);
310
+ if (updateConstituentOnlinePresenceByIdResponse.status !== 200) {
311
+ updateOnlinePresenceErrorCode = updateConstituentOnlinePresenceByIdResponse.status;
312
+ }
313
+ }
314
+ }
315
+ }
316
+ if (updateOnlinePresenceErrorCode) {
317
+ const errorMessage = updateOnlinePresenceErrorCode
318
+ ? `${updateOnlinePresenceErrorCode} error occurred when updating constituent online presence`
319
+ : 'Error occurred when updating constituent online presence';
320
+ if (utils_1.isRequestErrorRetryable(updateOnlinePresenceErrorCode)) {
321
+ throw new actions_core_1.RetryableError(errorMessage);
322
+ }
323
+ else {
324
+ integrationErrors.push(errorMessage);
325
+ }
326
+ }
327
+ }
328
+ if (Object.keys(phoneData).length > 0) {
329
+ const getConstituentPhoneListResponse = await this.getConstituentPhoneList(constituentId);
330
+ let updatePhoneErrorCode = undefined;
331
+ if (getConstituentPhoneListResponse.status !== 200) {
332
+ updatePhoneErrorCode = getConstituentPhoneListResponse.status;
333
+ }
334
+ else {
335
+ const constituentPhoneListResults = await getConstituentPhoneListResponse.json();
336
+ let existingPhone = undefined;
337
+ if (constituentPhoneListResults.count > 0) {
338
+ existingPhone = utils_1.filterObjectListByMatchFields(constituentPhoneListResults.value, phoneData, [
339
+ 'int:number'
340
+ ]);
341
+ }
342
+ if (!existingPhone) {
343
+ if (phoneData.primary !== false && constituentPhoneListResults.count === 0) {
344
+ phoneData.primary = true;
345
+ }
346
+ const createConstituentPhoneResponse = await this.createConstituentPhone(constituentId, phoneData);
347
+ if (createConstituentPhoneResponse.status !== 200) {
348
+ updatePhoneErrorCode = createConstituentPhoneResponse.status;
349
+ }
350
+ }
351
+ else {
352
+ if (existingPhone.inactive ||
353
+ (phoneData.do_not_call !== undefined && phoneData.do_not_call !== existingPhone.do_not_call) ||
354
+ (phoneData.primary !== undefined && phoneData.primary !== existingPhone.primary) ||
355
+ phoneData.type !== existingPhone.type) {
356
+ const updateConstituentPhoneByIdResponse = await this.updateConstituentPhoneById(existingPhone.id, phoneData);
357
+ if (updateConstituentPhoneByIdResponse.status !== 200) {
358
+ updatePhoneErrorCode = updateConstituentPhoneByIdResponse.status;
359
+ }
360
+ }
361
+ }
362
+ }
363
+ if (updatePhoneErrorCode) {
364
+ const errorMessage = updatePhoneErrorCode
365
+ ? `${updatePhoneErrorCode} error occurred when updating constituent online presence`
366
+ : 'Error occurred when updating constituent online presence';
367
+ if (utils_1.isRequestErrorRetryable(updatePhoneErrorCode)) {
368
+ throw new actions_core_1.RetryableError(errorMessage);
369
+ }
370
+ else {
371
+ integrationErrors.push(errorMessage);
372
+ }
373
+ }
374
+ }
375
+ if (integrationErrors.length > 0) {
376
+ throw new actions_core_1.IntegrationError('One or more errors occurred when updating existing constituent: ' + integrationErrors.join(', '), 'UPDATE_CONSTITUENT_ERROR', 500);
377
+ }
378
+ return Promise.resolve({
379
+ id: constituentId
380
+ });
381
+ }
382
+ async updateConstituentPhoneById(phoneId, phoneData) {
383
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/phones/${phoneId}`, {
123
384
  method: 'patch',
124
385
  json: {
125
- ...constituentPhoneData,
386
+ ...phoneData,
126
387
  inactive: false
127
388
  },
128
389
  throwHttpErrors: false
129
390
  });
130
391
  }
392
+ async createGift(giftData) {
393
+ return this.request(`${constants_1.SKY_API_GIFTS_URL}/gifts`, {
394
+ method: 'post',
395
+ json: giftData
396
+ });
397
+ }
398
+ async createConstituentAction(constituentActionData) {
399
+ return this.request(`${constants_1.SKY_API_CONSTITUENT_URL}/actions`, {
400
+ method: 'post',
401
+ json: constituentActionData
402
+ });
403
+ }
131
404
  }
132
405
  exports.BlackbaudSkyApi = BlackbaudSkyApi;
133
406
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/blackbaud-raisers-edge-nxt/api/index.ts"],"names":[],"mappings":";;;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EAAE,aAAa;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,0BAA0B,CAAC,OAAe,EAAE,SAAyB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,mCAAuB,WAAW,OAAO,EAAE,EAAE;YAClE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE;gBACJ,GAAG,SAAS;gBACZ,QAAQ,EAAE,KAAK;aAChB;YACD,eAAe,EAAE,KAAK;SACvB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAAc;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,6BAAiB,QAAQ,EAAE;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,qBAAwC;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,mCAAuB,UAAU,EAAE;YACxD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,qBAAqB;SAC5B,CAAC,CAAA;IACJ,CAAC;CACF;AA/hBD,0CA+hBC"}
@@ -1,2 +1,4 @@
1
- export declare const SKY_API_BASE_URL = "https://api.sky.blackbaud.com/constituent/v1";
2
1
  export declare const SKY_OAUTH2_TOKEN_URL = "https://oauth2.sky.blackbaud.com/token";
2
+ export declare const SKY_API_BASE_URL = "https://api.sky.blackbaud.com";
3
+ export declare const SKY_API_CONSTITUENT_URL: string;
4
+ export declare const SKY_API_GIFTS_URL: string;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SKY_OAUTH2_TOKEN_URL = exports.SKY_API_BASE_URL = void 0;
4
- exports.SKY_API_BASE_URL = 'https://api.sky.blackbaud.com/constituent/v1';
3
+ exports.SKY_API_GIFTS_URL = exports.SKY_API_CONSTITUENT_URL = exports.SKY_API_BASE_URL = exports.SKY_OAUTH2_TOKEN_URL = void 0;
5
4
  exports.SKY_OAUTH2_TOKEN_URL = 'https://oauth2.sky.blackbaud.com/token';
5
+ exports.SKY_API_BASE_URL = 'https://api.sky.blackbaud.com';
6
+ exports.SKY_API_CONSTITUENT_URL = `${exports.SKY_API_BASE_URL}/constituent/v1`;
7
+ exports.SKY_API_GIFTS_URL = `${exports.SKY_API_BASE_URL}/gift/v1`;
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/blackbaud-raisers-edge-nxt/constants/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,8CAA8C,CAAA;AACjE,QAAA,oBAAoB,GAAG,wCAAwC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/blackbaud-raisers-edge-nxt/constants/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,wCAAwC,CAAA;AAC/D,QAAA,gBAAgB,GAAG,+BAA+B,CAAA;AAClD,QAAA,uBAAuB,GAAG,GAAG,wBAAgB,iBAAiB,CAAA;AAC9D,QAAA,iBAAiB,GAAG,GAAG,wBAAgB,UAAU,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { SegmentEvent } from '@segment/actions-core';
2
+ export declare const trackEventData: Partial<SegmentEvent>;
3
+ export declare const trackEventDataNewConstituent: Partial<SegmentEvent>;
4
+ export declare const trackEventDataNoConstituent: Partial<SegmentEvent>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trackEventDataNoConstituent = exports.trackEventDataNewConstituent = exports.trackEventData = void 0;
4
+ exports.trackEventData = {
5
+ type: 'track',
6
+ properties: {
7
+ constituentId: '123',
8
+ category: 'Task/Other'
9
+ },
10
+ timestamp: '2022-12-12T19:11:01.249Z'
11
+ };
12
+ exports.trackEventDataNewConstituent = {
13
+ type: 'track',
14
+ properties: {
15
+ email: 'john@example.biz',
16
+ emailType: 'Personal',
17
+ firstName: 'John',
18
+ lastName: 'Doe',
19
+ category: 'Task/Other'
20
+ },
21
+ timestamp: '2022-12-12T19:11:01.249Z'
22
+ };
23
+ exports.trackEventDataNoConstituent = {
24
+ type: 'track',
25
+ properties: {
26
+ category: 'Task/Other'
27
+ },
28
+ timestamp: '2022-12-12T19:11:01.249Z'
29
+ };
30
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../../src/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/fixtures.ts"],"names":[],"mappings":";;;AAGa,QAAA,cAAc,GAA0B;IACnD,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,YAAY;KACvB;IACD,SAAS,EAAE,0BAA0B;CACtC,CAAA;AAEY,QAAA,4BAA4B,GAA0B;IACjE,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,KAAK,EAAE,kBAAkB;QACzB,SAAS,EAAE,UAAU;QACrB,SAAS,EAAE,MAAM;QACjB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,YAAY;KACvB;IACD,SAAS,EAAE,0BAA0B;CACtC,CAAA;AAEY,QAAA,2BAA2B,GAA0B;IAChE,IAAI,EAAE,OAAO;IACb,UAAU,EAAE;QACV,QAAQ,EAAE,YAAY;KACvB;IACD,SAAS,EAAE,0BAA0B;CACtC,CAAA"}
@@ -0,0 +1,53 @@
1
+ export interface Payload {
2
+ date: string | number;
3
+ category: string;
4
+ completed?: boolean;
5
+ completed_date?: string | number;
6
+ description?: string;
7
+ direction?: string;
8
+ end_time?: string;
9
+ fundraisers?: string[];
10
+ location?: string;
11
+ opportunity_id?: string;
12
+ outcome?: string;
13
+ priority?: string;
14
+ start_time?: string;
15
+ status?: string;
16
+ summary?: string;
17
+ type?: string;
18
+ author?: string;
19
+ constituent_address?: {
20
+ address_lines?: string;
21
+ city?: string;
22
+ country?: string;
23
+ do_not_mail?: boolean;
24
+ postal_code?: string;
25
+ primary?: boolean;
26
+ state?: string;
27
+ type?: string;
28
+ };
29
+ constituent_birthdate?: string | number;
30
+ constituent_id?: string;
31
+ constituent_email?: {
32
+ address?: string;
33
+ do_not_email?: boolean;
34
+ primary?: boolean;
35
+ type?: string;
36
+ };
37
+ constituent_first?: string;
38
+ constituent_gender?: string;
39
+ constituent_income?: string;
40
+ constituent_last?: string;
41
+ constituent_lookup_id?: string;
42
+ constituent_online_presence?: {
43
+ address?: string;
44
+ primary?: boolean;
45
+ type?: string;
46
+ };
47
+ constituent_phone?: {
48
+ do_not_call?: boolean;
49
+ number?: string;
50
+ primary?: boolean;
51
+ type?: string;
52
+ };
53
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/blackbaud-raisers-edge-nxt/createConstituentAction/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from '../createConstituentAction/generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;