@segment/action-destinations 3.242.0 → 3.243.0-snap-connector

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 (189) hide show
  1. package/dist/destinations/accoil-analytics/generated-types.d.ts +3 -0
  2. package/dist/destinations/accoil-analytics/generated-types.js +3 -0
  3. package/dist/destinations/accoil-analytics/generated-types.js.map +1 -0
  4. package/dist/destinations/accoil-analytics/index.d.ts +4 -0
  5. package/dist/destinations/accoil-analytics/index.js +69 -0
  6. package/dist/destinations/accoil-analytics/index.js.map +1 -0
  7. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.d.ts +5 -0
  8. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js +3 -0
  9. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js.map +1 -0
  10. package/dist/destinations/accoil-analytics/postToAccoil/index.d.ts +5 -0
  11. package/dist/destinations/accoil-analytics/postToAccoil/index.js +27 -0
  12. package/dist/destinations/accoil-analytics/postToAccoil/index.js.map +1 -0
  13. package/dist/destinations/app-fit/index.js +1 -1
  14. package/dist/destinations/app-fit/index.js.map +1 -1
  15. package/dist/destinations/avo/index.d.ts +1 -1
  16. package/dist/destinations/avo/index.js +10 -0
  17. package/dist/destinations/avo/index.js.map +1 -1
  18. package/dist/destinations/avo/sendSchemaToInspector/avo.js +1 -1
  19. package/dist/destinations/avo/sendSchemaToInspector/avo.js.map +1 -1
  20. package/dist/destinations/avo/sendSchemaToInspector/generated-types.d.ts +1 -1
  21. package/dist/destinations/avo/sendSchemaToInspector/index.js +4 -4
  22. package/dist/destinations/avo/sendSchemaToInspector/index.js.map +1 -1
  23. package/dist/destinations/customerio/deleteObject/generated-types.d.ts +4 -0
  24. package/dist/destinations/customerio/deleteObject/generated-types.js +3 -0
  25. package/dist/destinations/customerio/deleteObject/generated-types.js.map +1 -0
  26. package/dist/destinations/customerio/deleteObject/index.d.ts +5 -0
  27. package/dist/destinations/customerio/deleteObject/index.js +48 -0
  28. package/dist/destinations/customerio/deleteObject/index.js.map +1 -0
  29. package/dist/destinations/customerio/deletePerson/generated-types.d.ts +3 -0
  30. package/dist/destinations/customerio/deletePerson/generated-types.js +3 -0
  31. package/dist/destinations/customerio/deletePerson/generated-types.js.map +1 -0
  32. package/dist/destinations/customerio/deletePerson/index.d.ts +5 -0
  33. package/dist/destinations/customerio/deletePerson/index.js +41 -0
  34. package/dist/destinations/customerio/deletePerson/index.js.map +1 -0
  35. package/dist/destinations/customerio/deleteRelationship/generated-types.d.ts +6 -0
  36. package/dist/destinations/customerio/deleteRelationship/generated-types.js +3 -0
  37. package/dist/destinations/customerio/deleteRelationship/generated-types.js.map +1 -0
  38. package/dist/destinations/customerio/deleteRelationship/index.d.ts +5 -0
  39. package/dist/destinations/customerio/deleteRelationship/index.js +82 -0
  40. package/dist/destinations/customerio/deleteRelationship/index.js.map +1 -0
  41. package/dist/destinations/customerio/index.js +12 -0
  42. package/dist/destinations/customerio/index.js.map +1 -1
  43. package/dist/destinations/customerio/mergePeople/generated-types.d.ts +4 -0
  44. package/dist/destinations/customerio/mergePeople/generated-types.js +3 -0
  45. package/dist/destinations/customerio/mergePeople/generated-types.js.map +1 -0
  46. package/dist/destinations/customerio/mergePeople/index.d.ts +5 -0
  47. package/dist/destinations/customerio/mergePeople/index.js +52 -0
  48. package/dist/destinations/customerio/mergePeople/index.js.map +1 -0
  49. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.d.ts +10 -0
  50. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js +3 -0
  51. package/dist/destinations/customerio/reportDeliveryEvent/generated-types.js.map +1 -0
  52. package/dist/destinations/customerio/reportDeliveryEvent/index.d.ts +5 -0
  53. package/dist/destinations/customerio/reportDeliveryEvent/index.js +121 -0
  54. package/dist/destinations/customerio/reportDeliveryEvent/index.js.map +1 -0
  55. package/dist/destinations/customerio/suppressPerson/generated-types.d.ts +3 -0
  56. package/dist/destinations/customerio/suppressPerson/generated-types.js +3 -0
  57. package/dist/destinations/customerio/suppressPerson/generated-types.js.map +1 -0
  58. package/dist/destinations/customerio/suppressPerson/index.d.ts +5 -0
  59. package/dist/destinations/customerio/suppressPerson/index.js +41 -0
  60. package/dist/destinations/customerio/suppressPerson/index.js.map +1 -0
  61. package/dist/destinations/customerio/test-helper.d.ts +6 -0
  62. package/dist/destinations/customerio/test-helper.js +84 -0
  63. package/dist/destinations/customerio/test-helper.js.map +1 -0
  64. package/dist/destinations/customerio/unsuppressPerson/generated-types.d.ts +3 -0
  65. package/dist/destinations/customerio/unsuppressPerson/generated-types.js +3 -0
  66. package/dist/destinations/customerio/unsuppressPerson/generated-types.js.map +1 -0
  67. package/dist/destinations/customerio/unsuppressPerson/index.d.ts +5 -0
  68. package/dist/destinations/customerio/unsuppressPerson/index.js +41 -0
  69. package/dist/destinations/customerio/unsuppressPerson/index.js.map +1 -0
  70. package/dist/destinations/display-video-360/errors.d.ts +2 -2
  71. package/dist/destinations/display-video-360/errors.js +12 -6
  72. package/dist/destinations/display-video-360/errors.js.map +1 -1
  73. package/dist/destinations/display-video-360/index.js +16 -3
  74. package/dist/destinations/display-video-360/index.js.map +1 -1
  75. package/dist/destinations/display-video-360/shared.js +5 -3
  76. package/dist/destinations/display-video-360/shared.js.map +1 -1
  77. package/dist/destinations/engage/sendgrid/Profile.d.ts +6 -0
  78. package/dist/destinations/engage/sendgrid/Profile.js +3 -0
  79. package/dist/destinations/engage/sendgrid/Profile.js.map +1 -0
  80. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.d.ts +18 -0
  81. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js +94 -0
  82. package/dist/destinations/engage/sendgrid/previewApiLookup/api-lookups.js.map +1 -0
  83. package/dist/destinations/engage/utils/track.d.ts +17 -17
  84. package/dist/destinations/fullstory/index.js +4 -4
  85. package/dist/destinations/fullstory/index.js.map +1 -1
  86. package/dist/destinations/index.js +2 -0
  87. package/dist/destinations/index.js.map +1 -1
  88. package/dist/destinations/iterable/index.js +12 -0
  89. package/dist/destinations/iterable/index.js.map +1 -1
  90. package/dist/destinations/linkedin-conversions/streamConversion/index.js +18 -1
  91. package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
  92. package/dist/destinations/linkedin-conversions/types.d.ts +9 -0
  93. package/dist/destinations/linkedin-conversions/types.js.map +1 -1
  94. package/dist/destinations/mixpanel/incrementProperties/__test__/__snapshots__/snapshot.test.js.snap +18 -0
  95. package/dist/destinations/responsys/generated-types.d.ts +20 -0
  96. package/dist/destinations/responsys/generated-types.js +3 -0
  97. package/dist/destinations/responsys/generated-types.js.map +1 -0
  98. package/dist/destinations/responsys/index.d.ts +4 -0
  99. package/dist/destinations/responsys/index.js +197 -0
  100. package/dist/destinations/responsys/index.js.map +1 -0
  101. package/dist/destinations/responsys/sendAudience/generated-types.d.ts +14 -0
  102. package/dist/destinations/responsys/sendAudience/generated-types.js +3 -0
  103. package/dist/destinations/responsys/sendAudience/generated-types.js.map +1 -0
  104. package/dist/destinations/responsys/sendAudience/index.d.ts +5 -0
  105. package/dist/destinations/responsys/sendAudience/index.js +90 -0
  106. package/dist/destinations/responsys/sendAudience/index.js.map +1 -0
  107. package/dist/destinations/responsys/sendCustomTraits/generated-types.d.ts +9 -0
  108. package/dist/destinations/responsys/sendCustomTraits/generated-types.js +3 -0
  109. package/dist/destinations/responsys/sendCustomTraits/generated-types.js.map +1 -0
  110. package/dist/destinations/responsys/sendCustomTraits/index.d.ts +5 -0
  111. package/dist/destinations/responsys/sendCustomTraits/index.js +53 -0
  112. package/dist/destinations/responsys/sendCustomTraits/index.js.map +1 -0
  113. package/dist/destinations/responsys/shared_properties.d.ts +3 -0
  114. package/dist/destinations/responsys/shared_properties.js +19 -0
  115. package/dist/destinations/responsys/shared_properties.js.map +1 -0
  116. package/dist/destinations/responsys/types.d.ts +38 -0
  117. package/dist/destinations/responsys/types.js +3 -0
  118. package/dist/destinations/responsys/types.js.map +1 -0
  119. package/dist/destinations/responsys/upsertListMember/generated-types.d.ts +13 -0
  120. package/dist/destinations/responsys/upsertListMember/generated-types.js +3 -0
  121. package/dist/destinations/responsys/upsertListMember/generated-types.js.map +1 -0
  122. package/dist/destinations/responsys/upsertListMember/index.d.ts +5 -0
  123. package/dist/destinations/responsys/upsertListMember/index.js +78 -0
  124. package/dist/destinations/responsys/upsertListMember/index.js.map +1 -0
  125. package/dist/destinations/responsys/utils.d.ts +17 -0
  126. package/dist/destinations/responsys/utils.js +154 -0
  127. package/dist/destinations/responsys/utils.js.map +1 -0
  128. package/dist/destinations/schematic/identifyUser/generated-types.d.ts +3 -4
  129. package/dist/destinations/schematic/identifyUser/index.js +6 -35
  130. package/dist/destinations/schematic/identifyUser/index.js.map +1 -1
  131. package/dist/destinations/schematic/trackEvent/generated-types.d.ts +3 -3
  132. package/dist/destinations/schematic/trackEvent/index.js +7 -29
  133. package/dist/destinations/schematic/trackEvent/index.js.map +1 -1
  134. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.d.ts +1 -0
  135. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js +381 -0
  136. package/dist/destinations/snap-conversions-api/_tests_/capiV2tests.js.map +1 -0
  137. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.d.ts +1 -0
  138. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js +499 -0
  139. package/dist/destinations/snap-conversions-api/_tests_/capiV3tests.js.map +1 -0
  140. package/dist/destinations/snap-conversions-api/_tests_/index.test.js +4 -352
  141. package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
  142. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +24 -20
  143. package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
  144. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.d.ts +4 -0
  145. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js +97 -0
  146. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v2.js.map +1 -0
  147. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.d.ts +8 -0
  148. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js +125 -0
  149. package/dist/destinations/snap-conversions-api/reportConversionEvent/snap-capi-v3.js.map +1 -0
  150. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.d.ts +19 -0
  151. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js +62 -0
  152. package/dist/destinations/snap-conversions-api/reportConversionEvent/utils.js.map +1 -0
  153. package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -5
  154. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +1 -86
  155. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
  156. package/dist/destinations/tiktok-conversions/common_fields.d.ts +2 -0
  157. package/dist/destinations/tiktok-conversions/common_fields.js +245 -0
  158. package/dist/destinations/tiktok-conversions/common_fields.js.map +1 -0
  159. package/dist/destinations/tiktok-conversions/formatter.d.ts +3 -0
  160. package/dist/destinations/tiktok-conversions/formatter.js +43 -0
  161. package/dist/destinations/tiktok-conversions/formatter.js.map +1 -0
  162. package/dist/destinations/tiktok-conversions/utils.d.ts +4 -0
  163. package/dist/destinations/tiktok-conversions/utils.js +65 -0
  164. package/dist/destinations/tiktok-conversions/utils.js.map +1 -0
  165. package/dist/destinations/tiktok-conversions-sandbox/index.js +2 -2
  166. package/dist/destinations/tiktok-conversions-sandbox/index.js.map +1 -1
  167. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
  168. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
  169. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
  170. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
  171. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +16 -0
  172. package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
  173. package/dist/destinations/tiktok-offline-conversions/utils.d.ts +8 -0
  174. package/dist/destinations/tiktok-offline-conversions/utils.js +67 -0
  175. package/dist/destinations/tiktok-offline-conversions/utils.js.map +1 -0
  176. package/dist/destinations/tiktok-offline-conversions-sandbox/index.js +2 -2
  177. package/dist/destinations/tiktok-offline-conversions-sandbox/index.js.map +1 -1
  178. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js +1 -1
  179. package/dist/destinations/tiktok-offline-conversions-sandbox/reportOfflineEvent/index.js.map +1 -1
  180. package/dist/destinations/trackey/group.types.d.ts +11 -0
  181. package/dist/destinations/trackey/group.types.js +3 -0
  182. package/dist/destinations/trackey/group.types.js.map +1 -0
  183. package/dist/destinations/trackey/identify.types.d.ts +11 -0
  184. package/dist/destinations/trackey/identify.types.js +3 -0
  185. package/dist/destinations/trackey/identify.types.js.map +1 -0
  186. package/dist/destinations/trackey/track.types.d.ts +12 -0
  187. package/dist/destinations/trackey/track.types.js +3 -0
  188. package/dist/destinations/trackey/track.types.js.map +1 -0
  189. package/package.json +4 -4
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ const action = {
5
+ title: 'Merge People',
6
+ description: 'Merge two customer profiles together.',
7
+ defaultSubscription: 'type = "alias"',
8
+ fields: {
9
+ primary: {
10
+ label: 'Primary User',
11
+ description: `The person that you want to remain after the merge, identified by id, email or cio_id. This person receives information from the secondary person in the merge.`,
12
+ type: 'string',
13
+ required: true,
14
+ default: {
15
+ '@path': '$.userId'
16
+ }
17
+ },
18
+ secondary: {
19
+ label: 'Secondary User',
20
+ description: `The person that you want to delete after the merge, identified by id, email or cio_id. This person's information is merged into the primary person's profile and then it is deleted.`,
21
+ type: 'string',
22
+ required: true,
23
+ default: {
24
+ '@path': '$.previousId'
25
+ }
26
+ }
27
+ },
28
+ performBatch: (request, { payload: payloads, settings }) => {
29
+ return utils_1.sendBatch(request, payloads.map((payload) => ({
30
+ action: 'merge',
31
+ payload: mapPayload(payload),
32
+ settings,
33
+ type: 'person'
34
+ })));
35
+ },
36
+ perform: (request, { payload, settings }) => {
37
+ return utils_1.sendSingle(request, {
38
+ action: 'merge',
39
+ payload: mapPayload(payload),
40
+ settings,
41
+ type: 'person'
42
+ });
43
+ }
44
+ };
45
+ function mapPayload(payload) {
46
+ return {
47
+ primary: utils_1.resolveIdentifiers({ person_id: payload.primary }),
48
+ secondary: utils_1.resolveIdentifiers({ person_id: payload.secondary })
49
+ };
50
+ }
51
+ exports.default = action;
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/mergePeople/index.ts"],"names":[],"mappings":";;AAGA,oCAAoE;AAEpE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,uCAAuC;IACpD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,iKAAiK;YAC9K,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,gBAAgB;YACvB,WAAW,EAAE,sLAAsL;YACnM,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,cAAc;aACxB;SACF;KACF;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzD,OAAO,iBAAS,CACd,OAAO,EACP,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;YAC5B,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC,CACJ,CAAA;IACH,CAAC;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,kBAAU,CAAC,OAAO,EAAE;YACzB,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;YAC5B,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,SAAS,UAAU,CAAC,OAAgB;IAClC,OAAO;QACL,OAAO,EAAE,0BAAkB,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3D,SAAS,EAAE,0BAAkB,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;KAChE,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ delivery_id: string;
3
+ metric: string;
4
+ recipient?: string;
5
+ reason?: string;
6
+ href?: string;
7
+ action_name?: string;
8
+ action_value?: string;
9
+ timestamp?: string | number;
10
+ }
@@ -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/customerio/reportDeliveryEvent/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,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ const action = {
5
+ title: 'Report Delivery Event',
6
+ description: 'Report delivery metrics for a message sent from the Customer.io Journeys product.',
7
+ defaultSubscription: 'event = "Report Delivery Event"',
8
+ fields: {
9
+ delivery_id: {
10
+ label: 'Delivery ID',
11
+ description: 'The CIO-Delivery-ID from the message that you want to associate the metric with.',
12
+ type: 'string',
13
+ default: {
14
+ '@path': '$.properties.deliveryId'
15
+ },
16
+ required: true
17
+ },
18
+ metric: {
19
+ label: 'Metric',
20
+ description: `The metric you want to report back to Customer.io. Not all metrics are available for all channels. Please refer to the [documentation](https://customer.io/docs/api/track/#operation/metrics) for more information.`,
21
+ type: 'string',
22
+ default: {
23
+ '@path': '$.properties.metric'
24
+ },
25
+ required: true,
26
+ choices: [
27
+ { label: 'Delivered', value: 'delivered' },
28
+ { label: 'Opened', value: 'opened' },
29
+ { label: 'Clicked', value: 'clicked' },
30
+ { label: 'Converted', value: 'converted' },
31
+ { label: 'Marked as Spam', value: 'spammed' },
32
+ { label: 'Bounced', value: 'bounced' },
33
+ { label: 'Suppressed', value: 'dropped' },
34
+ { label: 'Deferred', value: 'deferred' }
35
+ ]
36
+ },
37
+ recipient: {
38
+ label: 'Recipient',
39
+ description: `Information about who the message was delivered to. For email, SMS and mobile push this is the email address, phone number and device token, respectively.`,
40
+ type: 'string',
41
+ default: {
42
+ '@path': '$.properties.recipient'
43
+ }
44
+ },
45
+ reason: {
46
+ label: 'Reason',
47
+ description: 'For metrics indicating a failure, this field provides information for the failure.',
48
+ type: 'string',
49
+ default: {
50
+ '@path': '$.properties.reason'
51
+ }
52
+ },
53
+ href: {
54
+ label: 'Href',
55
+ description: 'For click metrics, this is the link that was clicked.',
56
+ type: 'string',
57
+ default: {
58
+ '@path': '$.properties.href'
59
+ }
60
+ },
61
+ action_name: {
62
+ label: 'Action Name',
63
+ description: 'For In-App messages, this is the name of the action that was clicked.',
64
+ type: 'string',
65
+ default: {
66
+ '@path': '$.properties.actionName'
67
+ }
68
+ },
69
+ action_value: {
70
+ label: 'Action Value',
71
+ description: 'For In-App messages, this is the value of the action that was clicked.',
72
+ type: 'string',
73
+ default: {
74
+ '@path': '$.properties.actionValue'
75
+ }
76
+ },
77
+ timestamp: {
78
+ label: 'Timestamp',
79
+ description: 'A timestamp of when the metric event took place. Default is when the event was triggered.',
80
+ type: 'datetime',
81
+ format: 'date-time',
82
+ default: {
83
+ '@path': '$.timestamp'
84
+ }
85
+ }
86
+ },
87
+ perform: (request, { payload, settings }) => {
88
+ const metricsRequest = {
89
+ delivery_id: payload.delivery_id,
90
+ metric: payload.metric,
91
+ timestamp: Math.floor(Date.now() / 1000)
92
+ };
93
+ const unix_timestamp = Number(utils_1.convertValidTimestamp(payload.timestamp));
94
+ if (!isNaN(unix_timestamp)) {
95
+ metricsRequest.timestamp = unix_timestamp;
96
+ }
97
+ if (payload.recipient) {
98
+ metricsRequest.recipient = payload.recipient;
99
+ }
100
+ if (payload.reason) {
101
+ metricsRequest.reason = payload.reason;
102
+ }
103
+ if (payload.href) {
104
+ metricsRequest.href = payload.href;
105
+ }
106
+ if (payload.action_name) {
107
+ metricsRequest.metadata = metricsRequest.metadata || {};
108
+ metricsRequest.metadata.action_name = payload.action_name;
109
+ }
110
+ if (payload.action_value) {
111
+ metricsRequest.metadata = metricsRequest.metadata || {};
112
+ metricsRequest.metadata.action_value = payload.action_value;
113
+ }
114
+ return request(utils_1.trackApiEndpoint(settings) + '/api/v1/metrics', {
115
+ json: metricsRequest,
116
+ method: 'post'
117
+ });
118
+ }
119
+ };
120
+ exports.default = action;
121
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/reportDeliveryEvent/index.ts"],"names":[],"mappings":";;AAGA,oCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,mFAAmF;IAChG,mBAAmB,EAAE,iCAAiC;IACtD,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,kFA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,CAAC,WAAW,EAAE;YACvB,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAA;YACvD,cAAc,CAAC,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;SAC1D;QACD,IAAI,OAAO,CAAC,YAAY,EAAE;YACxB,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAA;YACvD,cAAc,CAAC,QAAQ,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAA;SAC5D;QAED,OAAO,OAAO,CAAC,wBAAgB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,EAAE;YAC7D,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAoBD,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,3 @@
1
+ export interface Payload {
2
+ person_id: string;
3
+ }
@@ -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/customerio/suppressPerson/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,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ const action = {
5
+ title: 'Suppress Person',
6
+ description: `Suppress a person in Customer.io. This will prevent the person from receiving any messages.`,
7
+ defaultSubscription: 'event = "User Suppressed"',
8
+ fields: {
9
+ person_id: {
10
+ label: 'Person ID',
11
+ description: 'The ID used to uniquely identify a person in Customer.io. Any valid identifier is supported, such as ID, cio_id, email, etc. Anonymous users cannot be suppressed. [Learn more](https://customer.io/docs/identifying-people/#identifiers).',
12
+ type: 'string',
13
+ default: {
14
+ '@if': {
15
+ exists: { '@path': '$.userId' },
16
+ then: { '@path': '$.userId' },
17
+ else: { '@path': '$.traits.email' }
18
+ }
19
+ },
20
+ required: true
21
+ }
22
+ },
23
+ performBatch: (request, { payload: payloads, settings }) => {
24
+ return utils_1.sendBatch(request, payloads.map((payload) => ({
25
+ action: 'suppress',
26
+ payload,
27
+ settings,
28
+ type: 'person'
29
+ })));
30
+ },
31
+ perform: (request, { payload, settings }) => {
32
+ return utils_1.sendSingle(request, {
33
+ action: 'suppress',
34
+ payload,
35
+ settings,
36
+ type: 'person'
37
+ });
38
+ }
39
+ };
40
+ exports.default = action;
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/suppressPerson/index.ts"],"names":[],"mappings":";;AAGA,oCAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,6FAA6F;IAC1G,mBAAmB,EAAE,2BAA2B;IAChD,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,4OAA4O;YAC9O,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;YACD,QAAQ,EAAE,IAAI;SACf;KACF;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzD,OAAO,iBAAS,CACd,OAAO,EACP,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,UAAU;YAClB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC,CACJ,CAAA;IACH,CAAC;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,kBAAU,CAAC,OAAO,EAAE;YACzB,MAAM,EAAE,UAAU;YAClB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="lodash" />
2
+ import nock from 'nock';
3
+ import { AccountRegion } from './utils';
4
+ export declare const nockTrackInternalEndpoint: (region: AccountRegion) => nock.Scope;
5
+ export declare function getDefaultMappings(action: string): import("lodash").Dictionary<import("@segment/actions-core/src/destination-kit/types").FieldValue | undefined>;
6
+ export declare function testRunner(fn: Function): void;
@@ -0,0 +1,84 @@
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
+ exports.testRunner = exports.getDefaultMappings = exports.nockTrackInternalEndpoint = void 0;
7
+ const nock_1 = __importDefault(require("nock"));
8
+ const mapValues_1 = __importDefault(require("lodash/mapValues"));
9
+ const actions_core_1 = require("@segment/actions-core");
10
+ const index_1 = __importDefault(require("./index"));
11
+ const utils_1 = require("./utils");
12
+ const testDestination = actions_core_1.createTestIntegration(index_1.default);
13
+ var EndpointType;
14
+ (function (EndpointType) {
15
+ EndpointType["BATCH"] = "batch";
16
+ EndpointType["SINGLE"] = "entity";
17
+ })(EndpointType || (EndpointType = {}));
18
+ const endpointByType = {
19
+ [EndpointType.BATCH]: 'batch',
20
+ [EndpointType.SINGLE]: 'entity'
21
+ };
22
+ const trackServiceByRegion = {
23
+ [utils_1.AccountRegion.US]: nock_1.default('https://track.customer.io'),
24
+ [utils_1.AccountRegion.EU]: nock_1.default('https://track-eu.customer.io')
25
+ };
26
+ function wrapFn(fn, type, region) {
27
+ return () => {
28
+ const settings = {
29
+ siteId: '12345',
30
+ apiKey: 'abcde',
31
+ accountRegion: region
32
+ };
33
+ const action = async (name, args) => {
34
+ const actionFn = {
35
+ [EndpointType.BATCH]: testDestination.testBatchAction,
36
+ [EndpointType.SINGLE]: testDestination.testAction
37
+ }[type];
38
+ if (type === EndpointType.BATCH) {
39
+ args.events = [args.event];
40
+ }
41
+ const responses = (await actionFn?.call(testDestination, name, args));
42
+ if (!responses.length) {
43
+ if (type === EndpointType.BATCH) {
44
+ await testDestination.testAction(name, args);
45
+ }
46
+ throw new Error(`No responses received.`);
47
+ }
48
+ expect(responses.length).toBe(1);
49
+ expect(responses[0].status).toBe(200);
50
+ expect(responses[0].headers.toJSON()).toMatchObject({
51
+ 'content-type': 'application/json'
52
+ });
53
+ expect(responses[0].data).toMatchObject({});
54
+ if (type === EndpointType.BATCH) {
55
+ return responses[0].options.json.batch[0];
56
+ }
57
+ return responses[0].options.json;
58
+ };
59
+ return fn(settings, action);
60
+ };
61
+ }
62
+ const nockTrackInternalEndpoint = (region) => trackServiceByRegion[region];
63
+ exports.nockTrackInternalEndpoint = nockTrackInternalEndpoint;
64
+ function getDefaultMappings(action) {
65
+ const fields = testDestination.definition.actions[action].fields;
66
+ const defaultMappings = mapValues_1.default(fields, 'default');
67
+ return defaultMappings;
68
+ }
69
+ exports.getDefaultMappings = getDefaultMappings;
70
+ function testRunner(fn) {
71
+ describe.each(Object.values(endpointByType))(`when using %s requests`, (type) => {
72
+ describe.each(Object.values(utils_1.AccountRegion))(`when using the %s region`, (region) => {
73
+ beforeEach(() => {
74
+ trackServiceByRegion[region].post(`/api/v2/${type}`).reply(200, {});
75
+ });
76
+ afterEach(() => {
77
+ nock_1.default.cleanAll();
78
+ });
79
+ return wrapFn(fn, type, region)();
80
+ });
81
+ });
82
+ }
83
+ exports.testRunner = testRunner;
84
+ //# sourceMappingURL=test-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helper.js","sourceRoot":"","sources":["../../../src/destinations/customerio/test-helper.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,iEAAwC;AACxC,wDAAgF;AAChF,oDAAgC;AAEhC,mCAAuC;AAEvC,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAU,CAAC,CAAA;AAEzD,IAAK,YAGJ;AAHD,WAAK,YAAY;IACf,+BAAe,CAAA;IACf,iCAAiB,CAAA;AACnB,CAAC,EAHI,YAAY,KAAZ,YAAY,QAGhB;AACD,MAAM,cAAc,GAAG;IACrB,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO;IAC7B,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,QAAQ;CAChC,CAAA;AACD,MAAM,oBAAoB,GAAG;IAC3B,CAAC,qBAAa,CAAC,EAAE,CAAC,EAAE,cAAI,CAAC,2BAA2B,CAAC;IACrD,CAAC,qBAAa,CAAC,EAAE,CAAC,EAAE,cAAI,CAAC,8BAA8B,CAAC;CACzD,CAAA;AAED,SAAS,MAAM,CAAC,EAAY,EAAE,IAAY,EAAE,MAAqB;IAC/D,OAAO,GAAG,EAAE;QACV,MAAM,QAAQ,GAAa;YACzB,MAAM,EAAE,OAAO;YACf,MAAM,EAAE,OAAO;YACf,aAAa,EAAE,MAAM;SACtB,CAAA;QAED,MAAM,MAAM,GAAG,KAAK,EAAE,IAAY,EAAE,IAA6B,EAAE,EAAE;YACnE,MAAM,QAAQ,GAAG;gBACf,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,eAAe;gBACrD,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,UAAU;aAClD,CAAC,IAAI,CAAC,CAAA;YAEP,IAAI,IAAI,KAAK,YAAY,CAAC,KAAK,EAAE;gBAC/B,IAAI,CAAC,MAAM,GAAG,CAAC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AEhG,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,MAAM,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAA;IAChE,MAAM,eAAe,GAAG,mBAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEpD,OAAO,eAAe,CAAA;AACxB,CAAC;AALD,gDAKC;AAED,SAAgB,UAAU,CAAC,EAAY;IACrC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAC,IAAI,EAAE,EAAE;QAC9E,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAa,CAAC,CAAC,CAAC,0BAA0B,EAAE,CAAC,MAAM,EAAE,EAAE;YACjF,UAAU,CAAC,GAAG,EAAE;gBACd,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;YACrE,CAAC,CAAC,CAAA;YAEF,SAAS,CAAC,GAAG,EAAE;gBACb,cAAI,CAAC,QAAQ,EAAE,CAAA;YACjB,CAAC,CAAC,CAAA;YAEF,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;QACnC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;AAdD,gCAcC"}
@@ -0,0 +1,3 @@
1
+ export interface Payload {
2
+ person_id: string;
3
+ }
@@ -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/customerio/unsuppressPerson/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,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../utils");
4
+ const action = {
5
+ title: 'Unsuppress Person',
6
+ description: `Unsuppress a person in Customer.io. This will allow the person to receive messages again.`,
7
+ defaultSubscription: 'event = "User Unsuppressed"',
8
+ fields: {
9
+ person_id: {
10
+ label: 'Person ID',
11
+ description: 'The ID used to uniquely identify a person in Customer.io. Any valid identifier is supported, such as ID, cio_id, email, etc. Anonymous users cannot be unsuppressed. [Learn more](https://customer.io/docs/identifying-people/#identifiers).',
12
+ type: 'string',
13
+ default: {
14
+ '@if': {
15
+ exists: { '@path': '$.userId' },
16
+ then: { '@path': '$.userId' },
17
+ else: { '@path': '$.traits.email' }
18
+ }
19
+ },
20
+ required: true
21
+ }
22
+ },
23
+ performBatch: (request, { payload: payloads, settings }) => {
24
+ return utils_1.sendBatch(request, payloads.map((payload) => ({
25
+ action: 'unsuppress',
26
+ payload,
27
+ settings,
28
+ type: 'person'
29
+ })));
30
+ },
31
+ perform: (request, { payload, settings }) => {
32
+ return utils_1.sendSingle(request, {
33
+ action: 'unsuppress',
34
+ payload,
35
+ settings,
36
+ type: 'person'
37
+ });
38
+ }
39
+ };
40
+ exports.default = action;
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/unsuppressPerson/index.ts"],"names":[],"mappings":";;AAGA,oCAAgD;AAEhD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,2FAA2F;IACxG,mBAAmB,EAAE,6BAA6B;IAClD,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,8OAA8O;YAChP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;YACD,QAAQ,EAAE,IAAI;SACf;KACF;IAED,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QACzD,OAAO,iBAAS,CACd,OAAO,EACP,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACzB,MAAM,EAAE,YAAY;YACpB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC,CACJ,CAAA;IACH,CAAC;IAED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,kBAAU,CAAC,OAAO,EAAE;YACzB,MAAM,EAAE,YAAY;YACpB,OAAO;YACP,QAAQ;YACR,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { IntegrationError, InvalidAuthenticationError } from '@segment/actions-core';
2
- import { StatsClient } from '@segment/actions-core/destination-kit';
3
- export declare const handleRequestError: (error: unknown, statsName: string, statsClient: StatsClient | undefined) => IntegrationError | InvalidAuthenticationError;
2
+ import { StatsContext } from '@segment/actions-core/destination-kit';
3
+ export declare const handleRequestError: (error: unknown, statsName: string, statsContext: StatsContext | undefined) => IntegrationError | InvalidAuthenticationError;
@@ -14,10 +14,12 @@ const isGoogleAPIError = (error) => {
14
14
  }
