@authme/id-recognition 2.8.3 → 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
@@ -57,11 +57,11 @@ exports.IdRecognitionCardType = void 0;
57
57
  })(exports.IdRecognitionCardType || (exports.IdRecognitionCardType = {}));
58
58
  exports.IdRecognitionCardName = void 0;
59
59
  (function (IdRecognitionCardName) {
60
- IdRecognitionCardName["IDCard"] = "sdk.home.selectDocument.idCard";
61
- IdRecognitionCardName["DriverLicense"] = "sdk.home.selectDocument.driverLicense";
62
- IdRecognitionCardName["HealthCard"] = "sdk.home.selectDocument.healthCard";
63
- IdRecognitionCardName["ResidentCard"] = "sdk.home.selectDocument.residentCard";
64
- IdRecognitionCardName["Passport"] = "sdk.home.selectDocument.passport";
60
+ IdRecognitionCardName["IDCard"] = "sdk.general.cardtype.idCard";
61
+ IdRecognitionCardName["DriverLicense"] = "sdk.general.cardtype.driverLicense";
62
+ IdRecognitionCardName["HealthCard"] = "sdk.general.cardtype.healthCard";
63
+ IdRecognitionCardName["ResidentCard"] = "sdk.general.cardtype.residentCard";
64
+ IdRecognitionCardName["Passport"] = "sdk.general.cardtype.passport";
65
65
  })(exports.IdRecognitionCardName || (exports.IdRecognitionCardName = {}));
66
66
  exports.ServerSideEAuthMeCardClass = void 0;
67
67
  (function (ServerSideEAuthMeCardClass) {
@@ -399,8 +399,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
399
399
  }
400
400
 
401
401
  var name = "authme/sdk";
402
- var version$1 = "2.8.3";
403
- var date = "2025-03-05T06:16:55+0000";
402
+ var version$1 = "2.8.5";
403
+ var date = "2025-03-17T05:56:00+0000";
404
404
  var packageInfo = {
405
405
  name: name,
406
406
  version: version$1,
@@ -611,36 +611,9 @@ function logCollect(message, stackTrace) {
611
611
  body: JSON.stringify(body)
612
612
  });
613
613
  }
614
- function option() {
614
+ function option(deviceType) {
615
615
  return __awaiter(this, void 0, void 0, function* () {
616
- // const url = '/api/identity-verification/v1/option';
617
- // const accessToken = Storage.getItem('token') as string | null;
618
- // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
619
- // const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
620
- // try {
621
- // const response = await fetch(normalizedUrl, {
622
- // method: 'GET',
623
- // headers: {
624
- // 'Content-Type': 'application/json',
625
- // 'Authorization': `Bearer ${accessToken}`, // 如果需要身份驗證
626
- // 'sdk-info': [
627
- // `sdk-version: ${version}`,
628
- // `platform: ${navigator.platform}`,
629
- // ].join(';') as string
630
- // }
631
- // });
632
- // if (!response.ok) {
633
- // // throw new Error(`HTTP error! Status: ${response.status}`);
634
- // return {};
635
- // }
636
- // const data = await response.json();
637
- // console.log('Response Data:', data);
638
- // return data; // 可以回傳資料讓其他函式使用
639
- // } catch (error) {
640
- // console.error('Fetch Error:', error);
641
- // return {}; // 或拋出錯誤,視需求而定
642
- // }
643
- return core.sendRequest('/api/identity-verification/v1/option', 'GET');
616
+ return core.sendRequest(`/api/identity-verification/v1/option${deviceType ? '?deviceType=' + deviceType : ''}`, 'GET');
644
617
  });
645
618
  }
646
619
  function themeUI(themeId) {
package/index.js CHANGED
@@ -54,11 +54,11 @@ var IdRecognitionCardType;
54
54
  })(IdRecognitionCardType || (IdRecognitionCardType = {}));
55
55
  var IdRecognitionCardName;
56
56
  (function (IdRecognitionCardName) {
57
- IdRecognitionCardName["IDCard"] = "sdk.home.selectDocument.idCard";
58
- IdRecognitionCardName["DriverLicense"] = "sdk.home.selectDocument.driverLicense";
59
- IdRecognitionCardName["HealthCard"] = "sdk.home.selectDocument.healthCard";
60
- IdRecognitionCardName["ResidentCard"] = "sdk.home.selectDocument.residentCard";
61
- IdRecognitionCardName["Passport"] = "sdk.home.selectDocument.passport";
57
+ IdRecognitionCardName["IDCard"] = "sdk.general.cardtype.idCard";
58
+ IdRecognitionCardName["DriverLicense"] = "sdk.general.cardtype.driverLicense";
59
+ IdRecognitionCardName["HealthCard"] = "sdk.general.cardtype.healthCard";
60
+ IdRecognitionCardName["ResidentCard"] = "sdk.general.cardtype.residentCard";
61
+ IdRecognitionCardName["Passport"] = "sdk.general.cardtype.passport";
62
62
  })(IdRecognitionCardName || (IdRecognitionCardName = {}));
