@bytexbyte/ike-app-api 1.0.82 → 1.0.83
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 +4 -4
- package/lib/App.js +3 -3
- package/lib/Auth/index.d.ts +2 -2
- package/lib/Auth/index.js +3 -3
- package/lib/Auth/type.d.ts +11 -11
- package/lib/Batch/index.d.ts +4 -4
- package/lib/Batch/index.js +3 -3
- package/lib/BleConnectionErrorLog/index.d.ts +2 -2
- package/lib/BleConnectionErrorLog/index.js +3 -3
- package/lib/Contract/index.js +3 -3
- package/lib/DigitalCustomization/index.d.ts +3 -3
- package/lib/DigitalCustomization/index.js +3 -3
- package/lib/File/UploadFileType.js +1 -1
- package/lib/File/index.d.ts +4 -4
- package/lib/File/index.js +8 -8
- package/lib/InAppNotification/index.js +3 -3
- package/lib/InAppNotification/type.d.ts +7 -7
- package/lib/Incode/index.js +15 -15
- package/lib/Incode/type.d.ts +2 -2
- package/lib/Mfa/index.d.ts +6 -6
- package/lib/Mfa/index.js +3 -3
- package/lib/Product/index.js +3 -3
- package/lib/Product/type.d.ts +6 -1
- package/lib/Redeem/index.d.ts +3 -3
- package/lib/Redeem/index.js +3 -3
- package/lib/RegisterDeviceCode/index.d.ts +2 -2
- package/lib/RegisterDeviceCode/index.js +3 -3
- package/lib/Rsa/index.js +3 -3
- package/lib/Scan/index.d.ts +4 -4
- package/lib/Scan/index.js +3 -3
- package/lib/Tags/index.d.ts +14 -14
- package/lib/Tags/index.js +3 -3
- package/lib/TouHistory/index.js +3 -3
- package/lib/User/index.d.ts +24 -18
- package/lib/User/index.js +53 -3
- package/lib/index.js +3 -3
- package/lib/types.d.ts +53 -53
- package/package.json +2 -2
package/lib/Redeem/index.js
CHANGED
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
|
-
|
|
2
|
+
type RegisterBody = {
|
|
3
3
|
token: string;
|
|
4
4
|
device: string;
|
|
5
5
|
deviceOsType: 'ios' | 'android' | 'windows' | 'macos' | 'web';
|
|
6
6
|
deviceId?: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type RegisterResult = {
|
|
9
9
|
error?: 'You are not logged in.' | 'Invalid request';
|
|
10
10
|
};
|
|
11
11
|
declare class IKEAppRegisterDeviceCodeApi extends BxBApi {
|
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
package/lib/Rsa/index.js
CHANGED
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
package/lib/Scan/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
2
|
import { Scan } from '../types';
|
|
3
|
-
|
|
3
|
+
type ScanBody = Pick<Scan, 'isAppClip' | 'latitude' | 'longitude' | 'tagTokenId' | 'deviceId' | 'tail'> & {
|
|
4
4
|
uid: string;
|
|
5
5
|
deviceOsType: 'ios' | 'android' | 'windows' | 'macos' | 'web';
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type UpdateBody = {
|
|
8
8
|
isVisitedPromo: Pick<Scan, 'isVisitedPromo'>['isVisitedPromo'];
|
|
9
9
|
isVisitedShop?: undefined;
|
|
10
10
|
isVisitedExplore?: undefined;
|
|
@@ -17,12 +17,12 @@ declare type UpdateBody = {
|
|
|
17
17
|
isVisitedShop?: undefined;
|
|
18
18
|
isVisitedExplore: Pick<Scan, 'isVisitedExplore'>['isVisitedExplore'];
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type ScanResult = {
|
|
21
21
|
scan: Scan;
|
|
22
22
|
} | {
|
|
23
23
|
error: 'Token is not exist.' | 'tokenId and UID do not match.' | 'This device is deactivated.' | 'Server timeout.' | 'The device does not support' | 'This is a IKE tag, You are not authorized to call this API.';
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
type UpdateResult = {
|
|
26
26
|
error?: 'scanId type error.' | 'scanId not found.' | 'This is a IKE tag, You are not authorized to call this API.' | 'Scan not found.';
|
|
27
27
|
};
|
|
28
28
|
declare class IKEAppScanApi extends BxBApi {
|
package/lib/Scan/index.js
CHANGED
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
package/lib/Tags/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
2
|
import { ikeApi } from '../config';
|
|
3
3
|
import { BlockChainStatusType } from '../types';
|
|
4
|
-
|
|
4
|
+
type GetResult = {
|
|
5
5
|
tokenId: string;
|
|
6
6
|
batchId: string;
|
|
7
7
|
batchSerialNumber: number;
|
|
@@ -11,48 +11,48 @@ declare type GetResult = {
|
|
|
11
11
|
}[];
|
|
12
12
|
};
|
|
13
13
|
} | null;
|
|
14
|
-
|
|
14
|
+
type GetManyQuery = {
|
|
15
15
|
batchId: string;
|
|
16
16
|
batchSerialNumberGte?: string;
|
|
17
17
|
batchSerialNumberLte?: string;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type GetManyResult = {
|
|
20
20
|
tokenId: string;
|
|
21
21
|
batchSerialNumber: number;
|
|
22
22
|
}[];
|
|
23
|
-
|
|
23
|
+
type PostBody = {
|
|
24
24
|
ownerId: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
type PostResult = {
|
|
27
27
|
tagTokenId: string;
|
|
28
28
|
error?: undefined;
|
|
29
29
|
} | {
|
|
30
30
|
tagTokenId?: undefined;
|
|
31
31
|
error: 'this is not your account.' | 'create error.' | 'this is not your tag.' | 'undo expired.' | 'delete error.';
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
type PutBody = Parameters<typeof ikeApi.tags.updateMany>[0];
|
|
34
|
+
type PutResult = Awaited<ReturnType<typeof ikeApi.tags.updateMany>>;
|
|
35
|
+
type TransferBody = {
|
|
36
36
|
ownerId: string;
|
|
37
37
|
transferId: string;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
type UndoTransferBody = {
|
|
40
40
|
ownerId: string;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type PutInfoVisible = {
|
|
43
43
|
ownerId: string;
|
|
44
44
|
isInfoVisible: boolean;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
type PutInfoVisibleResult = {
|
|
47
47
|
error?: 'this is not your account.' | 'this is not your tag.' | 'update error.';
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
type PutUpdateDisplayName = {
|
|
50
50
|
displayName: string;
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
type PutUpdateDisplayNameResult = {
|
|
53
53
|
error?: 'update error.';
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
type TagCheckListStatus = 'pass' | 'fail' | 'none';
|
|
56
56
|
declare class IKEAppTagsApi extends BxBApi {
|
|
57
57
|
constructor({ host, credentials, onSuccess, onError, }: {
|
|
58
58
|
host: string;
|
package/lib/Tags/index.js
CHANGED
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
package/lib/TouHistory/index.js
CHANGED
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
package/lib/User/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BxBApi from '@bytexbyte/bxb-api';
|
|
2
2
|
import { User, UserLog, UserLogAction, Wallet } from '../types';
|
|
3
|
-
|
|
3
|
+
type GetResult = {
|
|
4
4
|
user: {
|
|
5
5
|
email: string | null;
|
|
6
6
|
phone: string | null;
|
|
@@ -12,21 +12,21 @@ declare type GetResult = {
|
|
|
12
12
|
user?: undefined;
|
|
13
13
|
error: 'Authentication type error.' | 'Incorrect userID.' | 'User not found.' | 'You are not authorized to call this API.';
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
type UpdateBody = Pick<User, 'image' | 'firstName' | 'lastName'>;
|
|
16
|
+
type UpdateResult = Pick<User, 'id' | 'email' | 'phone' | 'image' | 'firstName' | 'lastName'> | {
|
|
17
17
|
error?: 'Authentication type error.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'You are not authorized to call this API.';
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type DeleteResult = User | {
|
|
20
20
|
error?: 'Authentication type error.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'User not found.' | 'You are not authorized to call this API.';
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
type GetWalletResult = {
|
|
23
23
|
address: Pick<Wallet, 'address'>['address'];
|
|
24
24
|
error?: undefined;
|
|
25
25
|
} | {
|
|
26
26
|
address?: undefined;
|
|
27
27
|
error: 'Incorrect userID.' | 'You are not logged in.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Invalid id.';
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
type GetUserIdByEmailResult = {
|
|
30
30
|
user: {
|
|
31
31
|
id: string;
|
|
32
32
|
};
|
|
@@ -35,18 +35,18 @@ declare type GetUserIdByEmailResult = {
|
|
|
35
35
|
user?: undefined;
|
|
36
36
|
error: 'Invalid email.' | 'You are not logged in.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'Missing userId.';
|
|
37
37
|
};
|
|
38
|
-
|
|
38
|
+
type PostWalletBody = {
|
|
39
39
|
address: string;
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
type PostWalletResult = {
|
|
42
42
|
userId: string;
|
|
43
43
|
address: string;
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
type LogoutResult = {
|
|
46
46
|
success?: boolean;
|
|
47
47
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'Missing userId.';
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
type GetScanHistoryResult = {
|
|
50
50
|
scanList: {
|
|
51
51
|
id: number;
|
|
52
52
|
tagTokenId: string;
|
|
@@ -75,25 +75,29 @@ declare type GetScanHistoryResult = {
|
|
|
75
75
|
} | {
|
|
76
76
|
error: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot get data of this user.' | 'Missing userId.';
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
type RemoveScanHistoryResult = {
|
|
79
79
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect tagUid.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing scanHistoryId.' | 'Missing tagUid.';
|
|
80
80
|
};
|
|
81
|
-
|
|
81
|
+
type RemoveAllScanHistoryResult = {
|
|
82
82
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'Missing userId.';
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
type SaveProductResult = {
|
|
85
85
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect batchId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing batchId.';
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
/** POST/DELETE `/api/user/:userId/portfolio/:tagTokenId` — one tag per owner (see `portfolio` table). */
|
|
88
|
+
type PortfolioDeviceResult = {
|
|
89
|
+
error?: string;
|
|
90
|
+
};
|
|
91
|
+
type RemoveProductResult = {
|
|
88
92
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.';
|
|
89
93
|
};
|
|
90
|
-
|
|
94
|
+
type CreateNotificationResult = {
|
|
91
95
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.' | 'Missing digitalCustomization.';
|
|
92
96
|
};
|
|
93
|
-
|
|
97
|
+
type RemoveNotificationResult = {
|
|
94
98
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.';
|
|
95
99
|
};
|
|
96
|
-
|
|
100
|
+
type UpdateNotificationResult = {
|
|
97
101
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.';
|
|
98
102
|
};
|
|
99
103
|
declare enum RuleType {
|
|
@@ -102,7 +106,7 @@ declare enum RuleType {
|
|
|
102
106
|
redeemNFT = "redeemNFT",
|
|
103
107
|
redeemGoldenTicket = "redeemGoldenTicket"
|
|
104
108
|
}
|
|
105
|
-
|
|
109
|
+
type GetConnectDeviceAtResult = {
|
|
106
110
|
connectDeviceAt: Date;
|
|
107
111
|
error?: undefined;
|
|
108
112
|
} | {
|
|
@@ -127,6 +131,8 @@ declare class IKEAppUserApi extends BxBApi {
|
|
|
127
131
|
removeAllScanHistory(userId: string): Promise<RemoveAllScanHistoryResult>;
|
|
128
132
|
saveProduct(userId: string, batchId: string): Promise<SaveProductResult>;
|
|
129
133
|
removeProduct(userId: string, batchId: string): Promise<RemoveProductResult>;
|
|
134
|
+
claimPortfolio(userId: string, tagTokenId: string): Promise<PortfolioDeviceResult>;
|
|
135
|
+
releasePortfolio(userId: string, tagTokenId: string): Promise<PortfolioDeviceResult>;
|
|
130
136
|
logout(userId: string, form: {
|
|
131
137
|
deviceToken: string;
|
|
132
138
|
}): Promise<LogoutResult>;
|
package/lib/User/index.js
CHANGED
|
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
|
@@ -277,6 +277,56 @@ var IKEAppUserApi = /** @class */ (function (_super) {
|
|
|
277
277
|
});
|
|
278
278
|
});
|
|
279
279
|
};
|
|
280
|
+
IKEAppUserApi.prototype.claimPortfolio = function (userId, tagTokenId) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
282
|
+
var encoded, response;
|
|
283
|
+
return __generator(this, function (_a) {
|
|
284
|
+
switch (_a.label) {
|
|
285
|
+
case 0:
|
|
286
|
+
encoded = encodeURIComponent(tagTokenId);
|
|
287
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
288
|
+
method: 'POST',
|
|
289
|
+
headers: userId
|
|
290
|
+
? {
|
|
291
|
+
'Content-Type': 'application/json',
|
|
292
|
+
'IKE-App-User-Id': userId,
|
|
293
|
+
}
|
|
294
|
+
: {
|
|
295
|
+
'Content-Type': 'application/json',
|
|
296
|
+
},
|
|
297
|
+
}, "".concat(userId, "/portfolio/").concat(encoded))];
|
|
298
|
+
case 1:
|
|
299
|
+
response = _a.sent();
|
|
300
|
+
return [2 /*return*/, response.json()];
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
IKEAppUserApi.prototype.releasePortfolio = function (userId, tagTokenId) {
|
|
306
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
307
|
+
var encoded, response;
|
|
308
|
+
return __generator(this, function (_a) {
|
|
309
|
+
switch (_a.label) {
|
|
310
|
+
case 0:
|
|
311
|
+
encoded = encodeURIComponent(tagTokenId);
|
|
312
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
313
|
+
method: 'DELETE',
|
|
314
|
+
headers: userId
|
|
315
|
+
? {
|
|
316
|
+
'Content-Type': 'application/json',
|
|
317
|
+
'IKE-App-User-Id': userId,
|
|
318
|
+
}
|
|
319
|
+
: {
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
},
|
|
322
|
+
}, "".concat(userId, "/portfolio/").concat(encoded))];
|
|
323
|
+
case 1:
|
|
324
|
+
response = _a.sent();
|
|
325
|
+
return [2 /*return*/, response.json()];
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
};
|
|
280
330
|
IKEAppUserApi.prototype.logout = function (userId, form) {
|
|
281
331
|
return __awaiter(this, void 0, void 0, function () {
|
|
282
332
|
var response;
|
package/lib/index.js
CHANGED
|
@@ -20,12 +20,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g =
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|