@bytexbyte/ike-app-api 1.0.80 → 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.
@@ -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
- start(): Promise<Session>;
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
- approve({ id, token, uniqueId, }: {
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: 'Field(s) cannot be empty.';
39
+ error: string;
27
40
  }>;
28
41
  }
29
42
  export default IKEAppIncodeApi;
@@ -86,19 +86,26 @@ var IKEAppIncodeApi = /** @class */ (function (_super) {
86
86
  });
87
87
  });
88
88
  };
89
- IKEAppIncodeApi.prototype.start = function () {
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 (_a) {
93
- switch (_a.label) {
94
- case 0: return [4 /*yield*/, this.bxbFetch({
95
- method: 'GET',
96
- headers: {
97
- 'Content-Type': 'application/json',
98
- },
99
- }, "start")];
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 = _a.sent();
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: {
@@ -8,6 +8,8 @@ export declare type Product = {
8
8
  minVerifyTimer: number;
9
9
  maxVerifyTimer: number;
10
10
  isSmokeFree: boolean;
11
+ ageRestriction: number;
12
+ deviceStandbyTime: number;
11
13
  isScanningAllow: boolean;
12
14
  vendor: string;
13
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/ike-app-api",
3
- "version": "1.0.80",
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": "^18.7.1",
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",
@@ -76,4 +76,4 @@
76
76
  "tsutils": "^2.29.0",
77
77
  "wrappy": "^1.0.2"
78
78
  }
79
- }
79
+ }