63
63
  var ServerSideEAuthMeCardClass;
64
64
  (function (ServerSideEAuthMeCardClass) {
@@ -396,8 +396,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
396
396
  }
397
397
 
398
398
  var name = "authme/sdk";
399
- var version$1 = "2.8.3";
400
- var date = "2025-03-05T06:16:55+0000";
399
+ var version$1 = "2.8.5";
400
+ var date = "2025-03-17T05:56:00+0000";
401
401
  var packageInfo = {
402
402
  name: name,
403
403
  version: version$1,
@@ -608,36 +608,9 @@ function logCollect(message, stackTrace) {
608
608
  body: JSON.stringify(body)
609
609
  });
610
610
  }
611
- function option() {
611
+ function option(deviceType) {
612
612
  return __awaiter(this, void 0, void 0, function* () {
613
- // const url = '/api/identity-verification/v1/option';
614
- // const accessToken = Storage.getItem('token') as string | null;
615
- // const baseUrl = Storage.getItem('apiBaseUrl') as string | null;
616
- // const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
617
- // try {
618
- // const response = await fetch(normalizedUrl, {
619
- // method: 'GET',
620
- // headers: {
621
- // 'Content-Type': 'application/json',
622
- // 'Authorization': `Bearer ${accessToken}`, // 如果需要身份驗證
623
- // 'sdk-info': [
624
- // `sdk-version: ${version}`,
625
- // `platform: ${navigator.platform}`,
626
- // ].join(';') as string
627
- // }
628
- // });
629
- // if (!response.ok) {
630
- // // throw new Error(`HTTP error! Status: ${response.status}`);
631
- // return {};
632
- // }
633
- // const data = await response.json();
634
- // console.log('Response Data:', data);
635
- // return data; // 可以回傳資料讓其他函式使用
636
- // } catch (error) {
637
- // console.error('Fetch Error:', error);
638
- // return {}; // 或拋出錯誤,視需求而定
639
- // }
640
- return sendRequest('/api/identity-verification/v1/option', 'GET');
613
+ return sendRequest(`/api/identity-verification/v1/option${deviceType ? '?deviceType=' + deviceType : ''}`, 'GET');
641
614
  });
642
615
  }
643
616
  function themeUI(themeId) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@authme/id-recognition",
3
- "version": "2.8.3",
3
+ "version": "2.8.5",
4
4
  "peerDependencies": {
5
5
  "core-js": "^3.6.0",
6
- "@authme/core": "2.8.3",
7
- "@authme/util": "2.8.3",
8
- "@authme/engine": "2.8.3"
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,6 +1,7 @@
1
1
  import { CountryCode, IdRecognitionCardType, RecognitionFileType, ResourceImageType } from '../enum';
2
2
  import { InitScanResponse } from '../model';
3
3
  import { ScanViewItem, WelcomePageConfig, ThicknessMode } from '../interface';
4
+ import { DEVICE_TYPE } from '@authme/util';
4
5
  interface InitScanDocumentParams {
5
6
  scanDocumentId: string;
6
7
  scanView: ScanViewItem;
@@ -87,6 +88,6 @@ export declare function saveExtraDoc(params: {
87
88
  };
88
89
  }): Promise<any>;
89
90
  export declare function logCollect(message: string, stackTrace: string): Promise<any>;
90
- export declare function option(): Promise<any>;
91
+ export declare function option(deviceType?: DEVICE_TYPE | null): Promise<any>;
91
92
  export declare function themeUI(themeId: string): Promise<any>;
92
93
  export {};
@@ -41,11 +41,11 @@ export declare enum IdRecognitionCardType {
41
41
  Passport = "Passport"
42
42
  }
43
43
  export declare enum IdRecognitionCardName {
44
- IDCard = "sdk.home.selectDocument.idCard",
45
- DriverLicense = "sdk.home.selectDocument.driverLicense",
46
- HealthCard = "sdk.home.selectDocument.healthCard",
47
- ResidentCard = "sdk.home.selectDocument.residentCard",
48
- Passport = "sdk.home.selectDocument.passport"
44
+ IDCard = "sdk.general.cardtype.idCard",
45
+ DriverLicense = "sdk.general.cardtype.driverLicense",
46
+ HealthCard = "sdk.general.cardtype.healthCard",
47
+ ResidentCard = "sdk.general.cardtype.residentCard",
48
+ Passport = "sdk.general.cardtype.passport"
49
49
  }
50
50
  export declare enum ServerSideEAuthMeCardClass {
51
51
  Invalid = "Invalid",