@regulaforensics/idv-document 3.10.548-nightly → 3.10.549-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 +46 -5
- package/dist/main.iife.js +2 -6
- package/dist/main.js +5 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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 { InternalScenarios } from '@regulaforensics/vp-frontend-document-components';
|
|
6
2
|
import { LitElement } from 'lit';
|
|
7
3
|
import { MirrorType } from '@regulaforensics/vp-frontend-document-components';
|
|
8
4
|
import { ModuleType as ModuleType_2 } from '@regulaforensics/vp-frontend-document-components';
|
|
9
5
|
import { TemplateResult } from 'lit-html';
|
|
10
6
|
|
|
7
|
+
declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
|
|
8
|
+
abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
|
|
9
|
+
abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
|
|
10
|
+
}
|
|
11
|
+
|
|
11
12
|
declare type DocumentGalleryProps = {
|
|
12
13
|
processParam?: {
|
|
13
14
|
multipageProcessing?: boolean;
|
|
@@ -101,7 +102,6 @@ declare type DocumentReaderProps = {
|
|
|
101
102
|
};
|
|
102
103
|
localizationKeys?: Record<string, string>;
|
|
103
104
|
customization?: {
|
|
104
|
-
fontFamily?: string;
|
|
105
105
|
cameraFrameWidthOffset?: number;
|
|
106
106
|
backgroundMaskAlpha?: number;
|
|
107
107
|
backgroundMaskColor?: string;
|
|
@@ -161,9 +161,50 @@ declare type DocumentReaderProps = {
|
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
declare type FailedAssets = {
|
|
165
|
+
imageURL: Set<string>;
|
|
166
|
+
base64: Set<string>;
|
|
167
|
+
blockingAssets: Set<string>;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
declare type IdvAsset = {
|
|
171
|
+
idvAsset: ImageLike;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
|
|
175
|
+
isProcessing?: (isProcessing: boolean) => void;
|
|
176
|
+
moduleProps: TModuleProps;
|
|
177
|
+
modulesConfig?: TModulesConfig;
|
|
178
|
+
perform: (data: any, type?: PerformType) => void;
|
|
179
|
+
idvEventListener: (module: string, data: any) => void;
|
|
180
|
+
nonce?: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
declare type ImageBase = {
|
|
184
|
+
imageURL?: string;
|
|
185
|
+
imageId?: string;
|
|
186
|
+
base64?: string;
|
|
187
|
+
prepareRequired?: boolean;
|
|
188
|
+
failurePolicy?: ImageFailurePolicy;
|
|
189
|
+
timeout?: number;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare type ImageFailurePolicy = 'ignore' | 'placeholderImage' | 'error';
|
|
193
|
+
|
|
194
|
+
declare type ImageLike = ImageBase & {
|
|
195
|
+
placeholderImage?: ImageLike;
|
|
196
|
+
};
|
|
197
|
+
|
|
164
198
|
export declare enum ModuleType {
|
|
165
199
|
BarcodeMRZ = "BarcodeMRZ",
|
|
166
200
|
BoundsLite = "BoundsLite"
|
|
167
201
|
}
|
|
168
202
|
|
|
203
|
+
declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
|
|
204
|
+
|
|
205
|
+
declare const PerformTypes: {
|
|
206
|
+
readonly FORM: "form";
|
|
207
|
+
readonly DATA: "data";
|
|
208
|
+
};
|
|
209
|
+
|
|
169
210
|
export { }
|
package/dist/main.iife.js
CHANGED
|
@@ -57,11 +57,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
57
57
|
width: 100%;
|
|
58
58
|
height: 100%;
|
|
59
59
|
}
|
|
60
|
-
`;function MB(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function NB(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var PB,FB=(PB=class extends Ne{constructor(...e){super(...e),this._performType=Jz.DATA,this.props=null,this._handleDocumentReader=e=>{var t,n,r,i;if((t=this.props)==null||(n=t.idvEventListener)==null||n.call(t,`IDV-DOCUMENT`,e.detail.action),e.detail.action===W.CAMERA_PROCESS_STARTED&&(r=this.props)!=null&&r.isProcessing&&this.props.isProcessing(!1),e.detail.action===W.PROCESS_FINISHED){var a,o,s,c,l;if(((a=e.detail.data)==null?void 0:a.status)===ap.ERROR){var u;let t={transactionId:``,cancel:!1,has_nfc:!1,errorCode:e.detail.data.reason};(u=this.props)==null||u.perform(t,this._performType)}let t=(o=e.detail.data)==null?void 0:o.status,n=t===ap.OK,r=t===ap.TIMEOUT;if(!(n||r)||!((s=e.detail.data)!=null&&s.response))return;(c=this.props)!=null&&c.isProcessing&&this.props.isProcessing(!0);let i=(l=this.props)==null||(l=l.moduleProps)==null?void 0:l.finalizePackageSettings;bB(()=>window.RegulaDocumentSDK.finalizePackage(),i==null?void 0:i.retryCount,i==null?void 0:i.retryDelay).then(e=>{var t;let n={transactionId:(e==null?void 0:e.transactionId)||``,cancel:!1,has_nfc:!1,errorCode:``};(t=this.props)==null||t.perform(n,this._performType)}).catch(e=>{var t;console.log(`finalizePackage error: `,e),(t=this.props)==null||t.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)})}if(((i=e.detail)==null?void 0:i.action)===W.CLOSE||e.detail.action===W.CAMERA_PROCESS_CLOSED){var d;(d=this.props)==null||d.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}}}_prepareCustomizationStyles(e,t,n){let r=[];if(e!=null&&e.
|
|
61
|
-
document-reader::part(container) {
|
|
62
|
-
font-family: ${o(e.fontFamily)};
|
|
63
|
-
}
|
|
64
|
-
`),e!=null&&e.backgroundMaskColor&&r.push(s`
|
|
60
|
+
`;function MB(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}function NB(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var PB,FB=(PB=class extends Ne{constructor(...e){super(...e),this._performType=Jz.DATA,this.props=null,this._handleDocumentReader=e=>{var t,n,r,i;if((t=this.props)==null||(n=t.idvEventListener)==null||n.call(t,`IDV-DOCUMENT`,e.detail.action),e.detail.action===W.CAMERA_PROCESS_STARTED&&(r=this.props)!=null&&r.isProcessing&&this.props.isProcessing(!1),e.detail.action===W.PROCESS_FINISHED){var a,o,s,c,l;if(((a=e.detail.data)==null?void 0:a.status)===ap.ERROR){var u;let t={transactionId:``,cancel:!1,has_nfc:!1,errorCode:e.detail.data.reason};(u=this.props)==null||u.perform(t,this._performType)}let t=(o=e.detail.data)==null?void 0:o.status,n=t===ap.OK,r=t===ap.TIMEOUT;if(!(n||r)||!((s=e.detail.data)!=null&&s.response))return;(c=this.props)!=null&&c.isProcessing&&this.props.isProcessing(!0);let i=(l=this.props)==null||(l=l.moduleProps)==null?void 0:l.finalizePackageSettings;bB(()=>window.RegulaDocumentSDK.finalizePackage(),i==null?void 0:i.retryCount,i==null?void 0:i.retryDelay).then(e=>{var t;let n={transactionId:(e==null?void 0:e.transactionId)||``,cancel:!1,has_nfc:!1,errorCode:``};(t=this.props)==null||t.perform(n,this._performType)}).catch(e=>{var t;console.log(`finalizePackage error: `,e),(t=this.props)==null||t.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)})}if(((i=e.detail)==null?void 0:i.action)===W.CLOSE||e.detail.action===W.CAMERA_PROCESS_CLOSED){var d;(d=this.props)==null||d.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}}}_prepareCustomizationStyles(e,t,n){let r=[];if(e!=null&&e.backgroundMaskColor&&r.push(s`
|
|
65
61
|
document-reader::part(frame-external-background) {
|
|
66
62
|
fill: ${o(e.backgroundMaskColor)};
|
|
67
63
|
}
|
|
@@ -277,7 +273,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
277
273
|
d="M93.1547 5.85404C92.7965 5.24412 91.9727 4.77991 90.8981 4.77991C89.0174 4.77991 87.459 6.35794 87.459 8.38431C87.459 10.3925 89.0174 11.9336 90.8981 11.9336C91.9191 11.9336 92.5637 11.6287 93.0651 10.9996V11.6455C93.0651 13.0442 92.08 13.5462 91.1308 13.5462C90.1816 13.5462 89.4292 13.0792 89.286 12.0578H87.7099C87.7818 13.8512 89.2142 15 91.1308 15C93.0474 15 94.6758 13.9063 94.6758 11.539V4.83175H93.1547V5.85404ZM91.0772 10.3911C89.9307 10.3911 89.1069 9.54811 89.1069 8.38291C89.1069 7.21772 89.9307 6.32058 91.0772 6.32058C92.2237 6.32058 93.0651 7.21725 93.0651 8.38291C93.0651 9.54858 92.2232 10.3911 91.0772 10.3911Z"
|
|
278
274
|
fill="#BD7DFF"
|
|
279
275
|
/>
|
|
280
|
-
</svg>`,VB,HB=(VB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=Jz.DATA,this.props=null,this._handleInputChange=function(){var e=d(function*(e){var n,r,i;let a=[...(n=e.target.files)==null?[]:n];if(!a.length)return;(r=t.props)!=null&&r.isProcessing&&t.props.isProcessing(!0),yield window.RegulaDocumentSDK.createBackendTransaction({},window.RegulaDocumentSDK.recognizerProcessParam);for(let e of a){let{isExtraLargeResolution:n,isDownscaleNeeded:r}=yield TB(e,oB,sB,cB),i=e.type.startsWith(`image/webp`);if(n){var o;(o=t.props)==null||o.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_RESOLUTION_EXCEEDS_LIMIT`},t._performType);return}let a;if(r||i){let n=yield DB(e,oB,sB);if(!n.ok){var s;let e={transactionId:``,cancel:!1,has_nfc:!1,errorCode:r?`IMAGE_DOWNSCALING_ERROR`:`IMAGE_PROCESSING_ERROR`};(s=t.props)==null||s.perform(e,t._performType);return}a=[n.imageData]}else a=[yield e.arrayBuffer()];try{yield window.RegulaDocumentSDK.processImage(a)}catch(e){var c;(c=t.props)==null||c.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_PROCESSING_ERROR`},t._performType)}}let l=(i=t.props)==null||(i=i.moduleProps)==null?void 0:i.finalizePackageSettings;try{var u;let e=yield bB(d(function*(){return window.RegulaDocumentSDK.finalizePackage()}),l==null?void 0:l.retryCount,l==null?void 0:l.retryDelay),n={transactionId:e==null?void 0:e.transactionId,cancel:!1,has_nfc:!1,errorCode:``};(u=t.props)==null||u.perform(n,t._performType)}catch(e){var
|
|
276
|
+
</svg>`,VB,HB=(VB=class extends Ne{constructor(...e){var t;super(...e),t=this,this._performType=Jz.DATA,this.props=null,this._handleInputChange=function(){var e=d(function*(e){var n,r,i;let a=[...(n=e.target.files)==null?[]:n];if(!a.length)return;(r=t.props)!=null&&r.isProcessing&&t.props.isProcessing(!0),yield window.RegulaDocumentSDK.createBackendTransaction({},window.RegulaDocumentSDK.recognizerProcessParam);for(let e of a){let{isExtraLargeResolution:n,isDownscaleNeeded:r}=yield TB(e,oB,sB,cB),i=e.type.startsWith(`image/webp`);if(n){var o;(o=t.props)==null||o.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_RESOLUTION_EXCEEDS_LIMIT`},t._performType);return}let a;if(r||i){let n=yield DB(e,oB,sB);if(!n.ok){var s;let e={transactionId:``,cancel:!1,has_nfc:!1,errorCode:r?`IMAGE_DOWNSCALING_ERROR`:`IMAGE_PROCESSING_ERROR`};(s=t.props)==null||s.perform(e,t._performType);return}a=[n.imageData]}else a=[yield e.arrayBuffer()];try{yield window.RegulaDocumentSDK.processImage(a)}catch(e){var c;(c=t.props)==null||c.perform({transactionId:``,cancel:!1,has_nfc:!1,errorCode:`IMAGE_PROCESSING_ERROR`},t._performType)}}let l=(i=t.props)==null||(i=i.moduleProps)==null?void 0:i.finalizePackageSettings;try{var u,f;let e=yield bB(d(function*(){return window.RegulaDocumentSDK.finalizePackage()}),l==null?void 0:l.retryCount,l==null?void 0:l.retryDelay),n={transactionId:e==null?void 0:e.transactionId,cancel:!1,has_nfc:!1,errorCode:``};(u=t.props)==null||u.perform(n,t._performType),(f=t.props)!=null&&f.isProcessing&&t.props.isProcessing(!1)}catch(e){var p;console.log(`finalizePackage error: `,e),(p=t.props)==null||p.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},t._performType)}});return function(t){return e.apply(this,arguments)}}()}_handleUploadClick(){this._input.click()}_handleCloseClick(){var e;(e=this.props)==null||e.perform({transactionId:``,cancel:!0,has_nfc:!1,errorCode:``},this._performType)}_setDocReaderGalleryProps(){var e;if(!this.props)return;let{processParam:t,sessionId:n,serviceToken:r,selectionLimit:i}=this.props.moduleProps;this._input.multiple=typeof i==`number`&&(i===0||i>1);let a=SB(t),o=a==null||(e=a.backendProcessing)==null?void 0:e.serviceURL;if(!o||!CB(o)){let e=new pB({errorCode:tB.CONFIGURATION_FAILED,message:`serviceURL is not defined or is invalid.`}),t=new fB({errorCode:eB.SCAN_ERROR,underlyingBaseError:e});this.props.perform(t)}r&&a!=null&&a.backendProcessing&&(a.backendProcessing.httpHeaders={Authorization:`Connection ${r}`});let s={processParam:Wz({},a)};n&&(s.tag=n),window.RegulaDocumentSDK.recognizerProcessParam=s,window.RegulaDocumentSDK.imageProcessParam={processParam:{scenario:_f.MrzAndLocate}}}updated(e){e.has(`props`)&&this._setDocReaderGalleryProps()}render(){var e,t;let n=(e=this.props)==null?void 0:e.moduleProps.locale;return de`<div
|
|
281
277
|
part="gallery-root"
|
|
282
278
|
class="gallery-root"
|
|
283
279
|
dir="${Xz(n)}"
|
package/dist/main.js
CHANGED
|
@@ -21295,11 +21295,7 @@ var NB, PB = (NB = class extends Me {
|
|
|
21295
21295
|
}
|
|
21296
21296
|
_prepareCustomizationStyles(e, t, n) {
|
|
21297
21297
|
let r = [];
|
|
21298
|
-
if (e != null && e.
|
|
21299
|
-
document-reader::part(container) {
|
|
21300
|
-
font-family: ${a(e.fontFamily)};
|
|
21301
|
-
}
|
|
21302
|
-
`), e != null && e.backgroundMaskColor && r.push(o`
|
|
21298
|
+
if (e != null && e.backgroundMaskColor && r.push(o`
|
|
21303
21299
|
document-reader::part(frame-external-background) {
|
|
21304
21300
|
fill: ${a(e.backgroundMaskColor)};
|
|
21305
21301
|
}
|
|
@@ -21686,7 +21682,7 @@ var FB = (e) => e == null ? z : e, IB = o`
|
|
|
21686
21682
|
}
|
|
21687
21683
|
let l = (i = t.props) == null || (i = i.moduleProps) == null ? void 0 : i.finalizePackageSettings;
|
|
21688
21684
|
try {
|
|
21689
|
-
var d;
|
|
21685
|
+
var d, f;
|
|
21690
21686
|
let e = yield yB(u(function* () {
|
|
21691
21687
|
return window.RegulaDocumentSDK.finalizePackage();
|
|
21692
21688
|
}), l == null ? void 0 : l.retryCount, l == null ? void 0 : l.retryDelay), n = {
|
|
@@ -21695,10 +21691,10 @@ var FB = (e) => e == null ? z : e, IB = o`
|
|
|
21695
21691
|
has_nfc: !1,
|
|
21696
21692
|
errorCode: ""
|
|
21697
21693
|
};
|
|
21698
|
-
(d = t.props) == null || d.perform(n, t._performType);
|
|
21694
|
+
(d = t.props) == null || d.perform(n, t._performType), (f = t.props) != null && f.isProcessing && t.props.isProcessing(!1);
|
|
21699
21695
|
} catch (e) {
|
|
21700
|
-
var
|
|
21701
|
-
console.log("finalizePackage error: ", e), (
|
|
21696
|
+
var p;
|
|
21697
|
+
console.log("finalizePackage error: ", e), (p = t.props) == null || p.perform({
|
|
21702
21698
|
transactionId: "",
|
|
21703
21699
|
cancel: !0,
|
|
21704
21700
|
has_nfc: !1,
|
package/package.json
CHANGED