@regulaforensics/idv-face 3.9.494-nightly → 3.9.496-rc

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/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { BaseModule } from '../../../../interfaces-idv/src';
2
- import { FailedAssets } from '../../interfaces-idv/src';
3
- import { IdvAsset } from '../../interfaces-idv/src';
4
- import { IdvModuleProps } from '../../../../interfaces-idv/src';
5
1
  import { LitElement } from 'lit';
6
2
  import { RecordingProcess } from '@regulaforensics/vp-frontend-face-components';
7
3
  import { TemplateResult } from 'lit-html';
8
4
 
5
+ declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
6
+ abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
7
+ abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
8
+ }
9
+
9
10
  export declare class FaceIdv extends LitElement implements BaseModule<FaceModuleProps, object> {
10
11
  props: IdvModuleProps<FaceModuleProps, object> | null;
11
12
  private renderVersion;
@@ -41,7 +42,6 @@ declare type FaceModuleProps = {
41
42
  };
42
43
  localizationKeys?: Record<string, string>;
43
44
  customization?: {
44
- fontFamily?: string;
45
45
  onboardingScreenBackgroundColor?: string;
46
46
  onboardingScreenStartButtonBackgroundColor?: string;
47
47
  onboardingScreenStartButtonBackgroundHover?: string;
@@ -110,6 +110,47 @@ declare type FaceModuleProps = {
110
110
  preloadAssetsRequired?: boolean;
111
111
  };
112
112
 
113
+ declare type FailedAssets = {
114
+ imageURL: Set<string>;
115
+ base64: Set<string>;
116
+ blockingAssets: Set<string>;
117
+ };
118
+
119
+ declare type IdvAsset = {
120
+ idvAsset: ImageLike;
121
+ };
122
+
123
+ declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
124
+ isProcessing?: (isProcessing: boolean) => void;
125
+ moduleProps: TModuleProps;
126
+ modulesConfig?: TModulesConfig;
127
+ perform: (data: any, type?: PerformType) => void;
128
+ idvEventListener: (module: string, data: any) => void;
129
+ nonce?: string;
130
+ };
131
+
132
+ declare type ImageBase = {
133
+ imageURL?: string;
134
+ imageId?: string;
135
+ base64?: string;
136
+ prepareRequired?: boolean;
137
+ failurePolicy?: ImageFailurePolicy;
138
+ timeout?: number;
139
+ };
140
+
141
+ declare type ImageFailurePolicy = 'ignore' | 'placeholderImage' | 'error';
142
+
143
+ declare type ImageLike = ImageBase & {
144
+ placeholderImage?: ImageLike;
145
+ };
146
+
147
+ declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
148
+
149
+ declare const PerformTypes: {
150
+ readonly FORM: "form";
151
+ readonly DATA: "data";
152
+ };
153
+
113
154
  declare type RecordingProcessKeys = keyof typeof RecordingProcess;
114
155
 
115
156
  export { }
package/dist/main.iife.js CHANGED
@@ -239,4 +239,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
239
239
  face-liveness::part(retry-screen-too-much-turn-image) {
240
240
  background-image: url(${o(i)});
241
241
  }
242
- `)}return r}_prepareTranslations(e){let{locale:t,localizationKeys:n}=e,r=t&&typeof t==`string`?t.slice(0,2).toLowerCase():``;return!r||!n?null:iw({translationKeysData:aw,translationKeysProps:n,locale:r})}_prepareSettings(e){var t,n,r,i,a,o,s;let{config:c,copyright:l,sessionId:u,serviceToken:d,serviceURL:f,customization:p,locale:m,failedAssets:h,preloadAssetsRequired:g}=e,_={fontFamily:p==null?void 0:p.fontFamily,onboardingScreenBackgroundColor:p==null?void 0:p.onboardingScreenBackgroundColor,onboardingScreenStartButtonBackground:p==null?void 0:p.onboardingScreenStartButtonBackgroundColor,onboardingScreenIllumination:et(p==null?void 0:p.onboardingScreenIllumination,g,h),onboardingScreenAccessories:et(p==null?void 0:p.onboardingScreenAccessories,g,h),onboardingScreenCameraLevel:et(p==null?void 0:p.onboardingScreenCameraLevel,g,h),cameraScreenFrontHintLabelText:p==null?void 0:p.cameraScreenFrontHintLabelTextColor,cameraScreenFrontHintLabelBackground:p==null?void 0:p.cameraScreenFrontHintLabelBackgroundColor,cameraScreenStrokeNormal:p==null?void 0:p.cameraScreenStrokeNormalColor,cameraScreenStrokeActiveColor:p==null?void 0:p.cameraScreenStrokeActiveColor,cameraScreenSectorTarget:p==null?void 0:p.cameraScreenSectorTargetColor,cameraScreenSectorActive:p==null?void 0:p.cameraScreenSectorActiveColor,processingScreenProgress:p==null?void 0:p.processingScreenProgressColor,successScreenImage:et(p==null?void 0:p.successScreenImage,g,h),successScreenBackgroundColor:p==null?void 0:p.successScreenBackgroundColor,infoScreenErrorCodeColor:p==null?void 0:p.infoScreenErrorCodeColor,infoScreenErrorCodeTextFontSize:p==null?void 0:p.infoScreenErrorCodeTextFontSize,retryScreenPersonImage:et(p==null?void 0:p.retryScreenHintSubject,g,h),retryScreenEnvironmentImage:et(p==null?void 0:p.retryScreenHintEnvironment,g,h),onboardingScreenStartButtonBackgroundHover:p==null?void 0:p.onboardingScreenStartButtonBackgroundHover,onboardingScreenStartButtonTitleHover:p==null?void 0:p.onboardingScreenStartButtonTitleHover,retryScreenRetryButtonTitleHover:p==null?void 0:p.retryScreenRetryButtonTitleHover,retryScreenRetryButtonBackgroundHover:p==null?void 0:p.retryScreenRetryButtonBackgroundHover,infoScreenRetryButtonBackgroundHover:p==null?void 0:p.infoScreenRetryButtonBackgroundHover,infoScreenRetryButtonTitleHover:p==null?void 0:p.infoScreenRetryButtonTitleHover},v=Ze({url:f,tag:u,retryCount:c==null?void 0:c.attemptsCount,changeCamera:(t=c==null?void 0:c.cameraSwitchEnabled)==null?!1:t,cameraId:c==null?void 0:c.cameraId,detectOcclusion:c==null?void 0:c.detectOcclusion,metadata:(n=c==null?void 0:c.metadata)==null?{}:n,rotationAngle:c==null?void 0:c.cameraRotationAngle,workerPath:c==null?void 0:c.workerPath,customization:Ze(_),nonce:(r=this.props)==null?void 0:r.nonce}),y=c==null?void 0:c.recordingProcess,b=y&&y in Lm?Lm[y]:Lm.SYNCHRONOUS_UPLOAD,x=(i=c==null?void 0:c.type)==null?`ACTIVE`:i,S=x===`BLINK`?rh.ACTIVE:rh[x],C=Je(Je({},m&&typeof m==`string`?{locale:m.slice(0,2).toLowerCase()}:{}),{},{recordingProcess:b,livenessType:S,startScreen:!(!(c==null||(a=c.skipSteps)==null)&&a.includes(`ONBOARDING_STEP`)),copyright:(o=(s=c==null?void 0:c.copyright)==null?l:s)==null?!0:o,headers:Je({Authorization:`Connection ${d}`},c==null?void 0:c.headers),closeDisabled:typeof(c==null?void 0:c.closeButtonEnabled)==`boolean`?!c.closeButtonEnabled:!1});return Je(Je({},v),C)}_setFaceLivenessProps(){if(!this.props||!this._component)return;console.info(`%cFace Liveness web component version: %s`,`color: #6e56b0;`,this._component.version);let{serviceURL:e,customization:t,preloadAssetsRequired:n,failedAssets:r}=this.props.moduleProps;if(!e||!rw(e)){let e=new ut({errorCode:ot.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new lt({errorCode:at.LIVENESS_ERROR,underlyingBaseError:e});this.props.perform(t)}c(this.shadowRoot,[...this.shadowRoot.adoptedStyleSheets,...this._prepareCustomizationStyles(t,n,r)]),this._component.settings=this._prepareSettings(this.props.moduleProps),this._component.translations=this._prepareTranslations(this.props.moduleProps)}updated(e){e.has(`props`)&&this._setFaceLivenessProps()}render(){return de`<face-liveness @face-liveness="${this._handleFaceLiveness}"></face-liveness>`}},lw.styles=[ow],lw);cw([ft(),sw(`design:type`,Object)],uw.prototype,`props`,void 0),cw([mt(`face-liveness`),sw(`design:type`,Object)],uw.prototype,`_component`,void 0),uw=cw([dt(`face-liveness-verification`)],uw);var dw,fw=!1,pw=class extends Me{constructor(...e){super(...e),this.props=null,this.renderVersion=0}setProps(e){let t=e.moduleProps.failedAssets;if(t&&t.blockingAssets.size>0){var n;let r=new lt({errorCode:at.IMAGE_LOADING_FAILED,message:`Failed to load image asset${t.blockingAssets.size>1?`s`:``}: ${[...t.blockingAssets].join(`, `)}`});(n=e.perform)==null||n.call(e,r)}this.renderVersion++,this.props=e}static isReady(){return fw}static initialize(e){fw=!0}static deinitialize(){fw=!1}render(){return de`${He(this.renderVersion,de`<face-liveness-verification .props=${this.props}></face-liveness-verification>`)}`}};return dw=pw,dw.getSupportedTemplates=()=>[rt.LIVENESS],dw.getIdentifier=()=>it,dw.displayName=it,cw([Ie({attribute:!1}),sw(`design:type`,Object)],pw.prototype,`props`,void 0),cw([Ie({attribute:!1}),sw(`design:type`,Object)],pw.prototype,`renderVersion`,void 0),Xe(it,pw),e.FaceIdv=pw,e})({});
242
+ `)}return r}_prepareTranslations(e){let{locale:t,localizationKeys:n}=e,r=t&&typeof t==`string`?t.slice(0,2).toLowerCase():``;return!r||!n?null:iw({translationKeysData:aw,translationKeysProps:n,locale:r})}_prepareSettings(e){var t,n,r,i,a,o,s;let{config:c,copyright:l,sessionId:u,serviceToken:d,serviceURL:f,customization:p,locale:m,failedAssets:h,preloadAssetsRequired:g}=e,_={onboardingScreenBackgroundColor:p==null?void 0:p.onboardingScreenBackgroundColor,onboardingScreenStartButtonBackground:p==null?void 0:p.onboardingScreenStartButtonBackgroundColor,onboardingScreenIllumination:et(p==null?void 0:p.onboardingScreenIllumination,g,h),onboardingScreenAccessories:et(p==null?void 0:p.onboardingScreenAccessories,g,h),onboardingScreenCameraLevel:et(p==null?void 0:p.onboardingScreenCameraLevel,g,h),cameraScreenFrontHintLabelText:p==null?void 0:p.cameraScreenFrontHintLabelTextColor,cameraScreenFrontHintLabelBackground:p==null?void 0:p.cameraScreenFrontHintLabelBackgroundColor,cameraScreenStrokeNormal:p==null?void 0:p.cameraScreenStrokeNormalColor,cameraScreenStrokeActiveColor:p==null?void 0:p.cameraScreenStrokeActiveColor,cameraScreenSectorTarget:p==null?void 0:p.cameraScreenSectorTargetColor,cameraScreenSectorActive:p==null?void 0:p.cameraScreenSectorActiveColor,processingScreenProgress:p==null?void 0:p.processingScreenProgressColor,successScreenImage:et(p==null?void 0:p.successScreenImage,g,h),successScreenBackgroundColor:p==null?void 0:p.successScreenBackgroundColor,infoScreenErrorCodeColor:p==null?void 0:p.infoScreenErrorCodeColor,infoScreenErrorCodeTextFontSize:p==null?void 0:p.infoScreenErrorCodeTextFontSize,retryScreenPersonImage:et(p==null?void 0:p.retryScreenHintSubject,g,h),retryScreenEnvironmentImage:et(p==null?void 0:p.retryScreenHintEnvironment,g,h),onboardingScreenStartButtonBackgroundHover:p==null?void 0:p.onboardingScreenStartButtonBackgroundHover,onboardingScreenStartButtonTitleHover:p==null?void 0:p.onboardingScreenStartButtonTitleHover,retryScreenRetryButtonTitleHover:p==null?void 0:p.retryScreenRetryButtonTitleHover,retryScreenRetryButtonBackgroundHover:p==null?void 0:p.retryScreenRetryButtonBackgroundHover,infoScreenRetryButtonBackgroundHover:p==null?void 0:p.infoScreenRetryButtonBackgroundHover,infoScreenRetryButtonTitleHover:p==null?void 0:p.infoScreenRetryButtonTitleHover},v=Ze({url:f,tag:u,retryCount:c==null?void 0:c.attemptsCount,changeCamera:(t=c==null?void 0:c.cameraSwitchEnabled)==null?!1:t,cameraId:c==null?void 0:c.cameraId,detectOcclusion:c==null?void 0:c.detectOcclusion,metadata:(n=c==null?void 0:c.metadata)==null?{}:n,rotationAngle:c==null?void 0:c.cameraRotationAngle,workerPath:c==null?void 0:c.workerPath,customization:Ze(_),nonce:(r=this.props)==null?void 0:r.nonce}),y=c==null?void 0:c.recordingProcess,b=y&&y in Lm?Lm[y]:Lm.SYNCHRONOUS_UPLOAD,x=(i=c==null?void 0:c.type)==null?`ACTIVE`:i,S=x===`BLINK`?rh.ACTIVE:rh[x],C=Je(Je({},m&&typeof m==`string`?{locale:m.slice(0,2).toLowerCase()}:{}),{},{recordingProcess:b,livenessType:S,startScreen:!(!(c==null||(a=c.skipSteps)==null)&&a.includes(`ONBOARDING_STEP`)),copyright:(o=(s=c==null?void 0:c.copyright)==null?l:s)==null?!0:o,headers:Je({Authorization:`Connection ${d}`},c==null?void 0:c.headers),closeDisabled:typeof(c==null?void 0:c.closeButtonEnabled)==`boolean`?!c.closeButtonEnabled:!1});return Je(Je({},v),C)}_setFaceLivenessProps(){if(!this.props||!this._component)return;console.info(`%cFace Liveness web component version: %s`,`color: #6e56b0;`,this._component.version);let{serviceURL:e,customization:t,preloadAssetsRequired:n,failedAssets:r}=this.props.moduleProps;if(!e||!rw(e)){let e=new ut({errorCode:ot.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new lt({errorCode:at.LIVENESS_ERROR,underlyingBaseError:e});this.props.perform(t)}c(this.shadowRoot,[...this.shadowRoot.adoptedStyleSheets,...this._prepareCustomizationStyles(t,n,r)]),this._component.settings=this._prepareSettings(this.props.moduleProps),this._component.translations=this._prepareTranslations(this.props.moduleProps)}updated(e){e.has(`props`)&&this._setFaceLivenessProps()}render(){return de`<face-liveness @face-liveness="${this._handleFaceLiveness}"></face-liveness>`}},lw.styles=[ow],lw);cw([ft(),sw(`design:type`,Object)],uw.prototype,`props`,void 0),cw([mt(`face-liveness`),sw(`design:type`,Object)],uw.prototype,`_component`,void 0),uw=cw([dt(`face-liveness-verification`)],uw);var dw,fw=!1,pw=class extends Me{constructor(...e){super(...e),this.props=null,this.renderVersion=0}setProps(e){let t=e.moduleProps.failedAssets;if(t&&t.blockingAssets.size>0){var n;let r=new lt({errorCode:at.IMAGE_LOADING_FAILED,message:`Failed to load image asset${t.blockingAssets.size>1?`s`:``}: ${[...t.blockingAssets].join(`, `)}`});(n=e.perform)==null||n.call(e,r)}this.renderVersion++,this.props=e}static isReady(){return fw}static initialize(e){fw=!0}static deinitialize(){fw=!1}render(){return de`${He(this.renderVersion,de`<face-liveness-verification .props=${this.props}></face-liveness-verification>`)}`}};return dw=pw,dw.getSupportedTemplates=()=>[rt.LIVENESS],dw.getIdentifier=()=>it,dw.displayName=it,cw([Ie({attribute:!1}),sw(`design:type`,Object)],pw.prototype,`props`,void 0),cw([Ie({attribute:!1}),sw(`design:type`,Object)],pw.prototype,`renderVersion`,void 0),Xe(it,pw),e.FaceIdv=pw,e})({});
package/dist/main.js CHANGED
@@ -15011,7 +15011,6 @@ var cw, lw = (cw = class extends je {
15011
15011
  _prepareSettings(e) {
15012
15012
  var t, n, r, i, a, o, s;
15013
15013
  let { config: c, copyright: l, sessionId: u, serviceToken: d, serviceURL: f, customization: p, locale: m, failedAssets: h, preloadAssetsRequired: g } = e, _ = {
15014
- fontFamily: p == null ? void 0 : p.fontFamily,
15015
15014
  onboardingScreenBackgroundColor: p == null ? void 0 : p.onboardingScreenBackgroundColor,
15016
15015
  onboardingScreenStartButtonBackground: p == null ? void 0 : p.onboardingScreenStartButtonBackgroundColor,
15017
15016
  onboardingScreenIllumination: $e(p == null ? void 0 : p.onboardingScreenIllumination, g, h),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@regulaforensics/idv-face",
3
- "version": "3.9.494-nightly",
3
+ "version": "3.9.496-rc",
4
4
  "description": "Regula framework agnostic web components to work with face idv",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/main.js",