@authme/liveness 2.8.1 → 2.8.3

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/index.cjs CHANGED
@@ -69,8 +69,8 @@ class FasService extends engine.AuthmeEngineModuleBase {
69
69
  }
70
70
 
71
71
  var name = "authme/sdk";
72
- var version$1 = "2.8.1";
73
- var date = "2025-02-04T09:12:52+0000";
72
+ var version$1 = "2.8.3";
73
+ var date = "2025-03-05T06:16:55+0000";
74
74
  var packageInfo = {
75
75
  name: name,
76
76
  version: version$1,
@@ -155,13 +155,75 @@ const getResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
155
155
  const getVerifyResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
156
156
  return core.sendRequest(`${url}/${id}`, 'GET');
157
157
  });
158
+ const option = url => () => __awaiter(void 0, void 0, void 0, function* () {
159
+ // const url = '/api/identity-verification/v1/option';
160
+ // const accessToken = Storage.getItem('token') as string | null;
161
+ // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
162
+ // const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
163
+ // try {
164
+ // const response = await fetch(normalizedUrl, {
165
+ // method: 'GET',
166
+ // headers: {
167
+ // 'Content-Type': 'application/json',
168
+ // 'Authorization': `Bearer ${accessToken}`, // 如果需要身份驗證
169
+ // 'sdk-info': [
170
+ // `sdk-version: ${version}`,
171
+ // `platform: ${navigator.platform}`,
172
+ // ].join(';') as string
173
+ // }
174
+ // });
175
+ // if (!response.ok) {
176
+ // // throw new Error(`HTTP error! Status: ${response.status}`);
177
+ // return {};
178
+ // }
179
+ // const data = await response.json();
180
+ // console.log('Response Data:', data);
181
+ // return data; // 可以回傳資料讓其他函式使用
182
+ // } catch (error) {
183
+ // console.error('Fetch Error:', error);
184
+ // return {}; // 或拋出錯誤,視需求而定
185
+ // }
186
+ return core.sendRequest(url, 'GET');
187
+ });
188
+ const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* () {
189
+ // const url = `/api/identity-verification/v1/ui-themes/${themeId}`;
190
+ // const accessToken = Storage.getItem('token') as string | null;
191
+ // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
192
+ // const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
193
+ // try {
194
+ // const response = await fetch(normalizedUrl, {
195
+ // method: 'GET',
196
+ // headers: {
197
+ // 'Content-Type': 'application/json',
198
+ // 'Authorization': `Bearer ${accessToken}`, // 如果需要身份驗證
199
+ // 'sdk-info': [
200
+ // `sdk-version: ${version}`,
201
+ // `platform: ${navigator.platform}`,
202
+ // ].join(';') as string
203
+ // }
204
+ // });
205
+ // if (!response.ok) {
206
+ // // throw new Error(`HTTP error! Status: ${response.status}`);
207
+ // return {};
208
+ // }
209
+ // const data = await response.json();
210
+ // console.log('Response Data:', data);
211
+ // return data; // 可以回傳資料讓其他函式使用
212
+ // } catch (error) {
213
+ // console.error('Fetch Error:', error);
214
+ // return {}; // 或拋出錯誤,視需求而定
215
+ // }
216
+ return core.sendRequest(`${url}/${themeId}`, 'GET');
217
+ });
158
218
  const IdentityVerification = {
159
219
  init: init('/api/identity-verification/v3/liveness/init'),
160
220
  detect: detect('/api/identity-verification/v3/liveness/detect'),
161
221
  uploadFrame: uploadFrame('/api/identity-verification/v3/liveness/frame'),
162
222
  uploadFrameFile: uploadFrameFile('/api/identity-verification/v3/liveness/frame-file'),
163
223
  uploadMeta: uploadMeta('/api/identity-verification/v3/liveness/meta'),
164
- getResult: getResult('/api/identity-verification/v3/liveness/result')
224
+ getResult: getResult('/api/identity-verification/v3/liveness/result'),
225
+ option: option('/api/identity-verification/v1/option'),
226
+ themeUI: themeUI('/api/identity-verification/v1/ui-themes')
165
227
  };
