@adyen/kyc-components 2.59.9 → 2.59.11

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.
@@ -6,6 +6,7 @@ import cx from "classnames";
6
6
  import { lazy, Suspense, forwardRef, memo, useMemo as useMemo$1 } from "preact/compat";
7
7
  import debounce$1 from "lodash-es/debounce";
8
8
  import isISIN from "validator/es/lib/isISIN.js";
9
+ import { Onfido } from "onfido-sdk-ui";
9
10
  import OpenBankingSDK from "@adyen/openbankingsdk";
10
11
  import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
11
12
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
@@ -15306,42 +15307,34 @@ const getOnfidoLocaleConfig = (i18n) => {
15306
15307
  const initOnfido = async ({
15307
15308
  token,
15308
15309
  i18n,
15309
- onIdVerificationClose,
15310
15310
  onIdVerificationComplete,
15311
15311
  onIdVerificationError
15312
- }) => {
15313
- const { init: init2 } = await import("onfido-sdk-ui");
15314
- return init2({
15315
- token,
15316
- containerId,
15317
- disableAnalytics: false,
15318
- useModal: false,
15319
- isModalOpen: false,
15320
- onUserExit: onIdVerificationClose,
15321
- onComplete: onIdVerificationComplete,
15322
- onError: onIdVerificationError,
15323
- steps: [
15324
- {
15325
- type: "document",
15326
- options: {
15327
- documentTypes: {
15328
- [DocumentType.PASSPORT]: true,
15329
- [DocumentType.DRIVING_LICENCE]: true,
15330
- [DocumentType.NATIONAL_IDENTITY_CARD]: true,
15331
- [DocumentType.RESIDENCE_PERMIT]: false
15332
- }
15312
+ }) => Onfido.init({
15313
+ token,
15314
+ containerId,
15315
+ disableAnalytics: false,
15316
+ onComplete: onIdVerificationComplete,
15317
+ onError: onIdVerificationError,
15318
+ steps: [
15319
+ {
15320
+ type: "document",
15321
+ options: {
15322
+ documentTypes: {
15323
+ [DocumentType.PASSPORT]: true,
15324
+ [DocumentType.DRIVING_LICENCE]: true,
15325
+ [DocumentType.NATIONAL_IDENTITY_CARD]: true,
15326
+ [DocumentType.RESIDENCE_PERMIT]: false
15333
15327
  }
15334
15328
  }
15335
- ],
15336
- language: getOnfidoLocaleConfig(i18n)
15337
- });
15338
- };
15329
+ }
15330
+ ],
15331
+ language: getOnfidoLocaleConfig(i18n)
15332
+ });
15339
15333
  const logger$v = createLogger("IdVerificationComponent");
15340
15334
  function IdVerificationComponent({
15341
15335
  userDetails,
15342
15336
  legalEntityId,
15343
15337
  handleGetIdVerificationToken,
15344
- onIdVerificationClose,
15345
15338
  onIdVerificationError,
15346
15339
  onIdVerificationComplete
15347
15340
  }) {
@@ -15359,19 +15352,15 @@ function IdVerificationComponent({
15359
15352
  onfidoSdk.current = await initOnfido({
15360
15353
  token: sdkToken2,
15361
15354
  i18n,
15362
- onIdVerificationClose,
15363
15355
  onIdVerificationError,
15364
- onIdVerificationComplete
15356
+ onIdVerificationComplete,
15357
+ language: getOnfidoLocaleConfig(i18n)
15365
15358
  });
15366
15359
  })().catch(logger$v.error);
15367
- return () => {
15368
- if (onfidoSdk.current) onfidoSdk.current.tearDown();
15360
+ return async () => {
15361
+ if (onfidoSdk.current) await onfidoSdk.current.tearDown();
15369
15362
  };
15370
- }, [sdkToken2]);
15371
- useEffect(() => {
15372
- if (!onfidoSdk.current) return;
15373
- onfidoSdk.current.setOptions({ language: getOnfidoLocaleConfig(i18n) });
15374
- }, [i18n.locale]);
15363
+ }, [sdkToken2, i18n]);
15375
15364
  return /* @__PURE__ */ jsx(LoaderWrapper, { status: loadingStatus, children: /* @__PURE__ */ jsx("div", { id: containerId, className: containerId }) });
15376
15365
  }
