@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,619 +1,346 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const actions_core_1 = require("@segment/actions-core");
3
+ exports.perform = exports.fields = void 0;
4
4
  const api_1 = require("../api");
5
5
  const utils_1 = require("../utils");
6
- const action = {
7
- title: 'Create or Update Individual Constituent',
8
- description: "Create or update an Individual Constituent record in Raiser's Edge NXT.",
9
- defaultSubscription: 'type = "identify"',
10
- fields: {
11
- address: {
12
- label: 'Address',
13
- description: "The constituent's address.",
14
- type: 'object',
15
- properties: {
16
- address_lines: {
17
- label: 'Address Lines',
18
- type: 'string'
19
- },
20
- city: {
21
- label: 'City',
22
- type: 'string'
23
- },
24
- country: {
25
- label: 'Country',
26
- type: 'string'
27
- },
28
- do_not_mail: {
29
- label: 'Do Not Mail',
30
- type: 'boolean'
31
- },
32
- postal_code: {
33
- label: 'ZIP/Postal Code',
34
- type: 'string'
35
- },
36
- primary: {
37
- label: 'Is Primary',
38
- type: 'boolean'
39
- },
40
- state: {
41
- label: 'State/Province',
42
- type: 'string'
43
- },
44
- type: {
45
- label: 'Address Type',
46
- type: 'string'
47
- }
6
+ exports.fields = {
7
+ address: {
8
+ label: 'Address',
9
+ description: "The constituent's address.",
10
+ type: 'object',
11
+ properties: {
12
+ address_lines: {
13
+ label: 'Address Lines',
14
+ type: 'string'
48
15
  },
49
- default: {
50
- address_lines: {
51
- '@if': {
52
- exists: {
53
- '@path': '$.traits.address.street'
54
- },
55
- then: {
56
- '@path': '$.traits.address.street'
57
- },
58
- else: {
59
- '@path': '$.properties.address.street'
60
- }
61
- }
62
- },
63
- city: {
64
- '@if': {
65
- exists: {
66
- '@path': '$.traits.address.city'
67
- },
68
- then: {
69
- '@path': '$.traits.address.city'
70
- },
71
- else: {
72
- '@path': '$.properties.address.city'
73
- }
74
- }
75
- },
76
- country: {
77
- '@if': {
78
- exists: {
79
- '@path': '$.traits.address.country'
80
- },
81
- then: {
82
- '@path': '$.traits.address.country'
83
- },
84
- else: {
85
- '@path': '$.properties.address.country'
86
- }
87
- }
88
- },
89
- do_not_mail: '',
90
- postal_code: {
91
- '@if': {
92
- exists: {
93
- '@path': '$.traits.address.postalCode'
94
- },
95
- then: {
96
- '@path': '$.traits.address.postalCode'
97
- },
98
- else: {
99
- '@path': '$.properties.address.postalCode'
100
- }
101
- }
102
- },
103
- primary: '',
104
- state: {
105
- '@if': {
106
- exists: {
107
- '@path': '$.traits.address.state'
108
- },
109
- then: {
110
- '@path': '$.traits.address.state'
111
- },
112
- else: {
113
- '@path': '$.properties.address.state'
114
- }
115
- }
116
- },
117
- type: ''
16
+ city: {
17
+ label: 'City',
18
+ type: 'string'
19
+ },
20
+ country: {
21
+ label: 'Country',
22
+ type: 'string'
23
+ },
24
+ do_not_mail: {
25
+ label: 'Do Not Mail',
26
+ type: 'boolean'
27
+ },
28
+ postal_code: {
29
+ label: 'ZIP/Postal Code',
30
+ type: 'string'
31
+ },
32
+ primary: {
33
+ label: 'Is Primary',
34
+ type: 'boolean'
35
+ },
36
+ state: {
37
+ label: 'State/Province',
38
+ type: 'string'
39
+ },
40
+ type: {
41
+ label: 'Address Type',
42
+ type: 'string'
118
43
  }
119
44
  },
120
- birthdate: {
121
- label: 'Birthdate',
122
- description: "The constituent's birthdate.",
123
- type: 'datetime',
124
- default: {
45
+ default: {
46
+ address_lines: {
125
47
  '@if': {
126
48
  exists: {
127
- '@path': '$.traits.birthday'
49
+ '@path': '$.traits.address.street'
128
50
  },
129
51
  then: {
130
- '@path': '$.traits.birthday'
52
+ '@path': '$.traits.address.street'
131
53
  },
132
54
  else: {
133
- '@path': '$.properties.birthday'
55
+ '@path': '$.properties.address.street'
134
56
  }
135
57
  }
136
- }
137
- },
138
- email: {
139
- label: 'Email',
140
- description: "The constituent's email address.",
141
- type: 'object',
142
- properties: {
143
- address: {
144
- label: 'Email Address',
145
- type: 'string'
146
- },
147
- do_not_email: {
148
- label: 'Do Not Email',
149
- type: 'boolean'
150
- },
151
- primary: {
152
- label: 'Is Primary',
153
- type: 'boolean'
154
- },
155
- type: {
156
- label: 'Email Type',
157
- type: 'string'
158
- }
159
58
  },
160
- default: {
161
- address: {
162
- '@if': {
163
- exists: {
164
- '@path': '$.traits.email'
165
- },
166
- then: {
167
- '@path': '$.traits.email'
168
- },
169
- else: {
170
- '@path': '$.properties.email'
171
- }
59
+ city: {
60
+ '@if': {
61
+ exists: {
62
+ '@path': '$.traits.address.city'
63
+ },
64
+ then: {
65
+ '@path': '$.traits.address.city'
66
+ },
67
+ else: {
68
+ '@path': '$.properties.address.city'
172
69
  }
173
- },
174
- do_not_email: '',
175
- primary: '',
176
- type: ''
177
- }
178
- },
179
- first: {
180
- label: 'First Name',
181
- description: "The constituent's first name up to 50 characters.",
182
- type: 'string',
183
- default: {
70
+ }
71
+ },
72
+ country: {
184
73
  '@if': {
185
74
  exists: {
186
- '@path': '$.traits.firstName'
75
+ '@path': '$.traits.address.country'
187
76
  },
188
77
  then: {
189
- '@path': '$.traits.firstName'
78
+ '@path': '$.traits.address.country'
190
79
  },
191
80
  else: {
192
- '@path': '$.properties.firstName'
81
+ '@path': '$.properties.address.country'
193
82
  }
194
83
  }
195
- }
196
- },
197
- gender: {
198
- label: 'Gender',
199
- description: "The constituent's gender.",
200
- type: 'string',
201
- default: {
84
+ },
85
+ do_not_mail: '',
86
+ postal_code: {
202
87
  '@if': {
203
88
  exists: {
204
- '@path': '$.traits.gender'
89
+ '@path': '$.traits.address.postalCode'
205
90
  },
206
91
  then: {
207
- '@path': '$.traits.gender'
92
+ '@path': '$.traits.address.postalCode'
208
93
  },
209
94
  else: {
210
- '@path': '$.properties.gender'
95
+ '@path': '$.properties.address.postalCode'
211
96
  }
212
97
  }
213
- }
214
- },
215
- income: {
216
- label: 'Income',
217
- description: "The constituent's income.",
218
- type: 'string'
219
- },
220
- last: {
221
- label: 'Last Name',
222
- description: "The constituent's last name up to 100 characters. This is required to create a constituent.",
223
- type: 'string',
224
- default: {
98
+ },
99
+ primary: '',
100
+ state: {
225
101
  '@if': {
226
102
  exists: {
227
- '@path': '$.traits.lastName'
103
+ '@path': '$.traits.address.state'
228
104
  },
229
105
  then: {
230
- '@path': '$.traits.lastName'
106
+ '@path': '$.traits.address.state'
231
107
  },
232
108
  else: {
233
- '@path': '$.properties.lastName'
109
+ '@path': '$.properties.address.state'
234
110
  }
235
111
  }
236
- }
237
- },
238
- lookup_id: {
239
- label: 'Lookup ID',
240
- description: 'The organization-defined identifier for the constituent.',
241
- type: 'string',
242
- default: ''
243
- },
244
- online_presence: {
245
- label: 'Online Presence',
246
- description: "The constituent's online presence.",
247
- type: 'object',
248
- properties: {
249
- address: {
250
- label: 'Web Address',
251
- type: 'string'
112
+ },
113
+ type: ''
114
+ }
115
+ },
116
+ birthdate: {
117
+ label: 'Birthdate',
118
+ description: "The constituent's birthdate.",
119
+ type: 'datetime',
120
+ default: {
121
+ '@if': {
122
+ exists: {
123
+ '@path': '$.traits.birthday'
252
124
  },
253
- primary: {
254
- label: 'Is Primary',
255
- type: 'boolean'
125
+ then: {
126
+ '@path': '$.traits.birthday'
256
127
  },
257
- type: {
258
- label: 'Online Presence Type',
259
- type: 'string'
128
+ else: {
129
+ '@path': '$.properties.birthday'
260
130
  }
131
+ }
132
+ }
133
+ },
134
+ constituent_id: {
135
+ label: 'Constituent ID',
136
+ description: 'The ID of the constituent.',
137
+ type: 'string'
138
+ },
139
+ email: {
140
+ label: 'Email',
141
+ description: "The constituent's email address.",
142
+ type: 'object',
143
+ properties: {
144
+ address: {
145
+ label: 'Email Address',
146
+ type: 'string'
261
147
  },
262
- default: {
263
- address: {
264
- '@if': {
265
- exists: {
266
- '@path': '$.traits.website'
267
- },
268
- then: {
269
- '@path': '$.traits.website'
270
- },
271
- else: {
272
- '@path': '$.properties.website'
273
- }
274
- }
275
- },
276
- primary: '',
277
- type: ''
148
+ do_not_email: {
149
+ label: 'Do Not Email',
150
+ type: 'boolean'
151
+ },
152
+ primary: {
153
+ label: 'Is Primary',
154
+ type: 'boolean'
155
+ },
156
+ type: {
157
+ label: 'Email Type',
158
+ type: 'string'
278
159
  }
279
160
  },
280
- phone: {
281
- label: 'Phone',
282
- description: "The constituent's phone number.",
283
- type: 'object',
284
- properties: {
285
- do_not_call: {
286
- label: 'Do Not Call',
287
- type: 'boolean'
288
- },
289
- number: {
290
- label: 'Phone Number',
291
- type: 'string'
292
- },
293
- primary: {
294
- label: 'Is Primary',
295
- type: 'boolean'
296
- },
297
- type: {
298
- label: 'Phone Type',
299
- type: 'string'
161
+ default: {
162
+ address: {
163
+ '@if': {
164
+ exists: {
165
+ '@path': '$.traits.email'
166
+ },
167
+ then: {
168
+ '@path': '$.traits.email'
169
+ },
170
+ else: {
171
+ '@path': '$.properties.email'
172
+ }
300
173
  }
301
174
  },
302
- default: {
303
- do_not_call: '',
304
- number: {
305
- '@if': {
306
- exists: {
307
- '@path': '$.traits.phone'
308
- },
309
- then: {
310
- '@path': '$.traits.phone'
311
- },
312
- else: {
313
- '@path': '$.properties.phone'
314
- }
315
- }
316
- },
317
- primary: '',
318
- type: ''
319
- }
175
+ do_not_email: '',
176
+ primary: '',
177
+ type: ''
320
178
  }
321
179
  },
322
- perform: async (request, { payload }) => {
323
- const blackbaudSkyApiClient = new api_1.BlackbaudSkyApi(request);
324
- let constituentId = undefined;
325
- if (payload.email?.address || payload.lookup_id) {
326
- let searchField = 'email_address';
327
- let searchText = payload.email?.address || '';
328
- if (payload.lookup_id) {
329
- searchField = 'lookup_id';
330
- searchText = payload.lookup_id;
331
- }
332
- const constituentSearchResponse = await blackbaudSkyApiClient.getExistingConstituents(searchField, searchText);
333
- const constituentSearchResults = await constituentSearchResponse.json();
334
- if (constituentSearchResults.count > 1) {
335
- throw new actions_core_1.IntegrationError('Multiple records returned for given traits', 'MULTIPLE_EXISTING_RECORDS', 400);
336
- }
337
- else if (constituentSearchResults.count === 1) {
338
- constituentId = constituentSearchResults.value[0].id;
339
- }
340
- }
341
- const constituentData = {
342
- first: payload.first,
343
- gender: payload.gender,
344
- income: payload.income,
345
- last: payload.last,
346
- lookup_id: payload.lookup_id
347
- };
348
- Object.keys(constituentData).forEach((key) => {
349
- if (!constituentData[key]) {
350
- delete constituentData[key];
351
- }
352
- });
353
- if (payload.birthdate) {
354
- const birthdateFuzzyDate = utils_1.dateStringToFuzzyDate(payload.birthdate);
355
- if (birthdateFuzzyDate) {
356
- constituentData.birthdate = birthdateFuzzyDate;
357
- }
358
- }
359
- let constituentAddressData = {};
360
- if (payload.address &&
361
- (payload.address.address_lines ||
362
- payload.address.city ||
363
- payload.address.country ||
364
- payload.address.postal_code ||
365
- payload.address.state) &&
366
- payload.address.type) {
367
- constituentAddressData = payload.address;
368
- }
369
- let constituentEmailData = {};
370
- if (payload.email && payload.email.address && payload.email.type) {
371
- constituentEmailData = payload.email;
372
- }
373
- let constituentOnlinePresenceData = {};
374
- if (payload.online_presence && payload.online_presence.address && payload.online_presence.type) {
375
- constituentOnlinePresenceData = payload.online_presence;
376
- }
377
- let constituentPhoneData = {};
378
- if (payload.phone && payload.phone.number && payload.phone.type) {
379
- constituentPhoneData = payload.phone;
380
- }
381
- if (!constituentId) {
382
- constituentData.type = 'Individual';
383
- if (!constituentData.last) {
384
- throw new actions_core_1.IntegrationError('Missing last name value', 'MISSING_REQUIRED_FIELD', 400);
385
- }
386
- else {
387
- if (Object.keys(constituentAddressData).length > 0) {
388
- constituentData.address = constituentAddressData;
389
- }
390
- if (Object.keys(constituentEmailData).length > 0) {
391
- constituentData.email = constituentEmailData;
392
- }
393
- if (Object.keys(constituentOnlinePresenceData).length > 0) {
394
- constituentData.online_presence = constituentOnlinePresenceData;
395
- }
396
- if (Object.keys(constituentPhoneData).length > 0) {
397
- constituentData.phone = constituentPhoneData;
180
+ first: {
181
+ label: 'First Name',
182
+ description: "The constituent's first name up to 50 characters.",
183
+ type: 'string',
184
+ default: {
185
+ '@if': {
186
+ exists: {
187
+ '@path': '$.traits.firstName'
188
+ },
189
+ then: {
190
+ '@path': '$.traits.firstName'
191
+ },
192
+ else: {
193
+ '@path': '$.properties.firstName'
398
194
  }
399
- await blackbaudSkyApiClient.createConstituent(constituentData);
400
195
  }
401
- return;
402
196
  }
403
- else {
404
- const integrationErrors = [];
405
- if (Object.keys(constituentData).length > 0) {
406
- const updateConstituentResponse = await blackbaudSkyApiClient.updateConstituent(constituentId, constituentData);
407
- if (updateConstituentResponse.status !== 200) {
408
- const statusCode = updateConstituentResponse.status;
409
- const errorMessage = statusCode
410
- ? `${statusCode} error occurred when updating constituent`
411
- : 'Error occurred when updating constituent';
412
- if (utils_1.isRequestErrorRetryable(statusCode)) {
413
- throw new actions_core_1.RetryableError(errorMessage);
414
- }
415
- else {
416
- integrationErrors.push(errorMessage);
417
- }
197
+ },
198
+ gender: {
199
+ label: 'Gender',
200
+ description: "The constituent's gender.",
201
+ type: 'string',
202
+ default: {
203
+ '@if': {
204
+ exists: {
205
+ '@path': '$.traits.gender'
206
+ },
207
+ then: {
208
+ '@path': '$.traits.gender'
209
+ },
210
+ else: {
211
+ '@path': '$.properties.gender'
418
212
  }
419
213
  }
420
- if (Object.keys(constituentAddressData).length > 0) {
421
- const getConstituentAddressListResponse = await blackbaudSkyApiClient.getConstituentAddressList(constituentId);
422
- let updateAddressErrorCode = undefined;
423
- if (getConstituentAddressListResponse.status !== 200) {
424
- updateAddressErrorCode = getConstituentAddressListResponse.status;
425
- }
426
- else {
427
- const constituentAddressListResults = await getConstituentAddressListResponse.json();
428
- let existingAddress = undefined;
429
- if (constituentAddressListResults.count > 0) {
430
- existingAddress = utils_1.filterObjectListByMatchFields(constituentAddressListResults.value, constituentAddressData, ['address_lines', 'city', 'postal_code', 'state']);
431
- }
432
- if (!existingAddress) {
433
- if (constituentAddressData.primary !== false && constituentAddressListResults.count === 0) {
434
- constituentAddressData.primary = true;
435
- }
436
- const createConstituentAddressResponse = await blackbaudSkyApiClient.createConstituentAddress(constituentId, constituentAddressData);
437
- if (createConstituentAddressResponse.status !== 200) {
438
- updateAddressErrorCode = createConstituentAddressResponse.status;
439
- }
440
- }
441
- else {
442
- if (existingAddress.inactive ||
443
- (constituentAddressData.do_not_mail !== undefined &&
444
- constituentAddressData.do_not_mail !== existingAddress.do_not_mail) ||
445
- (constituentAddressData.primary !== undefined &&
446
- constituentAddressData.primary &&
447
- constituentAddressData.primary !== existingAddress.primary) ||
448
- constituentAddressData.type !== existingAddress.type) {
449
- const updateConstituentAddressByIdResponse = await blackbaudSkyApiClient.updateConstituentAddressById(existingAddress.id, constituentAddressData);
450
- if (updateConstituentAddressByIdResponse.status !== 200) {
451
- updateAddressErrorCode = updateConstituentAddressByIdResponse.status;
452
- }
453
- }
454
- }
455
- }
456
- if (updateAddressErrorCode) {
457
- const errorMessage = updateAddressErrorCode
458
- ? `${updateAddressErrorCode} error occurred when updating constituent address`
459
- : 'Error occurred when updating constituent address';
460
- if (utils_1.isRequestErrorRetryable(updateAddressErrorCode)) {
461
- throw new actions_core_1.RetryableError(errorMessage);
462
- }
463
- else {
464
- integrationErrors.push(errorMessage);
465
- }
214
+ }
215
+ },
216
+ income: {
217
+ label: 'Income',
218
+ description: "The constituent's income.",
219
+ type: 'string'
220
+ },
221
+ last: {
222
+ label: 'Last Name',
223
+ description: "The constituent's last name up to 100 characters. This is required to create a constituent.",
224
+ type: 'string',
225
+ default: {
226
+ '@if': {
227
+ exists: {
228
+ '@path': '$.traits.lastName'
229
+ },
230
+ then: {
231
+ '@path': '$.traits.lastName'
232
+ },
233
+ else: {
234
+ '@path': '$.properties.lastName'
466
235
  }
467
236
  }
468
- if (Object.keys(constituentEmailData).length > 0) {
469
- const getConstituentEmailListResponse = await blackbaudSkyApiClient.getConstituentEmailList(constituentId);
470
- let updateEmailErrorCode = undefined;
471
- if (getConstituentEmailListResponse.status !== 200) {
472
- updateEmailErrorCode = getConstituentEmailListResponse.status;
473
- }
474
- else {
475
- const constituentEmailListResults = await getConstituentEmailListResponse.json();
476
- let existingEmail = undefined;
477
- if (constituentEmailListResults.count > 0) {
478
- existingEmail = utils_1.filterObjectListByMatchFields(constituentEmailListResults.value, constituentEmailData, [
479
- 'address'
480
- ]);
481
- }
482
- if (!existingEmail) {
483
- if (constituentEmailData.primary !== false && constituentEmailListResults.count === 0) {
484
- constituentEmailData.primary = true;
485
- }
486
- const createConstituentEmailResponse = await blackbaudSkyApiClient.createConstituentEmail(constituentId, constituentEmailData);
487
- if (createConstituentEmailResponse.status !== 200) {
488
- updateEmailErrorCode = createConstituentEmailResponse.status;
489
- }
490
- }
491
- else {
492
- if (existingEmail.inactive ||
493
- (constituentEmailData.do_not_email !== undefined &&
494
- constituentEmailData.do_not_email !== existingEmail.do_not_email) ||
495
- (constituentEmailData.primary !== undefined &&
496
- constituentEmailData.primary &&
497
- constituentEmailData.primary !== existingEmail.primary) ||
498
- constituentEmailData.type !== existingEmail.type) {
499
- const updateConstituentEmailByIdResponse = await blackbaudSkyApiClient.updateConstituentEmailById(existingEmail.id, constituentEmailData);
500
- if (updateConstituentEmailByIdResponse.status !== 200) {
501
- updateEmailErrorCode = updateConstituentEmailByIdResponse.status;
502
- }
503
- }
504
- }
505
- }
506
- if (updateEmailErrorCode) {
507
- const errorMessage = updateEmailErrorCode
508
- ? `${updateEmailErrorCode} error occurred when updating constituent email`
509
- : 'Error occurred when updating constituent email';
510
- if (utils_1.isRequestErrorRetryable(updateEmailErrorCode)) {
511
- throw new actions_core_1.RetryableError(errorMessage);
512
- }
513
- else {
514
- integrationErrors.push(errorMessage);
515
- }
516
- }
237
+ }
238
+ },
239
+ lookup_id: {
240
+ label: 'Lookup ID',
241
+ description: 'The organization-defined identifier for the constituent.',
242
+ type: 'string'
243
+ },
244
+ online_presence: {
245
+ label: 'Online Presence',
246
+ description: "The constituent's online presence.",
247
+ type: 'object',
248
+ properties: {
249
+ address: {
250
+ label: 'Web Address',
251
+ type: 'string'
252
+ },
253
+ primary: {
254
+ label: 'Is Primary',
255
+ type: 'boolean'
256
+ },
257
+ type: {
258
+ label: 'Online Presence Type',
259
+ type: 'string'
517
260
  }
518
- if (Object.keys(constituentOnlinePresenceData).length > 0) {
519
- const getConstituentOnlinePresenceListResponse = await blackbaudSkyApiClient.getConstituentOnlinePresenceList(constituentId);
520
- let updateOnlinePresenceErrorCode = undefined;
521
- if (getConstituentOnlinePresenceListResponse.status !== 200) {
522
- updateOnlinePresenceErrorCode = getConstituentOnlinePresenceListResponse.status;
523
- }
524
- else {
525
- const constituentOnlinePresenceListResults = await getConstituentOnlinePresenceListResponse.json();
526
- let existingOnlinePresence = undefined;
527
- if (constituentOnlinePresenceListResults.count > 0) {
528
- existingOnlinePresence = utils_1.filterObjectListByMatchFields(constituentOnlinePresenceListResults.value, constituentOnlinePresenceData, ['address']);
529
- }
530
- if (!existingOnlinePresence) {
531
- if (constituentOnlinePresenceData.primary !== false && constituentOnlinePresenceListResults.count === 0) {
532
- constituentOnlinePresenceData.primary = true;
533
- }
534
- const createConstituentOnlinePresenceResponse = await blackbaudSkyApiClient.createConstituentOnlinePresence(constituentId, constituentOnlinePresenceData);
535
- if (createConstituentOnlinePresenceResponse.status !== 200) {
536
- updateOnlinePresenceErrorCode = createConstituentOnlinePresenceResponse.status;
537
- }
538
- }
539
- else {
540
- if (existingOnlinePresence.inactive ||
541
- (constituentOnlinePresenceData.primary !== undefined &&
542
- constituentOnlinePresenceData.primary !== existingOnlinePresence.primary) ||
543
- constituentOnlinePresenceData.type !== existingOnlinePresence.type) {
544
- const updateConstituentOnlinePresenceByIdResponse = await blackbaudSkyApiClient.updateConstituentOnlinePresenceById(existingOnlinePresence.id, constituentOnlinePresenceData);
545
- if (updateConstituentOnlinePresenceByIdResponse.status !== 200) {
546
- updateOnlinePresenceErrorCode = updateConstituentOnlinePresenceByIdResponse.status;
547
- }
548
- }
549
- }
550
- }
551
- if (updateOnlinePresenceErrorCode) {
552
- const errorMessage = updateOnlinePresenceErrorCode
553
- ? `${updateOnlinePresenceErrorCode} error occurred when updating constituent online presence`
554
- : 'Error occurred when updating constituent online presence';
555
- if (utils_1.isRequestErrorRetryable(updateOnlinePresenceErrorCode)) {
556
- throw new actions_core_1.RetryableError(errorMessage);
557
- }
558
- else {
559
- integrationErrors.push(errorMessage);
261
+ },
262
+ default: {
263
+ address: {
264
+ '@if': {
265
+ exists: {
266
+ '@path': '$.traits.website'
267
+ },
268
+ then: {
269
+ '@path': '$.traits.website'
270
+ },
271
+ else: {
272
+ '@path': '$.properties.website'
560
273
  }
561
274
  }
275
+ },
276
+ primary: '',
277
+ type: ''
278
+ }
279
+ },
280
+ phone: {
281
+ label: 'Phone',
282
+ description: "The constituent's phone number.",
283
+ type: 'object',
284
+ properties: {
285
+ do_not_call: {
286
+ label: 'Do Not Call',
287
+ type: 'boolean'
288
+ },
289
+ number: {
290
+ label: 'Phone Number',
291
+ type: 'string'
292
+ },
293
+ primary: {
294
+ label: 'Is Primary',
295
+ type: 'boolean'
296
+ },
297
+ type: {
298
+ label: 'Phone Type',
299
+ type: 'string'
562
300
  }
563
- if (Object.keys(constituentPhoneData).length > 0) {
564
- const getConstituentPhoneListResponse = await blackbaudSkyApiClient.getConstituentPhoneList(constituentId);
565
- let updatePhoneErrorCode = undefined;
566
- if (getConstituentPhoneListResponse.status !== 200) {
567
- updatePhoneErrorCode = getConstituentPhoneListResponse.status;
568
- }
569
- else {
570
- const constituentPhoneListResults = await getConstituentPhoneListResponse.json();
571
- let existingPhone = undefined;
572
- if (constituentPhoneListResults.count > 0) {
573
- existingPhone = utils_1.filterObjectListByMatchFields(constituentPhoneListResults.value, constituentPhoneData, [
574
- 'int:number'
575
- ]);
576
- }
577
- if (!existingPhone) {
578
- if (constituentPhoneData.primary !== false && constituentPhoneListResults.count === 0) {
579
- constituentPhoneData.primary = true;
580
- }
581
- const createConstituentPhoneResponse = await blackbaudSkyApiClient.createConstituentPhone(constituentId, constituentPhoneData);
582
- if (createConstituentPhoneResponse.status !== 200) {
583
- updatePhoneErrorCode = createConstituentPhoneResponse.status;
584
- }
585
- }
586
- else {
587
- if (existingPhone.inactive ||
588
- (constituentPhoneData.do_not_call !== undefined &&
589
- constituentPhoneData.do_not_call !== existingPhone.do_not_call) ||
590
- (constituentPhoneData.primary !== undefined && constituentPhoneData.primary !== existingPhone.primary) ||
591
- constituentPhoneData.type !== existingPhone.type) {
592
- const updateConstituentPhoneByIdResponse = await blackbaudSkyApiClient.updateConstituentPhoneById(existingPhone.id, constituentPhoneData);
593
- if (updateConstituentPhoneByIdResponse.status !== 200) {
594
- updatePhoneErrorCode = updateConstituentPhoneByIdResponse.status;
595
- }
596
- }
597
- }
598
- }
599
- if (updatePhoneErrorCode) {
600
- const errorMessage = updatePhoneErrorCode
601
- ? `${updatePhoneErrorCode} error occurred when updating constituent online presence`
602
- : 'Error occurred when updating constituent online presence';
603
- if (utils_1.isRequestErrorRetryable(updatePhoneErrorCode)) {
604
- throw new actions_core_1.RetryableError(errorMessage);
605
- }
606
- else {
607
- integrationErrors.push(errorMessage);
301
+ },
302
+ default: {
303
+ do_not_call: '',
304
+ number: {
305
+ '@if': {
306
+ exists: {
307
+ '@path': '$.traits.phone'
308
+ },
309
+ then: {
310
+ '@path': '$.traits.phone'
311
+ },
312
+ else: {
313
+ '@path': '$.properties.phone'
608
314
  }
609
315
  }
610
- }
611
- if (integrationErrors.length > 0) {
612
- throw new actions_core_1.IntegrationError('One or more errors occurred when updating existing constituent: ' + integrationErrors.join(', '), 'UPDATE_CONSTITUENT_ERROR', 500);
613
- }
614
- return;
316
+ },
317
+ primary: '',
318
+ type: ''
615
319
  }
616
320
  }
617
321
  };
322
+ const perform = async (request, { payload }) => {
323
+ const blackbaudSkyApiClient = new api_1.BlackbaudSkyApi(request);
324
+ let constituentId = payload.constituent_id;
325
+ if (!constituentId && (payload.email?.address || payload.lookup_id)) {
326
+ const getExistingConstituentResponse = await blackbaudSkyApiClient.getExistingConstituent(payload.email, payload.lookup_id);
327
+ constituentId = getExistingConstituentResponse.id;
328
+ }
329
+ const [constituentData, addressData, emailData, onlinePresenceData, phoneData] = utils_1.splitConstituentPayload(payload);
330
+ if (!constituentId) {
331
+ return blackbaudSkyApiClient.createConstituentWithRelatedObjects(constituentData, addressData, emailData, onlinePresenceData, phoneData);
332
+ }
333
+ else {
334
+ return blackbaudSkyApiClient.updateConstituentWithRelatedObjects(constituentId, constituentData, addressData, emailData, onlinePresenceData, phoneData);
335
+ }
336
+ };
337
+ exports.perform = perform;
338
+ const action = {
339
+ title: 'Create or Update Individual Constituent',
340
+ description: "Create or update an Individual Constituent record in Raiser's Edge NXT.",
341
+ defaultSubscription: 'type = "identify"',
342
+ fields: exports.fields,
343
+ perform: exports.perform
344
+ };
618
345
  exports.default = action;
619
346
  //# sourceMappingURL=index.js.map