@segment/action-destinations 3.119.0 → 3.119.1-val-test-destination.37

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 (191) hide show
  1. package/README.md +1 -1
  2. package/dist/destinations/actable-predictive/sendCustomEvent/index.js +1 -1
  3. package/dist/destinations/actable-predictive/sendCustomEvent/index.js.map +1 -1
  4. package/dist/destinations/actable-predictive/sendEmailEvent/index.js +1 -1
  5. package/dist/destinations/actable-predictive/sendEmailEvent/index.js.map +1 -1
  6. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js +1 -1
  7. package/dist/destinations/actable-predictive/sendTransactionEvent/index.js.map +1 -1
  8. package/dist/destinations/actable-predictive/sendWebEvent/index.js +1 -1
  9. package/dist/destinations/actable-predictive/sendWebEvent/index.js.map +1 -1
  10. package/dist/destinations/adobe-target/adobeTarget_operations.d.ts +2 -1
  11. package/dist/destinations/adobe-target/adobeTarget_operations.js +8 -4
  12. package/dist/destinations/adobe-target/adobeTarget_operations.js.map +1 -1
  13. package/dist/destinations/adobe-target/updateProfile/index.js +3 -11
  14. package/dist/destinations/adobe-target/updateProfile/index.js.map +1 -1
  15. package/dist/destinations/braze-cohorts/api/index.d.ts +15 -0
  16. package/dist/destinations/braze-cohorts/api/index.js +36 -0
  17. package/dist/destinations/braze-cohorts/api/index.js.map +1 -0
  18. package/dist/destinations/braze-cohorts/braze-cohorts-types.d.ts +10 -0
  19. package/dist/destinations/braze-cohorts/braze-cohorts-types.js +3 -0
  20. package/dist/destinations/braze-cohorts/braze-cohorts-types.js.map +1 -0
  21. package/dist/destinations/braze-cohorts/generated-types.d.ts +4 -0
  22. package/dist/destinations/braze-cohorts/generated-types.js +3 -0
  23. package/dist/destinations/braze-cohorts/generated-types.js.map +1 -0
  24. package/dist/destinations/braze-cohorts/index.d.ts +4 -0
  25. package/dist/destinations/braze-cohorts/index.js +53 -0
  26. package/dist/destinations/braze-cohorts/index.js.map +1 -0
  27. package/dist/destinations/braze-cohorts/syncAudiences/generated-types.d.ts +16 -0
  28. package/dist/destinations/braze-cohorts/syncAudiences/generated-types.js +3 -0
  29. package/dist/destinations/braze-cohorts/syncAudiences/generated-types.js.map +1 -0
  30. package/dist/destinations/braze-cohorts/syncAudiences/index.d.ts +5 -0
  31. package/dist/destinations/braze-cohorts/syncAudiences/index.js +158 -0
  32. package/dist/destinations/braze-cohorts/syncAudiences/index.js.map +1 -0
  33. package/dist/destinations/customerio/createUpdateObject/generated-types.d.ts +11 -0
  34. package/dist/destinations/customerio/createUpdateObject/generated-types.js +3 -0
  35. package/dist/destinations/customerio/createUpdateObject/generated-types.js.map +1 -0
  36. package/dist/destinations/customerio/createUpdateObject/index.d.ts +5 -0
  37. package/dist/destinations/customerio/createUpdateObject/index.js +102 -0
  38. package/dist/destinations/customerio/createUpdateObject/index.js.map +1 -0
  39. package/dist/destinations/customerio/createUpdatePerson/generated-types.d.ts +2 -0
  40. package/dist/destinations/customerio/createUpdatePerson/index.js +24 -0
  41. package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
  42. package/dist/destinations/customerio/index.js +9 -1
  43. package/dist/destinations/customerio/index.js.map +1 -1
  44. package/dist/destinations/engage-messaging-sendgrid/sendEmail/generated-types.d.ts +1 -0
  45. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +12 -0
  46. package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
  47. package/dist/destinations/engage-messaging-twilio/sendSms/generated-types.d.ts +1 -0
  48. package/dist/destinations/engage-messaging-twilio/sendSms/index.js +12 -0
  49. package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
  50. package/dist/destinations/facebook-conversions-api/addToCart/index.js +2 -1
  51. package/dist/destinations/facebook-conversions-api/addToCart/index.js.map +1 -1
  52. package/dist/destinations/facebook-conversions-api/custom/index.js +2 -1
  53. package/dist/destinations/facebook-conversions-api/custom/index.js.map +1 -1
  54. package/dist/destinations/facebook-conversions-api/generated-types.d.ts +1 -0
  55. package/dist/destinations/facebook-conversions-api/index.js +7 -1
  56. package/dist/destinations/facebook-conversions-api/index.js.map +1 -1
  57. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js +2 -1
  58. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js.map +1 -1
  59. package/dist/destinations/facebook-conversions-api/pageView/index.js +2 -1
  60. package/dist/destinations/facebook-conversions-api/pageView/index.js.map +1 -1
  61. package/dist/destinations/facebook-conversions-api/purchase/index.js +2 -1
  62. package/dist/destinations/facebook-conversions-api/purchase/index.js.map +1 -1
  63. package/dist/destinations/facebook-conversions-api/search/index.js +2 -1
  64. package/dist/destinations/facebook-conversions-api/search/index.js.map +1 -1
  65. package/dist/destinations/facebook-conversions-api/viewContent/index.js +2 -1
  66. package/dist/destinations/facebook-conversions-api/viewContent/index.js.map +1 -1
  67. package/dist/destinations/google-analytics-4/selectPromotion/index.js +0 -3
  68. package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
  69. package/dist/destinations/google-analytics-4/viewItem/index.js +1 -13
  70. package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
  71. package/dist/destinations/google-enhanced-conversions/index.js +2 -2
  72. package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
  73. package/dist/destinations/google-enhanced-conversions/postConversion/index.js +2 -2
  74. package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
  75. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +1 -1
  76. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
  77. package/dist/destinations/google-sheets-dev/generated-types.d.ts +2 -0
  78. package/dist/destinations/google-sheets-dev/generated-types.js +3 -0
  79. package/dist/destinations/google-sheets-dev/generated-types.js.map +1 -0
  80. package/dist/destinations/google-sheets-dev/index.d.ts +4 -0
  81. package/dist/destinations/google-sheets-dev/index.js +41 -0
  82. package/dist/destinations/google-sheets-dev/index.js.map +1 -0
  83. package/dist/destinations/google-sheets-dev/postSheet.types.d.ts +11 -0
  84. package/dist/destinations/google-sheets-dev/postSheet.types.js +3 -0
  85. package/dist/destinations/google-sheets-dev/postSheet.types.js.map +1 -0
  86. package/dist/destinations/index.js +5 -0
  87. package/dist/destinations/index.js.map +1 -1
  88. package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js +7 -1
  89. package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js.map +1 -1
  90. package/dist/destinations/salesforce/account/generated-types.d.ts +1 -0
  91. package/dist/destinations/salesforce/account/index.js +1 -0
  92. package/dist/destinations/salesforce/account/index.js.map +1 -1
  93. package/dist/destinations/salesforce/cases/generated-types.d.ts +1 -0
  94. package/dist/destinations/salesforce/cases/index.js +1 -0
  95. package/dist/destinations/salesforce/cases/index.js.map +1 -1
  96. package/dist/destinations/salesforce/contact/generated-types.d.ts +1 -0
  97. package/dist/destinations/salesforce/contact/index.js +1 -0
  98. package/dist/destinations/salesforce/contact/index.js.map +1 -1
  99. package/dist/destinations/salesforce/customObject/generated-types.d.ts +1 -0
  100. package/dist/destinations/salesforce/customObject/index.js +1 -0
  101. package/dist/destinations/salesforce/customObject/index.js.map +1 -1
  102. package/dist/destinations/salesforce/lead/generated-types.d.ts +1 -0
  103. package/dist/destinations/salesforce/lead/index.js +1 -0
  104. package/dist/destinations/salesforce/lead/index.js.map +1 -1
  105. package/dist/destinations/salesforce/opportunity/generated-types.d.ts +1 -0
  106. package/dist/destinations/salesforce/opportunity/index.js +1 -0
  107. package/dist/destinations/salesforce/opportunity/index.js.map +1 -1
  108. package/dist/destinations/salesforce/sf-operations.js +17 -6
  109. package/dist/destinations/salesforce/sf-operations.js.map +1 -1
  110. package/dist/destinations/salesforce/sf-properties.d.ts +1 -0
  111. package/dist/destinations/salesforce/sf-properties.js +11 -1
  112. package/dist/destinations/salesforce/sf-properties.js.map +1 -1
  113. package/dist/destinations/salesforce/sf-utils.js +9 -4
  114. package/dist/destinations/salesforce/sf-utils.js.map +1 -1
  115. package/dist/destinations/segment-profiles/errors.d.ts +14 -0
  116. package/dist/destinations/segment-profiles/errors.js +10 -0
  117. package/dist/destinations/segment-profiles/errors.js.map +1 -0
  118. package/dist/destinations/segment-profiles/generated-types.d.ts +4 -0
  119. package/dist/destinations/segment-profiles/generated-types.js +3 -0
  120. package/dist/destinations/segment-profiles/generated-types.js.map +1 -0
  121. package/dist/destinations/segment-profiles/helperFunctions.d.ts +8 -0
  122. package/dist/destinations/segment-profiles/helperFunctions.js +52 -0
  123. package/dist/destinations/segment-profiles/helperFunctions.js.map +1 -0
  124. package/dist/destinations/segment-profiles/index.d.ts +4 -0
  125. package/dist/destinations/segment-profiles/index.js +50 -0
  126. package/dist/destinations/segment-profiles/index.js.map +1 -0
  127. package/dist/destinations/segment-profiles/properties.d.ts +12 -0
  128. package/dist/destinations/segment-profiles/properties.js +26 -0
  129. package/dist/destinations/segment-profiles/properties.js.map +1 -0
  130. package/dist/destinations/segment-profiles/segment-properties.d.ts +6 -0
  131. package/dist/destinations/segment-profiles/segment-properties.js +33 -0
  132. package/dist/destinations/segment-profiles/segment-properties.js.map +1 -0
  133. package/dist/destinations/segment-profiles/sendGroup/generated-types.d.ts +9 -0
  134. package/dist/destinations/segment-profiles/sendGroup/generated-types.js +3 -0
  135. package/dist/destinations/segment-profiles/sendGroup/generated-types.js.map +1 -0
  136. package/dist/destinations/segment-profiles/sendGroup/index.d.ts +5 -0
  137. package/dist/destinations/segment-profiles/sendGroup/index.js +52 -0
  138. package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -0
  139. package/dist/destinations/segment-profiles/sendIdentify/generated-types.d.ts +9 -0
  140. package/dist/destinations/segment-profiles/sendIdentify/generated-types.js +3 -0
  141. package/dist/destinations/segment-profiles/sendIdentify/generated-types.js.map +1 -0
  142. package/dist/destinations/segment-profiles/sendIdentify/index.d.ts +5 -0
  143. package/dist/destinations/segment-profiles/sendIdentify/index.js +52 -0
  144. package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -0
  145. package/dist/destinations/snap-conversions-api/_tests_/index.test.js +1 -1
  146. package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
  147. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +1 -1
  148. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
  149. package/dist/destinations/val-test-destination/generated-types.d.ts +2 -0
  150. package/dist/destinations/val-test-destination/generated-types.js +3 -0
  151. package/dist/destinations/val-test-destination/generated-types.js.map +1 -0
  152. package/dist/destinations/val-test-destination/index.d.ts +4 -0
  153. package/dist/destinations/val-test-destination/index.js +17 -0
  154. package/dist/destinations/val-test-destination/index.js.map +1 -0
  155. package/dist/destinations/val-test-destination/sendMessage/generated-types.d.ts +3 -0
  156. package/dist/destinations/val-test-destination/sendMessage/generated-types.js +3 -0
  157. package/dist/destinations/val-test-destination/sendMessage/generated-types.js.map +1 -0
  158. package/dist/destinations/val-test-destination/sendMessage/index.d.ts +5 -0
  159. package/dist/destinations/val-test-destination/sendMessage/index.js +22 -0
  160. package/dist/destinations/val-test-destination/sendMessage/index.js.map +1 -0
  161. package/dist/destinations/vwo/generated-types.d.ts +3 -0
  162. package/dist/destinations/vwo/generated-types.js +3 -0
  163. package/dist/destinations/vwo/generated-types.js.map +1 -0
  164. package/dist/destinations/vwo/identifyUser/generated-types.d.ts +12 -0
  165. package/dist/destinations/vwo/identifyUser/generated-types.js +3 -0
  166. package/dist/destinations/vwo/identifyUser/generated-types.js.map +1 -0
  167. package/dist/destinations/vwo/identifyUser/index.d.ts +5 -0
  168. package/dist/destinations/vwo/identifyUser/index.js +80 -0
  169. package/dist/destinations/vwo/identifyUser/index.js.map +1 -0
  170. package/dist/destinations/vwo/index.d.ts +4 -0
  171. package/dist/destinations/vwo/index.js +60 -0
  172. package/dist/destinations/vwo/index.js.map +1 -0
  173. package/dist/destinations/vwo/pageVisit/generated-types.d.ts +10 -0
  174. package/dist/destinations/vwo/pageVisit/generated-types.js +3 -0
  175. package/dist/destinations/vwo/pageVisit/generated-types.js.map +1 -0
  176. package/dist/destinations/vwo/pageVisit/index.d.ts +5 -0
  177. package/dist/destinations/vwo/pageVisit/index.js +77 -0
  178. package/dist/destinations/vwo/pageVisit/index.js.map +1 -0
  179. package/dist/destinations/vwo/trackEvent/generated-types.d.ts +13 -0
  180. package/dist/destinations/vwo/trackEvent/generated-types.js +3 -0
  181. package/dist/destinations/vwo/trackEvent/generated-types.js.map +1 -0
  182. package/dist/destinations/vwo/trackEvent/index.d.ts +5 -0
  183. package/dist/destinations/vwo/trackEvent/index.js +86 -0
  184. package/dist/destinations/vwo/trackEvent/index.js.map +1 -0
  185. package/dist/destinations/vwo/types.d.ts +42 -0
  186. package/dist/destinations/vwo/types.js +3 -0
  187. package/dist/destinations/vwo/types.js.map +1 -0
  188. package/dist/destinations/vwo/utility.d.ts +13 -0
  189. package/dist/destinations/vwo/utility.js +59 -0
  190. package/dist/destinations/vwo/utility.js.map +1 -0
  191. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"sf-operations.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-operations.ts"],"names":[],"mappings":";;;AAAA,wDAAuE;AAEvE,6DAAuD;AACvD,yCAAyC;AAG5B,QAAA,WAAW,GAAG,OAAO,CAAA;AAKlC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IAClC,MAAM,QAAQ,GAAG,0DAA0D,CAAA;IAC3E,MAAM,IAAI,+BAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;AACrD,CAAC,CAAA;AAsCD,MAAqB,UAAU;IAI7B,YAAY,WAAmB,EAAE,OAAsB;QAOvD,iBAAY,GAAG,KAAK,EAAE,OAAuB,EAAE,OAAe,EAAE,EAAE;YAChE,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAEjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,iBAAiB,mBAAW,aAA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,EAAE,kBAAkB,EAAE,GAAG,CAAC,CAAC,CAAA;aAChG;YAED,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE;gBAC1B,OAAO,CAAC,EAAE,EAAE,IAAI,+BAAgB,CAAC,6CAA6C,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAC,CAAA;aAChH;YAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;gBACxE,OAAO,CAAC,EAAE,EAAE,IAAI,+BAAgB,CAAC,kCAAkC,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC,CAAA;aAC3F;YAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;QAC5C,CAAC,CAAA;QApRC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAC/E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAmRF;AA5RD,6BA4RC"}
