@authme/identity-verification 2.8.49 → 2.8.50

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.js CHANGED
@@ -29696,7 +29696,6 @@ async function startLiveness(config) {
29696
29696
  sendFrame(canvasSizeInfo, canvas, uiComponentBasic.video, config.onFrame, livenessConfig.fasMaxFps, true, 'all', undefined, frameFlags), rxjs.tap(({
29697
29697
  result
29698
29698
  }) => {
29699
- // console.log('result', result);
29700
29699
  applyTextByResult(result);
29701
29700
  }),
29702
29701
  // filter(
@@ -29725,20 +29724,14 @@ async function startLiveness(config) {
29725
29724
  return Object.assign({}, data, {
29726
29725
  isSuccess
29727
29726
  });
29728
- }))))), rxjs.tap(res => {
29729
- // Engine timeout 會在 res.isSuccess 為 false 時發生
29730
- if (res.isSuccess) {
29731
- sendStatusDescription$2(core.StatusDescription.UploadingStart);
29732
- util.startSpinner({
29733
- text: translateService.translate('sdk.general.uploading'),
29734
- statement: translateService.translate('sdk.general.footer'),
29735
- backgroundOpaque: true
29736
- });
29737
- } else {
29738
- // Engine 返回 timeout 或其他失敗狀態
29739
- throw new core.AuthmeError(core.ErrorCode.LIVENESS_NOT_PASSED);
29740
- }
29741
- }), rxjs.filter(res => res.isSuccess), rxjs.switchMap(() => rxjs.defer(() => config.onSuccess())));
29727
+ }))))), rxjs.tap(() => {
29728
+ sendStatusDescription$2(core.StatusDescription.UploadingStart);
29729
+ util.startSpinner({
29730
+ text: translateService.translate('sdk.general.uploading'),
29731
+ statement: translateService.translate('sdk.general.footer'),
29732
+ backgroundOpaque: true
29733
+ });
29734
+ }), rxjs.switchMap(res => rxjs.defer(() => config.onSuccess(res.isSuccess))));
29742
29735
  return rxjs.of({}).pipe(() => {
29743
29736
  eventListenerService$2.start();
29744
29737
  setStatusView$2(core.StatusView.Init);
@@ -34645,33 +34638,19 @@ class LivenessModule {
34645
34638
  getSelectedImage: () => {
34646
34639
  return selectedImage;
34647
34640
  },
34648
- onSuccess: async function () {
34641
+ onSuccess: async function (isSuccess) {
34649
34642
  await _this.fasService.stop();
34650
34643
  const meta = await _this.fasService.getReport();
34651
- // await SendRequestWithRetry(() =>
34652
- // this.postResult(
34653
- // id,
34654
- // frameList,
34655
- // resultList,
34656
- // meta,
34657
- // {
34658
- // uploadFullFrame: config.uploadFullFrame,
34659
- // },
34660
- // shouldEncrypt,
34661
- // encryptDataBase64
34662
- // )
34663
- // );
34664
34644
  await handleUpload(id, frameList, resultList, meta, config, shouldEncrypt, encryptDataBase64);
34665
- // upload finish view
34666
- util.uploadModal({
34667
- type: 'success',
34668
- titleSuccess: core.getTranslateInstance().translate('sdk.general.successUpload')
34669
- });
34670
- // setTimeout(() => {
34671
- // successView?.removeModal();
34672
- // }, 900);
34645
+ if (isSuccess) {
34646
+ // upload finish view
34647
+ util.uploadModal({
34648
+ type: 'success',
34649
+ titleSuccess: core.getTranslateInstance().translate('sdk.general.successUpload')
34650
+ });
34651
+ }
34673
34652
  const result = await _this.getResult(id);
34674
- return result.isPass;
34653
+ return isSuccess ? result.isPass : false;
34675
34654
  },
34676
34655
  onDestroy: async function () {
34677
34656
  var _this$fasService2;
@@ -37344,7 +37323,7 @@ class AuthmeIdentityVerification extends engine.AuthmeFunctionModule {
37344
37323
  }
37345
37324
 
37346
37325
  var name = "authme/sdk";
37347
- var version$1 = "2.8.49";
37326
+ var version$1 = "2.8.50";
37348
37327
  var packageInfo = {
37349
37328
  name: name,
37350
37329
  version: version$1};
package/index.esm.js CHANGED
@@ -29694,7 +29694,6 @@ async function startLiveness(config) {
29694
29694
  sendFrame(canvasSizeInfo, canvas, uiComponentBasic.video, config.onFrame, livenessConfig.fasMaxFps, true, 'all', undefined, frameFlags), tap(({
29695
29695
  result
29696
29696
  }) => {
29697
- // console.log('result', result);
29698
29697
  applyTextByResult(result);
29699
29698
  }),
29700
29699
  // filter(
@@ -29723,20 +29722,14 @@ async function startLiveness(config) {
29723
29722
  return Object.assign({}, data, {
29724
29723
  isSuccess
29725
29724
  });
29726
- }))))), tap(res => {
29727
- // Engine timeout 會在 res.isSuccess 為 false 時發生
29728
- if (res.isSuccess) {
29729
- sendStatusDescription$2(StatusDescription.UploadingStart);
29730
- startSpinner({
29731
- text: translateService.translate('sdk.general.uploading'),
29732
- statement: translateService.translate('sdk.general.footer'),
29733
- backgroundOpaque: true
29734
- });
29735
- } else {
29736
- // Engine 返回 timeout 或其他失敗狀態
29737
- throw new AuthmeError(ErrorCode.LIVENESS_NOT_PASSED);
29738
- }
29739
- }), filter(res => res.isSuccess), switchMap(() => defer(() => config.onSuccess())));
29725
+ }))))), tap(() => {
29726
+ sendStatusDescription$2(StatusDescription.UploadingStart);
29727
+ startSpinner({
29728
+ text: translateService.translate('sdk.general.uploading'),
29729
+ statement: translateService.translate('sdk.general.footer'),
29730
+ backgroundOpaque: true
29731
+ });
29732
+ }), switchMap(res => defer(() => config.onSuccess(res.isSuccess))));
29740
29733
  return of({}).pipe(() => {
29741
29734
  eventListenerService$2.start();
29742
29735
  setStatusView$2(StatusView.Init);
@@ -34643,33 +34636,19 @@ class LivenessModule {
34643
34636
  getSelectedImage: () => {
34644
34637
  return selectedImage;
34645
34638
  },
34646
- onSuccess: async function () {
34639
+ onSuccess: async function (isSuccess) {
34647
34640
  await _this.fasService.stop();
34648
34641
  const meta = await _this.fasService.getReport();
34649
- // await SendRequestWithRetry(() =>
34650
- // this.postResult(
34651
- // id,
34652
- // frameList,
34653
- // resultList,
34654
- // meta,
34655
- // {
34656
- // uploadFullFrame: config.uploadFullFrame,
34657
- // },
34658
- // shouldEncrypt,
34659
- // encryptDataBase64
34660
- // )
34661
- // );
34662
34642
  await handleUpload(id, frameList, resultList, meta, config, shouldEncrypt, encryptDataBase64);
34663
- // upload finish view
34664
- uploadModal({
34665
- type: 'success',
34666
- titleSuccess: getTranslateInstance().translate('sdk.general.successUpload')
34667
- });
34668
- // setTimeout(() => {
34669
- // successView?.removeModal();
34670
- // }, 900);
34643
+ if (isSuccess) {
34644
+ // upload finish view
34645
+ uploadModal({
34646
+ type: 'success',
34647
+ titleSuccess: getTranslateInstance().translate('sdk.general.successUpload')
34648
+ });
34649
+ }
34671
34650
  const result = await _this.getResult(id);
34672
- return result.isPass;
34651
+ return isSuccess ? result.isPass : false;
34673
34652
  },
34674
34653
  onDestroy: async function () {
34675
34654
  var _this$fasService2;
@@ -37342,7 +37321,7 @@ class AuthmeIdentityVerification extends AuthmeFunctionModule {
37342
37321
  }
37343
37322
 
37344
37323
  var name = "authme/sdk";
37345
- var version$1 = "2.8.49";
37324
+ var version$1 = "2.8.50";
37346
37325
  var packageInfo = {
37347
37326
  name: name,
37348
37327
  version: version$1};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authme/identity-verification",
3
- "version": "2.8.49",
3
+ "version": "2.8.50",
4
4
  "peerDependencies": {
5
5
  "core-js": "^3.6.0",
6
6
  "lottie-web": "^5.9.2",
@@ -12,7 +12,7 @@ export declare function startLiveness(config: {
12
12
  }) => Promise<FasResult>;
13
13
  setFrameSize: (width: number, height: number) => void;
14
14
  getSelectedImage: () => Uint8Array | Uint8ClampedArray | null;
15
- onSuccess: () => Promise<boolean>;
15
+ onSuccess: (isSuccess: boolean) => Promise<boolean>;
16
16
  onDestroy: () => Promise<void>;
17
17
  getNormalizedROI: () => Promise<{
18
18
  width: number;
@@ -20,4 +20,4 @@ export declare function startLiveness(config: {
20
20
  x: number;
21
21
  y: number;
22
22
  }>;
23
- }): Promise<import("rxjs").Observable<unknown>>;
23
+ }): Promise<import("rxjs").Observable<boolean>>;