onfido-sdk-ui 14.16.0 → 14.18.0

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/Onfido.iife.js CHANGED
@@ -1 +1 @@
1
- var v=Object.defineProperty;var L=(i,r,d)=>r in i?v(i,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[r]=d;var o=(i,r,d)=>(L(i,typeof r!="symbol"?r+"":r,d),d);(function(i){"use strict";class r{constructor(){this.eventListener={}}addEventListener(n,e){return this.eventListener[n]=this.eventListener[n]||[],this.eventListener[n].push(e),this}removeEventListener(n,e){const t=this.eventListener[n];if(t){let h;for(;(h=t.indexOf(e))!==-1;)t.splice(h,1)}}trigger(n,e){e.type=n,(this.eventListener[n]||[]).forEach(t=>{t(e)})}}const d="v14";class c extends r{constructor(){super(...arguments);o(this,"_handle");o(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(t=>t(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([t,h])=>{e.addEventListener(t,h)}),this.eventListener={}}addEventListener(e,t){return this._handle?(this._handle.addEventListener(e,t),this):super.addEventListener(e,t)}removeEventListener(e,t){if(this._handle)return this._handle.removeEventListener(e,t),this;super.removeEventListener(e,t)}tearDown(){var e;this._handle?(e=this._handle)==null||e.tearDown():this._handleSetCallbacks.push(()=>{this.tearDown()})}}const l=s=>`v${(s||d).replace(/^v/,"")}`,a={init(s){const n=new c;return import(/* webpackIgnore: true */ s.sdkUrl||`https://sdk.onfido.com/${l(s.version)}/Onfido.js`).then(t=>{const{Onfido:h}=t;n._setHandle(h.init(s))}).catch(t=>{var h;n.trigger("error",{error:t}),(h=s.onError)==null||h.call(s,t)}),n}};i.Onfido=a,i.prefixVersion=l,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})})(this.window=this.window||{});
1
+ var v=Object.defineProperty;var L=(i,r,d)=>r in i?v(i,r,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[r]=d;var o=(i,r,d)=>(L(i,typeof r!="symbol"?r+"":r,d),d);(function(i){"use strict";class r{constructor(){this.eventListener={}}addEventListener(n,e){return this.eventListener[n]=this.eventListener[n]||[],this.eventListener[n].push(e),this}removeEventListener(n,e){const t=this.eventListener[n];if(t){let h;for(;(h=t.indexOf(e))!==-1;)t.splice(h,1)}}trigger(n,e){e.type=n,(this.eventListener[n]||[]).forEach(t=>{t(e)})}}const d="v14";class c extends r{constructor(){super(...arguments);o(this,"_handle");o(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(t=>t(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([t,h])=>{e.addEventListener(t,h)}),this.eventListener={}}addEventListener(e,t){return this._handle?(this._handle.addEventListener(e,t),this):super.addEventListener(e,t)}removeEventListener(e,t){if(this._handle)return this._handle.removeEventListener(e,t),this;super.removeEventListener(e,t)}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()}}const l=s=>`v${(s||d).replace(/^v/,"")}`,a={init(s){const n=new c;return import(/* webpackIgnore: true */ s.sdkUrl||`https://sdk.onfido.com/${l(s.version)}/Onfido.js`).then(t=>{const{Onfido:h}=t;n._setHandle(h.init(s))}).catch(t=>{var h;n.trigger("error",{error:t}),(h=s.onError)==null||h.call(s,t)}),n}};i.Onfido=a,i.prefixVersion=l,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})})(this.window=this.window||{});
package/Onfido.js CHANGED
@@ -42,17 +42,20 @@ class c extends o {
42
42
  return this._handle.removeEventListener(e, n), this;
43
43
  super.removeEventListener(e, n);
44
44
  }
45
- tearDown() {
45
+ async tearDown() {
46
46
  var e;
47
- this._handle ? (e = this._handle) == null || e.tearDown() : this._handleSetCallbacks.push(() => {
48
- this.tearDown();
49
- });
47
+ if (this._handle)
48
+ await ((e = this._handle) == null ? void 0 : e.tearDown());
49
+ else
50
+ return this._handleSetCallbacks.push(() => {
51
+ this.tearDown();
52
+ }), Promise.resolve();
50
53
  }
51
54
  }
52
- const v = (s) => `v${(s || l).replace(/^v/, "")}`, L = {
55
+ const a = (s) => `v${(s || l).replace(/^v/, "")}`, L = {
53
56
  init(s) {
54
57
  const t = new c();
55
- return import(/* webpackIgnore: true */ s.sdkUrl || `https://sdk.onfido.com/${v(s.version)}/Onfido.js`).then((n) => {
58
+ return import(/* webpackIgnore: true */ s.sdkUrl || `https://sdk.onfido.com/${a(s.version)}/Onfido.js`).then((n) => {
56
59
  const { Onfido: i } = n;
57
60
  t._setHandle(i.init(s));
58
61
  }).catch((n) => {
@@ -63,5 +66,5 @@ const v = (s) => `v${(s || l).replace(/^v/, "")}`, L = {
63
66
  };
64
67
  export {
65
68
  L as Onfido,
66
- v as prefixVersion
69
+ a as prefixVersion
67
70
  };
package/Onfido.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(n,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(n=typeof globalThis<"u"?globalThis:n||self,i(n.window=n.window||{}))})(this,function(n){"use strict";var v=Object.defineProperty;var a=(n,i,o)=>i in n?v(n,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[i]=o;var h=(n,i,o)=>(a(n,typeof i!="symbol"?i+"":i,o),o);class i{constructor(){this.eventListener={}}addEventListener(s,e){return this.eventListener[s]=this.eventListener[s]||[],this.eventListener[s].push(e),this}removeEventListener(s,e){const t=this.eventListener[s];if(t){let r;for(;(r=t.indexOf(e))!==-1;)t.splice(r,1)}}trigger(s,e){e.type=s,(this.eventListener[s]||[]).forEach(t=>{t(e)})}}const o="v14";class c extends i{constructor(){super(...arguments);h(this,"_handle");h(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(t=>t(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([t,r])=>{e.addEventListener(t,r)}),this.eventListener={}}addEventListener(e,t){return this._handle?(this._handle.addEventListener(e,t),this):super.addEventListener(e,t)}removeEventListener(e,t){if(this._handle)return this._handle.removeEventListener(e,t),this;super.removeEventListener(e,t)}tearDown(){var e;this._handle?(e=this._handle)==null||e.tearDown():this._handleSetCallbacks.push(()=>{this.tearDown()})}}const l=d=>`v${(d||o).replace(/^v/,"")}`,f={init(d){const s=new c;return import(/* webpackIgnore: true */ d.sdkUrl||`https://sdk.onfido.com/${l(d.version)}/Onfido.js`).then(t=>{const{Onfido:r}=t;s._setHandle(r.init(d))}).catch(t=>{var r;s.trigger("error",{error:t}),(r=d.onError)==null||r.call(d,t)}),s}};n.Onfido=f,n.prefixVersion=l,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(n=typeof globalThis<"u"?globalThis:n||self,i(n.window=n.window||{}))})(this,function(n){"use strict";var a=Object.defineProperty;var v=(n,i,o)=>i in n?a(n,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[i]=o;var h=(n,i,o)=>(v(n,typeof i!="symbol"?i+"":i,o),o);class i{constructor(){this.eventListener={}}addEventListener(s,e){return this.eventListener[s]=this.eventListener[s]||[],this.eventListener[s].push(e),this}removeEventListener(s,e){const t=this.eventListener[s];if(t){let d;for(;(d=t.indexOf(e))!==-1;)t.splice(d,1)}}trigger(s,e){e.type=s,(this.eventListener[s]||[]).forEach(t=>{t(e)})}}const o="v14";class c extends i{constructor(){super(...arguments);h(this,"_handle");h(this,"_handleSetCallbacks",[])}_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(t=>t(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(([t,d])=>{e.addEventListener(t,d)}),this.eventListener={}}addEventListener(e,t){return this._handle?(this._handle.addEventListener(e,t),this):super.addEventListener(e,t)}removeEventListener(e,t){if(this._handle)return this._handle.removeEventListener(e,t),this;super.removeEventListener(e,t)}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()}}const l=r=>`v${(r||o).replace(/^v/,"")}`,f={init(r){const s=new c;return import(/* webpackIgnore: true */ r.sdkUrl||`https://sdk.onfido.com/${l(r.version)}/Onfido.js`).then(t=>{const{Onfido:d}=t;s._setHandle(d.init(r))}).catch(t=>{var d;s.trigger("error",{error:t}),(d=r.onError)==null||d.call(r,t)}),s}};n.Onfido=f,n.prefixVersion=l,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/license CHANGED
@@ -1,17 +1,17 @@
1
1
  Please see the terms of your Onfido Services Agreement which you are bound by with respect to your use of the Onfido
2
2
  SDK. To the extent the Onfido SDK includes copies or substantial portions of software licenced under third party terms
3
- and conditions this will be set out at https://sdk.onfido.com/capture/core/14.16.0/license.
3
+ and conditions this will be set out at https://sdk.onfido.com/capture/core/14.18.0/license.
4
4
 
5
5
  In the event of any inconsistency between the Onfido Services Agreement and any third party terms and conditions, the
6
6
  third party terms and conditions shall take precedence over the rights and
7
7
  restrictions granted in the Onfido Services Agreement solely in respect of such third party dependencies set out
8
- at https://sdk.onfido.com/capture/core/14.16.0/license.
8
+ at https://sdk.onfido.com/capture/core/14.18.0/license.
9
9
 
10
10
  3rd party licenses
11
11
  ------------------
12
12
 
13
13
  Name: @onfido/capture-shared
14
- Version: 1.22.5
14
+ Version: 1.26.1
15
15
  License: null
16
16
  Private: false
17
17
  Description: A shared library to use in various capture packages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onfido-sdk-ui",
3
- "version": "14.16.0",
3
+ "version": "14.18.0",
4
4
  "description": "JavaScript SDK view layer for Onfido identity verification",
5
5
  "author": "Web SDK Customer Support <web-sdk@onfido.com> (https://github.com/onfido)",
6
6
  "repository": {
package/types/Events.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { CaptureModule } from './shared/Types';
2
+ import type { SdkError } from './shared/Error';
2
3
  import type { Event } from './shared/EventEmitter';
3
- import type { CompleteData, ErrorType } from './Types';
4
+ import type { CompleteData } from './shared/SdkParameters';
4
5
  export type ModuleEvent<T extends string> = {
5
6
  module: CaptureModule;
6
7
  id: string;
@@ -17,7 +18,7 @@ export type UserAnalyticsEvent = Event<'userAnalytics'> & {
17
18
  isCrossDevice: boolean;
18
19
  };
19
20
  export type ErrorEvent = {
20
- error: ErrorType;
21
+ error: SdkError | Error | unknown;
21
22
  } & Event<'error'>;
22
23
  export type PermissionUnknownEvent = Event<'permissionUnknown'> & {
23
24
  permissionsRequired: string[];
package/types/Onfido.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { Listener } from './shared/EventEmitter';
2
- import type { SdkParameters } from './Types';
2
+ import type { SdkParameters } from './shared/SdkParameters';
3
3
  import type { CaptureRunEvents } from './Events';
4
4
  export type Handle = {
5
5
  addEventListener: <EventName extends keyof CaptureRunEvents>(eventName: EventName, listener: Listener<CaptureRunEvents[EventName]>) => void;
6
6
  removeEventListener: <EventName extends keyof CaptureRunEvents>(eventName: EventName, listener: Listener<CaptureRunEvents[EventName]>) => void;
7
- tearDown: () => void;
7
+ tearDown: () => Promise<void>;
8
8
  };
9
9
  export declare const backwardCompatibility: (parameter: SdkParameters) => void;
10
10
  export type OnfidoApi = {
package/types/loader.d.ts CHANGED
@@ -1,5 +1,5 @@
1
+ import type { SdkParameters } from './shared/SdkParameters';
1
2
  import type { Handle } from './Onfido';
2
- import type { SdkParameters } from './Types';
3
3
  export type LoaderParameter = {
4
4
  /**
5
5
  * This is a developer feature, if the sdk is hosted on a different url
@@ -1,4 +1,4 @@
1
- import type { FeatureFlags } from './Features';
1
+ import type { FeatureFlags } from './FeatureFlags';
2
2
  export type ModuleError = {
3
3
  type: 'no_camera';
4
4
  message?: string;
@@ -57,6 +57,7 @@ export type CustomCallbacks = {
57
57
  export type ExecutionContext = {
58
58
  platform: Platform;
59
59
  version: string;
60
+ module?: CaptureModule;
60
61
  configuration?: ExecutionContextConfiguration;
61
62
  customCallbacks?: CustomCallbacks;
62
63
  currentScriptHostname?: string;
@@ -77,6 +78,16 @@ export type ClientConfiguration = {
77
78
  sessionUuid: string;
78
79
  workflowRunId: string | undefined;
79
80
  steps: LegacyStepDefinition[];
81
+ source: {
82
+ platform: string;
83
+ version: string;
84
+ sdk_environment: string;
85
+ distribution_source: string;
86
+ };
87
+ };
88
+ logger: {
89
+ enabled: boolean;
90
+ levels: string[];
80
91
  };
81
92
  enterpriseFeatures?: EnterpriseFeatures;
82
93
  crossDeviceClientIntroProductName?: string;
package/types/Types.d.ts DELETED
@@ -1,54 +0,0 @@
1
- import type { LegacyStepDefinition, LegacyStepType, CrossDevicePolicy, EnterpriseFeatures, LocaleDirection, Theme, ThemeConfig, Translations, UserDetails } from './shared/Types';
2
- import type { CrossDeviceMethod } from './shared/CrossDeviceConnect.types';
3
- import type { EnterpriseFeatureCallback } from './shared/Enterprise';
4
- export declare const legacySteps: LegacyStepType[];
5
- export declare const isLegacyStepType: (step: LegacyStepDefinition) => step is LegacyStepType;
6
- export type CompleteData = Record<string, unknown>;
7
- export type ErrorType = any;
8
- export type EnterpriseFeatureParameter = EnterpriseFeatures & EnterpriseFeatureCallback;
9
- export type CommonSdkParameters = {
10
- containerEl?: HTMLElement;
11
- containerId?: string;
12
- onError?: (error: ErrorType) => void;
13
- onComplete?: (data: CompleteData) => void;
14
- enterpriseFeatures?: EnterpriseFeatureParameter;
15
- theme?: Theme;
16
- customUI?: ThemeConfig;
17
- language?: string | LegacyLanguageParameter;
18
- translations?: Translations;
19
- };
20
- export type LegacyLanguageParameter = {
21
- locale?: string;
22
- phrases?: Record<string, string>;
23
- mobilePhrases?: Record<string, string>;
24
- direction?: LocaleDirection;
25
- };
26
- export type TokenParameters = {
27
- token: string;
28
- language?: string | LegacyLanguageParameter;
29
- translations?: Translations;
30
- theme?: Theme;
31
- /***
32
- * You can change the default country for the SMS number input by passing the
33
- * smsNumberCountryCode option when the SDK is initialized. The value should
34
- * be a string containing a 2-character ISO Country code. If empty, the SMS
35
- * number country code will default to GB.
36
- */
37
- smsNumberCountryCode?: string;
38
- userDetails?: UserDetails;
39
- _crossDeviceLinkMethods?: CrossDeviceMethod[];
40
- crossDevicePolicy?: CrossDevicePolicy;
41
- disableAnalytics?: boolean;
42
- disableAnalyticsCookies?: boolean;
43
- } & CommonSdkParameters;
44
- export type StudioSdkParameters = {
45
- workflowRunId: string;
46
- disableWelcomeScreen?: boolean;
47
- } & TokenParameters;
48
- export type ClassicSdkParameters = {
49
- steps: LegacyStepDefinition[];
50
- } & TokenParameters;
51
- export type CrossDeviceSdkParameters = CommonSdkParameters & {
52
- roomId?: string;
53
- };
54
- export type SdkParameters = StudioSdkParameters | ClassicSdkParameters | CrossDeviceSdkParameters;