@segment/action-destinations 3.164.1-test-error.9 → 3.165.1-add-new-error.24

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 (171) hide show
  1. package/dist/destinations/acoustic/Utility/eventprocessing.js +18 -18
  2. package/dist/destinations/acoustic/Utility/eventprocessing.js.map +1 -1
  3. package/dist/destinations/airship/customEvents/generated-types.d.ts +9 -0
  4. package/dist/destinations/airship/customEvents/generated-types.js +3 -0
  5. package/dist/destinations/airship/customEvents/generated-types.js.map +1 -0
  6. package/dist/destinations/airship/customEvents/index.d.ts +5 -0
  7. package/dist/destinations/airship/customEvents/index.js +59 -0
  8. package/dist/destinations/airship/customEvents/index.js.map +1 -0
  9. package/dist/destinations/airship/generated-types.d.ts +5 -0
  10. package/dist/destinations/airship/generated-types.js +3 -0
  11. package/dist/destinations/airship/generated-types.js.map +1 -0
  12. package/dist/destinations/airship/index.d.ts +4 -0
  13. package/dist/destinations/airship/index.js +97 -0
  14. package/dist/destinations/airship/index.js.map +1 -0
  15. package/dist/destinations/airship/manageTags/generated-types.d.ts +7 -0
  16. package/dist/destinations/airship/manageTags/generated-types.js +3 -0
  17. package/dist/destinations/airship/manageTags/generated-types.js.map +1 -0
  18. package/dist/destinations/airship/manageTags/index.d.ts +5 -0
  19. package/dist/destinations/airship/manageTags/index.js +38 -0
  20. package/dist/destinations/airship/manageTags/index.js.map +1 -0
  21. package/dist/destinations/airship/setAttributes/generated-types.d.ts +30 -0
  22. package/dist/destinations/airship/setAttributes/generated-types.js +3 -0
  23. package/dist/destinations/airship/setAttributes/generated-types.js.map +1 -0
  24. package/dist/destinations/airship/setAttributes/index.d.ts +5 -0
  25. package/dist/destinations/airship/setAttributes/index.js +182 -0
  26. package/dist/destinations/airship/setAttributes/index.js.map +1 -0
  27. package/dist/destinations/airship/utilities.d.ts +28 -0
  28. package/dist/destinations/airship/utilities.js +146 -0
  29. package/dist/destinations/airship/utilities.js.map +1 -0
  30. package/dist/destinations/calliper/alias/generated-types.d.ts +5 -0
  31. package/dist/destinations/calliper/alias/generated-types.js +3 -0
  32. package/dist/destinations/calliper/alias/generated-types.js.map +1 -0
  33. package/dist/destinations/calliper/alias/index.d.ts +5 -0
  34. package/dist/destinations/calliper/alias/index.js +60 -0
  35. package/dist/destinations/calliper/alias/index.js.map +1 -0
  36. package/dist/destinations/calliper/generated-types.d.ts +4 -0
  37. package/dist/destinations/calliper/generated-types.js +3 -0
  38. package/dist/destinations/calliper/generated-types.js.map +1 -0
  39. package/dist/destinations/calliper/identifyGroup/generated-types.d.ts +7 -0
  40. package/dist/destinations/calliper/identifyGroup/generated-types.js +3 -0
  41. package/dist/destinations/calliper/identifyGroup/generated-types.js.map +1 -0
  42. package/dist/destinations/calliper/identifyGroup/index.d.ts +5 -0
  43. package/dist/destinations/calliper/identifyGroup/index.js +53 -0
  44. package/dist/destinations/calliper/identifyGroup/index.js.map +1 -0
  45. package/dist/destinations/calliper/identifyUser/generated-types.d.ts +14 -0
  46. package/dist/destinations/calliper/identifyUser/generated-types.js +3 -0
  47. package/dist/destinations/calliper/identifyUser/generated-types.js.map +1 -0
  48. package/dist/destinations/calliper/identifyUser/index.d.ts +5 -0
  49. package/dist/destinations/calliper/identifyUser/index.js +152 -0
  50. package/dist/destinations/calliper/identifyUser/index.js.map +1 -0
  51. package/dist/destinations/calliper/index.d.ts +4 -0
  52. package/dist/destinations/calliper/index.js +81 -0
  53. package/dist/destinations/calliper/index.js.map +1 -0
  54. package/dist/destinations/calliper/trackEvent/eventProperties.d.ts +2 -0
  55. package/dist/destinations/calliper/trackEvent/eventProperties.js +231 -0
  56. package/dist/destinations/calliper/trackEvent/eventProperties.js.map +1 -0
  57. package/dist/destinations/calliper/trackEvent/generated-types.d.ts +32 -0
  58. package/dist/destinations/calliper/trackEvent/generated-types.js +3 -0
  59. package/dist/destinations/calliper/trackEvent/generated-types.js.map +1 -0
  60. package/dist/destinations/calliper/trackEvent/index.d.ts +5 -0
  61. package/dist/destinations/calliper/trackEvent/index.js +65 -0
  62. package/dist/destinations/calliper/trackEvent/index.js.map +1 -0
  63. package/dist/destinations/calliper/utils/constants.d.ts +1 -0
  64. package/dist/destinations/calliper/utils/constants.js +5 -0
  65. package/dist/destinations/calliper/utils/constants.js.map +1 -0
  66. package/dist/destinations/calliper/utils/helpers.d.ts +1 -0
  67. package/dist/destinations/calliper/utils/helpers.js +8 -0
  68. package/dist/destinations/calliper/utils/helpers.js.map +1 -0
  69. package/dist/destinations/emarsys/addToContactList/index.js +6 -6
  70. package/dist/destinations/emarsys/addToContactList/index.js.map +1 -1
  71. package/dist/destinations/emarsys/removeFromContactList/index.js +6 -6
  72. package/dist/destinations/emarsys/removeFromContactList/index.js.map +1 -1
  73. package/dist/destinations/emarsys/triggerEvent/index.d.ts +1 -1
  74. package/dist/destinations/emarsys/triggerEvent/index.js +10 -9
  75. package/dist/destinations/emarsys/triggerEvent/index.js.map +1 -1
  76. package/dist/destinations/emarsys/upsertContact/index.d.ts +1 -1
  77. package/dist/destinations/emarsys/upsertContact/index.js +9 -8
  78. package/dist/destinations/emarsys/upsertContact/index.js.map +1 -1
  79. package/dist/destinations/facebook-conversions-api/addToCart/generated-types.d.ts +21 -0
  80. package/dist/destinations/facebook-conversions-api/addToCart/index.js +3 -0
  81. package/dist/destinations/facebook-conversions-api/addToCart/index.js.map +1 -1
  82. package/dist/destinations/facebook-conversions-api/custom/generated-types.d.ts +21 -0
  83. package/dist/destinations/facebook-conversions-api/custom/index.js +3 -0
  84. package/dist/destinations/facebook-conversions-api/custom/index.js.map +1 -1
  85. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.d.ts +10 -0
  86. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.js +179 -0
  87. package/dist/destinations/facebook-conversions-api/fb-capi-app-data.js.map +1 -0
  88. package/dist/destinations/facebook-conversions-api/index.js +1 -1
  89. package/dist/destinations/facebook-conversions-api/index.js.map +1 -1
  90. package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.d.ts +21 -0
  91. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js +3 -0
  92. package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js.map +1 -1
  93. package/dist/destinations/facebook-conversions-api/pageView/generated-types.d.ts +21 -0
  94. package/dist/destinations/facebook-conversions-api/pageView/index.js +3 -0
  95. package/dist/destinations/facebook-conversions-api/pageView/index.js.map +1 -1
  96. package/dist/destinations/facebook-conversions-api/purchase/generated-types.d.ts +21 -0
  97. package/dist/destinations/facebook-conversions-api/purchase/index.js +3 -0
  98. package/dist/destinations/facebook-conversions-api/purchase/index.js.map +1 -1
  99. package/dist/destinations/facebook-conversions-api/search/generated-types.d.ts +21 -0
  100. package/dist/destinations/facebook-conversions-api/search/index.js +3 -0
  101. package/dist/destinations/facebook-conversions-api/search/index.js.map +1 -1
  102. package/dist/destinations/facebook-conversions-api/viewContent/generated-types.d.ts +21 -0
  103. package/dist/destinations/facebook-conversions-api/viewContent/index.js +3 -0
  104. package/dist/destinations/facebook-conversions-api/viewContent/index.js.map +1 -1
  105. package/dist/destinations/fullstory/index.js +1 -1
  106. package/dist/destinations/fullstory/index.js.map +1 -1
  107. package/dist/destinations/google-enhanced-conversions/functions.d.ts +1 -0
  108. package/dist/destinations/google-enhanced-conversions/functions.js +3 -1
  109. package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
  110. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +3 -1
  111. package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
  112. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +3 -1
  113. package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
  114. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.d.ts +1 -1
  115. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +3 -6
  116. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
  117. package/dist/destinations/index.js +2 -0
  118. package/dist/destinations/index.js.map +1 -1
  119. package/dist/destinations/iterable/index.js +3 -3
  120. package/dist/destinations/iterable/index.js.map +1 -1
  121. package/dist/destinations/iterable/shared-fields.d.ts +15 -1
  122. package/dist/destinations/iterable/shared-fields.js +19 -17
  123. package/dist/destinations/iterable/shared-fields.js.map +1 -1
  124. package/dist/destinations/iterable/trackEvent/index.js +4 -1
  125. package/dist/destinations/iterable/trackEvent/index.js.map +1 -1
  126. package/dist/destinations/iterable/trackPurchase/generated-types.d.ts +1 -4
  127. package/dist/destinations/iterable/trackPurchase/index.js +21 -26
  128. package/dist/destinations/iterable/trackPurchase/index.js.map +1 -1
  129. package/dist/destinations/iterable/updateCart/generated-types.d.ts +1 -4
  130. package/dist/destinations/iterable/updateCart/index.js +21 -28
  131. package/dist/destinations/iterable/updateCart/index.js.map +1 -1
  132. package/dist/destinations/iterable/updateUser/generated-types.d.ts +1 -1
  133. package/dist/destinations/iterable/updateUser/index.js +12 -8
  134. package/dist/destinations/iterable/updateUser/index.js.map +1 -1
  135. package/dist/destinations/iterable/utils.d.ts +4 -0
  136. package/dist/destinations/iterable/utils.js +63 -0
  137. package/dist/destinations/iterable/utils.js.map +1 -0
  138. package/dist/destinations/liveramp-audiences/audienceEntered/generated-types.d.ts +1 -0
  139. package/dist/destinations/liveramp-audiences/audienceEntered/index.js +7 -0
  140. package/dist/destinations/liveramp-audiences/audienceEntered/index.js.map +1 -1
  141. package/dist/destinations/liveramp-audiences/generated-types.d.ts +2 -0
  142. package/dist/destinations/liveramp-audiences/index.js +14 -0
  143. package/dist/destinations/liveramp-audiences/index.js.map +1 -1
  144. package/dist/destinations/noop/generated-types.d.ts +2 -0
  145. package/dist/destinations/noop/generated-types.js +3 -0
  146. package/dist/destinations/noop/generated-types.js.map +1 -0
  147. package/dist/destinations/noop/index.d.ts +4 -0
  148. package/dist/destinations/noop/index.js +27 -0
  149. package/dist/destinations/noop/index.js.map +1 -0
  150. package/dist/destinations/noop/noop/generated-types.d.ts +3 -0
  151. package/dist/destinations/noop/noop/generated-types.js +3 -0
  152. package/dist/destinations/noop/noop/generated-types.js.map +1 -0
  153. package/dist/destinations/noop/noop/index.d.ts +5 -0
  154. package/dist/destinations/noop/noop/index.js +19 -0
  155. package/dist/destinations/noop/noop/index.js.map +1 -0
  156. package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/index.js +1 -1
  157. package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/index.js.map +1 -1
  158. package/dist/destinations/snap-conversions-api/snap-capi-properties.js +2 -1
  159. package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +1 -1
  160. package/dist/destinations/usermaven/common-definitions.js +1 -1
  161. package/dist/destinations/usermaven/common-definitions.js.map +1 -1
  162. package/dist/destinations/usermaven/generated-types.d.ts +1 -0
  163. package/dist/destinations/usermaven/group/generated-types.d.ts +1 -1
  164. package/dist/destinations/usermaven/identify/generated-types.d.ts +1 -1
  165. package/dist/destinations/usermaven/index.js +10 -1
  166. package/dist/destinations/usermaven/index.js.map +1 -1
  167. package/dist/destinations/usermaven/page/generated-types.d.ts +1 -1
  168. package/dist/destinations/usermaven/request-params.js +4 -3
  169. package/dist/destinations/usermaven/request-params.js.map +1 -1
  170. package/dist/destinations/usermaven/track/generated-types.d.ts +1 -1
  171. package/package.json +4 -4
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eventProperties = void 0;
4
+ exports.eventProperties = {
5
+ event: {
6
+ label: 'Event Type',
7
+ type: 'string',
8
+ description: 'A type of your event, e.g. a sign up or a name of an action within your product.',
9
+ required: true,
10
+ default: {
11
+ '@path': '$.event'
12
+ }
13
+ },
14
+ time: {
15
+ label: 'Timestamp',
16
+ type: 'datetime',
17
+ description: 'The timestamp of the event. Could be any date string/number value compatible with JavaScript Date constructor: e.g. milliseconds epoch or an ISO datetime. If time is not sent with the event, it will be set to the request time.',
18
+ default: {
19
+ '@path': '$.timestamp'
20
+ }
21
+ },
22
+ anonymous_id: {
23
+ label: 'Anonymous ID',
24
+ type: 'string',
25
+ description: 'A distinct ID of an unidentified (logged out) user. Device id is used if available',
26
+ default: {
27
+ '@path': '$.anonymousId'
28
+ }
29
+ },
30
+ user_id: {
31
+ label: 'User ID',
32
+ type: 'string',
33
+ description: 'A distinct ID of an identified (logged in) user.',
34
+ default: {
35
+ '@path': '$.userId'
36
+ }
37
+ },
38
+ group_id: {
39
+ label: 'Group ID',
40
+ type: 'string',
41
+ description: 'The unique identifier of the group that performed this event.',
42
+ default: {
43
+ '@path': '$.context.groupId'
44
+ }
45
+ },
46
+ event_unique_id: {
47
+ label: 'Event ID',
48
+ type: 'string',
49
+ description: 'A random id that is unique to an event. ID is being used to prevent event duplication. All the events that share the same unique id besides the first one will be ignored.',
50
+ default: {
51
+ '@path': '$.messageId'
52
+ }
53
+ },
54
+ app_version: {
55
+ label: 'App Version',
56
+ type: 'string',
57
+ description: 'The current version of your application.',
58
+ default: {
59
+ '@path': '$.context.app.version'
60
+ }
61
+ },
62
+ os_name: {
63
+ label: 'OS Name',
64
+ type: 'string',
65
+ description: 'The name of the mobile operating system or browser that the user is using.',
66
+ default: {
67
+ '@path': '$.context.os.name'
68
+ }
69
+ },
70
+ os_version: {
71
+ label: 'OS Version',
72
+ type: 'string',
73
+ description: 'The version of the mobile operating system or browser the user is using.',
74
+ default: {
75
+ '@path': '$.context.os.version'
76
+ }
77
+ },
78
+ device_id: {
79
+ label: 'Device ID',
80
+ type: 'string',
81
+ description: 'A unique identifier for the device the user is using.',
82
+ default: {
83
+ '@path': '$.context.device.id'
84
+ }
85
+ },
86
+ platform: {
87
+ label: 'Platform',
88
+ type: 'string',
89
+ description: 'Platform of the device.',
90
+ default: {
91
+ '@path': '$.context.device.type'
92
+ }
93
+ },
94
+ device_manufacturer: {
95
+ label: 'Device Manufacturer',
96
+ type: 'string',
97
+ description: 'The device manufacturer that the user is using.',
98
+ default: {
99
+ '@path': '$.context.device.manufacturer'
100
+ }
101
+ },
102
+ device_model: {
103
+ label: 'Device Model',
104
+ type: 'string',
105
+ description: 'The device model that the user is using.',
106
+ default: {
107
+ '@path': '$.context.device.model'
108
+ }
109
+ },
110
+ carrier: {
111
+ label: 'Carrier',
112
+ type: 'string',
113
+ description: 'The carrier that the user is using.',
114
+ default: {
115
+ '@path': '$.context.network.carrier'
116
+ }
117
+ },
118
+ cellular: {
119
+ label: 'Cellular Enabled',
120
+ type: 'boolean',
121
+ description: 'Whether cellular is enabled.',
122
+ default: {
123
+ '@path': '$.context.network.cellular'
124
+ }
125
+ },
126
+ country: {
127
+ label: 'Country',
128
+ type: 'string',
129
+ description: 'The current country of the user.',
130
+ default: {
131
+ '@path': '$.context.location.country'
132
+ }
133
+ },
134
+ region: {
135
+ label: 'Region',
136
+ type: 'string',
137
+ description: 'The current region of the user.',
138
+ default: {
139
+ '@path': '$.context.location.region'
140
+ }
141
+ },
142
+ city: {
143
+ label: 'City',
144
+ type: 'string',
145
+ description: 'The current city of the user.',
146
+ default: {
147
+ '@path': '$.context.location.city'
148
+ }
149
+ },
150
+ language: {
151
+ label: 'Language',
152
+ type: 'string',
153
+ description: 'The language set by the user.',
154
+ default: {
155
+ '@path': '$.context.locale'
156
+ }
157
+ },
158
+ library_name: {
159
+ label: 'Library Name',
160
+ type: 'string',
161
+ description: 'The name of the SDK used to send events.',
162
+ default: {
163
+ '@path': '$.context.library.name'
164
+ }
165
+ },
166
+ library_version: {
167
+ label: 'Library Version',
168
+ type: 'string',
169
+ description: 'The version of the SDK used to send events.',
170
+ default: {
171
+ '@path': '$.context.library.version'
172
+ }
173
+ },
174
+ ip: {
175
+ label: 'IP Address',
176
+ type: 'string',
177
+ description: "The IP address of the user. This is only used for geolocation and won't be stored.",
178
+ default: {
179
+ '@path': '$.context.ip'
180
+ }
181
+ },
182
+ url: {
183
+ label: 'URL',
184
+ type: 'string',
185
+ description: 'The full URL of the webpage on which the event is triggered.',
186
+ default: {
187
+ '@path': '$.context.page.url'
188
+ }
189
+ },
190
+ path: {
191
+ label: 'Page Path',
192
+ type: 'string',
193
+ description: 'The relative URL of the webpage on which the event is triggered.',
194
+ default: {
195
+ '@path': '$.context.page.path'
196
+ }
197
+ },
198
+ page_title: {
199
+ label: 'Page Title',
200
+ type: 'string',
201
+ description: 'The name of the webpage on which the event is triggered.',
202
+ default: {
203
+ '@path': '$.context.page.title'
204
+ }
205
+ },
206
+ referrer: {
207
+ label: 'Referrer',
208
+ type: 'string',
209
+ description: 'Referrer url',
210
+ default: {
211
+ '@path': '$.context.page.referrer'
212
+ }
213
+ },
214
+ user_agent: {
215
+ label: 'User Agent',
216
+ type: 'string',
217
+ description: 'User agent',
218
+ default: {
219
+ '@path': '$.context.userAgent'
220
+ }
221
+ },
222
+ event_properties: {
223
+ label: 'Event Properties',
224
+ type: 'object',
225
+ description: 'An object of key-value pairs that represent additional data to be sent along with the event.',
226
+ default: {
227
+ '@path': '$.properties'
228
+ }
229
+ }
230
+ };
231
+ //# sourceMappingURL=eventProperties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventProperties.js","sourceRoot":"","sources":["../../../../src/destinations/calliper/trackEvent/eventProperties.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAA+B;IACzD,KAAK,EAAE;QACL,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,kFAAkF;QAC/F,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,OAAO,EAAE,SAAS;SACnB;KACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,oOAAoO;QACtO,OAAO,EAAE;YACP,OAAO,EAAE,aAAa;SACvB;KACF;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oFAAoF;QACjG,OAAO,EAAE;YACP,OAAO,EAAE,eAAe;SACzB;KACF;IACD,OAAO,EAAE;QACP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
4
+ anonymous_id?: string;
5
+ user_id?: string;
6
+ group_id?: string;
7
+ event_unique_id?: string;
8
+ app_version?: string;
9
+ os_name?: string;
10
+ os_version?: string;
11
+ device_id?: string;
12
+ platform?: string;
13
+ device_manufacturer?: string;
14
+ device_model?: string;
15
+ carrier?: string;
16
+ cellular?: boolean;
17
+ country?: string;
18
+ region?: string;
19
+ city?: string;
20
+ language?: string;
21
+ library_name?: string;
22
+ library_version?: string;
23
+ ip?: string;
24
+ url?: string;
25
+ path?: string;
26
+ page_title?: string;
27
+ referrer?: string;
28
+ user_agent?: string;
29
+ event_properties?: {
30
+ [k: string]: unknown;
31
+ };
32
+ }
@@ -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/calliper/trackEvent/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,65 @@
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 eventProperties_1 = require("./eventProperties");
7
+ const dayjs_1 = __importDefault(require("../../../lib/dayjs"));
8
+ const constants_1 = require("../utils/constants");
9
+ const formatEvent = (payload) => {
10
+ const datetime = payload.time;
11
+ const time = datetime && dayjs_1.default.utc(datetime).isValid() ? dayjs_1.default.utc(datetime).valueOf() : Date.now();
12
+ return {
13
+ event: payload.event,
14
+ time: time,
15
+ anonymous_id: payload.anonymous_id,
16
+ user_id: payload.user_id,
17
+ group_id: payload.group_id,
18
+ event_unique_id: payload.event_unique_id,
19
+ app_version: payload.app_version,
20
+ os_name: payload.os_name,
21
+ device_id: payload.device_id,
22
+ platform: payload.platform,
23
+ device_manufacturer: payload.device_manufacturer,
24
+ device_model: payload.device_model,
25
+ carrier: payload.carrier,
26
+ cellular: payload.cellular,
27
+ country: payload.country,
28
+ region: payload.region,
29
+ city: payload.city,
30
+ language: payload.language,
31
+ library_name: `Segment: ${payload.library_name}`,
32
+ library_version: payload.library_version,
33
+ ip: payload.ip,
34
+ url: payload.url,
35
+ path: payload.path,
36
+ page_title: payload.page_title,
37
+ user_agent: payload.user_agent,
38
+ properties: payload.event_properties
39
+ };
40
+ };
41
+ const processData = async (request, settings, payload) => {
42
+ const events = payload.map(formatEvent);
43
+ return request(`${constants_1.API_URL}/event/batch`, {
44
+ method: 'post',
45
+ json: {
46
+ company_id: settings.companyId,
47
+ key: settings.segmentKey,
48
+ events
49
+ }
50
+ });
51
+ };
52
+ const action = {
53
+ title: 'Track Event',
54
+ description: 'Send your product event to Calliper.',
55
+ defaultSubscription: 'type = "track"',
56
+ fields: eventProperties_1.eventProperties,
57
+ performBatch: async (request, { settings, payload }) => {
58
+ return processData(request, settings, payload);
59
+ },
60
+ perform: async (request, { settings, payload }) => {
61
+ return processData(request, settings, [payload]);
62
+ }
63
+ };
64
+ exports.default = action;
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/calliper/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,uDAAmD;AACnD,+DAAsC;AACtC,kDAA4C;AAE5C,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,EAAE;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAA;IAC7B,MAAM,IAAI,GAAG,QAAQ,IAAI,eAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,EA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mBAAO,cAAc,EAAE;QACvC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,UAAU,EAAE,QAAQ,CAAC,SAAS;YAC9B,GAAG,EAAE,QAAQ,CAAC,UAAU;YACxB,MAAM;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,sCAAsC;IACnD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE,iCAAe;IAEvB,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACrD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAChD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,OAAO,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IAClD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const API_URL = "https://api.getcalliper.com/segment";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_URL = void 0;
4
+ exports.API_URL = 'https://api.getcalliper.com/segment';
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/destinations/calliper/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,qCAAqC,CAAA"}
@@ -0,0 +1 @@
1
+ export declare function formatName(firstName: unknown, lastName: unknown, name: unknown): unknown;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatName = void 0;
4
+ function formatName(firstName, lastName, name) {
5
+ return name ?? ([firstName, lastName].filter(Boolean).join(' ') || undefined);
6
+ }
7
+ exports.formatName = formatName;
8
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/destinations/calliper/utils/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,SAAkB,EAAE,QAAiB,EAAE,IAAa;IAC7E,OAAO,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,CAAA;AAC/E,CAAC;AAFD,gCAEC"}
@@ -38,9 +38,9 @@ const action = {
38
38
  },
