onfido-sdk-ui 14.44.0 → 14.45.1

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/LICENSE CHANGED
@@ -10,7 +10,7 @@ at https://documentation.onfido.com/sdk/sdk-licenses/.
10
10
  ------------------
11
11
 
12
12
  Name: @onfido/capture-shared
13
- Version: 2.15.18
13
+ Version: 2.16.1
14
14
  License: null
15
15
  Private: false
16
16
  Description: A shared library to use in various capture packages
package/Onfido.iife.js CHANGED
@@ -1 +1 @@
1
- var f=Object.defineProperty;var L=(s,r,d)=>r in s?f(s,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[r]=d;var h=(s,r,d)=>(L(s,typeof r!="symbol"?r+"":r,d),d);(function(s){"use strict";class r{constructor(){this.eventListener={}}addEventListener(i,e){return this.eventListener[i]=this.eventListener[i]||[],this.eventListener[i].push(e),this}removeEventListener(i,e){const n=this.eventListener[i];if(n){let o;for(;(o=n.indexOf(e))!==-1;)n.splice(o,1)}}trigger(i,e){(this.eventListener[i]||[]).forEach(n=>{n(e)})}}const d="v14";class v extends r{constructor(){super(...arguments);h(this,"_handle");h(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(n=>n(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([n,o])=>{e.addEventListener(n,o)}),this.eventListener={}}addEventListener(e,n){return this._handle?(this._handle.addEventListener(e,n),this):super.addEventListener(e,n)}removeEventListener(e,n){if(this._handle)return this._handle.removeEventListener(e,n),this;super.removeEventListener(e,n)}async tearDown(){var e;if(this._handle)await((e=this._handle)==null?void 0:e.tearDown());else return this._handleSetCallbacks.push(()=>{this.tearDown()}),Promise.resolve()}get version(){var e;return(e=this._handle)==null?void 0:e.version}}const l=t=>`v${(t||d).replace(/^v/,"")}`,c={init(t){const i=new v;return import(/* webpackIgnore: true */ /* @vite-ignore */ t.sdkUrl||`https://sdk.onfido.com/${l(t.version)}/Onfido.js`).then(n=>{const{Onfido:o}=n;i._setHandle(o.init(t))}).catch(n=>{var o;i.trigger("error",{error:n}),(o=t.onError)==null||o.call(t,n)}),i}};Object.defineProperty(c,"environment",{get:()=>window==null?void 0:window.Onfido.environment,set:t=>{window.Onfido=window.Onfido||{},window.Onfido.environment=t}});const a=c;s.Onfido=a,s.prefixVersion=l,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})})(this.window=this.window||{});
1
+ var f=Object.defineProperty;var L=(s,o,d)=>o in s?f(s,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[o]=d;var h=(s,o,d)=>(L(s,typeof o!="symbol"?o+"":o,d),d);(function(s){"use strict";class o{constructor(){this.eventListener={}}addEventListener(i,e){return this.eventListener[i]=this.eventListener[i]||[],this.eventListener[i].push(e),this}removeEventListener(i,e){const n=this.eventListener[i];if(n){let r;for(;(r=n.indexOf(e))!==-1;)n.splice(r,1)}}trigger(i,e){(this.eventListener[i]||[]).forEach(n=>{n==null||n(e)})}}const d="v14";class c extends o{constructor(){super(...arguments);h(this,"_handle");h(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(n=>n(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([n,r])=>{e.addEventListener(n,r)}),this.eventListener={}}addEventListener(e,n){return this._handle?(this._handle.addEventListener(e,n),this):super.addEventListener(e,n)}removeEventListener(e,n){if(this._handle)return this._handle.removeEventListener(e,n),this;super.removeEventListener(e,n)}async tearDown(){var e;if(this._handle)await((e=this._handle)==null?void 0:e.tearDown());else return this._handleSetCallbacks.push(()=>{this.tearDown()}),Promise.resolve()}get version(){var e;return(e=this._handle)==null?void 0:e.version}}const l=t=>`v${(t||d).replace(/^v/,"")}`,v={init(t){const i=new c;return import(/* webpackIgnore: true */ /* @vite-ignore */ t.sdkUrl||`https://sdk.onfido.com/${l(t.version)}/Onfido.js`).then(n=>{const{Onfido:r}=n;i._setHandle(r.init(t))}).catch(n=>{var r;i.trigger("error",{error:n}),(r=t.onError)==null||r.call(t,n)}),i}};Object.defineProperty(v,"environment",{get:()=>window==null?void 0:window.Onfido.environment,set:t=>{window.Onfido=window.Onfido||{},window.Onfido.environment=t}});const a=v;s.Onfido=a,s.prefixVersion=l,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})})(this.window=this.window||{});
package/Onfido.js CHANGED
@@ -1,24 +1,24 @@
1
1
  var d = Object.defineProperty;
2
- var h = (i, n, e) => n in i ? d(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
3
- var r = (i, n, e) => (h(i, typeof n != "symbol" ? n + "" : n, e), e);
2
+ var h = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var r = (i, t, e) => (h(i, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  class l {
5
5
  constructor() {
6
6
  this.eventListener = {};
7
7
  }
8
- addEventListener(n, e) {
9
- return this.eventListener[n] = this.eventListener[n] || [], this.eventListener[n].push(e), this;
8
+ addEventListener(t, e) {
9
+ return this.eventListener[t] = this.eventListener[t] || [], this.eventListener[t].push(e), this;
10
10
  }
11
- removeEventListener(n, e) {
12
- const t = this.eventListener[n];
13
- if (t) {
11
+ removeEventListener(t, e) {
12
+ const n = this.eventListener[t];
13
+ if (n) {
14
14
  let s;
15
- for (; (s = t.indexOf(e)) !== -1; )
16
- t.splice(s, 1);
15
+ for (; (s = n.indexOf(e)) !== -1; )
16
+ n.splice(s, 1);
17
17
  }
18
18
  }
19
- trigger(n, e) {
20
- (this.eventListener[n] || []).forEach((t) => {
21
- t(e);
19
+ trigger(t, e) {
20
+ (this.eventListener[t] || []).forEach((n) => {
21
+ n == null || n(e);
22
22
  });
23
23
  }
24
24
  }
@@ -30,17 +30,17 @@ class c extends l {
30
30
  r(this, "_handleSetCallbacks", []);
31
31
  }
32
32
  _setHandle(e) {
33
- this._handle = e, this._handleSetCallbacks.forEach((t) => t(e)), this._handleSetCallbacks = [], Object.entries(this.eventListener).forEach(([t, s]) => {
34
- e.addEventListener(t, s);
33
+ this._handle = e, this._handleSetCallbacks.forEach((n) => n(e)), this._handleSetCallbacks = [], Object.entries(this.eventListener).forEach(([n, s]) => {
34
+ e.addEventListener(n, s);
35
35
  }), this.eventListener = {};
36
36
  }
37
- addEventListener(e, t) {
38
- return this._handle ? (this._handle.addEventListener(e, t), this) : super.addEventListener(e, t);
37
+ addEventListener(e, n) {
38
+ return this._handle ? (this._handle.addEventListener(e, n), this) : super.addEventListener(e, n);
39
39
  }
40
- removeEventListener(e, t) {
40
+ removeEventListener(e, n) {
41
41
  if (this._handle)
42
- return this._handle.removeEventListener(e, t), this;
43
- super.removeEventListener(e, t);
42
+ return this._handle.removeEventListener(e, n), this;
43
+ super.removeEventListener(e, n);
44
44
  }
45
45
  async tearDown() {
46
46
  var e;
@@ -58,14 +58,14 @@ class c extends l {
58
58
  }
59
59
  const a = (i) => `v${(i || v).replace(/^v/, "")}`, o = {
60
60
  init(i) {
61
- const n = new c();
62
- return import(/* webpackIgnore: true */ /* @vite-ignore */ i.sdkUrl || `https://sdk.onfido.com/${a(i.version)}/Onfido.js`).then((t) => {
63
- const { Onfido: s } = t;
64
- n._setHandle(s.init(i));
65
- }).catch((t) => {
61
+ const t = new c();
62
+ return import(/* webpackIgnore: true */ /* @vite-ignore */ i.sdkUrl || `https://sdk.onfido.com/${a(i.version)}/Onfido.js`).then((n) => {
63
+ const { Onfido: s } = n;
64
+ t._setHandle(s.init(i));
65
+ }).catch((n) => {
66
66
  var s;
67
- n.trigger("error", { error: t }), (s = i.onError) == null || s.call(i, t);
68
- }), n;
67
+ t.trigger("error", { error: n }), (s = i.onError) == null || s.call(i, n);
68
+ }), t;
69
69
  }
70
70
  };
71
71
  Object.defineProperty(o, "environment", {
package/Onfido.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(t,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis<"u"?globalThis:t||self,i(t.window=t.window||{}))})(this,function(t){"use strict";var a=Object.defineProperty;var u=(t,i,r)=>i in t?a(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r;var h=(t,i,r)=>(u(t,typeof i!="symbol"?i+"":i,r),r);class i{constructor(){this.eventListener={}}addEventListener(o,e){return this.eventListener[o]=this.eventListener[o]||[],this.eventListener[o].push(e),this}removeEventListener(o,e){const n=this.eventListener[o];if(n){let d;for(;(d=n.indexOf(e))!==-1;)n.splice(d,1)}}trigger(o,e){(this.eventListener[o]||[]).forEach(n=>{n(e)})}}const r="v14";class c extends i{constructor(){super(...arguments);h(this,"_handle");h(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(n=>n(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([n,d])=>{e.addEventListener(n,d)}),this.eventListener={}}addEventListener(e,n){return this._handle?(this._handle.addEventListener(e,n),this):super.addEventListener(e,n)}removeEventListener(e,n){if(this._handle)return this._handle.removeEventListener(e,n),this;super.removeEventListener(e,n)}async tearDown(){var e;if(this._handle)await((e=this._handle)==null?void 0:e.tearDown());else return this._handleSetCallbacks.push(()=>{this.tearDown()}),Promise.resolve()}get version(){var e;return(e=this._handle)==null?void 0:e.version}}const l=s=>`v${(s||r).replace(/^v/,"")}`,f={init(s){const o=new c;return import(/* webpackIgnore: true */ /* @vite-ignore */ s.sdkUrl||`https://sdk.onfido.com/${l(s.version)}/Onfido.js`).then(n=>{const{Onfido:d}=n;o._setHandle(d.init(s))}).catch(n=>{var d;o.trigger("error",{error:n}),(d=s.onError)==null||d.call(s,n)}),o}};Object.defineProperty(f,"environment",{get:()=>window==null?void 0:window.Onfido.environment,set:s=>{window.Onfido=window.Onfido||{},window.Onfido.environment=s}});const v=f;t.Onfido=v,t.prefixVersion=l,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(t,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(t=typeof globalThis<"u"?globalThis:t||self,i(t.window=t.window||{}))})(this,function(t){"use strict";var a=Object.defineProperty;var u=(t,i,r)=>i in t?a(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r;var h=(t,i,r)=>(u(t,typeof i!="symbol"?i+"":i,r),r);class i{constructor(){this.eventListener={}}addEventListener(o,e){return this.eventListener[o]=this.eventListener[o]||[],this.eventListener[o].push(e),this}removeEventListener(o,e){const n=this.eventListener[o];if(n){let d;for(;(d=n.indexOf(e))!==-1;)n.splice(d,1)}}trigger(o,e){(this.eventListener[o]||[]).forEach(n=>{n==null||n(e)})}}const r="v14";class c extends i{constructor(){super(...arguments);h(this,"_handle");h(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(n=>n(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([n,d])=>{e.addEventListener(n,d)}),this.eventListener={}}addEventListener(e,n){return this._handle?(this._handle.addEventListener(e,n),this):super.addEventListener(e,n)}removeEventListener(e,n){if(this._handle)return this._handle.removeEventListener(e,n),this;super.removeEventListener(e,n)}async tearDown(){var e;if(this._handle)await((e=this._handle)==null?void 0:e.tearDown());else return this._handleSetCallbacks.push(()=>{this.tearDown()}),Promise.resolve()}get version(){var e;return(e=this._handle)==null?void 0:e.version}}const l=s=>`v${(s||r).replace(/^v/,"")}`,f={init(s){const o=new c;return import(/* webpackIgnore: true */ /* @vite-ignore */ s.sdkUrl||`https://sdk.onfido.com/${l(s.version)}/Onfido.js`).then(n=>{const{Onfido:d}=n;o._setHandle(d.init(s))}).catch(n=>{var d;o.trigger("error",{error:n}),(d=s.onError)==null||d.call(s,n)}),o}};Object.defineProperty(f,"environment",{get:()=>window==null?void 0:window.Onfido.environment,set:s=>{window.Onfido=window.Onfido||{},window.Onfido.environment=s}});const v=f;t.Onfido=v,t.prefixVersion=l,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onfido-sdk-ui",
3
- "version": "14.44.0",
3
+ "version": "14.45.1",
4
4
  "description": "JavaScript SDK view layer for Onfido identity verification",
5
5
  "author": "Onfido Customer Support <support@onfido.com> (https://documentation.onfido.com/sdk/web/)",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "license": "SEE LICENSE in LICENSE",
11
11
  "main": "Onfido.js",
12
- "types": "types/index.d.ts",
12
+ "types": "types/loader.d.ts",
13
13
  "files": [
14
14
  "Onfido.*",
15
15
  "types"
package/types/loader.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { OnfidoApi } from './Onfido';
1
+ import type { SdkParameters } from './shared/SdkParameters';
2
+ import type { Handle, OnfidoApi } from './Onfido';
2
3
  export type LoaderParameter = {
3
4
  /**
4
5
  * The version of the sdk to be loaded, by default v14 is used, which
@@ -8,6 +9,7 @@ export type LoaderParameter = {
8
9
  version?: string;
9
10
  };
10
11
  export declare const prefixVersion: (version?: string) => string;
11
- export declare const Onfido: OnfidoApi & {
12
+ export declare const Onfido: Omit<OnfidoApi, 'init'> & {
13
+ init: (parameter: SdkParameters & LoaderParameter) => Handle;
12
14
  environment?: 'INSECURE';
13
15
  };
@@ -20,7 +20,7 @@ export type ModuleFinishOptions = {
20
20
  };
21
21
  export type ExecutorMethod = 'bootstrap' | 'ping' | 'start';
22
22
  export type CrossDeviceExecutorMethod = 'crossDevice.update' | 'crossDevice.abort';
23
- export type RunnerMethod = 'captureModule.finish' | 'captureModule.error' | 'captureModule.unsupported' | 'crossDevice.start' | 'crossDevice.preload' | 'crossDevice.verify' | 'crossDevice.abort' | 'crossDevice.refresh' | 'crossDevice.regenerate' | 'analytics.send' | 'analytics.userAnalytics' | 'navigation.back' | 'navigation.exit' | 'navigation.externalLink' | 'customCallback.invoke' | 'passkey.create' | 'passkey.get';
23
+ export type RunnerMethod = 'captureModule.finish' | 'captureModule.error' | 'captureModule.unsupported' | 'crossDevice.start' | 'crossDevice.preload' | 'crossDevice.verify' | 'crossDevice.abort' | 'crossDevice.refresh' | 'crossDevice.regenerate' | 'analytics.send' | 'analyticsV2.send' | 'analytics.userAnalytics' | 'navigation.back' | 'navigation.exit' | 'navigation.externalLink' | 'customCallback.invoke' | 'passkey.create' | 'passkey.get';
24
24
  export type Configuration<T = unknown> = {
25
25
  translations?: T;
26
26
  theme?: Theme;