@blux.ai/web-sdk 0.0.5 → 0.0.6-tommy0

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 (115) hide show
  1. package/README.md +4 -4
  2. package/demo/craco.config.js +2 -0
  3. package/demo/package.json +4 -2
  4. package/demo/public/index.html +1 -1
  5. package/demo/tailwind.config.js +2 -0
  6. package/dist/BluxClient.d.ts +14 -13
  7. package/dist/BluxClient.js +180 -324
  8. package/dist/BluxClient.js.map +1 -1
  9. package/dist/apis/createEvent.d.ts +4 -0
  10. package/dist/apis/createEvent.js +7 -0
  11. package/dist/apis/createEvent.js.map +1 -0
  12. package/dist/apis/getItemRecommendation.d.ts +4 -0
  13. package/dist/apis/getItemRecommendation.js +7 -0
  14. package/dist/apis/getItemRecommendation.js.map +1 -0
  15. package/dist/apis/initialize.d.ts +4 -0
  16. package/dist/apis/initialize.js +7 -0
  17. package/dist/apis/initialize.js.map +1 -0
  18. package/dist/apis/signIn.d.ts +4 -0
  19. package/dist/apis/signIn.js +7 -0
  20. package/dist/apis/signIn.js.map +1 -0
  21. package/dist/apis/signOut.d.ts +4 -0
  22. package/dist/apis/signOut.js +7 -0
  23. package/dist/apis/signOut.js.map +1 -0
  24. package/dist/apis/updateCustomUserProperties.d.ts +4 -0
  25. package/dist/apis/updateCustomUserProperties.js +7 -0
  26. package/dist/apis/updateCustomUserProperties.js.map +1 -0
  27. package/dist/apis/updateUserProperties.d.ts +4 -0
  28. package/dist/apis/updateUserProperties.js +7 -0
  29. package/dist/apis/updateUserProperties.js.map +1 -0
  30. package/dist/constants/URLS.d.ts +1 -7
  31. package/dist/constants/URLS.js +3 -15
  32. package/dist/constants/URLS.js.map +1 -1
  33. package/dist/events/AddCartaddEvent.d.ts +2 -2
  34. package/dist/events/AddCartaddEvent.js +9 -40
  35. package/dist/events/AddCartaddEvent.js.map +1 -1
  36. package/dist/events/AddCustomEvent.d.ts +2 -2
  37. package/dist/events/AddCustomEvent.js +11 -42
  38. package/dist/events/AddCustomEvent.js.map +1 -1
  39. package/dist/events/AddLikeEvent.d.ts +2 -2
  40. package/dist/events/AddLikeEvent.js +9 -40
  41. package/dist/events/AddLikeEvent.js.map +1 -1
  42. package/dist/events/AddPageViewEvent.d.ts +2 -2
  43. package/dist/events/AddPageViewEvent.js +9 -38
  44. package/dist/events/AddPageViewEvent.js.map +1 -1
  45. package/dist/events/AddProductDetailViewEvent.d.ts +2 -2
  46. package/dist/events/AddProductDetailViewEvent.js +11 -41
  47. package/dist/events/AddProductDetailViewEvent.js.map +1 -1
  48. package/dist/events/AddPurchaseEvent.d.ts +2 -2
  49. package/dist/events/AddPurchaseEvent.js +11 -39
  50. package/dist/events/AddPurchaseEvent.js.map +1 -1
  51. package/dist/events/AddRateEvent.d.ts +2 -2
  52. package/dist/events/AddRateEvent.js +9 -40
  53. package/dist/events/AddRateEvent.js.map +1 -1
  54. package/dist/events/AddRecommendationViewEvent.d.ts +2 -2
  55. package/dist/events/AddRecommendationViewEvent.js +8 -39
  56. package/dist/events/AddRecommendationViewEvent.js.map +1 -1
  57. package/dist/events/Event.d.ts +2 -2
  58. package/dist/events/Event.js +11 -25
  59. package/dist/events/Event.js.map +1 -1
  60. package/dist/events/VisitEvent.d.ts +5 -0
  61. package/dist/events/VisitEvent.js +11 -0
  62. package/dist/events/VisitEvent.js.map +1 -0
  63. package/dist/events/index.js +9 -28
  64. package/dist/events/index.js.map +1 -1
  65. package/dist/events/types.d.ts +6 -10
  66. package/dist/events/types.js +2 -6
  67. package/dist/events/types.js.map +1 -1
  68. package/dist/index.d.ts +3 -1
  69. package/dist/index.js +6 -23
  70. package/dist/index.js.map +1 -1
  71. package/dist/recommendations/ItemRecommendation.d.ts +5 -0
  72. package/dist/recommendations/ItemRecommendation.js +12 -0
  73. package/dist/recommendations/ItemRecommendation.js.map +1 -0
  74. package/dist/recommendations/Recommendation.d.ts +5 -0
  75. package/dist/recommendations/Recommendation.js +9 -0
  76. package/dist/recommendations/Recommendation.js.map +1 -0
  77. package/dist/recommendations/index.d.ts +1 -0
  78. package/dist/recommendations/index.js +2 -0
  79. package/dist/recommendations/index.js.map +1 -0
  80. package/dist/recommendations/types.d.ts +11 -0
  81. package/dist/recommendations/types.js +2 -0
  82. package/dist/recommendations/types.js.map +1 -0
  83. package/dist/utils/LocalStorage.js +14 -0
  84. package/dist/utils/LocalStorage.js.map +1 -0
  85. package/dist/{core → utils}/Logger.d.ts +1 -1
  86. package/dist/utils/Logger.js +49 -0
  87. package/dist/utils/Logger.js.map +1 -0
  88. package/dist/utils/getPath.d.ts +1 -0
  89. package/dist/utils/getPath.js +4 -0
  90. package/dist/utils/getPath.js.map +1 -0
  91. package/dist/utils/helper.js +2 -9
  92. package/dist/utils/helper.js.map +1 -1
  93. package/dist/utils/operators.d.ts +1 -1
  94. package/dist/utils/operators.js +5 -11
  95. package/dist/utils/operators.js.map +1 -1
  96. package/package.json +7 -6
  97. package/.prettierrc +0 -4
  98. package/.sentryclirc +0 -3
  99. package/demo/README.md +0 -46
  100. package/demo/src/App.test.tsx +0 -9
  101. package/demo/src/App.tsx +0 -158
  102. package/demo/src/index.css +0 -16
  103. package/demo/src/index.tsx +0 -19
  104. package/demo/src/react-app-env.d.ts +0 -1
  105. package/demo/src/reportWebVitals.ts +0 -15
  106. package/demo/src/setupTests.ts +0 -5
  107. package/demo/yarn.lock +0 -10120
  108. package/dist/core/LocalStorage.js +0 -21
  109. package/dist/core/LocalStorage.js.map +0 -1
  110. package/dist/core/Logger.js +0 -88
  111. package/dist/core/Logger.js.map +0 -1
  112. package/dist/utils/sentry.d.ts +0 -2
  113. package/dist/utils/sentry.js +0 -50
  114. package/dist/utils/sentry.js.map +0 -1
  115. /package/dist/{core → utils}/LocalStorage.d.ts +0 -0
