@adyen/kyc-components 2.40.0 → 2.41.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.
@@ -11,4 +11,4 @@ export declare enum BusinessTypeSelectionStep {
11
11
  CONFIRM_BUSINESS_SETUP_CHANGE = 3
12
12
  }
13
13
  export declare const businessTypeSelectionStepTitles: Record<BusinessTypeSelectionStep, TranslationKey>;
14
- export declare const BusinessTypeSelection: ({ legalEntityResponse, accountHolder, onAccountHolderSelect, handleUpdateLegalEntity, taskHistory, setTaskHistory, onNavigateTo, baseTrackingPayload, }: BusinessTypeSelectionProps) => JSX.Element | null;
14
+ export declare const BusinessTypeSelection: ({ legalEntityResponse, accountHolder, onComplete, onBack, handleUpdateLegalEntity, baseTrackingPayload, }: BusinessTypeSelectionProps) => JSX.Element | null;
@@ -2,14 +2,11 @@ import type { ExistingLegalEntity } from '../../core/models/api/legal-entity';
2
2
  import type { TranslationKey } from '../../language/types';
3
3
  import type { DropinAPIHandlers, DropinProps } from '../Dropins/types';
4
4
  import type { AccountHolderOption, LegalArrangementOption } from '../internal/AccountHolder/types';
5
- import type { TaskTypes } from '../TaskList/types';
6
5
  export interface BusinessTypeSelectionProps extends DropinAPIHandlers, DropinProps {
7
6
  legalEntityResponse: ExistingLegalEntity;
8
- accountHolder?: AccountHolderOption;
9
- onAccountHolderSelect: (accountHolder: AccountHolderOption) => void;
10
- taskHistory: TaskTypes[];
11
- setTaskHistory: (tasks: TaskTypes[]) => void;
12
- onNavigateTo: (task: TaskTypes) => void;
7
+ accountHolder: AccountHolderOption | null;
8
+ onComplete: (accountHolder: AccountHolderOption) => void;
9
+ onBack?: () => void;
13
10
  }
