vult-security-kyc 0.0.4 → 0.0.5

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.
@@ -1,8 +1,10 @@
1
1
  import { KYC_SETTINGS } from './interfaces/IKYCWidget';
2
- export declare const IFrame: ({ KYC_VARS, }: {
2
+ export declare const IFrame: ({ KYC_VARS, iframeId, iframeContainerId, }: {
3
3
  KYC_VARS: KYC_SETTINGS;
4
4
  setLocationData: (x: {
5
5
  latitude: number;
6
6
  longitude: number;
7
7
  }) => void;
8
+ iframeId: string;
9
+ iframeContainerId: string;
8
10
  }) => Promise<HTMLDivElement>;
@@ -1,4 +1,5 @@
1
- export declare const MainWindow: ({ removeElementFromDOM, onDismiss, }: {
1
+ export declare const MainWindow: ({ removeElementFromDOM, onDismiss, mainWindowId, }: {
2
2
  removeElementFromDOM: () => void;
3
3
  onDismiss?: () => void;
4
+ mainWindowId: string;
4
5
  }) => HTMLDivElement;
@@ -1,62 +1,54 @@
1
- /* Vult Kyc Widget: 2.0.0 */
2
- import { useRef as l, useEffect as f } from "react";
3
- import { KYCWidget as a, IDV as p, IDA as y } from "../vult-kyc-widget.es.js";
4
- const V = ({
5
- environment: i,
6
- sessionId: e,
7
- autoClose: o = !0,
8
- onComplete: n,
9
- onDismiss: c
1
+ /* Vult Kyc Widget: 0.0.5 */
2
+ import { useRef as s, useEffect as f } from "react";
3
+ import { KYCWidget as p, IDV as d, IDA as R } from "../vult-kyc-widget.es.js";
4
+ const D = ({
5
+ environment: l,
6
+ sessionId: c,
7
+ autoClose: n = !0,
8
+ onComplete: u,
9
+ onDismiss: o
10
10
  }) => {
11
- const r = l(null);
11
+ const r = s(null), e = s({ onComplete: u, onDismiss: o, autoClose: n }), t = s(!0);
12
12
  return f(() => {
13
- var t;
14
- e ? (t = r.current) == null || t.startIDVerify(e) : console.warn("Awaiting sessionId to be provided");
15
- }, [e]), f(() => {
16
- var t;
17
- return r.current || (r.current = new a({
18
- env: i,
19
- onDismiss: () => {
20
- c && c();
21
- },
22
- onComplete: () => {
23
- var u;
24
- n && n(), o && ((u = r.current) == null || u.close());
25
- },
26
- Session_Type: p
27
- })), e && ((t = r.current) == null || t.startIDVerify(e)), () => {
28
- r.current && r.current.close();
29
- };
30
- }, []), null;
31
- }, v = ({
32
- environment: i,
33
- sessionId: e,
34
- autoClose: o = !0,
35
- onComplete: n,
36
- onDismiss: c
13
+ e.current = { onComplete: u, onDismiss: o, autoClose: n };
14
+ }, [u, o, n]), f(() => (t.current = !0, r.current || (r.current = new p({
15
+ env: l,
16
+ onDismiss: () => {
17
+ t.current && e.current.onDismiss && e.current.onDismiss();
18
+ },
19
+ onComplete: (a) => {
20
+ var i;
21
+ t.current && e.current.onComplete && e.current.onComplete(a), t.current && e.current.autoClose && ((i = r.current) == null || i.close().catch(console.error));
22
+ },
23
+ Session_Type: d
24
+ })), c ? r.current.startIDVerify(c) : console.warn("Awaiting sessionId to be provided"), () => {
25
+ t.current = !1, r.current && (r.current.close().catch(console.error), r.current = null);
26
+ }), [c, l]), null;
27
+ }, h = ({
28
+ environment: l,
29
+ sessionId: c,
30
+ autoClose: n = !0,
31
+ onComplete: u,
32
+ onDismiss: o
37
33
  }) => {
38
- const r = l(null);
34
+ const r = s(null), e = s({ onComplete: u, onDismiss: o, autoClose: n }), t = s(!0);
39
35
  return f(() => {
40
- var t;
41
- e ? (t = r.current) == null || t.startIDAuthenticate(e) : console.warn("Awaiting sessionId to be provided");
42
- }, [e]), f(() => {
43
- var t;
44
- return r.current || (r.current = new a({
45
- env: i,
46
- onDismiss: () => {
47
- c && c();
48
- },
49
- onComplete: () => {
50
- var u;
51
- n && n(), o && ((u = r.current) == null || u.close());
52
- },
53
- Session_Type: y
54
- })), e && ((t = r.current) == null || t.startIDVerify(e)), () => {
55
- r.current && r.current.close();
56
- };
57
- }, []), null;
36
+ e.current = { onComplete: u, onDismiss: o, autoClose: n };
37
+ }, [u, o, n]), f(() => (t.current = !0, r.current || (r.current = new p({
38
+ env: l,
39
+ onDismiss: () => {
40
+ t.current && e.current.onDismiss && e.current.onDismiss();
41
+ },
42
+ onComplete: (a) => {
43
+ var i;
44
+ t.current && e.current.onComplete && e.current.onComplete(a), t.current && e.current.autoClose && ((i = r.current) == null || i.close().catch(console.error));
45
+ },
46
+ Session_Type: R
47
+ })), c ? r.current.startIDAuthenticate(c) : console.warn("Awaiting sessionId to be provided"), () => {
48
+ t.current = !1, r.current && (r.current.close().catch(console.error), r.current = null);
49
+ }), [c, l]), null;
58
50
  };
59
51
  export {
60
- v as VULTIda,
61
- V as VULTIdv
52
+ h as VULTIda,
53
+ D as VULTIdv
62
54
  };
@@ -12,6 +12,11 @@ export declare class KYCWidget {
12
12
  previousHeight: number;
13
13
  RESIZE_THRESHOLD_HEIGHT: number;
14
14
  RESIZE_THRESHOLD_WIDTH: number;
15
+ instanceId: string;
16
+ mainWindowId: string;
17
+ iframeId: string;
18
+ iframeContainerId: string;
19
+ isClosing: boolean;
15
20
  constructor(initialConfiguration: KYCWidgetConfig);
16
21
  windowEventListener: (ev: any) => void;
17
22
  setLocationData: (coords: {
@@ -24,7 +29,7 @@ export declare class KYCWidget {
24
29
  setSessionType: (initialConfiguration: KYCWidgetConfig) => "/verify" | "/authenticate" | "";
25
30
  startIDVerify: (session_id: string) => Promise<void>;
26
31
  startIDAuthenticate: (session_id: string) => Promise<void>;
27
- close: () => void;
32
+ close: () => Promise<void>;
28
33
  }
29
34
  export declare const IDA = "IDAuthentication";
30
35
  export declare const IDV = "IDVerification";