@bytexbyte/ike-app-api 1.0.81 → 1.0.82
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 +0 -8
- package/lib/Auth/index.js +0 -20
- package/lib/Incode/index.d.ts +16 -3
- package/lib/Incode/index.js +52 -13
- package/package.json +2 -2
package/lib/Auth/index.d.ts
CHANGED
|
@@ -173,14 +173,6 @@ declare class IKEAppAuthApi extends BxBApi {
|
|
|
173
173
|
} | {
|
|
174
174
|
error: 'Field(s) cannot be empty.' | 'User not found.';
|
|
175
175
|
}>;
|
|
176
|
-
/** Incode age estimation (face) flow completed in Link app; session user must match `userId`. Sets `isAgeVerified` on the server. */
|
|
177
|
-
confirmAgeEstimationComplete(body: {
|
|
178
|
-
userId: string;
|
|
179
|
-
}): Promise<{
|
|
180
|
-
success: true;
|
|
181
|
-
} | {
|
|
182
|
-
error: 'Field(s) cannot be empty.' | 'You are not logged in.' | 'You cannot make changes to this user.' | 'User not found.';
|
|
183
|
-
}>;
|
|
184
176
|
isPhoneExisted(body: {
|
|
185
177
|
phone: string;
|
|
186
178
|
}): Promise<{
|
package/lib/Auth/index.js
CHANGED
|
@@ -426,26 +426,6 @@ var IKEAppAuthApi = /** @class */ (function (_super) {
|
|
|
426
426
|
});
|
|
427
427
|
});
|
|
428
428
|
};
|
|
429
|
-
/** Incode age estimation (face) flow completed in Link app; session user must match `userId`. Sets `isAgeVerified` on the server. */
|
|
430
|
-
IKEAppAuthApi.prototype.confirmAgeEstimationComplete = function (body) {
|
|
431
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
432
|
-
var response;
|
|
433
|
-
return __generator(this, function (_a) {
|
|
434
|
-
switch (_a.label) {
|
|
435
|
-
case 0: return [4 /*yield*/, this.bxbFetch({
|
|
436
|
-
method: 'POST',
|
|
437
|
-
headers: {
|
|
438
|
-
'Content-Type': 'application/json',
|
|
439
|
-
},
|
|
440
|
-
body: JSON.stringify(body),
|
|
441
|
-
}, "verify/age-estimation-complete")];
|
|
442
|
-
case 1:
|
|
443
|
-
response = _a.sent();
|
|
444
|
-
return [2 /*return*/, response.json()];
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
429
|
IKEAppAuthApi.prototype.isPhoneExisted = function (body) {
|
|
450
430
|
return __awaiter(this, void 0, void 0, function () {
|
|
451
431
|
var response;
|
package/lib/Incode/index.d.ts
CHANGED
|
@@ -10,20 +10,33 @@ declare class IKEAppIncodeApi extends BxBApi {
|
|
|
10
10
|
onError?: (error: any) => void;
|
|
11
11
|
});
|
|
12
12
|
getOcrData(form: GetOcrDataBody): Promise<any>;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* GET /api/incode/start — optional `flow` matches backend (`faceAgeEstimation`, `faceAgeCheck`, `faceAgeCapture`, …).
|
|
15
|
+
*/
|
|
16
|
+
start(options?: {
|
|
17
|
+
flow?: string;
|
|
18
|
+
}): Promise<Session>;
|
|
14
19
|
finish({ token }: {
|
|
15
20
|
token: string;
|
|
16
21
|
}): Promise<Session | {
|
|
17
22
|
error: 'Missing required parameter token';
|
|
18
23
|
}>;
|
|
19
|
-
|
|
24
|
+
/**
|
|
25
|
+
* GET /api/incode/score — proxies Incode `omni/get/score` (session `token` as query param).
|
|
26
|
+
*/
|
|
27
|
+
score(params: {
|
|
28
|
+
token: string;
|
|
29
|
+
interviewId?: string;
|
|
30
|
+
}): Promise<unknown>;
|
|
31
|
+
approve({ id, token, uniqueId, interviewId, }: {
|
|
20
32
|
id: string;
|
|
21
33
|
token: string;
|
|
22
34
|
uniqueId: string;
|
|
35
|
+
interviewId?: string;
|
|
23
36
|
}): Promise<{
|
|
24
37
|
incodeId: string;
|
|
25
38
|
} | {
|
|
26
|
-
error:
|
|
39
|
+
error: string;
|
|
27
40
|
}>;
|
|
28
41
|
}
|
|
29
42
|
export default IKEAppIncodeApi;
|
package/lib/Incode/index.js
CHANGED
|
@@ -86,19 +86,26 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
|
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
-
|
|
89
|
+
/**
|
|
90
|
+
* GET /api/incode/start — optional `flow` matches backend (`faceAgeEstimation`, `faceAgeCheck`, `faceAgeCapture`, …).
|
|
91
|
+
*/
|
|
92
|
+
IKEAppIncodeApi.prototype.start = function (options) {
|
|
93
|
+
var _a;
|
|
90
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
-
var response;
|
|
92
|
-
return __generator(this, function (
|
|
93
|
-
switch (
|
|
94
|
-
case 0:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
var flow, path, response;
|
|
96
|
+
return __generator(this, function (_b) {
|
|
97
|
+
switch (_b.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
flow = (_a = options === null || options === void 0 ? void 0 : options.flow) === null || _a === void 0 ? void 0 : _a.trim();
|
|
100
|
+
path = flow !== undefined && flow !== '' ? "start?".concat(new URLSearchParams({ flow: flow }).toString()) : "start";
|
|
101
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
102
|
+
method: 'GET',
|
|
103
|
+
headers: {
|
|
104
|
+
'Content-Type': 'application/json',
|
|
105
|
+
},
|
|
106
|
+
}, path)];
|
|
100
107
|
case 1:
|
|
101
|
-
response =
|
|
108
|
+
response = _b.sent();
|
|
102
109
|
return [2 /*return*/, response.json()];
|
|
103
110
|
}
|
|
104
111
|
});
|
|
@@ -125,14 +132,46 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
|
|
|
125
132
|
});
|
|
126
133
|
});
|
|
127
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* GET /api/incode/score — proxies Incode `omni/get/score` (session `token` as query param).
|
|
137
|
+
*/
|
|
138
|
+
IKEAppIncodeApi.prototype.score = function (params) {
|
|
139
|
+
var _a;
|
|
140
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
141
|
+
var search, iv, response;
|
|
142
|
+
return __generator(this, function (_b) {
|
|
143
|
+
switch (_b.label) {
|
|
144
|
+
case 0:
|
|
145
|
+
search = new URLSearchParams({ token: params.token });
|
|
146
|
+
iv = (_a = params.interviewId) === null || _a === void 0 ? void 0 : _a.trim();
|
|
147
|
+
if (iv) {
|
|
148
|
+
search.set('interviewId', iv);
|
|
149
|
+
}
|
|
150
|
+
return [4 /*yield*/, this.bxbFetch({
|
|
151
|
+
method: 'GET',
|
|
152
|
+
headers: {
|
|
153
|
+
'Content-Type': 'application/json',
|
|
154
|
+
},
|
|
155
|
+
}, "score?".concat(search.toString()))];
|
|
156
|
+
case 1:
|
|
157
|
+
response = _b.sent();
|
|
158
|
+
return [2 /*return*/, response.json()];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
128
163
|
IKEAppIncodeApi.prototype.approve = function (_a) {
|
|
129
|
-
var id = _a.id, token = _a.token, uniqueId = _a.uniqueId;
|
|
164
|
+
var id = _a.id, token = _a.token, uniqueId = _a.uniqueId, interviewId = _a.interviewId;
|
|
130
165
|
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
-
var params, response;
|
|
166
|
+
var params, iv, response;
|
|
132
167
|
return __generator(this, function (_b) {
|
|
133
168
|
switch (_b.label) {
|
|
134
169
|
case 0:
|
|
135
170
|
params = new URLSearchParams({ id: id, token: token, uniqueId: uniqueId });
|
|
171
|
+
iv = interviewId === null || interviewId === void 0 ? void 0 : interviewId.trim();
|
|
172
|
+
if (iv) {
|
|
173
|
+
params.set('interviewId', iv);
|
|
174
|
+
}
|
|
136
175
|
return [4 /*yield*/, this.bxbFetch({
|
|
137
176
|
method: 'GET',
|
|
138
177
|
headers: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytexbyte/ike-app-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.82",
|
|
4
4
|
"description": "app api",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"homepage": "https://dev.azure.com/ByteXByte/IKE/_git/IKE-web?path=/next/app-api",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^
|
|
26
|
+
"@types/node": "^22.0.0",
|
|
27
27
|
"prettier": "^2.7.1",
|
|
28
28
|
"tslint": "^6.1.3",
|
|
29
29
|
"tslint-config-prettier": "^1.18.0",
|