@bytexbyte/ike-app-api 1.0.22 → 1.0.24
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/Auth/index.d.ts +1 -1
- package/lib/User/index.d.ts +33 -0
- package/lib/User/index.js +29 -0
- package/package.json +2 -2
package/lib/Auth/index.d.ts
CHANGED
|
@@ -157,7 +157,7 @@ declare class IKEAppAuthApi extends BxBApi {
|
|
|
157
157
|
}): Promise<{
|
|
158
158
|
success: 'ok';
|
|
159
159
|
} | {
|
|
160
|
-
error: 'Phone number is required.' | 'User not found.'
|
|
160
|
+
error: 'Phone number is required.' | 'User not found.';
|
|
161
161
|
}>;
|
|
162
162
|
verifyAge(body: {
|
|
163
163
|
phone: string;
|
package/lib/User/index.d.ts
CHANGED
|
@@ -46,6 +46,35 @@ declare 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
|
+
declare type GetScanHistoryResult = {
|
|
50
|
+
scanList: {
|
|
51
|
+
id: number;
|
|
52
|
+
tagTokenId: string;
|
|
53
|
+
location: string | null;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
tag: {
|
|
56
|
+
uid: string | null;
|
|
57
|
+
displayName: string;
|
|
58
|
+
batch: {
|
|
59
|
+
company: {
|
|
60
|
+
name: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
digitalCustomizationId: number | null;
|
|
65
|
+
digitalCustomization: {
|
|
66
|
+
product: {
|
|
67
|
+
name: string;
|
|
68
|
+
images: {
|
|
69
|
+
id: number;
|
|
70
|
+
src: string;
|
|
71
|
+
}[];
|
|
72
|
+
} | null;
|
|
73
|
+
} | null;
|
|
74
|
+
}[];
|
|
75
|
+
} | {
|
|
76
|
+
error: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot get data of this user.' | 'Missing userId.';
|
|
77
|
+
};
|
|
49
78
|
declare type RemoveScanHistoryResult = {
|
|
50
79
|
error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect tagUid.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing scanHistoryId.' | 'Missing tagUid.';
|
|
51
80
|
};
|
|
@@ -136,6 +165,10 @@ declare class IKEAppUserApi extends BxBApi {
|
|
|
136
165
|
error: 'Incorrect userID.' | 'Authentication type error.' | 'You cannot make changes to this user.' | 'You are not logged in.' | 'Missing userId.' | 'Missing companyId.' | 'Missing rewardRuleId.' | 'No available discount codes found.' | undefined;
|
|
137
166
|
}>;
|
|
138
167
|
getUserIdByEmail(userId: string, email: string): Promise<GetUserIdByEmailResult>;
|
|
168
|
+
getScanHistory(userId: string, query: {
|
|
169
|
+
ignoerTagUid?: string;
|
|
170
|
+
limit?: number;
|
|
171
|
+
}): Promise<GetScanHistoryResult>;
|
|
139
172
|
removeScanHistoryByTagUid(userId: string, tagUid: string): Promise<RemoveScanHistoryResult>;
|
|
140
173
|
}
|
|
141
174
|
export default IKEAppUserApi;
|
package/lib/User/index.js
CHANGED
|
@@ -501,6 +501,35 @@ var IKEAppUserApi = /** @class */ (function (_super) {
|
|
|
501
501
|
});
|
|
502
502
|
});
|
|
503
503
|
};
|
|
504
|
+
IKEAppUserApi.prototype.getScanHistory = function (userId, query) {
|
|
505
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
506
|
+
var searchParams, response;
|
|
507
|
+
return __generator(this, function (_a) {
|
|
508
|
+
switch (_a.label) {
|
|
509
|
+
case 0:
|
|
510
|
+
searchParams = new URLSearchParams();
|
|
511
|
+
if (query.ignoerTagUid)
|
|
512
|
+
searchParams.append('ignoerTagUids', query.ignoerTagUid);
|
|
513
|
+
if (query.limit)
|
|
514
|
+
searchParams.append('limit', query.limit.toString());
|
|
515
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
516
|
+
method: 'GET',
|
|
517
|
+
headers: userId
|
|
518
|
+
? {
|
|
519
|
+
'Content-Type': 'application/json',
|
|
520
|
+
'IKE-App-User-Id': userId,
|
|
521
|
+
}
|
|
522
|
+
: {
|
|
523
|
+
'Content-Type': 'application/json',
|
|
524
|
+
},
|
|
525
|
+
}, "".concat(userId, "/scan-history?").concat(searchParams.toString()))];
|
|
526
|
+
case 1:
|
|
527
|
+
response = _a.sent();
|
|
528
|
+
return [2 /*return*/, response.json()];
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
});
|
|
532
|
+
};
|
|
504
533
|
IKEAppUserApi.prototype.removeScanHistoryByTagUid = function (userId, tagUid) {
|
|
505
534
|
return __awaiter(this, void 0, void 0, function () {
|
|
506
535
|
var response;
|
package/package.json
CHANGED