@blux.ai/web-sdk 0.0.3
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/.prettierrc +5 -0
- package/.vscode/settings.json +7 -0
- package/LICENSE +1 -0
- package/README.md +21 -0
- package/dist/BluxClient.d.ts +17 -0
- package/dist/BluxClient.js +104 -0
- package/dist/core/BaseErrorHandler.d.ts +3 -0
- package/dist/core/BaseErrorHandler.js +13 -0
- package/dist/core/HTTPClient.d.ts +10 -0
- package/dist/core/HTTPClient.js +122 -0
- package/dist/core/LocalStorage.d.ts +13 -0
- package/dist/core/LocalStorage.js +43 -0
- package/dist/core/Logger.d.ts +14 -0
- package/dist/core/Logger.js +90 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +18 -0
- package/dist/requests/Devices/ActivateDevice.d.ts +8 -0
- package/dist/requests/Devices/ActivateDevice.js +39 -0
- package/dist/requests/Devices/CreateDevice.d.ts +14 -0
- package/dist/requests/Devices/CreateDevice.js +54 -0
- package/dist/requests/Devices/UpdateDevice.d.ts +17 -0
- package/dist/requests/Devices/UpdateDevice.js +61 -0
- package/dist/requests/Devices/index.d.ts +3 -0
- package/dist/requests/Devices/index.js +19 -0
- package/dist/requests/Events/AddCartaddEvent.d.ts +5 -0
- package/dist/requests/Events/AddCartaddEvent.js +39 -0
- package/dist/requests/Events/AddCustomEvent.d.ts +5 -0
- package/dist/requests/Events/AddCustomEvent.js +40 -0
- package/dist/requests/Events/AddLikeEvent.d.ts +5 -0
- package/dist/requests/Events/AddLikeEvent.js +39 -0
- package/dist/requests/Events/AddPageViewEvent.d.ts +5 -0
- package/dist/requests/Events/AddPageViewEvent.js +37 -0
- package/dist/requests/Events/AddProductDetailViewEvent.d.ts +5 -0
- package/dist/requests/Events/AddProductDetailViewEvent.js +39 -0
- package/dist/requests/Events/AddPurchaseEvent.d.ts +5 -0
- package/dist/requests/Events/AddPurchaseEvent.js +38 -0
- package/dist/requests/Events/AddRateEvent.d.ts +5 -0
- package/dist/requests/Events/AddRateEvent.js +40 -0
- package/dist/requests/Events/AddRecommendationViewEvent.d.ts +5 -0
- package/dist/requests/Events/AddRecommendationViewEvent.js +38 -0
- package/dist/requests/Events/EventRequest.d.ts +17 -0
- package/dist/requests/Events/EventRequest.js +56 -0
- package/dist/requests/Events/index.d.ts +8 -0
- package/dist/requests/Events/index.js +24 -0
- package/dist/requests/Events/types.d.ts +42 -0
- package/dist/requests/Events/types.js +2 -0
- package/dist/requests/Request.d.ts +12 -0
- package/dist/requests/Request.js +22 -0
- package/dist/requests/Users/UpdateUserProperties.d.ts +17 -0
- package/dist/requests/Users/UpdateUserProperties.js +54 -0
- package/dist/requests/Users/index.d.ts +1 -0
- package/dist/requests/Users/index.js +17 -0
- package/dist/requests/Users/types.d.ts +12 -0
- package/dist/requests/Users/types.js +2 -0
- package/dist/requests/index.d.ts +3 -0
- package/dist/requests/index.js +19 -0
- package/dist/utils/helper.d.ts +1 -0
- package/dist/utils/helper.js +7 -0
- package/dist/utils/types.d.ts +2 -0
- package/dist/utils/types.js +11 -0
- package/package.json +20 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Request } from "../Request";
|
|
2
|
+
import { IUpdateUserProperties } from "./types";
|
|
3
|
+
export declare class UpdateUserProperties extends Request {
|
|
4
|
+
protected firstName?: string;
|
|
5
|
+
protected lastName?: string;
|
|
6
|
+
protected phoneNumber?: string;
|
|
7
|
+
protected emailAddress?: string;
|
|
8
|
+
protected nickname?: string;
|
|
9
|
+
protected marketingNotificationConsent?: boolean;
|
|
10
|
+
protected nighttimeNotificationConsent?: boolean;
|
|
11
|
+
protected pushNotificationConsent?: boolean;
|
|
12
|
+
protected emailConsent?: boolean;
|
|
13
|
+
protected smsConsent?: boolean;
|
|
14
|
+
constructor({ firstName, lastName, phoneNumber, emailAddress, nickname, marketingNotificationConsent, nighttimeNotificationConsent, pushNotificationConsent, emailConsent, smsConsent, }: IUpdateUserProperties);
|
|
15
|
+
getPayload(): object;
|
|
16
|
+
}
|
|
17
|
+
export default UpdateUserProperties;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
exports.__esModule = true;
|
|
18
|
+
exports.UpdateUserProperties = void 0;
|
|
19
|
+
var Request_1 = require("../Request");
|
|
20
|
+
var UpdateUserProperties = /** @class */ (function (_super) {
|
|
21
|
+
__extends(UpdateUserProperties, _super);
|
|
22
|
+
function UpdateUserProperties(_a) {
|
|
23
|
+
var firstName = _a.firstName, lastName = _a.lastName, phoneNumber = _a.phoneNumber, emailAddress = _a.emailAddress, nickname = _a.nickname, marketingNotificationConsent = _a.marketingNotificationConsent, nighttimeNotificationConsent = _a.nighttimeNotificationConsent, pushNotificationConsent = _a.pushNotificationConsent, emailConsent = _a.emailConsent, smsConsent = _a.smsConsent;
|
|
24
|
+
var _this = _super.call(this, "PATCH", "/users") || this;
|
|
25
|
+
_this.firstName = firstName;
|
|
26
|
+
_this.lastName = lastName;
|
|
27
|
+
_this.phoneNumber = phoneNumber;
|
|
28
|
+
_this.emailAddress = emailAddress;
|
|
29
|
+
_this.nickname = nickname;
|
|
30
|
+
_this.marketingNotificationConsent = marketingNotificationConsent;
|
|
31
|
+
_this.nighttimeNotificationConsent = nighttimeNotificationConsent;
|
|
32
|
+
_this.pushNotificationConsent = pushNotificationConsent;
|
|
33
|
+
_this.emailConsent = emailConsent;
|
|
34
|
+
_this.smsConsent = smsConsent;
|
|
35
|
+
return _this;
|
|
36
|
+
}
|
|
37
|
+
UpdateUserProperties.prototype.getPayload = function () {
|
|
38
|
+
return {
|
|
39
|
+
first_name: this.firstName,
|
|
40
|
+
last_name: this.lastName,
|
|
41
|
+
phone_number: this.phoneNumber,
|
|
42
|
+
email_address: this.emailAddress,
|
|
43
|
+
nickname: this.nickname,
|
|
44
|
+
marketing_notification_consent: this.marketingNotificationConsent,
|
|
45
|
+
nighttime_notification_consent: this.nighttimeNotificationConsent,
|
|
46
|
+
push_notification_consent: this.pushNotificationConsent,
|
|
47
|
+
email_consent: this.emailConsent,
|
|
48
|
+
sms_consent: this.smsConsent
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return UpdateUserProperties;
|
|
52
|
+
}(Request_1.Request));
|
|
53
|
+
exports.UpdateUserProperties = UpdateUserProperties;
|
|
54
|
+
exports["default"] = UpdateUserProperties;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./UpdateUserProperties";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
__exportStar(require("./UpdateUserProperties"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface IUpdateUserProperties {
|
|
2
|
+
firstName?: string;
|
|
3
|
+
lastName?: string;
|
|
4
|
+
phoneNumber?: string;
|
|
5
|
+
emailAddress?: string;
|
|
6
|
+
nickname?: string;
|
|
7
|
+
marketingNotificationConsent?: boolean;
|
|
8
|
+
nighttimeNotificationConsent?: boolean;
|
|
9
|
+
pushNotificationConsent?: boolean;
|
|
10
|
+
emailConsent?: boolean;
|
|
11
|
+
smsConsent?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
__exportStar(require("./Devices"), exports);
|
|
18
|
+
__exportStar(require("./Users"), exports);
|
|
19
|
+
__exportStar(require("./Events"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCurrentUnixTimestamp: () => number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.isEmptyString = exports.isNullOrUndefined = void 0;
|
|
4
|
+
var isNullOrUndefined = function (input) {
|
|
5
|
+
return input == null;
|
|
6
|
+
};
|
|
7
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
8
|
+
var isEmptyString = function (input) {
|
|
9
|
+
return input.length == 0;
|
|
10
|
+
};
|
|
11
|
+
exports.isEmptyString = isEmptyString;
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blux.ai/web-sdk",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "The official Blux JavaScript browser client library",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"license": "UNLICENSED",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "jest",
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "yarn build -w",
|
|
13
|
+
"prepack": "rm -rf dist && yarn build"
|
|
14
|
+
},
|
|
15
|
+
"author": "Z.Ai Inc.",
|
|
16
|
+
"homepage": "https://www.blux.ai/",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^4.6.3"
|
|
19
|
+
}
|
|
20
|
+
}
|