166
228
  const CustomerManagement = {
167
229
  getVerifyResult: getVerifyResult('/api/customer-management/liveness-verify/v3/result'),
package/index.js CHANGED
@@ -66,8 +66,8 @@ class FasService extends AuthmeEngineModuleBase {
66
66
  }
67
67
 
68
68
  var name = "authme/sdk";
69
- var version$1 = "2.8.1";
70
- var date = "2025-02-04T09:12:52+0000";
69
+ var version$1 = "2.8.3";
70
+ var date = "2025-03-05T06:16:55+0000";
71
71
  var packageInfo = {
72
72
  name: name,
73
73
  version: version$1,
@@ -152,13 +152,75 @@ const getResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
152
152
  const getVerifyResult = url => id => __awaiter(void 0, void 0, void 0, function* () {
153
153
  return sendRequest(`${url}/${id}`, 'GET');
154
154
  });
155
+ const option = url => () => __awaiter(void 0, void 0, void 0, function* () {
156
+ // const url = '/api/identity-verification/v1/option';
157
+ // const accessToken = Storage.getItem('token') as string | null;
158
+ // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
159
+ // const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
160
+ // try {
161
+ // const response = await fetch(normalizedUrl, {
162
+ // method: 'GET',
163
+ // headers: {
164
+ // 'Content-Type': 'application/json',
165
+ // 'Authorization': `Bearer ${accessToken}`, // 如果需要身份驗證
166
+ // 'sdk-info': [
167
+ // `sdk-version: ${version}`,
168
+ // `platform: ${navigator.platform}`,
169
+ // ].join(';') as string
170
+ // }
171
+ // });
172
+ // if (!response.ok) {
173
+ // // throw new Error(`HTTP error! Status: ${response.status}`);
174
+ // return {};
175
+ // }
176
+ // const data = await response.json();
177
+ // console.log('Response Data:', data);
178
+ // return data; // 可以回傳資料讓其他函式使用
179
+ // } catch (error) {
180
+ // console.error('Fetch Error:', error);
181
+ // return {}; // 或拋出錯誤,視需求而定
182
+ // }
183
+ return sendRequest(url, 'GET');
184
+ });
185
+ const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* () {
186
+ // const url = `/api/identity-verification/v1/ui-themes/${themeId}`;
187
+ // const accessToken = Storage.getItem('token') as string | null;
188
+ // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
189
+ // const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
190
+ // try {
191
+ // const response = await fetch(normalizedUrl, {
192
+ // method: 'GET',
193
+ // headers: {
194
+ // 'Content-Type': 'application/json',
195
+ // 'Authorization': `Bearer ${accessToken}`, // 如果需要身份驗證
196
+ // 'sdk-info': [
197
+ // `sdk-version: ${version}`,
198
+ // `platform: ${navigator.platform}`,
199
+ // ].join(';') as string
200
+ // }
201
+ // });
202
+ // if (!response.ok) {
203
+ // // throw new Error(`HTTP error! Status: ${response.status}`);
204
+ // return {};
205
+ // }
206
+ // const data = await response.json();
207
+ // console.log('Response Data:', data);
208
+ // return data; // 可以回傳資料讓其他函式使用
209
+ // } catch (error) {
210
+ // console.error('Fetch Error:', error);
211
+ // return {}; // 或拋出錯誤,視需求而定
212
+ // }
213
+ return sendRequest(`${url}/${themeId}`, 'GET');
214
+ });
155
215
  const IdentityVerification = {
156
216
  init: init('/api/identity-verification/v3/liveness/init'),
157
217
  detect: detect('/api/identity-verification/v3/liveness/detect'),
158
218
  uploadFrame: uploadFrame('/api/identity-verification/v3/liveness/frame'),
159
219
  uploadFrameFile: uploadFrameFile('/api/identity-verification/v3/liveness/frame-file'),
160
220
  uploadMeta: uploadMeta('/api/identity-verification/v3/liveness/meta'),
161
- getResult: getResult('/api/identity-verification/v3/liveness/result')
221
+ getResult: getResult('/api/identity-verification/v3/liveness/result'),
222
+ option: option('/api/identity-verification/v1/option'),
223
+ themeUI: themeUI('/api/identity-verification/v1/ui-themes')
162
224
  };
163
225
  const CustomerManagement = {
164
226
  getVerifyResult: getVerifyResult('/api/customer-management/liveness-verify/v3/result'),
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@authme/liveness",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "peerDependencies": {
5
5
  "core-js": "^3.6.0",
6
- "@authme/core": "2.8.1",
7
- "@authme/util": "2.8.1",
8
- "@authme/engine": "2.8.1"
6
+ "@authme/core": "2.8.3",
7
+ "@authme/util": "2.8.3",
8
+ "@authme/engine": "2.8.3"
9
9
  },
10
10
  "module": "./index.js",
11
11
  "main": "./index.cjs",
@@ -10,6 +10,8 @@ export declare const LivenessAPI: {
10
10
  uploadFrameFile: (data: LivenessUploadFrameBody) => Promise<void>;
11
11
  uploadMeta: (data: LivenessUploadMetaBody) => Promise<void>;
12
12
  getResult: (id: string) => Promise<LivenessResultResponse>;
13
+ option: () => Promise<any>;
14
+ themeUI: (themeId: string) => Promise<any>;
13
15
  };
14
16
  CustomerManagement: {
15
17
  getVerifyResult: (id: string) => Promise<any>;