@vpdev2/metakyc 1.0.55 → 1.0.57
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/client/session.d.ts +19 -12
- package/dist/client/session.d.ts.map +1 -1
- package/dist/components/MetaKYC.d.ts +31 -0
- package/dist/components/MetaKYC.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useMetaKYCFlow.d.ts +18 -0
- package/dist/hooks/useMetaKYCFlow.d.ts.map +1 -0
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1742 -1629
- package/dist/index.js.map +1 -1
- package/dist/services/applicant.service.d.ts +7 -1
- package/dist/services/applicant.service.d.ts.map +1 -1
- package/dist/types/applicant.d.ts +15 -0
- package/dist/types/applicant.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/client/session.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
workflowKey: string;
|
|
1
|
+
export interface ApplicantPreFillParams {
|
|
3
2
|
firstName?: string;
|
|
4
3
|
lastName?: string;
|
|
5
4
|
email?: string;
|
|
@@ -17,23 +16,31 @@ export interface CreateSessionTokenParams {
|
|
|
17
16
|
/** String client ID (non-ABP projects). Provide this OR tenantId. */
|
|
18
17
|
clientId?: string;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
19
|
+
* Your system's unique user identifier. The server automatically creates or
|
|
20
|
+
* finds an applicant matching this ID, so the response always includes `applicantId`.
|
|
21
|
+
*/
|
|
22
|
+
externalRefId: string;
|
|
23
|
+
/**
|
|
24
|
+
* Workflow key for this session. Together with `externalRefId`, the server
|
|
25
|
+
* creates or retrieves the applicant assigned to this workflow.
|
|
26
|
+
*/
|
|
27
|
+
workflowKey: string;
|
|
28
|
+
/**
|
|
29
|
+
* When true, the SDK shows the company applicant form instead of individual.
|
|
30
|
+
* Embedded in the token so the SDK auto-detects the form type.
|
|
23
31
|
*/
|
|
24
|
-
|
|
32
|
+
isCompany?: boolean;
|
|
25
33
|
/**
|
|
26
|
-
* Optional
|
|
27
|
-
*
|
|
28
|
-
* to the SDK so the CreateApplicantForm starts pre-filled.
|
|
34
|
+
* Optional pre-fill data for the applicant (email, name, etc.).
|
|
35
|
+
* The applicant is always created; this just seeds initial field values.
|
|
29
36
|
*/
|
|
30
|
-
applicant?:
|
|
37
|
+
applicant?: ApplicantPreFillParams;
|
|
31
38
|
}
|
|
32
39
|
export interface SessionTokenResult {
|
|
33
40
|
accessToken: string;
|
|
34
41
|
expiresInSeconds: number;
|
|
35
|
-
/**
|
|
36
|
-
applicantId
|
|
42
|
+
/** The applicant ID created/found for this externalRefId + workflowKey combination. */
|
|
43
|
+
applicantId: number;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* Server-side utility to create a short-lived SDK session token.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/client/session.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/client/session.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,uFAAuF;IACvF,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,qBAAa,cAAc;WACZ,WAAW,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA6CxF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { WorkflowResultType } from '../types';
|
|
3
|
+
export interface MetaKYCProps {
|
|
4
|
+
/** Override company detection from the token. When true, shows the company form. */
|
|
5
|
+
isCompany?: boolean;
|
|
6
|
+
/** Called when the entire workflow completes */
|
|
7
|
+
onComplete?: (result: WorkflowResultType) => void;
|
|
8
|
+
/** Called when an error occurs */
|
|
9
|
+
onError?: (error: Error) => void;
|
|
10
|
+
/** Called after the applicant is created (before the workflow starts) */
|
|
11
|
+
onApplicantCreated?: (applicantId: number) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Unified MetaKYC component.
|
|
16
|
+
*
|
|
17
|
+
* Automatically determines what to display based on the session token:
|
|
18
|
+
* - If no applicant exists for the token's ExternalRefId → shows the create form
|
|
19
|
+
* - If an applicant exists but has no progress (skeleton) → shows the create form (pre-filled)
|
|
20
|
+
* - If an applicant has active progress → shows the KYC workflow
|
|
21
|
+
* - If finished or on-hold → shows the status display (handled inside KycWorkflow)
|
|
22
|
+
*
|
|
23
|
+
* Usage:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <MetaKYCProvider config={{ baseUrl, getAccessToken: () => token }}>
|
|
26
|
+
* <MetaKYC onComplete={(result) => console.log(result)} />
|
|
27
|
+
* </MetaKYCProvider>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const MetaKYC: React.FC<MetaKYCProps>;
|
|
31
|
+
//# sourceMappingURL=MetaKYC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MetaKYC.d.ts","sourceRoot":"","sources":["../../src/components/MetaKYC.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,MAAM,WAAW,YAAY;IAC3B,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAClD,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAuH1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SdkPhase } from '../types';
|
|
2
|
+
export interface MetaKYCFlowState {
|
|
3
|
+
phase: SdkPhase | 'loading' | 'error';
|
|
4
|
+
applicantId?: number;
|
|
5
|
+
isCompany: boolean;
|
|
6
|
+
workflowKey?: string;
|
|
7
|
+
error?: Error;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Transition to the workflow phase after applicant creation.
|
|
11
|
+
* Call this from the form's onSuccess callback.
|
|
12
|
+
*/
|
|
13
|
+
transitionToWorkflow: (applicantId: number) => void;
|
|
14
|
+
/** Re-fetch the SDK state from the backend */
|
|
15
|
+
refresh: () => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function useMetaKYCFlow(isCompanyOverride?: boolean): MetaKYCFlowState;
|
|
18
|
+
//# sourceMappingURL=useMetaKYCFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMetaKYCFlow.d.ts","sourceRoot":"","sources":["../../src/hooks/useMetaKYCFlow.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,8CAA8C;IAC9C,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,cAAc,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAiD5E"}
|