@blux.ai/web-sdk 0.0.4-rc0 → 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 +6 -6
  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 +16 -15
  7. package/dist/BluxClient.js +180 -320
  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 +2 -6
  31. package/dist/constants/URLS.js +4 -14
  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 -49
  114. package/dist/utils/sentry.js.map +0 -1
  115. /package/dist/{core → utils}/LocalStorage.d.ts +0 -0
@@ -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 {
@@ -0,0 +1,49 @@
1
+ const consoleMethodByLevel = {
2
+ debug: console.debug.bind(console),
3
+ log: console.log.bind(console),
4
+ warning: console.warn.bind(console),
5
+ error: console.error.bind(console),
6
+ fatal: console.error.bind(console),
7
+ };
8
+ const LOG_LEVEL_ORDERS = {
9
+ debug: 0,
10
+ log: 1,
11
+ warning: 2,
12
+ error: 3,
13
+ fatal: 4,
14
+ };
15
+ // eslint-disable-next-line @typescript-eslint/no-extraneous-class
16
+ export class Logger {
17
+ static logLevel = "error";
18
+ static base(message, level, context) {
19
+ if (LOG_LEVEL_ORDERS[level] >= LOG_LEVEL_ORDERS[this.logLevel]) {
20
+ const logForConsole = ["[BluxClient]", message];
21
+ if (context?.extra) {
22
+ logForConsole.push(context.extra);
23
+ }
24
+ if (context?.tags) {
25
+ logForConsole.push(context.tags);
26
+ }
27
+ consoleMethodByLevel[level]?.(...logForConsole);
28
+ }
29
+ }
30
+ static debug(message, context) {
31
+ this.base(message, "debug", context);
32
+ }
33
+ static log(message, context) {
34
+ this.base(message, "log", context);
35
+ }
36
+ static warning(message, context) {
37
+ this.base(message, "warning", context);
38
+ }
39
+ static error(message, context) {
40
+ this.base(message, "error", context);
41
+ }
42
+ static fatal(message, context) {
43
+ this.base(message, "fatal", context);
44
+ }
45
+ static setLevel(level) {
46
+ this.logLevel = level;
47
+ }
48
+ }
49
+ //# sourceMappingURL=Logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Logger.js","sourceRoot":"/","sources":["utils/Logger.ts"],"names":[],"mappings":"AAGA,MAAM,oBAAoB,GAAG;IAC3B,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAClC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;CAC1B,CAAC;AAIX,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACT,CAAC;AAIF,kEAAkE;AAClE,MAAM,OAAO,MAAM;IACV,MAAM,CAAC,QAAQ,GAAa,OAAO,CAAC;IAEnC,MAAM,CAAC,IAAI,CACjB,OAAuB,EACvB,KAAe,EACf,OAAiB;QAEjB,IAAI,gBAAgB,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC9D,MAAM,aAAa,GAAc,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAE3D,IAAI,OAAO,EAAE,KAAK,EAAE;gBAClB,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aACnC;YACD,IAAI,OAAO,EAAE,IAAI,EAAE;gBACjB,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAClC;YAED,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC;SACjD;IACH,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,OAAuB,EAAE,OAAiB;QAC5D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IACM,MAAM,CAAC,GAAG,CAAC,OAAuB,EAAE,OAAiB;QAC1D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IACM,MAAM,CAAC,OAAO,CAAC,OAAuB,EAAE,OAAiB;QAC9D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,OAAuB,EAAE,OAAiB;QAC5D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,OAAuB,EAAE,OAAiB;QAC5D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAe;QACpC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { ScopeContext } from \"@sentry/types\";\n\nconst consoleMethodByLevel = {\n debug: console.debug.bind(console),\n log: console.log.bind(console),\n warning: console.warn.bind(console),\n error: console.error.bind(console),\n fatal: console.error.bind(console),\n} as const;\n\nexport type LogLevel = \"debug\" | \"log\" | \"warning\" | \"error\" | \"fatal\";\n\nconst LOG_LEVEL_ORDERS = {\n debug: 0,\n log: 1,\n warning: 2,\n error: 3,\n fatal: 4,\n};\n\nexport type Context = Partial<Pick<ScopeContext, \"tags\" | \"extra\">>;\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class Logger {\n public static logLevel: LogLevel = \"error\";\n\n private static base(\n message: string | Error,\n level: LogLevel,\n context?: Context,\n ) {\n if (LOG_LEVEL_ORDERS[level] >= LOG_LEVEL_ORDERS[this.logLevel]) {\n const logForConsole: unknown[] = [\"[BluxClient]\", message];\n\n if (context?.extra) {\n logForConsole.push(context.extra);\n }\n if (context?.tags) {\n logForConsole.push(context.tags);\n }\n\n consoleMethodByLevel[level]?.(...logForConsole);\n }\n }\n public static debug(message: string | Error, context?: Context) {\n this.base(message, \"debug\", context);\n }\n public static log(message: string | Error, context?: Context) {\n this.base(message, \"log\", context);\n }\n public static warning(message: string | Error, context?: Context) {\n this.base(message, \"warning\", context);\n }\n public static error(message: string | Error, context?: Context) {\n this.base(message, \"error\", context);\n }\n public static fatal(message: string | Error, context?: Context) {\n this.base(message, \"fatal\", context);\n }\n\n public static setLevel(level: LogLevel) {\n this.logLevel = level;\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function getPath(path: string, pathParams: Record<string, string>): string;
@@ -0,0 +1,4 @@
1
+ export function getPath(path, pathParams) {
2
+ return Object.keys(pathParams).reduce((acc, key) => acc.replace(`{${key}}`, pathParams[key]), path);
3
+ }
4
+ //# sourceMappingURL=getPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPath.js","sourceRoot":"/","sources":["utils/getPath.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,UAAkC;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACtG,CAAC","sourcesContent":["export function getPath(path: string, pathParams: Record<string, string>) {\n return Object.keys(pathParams).reduce((acc, key) => acc.replace(`{${key}}`, pathParams[key]), path);\n}\n"]}
@@ -1,11 +1,4 @@
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]="985a57e3-68a3-52dc-9464-c6ab04aab3b5")}catch(e){}}();
3
-
4
- exports.__esModule = true;
5
- exports.getCurrentUnixTimestamp = void 0;
6
- var getCurrentUnixTimestamp = function () {
1
+ export const getCurrentUnixTimestamp = () => {
7
2
  return new Date().getTime() / 1e3;
8
3
  };
9
- exports.getCurrentUnixTimestamp = getCurrentUnixTimestamp;
10
- //# sourceMappingURL=helper.js.map
11
- //# debugId=985a57e3-68a3-52dc-9464-c6ab04aab3b5
4
+ //# sourceMappingURL=helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sources":["utils/helper.ts"],"sourceRoot":"/","sourcesContent":["export const getCurrentUnixTimestamp = () => {\n return new Date().getTime() / 1e3;\n};\n"],"names":[],"mappings":";;;;;AAAO,IAAM,uBAAuB,GAAG;IACrC,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AACpC,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC","debug_id":"985a57e3-68a3-52dc-9464-c6ab04aab3b5"}
1
+ {"version":3,"file":"helper.js","sourceRoot":"/","sources":["utils/helper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AACpC,CAAC,CAAC","sourcesContent":["export const getCurrentUnixTimestamp = () => {\n return new Date().getTime() / 1e3;\n};\n"]}
@@ -1,2 +1,2 @@
1
- import { OperatorFunction } from "rxjs";
1
+ import type { OperatorFunction } from "rxjs";
2
2
  export declare function filterNullable<T>(): OperatorFunction<T | null | undefined, T>;
@@ -1,12 +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]="95b6898a-b9b8-5e37-9ad4-08b9bcf66acc")}catch(e){}}();
3
-
4
- exports.__esModule = true;
5
- exports.filterNullable = void 0;
6
- var rxjs_1 = require("rxjs");
7
- function filterNullable() {
8
- return (0, rxjs_1.filter)(function (v) { return v != null; });
1
+ import { filter } from "rxjs";
2
+ export function filterNullable() {
3
+ // eslint-disable-next-line no-eq-null,eqeqeq
4
+ return filter((v) => v != null);
9
5
  }
10
- exports.filterNullable = filterNullable;
11
- //# sourceMappingURL=operators.js.map
12
- //# debugId=95b6898a-b9b8-5e37-9ad4-08b9bcf66acc
6
+ //# sourceMappingURL=operators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operators.js","sources":["utils/operators.ts"],"sourceRoot":"/","sourcesContent":["import { filter, OperatorFunction } from \"rxjs\";\n\nexport function filterNullable<T>(): OperatorFunction<T | null | undefined, T> {\n return filter((v): v is T => v != null);\n}\n"],"names":[],"mappings":";;;;;AAAA,6BAAgD;AAEhD,SAAgB,cAAc;IAC5B,OAAO,IAAA,aAAM,EAAC,UAAC,CAAC,IAAa,OAAA,CAAC,IAAI,IAAI,EAAT,CAAS,CAAC,CAAC;AAC1C,CAAC;AAFD,wCAEC","debug_id":"95b6898a-b9b8-5e37-9ad4-08b9bcf66acc"}
1
+ {"version":3,"file":"operators.js","sourceRoot":"/","sources":["utils/operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,MAAM,UAAU,cAAc;IAC5B,6CAA6C;IAC7C,OAAO,MAAM,CAAC,CAAC,CAAC,EAAU,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import type { OperatorFunction } from \"rxjs\";\nimport { filter } from \"rxjs\";\n\nexport function filterNullable<T>(): OperatorFunction<T | null | undefined, T> {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return filter((v): v is T => v != null);\n}\n"]}