@frankieone/one-sdk 1.10.3-rc → 1.10.4-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.
Files changed (93) hide show
  1. package/README.md +7 -24
  2. package/dist/commit.txt +1 -1
  3. package/dist/esm/modules/biometrics/definition.d.ts +1 -9
  4. package/dist/esm/modules/biometrics/definition.d.ts.map +1 -1
  5. package/dist/esm/modules/biometrics/index.d.ts.map +1 -1
  6. package/dist/esm/modules/biometrics/index.js +0 -2
  7. package/dist/esm/modules/biometrics/index.js.map +1 -1
  8. package/dist/esm/modules/biometrics/vendors/Daon/index.d.ts +1 -1
  9. package/dist/esm/modules/biometrics/vendors/Incode/index.d.ts +1 -1
  10. package/dist/esm/modules/biometrics/vendors/OcrLabs/index.d.ts +1 -1
  11. package/dist/esm/modules/biometrics/vendors/OcrLabs/nolint_liveness-v3.3.0.vendor.d.ts +128 -128
  12. package/dist/esm/modules/biometrics/vendors/Onfido/index.d.ts +1 -1
  13. package/dist/esm/modules/biometrics/vendors/Sumsub/index.d.ts +1 -1
  14. package/dist/esm/modules/biometrics/vendors/dummy-biometrics/index.d.ts +1 -1
  15. package/dist/esm/modules/common/modules/env2url.d.ts.map +1 -1
  16. package/dist/esm/modules/common/modules/env2url.js +27 -26
  17. package/dist/esm/modules/common/modules/env2url.js.map +1 -1
  18. package/dist/esm/modules/features.config.d.ts +0 -2
  19. package/dist/esm/modules/features.config.d.ts.map +1 -1
  20. package/dist/esm/modules/features.config.js +0 -2
  21. package/dist/esm/modules/features.config.js.map +1 -1
  22. package/dist/esm/modules/form/vendors/react/features/PersonalDetails/personalDetails.config.d.ts +725 -725
  23. package/dist/esm/modules/form/vendors/react/features/PersonalDetails/personalDetails.config.d.ts.map +1 -1
  24. package/dist/esm/modules/frankie-client/FrankieApiClient.d.ts +1 -15
  25. package/dist/esm/modules/frankie-client/FrankieApiClient.d.ts.map +1 -1
  26. package/dist/esm/modules/frankie-client/FrankieApiClient.js +0 -42
  27. package/dist/esm/modules/frankie-client/FrankieApiClient.js.map +1 -1
  28. package/dist/esm/modules/idv/vendors/Daon/index.d.ts +1 -1
  29. package/dist/esm/modules/idv/vendors/Incode/index.d.ts +1 -1
  30. package/dist/esm/modules/idv/vendors/Mastercard/index.d.ts +1 -1
  31. package/dist/esm/modules/idv/vendors/OcrLabs/index.d.ts +1 -1
  32. package/dist/esm/modules/idv/vendors/Onfido/index.d.ts +1 -1
  33. package/dist/esm/modules/idv/vendors/Sumsub/index.d.ts +1 -1
  34. package/dist/esm/modules/idv/vendors/Truuth/index.d.ts +1 -1
  35. package/dist/esm/modules/idv/vendors/common/iframeUtils/defineIframeIDVWrapper.d.ts +1 -1
  36. package/dist/esm/modules/index.d.ts +0 -2
  37. package/dist/esm/modules/index.d.ts.map +1 -1
  38. package/dist/esm/modules/index.js +0 -2
  39. package/dist/esm/modules/index.js.map +1 -1
  40. package/dist/esm/modules/journey/steps/stepTable.d.ts +13 -13
  41. package/dist/esm/modules/meta.json +1 -1
  42. package/dist/esm/modules/ocr/definition.d.ts +1 -9
  43. package/dist/esm/modules/ocr/definition.d.ts.map +1 -1
  44. package/dist/esm/modules/ocr/index.d.ts.map +1 -1
  45. package/dist/esm/modules/ocr/index.js +0 -2
  46. package/dist/esm/modules/ocr/index.js.map +1 -1
  47. package/dist/esm/modules/ocr/vendors/Daon/index.d.ts +1 -1
  48. package/dist/esm/modules/ocr/vendors/Incode/index.d.ts +1 -1
  49. package/dist/esm/modules/ocr/vendors/Onfido/index.d.ts +1 -1
  50. package/dist/esm/modules/ocr/vendors/Sumsub/index.d.ts +1 -1
  51. package/dist/esm/modules/ocr/vendors/dummy-ocr/index.d.ts +1 -1
  52. package/dist/esm/modules/types.d.ts +1 -1
  53. package/dist/esm/modules/types.d.ts.map +1 -1
  54. package/dist/esm/modules/types.js +0 -1
  55. package/dist/esm/modules/types.js.map +1 -1
  56. package/dist/version.txt +1 -1
  57. package/package.json +1 -3
  58. package/dist/esm/modules/biometrics/vendors/IDVerse/index.d.ts +0 -10
  59. package/dist/esm/modules/biometrics/vendors/IDVerse/index.d.ts.map +0 -1
  60. package/dist/esm/modules/biometrics/vendors/IDVerse/index.js +0 -19
  61. package/dist/esm/modules/biometrics/vendors/IDVerse/index.js.map +0 -1
  62. package/dist/esm/modules/cli/index.d.ts +0 -8
  63. package/dist/esm/modules/cli/index.d.ts.map +0 -1
  64. package/dist/esm/modules/cli/index.js +0 -6
  65. package/dist/esm/modules/cli/index.js.map +0 -1
  66. package/dist/esm/modules/cli/template/index.d.ts +0 -7
  67. package/dist/esm/modules/cli/template/index.d.ts.map +0 -1
  68. package/dist/esm/modules/cli/template/index.js +0 -68
  69. package/dist/esm/modules/cli/template/index.js.map +0 -1
  70. package/dist/esm/modules/cli/template/styles.d.ts +0 -3
  71. package/dist/esm/modules/cli/template/styles.d.ts.map +0 -1
  72. package/dist/esm/modules/cli/template/styles.js +0 -48
  73. package/dist/esm/modules/cli/template/styles.js.map +0 -1
  74. package/dist/esm/modules/cli/template/templateIdv.d.ts +0 -2
  75. package/dist/esm/modules/cli/template/templateIdv.d.ts.map +0 -1
  76. package/dist/esm/modules/cli/template/templateIdv.js +0 -109
  77. package/dist/esm/modules/cli/template/templateIdv.js.map +0 -1
  78. package/dist/esm/modules/cli/template/templateIdvReview.d.ts +0 -2
  79. package/dist/esm/modules/cli/template/templateIdvReview.d.ts.map +0 -1
  80. package/dist/esm/modules/cli/template/templateIdvReview.js +0 -124
  81. package/dist/esm/modules/cli/template/templateIdvReview.js.map +0 -1
  82. package/dist/esm/modules/cli/template/templateManualKyc.d.ts +0 -2
  83. package/dist/esm/modules/cli/template/templateManualKyc.d.ts.map +0 -1
  84. package/dist/esm/modules/cli/template/templateManualKyc.js +0 -214
  85. package/dist/esm/modules/cli/template/templateManualKyc.js.map +0 -1
  86. package/dist/esm/modules/common/vendors/idverse/index.d.ts +0 -93
  87. package/dist/esm/modules/common/vendors/idverse/index.d.ts.map +0 -1
  88. package/dist/esm/modules/common/vendors/idverse/index.js +0 -374
  89. package/dist/esm/modules/common/vendors/idverse/index.js.map +0 -1
  90. package/dist/esm/modules/ocr/vendors/IDVerse/index.d.ts +0 -10
  91. package/dist/esm/modules/ocr/vendors/IDVerse/index.d.ts.map +0 -1
  92. package/dist/esm/modules/ocr/vendors/IDVerse/index.js +0 -19
  93. package/dist/esm/modules/ocr/vendors/IDVerse/index.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@frankieone/one-sdk",