39
39
  perform: async (request, data) => {
40
40
  if (!data?.payload?.key_field)
41
- throw new actions_core_1.PayloadValidationError('Missing key field');
41
+ throw new actions_core_1.IntegrationError('Missing key field');
42
42
  if (!data?.payload?.key_value)
43
- throw new actions_core_1.PayloadValidationError('Missing key value');
43
+ throw new actions_core_1.IntegrationError('Missing key value');
44
44
  data.payload.contactlistid = parseInt(data.payload.contactlistid.toString().replace(/[^0-9]/g, ''));
45
45
  if (data.payload.contactlistid > 0) {
46
46
  const payload = {
@@ -59,13 +59,13 @@ const action = {
59
59
  if (body.replyCode === 0)
60
60
  return response;
61
61
  else
62
- throw new actions_core_1.APIError('Something went wrong while adding to contact list');
62
+ throw new actions_core_1.IntegrationError('Something went wrong while adding to contact list');
63
63
  }
64
64
  catch (err) {
65
- throw new actions_core_1.APIError('Invalid JSON response');
65
+ throw new actions_core_1.IntegrationError('Invalid JSON response');
66
66
  }
67
67
  case 400:
68
- throw new actions_core_1.APIError('The contact could not be removed from the contact list');
68
+ throw new actions_core_1.IntegrationError('The contact could not be removed from the contact list');
69
69
  case 429:
70
70
  throw new actions_core_1.RetryableError('Rate limit reached.');
71
71
  default:
@@ -73,7 +73,7 @@ const action = {
73
73
  }
74
74
  }
75
75
  else {
76
- throw new actions_core_1.PayloadValidationError('ContactlistId must be >0');
76
+ throw new actions_core_1.IntegrationError('ContactlistId must be >0');
77
77
  }
78
78
  },
79
79
  performBatch: async (request, data) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/addToContactList/index.ts"],"names":[],"mappings":";;AAAA,wDAAwF;AAIxF,sDAO0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,iFAAiF;IAC9F,MAAM,EAAE;QACN,aAAa,EAAE;YACb,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC/B,OAAO,gCAAe,CAAC,OAAO,CAAC,CAAA;QACjC,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC3B,OAAO,0BAAS,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS;YAAE,MAAM,IAAI,qCAAsB,CAAC,mBAAmB,CAAC,CAAA;QAEpF,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS;YAAE,MAAM,IAAI,qCAAsB,CA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B,CAAC,CAAA;gBACF,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACxB;YACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;aAC7B;SACF;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/addToContactList/index.ts"],"names":[],"mappings":";;AAAA,wDAAwE;AAIxE,sDAO0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,iFAAiF;IAC9F,MAAM,EAAE;QACN,aAAa,EAAE;YACb,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC/B,OAAO,gCAAe,CAAC,OAAO,CAAC,CAAA;QACjC,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC3B,OAAO,0BAAS,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,IAAI,CAAC,IAAI,EAAE,OA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OAAO,CAAC,GAAG,yBAAQ,eAAe,KAAK,CAAC,aAAa,MAAM,EAAE;oBAC5E,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,OAAO;oBACb,eAAe,EAAE,IAAI;iBACtB,CAAC,CAAA;gBACF,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACxB;YACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;aAC7B;SACF;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -38,9 +38,9 @@ const action = {
38
38
  },
39
39
  perform: async (request, data) => {
40
40
  if (!data?.payload?.key_field)
41
- throw new actions_core_1.PayloadValidationError('Missing key field');
41
+ throw new actions_core_1.IntegrationError('Missing key field');
42
42
  if (!data?.payload?.key_value)
43
- throw new actions_core_1.PayloadValidationError('Missing key value');
43
+ throw new actions_core_1.IntegrationError('Missing key value');
44
44
  data.payload.contactlistid = parseInt(data.payload.contactlistid.toString().replace(/[^0-9]/g, ''));
45
45
  if (data.payload.contactlistid > 0) {
46
46
  const payload = {
@@ -60,13 +60,13 @@ const action = {
60
60
  if (body.replyCode === 0)
61
61
  return response;
62
62
  else
63
- throw new actions_core_1.APIError('Something went wrong while removing from contact list');
63
+ throw new actions_core_1.IntegrationError('Something went wrong while removing from contact list');
64
64
  }
65
65
  catch (err) {
66
- throw new actions_core_1.APIError('Invalid JSON response');
66
+ throw new actions_core_1.IntegrationError('Invalid JSON response');
67
67
  }
68
68
  case 400:
69
- throw new actions_core_1.APIError('The contact could not be removed from the contact list');
69
+ throw new actions_core_1.IntegrationError('The contact could not be removed from the contact list');
70
70
  case 429:
71
71
  throw new actions_core_1.RetryableError('Rate limit reached.');
72
72
  default:
@@ -74,7 +74,7 @@ const action = {
74
74
  }
75
75
  }
76
76
  else {
77
- throw new actions_core_1.PayloadValidationError('ContactlistId must be >0');
77
+ throw new actions_core_1.IntegrationError('ContactlistId must be >0');
78
78
  }
79
79
  },
80
80
  performBatch: async (request, data) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/removeFromContactList/index.ts"],"names":[],"mappings":";;AAAA,wDAAwF;AAIxF,sDAO0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,uCAAuC;IACpD,MAAM,EAAE;QACN,aAAa,EAAE;YACb,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC/B,OAAO,gCAAe,CAAC,OAAO,CAAC,CAAA;QACjC,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC3B,OAAO,0BAAS,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS;YAAE,MAAM,IAAI,qCAAsB,CAAC,mBAAmB,CAAC,CAAA;QAEpF,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS;YAAE,MAAM,IAAI,qCAAsB,CAAC,mBAAmB,C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C,QAAQ,CAAC,CAAA;aACxB;YACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;aAC7B;SACF;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/removeFromContactList/index.ts"],"names":[],"mappings":";;AAAA,wDAAwE;AAIxE,sDAO0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,0BAA0B;IACjC,WAAW,EAAE,uCAAuC;IACpD,MAAM,EAAE;QACN,aAAa,EAAE;YACb,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;KACF;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC/B,OAAO,gCAAe,CAAC,OAAO,CAAC,CAAA;QACjC,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC3B,OAAO,0BAAS,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS;YAAE,MAAM,IAAI,+BAAgB,C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AAM,EAAE,MAAM;oBACd,IAAI,EAAE,OAAO;oBACb,eAAe,EAAE,KAAK;iBACvB,CAAC,CAAA;gBACF,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACxB;YACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvB,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;aAC7B;SACF;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,4 +1,4 @@
1
- import { ActionDefinition } from '@segment/actions-core';
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
2
  import type { Settings } from '../generated-types';
3
3
  import type { Payload } from './generated-types';
4
4
  declare const action: ActionDefinition<Settings, Payload>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const actions_core_1 = require("@segment/actions-core");
4
3
  const emarsys_helper_1 = require("../emarsys-helper");
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ const actions_core_2 = require("@segment/actions-core");
5
6
  const action = {
6
7
  title: 'Trigger Event',
7
8
  description: 'Trigger an external event on the Emarsys platform to launch automation programs. Note: You can only pass objects to event_payload (no literals, no arrays).',
@@ -46,9 +47,9 @@ const action = {
46
47
  },
47
48
  perform: async (request, data) => {
48
49
  if (!data?.payload?.key_field)
49
- throw new actions_core_1.PayloadValidationError('Missing key field');
50
+ throw new actions_core_1.IntegrationError('Missing key field');
50
51
  if (!data?.payload?.key_value)
51
- throw new actions_core_1.PayloadValidationError('Missing key value');
52
+ throw new actions_core_1.IntegrationError('Missing key value');
52
53
  data.payload.eventid = parseInt(data.payload.eventid.toString().replace(/[^0-9]/g, ''));
53
54
  if (data.payload.eventid > 0) {
54
55
  const payload = {
@@ -68,21 +69,21 @@ const action = {
68
69
  if (body.replyCode === 0)
69
70
  return response;
70
71
  else
71
- throw new actions_core_1.APIError('Something went wrong while triggering the event');
72
+ throw new actions_core_1.IntegrationError('Something went wrong while triggering the event');
72
73
  }
73
74
  catch (err) {
74
- throw new actions_core_1.APIError('Invalid JSON response');
75
+ throw new actions_core_1.IntegrationError('Invalid JSON response');
75
76
  }
76
77
  case 400:
77
- throw new actions_core_1.APIError('The event could not be triggered');
78
+ throw new actions_core_1.IntegrationError('The event could not be triggered');
78
79
  case 429:
79
- throw new actions_core_1.RetryableError('Rate limit reached.');
80
+ throw new actions_core_2.RetryableError('Rate limit reached.');
80
81
  default:
81
- throw new actions_core_1.RetryableError('There seems to be an API issue.');
82
+ throw new actions_core_2.RetryableError('There seems to be an API issue.');
82
83
  }
83
84
  }
84
85
  else {
85
- throw new actions_core_1.PayloadValidationError('eventid must be >0');
86
+ throw new actions_core_1.IntegrationError('eventid must be >0');
86
87
  }
87
88
  },
88
89
  performBatch: async (request, data) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/emarsys/triggerEvent/index.ts"],"names":[],"mappings":";;AAAA,wDAA0G;AAG1G,sDAS0B;AAE1B,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,6JAA6J;IAC/J,MAAM,EAAE;QACN,OAAO,EAAE;YACP,KAAK,EAAE,0BAA0B;YACjC,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,2EAA2E;YACxF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;SACf;QACD,aAAa,EAAE;YACb,KAAK,EAAE,eAAe;YACtB,W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AA;IACV,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,4 +1,4 @@
1
- import { ActionDefinition } from '@segment/actions-core';
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
2
  import type { Settings } from '../generated-types';
3
3
  import type { Payload } from './generated-types';
4
4
  declare const action: ActionDefinition<Settings, Payload>;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const actions_core_1 = require("@segment/actions-core");
4
3
  const emarsys_helper_1 = require("../emarsys-helper");
4
+ const actions_core_1 = require("@segment/actions-core");
5
+ const actions_core_2 = require("@segment/actions-core");
5
6
  const action = {
6
7
  title: 'Upsert Contact',
7
8
  description: 'Insert or update a contact on the Emarsys platform',
@@ -55,9 +56,9 @@ const action = {
55
56
  perform: async (request, data) => {
56
57
  const contact = {};
57
58
  if (!data?.payload?.key_field)
58
- throw new actions_core_1.PayloadValidationError('Missing key field');
59
+ throw new actions_core_1.IntegrationError('Missing key field');
59
60
  if (!data?.payload?.key_value)
60
- throw new actions_core_1.PayloadValidationError('Missing key value');
61
+ throw new actions_core_1.IntegrationError('Missing key value');
61
62
  contact[data.payload.key_field] = data.payload.key_value;
62
63
  Object.assign(contact, data.payload.write_field);
63
64
  const payload = {
@@ -76,17 +77,17 @@ const action = {
76
77
  if (body.replyCode === 0)
77
78
  return response;
78
79
  else
79
- throw new actions_core_1.APIError('Something went wrong while upserting the contact');
80
+ throw new actions_core_1.IntegrationError('Something went wrong while upserting the contact');
80
81
  }
81
82
  catch (err) {
82
- throw new actions_core_1.APIError('Invalid JSON response');
83
+ throw new actions_core_1.IntegrationError('Invalid JSON response');
83
84
  }
84
85
  case 400:
85
- throw new actions_core_1.APIError('Contact could not be upserted');
86
+ throw new actions_core_1.IntegrationError('Contact could not be upserted');
86
87
  case 429:
87
- throw new actions_core_1.RetryableError('Rate limit reached.');
88
+ throw new actions_core_2.RetryableError('Rate limit reached.');
88
89
  default:
89
- throw new actions_core_1.RetryableError('There seems to be an API issue.');
90
+ throw new actions_core_2.RetryableError('There seems to be an API issue.');
90
91
  }
91
92
  },
92
93
  performBatch: async (request, data) => {