@blux.ai/web-sdk 0.0.6 → 1.0.0-rc0

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 (96) hide show
  1. package/README.md +19 -19
  2. package/dist/package.json +35 -0
  3. package/package.json +5 -3
  4. package/dist/BluxClient.d.ts +0 -43
  5. package/dist/BluxClient.js +0 -190
  6. package/dist/BluxClient.js.map +0 -1
  7. package/dist/apis/createEvent.d.ts +0 -4
  8. package/dist/apis/createEvent.js +0 -7
  9. package/dist/apis/createEvent.js.map +0 -1
  10. package/dist/apis/getItemRecommendation.d.ts +0 -4
  11. package/dist/apis/getItemRecommendation.js +0 -7
  12. package/dist/apis/getItemRecommendation.js.map +0 -1
  13. package/dist/apis/initialize.d.ts +0 -4
  14. package/dist/apis/initialize.js +0 -7
  15. package/dist/apis/initialize.js.map +0 -1
  16. package/dist/apis/signIn.d.ts +0 -4
  17. package/dist/apis/signIn.js +0 -7
  18. package/dist/apis/signIn.js.map +0 -1
  19. package/dist/apis/signOut.d.ts +0 -4
  20. package/dist/apis/signOut.js +0 -7
  21. package/dist/apis/signOut.js.map +0 -1
  22. package/dist/apis/updateCustomUserProperties.d.ts +0 -4
  23. package/dist/apis/updateCustomUserProperties.js +0 -7
  24. package/dist/apis/updateCustomUserProperties.js.map +0 -1
  25. package/dist/apis/updateUserProperties.d.ts +0 -4
  26. package/dist/apis/updateUserProperties.js +0 -7
  27. package/dist/apis/updateUserProperties.js.map +0 -1
  28. package/dist/constants/URLS.d.ts +0 -6
  29. package/dist/constants/URLS.js +0 -7
  30. package/dist/constants/URLS.js.map +0 -1
  31. package/dist/events/AddCartaddEvent.d.ts +0 -5
  32. package/dist/events/AddCartaddEvent.js +0 -11
  33. package/dist/events/AddCartaddEvent.js.map +0 -1
  34. package/dist/events/AddCustomEvent.d.ts +0 -5
  35. package/dist/events/AddCustomEvent.js +0 -12
  36. package/dist/events/AddCustomEvent.js.map +0 -1
  37. package/dist/events/AddLikeEvent.d.ts +0 -5
  38. package/dist/events/AddLikeEvent.js +0 -11
  39. package/dist/events/AddLikeEvent.js.map +0 -1
  40. package/dist/events/AddPageViewEvent.d.ts +0 -5
  41. package/dist/events/AddPageViewEvent.js +0 -11
  42. package/dist/events/AddPageViewEvent.js.map +0 -1
  43. package/dist/events/AddProductDetailViewEvent.d.ts +0 -5
  44. package/dist/events/AddProductDetailViewEvent.js +0 -12
  45. package/dist/events/AddProductDetailViewEvent.js.map +0 -1
  46. package/dist/events/AddPurchaseEvent.d.ts +0 -5
  47. package/dist/events/AddPurchaseEvent.js +0 -13
  48. package/dist/events/AddPurchaseEvent.js.map +0 -1
  49. package/dist/events/AddRateEvent.d.ts +0 -5
  50. package/dist/events/AddRateEvent.js +0 -12
  51. package/dist/events/AddRateEvent.js.map +0 -1
  52. package/dist/events/AddRecommendationViewEvent.d.ts +0 -5
  53. package/dist/events/AddRecommendationViewEvent.js +0 -10
  54. package/dist/events/AddRecommendationViewEvent.js.map +0 -1
  55. package/dist/events/Event.d.ts +0 -5
  56. package/dist/events/Event.js +0 -12
  57. package/dist/events/Event.js.map +0 -1
  58. package/dist/events/VisitEvent.d.ts +0 -5
  59. package/dist/events/VisitEvent.js +0 -11
  60. package/dist/events/VisitEvent.js.map +0 -1
  61. package/dist/events/index.d.ts +0 -8
  62. package/dist/events/index.js +0 -9
  63. package/dist/events/index.js.map +0 -1
  64. package/dist/events/types.d.ts +0 -38
  65. package/dist/events/types.js +0 -2
  66. package/dist/events/types.js.map +0 -1
  67. package/dist/index.d.ts +0 -5
  68. package/dist/index.js +0 -6
  69. package/dist/index.js.map +0 -1
  70. package/dist/recommendations/ItemRecommendation.d.ts +0 -5
  71. package/dist/recommendations/ItemRecommendation.js +0 -12
  72. package/dist/recommendations/ItemRecommendation.js.map +0 -1
  73. package/dist/recommendations/Recommendation.d.ts +0 -5
  74. package/dist/recommendations/Recommendation.js +0 -9
  75. package/dist/recommendations/Recommendation.js.map +0 -1
  76. package/dist/recommendations/index.d.ts +0 -1
  77. package/dist/recommendations/index.js +0 -2
  78. package/dist/recommendations/index.js.map +0 -1
  79. package/dist/recommendations/types.d.ts +0 -11
  80. package/dist/recommendations/types.js +0 -2
  81. package/dist/recommendations/types.js.map +0 -1
  82. package/dist/utils/LocalStorage.d.ts +0 -4
  83. package/dist/utils/LocalStorage.js +0 -14
  84. package/dist/utils/LocalStorage.js.map +0 -1
  85. package/dist/utils/Logger.d.ts +0 -13
  86. package/dist/utils/Logger.js +0 -49
  87. package/dist/utils/Logger.js.map +0 -1
  88. package/dist/utils/getPath.d.ts +0 -1
  89. package/dist/utils/getPath.js +0 -4
  90. package/dist/utils/getPath.js.map +0 -1
  91. package/dist/utils/helper.d.ts +0 -1
  92. package/dist/utils/helper.js +0 -4
  93. package/dist/utils/helper.js.map +0 -1
  94. package/dist/utils/operators.d.ts +0 -2
  95. package/dist/utils/operators.js +0 -6
  96. package/dist/utils/operators.js.map +0 -1
