@authme/liveness 2.8.4 → 2.8.5

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.4";
73
- var date = "2025-03-13T06:47:53+0000";
72
+ var version$1 = "2.8.5";
73
+ var date = "2025-03-17T05:56:00+0000";
74
74
  var packageInfo = {
75
75
  name: name,
76
76
  version: version$1,
@@ -155,35 +155,8 @@ 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');
158
+ const option = url => deviceType => __awaiter(void 0, void 0, void 0, function* () {
159
+ return core.sendRequest(`${url}${deviceType ? '?deviceType=' + deviceType : ''}`, 'GET');
187
160
  });
188
161
  const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* () {
189
162
  // const url = `/api/identity-verification/v1/ui-themes/${themeId}`;
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.4";
70
- var date = "2025-03-13T06:47:53+0000";
69
+ var version$1 = "2.8.5";
70
+ var date = "2025-03-17T05:56:00+0000";
71
71
  var packageInfo = {
72
72
  name: name,
73
73
  version: version$1,
@@ -152,35 +152,8 @@ 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');
155
+ const option = url => deviceType => __awaiter(void 0, void 0, void 0, function* () {
156
+ return sendRequest(`${url}${deviceType ? '?deviceType=' + deviceType : ''}`, 'GET');
184
157
  });
185
158
  const themeUI = url => themeId => __awaiter(void 0, void 0, void 0, function* () {
186
159
  // const url = `/api/identity-verification/v1/ui-themes/${themeId}`;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@authme/liveness",
3
- "version": "2.8.4",
3
+ "version": "2.8.5",
4
4
  "peerDependencies": {
5
5
  "core-js": "^3.6.0",
6
- "@authme/core": "2.8.4",
7
- "@authme/util": "2.8.4",
8
- "@authme/engine": "2.8.4"
6
+ "@authme/core": "2.8.5",
7
+ "@authme/util": "2.8.5",
8
+ "@authme/engine": "2.8.5"
9
9
  },
10
10
  "module": "./index.js",
11
11
  "main": "./index.cjs",
@@ -1,4 +1,5 @@
1
1
  import { LivenessDetectBody, LivenessResultResponse, LivenessUploadFrameBody, LivenessUploadMetaBody } from './dto.interface';
2
+ import { DEVICE_TYPE } from '@authme/util';
2
3
  export declare const LivenessAPI: {
3
4
  IdentityVerification: {
4
5
  init: (Immediately: boolean, passive?: boolean | null, compareCustomerClientId?: string | null) => Promise<any>;
@@ -10,7 +11,7 @@ export declare const LivenessAPI: {
10
11
  uploadFrameFile: (data: LivenessUploadFrameBody) => Promise<void>;
11
12
  uploadMeta: (data: LivenessUploadMetaBody) => Promise<void>;
12
13
  getResult: (id: string) => Promise<LivenessResultResponse>;
13
- option: () => Promise<any>;
14
+ option: (deviceType?: DEVICE_TYPE | null) => Promise<any>;
14
15
  themeUI: (themeId: string) => Promise<any>;
15
16
  };
16
17
  CustomerManagement: {