@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.
- package/README.md +4 -4
- package/demo/craco.config.js +2 -0
- package/demo/package.json +4 -2
- package/demo/public/index.html +1 -1
- package/demo/tailwind.config.js +2 -0
- package/dist/BluxClient.d.ts +14 -13
- package/dist/BluxClient.js +180 -324
- package/dist/BluxClient.js.map +1 -1
- package/dist/apis/createEvent.d.ts +4 -0
- package/dist/apis/createEvent.js +7 -0
- package/dist/apis/createEvent.js.map +1 -0
- package/dist/apis/getItemRecommendation.d.ts +4 -0
- package/dist/apis/getItemRecommendation.js +7 -0
- package/dist/apis/getItemRecommendation.js.map +1 -0
- package/dist/apis/initialize.d.ts +4 -0
- package/dist/apis/initialize.js +7 -0
- package/dist/apis/initialize.js.map +1 -0
- package/dist/apis/signIn.d.ts +4 -0
- package/dist/apis/signIn.js +7 -0
- package/dist/apis/signIn.js.map +1 -0
- package/dist/apis/signOut.d.ts +4 -0
- package/dist/apis/signOut.js +7 -0
- package/dist/apis/signOut.js.map +1 -0
- package/dist/apis/updateCustomUserProperties.d.ts +4 -0
- package/dist/apis/updateCustomUserProperties.js +7 -0
- package/dist/apis/updateCustomUserProperties.js.map +1 -0
- package/dist/apis/updateUserProperties.d.ts +4 -0
- package/dist/apis/updateUserProperties.js +7 -0
- package/dist/apis/updateUserProperties.js.map +1 -0
- package/dist/constants/URLS.d.ts +1 -7
- package/dist/constants/URLS.js +3 -15
- package/dist/constants/URLS.js.map +1 -1
- package/dist/events/AddCartaddEvent.d.ts +2 -2
- package/dist/events/AddCartaddEvent.js +9 -40
- package/dist/events/AddCartaddEvent.js.map +1 -1
- package/dist/events/AddCustomEvent.d.ts +2 -2
- package/dist/events/AddCustomEvent.js +11 -42
- package/dist/events/AddCustomEvent.js.map +1 -1
- package/dist/events/AddLikeEvent.d.ts +2 -2
- package/dist/events/AddLikeEvent.js +9 -40
- package/dist/events/AddLikeEvent.js.map +1 -1
- package/dist/events/AddPageViewEvent.d.ts +2 -2
- package/dist/events/AddPageViewEvent.js +9 -38
- package/dist/events/AddPageViewEvent.js.map +1 -1
- package/dist/events/AddProductDetailViewEvent.d.ts +2 -2
- package/dist/events/AddProductDetailViewEvent.js +11 -41
- package/dist/events/AddProductDetailViewEvent.js.map +1 -1
- package/dist/events/AddPurchaseEvent.d.ts +2 -2
- package/dist/events/AddPurchaseEvent.js +11 -39
- package/dist/events/AddPurchaseEvent.js.map +1 -1
- package/dist/events/AddRateEvent.d.ts +2 -2
- package/dist/events/AddRateEvent.js +9 -40
- package/dist/events/AddRateEvent.js.map +1 -1
- package/dist/events/AddRecommendationViewEvent.d.ts +2 -2
- package/dist/events/AddRecommendationViewEvent.js +8 -39
- package/dist/events/AddRecommendationViewEvent.js.map +1 -1
- package/dist/events/Event.d.ts +2 -2
- package/dist/events/Event.js +11 -25
- package/dist/events/Event.js.map +1 -1
- package/dist/events/VisitEvent.d.ts +5 -0
- package/dist/events/VisitEvent.js +11 -0
- package/dist/events/VisitEvent.js.map +1 -0
- package/dist/events/index.js +9 -28
- package/dist/events/index.js.map +1 -1
- package/dist/events/types.d.ts +6 -10
- package/dist/events/types.js +2 -6
- package/dist/events/types.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -23
- package/dist/index.js.map +1 -1
- package/dist/recommendations/ItemRecommendation.d.ts +5 -0
- package/dist/recommendations/ItemRecommendation.js +12 -0
- package/dist/recommendations/ItemRecommendation.js.map +1 -0
- package/dist/recommendations/Recommendation.d.ts +5 -0
- package/dist/recommendations/Recommendation.js +9 -0
- package/dist/recommendations/Recommendation.js.map +1 -0
- package/dist/recommendations/index.d.ts +1 -0
- package/dist/recommendations/index.js +2 -0
- package/dist/recommendations/index.js.map +1 -0
- package/dist/recommendations/types.d.ts +11 -0
- package/dist/recommendations/types.js +2 -0
- package/dist/recommendations/types.js.map +1 -0
- package/dist/utils/LocalStorage.js +14 -0
- package/dist/utils/LocalStorage.js.map +1 -0
- package/dist/{core → utils}/Logger.d.ts +1 -1
- package/dist/utils/Logger.js +49 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/getPath.d.ts +1 -0
- package/dist/utils/getPath.js +4 -0
- package/dist/utils/getPath.js.map +1 -0
- package/dist/utils/helper.js +2 -9
- package/dist/utils/helper.js.map +1 -1
- package/dist/utils/operators.d.ts +1 -1
- package/dist/utils/operators.js +5 -11
- package/dist/utils/operators.js.map +1 -1
- package/package.json +7 -6
- package/.prettierrc +0 -4
- package/.sentryclirc +0 -3
- package/demo/README.md +0 -46
- package/demo/src/App.test.tsx +0 -9
- package/demo/src/App.tsx +0 -158
- package/demo/src/index.css +0 -16
- package/demo/src/index.tsx +0 -19
- package/demo/src/react-app-env.d.ts +0 -1
- package/demo/src/reportWebVitals.ts +0 -15
- package/demo/src/setupTests.ts +0 -5
- package/demo/yarn.lock +0 -10120
- package/dist/core/LocalStorage.js +0 -21
- package/dist/core/LocalStorage.js.map +0 -1
- package/dist/core/Logger.js +0 -88
- package/dist/core/Logger.js.map +0 -1
- package/dist/utils/sentry.d.ts +0 -2
- package/dist/utils/sentry.js +0 -50
- package/dist/utils/sentry.js.map +0 -1
- /package/dist/{core → utils}/LocalStorage.d.ts +0 -0
|
@@ -1,42 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
39
|
-
|
|
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"],"
|
|
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,
|
|
4
|
+
constructor({ item_id, price, event_properties }: IAddPurchaseEvent);
|
|
5
5
|
}
|
|
@@ -1,41 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
event_properties: event_properties,
|
|
34
|
-
timestamp: timestamp
|
|
35
|
-
}) || this;
|
|
9
|
+
event_properties,
|
|
10
|
+
});
|
|
36
11
|
}
|
|
37
|
-
|
|
38
|
-
|
|
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"],"
|
|
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,
|
|
4
|
+
constructor({ item_id, rating, event_properties }: IAddRateEvent);
|
|
5
5
|
}
|
|
@@ -1,43 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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"],"
|
|
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({
|
|
4
|
+
constructor({ event_properties }: IAddRecommendationViewEvent);
|
|
5
5
|
}
|
|
@@ -1,41 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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"],"
|
|
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"]}
|
package/dist/events/Event.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/events/Event.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
exports.Event = Event;
|
|
25
|
-
//# sourceMappingURL=Event.js.map
|
|
26
|
-
//# debugId=f1f7685c-909d-5d4a-bf30-037dda253e70
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Event.js.map
|
package/dist/events/Event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Event.js","sources":["events/Event.ts"],"
|
|
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,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"]}
|
package/dist/events/index.js
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
package/dist/events/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["events/index.ts"],"
|
|
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"]}
|
package/dist/events/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
7
|
+
captured_at: string;
|
|
12
8
|
}
|
|
13
|
-
type BaseEvent = Omit<EventRequest, "event_type" | "event_value" | "id" | "
|
|
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
|
|
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
|
|
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 {};
|
package/dist/events/types.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
//# sourceMappingURL=types.js.map
|
|
6
|
-
//# debugId=8aa0a98c-918e-57f5-a870-7d244f4c8131
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
package/dist/events/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["events/types.ts"],"
|
|
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
package/dist/index.js
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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"],"
|
|
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,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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 {
|