15377
15366
  function IdDocumentAlreadyUpload(props) {
@@ -24350,10 +24339,16 @@ function getPropsFromConfigurations(scenarioConfiguration, forms, remediationAct
24350
24339
  }
24351
24340
  case TrustedFieldsProvider.SINGPASS: {
24352
24341
  if (legalEntityType === "organization") {
24353
- return [...acc, ...trusted.fields.map((tf) => businessDetailsApiKeyMapping[tf])];
24342
+ const orgFields = trusted.fields.filter(
24343
+ (field) => (field == null ? void 0 : field.split(".")[0]) === "organization"
24344
+ );
24345
+ return [...acc, ...orgFields.map((tf) => businessDetailsApiKeyMapping[tf])];
24354
24346
  }
24355
24347
  if (legalEntityType === "individual") {
24356
- return [...acc, ...trusted.fields.map((tf) => individualApiKeyMapping[tf])];
24348
+ const individualFields = trusted.fields.filter(
24349
+ (field) => (field == null ? void 0 : field.split(".")[0]) === "individual"
24350
+ );
24351
+ return [...acc, ...individualFields.map((tf) => individualApiKeyMapping[tf])];
24357
24352
  }
24358
24353
  return acc;
24359
24354
  }
@@ -39410,7 +39405,7 @@ const ConfigurationApiProvider = ({
39410
39405
  }) => {
39411
39406
  const authContext = useAuthContext();
39412
39407
  const { isEmbeddedDropin, loadingContext } = authContext;
39413
- const sdkVersion = "2.59.9";
39408
+ const sdkVersion = "2.59.11";
39414
39409
  useAnalytics({
39415
39410
  onUserEvent,
39416
39411
  legalEntityId: rootLegalEntityId,
@@ -40083,7 +40078,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40083
40078
  };
40084
40079
  const copyToClipboard = async () => {
40085
40080
  const toCopy = {
40086
- sdkVersion: "2.59.9",
40081
+ sdkVersion: "2.59.11",
40087
40082
  experiments: Object.fromEntries(allExperimentsWithValues),
40088
40083
  settings: Object.fromEntries(allSettingsWithValues)
40089
40084
  };
@@ -40148,7 +40143,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40148
40143
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
40149
40144
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40150
40145
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
40151
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.59.9" })
40146
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.59.11" })
40152
40147
  ] }) }),
40153
40148
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40154
40149
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
@@ -1,3 +1,3 @@
1
1
  import './IdVerificationComponent.scss';
2
2
  import type { IdVerificationProps } from '../types';
3
- export declare function IdVerificationComponent({ userDetails, legalEntityId, handleGetIdVerificationToken, onIdVerificationClose, onIdVerificationError, onIdVerificationComplete, }: IdVerificationProps): import("preact").JSX.Element;
3
+ export declare function IdVerificationComponent({ userDetails, legalEntityId, handleGetIdVerificationToken, onIdVerificationError, onIdVerificationComplete, }: IdVerificationProps): import("preact").JSX.Element;
@@ -12,3 +12,35 @@ export interface UserDetails {
12
12
  lastName?: string;
13
13
  residencyCountry?: string;
14
14
  }
15
+ type OnfidoSdkErrorTypes = 'invalid_token' | 'expired_token' | 'expired_trial' | 'geoblocked_request' | 'permissions_unavailable' | 'exception' | 'unsupported' | 'unsupported_feature' | 'invalid_sdk_parameter' | 'restart' | 'desktop' | 'unsupported_sdk_version' | 'no_camera' | 'user_consent_denied' | 'uncaught_fetch_error' | 'api_error' | 'cross_device_verification_invalid' | 'cross_device_verification_abort' | 'workflow_abandoned' | 'workflow_error';
16
+ export interface OnfidoErrorCallback {
17
+ type: OnfidoSdkErrorTypes;
18
+ message: string;
19
+ exception?: Error | unknown;
20
+ }
21
+ export interface OnfidoCompleteData {
22
+ document_front?: {
23
+ id: string;
24
+ type: string;
25
+ side: 'front';
26
+ };
27
+ document_back?: {
28
+ id: string;
29
+ type: string;
30
+ side: 'back';
31
+ };
32
+ face?: {
33
+ id: string;
34
+ variant: 'standard' | 'video';
35
+ };
36
+ }
37
+ export interface OnfidoLocaleConfig {
38
+ locale: string;
39
+ phrases?: {
40
+ [key: string]: string;
41
+ };
42
+ mobilePhrases?: {
43
+ [key: string]: string;
44
+ };
45
+ }
46
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.59.9",
3
+ "version": "2.59.11",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",
@@ -85,7 +85,7 @@
85
85
  "classnames": "^2.3.2",
86
86
  "isomorphic-dompurify": "^2.17.0",
87
87
  "lodash-es": "^4.17.21",
88
- "onfido-sdk-ui": "12.3.5",
88
+ "onfido-sdk-ui": "14.38.0",
89
89
  "preact": "^10.17.1",
90
90
  "validator": "^13.5.2"
91
91
  },