@bytexbyte/ike-app-api 1.0.52 → 1.0.54
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/lib/App.d.ts +6 -0
- package/lib/App.js +13 -0
- package/lib/Product/index.d.ts +2 -2
- package/lib/Product/index.js +13 -7
- package/package.json +1 -1
package/lib/App.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ declare type GetMaintenanceVersionResult = {
|
|
|
8
8
|
declare type GetCheckNetwork = {
|
|
9
9
|
message: string;
|
|
10
10
|
};
|
|
11
|
+
declare type GetConfig = {
|
|
12
|
+
isRewardEnabled: boolean;
|
|
13
|
+
};
|
|
11
14
|
declare class IKEAppApi extends BxBApi {
|
|
12
15
|
constructor({ host, onSuccess, onError }: {
|
|
13
16
|
host: string;
|
|
@@ -19,5 +22,8 @@ declare class IKEAppApi extends BxBApi {
|
|
|
19
22
|
getCheckNetwork(init?: {
|
|
20
23
|
signal?: AbortSignal;
|
|
21
24
|
}): Promise<GetCheckNetwork>;
|
|
25
|
+
getConfig(init?: {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}): Promise<GetConfig>;
|
|
22
28
|
}
|
|
23
29
|
export default IKEAppApi;
|
package/lib/App.js
CHANGED
|
@@ -122,6 +122,19 @@ var IKEAppApi = /** @class */ (function (_super) {
|
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
|
+
IKEAppApi.prototype.getConfig = function (init) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
var response;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0: return [4 /*yield*/, this.bxbFetch(__assign({ method: 'GET', headers: { 'Content-Type': 'application/json' } }, init), 'get-config')];
|
|
131
|
+
case 1:
|
|
132
|
+
response = _a.sent();
|
|
133
|
+
return [2 /*return*/, response.json()];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
};
|
|
125
138
|
return IKEAppApi;
|
|
126
139
|
}(bxb_api_1.default));
|
|
127
140
|
exports.default = IKEAppApi;
|
package/lib/Product/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ declare class IKEAppProductApi extends BxBApi {
|
|
|
8
8
|
});
|
|
9
9
|
getProductByMacAddress(form: {
|
|
10
10
|
macAddress: string;
|
|
11
|
-
longitude
|
|
12
|
-
latitude
|
|
11
|
+
longitude?: number;
|
|
12
|
+
latitude?: number;
|
|
13
13
|
}): Promise<Product | {
|
|
14
14
|
error: 'Token is not exist.' | 'Digital customization is not exist.';
|
|
15
15
|
}>;
|
package/lib/Product/index.js
CHANGED
|
@@ -69,15 +69,21 @@ var IKEAppProductApi = /** @class */ (function (_super) {
|
|
|
69
69
|
}
|
|
70
70
|
IKEAppProductApi.prototype.getProductByMacAddress = function (form) {
|
|
71
71
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
var response;
|
|
72
|
+
var params, response;
|
|
73
73
|
return __generator(this, function (_a) {
|
|
74
74
|
switch (_a.label) {
|
|
75
|
-
case 0:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
case 0:
|
|
76
|
+
params = new URLSearchParams();
|
|
77
|
+
if (form.longitude)
|
|
78
|
+
params.append('longitude', form.longitude.toString());
|
|
79
|
+
if (form.latitude)
|
|
80
|
+
params.append('latitude', form.latitude.toString());
|
|
81
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
82
|
+
method: 'GET',
|
|
83
|
+
headers: {
|
|
84
|
+
'Content-Type': 'application/json',
|
|
85
|
+
},
|
|
86
|
+
}, "".concat(form.macAddress, "?").concat(params.toString()))];
|
|
81
87
|
case 1:
|
|
82
88
|
response = _a.sent();
|
|
83
89
|
return [2 /*return*/, response.json()];
|