@@ -1,42 +1,12 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c9bf6757-5e86-5733-a4c4-3be4ac06377d")}catch(e){}}();
3
-
4
- var __extends = (this && this.__extends) || (function () {
5
- var extendStatics = function (d, b) {
6
- extendStatics = Object.setPrototypeOf ||
7
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
9
- return extendStatics(d, b);
10
- };
11
- return function (d, b) {
12
- if (typeof b !== "function" && b !== null)
13
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
- extendStatics(d, b);
15
- function __() { this.constructor = d; }
16
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
- };
18
- })();
19
- exports.__esModule = true;
20
- exports.AddProductDetailViewEvent = void 0;
21
- var helper_1 = require("../utils/helper");
22
- var Event_1 = require("./Event");
23
- var AddProductDetailViewEvent = /** @class */ (function (_super) {
24
- __extends(AddProductDetailViewEvent, _super);
25
- function AddProductDetailViewEvent(_a) {
26
- var item_id = _a.item_id, url = _a.url, ref = _a.ref, recommendation_id = _a.recommendation_id, from = _a.from, event_properties = _a.event_properties, _b = _a.timestamp, timestamp = _b === void 0 ? (0, helper_1.getCurrentUnixTimestamp)() : _b;
27
- return _super.call(this, {
28
- event_type: "product_detail_view",
29
- item_id: item_id,
30
- url: url,
31
- ref: ref,
32
- recommendation_id: recommendation_id,
33
- from: from,
34
- event_properties: event_properties,
35
- timestamp: timestamp
36
- }) || this;
1
+ import { Event } from "./Event";
2
+ import { EventType } from "@blux.ai/common";
3
+ export class AddProductDetailViewEvent extends Event {
4
+ constructor({ item_id, event_properties }) {
5
+ super({
6
+ event_type: EventType.product_detail_view,
7
+ item_id,
8
+ event_properties,
9
+ });
37
10
  }
38
- return AddProductDetailViewEvent;
39
- }(Event_1.Event));
40
- exports.AddProductDetailViewEvent = AddProductDetailViewEvent;
41
- //# sourceMappingURL=AddProductDetailViewEvent.js.map
42
- //# debugId=c9bf6757-5e86-5733-a4c4-3be4ac06377d
11
+ }
12
+ //# sourceMappingURL=AddProductDetailViewEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddProductDetailViewEvent.js","sources":["events/AddProductDetailViewEvent.ts"],"sourceRoot":"/","sourcesContent":["import { IAddProductDetailViewEvent } from \"./types\";\nimport { getCurrentUnixTimestamp } from \"../utils/helper\";\nimport { Event } from \"./Event\";\n\nexport class AddProductDetailViewEvent extends Event {\n constructor({\n item_id,\n url,\n ref,\n recommendation_id,\n from,\n event_properties,\n timestamp = getCurrentUnixTimestamp(),\n }: IAddProductDetailViewEvent) {\n super({\n event_type: \"product_detail_view\",\n item_id,\n url,\n ref,\n recommendation_id,\n from,\n event_properties,\n timestamp,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAA0D;AAC1D,iCAAgC;AAEhC;IAA+C,6CAAK;IAClD,mCAAY,EAQiB;YAP3B,OAAO,aAAA,EACP,GAAG,SAAA,EACH,GAAG,SAAA,EACH,iBAAiB,uBAAA,EACjB,IAAI,UAAA,EACJ,gBAAgB,sBAAA,EAChB,iBAAqC,EAArC,SAAS,mBAAG,IAAA,gCAAuB,GAAE,KAAA;eAErC,kBAAM;YACJ,UAAU,EAAE,qBAAqB;YACjC,OAAO,SAAA;YACP,GAAG,KAAA;YACH,GAAG,KAAA;YACH,iBAAiB,mBAAA;YACjB,IAAI,MAAA;YACJ,gBAAgB,kBAAA;YAChB,SAAS,WAAA;SACV,CAAC;IACJ,CAAC;IACH,gCAAC;AAAD,CAAC,AArBD,CAA+C,aAAK,GAqBnD;AArBY,8DAAyB","debug_id":"c9bf6757-5e86-5733-a4c4-3be4ac06377d"}
1
+ {"version":3,"file":"AddProductDetailViewEvent.js","sourceRoot":"/","sources":["events/AddProductDetailViewEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAA8B;QACnE,KAAK,CAAC;YACJ,UAAU,EAAE,SAAS,CAAC,mBAAmB;YACzC,OAAO;YACP,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddProductDetailViewEvent } from \"./types\";\nimport { Event } from \"./Event\";\nimport { EventType } from \"@blux.ai/common\";\n\nexport class AddProductDetailViewEvent extends Event {\n constructor({ item_id, event_properties }: IAddProductDetailViewEvent) {\n super({\n event_type: EventType.product_detail_view,\n item_id,\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { IAddPurchaseEvent } from "./types";
1
+ import type { IAddPurchaseEvent } from "./types";
2
2
  import { Event } from "./Event";
3
3
  export declare class AddPurchaseEvent extends Event {
4
- constructor({ item_id, price, url, ref, event_properties, timestamp, }: IAddPurchaseEvent);
4
+ constructor({ item_id, price, event_properties }: IAddPurchaseEvent);
5
5
  }
@@ -1,41 +1,13 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="05f7be17-19c7-541d-ab08-08ad0e90289f")}catch(e){}}();
3
-
4
- var __extends = (this && this.__extends) || (function () {
5
- var extendStatics = function (d, b) {
6
- extendStatics = Object.setPrototypeOf ||
7
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
9
- return extendStatics(d, b);
10
- };
11
- return function (d, b) {
12
- if (typeof b !== "function" && b !== null)
13
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
- extendStatics(d, b);
15
- function __() { this.constructor = d; }
16
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
- };
18
- })();
19
- exports.__esModule = true;
20
- exports.AddPurchaseEvent = void 0;
21
- var helper_1 = require("../utils/helper");
22
- var Event_1 = require("./Event");
23
- var AddPurchaseEvent = /** @class */ (function (_super) {
24
- __extends(AddPurchaseEvent, _super);
25
- function AddPurchaseEvent(_a) {
26
- var item_id = _a.item_id, price = _a.price, url = _a.url, ref = _a.ref, event_properties = _a.event_properties, _b = _a.timestamp, timestamp = _b === void 0 ? (0, helper_1.getCurrentUnixTimestamp)() : _b;
27
- return _super.call(this, {
28
- event_type: "purchase",
29
- item_id: item_id,
1
+ import { Event } from "./Event";
2
+ import { EventType } from "@blux.ai/common";
3
+ export class AddPurchaseEvent extends Event {
4
+ constructor({ item_id, price, event_properties }) {
5
+ super({
6
+ event_type: EventType.purchase,
7
+ item_id,
30
8
  event_value: price.toString(),
31
- url: url,
32
- ref: ref,
33
- event_properties: event_properties,
34
- timestamp: timestamp
35
- }) || this;
9
+ event_properties,
10
+ });
36
11
  }
37
- return AddPurchaseEvent;
38
- }(Event_1.Event));
39
- exports.AddPurchaseEvent = AddPurchaseEvent;
40
- //# sourceMappingURL=AddPurchaseEvent.js.map
41
- //# debugId=05f7be17-19c7-541d-ab08-08ad0e90289f
12
+ }
13
+ //# sourceMappingURL=AddPurchaseEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddPurchaseEvent.js","sources":["events/AddPurchaseEvent.ts"],"sourceRoot":"/","sourcesContent":["import { IAddPurchaseEvent } from \"./types\";\nimport { getCurrentUnixTimestamp } from \"../utils/helper\";\nimport { Event } from \"./Event\";\n\nexport class AddPurchaseEvent extends Event {\n constructor({\n item_id,\n price,\n url,\n ref,\n event_properties,\n timestamp = getCurrentUnixTimestamp(),\n }: IAddPurchaseEvent) {\n super({\n event_type: \"purchase\",\n item_id,\n event_value: price.toString(),\n url,\n ref,\n event_properties,\n timestamp,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAA0D;AAC1D,iCAAgC;AAEhC;IAAsC,oCAAK;IACzC,0BAAY,EAOQ;YANlB,OAAO,aAAA,EACP,KAAK,WAAA,EACL,GAAG,SAAA,EACH,GAAG,SAAA,EACH,gBAAgB,sBAAA,EAChB,iBAAqC,EAArC,SAAS,mBAAG,IAAA,gCAAuB,GAAE,KAAA;eAErC,kBAAM;YACJ,UAAU,EAAE,UAAU;YACtB,OAAO,SAAA;YACP,WAAW,EAAE,KAAK,CAAC,QAAQ,EAAE;YAC7B,GAAG,KAAA;YACH,GAAG,KAAA;YACH,gBAAgB,kBAAA;YAChB,SAAS,WAAA;SACV,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AAnBD,CAAsC,aAAK,GAmB1C;AAnBY,4CAAgB","debug_id":"05f7be17-19c7-541d-ab08-08ad0e90289f"}
1
+ {"version":3,"file":"AddPurchaseEvent.js","sourceRoot":"/","sources":["events/AddPurchaseEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAqB;QACjE,KAAK,CAAC;YACJ,UAAU,EAAE,SAAS,CAAC,QAAQ;YAC9B,OAAO;YACP,WAAW,EAAE,KAAK,CAAC,QAAQ,EAAE;YAC7B,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddPurchaseEvent } from \"./types\";\nimport { Event } from \"./Event\";\nimport { EventType } from \"@blux.ai/common\";\n\nexport class AddPurchaseEvent extends Event {\n constructor({ item_id, price, event_properties }: IAddPurchaseEvent) {\n super({\n event_type: EventType.purchase,\n item_id,\n event_value: price.toString(),\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { IAddRateEvent } from "./types";
1
+ import type { IAddRateEvent } from "./types";
2
2
  import { Event } from "./Event";
3
3
  export declare class AddRateEvent extends Event {
4
- constructor({ item_id, rating, url, ref, recommendation_id, from, event_properties, timestamp, }: IAddRateEvent);
4
+ constructor({ item_id, rating, event_properties }: IAddRateEvent);
5
5
  }
@@ -1,43 +1,12 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0540da65-445e-58bd-8562-798cbf8437d2")}catch(e){}}();
3
-
4
- var __extends = (this && this.__extends) || (function () {
5
- var extendStatics = function (d, b) {
6
- extendStatics = Object.setPrototypeOf ||
7
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
9
- return extendStatics(d, b);
10
- };
11
- return function (d, b) {
12
- if (typeof b !== "function" && b !== null)
13
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
- extendStatics(d, b);
15
- function __() { this.constructor = d; }
16
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
- };
18
- })();
19
- exports.__esModule = true;
20
- exports.AddRateEvent = void 0;
21
- var helper_1 = require("../utils/helper");
22
- var Event_1 = require("./Event");
23
- var AddRateEvent = /** @class */ (function (_super) {
24
- __extends(AddRateEvent, _super);
25
- function AddRateEvent(_a) {
26
- var item_id = _a.item_id, rating = _a.rating, url = _a.url, ref = _a.ref, recommendation_id = _a.recommendation_id, from = _a.from, event_properties = _a.event_properties, _b = _a.timestamp, timestamp = _b === void 0 ? (0, helper_1.getCurrentUnixTimestamp)() : _b;
27
- return _super.call(this, {
1
+ import { Event } from "./Event";
2
+ export class AddRateEvent extends Event {
3
+ constructor({ item_id, rating, event_properties }) {
4
+ super({
28
5
  event_type: "rate",
29
6
  event_value: rating.toString(),
30
- item_id: item_id,
31
- url: url,
32
- ref: ref,
33
- recommendation_id: recommendation_id,
34
- from: from,
35
- event_properties: event_properties,
36
- timestamp: timestamp
37
- }) || this;
7
+ item_id,
8
+ event_properties,
9
+ });
38
10
  }
39
- return AddRateEvent;
40
- }(Event_1.Event));
41
- exports.AddRateEvent = AddRateEvent;
42
- //# sourceMappingURL=AddRateEvent.js.map
43
- //# debugId=0540da65-445e-58bd-8562-798cbf8437d2
11
+ }
12
+ //# sourceMappingURL=AddRateEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddRateEvent.js","sources":["events/AddRateEvent.ts"],"sourceRoot":"/","sourcesContent":["import { IAddRateEvent } from \"./types\";\nimport { getCurrentUnixTimestamp } from \"../utils/helper\";\nimport { Event } from \"./Event\";\n\nexport class AddRateEvent extends Event {\n constructor({\n item_id,\n rating,\n url,\n ref,\n recommendation_id,\n from,\n event_properties,\n timestamp = getCurrentUnixTimestamp(),\n }: IAddRateEvent) {\n super({\n event_type: \"rate\",\n event_value: rating.toString(),\n item_id,\n url,\n ref,\n recommendation_id,\n from,\n event_properties,\n timestamp,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAA0D;AAC1D,iCAAgC;AAEhC;IAAkC,gCAAK;IACrC,sBAAY,EASI;YARd,OAAO,aAAA,EACP,MAAM,YAAA,EACN,GAAG,SAAA,EACH,GAAG,SAAA,EACH,iBAAiB,uBAAA,EACjB,IAAI,UAAA,EACJ,gBAAgB,sBAAA,EAChB,iBAAqC,EAArC,SAAS,mBAAG,IAAA,gCAAuB,GAAE,KAAA;eAErC,kBAAM;YACJ,UAAU,EAAE,MAAM;YAClB,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE;YAC9B,OAAO,SAAA;YACP,GAAG,KAAA;YACH,GAAG,KAAA;YACH,iBAAiB,mBAAA;YACjB,IAAI,MAAA;YACJ,gBAAgB,kBAAA;YAChB,SAAS,WAAA;SACV,CAAC;IACJ,CAAC;IACH,mBAAC;AAAD,CAAC,AAvBD,CAAkC,aAAK,GAuBtC;AAvBY,oCAAY","debug_id":"0540da65-445e-58bd-8562-798cbf8437d2"}
1
+ {"version":3,"file":"AddRateEvent.js","sourceRoot":"/","sources":["events/AddRateEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAiB;QAC9D,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE;YAC9B,OAAO;YACP,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddRateEvent } from \"./types\";\nimport { Event } from \"./Event\";\n\nexport class AddRateEvent extends Event {\n constructor({ item_id, rating, event_properties }: IAddRateEvent) {\n super({\n event_type: \"rate\",\n event_value: rating.toString(),\n item_id,\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { IAddRecommendationViewEvent } from "./types";
1
+ import type { IAddRecommendationViewEvent } from "./types";
2
2
  import { Event } from "./Event";
3
3
  export declare class AddRecommendationViewEvent extends Event {
4
- constructor({ url, ref, recommendation_id, from, event_properties, timestamp, }: IAddRecommendationViewEvent);
4
+ constructor({ event_properties }: IAddRecommendationViewEvent);
5
5
  }
@@ -1,41 +1,10 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4533348d-c331-5873-b083-81bf8e2d0cb9")}catch(e){}}();
3
-
4
- var __extends = (this && this.__extends) || (function () {
5
- var extendStatics = function (d, b) {
6
- extendStatics = Object.setPrototypeOf ||
7
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
8
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
9
- return extendStatics(d, b);
10
- };
11
- return function (d, b) {
12
- if (typeof b !== "function" && b !== null)
13
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
14
- extendStatics(d, b);
15
- function __() { this.constructor = d; }
16
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
17
- };
18
- })();
19
- exports.__esModule = true;
20
- exports.AddRecommendationViewEvent = void 0;
21
- var helper_1 = require("../utils/helper");
22
- var Event_1 = require("./Event");
23
- var AddRecommendationViewEvent = /** @class */ (function (_super) {
24
- __extends(AddRecommendationViewEvent, _super);
25
- function AddRecommendationViewEvent(_a) {
26
- var url = _a.url, ref = _a.ref, recommendation_id = _a.recommendation_id, from = _a.from, event_properties = _a.event_properties, _b = _a.timestamp, timestamp = _b === void 0 ? (0, helper_1.getCurrentUnixTimestamp)() : _b;
27
- return _super.call(this, {
1
+ import { Event } from "./Event";
2
+ export class AddRecommendationViewEvent extends Event {
3
+ constructor({ event_properties }) {
4
+ super({
28
5
  event_type: "recommendation_view",
29
- url: url,
30
- ref: ref,
31
- recommendation_id: recommendation_id,
32
- from: from,
33
- event_properties: event_properties,
34
- timestamp: timestamp
35
- }) || this;
6
+ event_properties,
7
+ });
36
8
  }
37
- return AddRecommendationViewEvent;
38
- }(Event_1.Event));
39
- exports.AddRecommendationViewEvent = AddRecommendationViewEvent;
40
- //# sourceMappingURL=AddRecommendationViewEvent.js.map
41
- //# debugId=4533348d-c331-5873-b083-81bf8e2d0cb9
9
+ }
10
+ //# sourceMappingURL=AddRecommendationViewEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddRecommendationViewEvent.js","sources":["events/AddRecommendationViewEvent.ts"],"sourceRoot":"/","sourcesContent":["import { IAddRecommendationViewEvent } from \"./types\";\nimport { getCurrentUnixTimestamp } from \"../utils/helper\";\nimport { Event } from \"./Event\";\n\nexport class AddRecommendationViewEvent extends Event {\n constructor({\n url,\n ref,\n recommendation_id,\n from,\n event_properties,\n timestamp = getCurrentUnixTimestamp(),\n }: IAddRecommendationViewEvent) {\n super({\n event_type: \"recommendation_view\",\n url,\n ref,\n recommendation_id,\n from,\n event_properties,\n timestamp,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAA0D;AAC1D,iCAAgC;AAEhC;IAAgD,8CAAK;IACnD,oCAAY,EAOkB;YAN5B,GAAG,SAAA,EACH,GAAG,SAAA,EACH,iBAAiB,uBAAA,EACjB,IAAI,UAAA,EACJ,gBAAgB,sBAAA,EAChB,iBAAqC,EAArC,SAAS,mBAAG,IAAA,gCAAuB,GAAE,KAAA;eAErC,kBAAM;YACJ,UAAU,EAAE,qBAAqB;YACjC,GAAG,KAAA;YACH,GAAG,KAAA;YACH,iBAAiB,mBAAA;YACjB,IAAI,MAAA;YACJ,gBAAgB,kBAAA;YAChB,SAAS,WAAA;SACV,CAAC;IACJ,CAAC;IACH,iCAAC;AAAD,CAAC,AAnBD,CAAgD,aAAK,GAmBpD;AAnBY,gEAA0B","debug_id":"4533348d-c331-5873-b083-81bf8e2d0cb9"}
1
+ {"version":3,"file":"AddRecommendationViewEvent.js","sourceRoot":"/","sources":["events/AddRecommendationViewEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnD,YAAY,EAAE,gBAAgB,EAA+B;QAC3D,KAAK,CAAC;YACJ,UAAU,EAAE,qBAAqB;YACjC,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddRecommendationViewEvent } from \"./types\";\nimport { Event } from \"./Event\";\n\nexport class AddRecommendationViewEvent extends Event {\n constructor({ event_properties }: IAddRecommendationViewEvent) {\n super({\n event_type: \"recommendation_view\",\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { EventRequest } from "./types";
1
+ import type { EventRequest } from "./types";
2
2
  export declare abstract class Event {
3
3
  readonly request: EventRequest;
4
- constructor(data: Omit<EventRequest, "id">);
4
+ constructor(data: Omit<EventRequest, "id" | "captured_at">);
5
5
  }
@@ -1,26 +1,12 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f1f7685c-909d-5d4a-bf30-037dda253e70")}catch(e){}}();
3
-
4
- var __assign = (this && this.__assign) || function () {
5
- __assign = Object.assign || function(t) {
6
- for (var s, i = 1, n = arguments.length; i < n; i++) {
7
- s = arguments[i];
8
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
9
- t[p] = s[p];
10
- }
11
- return t;
12
- };
13
- return __assign.apply(this, arguments);
14
- };
15
- exports.__esModule = true;
16
- exports.Event = void 0;
17
- var uuid_1 = require("uuid");
18
- var Event = /** @class */ (function () {
19
- function Event(data) {
20
- this.request = __assign({ id: (0, uuid_1.v4)() }, data);
1
+ import { v4 as uuid } from "uuid";
2
+ export class Event {
3
+ request;
4
+ constructor(data) {
5
+ this.request = {
6
+ id: uuid(),
7
+ captured_at: new Date().toISOString(),
8
+ ...data,
9
+ };
21
10
  }
22
- return Event;
23
- }());
24
- exports.Event = Event;
25
- //# sourceMappingURL=Event.js.map
26
- //# debugId=f1f7685c-909d-5d4a-bf30-037dda253e70
11
+ }
12
+ //# sourceMappingURL=Event.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Event.js","sources":["events/Event.ts"],"sourceRoot":"/","sourcesContent":["import { EventRequest } from \"./types\";\n\nimport { v4 as uuid } from \"uuid\";\n\nexport abstract class Event {\n public readonly request: EventRequest;\n constructor(data: Omit<EventRequest, \"id\">) {\n this.request = {\n id: uuid(),\n ...data,\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,6BAAkC;AAElC;IAEE,eAAY,IAA8B;QACxC,IAAI,CAAC,OAAO,cACV,EAAE,EAAE,IAAA,SAAI,GAAE,IACP,IAAI,CACR,CAAC;IACJ,CAAC;IACH,YAAC;AAAD,CAAC,AARD,IAQC;AARqB,sBAAK","debug_id":"f1f7685c-909d-5d4a-bf30-037dda253e70"}
1
+ {"version":3,"file":"Event.js","sourceRoot":"/","sources":["events/Event.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,OAAgB,KAAK;IACT,OAAO,CAAe;IACtC,YAAY,IAA8C;QACxD,IAAI,CAAC,OAAO,GAAG;YACb,EAAE,EAAE,IAAI,EAAE;YACV,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACrC,GAAG,IAAI;SACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { EventRequest } from \"./types\";\n\nimport { v4 as uuid } from \"uuid\";\n\nexport abstract class Event {\n public readonly request: EventRequest;\n constructor(data: Omit<EventRequest, \"id\" | \"captured_at\">) {\n this.request = {\n id: uuid(),\n captured_at: new Date().toISOString(),\n ...data,\n };\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { IVisitEvent } from "./types";
2
+ import { Event } from "./Event";
3
+ export declare class VisitEvent extends Event {
4
+ constructor({ event_properties }: IVisitEvent);
5
+ }
@@ -0,0 +1,11 @@
1
+ import { Event } from "./Event";
2
+ import { EventType } from "@blux.ai/common";
3
+ export class VisitEvent extends Event {
4
+ constructor({ event_properties }) {
5
+ super({
6
+ event_type: EventType.visit,
7
+ event_properties,
8
+ });
9
+ }
10
+ }
11
+ //# sourceMappingURL=VisitEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisitEvent.js","sourceRoot":"/","sources":["events/VisitEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,EAAE,gBAAgB,EAAe;QAC3C,KAAK,CAAC;YACJ,UAAU,EAAE,SAAS,CAAC,KAAK;YAC3B,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IVisitEvent } from \"./types\";\nimport { Event } from \"./Event\";\nimport { EventType } from \"@blux.ai/common\";\n\nexport class VisitEvent extends Event {\n constructor({ event_properties }: IVisitEvent) {\n super({\n event_type: EventType.visit,\n event_properties,\n });\n }\n}\n"]}
@@ -1,28 +1,9 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="372eecae-9cdf-5b5d-afcb-bd0f3ea00a02")}catch(e){}}();
3
-
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
- };
18
- exports.__esModule = true;
19
- __exportStar(require("./AddProductDetailViewEvent"), exports);
20
- __exportStar(require("./AddLikeEvent"), exports);
21
- __exportStar(require("./AddCartaddEvent"), exports);
22
- __exportStar(require("./AddPageViewEvent"), exports);
23
- __exportStar(require("./AddRecommendationViewEvent"), exports);
24
- __exportStar(require("./AddRateEvent"), exports);
25
- __exportStar(require("./AddPurchaseEvent"), exports);
26
- __exportStar(require("./AddCustomEvent"), exports);
27
- //# sourceMappingURL=index.js.map
28
- //# debugId=372eecae-9cdf-5b5d-afcb-bd0f3ea00a02
1
+ export * from "./AddProductDetailViewEvent";
2
+ export * from "./AddLikeEvent";
3
+ export * from "./AddCartaddEvent";
4
+ export * from "./AddPageViewEvent";
5
+ export * from "./AddRecommendationViewEvent";
6
+ export * from "./AddRateEvent";
7
+ export * from "./AddPurchaseEvent";
8
+ export * from "./AddCustomEvent";
9
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["events/index.ts"],"sourceRoot":"/","sourcesContent":["export * from \"./AddProductDetailViewEvent\";\nexport * from \"./AddLikeEvent\";\nexport * from \"./AddCartaddEvent\";\nexport * from \"./AddPageViewEvent\";\nexport * from \"./AddRecommendationViewEvent\";\nexport * from \"./AddRateEvent\";\nexport * from \"./AddPurchaseEvent\";\nexport * from \"./AddCustomEvent\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,+DAA6C;AAC7C,iDAA+B;AAC/B,qDAAmC;AACnC,mDAAiC","debug_id":"372eecae-9cdf-5b5d-afcb-bd0f3ea00a02"}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["events/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from \"./AddProductDetailViewEvent\";\nexport * from \"./AddLikeEvent\";\nexport * from \"./AddCartaddEvent\";\nexport * from \"./AddPageViewEvent\";\nexport * from \"./AddRecommendationViewEvent\";\nexport * from \"./AddRateEvent\";\nexport * from \"./AddPurchaseEvent\";\nexport * from \"./AddCustomEvent\";\n"]}
@@ -3,16 +3,10 @@ export interface EventRequest {
3
3
  event_type: string;
4
4
  event_value?: string;
5
5
  item_id?: string;
6
- url?: string;
7
- ref?: string;
8
- recommendation_id?: string;
9
- from?: string;
10
6
  event_properties?: Record<string, any>;
11
- timestamp: number;
7
+ captured_at: string;
12
8
  }
13
- type BaseEvent = Omit<EventRequest, "event_type" | "event_value" | "id" | "timestamp"> & {
14
- timestamp?: number;
15
- };
9
+ type BaseEvent = Omit<EventRequest, "event_type" | "event_value" | "id" | "captured_at">;
16
10
  export interface IAddProductDetailViewEvent extends BaseEvent {
17
11
  item_id: string;
18
12
  }
@@ -26,7 +20,7 @@ export interface IAddRateEvent extends BaseEvent {
26
20
  item_id: string;
27
21
  rating: number;
28
22
  }
29
- export interface IAddPurchaseEvent extends Omit<BaseEvent, "from"> {
23
+ export interface IAddPurchaseEvent extends BaseEvent {
30
24
  item_id: string;
31
25
  price: number;
32
26
  }
@@ -36,7 +30,9 @@ export interface IAddCustomEvent extends BaseEvent {
36
30
  }
37
31
  export interface IAddRecommendationViewEvent extends Omit<BaseEvent, "item_id"> {
38
32
  }
39
- export interface IAddPageViewEvent extends Omit<BaseEvent, "from" | "item_id" | "recommendation_id"> {
33
+ export interface IVisitEvent extends Omit<BaseEvent, "item_id"> {
34
+ }
35
+ export interface IAddPageViewEvent extends Omit<BaseEvent, "item_id"> {
40
36
  pageType: string;
41
37
  }
42
38
  export {};
@@ -1,6 +1,2 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8aa0a98c-918e-57f5-a870-7d244f4c8131")}catch(e){}}();
3
-
4
- exports.__esModule = true;
5
- //# sourceMappingURL=types.js.map
6
- //# debugId=8aa0a98c-918e-57f5-a870-7d244f4c8131
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["events/types.ts"],"sourceRoot":"/","sourcesContent":["export interface EventRequest {\n id: string;\n event_type: string;\n event_value?: string;\n item_id?: string;\n url?: string;\n ref?: string;\n recommendation_id?: string;\n from?: string;\n event_properties?: Record<string, any>;\n timestamp: number;\n}\n\ntype BaseEvent = Omit<\n EventRequest,\n \"event_type\" | \"event_value\" | \"id\" | \"timestamp\"\n> & { timestamp?: number };\n\nexport interface IAddProductDetailViewEvent extends BaseEvent {\n item_id: string;\n}\n\nexport interface IAddLikeEvent extends BaseEvent {\n item_id: string;\n}\n\nexport interface IAddCartaddEvent extends BaseEvent {\n item_id: string;\n}\n\nexport interface IAddRateEvent extends BaseEvent {\n item_id: string;\n rating: number;\n}\n\nexport interface IAddPurchaseEvent extends Omit<BaseEvent, \"from\"> {\n item_id: string;\n price: number;\n}\n\nexport interface IAddCustomEvent extends BaseEvent {\n event_type: string;\n event_value?: string;\n}\n\nexport interface IAddRecommendationViewEvent\n extends Omit<BaseEvent, \"item_id\"> {}\n\nexport interface IAddPageViewEvent\n extends Omit<BaseEvent, \"from\" | \"item_id\" | \"recommendation_id\"> {\n pageType: string;\n}\n"],"names":[],"mappings":"","debug_id":"8aa0a98c-918e-57f5-a870-7d244f4c8131"}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["events/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nexport interface EventRequest {\n id: string;\n event_type: string;\n event_value?: string;\n item_id?: string;\n event_properties?: Record<string, any>;\n captured_at: string;\n}\n\ntype BaseEvent = Omit<\n EventRequest,\n \"event_type\" | \"event_value\" | \"id\" | \"captured_at\"\n>;\n\nexport interface IAddProductDetailViewEvent extends BaseEvent {\n item_id: string;\n}\n\nexport interface IAddLikeEvent extends BaseEvent {\n item_id: string;\n}\n\nexport interface IAddCartaddEvent extends BaseEvent {\n item_id: string;\n}\n\nexport interface IAddRateEvent extends BaseEvent {\n item_id: string;\n rating: number;\n}\n\nexport interface IAddPurchaseEvent extends BaseEvent {\n item_id: string;\n price: number;\n}\n\nexport interface IAddCustomEvent extends BaseEvent {\n event_type: string;\n event_value?: string;\n}\n\nexport interface IAddRecommendationViewEvent\n extends Omit<BaseEvent, \"item_id\"> {}\n\nexport interface IVisitEvent extends Omit<BaseEvent, \"item_id\"> {}\n\nexport interface IAddPageViewEvent extends Omit<BaseEvent, \"item_id\"> {\n pageType: string;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- import { bluxClient } from "./BluxClient";
1
+ import { bluxClient, BluxClient } from "./BluxClient";
2
2
  export * from "./events";
3
+ export * from "./recommendations";
4
+ export { BluxClient };
3
5
  export default bluxClient;
package/dist/index.js CHANGED
@@ -1,23 +1,6 @@
1
- "use strict";
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1736eddd-536b-54da-8c37-e8f6f09de830")}catch(e){}}();
3
-
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
- };
18
- exports.__esModule = true;
19
- var BluxClient_1 = require("./BluxClient");
20
- __exportStar(require("./events"), exports);
21
- exports["default"] = BluxClient_1.bluxClient;
22
- //# sourceMappingURL=index.js.map
23
- //# debugId=1736eddd-536b-54da-8c37-e8f6f09de830
1
+ import { bluxClient, BluxClient } from "./BluxClient";
2
+ export * from "./events";
3
+ export * from "./recommendations";
4
+ export { BluxClient };
5
+ export default bluxClient;
6
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["index.ts"],"sourceRoot":"/","sourcesContent":["import { bluxClient } from \"./BluxClient\";\n\nexport * from \"./events\";\n\nexport default bluxClient;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA0C;AAE1C,2CAAyB;AAEzB,qBAAe,uBAAU,CAAC","debug_id":"1736eddd-536b-54da-8c37-e8f6f09de830"}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEtD,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,eAAe,UAAU,CAAC","sourcesContent":["import { bluxClient, BluxClient } from \"./BluxClient\";\n\nexport * from \"./events\";\nexport * from \"./recommendations\";\n\nexport { BluxClient };\n\nexport default bluxClient;\n"]}
@@ -0,0 +1,5 @@
1
+ import type { IItemRecommendation } from "./types";
2
+ import { Recommendation } from "./Recommendation";
3
+ export declare class ItemRecommendation extends Recommendation {
4
+ constructor({ call_type, limit, offset, item_ids }: IItemRecommendation);
5
+ }
@@ -0,0 +1,12 @@
1
+ import { Recommendation } from "./Recommendation";
2
+ export class ItemRecommendation extends Recommendation {
3
+ constructor({ call_type, limit, offset, item_ids }) {
4
+ super({
5
+ call_type,
6
+ limit,
7
+ offset: offset ?? 0,
8
+ item_ids,
9
+ });
10
+ }
11
+ }
12
+ //# sourceMappingURL=ItemRecommendation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemRecommendation.js","sourceRoot":"/","sources":["recommendations/ItemRecommendation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IACpD,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAuB;QACrE,KAAK,CAAC;YACJ,SAAS;YACT,KAAK;YACL,MAAM,EAAE,MAAM,IAAI,CAAC;YACnB,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IItemRecommendation } from \"./types\";\nimport { Recommendation } from \"./Recommendation\";\n\nexport class ItemRecommendation extends Recommendation {\n constructor({ call_type, limit, offset, item_ids }: IItemRecommendation) {\n super({\n call_type,\n limit,\n offset: offset ?? 0,\n item_ids,\n });\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { RecommendationRequest } from "./types";
2
+ export declare abstract class Recommendation {
3
+ readonly request: RecommendationRequest;
4
+ constructor(data: RecommendationRequest);
5
+ }
@@ -0,0 +1,9 @@
1
+ export class Recommendation {
2
+ request;
3
+ constructor(data) {
4
+ this.request = {
5
+ ...data,
6
+ };
7
+ }
8
+ }
9
+ //# sourceMappingURL=Recommendation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Recommendation.js","sourceRoot":"/","sources":["recommendations/Recommendation.ts"],"names":[],"mappings":"AAEA,MAAM,OAAgB,cAAc;IAClB,OAAO,CAAwB;IAE/C,YAAY,IAA2B;QACrC,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,IAAI;SACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { RecommendationRequest } from \"./types\";\n\nexport abstract class Recommendation {\n public readonly request: RecommendationRequest;\n\n constructor(data: RecommendationRequest) {\n this.request = {\n ...data,\n };\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export * from "./ItemRecommendation";
@@ -0,0 +1,2 @@
1
+ export * from "./ItemRecommendation";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["recommendations/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC","sourcesContent":["export * from \"./ItemRecommendation\";\n"]}
@@ -0,0 +1,11 @@
1
+ export interface RecommendationRequest {
2
+ call_type: string;
3
+ limit: number;
4
+ offset: number;
5
+ item_ids?: string[];
6
+ }
7
+ type BaseRecommendation = Omit<RecommendationRequest, "offset">;
8
+ export interface IItemRecommendation extends BaseRecommendation {
9
+ offset?: number;
10
+ }
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["recommendations/types.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nexport interface RecommendationRequest {\n call_type: string;\n limit: number;\n offset: number;\n item_ids?: string[];\n}\n\ntype BaseRecommendation = Omit<RecommendationRequest, \"offset\">;\n\nexport interface IItemRecommendation extends BaseRecommendation {\n offset?: number;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ const BLUX_DEVICE_ID = "blux_deviceId";
2
+ // eslint-disable-next-line @typescript-eslint/no-extraneous-class
3
+ export class LocalStorage {
4
+ static getDeviceId() {
5
+ const deviceId = localStorage.getItem(BLUX_DEVICE_ID);
6
+ return deviceId === "undefined" || deviceId?.trim() === ""
7
+ ? null
8
+ : deviceId;
9
+ }
10
+ static setDeviceId(deviceId) {
11
+ localStorage.setItem(BLUX_DEVICE_ID, deviceId);
12
+ }
13
+ }
14
+ //# sourceMappingURL=LocalStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStorage.js","sourceRoot":"/","sources":["utils/LocalStorage.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,eAAe,CAAC;AAEvC,kEAAkE;AAClE,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,WAAW;QAChB,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QACtD,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;YACxD,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,QAAQ,CAAC;IACf,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,QAAgB;QACjC,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["const BLUX_DEVICE_ID = \"blux_deviceId\";\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class LocalStorage {\n static getDeviceId(): string | null {\n const deviceId = localStorage.getItem(BLUX_DEVICE_ID);\n return deviceId === \"undefined\" || deviceId?.trim() === \"\"\n ? null\n : deviceId;\n }\n\n static setDeviceId(deviceId: string) {\n localStorage.setItem(BLUX_DEVICE_ID, deviceId);\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { ScopeContext } from "@sentry/types";
1
+ import type { ScopeContext } from "@sentry/types";
2
2
  export type LogLevel = "debug" | "log" | "warning" | "error" | "fatal";
3
3
  export type Context = Partial<Pick<ScopeContext, "tags" | "extra">>;
4
4
  export declare class Logger {