3
- "version": "1.10.3-rc",
4
- "cliVersion": "0.0.2",
3
+ "version": "1.10.4-rc",
5
4
  "description": "FrankieOne OneSDK",
6
5
  "keywords": [],
7
6
  "license": "ISC",
@@ -38,7 +37,6 @@
38
37
  "curr-version": "echo $npm_package_version",
39
38
  "package:name": "echo $npm_package_name",
40
39
  "dev": "run-p \"watch:css\" \"start:playground\"",
41
- "dev:cli": "export CLI_MODE=dev && cd cli && go run .",
42
40
  "eslint-check": "export NODE_OPTIONS='--max-old-space-size=8192'; eslint . -c .eslintrc.cjs --quiet --exit-on-fatal-error",
43
41
  "fresh": "node scripts/fresh.js --include-apps",
44
42
  "lint:staged": "lint-staged --verbose --concurrent=false",
@@ -1,10 +0,0 @@
1
- export declare const initialise: import("../../../common/types").WrapperInitialiseFunction<{
2
- eventHub: import("../../../common").EventHub<import("../..").Events>;
3
- mountElement: HTMLElement;
4
- }, import("../../definition").BiometricsWrapperContext, "async", {
5
- localEventHub: import("../../../common").EventHub<import("../..").Events>;
6
- recipe: import("../../../sdk/types").RecipeParsed;
7
- }> & {
8
- vendorName: "incode" | "onfido" | "ocrlabs" | "sumsub" | "idverse" | "daon" | "dummy-biometrics";
9
- };
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../modules/biometrics/vendors/IDVerse/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU;;;;;;;;CAatB,CAAC"}
@@ -1,19 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { defineWrapper } from '../../../common/modules/defineModule.js';
11
- import { loadIdverseSdk } from '../../../common/vendors/idverse/index.js';
12
- import { IDVClient } from '../../../frankie-client/clients/IDVClient.js';
13
- export const initialise = defineWrapper('idverse', (shared, options) => __awaiter(void 0, void 0, void 0, function* () {
14
- const { frankieClient } = shared;
15
- const idvClient = new IDVClient(frankieClient);
16
- yield loadIdverseSdk(['face-scan', 'id-scan'], idvClient, shared, Object.assign(Object.assign({}, options), { eventHubBiometrics: options.eventHub }));
17
- return {};
18
- }));
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../modules/biometrics/vendors/IDVerse/index.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CACrC,SAAS,EACT,CAAO,MAAM,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IACjC,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,aAAa,CAAC,CAAC;IAE/C,MAAM,cAAc,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,kCAC3D,OAAO,KACV,kBAAkB,EAAE,OAAO,CAAC,QAAQ,IACpC,CAAC;IAEH,OAAO,EAAE,CAAC;AACZ,CAAC,CAAA,CACF,CAAC"}
@@ -1,8 +0,0 @@
1
- export default function generateOneSdkFlow({ flowId, env, cid, ccid, apiKey }: {
2
- flowId: any;
3
- env: any;
4
- cid: any;
5
- ccid: any;
6
- apiKey: any;
7
- }): string;
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../modules/cli/index.js"],"names":[],"mappings":"AAGA;;;;;;WAEC"}
@@ -1,6 +0,0 @@
1
- import createHTML from './template/index.js';
2
- // @param {string} flowId - the id of the flow to generate, idv / idv_review / manual_kyc
3
- export default function generateOneSdkFlow({ flowId, env, cid, ccid, apiKey }) {
4
- return createHTML(flowId)({ env, cid, ccid, apiKey });
5
- }
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/cli/index.js"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C,yFAAyF;AACzF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3E,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACxD,CAAC"}
@@ -1,7 +0,0 @@
1
- export default function createHTML(flowId: any): ({ env, cid, ccid, apiKey }: {
2
- env: any;
3
- cid: any;
4
- ccid: any;
5
- apiKey: any;
6
- }) => string;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../modules/cli/template/index.js"],"names":[],"mappings":"AAuDA;;;;;aAkBC"}
@@ -1,68 +0,0 @@
1
- import { templateIdv } from './templateIdv.js';
2
- import { templateIdvReview } from './templateIdvReview.js';
3
- import { templateManualKyc } from './templateManualKyc.js';
4
- const backendURL = {
5
- dev: "https://backend.latest.frankiefinancial.io",
6
- qa: "https://backend.qa.frankiefinancial.io",
7
- uat: "https://backend.kycaml.uat.frankiefinancial.io",
8
- prod: "https://backend.kycaml.frankiefinancial.io",
9
- };
10
- const js = String.raw;
11
- const createRequestTokenFunction = ({ env, cid, ccid, apiKey }) => js `
12
- // Function to get an authentication token from the FrankieOne API
13
- // This token is required to initialize OneSDK
14
- async function getToken() {
15
- // WARNING: This is for testing purposes only
16
- // In production, token generation should happen server-side for security
17
-
18
- // Replace these placeholder values with your actual credentials
19
- const customerId = '${cid}';
20
- // Optional: leave empty if not applicable (for multi-tenant setups)
21
- const customerChildId = '${ccid}';
22
- const apiKey = '${apiKey}';
23
-
24
- // Create authentication key by base64 encoding the credentials
25
- const authKey = btoa(
26
- [customerId, customerChildId, apiKey].filter(Boolean).join(':'),
27
- );
28
-
29
- // Replace this with your own logic to generate a unique customer reference
30
- const customerReference = Math.random().toString(36).substring(2);
31
-
32
- // Request a machine session token from FrankieOne
33
- const tokenResponse = await fetch(
34
- '${backendURL[env]}/auth/v2/machine-session',
35
- {
36
- method: 'POST',
37
- headers: {
38
- authorization: 'machine ' + authKey,
39
- 'Content-Type': 'application/json',
40
- },
41
- body: JSON.stringify({
42
- permissions: {
43
- preset: 'one-sdk',
44
- reference: customerReference,
45
- },
46
- }),
47
- },
48
- );
49
-
50
- return await tokenResponse.json();
51
- }`;
52
- export default function createHTML(flowId) {
53
- return function ({ env, cid, ccid, apiKey }) {
54
- const getTokenImpl = createRequestTokenFunction({ env, cid, ccid, apiKey });
55
- switch (flowId) {
56
- case 'idv':
57
- return templateIdv(getTokenImpl);
58
- case 'idv_review':
59
- return templateIdvReview(getTokenImpl);
60
- case 'manual_kyc':
61
- return templateManualKyc(getTokenImpl);
62
- default:
63
- return 'Unknown flow ID';
64
- }
65
- };
66
- }
67
- ;
68
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/cli/template/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,UAAU,GAAG;IACjB,GAAG,EAAE,4CAA4C;IACjD,EAAE,EAAE,wCAAwC;IAC5C,GAAG,EAAE,gDAAgD;IACrD,IAAI,EAAE,4CAA4C;CACnD,CAAC;AAEF,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;AAEtB,MAAM,0BAA0B,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,CAAA;;;;;;;;4BAQzC,GAAG;;iCAEE,IAAI;wBACb,MAAM;;;;;;;;;;;;WAYnB,UAAU,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;MAiBpB,CAAC;AAEP,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM;IACvC,OAAO,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;QACzC,MAAM,YAAY,GAAG,0BAA0B,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAE5E,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,KAAK;gBACR,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC;YAEnC,KAAK,YAAY;gBACf,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;YAEzC,KAAK,YAAY;gBACf,OAAO,iBAAiB,CAAC,YAAY,CAAC,CAAC;YAEzC;gBACE,OAAO,iBAAiB,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAAA,CAAC"}
@@ -1,3 +0,0 @@
1
- declare const _default: string;
2
- export default _default;
3
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../modules/cli/template/styles.js"],"names":[],"mappings":""}
@@ -1,48 +0,0 @@
1
- const css = String.raw;
2
- //NOTE: The `:root` value should match with the value from actual style in OneSDK
3
- //for now, let's match it manually.
4
- export default css `
5
- <style>
6
- body {
7
- background-color: white
8
- }
9
-
10
- #onesdk-container {
11
- position: absolute;
12
- top: 0;
13
- left: 0;
14
- width: 100%;
15
- height: 100%;
16
- display: flex;
17
- justify-content: center;
18
- align-items: center;
19
- }
20
-
21
- :root {
22
- --primary-color: #2b65f9;
23
- --button-text-color: #FFFFFF;
24
- }
25
-
26
- .ff-button {
27
- background-color: var(--primary-color) !important;
28
- color: var(--button-text-color) !important;
29
- }
30
-
31
- .ff-button:disabled {
32
- background-color: #e5e7eb !important;
33
- }
34
-
35
- .ff-checkbox-input {
36
- accent-color: var(--primary-color);
37
- }
38
-
39
- .ff-edit-button {
40
- fill: var(--primary-color);
41
- }
42
-
43
- .ff-instruction-item svg {
44
- fill: var(--primary-color);
45
- }
46
- </style>
47
- `;
48
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../modules/cli/template/styles.js"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;AAEvB,iFAAiF;AACjF,mCAAmC;AACnC,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CjB,CAAC"}
@@ -1,2 +0,0 @@
1
- export function templateIdv(getTokenImpl: any): string;
2
- //# sourceMappingURL=templateIdv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateIdv.d.ts","sourceRoot":"","sources":["../../../../../modules/cli/template/templateIdv.js"],"names":[],"mappings":"AAEO,uDA0GC"}
@@ -1,109 +0,0 @@
1
- const html = String.raw;
2
- export const templateIdv = (getTokenImpl) => html `<!-- Generated by OneSDK CLI -->
3
- <!-- More information: https://docs.frankieone.com/v1.14.1/docs/about-onesdk -->
4
-
5
- <!DOCTYPE html>
6
- <html lang="en">
7
- <head>
8
- <!-- UTF-8 encoding ensures proper display of special characters in the UI -->
9
- <meta charset="utf-8" />
10
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
11
- <title>OneSDK - IDV</title>
12
-
13
- <!-- Load the OneSDK library from FrankieOne CDN -->
14
- <!-- You can change the version number in the URL to use a different version -->
15
- <script src="https://assets.frankiefinancial.io/one-sdk/v1/oneSdk.umd.js"></script>
16
-
17
- <script>
18
- ${getTokenImpl}
19
-
20
- // Main function to initialize and start OneSDK
21
- async function startOneSdk() {
22
- const sessionToken = await getToken();
23
-
24
- // Initialize OneSDK with configuration
25
- const oneSdk = await OneSdk({
26
- session: sessionToken,
27
- mode: 'production',
28
- recipe: {
29
- form: {
30
- provider: {
31
- name: 'react',
32
- // UNCOMMENT AND ADD YOUR KEY to use Google Places address autocomplete
33
- // googleApiKey: "<GOOGLE_API_KEY>",
34
- },
35
- },
36
- },
37
- });
38
-
39
- const oneSdkIndividual = oneSdk.individual();
40
- oneSdkIndividual.addConsent("general");
41
- oneSdkIndividual.addConsent("docs");
42
- oneSdkIndividual.addConsent("creditheader");
43
- await oneSdkIndividual.submit();
44
- // Create an IDV (Identity Verification) flow instance
45
- const idv = oneSdk.flow('idv');
46
-
47
- const successScreen = oneSdk.component('form', {
48
- name: 'RESULT',
49
- mode: 'individual',
50
- type: 'manual',
51
- state: 'SUCCESS',
52
- title: { label: "Thanks, you're all done" },
53
- cta: null,
54
- });
55
-
56
- const failedScreen = oneSdk.component("form", {
57
- name: "RESULT",
58
- mode: "individual",
59
- state: "FAIL",
60
- type: "manual",
61
- });
62
-
63
- // Mount the IDV flow to the container element
64
- idv.mount('#idv-el');
65
-
66
- // Handle loading states during verification
67
- idv.on('loading', () => {
68
- console.log('loading');
69
- });
70
-
71
- // Handle verification results
72
- idv.on('results', async ({ checkStatus, document, entityId }) => {
73
- if (checkStatus) {
74
- console.log('results succesful');
75
- successScreen.mount("#idv-el");
76
- } else {
77
- console.log('no data returned');
78
- }
79
- });
80
-
81
- // Handle errors during verification
82
- idv.on('error', ({ message, payload }) => {
83
- console.log('received error');
84
- console.log(message, payload);
85
- });
86
-
87
- // Handle completion of document detection/capture
88
- idv.on('detection_complete', (message) => {
89
- console.log('capture finished');
90
- console.log(message);
91
- });
92
-
93
- // Log all OneSDK events to console for debugging
94
- idv.on('*', (message) => {
95
- console.log(message);
96
- });
97
- }
98
- </script>
99
- </head>
100
-
101
- <body style="background-color: white" onload="startOneSdk()">
102
- <!-- Container element where OneSDK will mount its UI components -->
103
- <div
104
- id="idv-el"
105
- style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;"
106
- ></div>
107
- </body>
108
- </html>`;
109
- //# sourceMappingURL=templateIdv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateIdv.js","sourceRoot":"","sources":["../../../../../modules/cli/template/templateIdv.js"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;MAgB3C,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0FV,CAAC"}
@@ -1,2 +0,0 @@
1
- export function templateIdvReview(getTokenImpl: any): string;
2
- //# sourceMappingURL=templateIdvReview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateIdvReview.d.ts","sourceRoot":"","sources":["../../../../../modules/cli/template/templateIdvReview.js"],"names":[],"mappings":"AAIO,6DAwHC"}
@@ -1,124 +0,0 @@
1
- import css from './styles.js';
2
- const html = String.raw;
3
- export const templateIdvReview = (getTokenImpl) => html `<!-- Generated by OneSDK CLI -->
4
- <!-- More information: https://docs.frankieone.com/v1.14.1/docs/about-onesdk -->
5
-
6
- <!DOCTYPE html>
7
- <html lang="en">
8
- <head>
9
- <!-- UTF-8 encoding ensures proper display of special characters in the UI -->
10
- <meta charset="utf-8" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
12
- <title>OneSDK - IDV+Review</title>
13
-
14
- <!-- Load the OneSDK library from FrankieOne CDN -->
15
- <!-- You can change the version number in the URL to use a different version -->
16
- <script src="https://assets.frankiefinancial.io/one-sdk/v1/oneSdk.umd.js"></script>
17
-
18
- <script>
19
- ${getTokenImpl}
20
-
21
- // Main function to initialize and start OneSDK
22
- async function startOneSdk() {
23
- const sessionToken = await getToken();
24
-
25
- // Initialize OneSDK with configuration
26
- const oneSdk = await OneSdk({
27
- session: sessionToken,
28
- mode: 'production',
29
- recipe: {
30
- form: {
31
- provider: {
32
- name: 'react',
33
- // UNCOMMENT AND ADD YOUR KEY to use Google Places address autocomplete
34
- // googleApiKey: "<GOOGLE_API_KEY>",
35
- },
36
- },
37
- },
38
- });
39
-
40
- const oneSdkIndividual = oneSdk.individual();
41
- oneSdkIndividual.addConsent("general");
42
- oneSdkIndividual.addConsent("docs");
43
- oneSdkIndividual.addConsent("creditheader");
44
- await oneSdkIndividual.submit();
45
-
46
- // Create an IDV flow instance for identity verification
47
- const idv = oneSdk.flow('idv');
48
-
49
- // Create review component for OCR (Optical Character Recognition) review
50
- const review = oneSdk.component('form', {
51
- name: 'REVIEW',
52
- type: 'ocr',
53
- mode: 'individual',
54
- verify: true
55
- });
56
-
57
- const successScreen = oneSdk.component('form', {
58
- name: 'RESULT',
59
- mode: 'individual',
60
- type: 'manual',
61
- state: 'SUCCESS',
62
- title: { label: "Thanks, you're all done" },
63
- cta: null,
64
- });
65
-
66
- const failedScreen = oneSdk.component("form", {
67
- name: "RESULT",
68
- mode: "individual",
69
- state: "FAIL",
70
- type: "manual",
71
- });
72
-
73
- review.on('form:review:ready', async () => {
74
- try {
75
- // Submit the review form and run verification
76
- let res = oneSdkIndividual.submit({ verify: true });
77
- console.log('submit and run verification result: ', res);
78
- successScreen.mount('#onesdk-container');
79
- } catch (error) {
80
- console.error(error);
81
- failedScreen.mount('#onesdk-container');
82
- }
83
- });
84
-
85
- // Mount the IDV flow to the container element
86
- idv.mount('#onesdk-container');
87
-
88
- // Handle verification results
89
- idv.on('results', async ({ checkStatus, document, entityId }) => {
90
- if (checkStatus) {
91
- console.log('results succesful');
92
- review.mount('#onesdk-container');
93
- } else {
94
- console.log('no data returned');
95
- }
96
- });
97
-
98
- // Handle errors during verification
99
- idv.on('error', ({ message, payload }) => {
100
- console.log('received error');
101
- console.log(message, payload);
102
- });
103
-
104
- // Handle completion of document detection/capture
105
- idv.on('detection_complete', (message) => {
106
- console.log('capture finished');
107
- console.log(message);
108
- });
109
-
110
- // Log all events for debugging
111
- idv.on('*', (message) => {
112
- console.log(message);
113
- });
114
- }
115
- </script>
116
- ${css}
117
- </head>
118
-
119
- <body onload="startOneSdk()">
120
- <!-- Container element where OneSDK will mount its UI components -->
121
- <div id="onesdk-container"></div>
122
- </body>
123
- </html>`;
124
- //# sourceMappingURL=templateIdvReview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateIdvReview.js","sourceRoot":"","sources":["../../../../../modules/cli/template/templateIdvReview.js"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;MAgBjD,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiGZ,GAAG;;;;;;;QAOD,CAAC"}
@@ -1,2 +0,0 @@
1
- export function templateManualKyc(getTokenImpl: any): string;
2
- //# sourceMappingURL=templateManualKyc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateManualKyc.d.ts","sourceRoot":"","sources":["../../../../../modules/cli/template/templateManualKyc.js"],"names":[],"mappings":"AAIO,6DAkNC"}