@@ -1,5 +0,0 @@
1
- import type { IAddCustomEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddCustomEvent extends Event {
4
- constructor({ event_type, event_value, item_id, event_properties, }: IAddCustomEvent);
5
- }
@@ -1,12 +0,0 @@
1
- import { Event } from "./Event";
2
- export class AddCustomEvent extends Event {
3
- constructor({ event_type, event_value, item_id, event_properties, }) {
4
- super({
5
- event_type,
6
- event_value,
7
- item_id,
8
- event_properties,
9
- });
10
- }
11
- }
12
- //# sourceMappingURL=AddCustomEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddCustomEvent.js","sourceRoot":"/","sources":["events/AddCustomEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,EACV,UAAU,EACV,WAAW,EACX,OAAO,EACP,gBAAgB,GACA;QAChB,KAAK,CAAC;YACJ,UAAU;YACV,WAAW;YACX,OAAO;YACP,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddCustomEvent } from \"./types\";\nimport { Event } from \"./Event\";\n\nexport class AddCustomEvent extends Event {\n constructor({\n event_type,\n event_value,\n item_id,\n event_properties,\n }: IAddCustomEvent) {\n super({\n event_type,\n event_value,\n item_id,\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- import type { IAddLikeEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddLikeEvent extends Event {
4
- constructor({ item_id, event_properties }: IAddLikeEvent);
5
- }
@@ -1,11 +0,0 @@
1
- import { Event } from "./Event";
2
- export class AddLikeEvent extends Event {
3
- constructor({ item_id, event_properties }) {
4
- super({
5
- event_type: "like",
6
- item_id,
7
- event_properties,
8
- });
9
- }
10
- }
11
- //# sourceMappingURL=AddLikeEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddLikeEvent.js","sourceRoot":"/","sources":["events/AddLikeEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAiB;QACtD,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM;YAClB,OAAO;YACP,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddLikeEvent } from \"./types\";\nimport { Event } from \"./Event\";\n\nexport class AddLikeEvent extends Event {\n constructor({ item_id, event_properties }: IAddLikeEvent) {\n super({\n event_type: \"like\",\n item_id,\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- import type { IAddPageViewEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddPageViewEvent extends Event {
4
- constructor({ pageType, event_properties }: IAddPageViewEvent);
5
- }
@@ -1,11 +0,0 @@
1
- import { Event } from "./Event";
2
- export class AddPageViewEvent extends Event {
3
- constructor({ pageType, event_properties }) {
4
- super({
5
- event_type: "page_view",
6
- event_value: pageType,
7
- event_properties,
8
- });
9
- }
10
- }
11
- //# sourceMappingURL=AddPageViewEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddPageViewEvent.js","sourceRoot":"/","sources":["events/AddPageViewEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAqB;QAC3D,KAAK,CAAC;YACJ,UAAU,EAAE,WAAW;YACvB,WAAW,EAAE,QAAQ;YACrB,gBAAgB;SACjB,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { IAddPageViewEvent } from \"./types\";\nimport { Event } from \"./Event\";\n\nexport class AddPageViewEvent extends Event {\n constructor({ pageType, event_properties }: IAddPageViewEvent) {\n super({\n event_type: \"page_view\",\n event_value: pageType,\n event_properties,\n });\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- import type { IAddProductDetailViewEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddProductDetailViewEvent extends Event {
4
- constructor({ item_id, event_properties }: IAddProductDetailViewEvent);
5
- }
@@ -1,12 +0,0 @@
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
- });
10
- }
11
- }
12
- //# sourceMappingURL=AddProductDetailViewEvent.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import type { IAddPurchaseEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddPurchaseEvent extends Event {
4
- constructor({ item_id, price, event_properties }: IAddPurchaseEvent);
5
- }
@@ -1,13 +0,0 @@
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,
8
- event_value: price.toString(),
9
- event_properties,
10
- });
11
- }
12
- }
13
- //# sourceMappingURL=AddPurchaseEvent.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import type { IAddRateEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddRateEvent extends Event {
4
- constructor({ item_id, rating, event_properties }: IAddRateEvent);
5
- }
@@ -1,12 +0,0 @@
1
- import { Event } from "./Event";
2
- export class AddRateEvent extends Event {
3
- constructor({ item_id, rating, event_properties }) {
4
- super({
5
- event_type: "rate",
6
- event_value: rating.toString(),
7
- item_id,
8
- event_properties,
9
- });
10
- }
11
- }
12
- //# sourceMappingURL=AddRateEvent.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import type { IAddRecommendationViewEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class AddRecommendationViewEvent extends Event {
4
- constructor({ event_properties }: IAddRecommendationViewEvent);
5
- }
@@ -1,10 +0,0 @@
1
- import { Event } from "./Event";
2
- export class AddRecommendationViewEvent extends Event {
3
- constructor({ event_properties }) {
4
- super({
5
- event_type: "recommendation_view",
6
- event_properties,
7
- });
8
- }
9
- }
10
- //# sourceMappingURL=AddRecommendationViewEvent.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import type { EventRequest } from "./types";
2
- export declare abstract class Event {
3
- readonly request: EventRequest;
4
- constructor(data: Omit<EventRequest, "id" | "captured_at">);
5
- }
@@ -1,12 +0,0 @@
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
- };
10
- }
11
- }
12
- //# sourceMappingURL=Event.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,5 +0,0 @@
1
- import type { IVisitEvent } from "./types";
2
- import { Event } from "./Event";
3
- export declare class VisitEvent extends Event {
4
- constructor({ event_properties }: IVisitEvent);
5
- }
@@ -1,11 +0,0 @@
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
@@ -1 +0,0 @@
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,8 +0,0 @@
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";
@@ -1,9 +0,0 @@
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 +0,0 @@
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"]}
@@ -1,38 +0,0 @@
1
- export interface EventRequest {
2
- id: string;
3
- event_type: string;
4
- event_value?: string;
5
- item_id?: string;
6
- event_properties?: Record<string, any>;
7
- captured_at: string;
8
- }
9
- type BaseEvent = Omit<EventRequest, "event_type" | "event_value" | "id" | "captured_at">;
10
- export interface IAddProductDetailViewEvent extends BaseEvent {
11
- item_id: string;
12
- }
13
- export interface IAddLikeEvent extends BaseEvent {
14
- item_id: string;
15
- }
16
- export interface IAddCartaddEvent extends BaseEvent {
17
- item_id: string;
18
- }
19
- export interface IAddRateEvent extends BaseEvent {
20
- item_id: string;
21
- rating: number;
22
- }
23
- export interface IAddPurchaseEvent extends BaseEvent {
24
- item_id: string;
25
- price: number;
26
- }
27
- export interface IAddCustomEvent extends BaseEvent {
28
- event_type: string;
29
- event_value?: string;
30
- }
31
- export interface IAddRecommendationViewEvent extends Omit<BaseEvent, "item_id"> {
32
- }
33
- export interface IVisitEvent extends Omit<BaseEvent, "item_id"> {
34
- }
35
- export interface IAddPageViewEvent extends Omit<BaseEvent, "item_id"> {
36
- pageType: string;
37
- }
38
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
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 DELETED
@@ -1,5 +0,0 @@
1
- import { bluxClient, BluxClient } from "./BluxClient";
2
- export * from "./events";
3
- export * from "./recommendations";
4
- export { BluxClient };
5
- export default bluxClient;
package/dist/index.js DELETED
@@ -1,6 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
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"]}
@@ -1,5 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,5 +0,0 @@
1
- import type { RecommendationRequest } from "./types";
2
- export declare abstract class Recommendation {
3
- readonly request: RecommendationRequest;
4
- constructor(data: RecommendationRequest);
5
- }
@@ -1,9 +0,0 @@
1
- export class Recommendation {
2
- request;
3
- constructor(data) {
4
- this.request = {
5
- ...data,
6
- };
7
- }
8
- }
9
- //# sourceMappingURL=Recommendation.js.map
@@ -1 +0,0 @@
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"]}
@@ -1 +0,0 @@
1
- export * from "./ItemRecommendation";
@@ -1,2 +0,0 @@
1
- export * from "./ItemRecommendation";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["recommendations/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC","sourcesContent":["export * from \"./ItemRecommendation\";\n"]}
@@ -1,11 +0,0 @@
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 {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,4 +0,0 @@
1
- export declare class LocalStorage {
2
- static getDeviceId(): string | null;
3
- static setDeviceId(deviceId: string): void;
4
- }
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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,13 +0,0 @@
1
- import type { ScopeContext } from "@sentry/types";
2
- export type LogLevel = "debug" | "log" | "warning" | "error" | "fatal";
3
- export type Context = Partial<Pick<ScopeContext, "tags" | "extra">>;
4
- export declare class Logger {
5
- static logLevel: LogLevel;
6
- private static base;
7
- static debug(message: string | Error, context?: Context): void;
8
- static log(message: string | Error, context?: Context): void;
9
- static warning(message: string | Error, context?: Context): void;
10
- static error(message: string | Error, context?: Context): void;
11
- static fatal(message: string | Error, context?: Context): void;
12
- static setLevel(level: LogLevel): void;
13
- }
@@ -1,49 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1 +0,0 @@
1
- export declare function getPath(path: string, pathParams: Record<string, string>): string;
@@ -1,4 +0,0 @@
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
@@ -1 +0,0 @@
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 +0,0 @@
1
- export declare const getCurrentUnixTimestamp: () => number;
@@ -1,4 +0,0 @@
1
- export const getCurrentUnixTimestamp = () => {
2
- return new Date().getTime() / 1e3;
3
- };
4
- //# sourceMappingURL=helper.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- import type { OperatorFunction } from "rxjs";
2
- export declare function filterNullable<T>(): OperatorFunction<T | null | undefined, T>;
@@ -1,6 +0,0 @@
1
- import { filter } from "rxjs";
2
- export function filterNullable() {
3
- // eslint-disable-next-line no-eq-null,eqeqeq
4
- return filter((v) => v != null);
5
- }
6
- //# sourceMappingURL=operators.js.map
@@ -1 +0,0 @@
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"]}