15
15
  return false;
16
16
  };
17
- const handleRequestError = (error, statsName, statsClient) => {
17
+ const handleRequestError = (error, statsName, statsContext) => {
18
+ const { statsClient, tags: statsTags } = statsContext || {};
18
19
  if (!isGoogleAPIError(error)) {
19
20
  if (!error) {
20
- statsClient?.incr(`${statsName}.error.UNKNOWN_ERROR`, 1);
21
+ statsTags?.push('error:unknown');
22
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
21
23
  return new actions_core_1.IntegrationError('Unknown error', 'UNKNOWN_ERROR', 500);
22
24
  }
23
25
  }
@@ -25,18 +27,22 @@ const handleRequestError = (error, statsName, statsClient) => {
25
27
  const code = gError.response?.status;
26
28
  const message = gError.response?.data?.error?.message;
27
29
  if (code === 401) {
28
- statsClient?.incr(`${statsName}.error.INVALID_AUTHENTICATION`, 1);
30
+ statsTags?.push('error:invalid-authentication');
31
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
29
32
  return new actions_core_1.InvalidAuthenticationError(message, actions_core_1.ErrorCodes.INVALID_AUTHENTICATION);
30
33
  }
31
34
  if (code === 501) {
32
- statsClient?.incr(`${statsName}.error.INTEGRATION_ERROR`, 1);
35
+ statsTags?.push('error:integration-error');
36
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
33
37
  return new actions_core_1.IntegrationError(message, 'INTEGRATION_ERROR', 501);
34
38
  }
35
39
  if (code === 408 || code === 423 || code === 429 || code >= 500) {
36
- statsClient?.incr(`${statsName}.error.RETRYABLE_ERROR`, 1);
40
+ statsTags?.push('error:retryable-error');
41
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
37
42
  return new actions_core_1.IntegrationError(message, 'RETRYABLE_ERROR', code);
38
43
  }
39
- statsClient?.incr(`${statsName}.error.INTEGRATION_ERROR`, 1);
44
+ statsTags?.push('error:generic-error');
45
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
40
46
  return new actions_core_1.IntegrationError(message, 'INTEGRATION_ERROR', code);
41
47
  };
42
48
  exports.handleRequestError = handleRequestError;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/errors.ts"],"names":[],"mappings":";;;AAAA,wDA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G,CAAC,CAAA;KAC/D;IAED,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE;QAC/D,SAAS,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAAA;QACxC,WAAW,EAAE,IAAI,CAAC,GAAG,SAAS,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;QACrD,OAAO,IAAI,+BAAgB,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAA;KAC9D;IAED,SAAS,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IACtC,WAAW,EAAE,IAAI,CAAC,GAAG,SAAS,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;IACrD,OAAO,IAAI,+BAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAA;AACjE,CAAC,CAAA;AApCY,QAAA,kBAAkB,sBAoC9B"}
@@ -59,14 +59,21 @@ const destination = {
59
59
  const { statsClient, tags: statsTags } = statsContext || {};
60
60
  const statsName = 'createAudience';
61
61
  statsTags?.push(`slug:${destination.slug}`);
62
+ statsClient?.incr(`${statsName}.call`, 1, statsTags);
62
63
  const authSettings = shared_1.getAuthSettings(settings);
63
64
  if (!audienceName) {
65
+ statsTags?.push('error:missing-settings');
66
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
64
67
  throw new actions_core_1.IntegrationError('Missing audience name value', 'MISSING_REQUIRED_FIELD', 400);
65
68
  }
66
69
  if (!advertiserId) {
70
+ statsTags?.push('error:missing-settings');
71
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
67
72
  throw new actions_core_1.IntegrationError('Missing advertiser ID value', 'MISSING_REQUIRED_FIELD', 400);
68
73
  }
69
74
  if (!accountType) {
75
+ statsTags?.push('error:missing-settings');
76
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
70
77
  throw new actions_core_1.IntegrationError('Missing account type value', 'MISSING_REQUIRED_FIELD', 400);
71
78
  }
72
79
  const listTypeMap = { basicUserList: {}, type: 'REMARKETING', membershipStatus: 'OPEN' };
@@ -97,7 +104,7 @@ const destination = {
97
104
  };
98
105
  }
99
106
  catch (error) {
100
- throw errors_1.handleRequestError(error, statsName, statsClient);
107
+ throw errors_1.handleRequestError(error, statsName, statsContext);
101
108
  }
102
109
  },
103
110
  async getAudience(request, getAudienceInput) {
@@ -106,14 +113,20 @@ const destination = {
106
113
  const { advertiserId, accountType } = audienceSettings || {};
107
114
  const statsName = 'getAudience';
108
115
  statsTags?.push(`slug:${destination.slug}`);
116
+ statsClient?.incr(`${statsName}.call`, 1, statsTags);
109
117
  const authSettings = shared_1.getAuthSettings(settings);
110
118
  if (!advertiserId) {
119
+ statsTags?.push('error:missing-settings');
120
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
111
121
  throw new actions_core_1.IntegrationError('Missing required advertiser ID value', 'MISSING_REQUIRED_FIELD', 400);
112
122
  }
113
123
  if (!accountType) {
124
+ statsTags?.push('error:missing-settings');
125
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
114
126
  throw new actions_core_1.IntegrationError('Missing account type value', 'MISSING_REQUIRED_FIELD', 400);
115
127
  }
116
128
  if (shared_1.isLegacyDestinationMigration(getAudienceInput, authSettings)) {
129
+ statsClient?.incr(`${statsName}.legacy`, 1, statsTags);
117
130
  return {
118
131
  externalId: getAudienceInput.externalId
119
132
  };
@@ -131,7 +144,7 @@ const destination = {
131
144
  const r = await response.json();
132
145
  const externalId = r[0]?.results[0]?.userList?.resourceName;
133
146
  if (externalId !== getAudienceInput.externalId) {
134
- statsClient?.incr(`${statsName}.error.UNABLE_TO_VERIFY`, 1, statsTags);
147
+ statsClient?.incr(`${statsName}.error`, 1, statsTags);
135
148
  throw new actions_core_1.IntegrationError("Unable to verify ownership over audience. Segment Audience ID doesn't match Googles Audience ID.", 'INVALID_REQUEST_DATA', 400);
136
149
  }
137
150
  statsClient?.incr(`${statsName}.success`, 1, statsTags);
@@ -140,7 +153,7 @@ const destination = {
140
153
  };
141
154
  }
142
155
  catch (error) {
143
- throw errors_1.handleRequestError(error, statsName, statsClient);
156
+ throw errors_1.handleRequestError(error, statsName, statsContext);
144
157
  }
145
158
  }
146
159
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAKvF,oEAA2C;AAC3C,8EAAqD;AAErD,2CAA8E;AAC9E,qCAAoG;AACpG,qCAA6C;AAE7C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAuB,qBAAS,EAAE;gBAC9D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,uCAAiD;oBAC5E,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YACF,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,CAAA;QAC3C,CAAC;KACF;IACD,cAAc,EAAE;QACd,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,0KAA0K;SAC7K;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,6FAA6F;YAC1G,QAAQ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,CAAC,UAAU,EAAE;oBAC9C,WAAW,EAAE,IAAI,CAAC,GAAG,SAAS,yBAAyB,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;oBACtE,MAAM,IAAI,+BAAgB,CACxB,kGAAkG,EAClG,sBAAsB,EACtB,GAAG,CACJ,CAAA;iBACF;gBAED,WAAW,EAAE,IAAI,CAAC,GAAG,SAAS,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;gBACvD,OAAO;oBACL,UAAU,EAAE,UAAU;iBACvB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,2BAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAA;aACxD;QACH,CAAC;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,kBAAkB,EAAlB,4BAAkB;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/display-video-360/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAuF;AAKvF,oEAA2C;AAC3C,8EAAqD;AAErD,2CAA8E;AAC9E,qCAAoG;AACpG,qCAA6C;AAE7C,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE,2BAA2B;IACjC,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAuB,qBAAS,EAAE;gBAC9D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,uCAAiD;oBAC5E,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,Y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,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAA;gBAE3D,IAAI,UAAU,KAAK,gBAAgB,CAAC,UAAU,EAAE;oBAC9C,WAAW,EAAE,IAAI,CAAC,GAAG,SAAS,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;oBACrD,MAAM,IAAI,+BAAgB,CACxB,kGAAkG,EAClG,sBAAsB,EACtB,GAAG,CACJ,CAAA;iBACF;gBAED,WAAW,EAAE,IAAI,CAAC,GAAG,SAAS,UAAU,EAAE,CAAC,EAAE,SAAS,CAAC,CAAA;gBACvD,OAAO;oBACL,UAAU,EAAE,UAAU;iBACvB,CAAA;aACF;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,2BAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,YAAY,CAAC,CAAA;aACzD;QACH,CAAC;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,kBAAkB,EAAlB,4BAAkB;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -11,10 +11,12 @@ const isLegacyDestinationMigration = (getAudienceInput, authSettings) => {
11
11
  };
12
12
  exports.isLegacyDestinationMigration = isLegacyDestinationMigration;
13
13
  const getAuthSettings = (settings) => {
14
- const { oauth } = settings;
14
+ if (!settings.oauth) {
15
+ return {};
16
+ }
15
17
  return {
16
- clientId: oauth.clientId,
17
- clientSecret: oauth.clientSecret
18
+ clientId: settings.oauth.clientId,
19
+ clientSecret: settings.oauth.clientSecret
18
20
  };
19
21
  };
20
22
  exports.getAuthSettings = getAuthSettings;