@@ -3,6 +3,7 @@ export declare const operation: InputField;
3
3
  export declare const enable_batching: InputField;
4
4
  export declare const bulkUpsertExternalId: InputField;
5
5
  export declare const bulkUpdateRecordId: InputField;
6
+ export declare const recordMatcherOperator: InputField;
6
7
  export declare const traits: InputField;
7
8
  export declare const customFields: InputField;
8
9
  interface Payload {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateLookup = exports.customFields = exports.traits = exports.bulkUpdateRecordId = exports.bulkUpsertExternalId = exports.enable_batching = exports.operation = void 0;
3
+ exports.validateLookup = exports.customFields = exports.traits = exports.recordMatcherOperator = exports.bulkUpdateRecordId = exports.bulkUpsertExternalId = exports.enable_batching = exports.operation = void 0;
4
4
  const actions_core_1 = require("@segment/actions-core");
5
5
  exports.operation = {
6
6
  label: 'Operation',
@@ -43,6 +43,16 @@ exports.bulkUpdateRecordId = {
43
43
  description: 'The record id value to use for bulk update.',
44
44
  type: 'string'
45
45
  };
46
+ exports.recordMatcherOperator = {
47
+ label: 'Record Matchers Operator',
48
+ description: 'This field affects how Segment uses the record matchers to query Salesforce records. By default, Segment uses the "OR" operator to query Salesforce for a record. If you would like to query Salesforce records using a combination of multiple record matchers, change this to "AND".',
49
+ type: 'string',
50
+ choices: [
51
+ { label: 'OR', value: 'OR' },
52
+ { label: 'AND', value: 'AND' }
53
+ ],
54
+ default: 'OR'
55
+ };
46
56
  exports.traits = {
47
57
  label: 'Record Matchers',
48
58
  description: `The fields used to find Salesforce records for updates. **This is required if the operation is Update or Upsert.**
@@ -1 +1 @@
1
- {"version":3,"file":"sf-properties.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-properties.ts"],"names":[],"mappings":";;;AACA,wDAAwD;AAE3C,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EACT,kHAAkH;IACpH,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC/C,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,QAAQ,EAAE;QACpD,EAAE,KAAK,EAAE,gDAAgD,EAAE,KAAK,EAAE,QAAQ,EAAE;KAC7E;CACF,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,kWAAkW;IACpW,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;CACf,CAAA;AAEY,QAAA,oBAAoB,GAAe;IAC9C,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,gEAAgE;IAC7E,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,eAAe;IAChC,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,cAAc,EAAE;YACd,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,QAAQ;SACf;KACF;CACF,CAAA;AAEY,QAAA,kBAAkB,GAAe;IAC5C,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE;;;;;;;;GAQZ;IACD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,eAAe;CACjC,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE;;;;;;;GAOZ;IACD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;CAC5B,CAAA;AAOM,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,EAAE;IACjD,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;QACpE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,MAAM,IAAI,+BAAgB,CACxB,wDAAwD,EACxD,8BAA8B,EAC9B,GAAG,CACJ,CAAA;SACF;KACF;AACH,CAAC,CAAA;AAVY,QAAA,cAAc,kBAU1B"}
1
+ {"version":3,"file":"sf-properties.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-properties.ts"],"names":[],"mappings":";;;AACA,wDAAwD;AAE3C,QAAA,SAAS,GAAe;IACnC,KA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CACd,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE;;;;;;;;GAQZ;IACD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,eAAe;CACjC,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE;;;;;;;GAOZ;IACD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;CAC5B,CAAA;AAOM,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,EAAE;IACjD,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;QACpE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,MAAM,IAAI,+BAAgB,CACxB,wDAAwD,EACxD,8BAA8B,EAC9B,GAAG,CACJ,CAAA;SACF;KACF;AACH,CAAC,CAAA;AAVY,QAAA,cAAc,kBAU1B"}
@@ -20,6 +20,11 @@ const validateHeaderField = (field) => {
20
20
  throw new actions_core_1.IntegrationError(`Invalid character in field name: ${field}`, `Invalid character in field name: ${field}`, 400);
21
21
  }
22
22
  };
23
+ const escapeDoubleQuotes = (value) => {
24
+ if (typeof value !== 'string')
25
+ return value;
26
+ return value.replace(/"/g, '""');
27
+ };
23
28
  const buildHeaderMap = (payloads) => {
24
29
  const headerMap = new Map();
25
30
  for (let i = payloads.length - 1; i >= 0; i--) {
@@ -67,9 +72,9 @@ const buildCSVFromHeaderMap = (payloads, headerMap, n) => {
67
72
  if (headerMap.has(key)) {
68
73
  const column = headerMap.get(key);
69
74
  if (column !== undefined && column.length > 0 && column[column.length - 1][1] === i) {
70
- const value = column.pop();
71
- if (value !== undefined) {
72
- row += `"${value[0]}",`;
75
+ const valueTuple = column.pop();
76
+ if (valueTuple !== undefined && valueTuple[0] !== undefined && valueTuple[0] !== null) {
77
+ row += `"${escapeDoubleQuotes(valueTuple[0])}",`;
73
78
  noValueFound = false;
74
79
  }
75
80
  }
@@ -93,7 +98,7 @@ const getUniqueIdValue = (payload) => {
93
98
  if (payload.enable_batching && payload.operation === 'update' && payload.bulkUpdateRecordId) {
94
99
  return payload.bulkUpdateRecordId;
95
100
  }
96
- throw new actions_core_1.IntegrationError(`bulk ${payload.operation} is missing the required bulk ID`, `bulk ${payload.operation} is missing the required bulk ID`, 400);
101
+ return NO_VALUE;
97
102
  };
98
103
  const buildCSVData = (payloads, uniqueIdName) => {
99
104
  const headerMap = buildHeaderMap(payloads);
@@ -1 +1 @@
1
- {"version":3,"file":"sf-utils.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-utils.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAwD;AAExD,iEAAwC;AAExC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS;IACpC,WAAW;IACX,QAAQ;IACR,iBAAiB;IACjB,cAAc;IACd,sBAAsB;IACtB,oBAAoB;CACrB,CAAC,CAAA;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAA;AAEvB,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAQ,EAAE;IAClD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACvB,MAAM,IAAI,+BAAgB,CACxB,oCAAoC,KAAK,EAAE,EAC3C,oCAAoC,KAAK,EAAE,EAC3C,GAAG,CACJ,CAAA;KACF;AACH,CAAC,CAAA;AAUD,MAAM,cAAc,GAAG,CAAC,QAA0B,EAAmC,EAAE;IACrF,MAAM,SAAS,GAAG,IAAI,GAAG,EAA8B,CAAA;IAGvD,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QAC3B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,E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CAAC,oBAAoB,CAAC,eAAe,CAAA;KACpD;IAED,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,kBAAkB,EAAE;QAC3F,OAAO,OAAO,CAAC,kBAAkB,CAAA;KAClC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAQM,MAAM,YAAY,GAAG,CAAC,QAA0B,EAAE,YAAoB,EAAU,EAAE;IACvF,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IAC1C,IAAI,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;IAEjC,GAAG,IAAI,GAAG,YAAY,IAAI,GAAG,qBAAqB,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAExF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAPY,QAAA,YAAY,gBAOxB;AAID,MAAM,qBAAqB,GAAG,CAAC,GAAW,EAAU,EAAE;IACpD,MAAM,KAAK,GAAG,mBAAS,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACvD,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { HTTPError, IntegrationError } from '@segment/actions-core';
2
+ export declare class SegmentPublicAPIError extends HTTPError {
3
+ response: Response & {
4
+ errors: {
5
+ type: string;
6
+ message?: string;
7
+ field?: string;
8
+ data?: string;
9
+ status?: number;
10
+ };
11
+ };
12
+ }
13
+ export declare const MissingUserOrAnonymousIdThrowableError: IntegrationError;
14
+ export declare const InvalidEndpointSelectedThrowableError: IntegrationError;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvalidEndpointSelectedThrowableError = exports.MissingUserOrAnonymousIdThrowableError = exports.SegmentPublicAPIError = void 0;
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ class SegmentPublicAPIError extends actions_core_1.HTTPError {
6
+ }
7
+ exports.SegmentPublicAPIError = SegmentPublicAPIError;
8
+ exports.MissingUserOrAnonymousIdThrowableError = new actions_core_1.IntegrationError('Either `Anonymous ID` or `User ID` must be defined.', 'Missing Required Field', 400);
9
+ exports.InvalidEndpointSelectedThrowableError = new actions_core_1.IntegrationError('A valid endpoint must be selected. Please check your Segment settings.', 'Misconfigured Endpoint', 400);
10
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/errors.ts"],"names":[],"mappings":";;;AAAA,wDAAmE;AAEnE,MAAa,qBAAsB,SAAQ,wBAAS;CAUnD;AAVD,sDAUC;AAEY,QAAA,sCAAsC,GAAG,IAAI,+BAAgB,CACxE,qDAAqD,EACrD,wBAAwB,EACxB,GAAG,CACJ,CAAA;AAEY,QAAA,qCAAqC,GAAG,IAAI,+BAAgB,CACvE,wEAAwE,EACxE,wBAAwB,EACxB,GAAG,CACJ,CAAA"}
@@ -0,0 +1,4 @@
1
+ export interface Settings {
2
+ segment_papi_token: string;
3
+ endpoint: string;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { RequestClient, DynamicFieldResponse } from '@segment/actions-core';
2
+ interface GetEngageSpaceParams {
3
+ endpoint: string;
4
+ bearerToken: string;
5
+ }
6
+ export declare function getEngageSpaces(request: RequestClient, data: GetEngageSpaceParams): Promise<DynamicFieldResponse>;
7
+ export declare function generateSegmentAPIAuthHeaders(writeKey: string): string;
8
+ export {};
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateSegmentAPIAuthHeaders = exports.getEngageSpaces = void 0;
4
+ const properties_1 = require("./properties");
5
+ async function getEngageSpaces(request, data) {
6
+ let cursor = 'MA==';
7
+ const choices = [];
8
+ let response;
9
+ const segmentPAPIEndpoint = properties_1.SEGMENT_ENDPOINTS[data.endpoint || properties_1.DEFAULT_SEGMENT_ENDPOINT].papi;
10
+ do {
11
+ const publicApiUrl = `${segmentPAPIEndpoint}/sources?pagination%5Bcount%5D=${properties_1.PAGINATION_COUNT}&pagination%5Bcursor%5D=${cursor}`;
12
+ try {
13
+ response = await request(publicApiUrl, {
14
+ headers: {
15
+ authorization: `Bearer ${data.bearerToken}`
16
+ },
17
+ method: 'GET',
18
+ skipResponseCloning: true
19
+ });
20
+ for (const source of response.data.data.sources) {
21
+ if (source.metadata.slug !== 'personas-compute') {
22
+ continue;
23
+ }
24
+ choices.push({
25
+ label: source.name,
26
+ value: source.writeKeys[0]
27
+ });
28
+ }
29
+ }
30
+ catch (err) {
31
+ return {
32
+ choices: [],
33
+ error: {
34
+ message: err?.response?.errors?.message ?? 'Unknown Error',
35
+ code: err?.response?.statusText ?? 'Unknown Error'
36
+ }
37
+ };
38
+ }
39
+ if (response.data.data.pagination.next) {
40
+ cursor = response.data.data.pagination.next;
41
+ }
42
+ } while (response.data.data.pagination.next);
43
+ return {
44
+ choices
45
+ };
46
+ }
47
+ exports.getEngageSpaces = getEngageSpaces;
48
+ function generateSegmentAPIAuthHeaders(writeKey) {
49
+ return `Basic ${Buffer.from(writeKey + ':').toString('base64')}`;
50
+ }
51
+ exports.generateSegmentAPIAuthHeaders = generateSegmentAPIAuthHeaders;
52
+ //# sourceMappingURL=helperFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helperFunctions.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/helperFunctions.ts"],"names":[],"mappings":";;;AACA,6CAA4F;AAuCrF,KA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AAU,CAAC,IAAI,CAAA;SAC5C;KACF,QAAQ,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAC;IAE5C,OAAO;QACL,OAAO;KACR,CAAA;AACH,CAAC;AAnDD,0CAmDC;AAED,SAAgB,6BAA6B,CAAC,QAAgB;IAI5D,OAAO,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;AAClE,CAAC;AALD,sEAKC"}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const properties_1 = require("./properties");
7
+ const sendGroup_1 = __importDefault(require("./sendGroup"));
8
+ const sendIdentify_1 = __importDefault(require("./sendIdentify"));
9
+ const destination = {
10
+ name: 'Segment Profiles',
11
+ slug: 'actions-segment-profiles',
12
+ mode: 'cloud',
13
+ authentication: {
14
+ scheme: 'custom',
15
+ fields: {
16
+ segment_papi_token: {
17
+ label: 'Segment Public API Token',
18
+ description: 'The Segment Public API requires that you have an authentication token before you send requests. [This document](https://docs.segmentapis.com/tag/Getting-Started#section/Get-an-API-token) explains how to setup a token.',
19
+ type: 'string',
20
+ required: true
21
+ },
22
+ endpoint: {
23
+ label: 'Endpoint Region',
24
+ description: 'The region to send your data.',
25
+ type: 'string',
26
+ format: 'text',
27
+ choices: Object.keys(properties_1.SEGMENT_ENDPOINTS).map((key) => ({
28
+ label: properties_1.SEGMENT_ENDPOINTS[key].label,
29
+ value: key
30
+ })),
31
+ default: properties_1.DEFAULT_SEGMENT_ENDPOINT,
32
+ required: true
33
+ }
34
+ },
35
+ testAuthentication: async (request, { settings }) => {
36
+ const { endpoint } = settings;
37
+ return request(properties_1.SEGMENT_ENDPOINTS[endpoint || properties_1.DEFAULT_SEGMENT_ENDPOINT].papi, {
38
+ headers: {
39
+ authorization: `Bearer ${settings.segment_papi_token}`
40
+ }
41
+ });
42
+ }
43
+ },
44
+ actions: {
45
+ sendGroup: sendGroup_1.default,
46
+ sendIdentify: sendIdentify_1.default
47
+ }
48
+ };
49
+ exports.default = destination;
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAEA,6CAA0E;AAE1E,4DAAmC;AAEnC,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,kBAAkB,EAAE;gBAClB,KAAK,EAAE,0BAA0B;gBACjC,WAAW,EACT,2NAA2N;gBAC7N,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,+BAA+B;gBAC5C,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,8BAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;oBACpD,KAAK,EAAE,8BAAiB,CAAC,GAAG,CAAC,CAAC,KAAK;oBACnC,KAAK,EAAE,GAAG;iBACX,CAAC,CAAC;gBACH,OAAO,EAAE,qCAAwB;gBACjC,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAA;YAC7B,OAAO,OAAO,CAAC,8BAAiB,CAAC,QAAQ,IAAI,qCAAwB,CAAC,CAAC,IAAI,EAAE;gBAC3E,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,QAAQ,CAAC,kBAAkB,EAAE;iBACvD;aACF,CAAC,CAAA;QACJ,CAAC;KACF;IACD,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,12 @@
1
+ interface SegmentEndpoint {
2
+ label: string;
3
+ url: string;
4
+ cdn: string;
5
+ papi: string;
6
+ }
7
+ export declare const SEGMENT_ENDPOINTS: {
8
+ [key: string]: SegmentEndpoint;
9
+ };
10
+ export declare const DEFAULT_SEGMENT_ENDPOINT = "north_america";
11
+ export declare const PAGINATION_COUNT = 10;
12
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAGINATION_COUNT = exports.DEFAULT_SEGMENT_ENDPOINT = exports.SEGMENT_ENDPOINTS = void 0;
4
+ exports.SEGMENT_ENDPOINTS = {
5
+ north_america: {
6
+ label: 'North America',
7
+ url: 'https://api.segment.io/v1',
8
+ cdn: 'https://cdn.segment.com/v1',
9
+ papi: 'https://api.segmentapis.com'
10
+ },
11
+ europe: {
12
+ label: 'Europe',
13
+ url: 'https://events.eu1.segmentapis.com/v1',
14
+ cdn: 'https://cdn.segment.com/v1',
15
+ papi: 'https://eu1.api.segmentapis.com'
16
+ },
17
+ stage: {
18
+ label: 'Staging',
19
+ url: 'https://api.segment.build/v1',
20
+ cdn: 'https://cdn.segment.build/v1',
21
+ papi: 'https://api.segmentapis.build'
22
+ }
23
+ };
24
+ exports.DEFAULT_SEGMENT_ENDPOINT = 'north_america';
25
+ exports.PAGINATION_COUNT = 10;
26
+ //# sourceMappingURL=properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/properties.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAAuC;IACnE,aAAa,EAAE;QACb,KAAK,EAAE,eAAe;QACtB,GAAG,EAAE,2BAA2B;QAChC,GAAG,EAAE,4BAA4B;QACjC,IAAI,EAAE,6BAA6B;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,uCAAuC;QAC5C,GAAG,EAAE,4BAA4B;QACjC,IAAI,EAAE,iCAAiC;KACxC;IACD,KAAK,EAAE;QACL,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,8BAA8B;QACnC,GAAG,EAAE,8BAA8B;QACnC,IAAI,EAAE,+BAA+B;KACtC;CACF,CAAA;AAEY,QAAA,wBAAwB,GAAG,eAAe,CAAA;AAE1C,QAAA,gBAAgB,GAAG,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { InputField } from '@segment/actions-core/src/destination-kit/types';
2
+ export declare const user_id: InputField;
3
+ export declare const anonymous_id: InputField;
4
+ export declare const group_id: InputField;
5
+ export declare const traits: InputField;
6
+ export declare const engage_space: InputField;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.engage_space = exports.traits = exports.group_id = exports.anonymous_id = exports.user_id = void 0;
4
+ exports.user_id = {
5
+ label: 'User ID',
6
+ description: 'Unique identifier for the user in your database. A userId or an anonymousId is required.',
7
+ type: 'string'
8
+ };
9
+ exports.anonymous_id = {
10
+ label: 'Anonymous ID',
11
+ description: 'A pseudo-unique substitute for a User ID, for cases when you don’t have an absolutely unique identifier. A userId or an anonymousId is required.',
12
+ type: 'string'
13
+ };
14
+ exports.group_id = {
15
+ label: 'Group ID',
16
+ description: 'The group or account ID a user is associated with.',
17
+ type: 'string'
18
+ };
19
+ exports.traits = {
20
+ label: 'Traits',
21
+ description: 'Free-form dictionary of traits that describe the user or group of users.',
22
+ type: 'object',
23
+ defaultObjectUI: 'keyvalue',
24
+ additionalProperties: true
25
+ };
26
+ exports.engage_space = {
27
+ label: 'Engage Space',
28
+ description: 'The engage space to use for creating a record.',
29
+ type: 'string',
30
+ required: true,
31
+ dynamic: true
32
+ };
33
+ //# sourceMappingURL=segment-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,gDAAgD;IAC7D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ engage_space: string;
3
+ user_id?: string;
4
+ anonymous_id?: string;
5
+ group_id: string;
6
+ traits?: {
7
+ [k: string]: unknown;
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendGroup/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const segment_properties_1 = require("../segment-properties");
4
+ const helperFunctions_1 = require("../helperFunctions");
5
+ const properties_1 = require("../properties");
6
+ const errors_1 = require("../errors");
7
+ const action = {
8
+ title: 'Send Group',
9
+ description: 'Send a group call to Segment’s tracking API. This is used to associate an individual user with a group',
10
+ defaultSubscription: 'type = "group"',
11
+ fields: {
12
+ engage_space: segment_properties_1.engage_space,
13
+ user_id: segment_properties_1.user_id,
14
+ anonymous_id: segment_properties_1.anonymous_id,
15
+ group_id: { ...segment_properties_1.group_id, required: true },
16
+ traits: segment_properties_1.traits
17
+ },
18
+ dynamicFields: {
19
+ engage_space: async (request, { settings }) => {
20
+ return helperFunctions_1.getEngageSpaces(request, {
21
+ endpoint: settings.endpoint,
22
+ bearerToken: settings.segment_papi_token
23
+ });
24
+ }
25
+ },
26
+ perform: (request, { payload, settings }) => {
27
+ if (!payload.anonymous_id && !payload.user_id) {
28
+ throw errors_1.MissingUserOrAnonymousIdThrowableError;
29
+ }
30
+ const groupPayload = {
31
+ userId: payload?.user_id,
32
+ anonymousId: payload?.anonymous_id,
33
+ groupId: payload?.group_id,
34
+ traits: {
35
+ ...payload?.traits
36
+ }
37
+ };
38
+ if (!settings.endpoint || !(settings.endpoint in properties_1.SEGMENT_ENDPOINTS)) {
39
+ throw errors_1.InvalidEndpointSelectedThrowableError;
40
+ }
41
+ const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
42
+ return request(`${selectedSegmentEndpoint}/group`, {
43
+ method: 'POST',
44
+ json: groupPayload,
45
+ headers: {
46
+ authorization: helperFunctions_1.generateSegmentAPIAuthHeaders(payload.engage_space)
47
+ }
48
+ });
49
+ }
50
+ };
51
+ exports.default = action;
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendGroup/index.ts"],"names":[],"mappings":";;AAGA,8DAA6F;AAC7F,wDAAmF;AACnF,8CAAiD;AACjD,sCAAyG;AAEzG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,wGAAwG;IACrH,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,YAAY,EAAZ,iCAAY;QACZ,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,QAAQ,EAAE,EAAE,GAAG,6BAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,MAAM,EAAN,2BAAM;KACP;IACD,aAAa,EAAE;QACb,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5C,OAAO,iCAAe,CAAC,OAAO,EAAE;gBAC9B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;gBAC3B,WAAW,EAAE,QAAQ,CAAC,kBAAkB;aACzC,CAAC,CAAA;QACJ,CAAC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QACD,MAAM,YAAY,GAAW;YAC3B,MAAM,EAAE,OAAO,EAAE,OAAO;YACxB,WAAW,EAAE,OAAO,EAAE,YAAY;YAClC,OAAO,EAAE,OAAO,EAAE,QAAQ;YAC1B,MAAM,EAAE;gBACN,GAAG,OAAO,EAAE,MAAM;aACnB;SACF,CAAA;QAGD,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,IAAI,8BAAiB,CAAC,EAAE;YACnE,MAAM,8CAAqC,CAAA;SAC5C;QAED,MAAM,uBAAuB,GAAG,8BAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAA;QACxE,OAAO,OAAO,CAAC,GAAG,uBAAuB,QAAQ,EAAE;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE;gBACP,aAAa,EAAE,+CAA6B,CAAC,OAAO,CAAC,YAAY,CAAC;aACnE;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ engage_space: string;
3
+ user_id?: string;
4
+ anonymous_id?: string;
5
+ group_id?: string;
6
+ traits?: {
7
+ [k: string]: unknown;
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendIdentify/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const segment_properties_1 = require("../segment-properties");
4
+ const helperFunctions_1 = require("../helperFunctions");
5
+ const properties_1 = require("../properties");
6
+ const errors_1 = require("../errors");
7
+ const action = {
8
+ title: 'Send Identify',
9
+ description: 'Send an identify call to Segment’s tracking API. This is used to tie your users to their actions and record traits about them.',
10
+ defaultSubscription: 'type = "identify"',
11
+ fields: {
12
+ engage_space: segment_properties_1.engage_space,
13
+ user_id: segment_properties_1.user_id,
14
+ anonymous_id: segment_properties_1.anonymous_id,
15
+ group_id: segment_properties_1.group_id,
16
+ traits: segment_properties_1.traits
17
+ },
18
+ dynamicFields: {
19
+ engage_space: async (request, { settings }) => {
20
+ return helperFunctions_1.getEngageSpaces(request, {
21
+ endpoint: settings.endpoint,
22
+ bearerToken: settings.segment_papi_token
23
+ });
24
+ }
25
+ },
26
+ perform: (request, { payload, settings }) => {
27
+ if (!payload.anonymous_id && !payload.user_id) {
28
+ throw errors_1.MissingUserOrAnonymousIdThrowableError;
29
+ }
30
+ const groupPayload = {
31
+ userId: payload?.user_id,
32
+ anonymousId: payload?.anonymous_id,
33
+ groupId: payload?.group_id,
34
+ traits: {
35
+ ...payload?.traits
36
+ }
37
+ };
38
+ if (!settings.endpoint || !(settings.endpoint in properties_1.SEGMENT_ENDPOINTS)) {
39
+ throw errors_1.InvalidEndpointSelectedThrowableError;
40
+ }
41
+ const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
42
+ return request(`${selectedSegmentEndpoint}/identify`, {
43
+ method: 'POST',
44
+ json: groupPayload,
45
+ headers: {
46
+ authorization: helperFunctions_1.generateSegmentAPIAuthHeaders(payload.engage_space)
47
+ }
48
+ });
49
+ }
50
+ };
51
+ exports.default = action;
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment-profiles/sendIdentify/index.ts"],"names":[],"mappings":";;AAGA,8DAA6F;AAC7F,wDAAmF;AACnF,8CAAiD;AACjD,sCAAyG;AAEzG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,gIAAgI;IAClI,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,YAAY,EAAZ,iCAAY;QACZ,OAAO,EAA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297
  });
298
298
  expect(responses).not.toBeNull();
299
299
  expect(responses[0].status).toBe(200);
300
- expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"integration\\":\\"segment\\",\\"event_type\\":\\"PURCHASE\\",\\"event_conversion_type\\":\\"WEB\\",\\"timestamp\\":1652368875449,\\"mobile_ad_id\\":\\"5af103f270fdc673b5e121ea929d1e47b2cee679e2059226a23c4cba37f8c9a9\\",\\"pixel_id\\":\\"test123\\"}"`);
300
+ expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"integration\\":\\"segment\\",\\"event_type\\":\\"PURCHASE\\",\\"event_conversion_type\\":\\"WEB\\",\\"timestamp\\":1652368875449,\\"hashed_mobile_ad_id\\":\\"5af103f270fdc673b5e121ea929d1e47b2cee679e2059226a23c4cba37f8c9a9\\",\\"pixel_id\\":\\"test123\\"}"`);
301
301
  });
302
302
  it('should handle event with ip and user_agent as only Snap identifiers', async () => {
303
303
  nock_1.default(conversionEventUrl).post('').reply(200, {});