@segment/action-destinations 3.324.0 → 3.325.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/destinations/accoil-analytics/common-fields.d.ts +2 -0
  2. package/dist/destinations/accoil-analytics/common-fields.js +21 -0
  3. package/dist/destinations/accoil-analytics/common-fields.js.map +1 -0
  4. package/dist/destinations/accoil-analytics/group/generated-types.d.ts +12 -0
  5. package/dist/destinations/accoil-analytics/group/generated-types.js.map +1 -0
  6. package/dist/destinations/accoil-analytics/group/index.js +72 -0
  7. package/dist/destinations/accoil-analytics/group/index.js.map +1 -0
  8. package/dist/destinations/accoil-analytics/identify/generated-types.d.ts +12 -0
  9. package/dist/destinations/accoil-analytics/identify/generated-types.js +3 -0
  10. package/dist/destinations/accoil-analytics/identify/generated-types.js.map +1 -0
  11. package/dist/destinations/accoil-analytics/identify/index.d.ts +5 -0
  12. package/dist/destinations/accoil-analytics/identify/index.js +73 -0
  13. package/dist/destinations/accoil-analytics/identify/index.js.map +1 -0
  14. package/dist/destinations/accoil-analytics/index.js +25 -26
  15. package/dist/destinations/accoil-analytics/index.js.map +1 -1
  16. package/dist/destinations/accoil-analytics/page/generated-types.d.ts +5 -0
  17. package/dist/destinations/accoil-analytics/page/generated-types.js +3 -0
  18. package/dist/destinations/accoil-analytics/page/generated-types.js.map +1 -0
  19. package/dist/destinations/accoil-analytics/page/index.d.ts +5 -0
  20. package/dist/destinations/accoil-analytics/page/index.js +38 -0
  21. package/dist/destinations/accoil-analytics/page/index.js.map +1 -0
  22. package/dist/destinations/accoil-analytics/screen/generated-types.d.ts +5 -0
  23. package/dist/destinations/accoil-analytics/screen/generated-types.js +3 -0
  24. package/dist/destinations/accoil-analytics/screen/generated-types.js.map +1 -0
  25. package/dist/destinations/accoil-analytics/screen/index.d.ts +5 -0
  26. package/dist/destinations/accoil-analytics/screen/index.js +38 -0
  27. package/dist/destinations/accoil-analytics/screen/index.js.map +1 -0
  28. package/dist/destinations/accoil-analytics/track/generated-types.d.ts +5 -0
  29. package/dist/destinations/accoil-analytics/track/generated-types.js +3 -0
  30. package/dist/destinations/accoil-analytics/track/generated-types.js.map +1 -0
  31. package/dist/destinations/accoil-analytics/track/index.d.ts +5 -0
  32. package/dist/destinations/accoil-analytics/track/index.js +39 -0
  33. package/dist/destinations/accoil-analytics/track/index.js.map +1 -0
  34. package/dist/destinations/accoil-analytics/utils.d.ts +6 -0
  35. package/dist/destinations/accoil-analytics/utils.js +14 -0
  36. package/dist/destinations/accoil-analytics/utils.js.map +1 -0
  37. package/dist/destinations/adobe-target/adobeTarget_operations.js +3 -2
  38. package/dist/destinations/adobe-target/adobeTarget_operations.js.map +1 -1
  39. package/dist/destinations/braze/createAlias2/generated-types.d.ts +5 -0
  40. package/dist/destinations/braze/createAlias2/generated-types.js +3 -0
  41. package/dist/destinations/braze/createAlias2/generated-types.js.map +1 -0
  42. package/dist/destinations/braze/createAlias2/index.d.ts +5 -0
  43. package/dist/destinations/braze/createAlias2/index.js +53 -0
  44. package/dist/destinations/braze/createAlias2/index.js.map +1 -0
  45. package/dist/destinations/braze/identifyUser2/generated-types.d.ts +8 -0
  46. package/dist/destinations/braze/identifyUser2/generated-types.js +3 -0
  47. package/dist/destinations/braze/identifyUser2/generated-types.js.map +1 -0
  48. package/dist/destinations/braze/identifyUser2/index.d.ts +5 -0
  49. package/dist/destinations/braze/identifyUser2/index.js +70 -0
  50. package/dist/destinations/braze/identifyUser2/index.js.map +1 -0
  51. package/dist/destinations/braze/index.js +11 -1
  52. package/dist/destinations/braze/index.js.map +1 -1
  53. package/dist/destinations/braze/trackEvent2/generated-types.d.ts +16 -0
  54. package/dist/destinations/braze/trackEvent2/generated-types.js +3 -0
  55. package/dist/destinations/braze/trackEvent2/generated-types.js.map +1 -0
  56. package/dist/destinations/braze/trackEvent2/index.d.ts +5 -0
  57. package/dist/destinations/braze/trackEvent2/index.js +117 -0
  58. package/dist/destinations/braze/trackEvent2/index.js.map +1 -0
  59. package/dist/destinations/braze/trackPurchase2/generated-types.d.ts +22 -0
  60. package/dist/destinations/braze/trackPurchase2/generated-types.js +3 -0
  61. package/dist/destinations/braze/trackPurchase2/generated-types.js.map +1 -0
  62. package/dist/destinations/braze/trackPurchase2/index.d.ts +5 -0
  63. package/dist/destinations/braze/trackPurchase2/index.js +135 -0
  64. package/dist/destinations/braze/trackPurchase2/index.js.map +1 -0
  65. package/dist/destinations/braze/updateUserProfile2/generated-types.d.ts +52 -0
  66. package/dist/destinations/braze/updateUserProfile2/generated-types.js +3 -0
  67. package/dist/destinations/braze/updateUserProfile2/generated-types.js.map +1 -0
  68. package/dist/destinations/braze/updateUserProfile2/index.d.ts +5 -0
  69. package/dist/destinations/braze/updateUserProfile2/index.js +303 -0
  70. package/dist/destinations/braze/updateUserProfile2/index.js.map +1 -0
  71. package/dist/destinations/braze/utils.d.ts +6 -6
  72. package/dist/destinations/braze/utils.js +36 -12
  73. package/dist/destinations/braze/utils.js.map +1 -1
  74. package/dist/destinations/contentstack/index.js +1 -1
  75. package/dist/destinations/contentstack/index.js.map +1 -1
  76. package/dist/destinations/first-party-dv360/functions.d.ts +1 -0
  77. package/dist/destinations/first-party-dv360/functions.js +3 -2
  78. package/dist/destinations/first-party-dv360/functions.js.map +1 -1
  79. package/dist/destinations/first-party-dv360/generated-types.d.ts +1 -0
  80. package/dist/destinations/first-party-dv360/index.js +8 -0
  81. package/dist/destinations/first-party-dv360/index.js.map +1 -1
  82. package/dist/destinations/hubspot/customEvent/client.d.ts +2 -2
  83. package/dist/destinations/hubspot/customEvent/client.js.map +1 -1
  84. package/dist/destinations/hubspot/customEvent/dynamic-fields.js +2 -2
  85. package/dist/destinations/hubspot/customEvent/dynamic-fields.js.map +1 -1
  86. package/dist/destinations/hubspot/customEvent/event-completion.d.ts +3 -0
  87. package/dist/destinations/hubspot/customEvent/event-completion.js +17 -0
  88. package/dist/destinations/hubspot/customEvent/event-completion.js.map +1 -0
  89. package/dist/destinations/hubspot/customEvent/index.js +36 -42
  90. package/dist/destinations/hubspot/customEvent/index.js.map +1 -1
  91. package/dist/destinations/hubspot/customEvent/types.d.ts +11 -4
  92. package/dist/destinations/hubspot/customEvent/types.js +1 -2
  93. package/dist/destinations/hubspot/customEvent/types.js.map +1 -1
  94. package/dist/destinations/hubspot/customEvent/utils.d.ts +10 -8
  95. package/dist/destinations/hubspot/customEvent/utils.js +155 -189
  96. package/dist/destinations/hubspot/customEvent/utils.js.map +1 -1
  97. package/dist/destinations/hubspot/customEvent/validation.d.ts +3 -0
  98. package/dist/destinations/hubspot/customEvent/validation.js +66 -0
  99. package/dist/destinations/hubspot/customEvent/validation.js.map +1 -0
  100. package/dist/destinations/index.js +3 -0
  101. package/dist/destinations/index.js.map +1 -1
  102. package/dist/destinations/klaviyo/generated-types.d.ts +3 -0
  103. package/dist/destinations/klaviyo/index.d.ts +2 -2
  104. package/dist/destinations/klaviyo/index.js +12 -1
  105. package/dist/destinations/klaviyo/index.js.map +1 -1
  106. package/dist/destinations/nextdoor-capi/generated-types.d.ts +1 -0
  107. package/dist/destinations/nextdoor-capi/index.js +6 -0
  108. package/dist/destinations/nextdoor-capi/index.js.map +1 -1
  109. package/dist/destinations/nextdoor-capi/sendConversion/generated-types.d.ts +0 -1
  110. package/dist/destinations/nextdoor-capi/sendConversion/index.js +2 -15
  111. package/dist/destinations/nextdoor-capi/sendConversion/index.js.map +1 -1
  112. package/dist/destinations/postscript/const.d.ts +2 -0
  113. package/dist/destinations/postscript/const.js +6 -0
  114. package/dist/destinations/postscript/const.js.map +1 -0
  115. package/dist/destinations/postscript/generated-types.d.ts +3 -0
  116. package/dist/destinations/postscript/generated-types.js +3 -0
  117. package/dist/destinations/postscript/generated-types.js.map +1 -0
  118. package/dist/destinations/postscript/index.d.ts +4 -0
  119. package/dist/destinations/postscript/index.js +42 -0
  120. package/dist/destinations/postscript/index.js.map +1 -0
  121. package/dist/destinations/postscript/syncAudiences/generated-types.d.ts +10 -0
  122. package/dist/destinations/postscript/syncAudiences/generated-types.js +3 -0
  123. package/dist/destinations/postscript/syncAudiences/generated-types.js.map +1 -0
  124. package/dist/destinations/postscript/syncAudiences/index.d.ts +5 -0
  125. package/dist/destinations/postscript/syncAudiences/index.js +138 -0
  126. package/dist/destinations/postscript/syncAudiences/index.js.map +1 -0
  127. package/dist/destinations/postscript/types.d.ts +10 -0
  128. package/dist/destinations/postscript/types.js +4 -0
  129. package/dist/destinations/postscript/types.js.map +1 -0
  130. package/dist/destinations/recombee/addBookmark/generated-types.d.ts +9 -0
  131. package/dist/destinations/recombee/addBookmark/generated-types.js +3 -0
  132. package/dist/destinations/recombee/addBookmark/generated-types.js.map +1 -0
  133. package/dist/destinations/recombee/addBookmark/index.d.ts +5 -0
  134. package/dist/destinations/recombee/addBookmark/index.js +55 -0
  135. package/dist/destinations/recombee/addBookmark/index.js.map +1 -0
  136. package/dist/destinations/recombee/addCartAddition/generated-types.d.ts +13 -0
  137. package/dist/destinations/recombee/addCartAddition/generated-types.js +3 -0
  138. package/dist/destinations/recombee/addCartAddition/generated-types.js.map +1 -0
  139. package/dist/destinations/recombee/addCartAddition/index.d.ts +5 -0
  140. package/dist/destinations/recombee/addCartAddition/index.js +99 -0
  141. package/dist/destinations/recombee/addCartAddition/index.js.map +1 -0
  142. package/dist/destinations/recombee/addDetailView/generated-types.d.ts +10 -0
  143. package/dist/destinations/recombee/addDetailView/generated-types.js +3 -0
  144. package/dist/destinations/recombee/addDetailView/generated-types.js.map +1 -0
  145. package/dist/destinations/recombee/addDetailView/index.d.ts +5 -0
  146. package/dist/destinations/recombee/addDetailView/index.js +60 -0
  147. package/dist/destinations/recombee/addDetailView/index.js.map +1 -0
  148. package/dist/destinations/recombee/addPurchase/generated-types.d.ts +14 -0
  149. package/dist/destinations/recombee/addPurchase/generated-types.js +3 -0
  150. package/dist/destinations/recombee/addPurchase/generated-types.js.map +1 -0
  151. package/dist/destinations/recombee/addPurchase/index.d.ts +5 -0
  152. package/dist/destinations/recombee/addPurchase/index.js +107 -0
  153. package/dist/destinations/recombee/addPurchase/index.js.map +1 -0
  154. package/dist/destinations/recombee/addRating/generated-types.d.ts +10 -0
  155. package/dist/destinations/recombee/addRating/generated-types.js +3 -0
  156. package/dist/destinations/recombee/addRating/generated-types.js.map +1 -0
  157. package/dist/destinations/recombee/addRating/index.d.ts +5 -0
  158. package/dist/destinations/recombee/addRating/index.js +61 -0
  159. package/dist/destinations/recombee/addRating/index.js.map +1 -0
  160. package/dist/destinations/recombee/commonFields.d.ts +32 -0
  161. package/dist/destinations/recombee/commonFields.js +43 -0
  162. package/dist/destinations/recombee/commonFields.js.map +1 -0
  163. package/dist/destinations/recombee/deleteBookmark/generated-types.d.ts +5 -0
  164. package/dist/destinations/recombee/deleteBookmark/generated-types.js +3 -0
  165. package/dist/destinations/recombee/deleteBookmark/generated-types.js.map +1 -0
  166. package/dist/destinations/recombee/deleteBookmark/index.d.ts +5 -0
  167. package/dist/destinations/recombee/deleteBookmark/index.js +52 -0
  168. package/dist/destinations/recombee/deleteBookmark/index.js.map +1 -0
  169. package/dist/destinations/recombee/deleteCartAddition/generated-types.d.ts +5 -0
  170. package/dist/destinations/recombee/deleteCartAddition/generated-types.js +3 -0
  171. package/dist/destinations/recombee/deleteCartAddition/generated-types.js.map +1 -0
  172. package/dist/destinations/recombee/deleteCartAddition/index.d.ts +5 -0
  173. package/dist/destinations/recombee/deleteCartAddition/index.js +52 -0
  174. package/dist/destinations/recombee/deleteCartAddition/index.js.map +1 -0
  175. package/dist/destinations/recombee/generated-types.d.ts +6 -0
  176. package/dist/destinations/recombee/generated-types.js +3 -0
  177. package/dist/destinations/recombee/generated-types.js.map +1 -0
  178. package/dist/destinations/recombee/index.d.ts +4 -0
  179. package/dist/destinations/recombee/index.js +223 -0
  180. package/dist/destinations/recombee/index.js.map +1 -0
  181. package/dist/destinations/recombee/mergeUsers/generated-types.d.ts +4 -0
  182. package/dist/destinations/recombee/mergeUsers/generated-types.js +3 -0
  183. package/dist/destinations/recombee/mergeUsers/generated-types.js.map +1 -0
  184. package/dist/destinations/recombee/mergeUsers/index.d.ts +5 -0
  185. package/dist/destinations/recombee/mergeUsers/index.js +34 -0
  186. package/dist/destinations/recombee/mergeUsers/index.js.map +1 -0
  187. package/dist/destinations/recombee/recombeeApiClient.d.ts +120 -0
  188. package/dist/destinations/recombee/recombeeApiClient.js +138 -0
  189. package/dist/destinations/recombee/recombeeApiClient.js.map +1 -0
  190. package/dist/destinations/recombee/setViewPortion/generated-types.d.ts +11 -0
  191. package/dist/destinations/recombee/setViewPortion/generated-types.js +3 -0
  192. package/dist/destinations/recombee/setViewPortion/generated-types.js.map +1 -0
  193. package/dist/destinations/recombee/setViewPortion/index.d.ts +5 -0
  194. package/dist/destinations/recombee/setViewPortion/index.js +68 -0
  195. package/dist/destinations/recombee/setViewPortion/index.js.map +1 -0
  196. package/dist/destinations/recombee/setViewPortionFromWatchTime/generated-types.d.ts +14 -0
  197. package/dist/destinations/recombee/setViewPortionFromWatchTime/generated-types.js +3 -0
  198. package/dist/destinations/recombee/setViewPortionFromWatchTime/generated-types.js.map +1 -0
  199. package/dist/destinations/recombee/setViewPortionFromWatchTime/index.d.ts +5 -0
  200. package/dist/destinations/recombee/setViewPortionFromWatchTime/index.js +96 -0
  201. package/dist/destinations/recombee/setViewPortionFromWatchTime/index.js.map +1 -0
  202. package/dist/destinations/reddit-audiences/const.d.ts +2 -0
  203. package/dist/destinations/reddit-audiences/const.js +6 -0
  204. package/dist/destinations/reddit-audiences/const.js.map +1 -0
  205. package/dist/destinations/reddit-audiences/generated-types.d.ts +6 -0
  206. package/dist/destinations/reddit-audiences/generated-types.js +3 -0
  207. package/dist/destinations/reddit-audiences/generated-types.js.map +1 -0
  208. package/dist/destinations/reddit-audiences/index.d.ts +4 -0
  209. package/dist/destinations/reddit-audiences/index.js +83 -0
  210. package/dist/destinations/reddit-audiences/index.js.map +1 -0
  211. package/dist/destinations/reddit-audiences/syncAudience/functions.d.ts +3 -0
  212. package/dist/destinations/reddit-audiences/syncAudience/functions.js +105 -0
  213. package/dist/destinations/reddit-audiences/syncAudience/functions.js.map +1 -0
  214. package/dist/destinations/reddit-audiences/syncAudience/generated-types.d.ts +13 -0
  215. package/dist/destinations/reddit-audiences/syncAudience/generated-types.js +3 -0
  216. package/dist/destinations/reddit-audiences/syncAudience/generated-types.js.map +1 -0
  217. package/dist/destinations/reddit-audiences/syncAudience/index.d.ts +5 -0
  218. package/dist/destinations/reddit-audiences/syncAudience/index.js +114 -0
  219. package/dist/destinations/reddit-audiences/syncAudience/index.js.map +1 -0
  220. package/dist/destinations/reddit-audiences/syncAudience/types.d.ts +33 -0
  221. package/dist/destinations/reddit-audiences/syncAudience/types.js +3 -0
  222. package/dist/destinations/reddit-audiences/syncAudience/types.js.map +1 -0
  223. package/dist/destinations/reddit-audiences/types.d.ts +18 -0
  224. package/dist/destinations/reddit-audiences/types.js +3 -0
  225. package/dist/destinations/reddit-audiences/types.js.map +1 -0
  226. package/dist/destinations/reddit-conversions-api/utils.js +2 -2
  227. package/dist/destinations/reddit-conversions-api/utils.js.map +1 -1
  228. package/dist/destinations/s3/fields.js +1 -1
  229. package/dist/destinations/s3/fields.js.map +1 -1
  230. package/dist/destinations/s3/functions.js.map +1 -1
  231. package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js +3 -3
  232. package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js.map +1 -1
  233. package/dist/destinations/stackadapt-audiences/forwardProfile/functions.js +1 -1
  234. package/dist/destinations/stackadapt-audiences/forwardProfile/functions.js.map +1 -1
  235. package/package.json +5 -4
  236. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.d.ts +0 -5
  237. package/dist/destinations/accoil-analytics/postToAccoil/generated-types.js.map +0 -1
  238. package/dist/destinations/accoil-analytics/postToAccoil/index.js +0 -28
  239. package/dist/destinations/accoil-analytics/postToAccoil/index.js.map +0 -1
  240. /package/dist/destinations/accoil-analytics/{postToAccoil → group}/generated-types.js +0 -0
  241. /package/dist/destinations/accoil-analytics/{postToAccoil → group}/index.d.ts +0 -0
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ userId: string;
3
+ itemId: string;
4
+ timestamp?: string;
5
+ duration?: number;
6
+ recommId?: string;
7
+ additionalData?: {
8
+ [k: string]: unknown;
9
+ };
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/recombee/addDetailView/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,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const recombeeApiClient_1 = require("../recombeeApiClient");
4
+ const commonFields_1 = require("../commonFields");
5
+ const action = {
6
+ title: 'Add Detail View',
7
+ description: 'Adds a detail view of the given item made by the given user.',
8
+ fields: {
9
+ userId: {
10
+ label: 'User ID',
11
+ description: 'The ID of the user who viewed the item.',
12
+ type: 'string',
13
+ required: true,
14
+ default: {
15
+ '@if': {
16
+ exists: { '@path': '$.userId' },
17
+ then: { '@path': '$.userId' },
18
+ else: { '@path': '$.anonymousId' }
19
+ }
20
+ }
21
+ },
22
+ itemId: {
23
+ label: 'Item ID',
24
+ description: 'The viewed item.',
25
+ type: 'string',
26
+ required: true,
27
+ default: {
28
+ '@if': {
29
+ exists: { '@path': '$.properties.product_id' },
30
+ then: { '@path': '$.properties.product_id' },
31
+ else: { '@path': '$.properties.asset_id' }
32
+ }
33
+ }
34
+ },
35
+ timestamp: {
36
+ label: 'Timestamp',
37
+ description: 'The UTC timestamp of when the view occurred.',
38
+ type: 'string',
39
+ required: false,
40
+ default: { '@path': '$.timestamp' }
41
+ },
42
+ duration: {
43
+ label: 'Duration',
44
+ description: 'The duration of the view in seconds.',
45
+ type: 'integer',
46
+ required: false
47
+ },
48
+ ...commonFields_1.interactionFields('view')
49
+ },
50
+ perform: async (request, data) => {
51
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
52
+ await client.send(new recombeeApiClient_1.AddDetailView(data.payload));
53
+ },
54
+ performBatch: async (request, data) => {
55
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
56
+ await client.send(new recombeeApiClient_1.Batch(data.payload.map((payload) => new recombeeApiClient_1.AddDetailView(payload))));
57
+ }
58
+ };
59
+ exports.default = action;
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/recombee/addDetailView/index.ts"],"names":[],"mappings":";;AAGA,4DAA8E;AAC9E,kDAAmD;AAEnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,8DAA8D;IAC3E,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;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,eAAe,EAAE;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;oBAC9C,IAAI,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;oBAC5C,IAAI,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;iBAC3C;aACF;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,8CAA8C;YAC3D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;SAChB;QACD,GAAG,gCAAiB,CAAC,MAAM,CAAC;KAC7B;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC5D,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,iCAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IACpD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC5D,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,yBAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,iCAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;IACzF,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,14 @@
1
+ export interface Payload {
2
+ userId: string;
3
+ items: {
4
+ itemId: string;
5
+ amount?: number;
6
+ price?: number;
7
+ profit?: number;
8
+ }[];
9
+ timestamp?: string;
10
+ recommId?: string;
11
+ additionalData?: {
12
+ [k: string]: unknown;
13
+ };
14
+ }
@@ -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/recombee/addPurchase/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,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const recombeeApiClient_1 = require("../recombeeApiClient");
4
+ const commonFields_1 = require("../commonFields");
5
+ const action = {
6
+ title: 'Add Purchase',
7
+ description: 'Adds a purchase of the given item(s) made by the given user.',
8
+ fields: {
9
+ userId: {
10
+ label: 'User ID',
11
+ description: 'The ID of the user who purchased the item(s).',
12
+ type: 'string',
13
+ required: true,
14
+ default: {
15
+ '@if': {
16
+ exists: { '@path': '$.userId' },
17
+ then: { '@path': '$.userId' },
18
+ else: { '@path': '$.anonymousId' }
19
+ }
20
+ }
21
+ },
22
+ items: {
23
+ label: 'Items',
24
+ description: 'The items that were purchased.',
25
+ type: 'object',
26
+ multiple: true,
27
+ required: true,
28
+ properties: {
29
+ itemId: {
30
+ label: 'Item ID',
31
+ description: 'ID of the item.',
32
+ type: 'string',
33
+ required: true
34
+ },
35
+ amount: {
36
+ label: 'Amount',
37
+ description: 'The amount (number) of the item purchased.',
38
+ type: 'number',
39
+ required: false,
40
+ default: 1
41
+ },
42
+ price: {
43
+ label: 'Price (per item)',
44
+ description: 'The price of the purchased item. If `amount` is greater than 1, the price of one item should be given.',
45
+ type: 'number',
46
+ required: false
47
+ },
48
+ profit: {
49
+ label: 'Profit (per item)',
50
+ description: 'The profit of the purchased item. If `amount` is greater than 1, the profit per one item should be given.',
51
+ type: 'number',
52
+ required: false
53
+ }
54
+ },
55
+ default: {
56
+ '@arrayPath': [
57
+ '$.properties.products',
58
+ {
59
+ itemId: {
60
+ '@if': {
61
+ exists: { '@path': '$.product_id' },
62
+ then: { '@path': '$.product_id' },
63
+ else: { '@path': '$.sku' }
64
+ }
65
+ },
66
+ amount: {
67
+ '@path': '$.quantity'
68
+ },
69
+ price: {
70
+ '@path': '$.price'
71
+ },
72
+ profit: {
73
+ '@path': '$.profit'
74
+ }
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ timestamp: {
80
+ label: 'Timestamp',
81
+ description: 'The UTC timestamp of when the purchase occurred.',
82
+ type: 'string',
83
+ required: false,
84
+ default: { '@path': '$.timestamp' }
85
+ },
86
+ ...commonFields_1.interactionFields('purchase')
87
+ },
88
+ perform: async (request, data) => {
89
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
90
+ await client.send(new recombeeApiClient_1.Batch(payloadToInteractions(data.payload)));
91
+ },
92
+ performBatch: async (request, data) => {
93
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
94
+ await client.send(new recombeeApiClient_1.Batch(data.payload.flatMap(payloadToInteractions)));
95
+ }
96
+ };
97
+ function payloadToInteractions(payload) {
98
+ return payload.items.map((item) => new recombeeApiClient_1.AddPurchase({
99
+ userId: payload.userId,
100
+ ...item,
101
+ timestamp: payload.timestamp,
102
+ recommId: payload.recommId,
103
+ additionalData: payload.additionalData
104
+ }));
105
+ }
106
+ exports.default = action;
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/recombee/addPurchase/index.ts"],"names":[],"mappings":";;AAGA,4DAA4E;AAC5E,kDAAmD;AAEnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,8DAA8D;IAC3E,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,+CA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KACvC,CAAC,CACL,CAAA;AACH,CAAC;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ userId: string;
3
+ itemId: string;
4
+ timestamp?: string;
5
+ rating: number;
6
+ recommId?: string;
7
+ additionalData?: {
8
+ [k: string]: unknown;
9
+ };
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/recombee/addRating/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,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const recombeeApiClient_1 = require("../recombeeApiClient");
4
+ const commonFields_1 = require("../commonFields");
5
+ const action = {
6
+ title: 'Add Rating',
7
+ description: 'Adds a rating of the given item made by the given user.',
8
+ fields: {
9
+ userId: {
10
+ label: 'User ID',
11
+ description: 'The ID of the user who submitted the rating.',
12
+ type: 'string',
13
+ required: true,
14
+ default: {
15
+ '@if': {
16
+ exists: { '@path': '$.userId' },
17
+ then: { '@path': '$.userId' },
18
+ else: { '@path': '$.anonymousId' }
19
+ }
20
+ }
21
+ },
22
+ itemId: {
23
+ label: 'Item ID',
24
+ description: 'The rated item.',
25
+ type: 'string',
26
+ required: true,
27
+ default: {
28
+ '@if': {
29
+ exists: { '@path': '$.properties.product_id' },
30
+ then: { '@path': '$.properties.product_id' },
31
+ else: { '@path': '$.properties.asset_id' }
32
+ }
33
+ }
34
+ },
35
+ timestamp: {
36
+ label: 'Timestamp',
37
+ description: 'The UTC timestamp of when the rating occurred.',
38
+ type: 'string',
39
+ required: false,
40
+ default: { '@path': '$.timestamp' }
41
+ },
42
+ rating: {
43
+ label: 'Rating',
44
+ description: 'The rating of the item rescaled to interval [-1.0,1.0], where -1.0 means the worst rating possible, 0.0 means neutral, and 1.0 means absolutely positive rating. For example, in the case of 5-star evaluations, rating = (numStars-3)/2 formula may be used for the conversion.',
45
+ type: 'number',
46
+ required: true,
47
+ default: { '@path': '$.properties.rating' }
48
+ },
49
+ ...commonFields_1.interactionFields('rating')
50
+ },
51
+ perform: async (request, data) => {
52
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
53
+ await client.send(new recombeeApiClient_1.AddRating(data.payload));
54
+ },
55
+ performBatch: async (request, data) => {
56
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
57
+ await client.send(new recombeeApiClient_1.Batch(data.payload.map((payload) => new recombeeApiClient_1.AddRating(payload))));
58
+ }
59
+ };
60
+ exports.default = action;
61
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/recombee/addRating/index.ts"],"names":[],"mappings":";;AAGA,4DAA0E;AAC1E,kDAAmD;AAEnD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,yDAAyD;IACtE,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,8CAA8C;YAC3D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;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,eAAe,EAAE;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,QAAQ;YACd,QAAQ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"}
@@ -0,0 +1,32 @@
1
+ import { InputField } from '@segment/actions-core';
2
+ export declare function interactionFields(interactionName: string): Record<string, InputField>;
3
+ export declare const ecommerceIdMapping: {
4
+ itemId: {
5
+ '@if': {
6
+ exists: {
7
+ '@path': string;
8
+ };
9
+ then: {
10
+ '@path': string;
11
+ };
12
+ else: {
13
+ '@path': string;
14
+ };
15
+ };
16
+ };
17
+ };
18
+ export declare const videoIdMapping: {
19
+ itemId: {
20
+ '@if': {
21
+ exists: {
22
+ '@path': string;
23
+ };
24
+ then: {
25
+ '@path': string;
26
+ };
27
+ else: {
28
+ '@path': string;
29
+ };
30
+ };
31
+ };
32
+ };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.videoIdMapping = exports.ecommerceIdMapping = exports.interactionFields = void 0;
4
+ function interactionFields(interactionName) {
5
+ return {
6
+ recommId: {
7
+ label: 'Recommendation ID',
8
+ description: `The ID of the clicked recommendation (if the ${interactionName} is based on a recommendation request).`,
9
+ type: 'string',
10
+ required: false,
11
+ default: {
12
+ '@path': '$.properties.recomm_id'
13
+ }
14
+ },
15
+ additionalData: {
16
+ label: 'Additional Data',
17
+ description: `Additional data to be stored with the ${interactionName}. *Keep this field empty unless instructed by the Recombee Support team.*`,
18
+ type: 'object',
19
+ required: false,
20
+ displayMode: 'collapsed'
21
+ }
22
+ };
23
+ }
24
+ exports.interactionFields = interactionFields;
25
+ exports.ecommerceIdMapping = {
26
+ itemId: {
27
+ '@if': {
28
+ exists: { '@path': '$.product_id' },
29
+ then: { '@path': '$.product_id' },
30
+ else: { '@path': '$.sku' }
31
+ }
32
+ }
33
+ };
34
+ exports.videoIdMapping = {
35
+ itemId: {
36
+ '@if': {
37
+ exists: { '@path': '$.properties.content_asset_id' },
38
+ then: { '@path': '$.properties.content_asset_id' },
39
+ else: { '@path': '$.properties.content_asset_ids[0]' }
40
+ }
41
+ }
42
+ };
43
+ //# sourceMappingURL=commonFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonFields.js","sourceRoot":"","sources":["../../../src/destinations/recombee/commonFields.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,eAAuB;IACvD,OAAO;QACL,QAAQ,EAAE;YACR,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,gDAAgD,eAAe,yCAAyC;YACrH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,wBAAwB;aAClC;SACF;QACD,cAAc,EAAE;YACd,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,yCAAyC,eAAe,2EAA2E;YAChJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,WAAW;SACzB;KACF,CAAA;AACH,CAAC;AAnBD,8CAmBC;AAEY,QAAA,kBAAkB,GAAG;IAChC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;YACnC,IAAI,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;YACjC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;SAC3B;KACF;CACF,CAAA;AAEY,QAAA,cAAc,GAAG;IAC5B,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,OAAO,EAAE,+BAA+B,EAAE;YACpD,IAAI,EAAE,EAAE,OAAO,EAAE,+BAA+B,EAAE;YAClD,IAAI,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE;SACvD;KACF;CACF,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface Payload {
2
+ userId: string;
3
+ itemId: string;
4
+ timestamp?: string;
5
+ }
@@ -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/recombee/deleteBookmark/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 recombeeApiClient_1 = require("../recombeeApiClient");
4
+ const action = {
5
+ title: 'Delete Bookmark',
6
+ description: 'Deletes a bookmark of the given item made by the given user.',
7
+ defaultSubscription: 'type = "track"',
8
+ fields: {
9
+ userId: {
10
+ label: 'User ID',
11
+ description: 'The ID of the user who bookmarked the item.',
12
+ type: 'string',
13
+ required: true,
14
+ default: {
15
+ '@if': {
16
+ exists: { '@path': '$.userId' },
17
+ then: { '@path': '$.userId' },
18
+ else: { '@path': '$.anonymousId' }
19
+ }
20
+ }
21
+ },
22
+ itemId: {
23
+ label: 'Item ID',
24
+ description: 'The item that was bookmarked.',
25
+ type: 'string',
26
+ required: true,
27
+ default: {
28
+ '@if': {
29
+ exists: { '@path': '$.properties.product_id' },
30
+ then: { '@path': '$.properties.product_id' },
31
+ else: { '@path': '$.properties.asset_id' }
32
+ }
33
+ }
34
+ },
35
+ timestamp: {
36
+ label: 'Timestamp',
37
+ description: 'The UTC timestamp of when the bookmark occurred. If the timestamp is omitted, then all the bookmarks with the given `userId` and `itemId` are deleted.',
38
+ type: 'string',
39
+ required: false
40
+ }
41
+ },
42
+ perform: async (request, data) => {
43
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
44
+ await client.send(new recombeeApiClient_1.DeleteBookmark(data.payload));
45
+ },
46
+ performBatch: async (request, data) => {
47
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
48
+ await client.send(new recombeeApiClient_1.Batch(data.payload.map((payload) => new recombeeApiClient_1.DeleteBookmark(payload))));
49
+ }
50
+ };
51
+ exports.default = action;
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/recombee/deleteBookmark/index.ts"],"names":[],"mappings":";;AAGA,4DAA+E;AAE/E,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,8DAA8D;IAC3E,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;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,eAAe,EAAE;iBACnC;aACF;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;oBAC9C,IAAI,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;oBAC5C,IAAI,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE;iBAC3C;aACF;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,wJAAwJ;YAC1J,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC5D,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,kCAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IACrD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACpC,MAAM,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAC5D,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,yBAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,kCAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1F,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,5 @@
1
+ export interface Payload {
2
+ userId: string;
3
+ itemId: string;
4
+ timestamp?: string;
5
+ }
@@ -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/recombee/deleteCartAddition/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 recombeeApiClient_1 = require("../recombeeApiClient");
4
+ const action = {
5
+ title: 'Delete Cart Addition',
6
+ description: 'Deletes a cart addition of the given item made by the given user.',
7
+ defaultSubscription: 'type = "track" and event = "Product Removed"',
8
+ fields: {
9
+ userId: {
10
+ label: 'User ID',
11
+ description: 'The ID of the user who added the item to the cart.',
12
+ type: 'string',
13
+ required: true,
14
+ default: {
15
+ '@if': {
16
+ exists: { '@path': '$.userId' },
17
+ then: { '@path': '$.userId' },
18
+ else: { '@path': '$.anonymousId' }
19
+ }
20
+ }
21
+ },
22
+ itemId: {
23
+ label: 'Item ID',
24
+ description: 'The item that was added to the cart.',
25
+ type: 'string',
26
+ required: true,
27
+ default: {
28
+ '@if': {
29
+ exists: { '@path': '$.properties.product_id' },
30
+ then: { '@path': '$.properties.product_id' },
31
+ else: { '@path': '$.properties.asset_id' }
32
+ }
33
+ }
34
+ },
35
+ timestamp: {
36
+ label: 'Timestamp',
37
+ description: 'The UTC timestamp of when the bookmark occurred. If the timestamp is omitted, then all the bookmarks with the given `userId` and `itemId` are deleted.',
38
+ type: 'string',
39
+ required: false
40
+ }
41
+ },
42
+ perform: async (request, data) => {
43
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
44
+ await client.send(new recombeeApiClient_1.DeleteCartAddition(data.payload));
45
+ },
46
+ performBatch: async (request, data) => {
47
+ const client = new recombeeApiClient_1.RecombeeApiClient(data.settings, request);
48
+ await client.send(new recombeeApiClient_1.Batch(data.payload.map((payload) => new recombeeApiClient_1.DeleteCartAddition(payload))));
49
+ }
50
+ };
51
+ exports.default = action;
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/recombee/deleteCartAddition/index.ts"],"names":[],"mappings":";;AAGA,4DAAmF;AAEnF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,mEAAmE;IAChF,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;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,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@@ -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/recombee/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;