14
11
  export interface BusinessTypeSelectionSchema {
15
12
  businessType?: BusinessTypeModel;
@@ -20,7 +20,7 @@ import type { BusinessType, BusinessTypeModel, LegalArrangementModel, TrusteeTyp
20
20
  * @param companyTypesValue - the subtype of an organization see CompanyValuesType
21
21
  */
22
22
  export declare const organizationTypesToSkipCompanyStructureForm: string[];
23
- export declare const getBusinessType: (businessTypeItems: BusinessTypeModel[], country: CountryCode, accountHolder?: AccountHolderOption, legalEntityType?: LegalEntityType, companyTypesValue?: CompanyTypesValue | '', capabilities?: CapabilityName[]) => BusinessTypeModel | undefined;
23
+ export declare const getBusinessType: (businessTypeItems: BusinessTypeModel[], country: CountryCode, accountHolder: AccountHolderOption | null, legalEntityType?: LegalEntityType, companyTypesValue?: CompanyTypesValue | '', capabilities?: CapabilityName[]) => BusinessTypeModel | undefined;
24
24
  export declare const businessTypes: readonly BusinessTypeModel[];
25
25
  export declare const businessTypeIcons: Record<BusinessType, IconName>;
26
26
  export declare const useSelectionOptions: (legalEntityResponse: ExistingLegalEntity) => {
@@ -31,5 +31,5 @@ export declare const useSelectionOptions: (legalEntityResponse: ExistingLegalEnt
31
31
  *
32
32
  */
33
33
  export declare const mapLegalArrangementOptionToCompanyTypesValue: (legalArrangement: LegalArrangementOption | undefined) => CompanyTypesValue | '';
34
- export declare const getDefaultLegalArrangementOrSuborganizationType: (legalEntityResponse: ExistingLegalEntity | undefined, accountHolder: AccountHolderOption | undefined) => LegalArrangementOption | undefined;
34
+ export declare const getDefaultLegalArrangementOrSuborganizationType: (legalEntityResponse: ExistingLegalEntity | undefined, accountHolder: AccountHolderOption | null) => LegalArrangementOption | undefined;
35
35
  export declare const getTargetLegalEntityType: (businessType: BusinessType | undefined, legalArrangement: LegalArrangementOption | undefined, trusteeType: TrusteeType | undefined, currentLegalEntityType: LegalEntityType | undefined) => LegalEntityType;
@@ -5,7 +5,7 @@ import type { CompanyProps } from '../types';
5
5
  export declare const companyForms: {
6
6
  readonly companyNameAndCountry: {
7
7
  readonly formId: "companyNameAndCountry";
8
- readonly formName: "nameAndCountry";
8
+ readonly formName: "basicInformation";
9
9
  readonly fields: ("country" | "legalCompanyName")[];
10
10
  };
11
11
  readonly companyType: {
@@ -0,0 +1,16 @@
1
+ import type { ExistingLegalEntity } from '../../../../core/models/api/legal-entity';
2
+ import { TaskTypes } from '../../../TaskList/types';
3
+ import type { DropinAPIHandlers } from '../../types';
4
+ interface UseNavigationOptions {
5
+ legalEntity: ExistingLegalEntity;
6
+ onNavigate?: (task: TaskTypes) => void;
7
+ handleOpenSingpassAuthorizationLink: DropinAPIHandlers['handleOpenSingpassAuthorizationLink'] | undefined;
8
+ }
9
+ interface UseNavigation {
10
+ currentTask: TaskTypes | undefined;
11
+ previousTask: TaskTypes | undefined;
12
+ navigateTo: (task: TaskTypes | 'default', deletePreviousHistory?: boolean) => void;
13
+ navigateBack: (stepCount?: number) => void;
14
+ }
15
+ export declare const useNavigation: ({ legalEntity, onNavigate, handleOpenSingpassAuthorizationLink, }: UseNavigationOptions) => UseNavigation;
16
+ export {};
@@ -9,9 +9,10 @@ export interface ViewVerificationStatusComponentProps {
9
9
  hideExplanation?: boolean;
10
10
  returnUrl?: string;
11
11
  redirectTarget?: OnboardingUrlTarget;
12
+ themeId?: string;
12
13
  onStatusChange?: (status: OnboardingStatus) => void;
13
14
  onError?: (errorEntity: ErrorEntity) => void;
14
15
  onRedirect?: (config: OnboardingRedirectConfig) => void;
15
16
  eventEmitter?: EventEmitter;
16
17
  }
17
- export declare function ViewVerificationStatusComponent({ legalEntityId, hideExplanation, returnUrl, redirectTarget, onStatusChange, onError, onRedirect, eventEmitter, }: ViewVerificationStatusComponentProps): import("preact").JSX.Element;
18
+ export declare function ViewVerificationStatusComponent({ legalEntityId, hideExplanation, returnUrl, redirectTarget, themeId, onStatusChange, onError, onRedirect, eventEmitter, }: ViewVerificationStatusComponentProps): import("preact").JSX.Element;
@@ -2,7 +2,7 @@ import type { SolePropProps } from '../types';
2
2
  export declare const solePropForms: {
3
3
  readonly solePropNameAndCountry: {
4
4
  readonly formId: "solePropNameAndCountry";
5
- readonly formName: "nameAndCountry";
5
+ readonly formName: "basicInformation";
6
6
  readonly fields: ("country" | "legalCompanyName")[];
7
7
  };
8
8
  readonly solePropRegistrationDetails: {
@@ -1,3 +1 @@
1
- import type { AccordionContextType } from '../Accordion/types';
2
- declare function useAccordionContext(): AccordionContextType;
3
- export default useAccordionContext;
1
+ export declare const useAccordionContext: () => import("../Accordion/types").AccordionContextType;
@@ -4,7 +4,7 @@ import type { CountryCode } from '../models/country-code';
4
4
  export interface CoreContextType {
5
5
  setContextCountry: (country: CountryCode) => void;
6
6
  contextCountry: CountryCode;
7
- setAccountHolder: (accountHolder: AccountHolderOption | null) => void;
7
+ setAccountHolder: (accountHolder: AccountHolderOption) => void;
8
8
  accountHolder: AccountHolderOption | null;
9
9
  setAccountFormat: (bankAccountFormat: BankAccountFormatType) => void;
10
10
  accountFormat: BankAccountFormatType;
@@ -2,7 +2,7 @@ import type { ComponentChildren } from 'preact';
2
2
  import type { CountryCode } from '../models/country-code';
3
3
  export interface CoreProviderProps {
4
4
  contextCountry: CountryCode;
5
- enableNewEntryFlowExperiment?: boolean;
5
+ rootLegalEntityId: string;
6
6
  children?: ComponentChildren;
7
7
  }
8
- export declare const CoreProvider: ({ contextCountry: initialContextCountry, enableNewEntryFlowExperiment, children, }: CoreProviderProps) => import("preact").JSX.Element;
8
+ export declare const CoreProvider: ({ contextCountry: initialContextCountry, rootLegalEntityId, children, }: CoreProviderProps) => import("preact").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { QueryClient } from '@tanstack/react-query';
2
+ export declare const ReactQueryClient: QueryClient;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare function ReactQueryProvider({ children }: {
3
+ children: JSX.Element;
4
+ }): import("preact").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { SingpassLinkResponse } from '../../../components/Dropins/types';
2
+ import type { AccountHolderOption } from '../../../components/internal/AccountHolder/types';
3
+ import type { ExistingLegalEntity } from '../../models/api/legal-entity';
4
+ interface UseIsEligibleForSingpassProps {
5
+ legalEntity: ExistingLegalEntity;
6
+ accountHolder: AccountHolderOption | null;
7
+ handleOpenSingpassAuthorizationLink: (() => Promise<SingpassLinkResponse>) | undefined;
8
+ }
9
+ export declare const useIsEligibleForSingpass: ({ legalEntity, accountHolder, handleOpenSingpassAuthorizationLink, }: UseIsEligibleForSingpassProps) => boolean;
10
+ export {};
@@ -1,2 +1,7 @@
1
1
  import type { AccountHolderOption } from '../../components/internal/AccountHolder/types';
2
- export declare const useAccountHolder: (enableNewEntryFlow: boolean) => [accountHolder: AccountHolderOption, setAccountHolder: (accountHolder: AccountHolderOption | null) => void];
2
+ interface UseAccountHolder {
3
+ accountHolder: AccountHolderOption | null;
4
+ setAccountHolder: (accountHolder: AccountHolderOption) => void;
5
+ }
6
+ export declare const useAccountHolder: (legalEntityId: string) => UseAccountHolder;
7
+ export {};
@@ -16,6 +16,7 @@ export interface OnboardingStatusResponse {
16
16
  export interface OnboardingLinkConfig {
17
17
  locale: string;
18
18
  returnUrl?: string;
19
+ themeId?: string;
19
20
  }
20
21
  export interface OnboardingLinkResponse {
21
22
  redirectUrl: string;
@@ -13,6 +13,7 @@ export interface ValidationError {
13
13
  errorCode: string;
14
14
  }
15
15
  export declare const isValidationError: (error: Error | undefined) => boolean;
16
+ export declare const isDocumentUploadError: (error: Error | undefined) => boolean;
16
17
  export interface ValidationResponse {
17
18
  invalidFields?: InvalidField[];
18
19
  errorCode?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.40.0",
3
+ "version": "2.41.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -70,11 +70,13 @@
70
70
  "dependencies": {
71
71
  "@adyen/adyen-document-viewer": "^1.1.0",
72
72
  "@adyen/openbankingsdk": "^0.1.2",
73
+ "@tanstack/react-query": "^5.31.0",
73
74
  "classnames": "^2.3.2",
74
75
  "isomorphic-dompurify": "^0.13.0",
75
76
  "lodash": "^4.17.21",
76
77
  "onfido-sdk-ui": "12.3.5",
77
- "preact": "^10.17.1"
78
+ "preact": "^10.17.1",
79
+ "validator": "^13.5.2"
78
80
  },
79
81
  "devDependencies": {
80
82
  "@commitlint/cli": "^17.7.1",
@@ -87,11 +89,13 @@
87
89
  "@storybook/core-server": "^8.0.4",
88
90
  "@storybook/preact": "^8.0.4",
89
91
  "@storybook/preact-vite": "^8.0.4",
92
+ "@tanstack/eslint-plugin-query": "^4.38.0",
90
93
  "@testing-library/jest-dom": "^5.17.0",
91
94
  "@testing-library/preact": "^3.2.3",
92
95
  "@testing-library/user-event": "^14.4.3",
93
96
  "@types/dompurify": "^3.0.5",
94
97
  "@types/inquirer": "^9.0.3",
98
+ "@types/validator": "^13.12.0",
95
99
  "@typescript-eslint/eslint-plugin": "^5.62.0",
96
100
  "@typescript-eslint/parser": "^5.62.0",
97
101
  "@vitest/coverage-v8": "^1.3.1",
@@ -139,9 +143,11 @@
139
143
  },
140
144
  "@storybook/preact-vite": {
141
145
  "vite": "^4 || ^5"
142
- }
146
+ },
147
+ "react": "npm:@preact/compat",
148
+ "react-dom": "npm:@preact/compat"
143
149
  },
144
150
  "engines": {
145
- "node": ">=18"
151
+ "node": ">=20"
146
152
  }
147
153
  }
@@ -1,14 +0,0 @@
1
- import type { SingpassLinkResponse } from '../../../components/Dropins/types';
2
- import type { AccountHolderOption } from '../../../components/internal/AccountHolder/types';
3
- import type { ExistingLegalEntity } from '../../models/api/legal-entity';
4
- interface UseShouldShowSingpassProps {
5
- isExperimentEnabled: boolean;
6
- legalEntity: ExistingLegalEntity;
7
- accountHolder?: AccountHolderOption;
8
- handleOpenSingpassAuthorizationLink?: () => Promise<SingpassLinkResponse>;
9
- }
10
- export declare const useShouldShowSingpass: ({ isExperimentEnabled, legalEntity, accountHolder, handleOpenSingpassAuthorizationLink, }: UseShouldShowSingpassProps) => {
11
- shouldShowSingpass: boolean;
12
- shouldShowSingpassForAccountHolder: (newAccountHolder?: AccountHolderOption) => boolean;
13
- };
14
- export {};
@@ -1 +0,0 @@
1
- export declare const useLeId: () => [id: string, setLeId: (id: string | null) => void | null];