@adyen/kyc-components 2.42.0 → 2.43.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.
Files changed (112) hide show
  1. package/dist/es/adyen-kyc-components.es.js +2967 -1497
  2. package/dist/es/{arrow-left-CwJQyOFz.js → arrow-left-CCxYxfCP.js} +1 -1
  3. package/dist/es/{arrow-right-Cs_AKUOH.js → arrow-right-DF4Qe-8E.js} +1 -1
  4. package/dist/es/{bin-8yaAerXc.js → bin-CGwewvcn.js} +1 -1
  5. package/dist/es/{check-_cOIMziL.js → check-CeSLN4_9.js} +1 -1
  6. package/dist/es/{checkmark-CZpv8i5a.js → checkmark-DEh9MPYR.js} +1 -1
  7. package/dist/es/{checkmark-small-C4TPve-W.js → checkmark-small-D_9HLctx.js} +1 -1
  8. package/dist/es/{chevron-down-CwS2tE_6.js → chevron-down-BzENwYSf.js} +1 -1
  9. package/dist/es/{chevron-right-B8cQLres.js → chevron-right-DczMHcvL.js} +1 -1
  10. package/dist/es/{chevron-up-DccG0tVR.js → chevron-up-BLtnROd5.js} +1 -1
  11. package/dist/es/{company-2-Cof0usfn.js → company-2-JG34IScE.js} +1 -1
  12. package/dist/es/{company-BKO80hWm.js → company-D5_F_6SW.js} +1 -1
  13. package/dist/es/{contract-DrX5y2Qf.js → contract-C6wDy9zU.js} +1 -1
  14. package/dist/es/{controlling-person-B_dn0b9H.js → controlling-person-C4KoSyi2.js} +1 -1
  15. package/dist/es/{cross-aFMJCrLf.js → cross-BadGfrgB.js} +1 -1
  16. package/dist/es/{decision-maker-28_rW1ah.js → decision-maker-Cef3-OzY.js} +1 -1
  17. package/dist/es/{document-Bn_3PIDG.js → document-Cg4kZHpA.js} +1 -1
  18. package/dist/es/{download-DgAZobJV.js → download-DGC5_Bxe.js} +1 -1
  19. package/dist/es/{edit-Dg19Ah77.js → edit--fDhojib.js} +1 -1
  20. package/dist/es/{field-error-DkFiF_Cv.js → field-error-WElEN1mN.js} +1 -1
  21. package/dist/es/{info-circle-CXFfd_nO.js → info-circle-DkHN1ugA.js} +1 -1
  22. package/dist/es/{light-bulb-CQ29JPA7.js → light-bulb-DEUhbRWP.js} +1 -1
  23. package/dist/es/{location-DmmjAv9A.js → location-B1Til-7Q.js} +1 -1
  24. package/dist/es/{more-horiz-dyZQKaOn.js → more-horiz-BieZKfy3.js} +1 -1
  25. package/dist/es/{new-document-CeV8zHP8.js → new-document-BEAJnXCG.js} +1 -1
  26. package/dist/es/{owners-C1dyQqRO.js → owners-D1pksb86.js} +1 -1
  27. package/dist/es/{payout-B-c43MDS.js → payout-BFiI--HY.js} +1 -1
  28. package/dist/es/{pci-CVqIvwR-.js → pci-DMQLRoAn.js} +1 -1
  29. package/dist/es/{plus-BUH0nzS_.js → plus-DAnbeoyS.js} +1 -1
  30. package/dist/es/{remove-Bor5X8Xu.js → remove-CEmd9YX7.js} +1 -1
  31. package/dist/es/{review-DcoDSRJT.js → review-CeQeKHXH.js} +1 -1
  32. package/dist/es/{search-SGLIdnsr.js → search-hf3HRVbu.js} +1 -1
  33. package/dist/es/{signatory-BMaWV_18.js → signatory-BVoLPYPu.js} +1 -1
  34. package/dist/es/{store-N4c2LHJ_.js → store-D2z639xh.js} +1 -1
  35. package/dist/es/{trust-BcVDhtGL.js → trust-CpcaQaV7.js} +1 -1
  36. package/dist/es/{user-C8STPF6-.js → user-D6swzlYs.js} +1 -1
  37. package/dist/es/{user-business-Dcvcw8gB.js → user-business-CwS5j1qX.js} +1 -1
  38. package/dist/es/{users-3-D3QDBEk-.js → users-3-BdjQ9rEA.js} +1 -1
  39. package/dist/es/{warning-Dxxpni4H.js → warning-99uFf1WU.js} +1 -1
  40. package/dist/es/{wrong-DNwa4zZR.js → wrong-1wvh7nZe.js} +1 -1
  41. package/dist/style.css +1386 -1149
  42. package/dist/types/components/BaseElement.d.ts +3 -0
  43. package/dist/types/components/BusinessDetails/component/BusinessDetailsComponent.d.ts +2 -0
  44. package/dist/types/components/BusinessDetails/forms.d.ts +23 -0
  45. package/dist/types/components/BusinessDetails/index.d.ts +1 -0
  46. package/dist/types/components/BusinessDetails/types.d.ts +33 -0
  47. package/dist/types/components/Company/component/CompanyComponent.d.ts +2 -2
  48. package/dist/types/components/Company/rules.d.ts +4 -10
  49. package/dist/types/components/CompanyNameAndCountry/component/CompanyNameAndCountryComponent.d.ts +1 -0
  50. package/dist/types/components/CompanyNameAndCountry/types.d.ts +2 -1
  51. package/dist/types/components/CompanySearch/forms.d.ts +1 -1
  52. package/dist/types/components/Dropins/BusinessDetailsDropin/components/BusinessDetailsDropinComponent.d.ts +2 -0
  53. package/dist/types/components/Dropins/BusinessDetailsDropin/index.d.ts +1 -0
  54. package/dist/types/components/Dropins/BusinessDetailsDropin/types.d.ts +55 -0
  55. package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +12 -0
  56. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  57. package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +1 -1
  58. package/dist/types/components/Dropins/CompanySearchDropin/types.d.ts +2 -0
  59. package/dist/types/components/Dropins/DropinComposer/components/DropinComposerComponent.d.ts +1 -1
  60. package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
  61. package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
  62. package/dist/types/components/Dropins/PciDropin/components/PciDropinComponent.d.ts +1 -1
  63. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/components/ServiceAgreementDropinComponent.d.ts +1 -1
  64. package/dist/types/components/Dropins/ServiceAgreementDropinComponent/types.d.ts +1 -0
  65. package/dist/types/components/Dropins/SolePropDropin/components/SolePropDropinComponent.d.ts +1 -1
  66. package/dist/types/components/Dropins/types.d.ts +3 -5
  67. package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +1 -3
  68. package/dist/types/components/EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent.d.ts +1 -3
  69. package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/ViewVerificationStatusComponent.d.ts +1 -3
  70. package/dist/types/components/EventEmitter.d.ts +2 -0
  71. package/dist/types/components/PayoutAccount/types.d.ts +0 -2
  72. package/dist/types/components/PayoutDetails/types.d.ts +0 -2
  73. package/dist/types/components/SoleProp/component/SolePropComponent.d.ts +1 -1
  74. package/dist/types/components/TaskList/component/TaskListItem.d.ts +1 -1
  75. package/dist/types/components/TaskList/types.d.ts +1 -0
  76. package/dist/types/components/UIElement.d.ts +4 -6
  77. package/dist/types/components/index.d.ts +2 -0
  78. package/dist/types/components/internal/CountryField/CountryField.d.ts +1 -1
  79. package/dist/types/components/internal/CountryOfGoverningLawField/CountryOfGoverningLawField.d.ts +3 -0
  80. package/dist/types/components/internal/CountryOfGoverningLawField/index.d.ts +1 -0
  81. package/dist/types/components/internal/CountryOfGoverningLawField/types.d.ts +9 -0
  82. package/dist/types/components/internal/Modal/Modal.d.ts +21 -0
  83. package/dist/types/components/internal/Summary/Summary.d.ts +1 -1
  84. package/dist/types/components/internal/Summary/types.d.ts +1 -0
  85. package/dist/types/core/Context/ExperimentContext/types.d.ts +4 -2
  86. package/dist/types/core/Context/ExpiryContext/ExpiredBanner.d.ts +1 -0
  87. package/dist/types/core/Context/ExpiryContext/ExpiryContext.d.ts +11 -0
  88. package/dist/types/core/Context/ExpiryContext/ExpiryModal.d.ts +6 -0
  89. package/dist/types/core/Context/ExpiryContext/useExpiryThreshold.d.ts +12 -0
  90. package/dist/types/core/Context/I18nProvider/I18nProvider.d.ts +3 -1
  91. package/dist/types/core/Context/StateContext/types.d.ts +3 -2
  92. package/dist/types/core/SDKValidation/index.d.ts +1 -1
  93. package/dist/types/core/core.d.ts +2 -1
  94. package/dist/types/core/hooks/useForm/types.d.ts +11 -0
  95. package/dist/types/core/hooks/useIsElementVisible.d.ts +2 -2
  96. package/dist/types/core/hooks/useScenarioConfiguration.d.ts +2 -1
  97. package/dist/types/core/models/api/contracts.d.ts +4 -0
  98. package/dist/types/core/models/api/organization.d.ts +9 -3
  99. package/dist/types/core/models/company.d.ts +4 -0
  100. package/dist/types/core/process-field-configurations.d.ts +3 -4
  101. package/dist/types/core/types.d.ts +11 -0
  102. package/dist/types/utils/company-util.d.ts +7 -1
  103. package/dist/types/utils/getFieldsWithExistingData.d.ts +2 -1
  104. package/dist/types/utils/mapping/businessDetails/index.d.ts +2 -0
  105. package/dist/types/utils/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +5 -0
  106. package/dist/types/utils/mapping/businessDetails/mapLegalEntityToBusinessDetailsSchema.d.ts +4 -0
  107. package/dist/types/utils/mapping/companySearch/mapLegalEntityToCompanySearchSchema.d.ts +2 -1
  108. package/dist/types/utils/mapping/componentApiMapping.d.ts +42 -1
  109. package/dist/types/utils/mapping/documentGuidanceMap.d.ts +1 -1
  110. package/package.json +2 -8
  111. package/dist/types/core/Context/QueryContext/QueryClient.d.ts +0 -2
  112. package/dist/types/core/Context/QueryContext/QueryClientProvider.d.ts +0 -4
@@ -5,12 +5,14 @@ import type { ComponentChildren } from 'preact';
5
5
  */
6
6
  export declare enum ExperimentNames {
7
7
  EnableCompanySearchFlow = "EnableCompanySearchFlow",
8
- EnableUSOnboardingFlow = "EnableUSOnboardingFlow",
8
+ EnableNewBusinessDetailsFlow = "EnableNewBusinessDetailsFlow",
9
9
  EnableNewEntryFlow = "EnableNewEntryFlow",
10
10
  AllowOrganizationSettlorWithExemptionReason = "AllowOrganizationSettlorWithExemptionReason",
11
11
  AllowMoreRolesForMainRootTrustee = "AllowMoreRolesForMainRootTrustee",
12
12
  ShowUnsupportedEntityType = "ShowUnsupportedEntityType",
13
- ShowSingPassButtonForCompanies = "ShowSingPassButtonForCompanies"
13
+ ShowSingPassButtonForCompanies = "ShowSingPassButtonForCompanies",
14
+ ShowExtraTaxExemptionReasons = "ShowExtraTaxExemptionReasons",
15
+ EnableCountryOfGoverningLawForUKCompanies = "EnableCountryOfGoverningLawForUKCompanies"
14
16
  }
15
17
  export type ExperimentName = `${ExperimentNames}`;
16
18
  export type Experiments = {
@@ -0,0 +1 @@
1
+ export declare const ExpiredBanner: () => import("preact").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ComponentChildren } from 'preact';
2
+ import type EventEmitter from '../../../components/EventEmitter';
3
+ export declare const ExpiryContext: import("preact").Context<boolean>;
4
+ export interface ExpiryProviderProps {
5
+ expiry?: number;
6
+ eventEmitter?: EventEmitter;
7
+ refreshExpiry?: () => Promise<number>;
8
+ children?: ComponentChildren;
9
+ }
10
+ export declare const ExpiryProvider: ({ expiry: initialExpiry, eventEmitter, refreshExpiry, children, }: ExpiryProviderProps) => import("preact").JSX.Element;
11
+ export declare const useHasExpired: () => boolean;
@@ -0,0 +1,6 @@
1
+ import './ExpiryModal.scss';
2
+ export interface ExpiryModalProps {
3
+ secondsUntilExpiry: number;
4
+ onContinue: () => void;
5
+ }
6
+ export declare const ExpiryModal: ({ secondsUntilExpiry, onContinue }: ExpiryModalProps) => import("preact").JSX.Element;
@@ -0,0 +1,12 @@
1
+ type UseExpiryThreshold = {
2
+ expiryStatus: 'notYetCloseToExpiry';
3
+ secondsUntilExpiry: undefined;
4
+ } | {
5
+ expiryStatus: 'almostExpired';
6
+ secondsUntilExpiry: number;
7
+ } | {
8
+ expiryStatus: 'expired';
9
+ secondsUntilExpiry: 0;
10
+ };
11
+ export declare const useExpiryThreshold: (expiry: number | undefined) => UseExpiryThreshold;
12
+ export {};
@@ -1,8 +1,10 @@
1
1
  import type { ComponentChildren } from 'preact';
2
+ import type EventEmitter from '../../../components/EventEmitter';
2
3
  import type { CustomTranslations } from '../../../language/types';
3
4
  export interface I18nProviderProps {
4
5
  locale: string;
5
6
  customTranslations?: CustomTranslations;
6
7
  children?: ComponentChildren;
8
+ eventEmitter?: EventEmitter;
7
9
  }
8
- export declare const I18nProvider: ({ locale: initialLocale, customTranslations, children, }: I18nProviderProps) => import("preact").JSX.Element;
10
+ export declare const I18nProvider: ({ locale: initialLocale, customTranslations, eventEmitter, children, }: I18nProviderProps) => import("preact").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { BusinessDetailsSchema } from '../../../components/BusinessDetails/types';
1
2
  import type { CompanySchema } from '../../../components/Company/types';
2
3
  import type { CompanySearchSchema } from '../../../components/CompanySearch/types';
3
4
  import type { TrustMemberSchema } from '../../../components/Dropins/RoleAndTypeDropin/types';
@@ -47,8 +48,8 @@ export type StateModel<TLDS extends TopLevelDataSchema = TopLevelDataSchema> = {
47
48
  prevState?: State<TLDS>;
48
49
  };
49
50
  };
50
- export type TopLevelDataSchema = IndividualSchema | CompanySchema | CompanySearchSchema | PayoutDetailsSchema | TrustSchema | TrustMemberSchema | SolePropSchema;
51
- export type AnyFormIdOfTLDS = keyof IndividualSchema | keyof CompanySchema | keyof CompanySearchSchema | keyof PayoutDetailsSchema | keyof TrustSchema | keyof TrustMemberSchema | keyof SolePropSchema;
51
+ export type TopLevelDataSchema = IndividualSchema | BusinessDetailsSchema | CompanySchema | CompanySearchSchema | PayoutDetailsSchema | TrustSchema | TrustMemberSchema | SolePropSchema;
52
+ export type AnyFormIdOfTLDS = keyof IndividualSchema | keyof BusinessDetailsSchema | keyof CompanySchema | keyof CompanySearchSchema | keyof PayoutDetailsSchema | keyof TrustSchema | keyof TrustMemberSchema | keyof SolePropSchema;
52
53
  export interface State<TLDS extends TopLevelDataSchema> {
53
54
  data: TLDS;
54
55
  allData: TLDS;
@@ -1,4 +1,4 @@
1
1
  import type { ComponentOptions } from '../../components';
2
2
  import type { CoreOptions } from '../types';
3
3
  export declare const validateCoreOptions: (coreOptions: CoreOptions) => void;
4
- export declare const validateForComponent: <Name extends "payoutAccount" | "pci" | "individualDropin" | "companyDropin" | "companySearchDropin" | "taskList" | "trustDropin" | "soleProprietorDropin" | "createTransferInstrumentComponent" | "createIndividualComponent" | "viewVerificationStatusComponent">(componentName: Name, options: ComponentOptions<Name>) => void;
4
+ export declare const validateForComponent: <Name extends "payoutAccount" | "pci" | "taskList" | "individualDropin" | "businessDetailsDropin" | "companyDropin" | "companySearchDropin" | "trustDropin" | "soleProprietorDropin" | "createTransferInstrumentComponent" | "createIndividualComponent" | "viewVerificationStatusComponent">(componentName: Name, options: ComponentOptions<Name>) => void;
@@ -8,7 +8,7 @@ export declare class Core {
8
8
  };
9
9
  components: UIElement[];
10
10
  constructor(coreOptions: CoreOptions);
11
- create: <Name extends "payoutAccount" | "pci" | "individualDropin" | "companyDropin" | "companySearchDropin" | "taskList" | "trustDropin" | "soleProprietorDropin" | "createTransferInstrumentComponent" | "createIndividualComponent" | "viewVerificationStatusComponent">(componentName: Name, componentOptions: ComponentOptions<Name>) => UIElement;
11
+ create: <Name extends "payoutAccount" | "pci" | "taskList" | "individualDropin" | "businessDetailsDropin" | "companyDropin" | "companySearchDropin" | "trustDropin" | "soleProprietorDropin" | "createTransferInstrumentComponent" | "createIndividualComponent" | "viewVerificationStatusComponent">(componentName: Name, componentOptions: ComponentOptions<Name>) => UIElement;
12
12
  /**
13
13
  * Updates global configurations, resets the internal state and remounts each element.
14
14
  * @param options - props to update
@@ -16,6 +16,7 @@ export declare class Core {
16
16
  */
17
17
  update: (options: Partial<CoreOptions>) => this;
18
18
  updateLocale: ({ locale }: Pick<CoreOptions, 'locale'>) => this;
19
+ updateExpiry: ({ expiry }: Pick<CoreOptions, 'expiry'>) => this;
19
20
  /**
20
21
  * Remove the reference of a component
21
22
  * @param component - reference to the component to be removed
@@ -37,6 +37,7 @@ export interface BaseFormFieldProps<FieldSchema> {
37
37
  className?: string;
38
38
  classNameModifiers?: string[];
39
39
  stateSliceId?: AnyFormIdOfTLDS;
40
+ name?: string;
40
41
  handleChangeFor: (key: keyof FieldSchema, mode?: ValidatorMode) => (e: any) => void;
41
42
  }
42
43
  export type FieldValue<FormSchema> = FormSchema[keyof FormSchema];
@@ -51,6 +52,12 @@ export interface FormState<FormSchema> {
51
52
  dataStoreId?: string;
52
53
  local?: FormState<FormSchema> | Partial<FormState<FormSchema>>;
53
54
  }
55
+ export type InnerFormLabels<InnerFormSchema> = {
56
+ [Field in keyof InnerFormSchema]: TranslationKey;
57
+ };
58
+ export type OuterFormLabels<OuterFormSchema> = {
59
+ [Form in keyof OuterFormSchema]: InnerFormLabels<OuterFormSchema[Form]>;
60
+ };
54
61
  export interface Form<FormSchema> extends FormState<FormSchema> {
55
62
  setData: (key: keyof FormSchema, value: FieldValue<FormSchema>) => void;
56
63
  setValid: (key: keyof FormSchema, value: boolean) => void;
@@ -91,6 +98,9 @@ export interface BaseOuterFormProps<FormSchema> extends BaseFormProps<FormSchema
91
98
  capabilities?: CapabilityName[];
92
99
  country?: CountryCode;
93
100
  activeForm?: FormModel;
101
+ allFields?: {
102
+ [InnerFormName in keyof FormSchema]: Array<keyof FormSchema[InnerFormName]>;
103
+ };
94
104
  requiredFields?: {
95
105
  [InnerFormName in keyof FormSchema]: Array<keyof FormSchema[InnerFormName]>;
96
106
  };
@@ -119,6 +129,7 @@ export interface BaseOuterFormProps<FormSchema> extends BaseFormProps<FormSchema
119
129
  export interface BaseInnerFormProps<FormSchema> extends BaseFormProps<FormSchema> {
120
130
  formVerificationErrors?: FormVerificationErrors;
121
131
  fieldValidationErrors?: Record<keyof FormSchema, boolean>;
132
+ allFields?: Array<keyof FormSchema>;
122
133
  requiredFields?: Array<keyof FormSchema>;
123
134
  obscuredFields?: Array<keyof FormSchema>;
124
135
  optionalFields?: Array<keyof FormSchema>;
@@ -1,2 +1,2 @@
1
- import type { Ref } from 'preact/hooks';
2
- export declare function useIsElementVisible(ref: Ref<Element>, fallback?: boolean): boolean;
1
+ import type { MutableRef } from 'preact/hooks';
2
+ export declare function useIsElementVisible(ref: MutableRef<Element>, fallback?: boolean): boolean;
@@ -1,3 +1,4 @@
1
+ import type { Dispatch, StateUpdater } from 'preact/hooks';
1
2
  import type { CountryBankVerificationVendors } from '../../components/BankVerification/types';
2
3
  import type { BankAccountFormatType } from '../../components/internal/BankAccountFormat/types';
3
4
  import type { LoadingStatus } from '../../components/internal/LoaderWrapper/constants';
@@ -14,7 +15,7 @@ export interface UseScenarioConfigurationOptions {
14
15
  getConfigurationData: () => Promise<GetConfigurationResponse>;
15
16
  parseConfiguration: ParseConfiguration;
16
17
  country: CountryCode;
17
- setLoadingStatus: (loadingStatus: LoadingStatus) => void;
18
+ setLoadingStatus: Dispatch<StateUpdater<LoadingStatus>>;
18
19
  getPayoutAccountFormatData?: () => Promise<PayoutAccountFormats>;
19
20
  instantVerificationEnabled?: boolean;
20
21
  existingBankAccountFormat?: BankAccountFormatType;
@@ -42,6 +42,9 @@ export interface ServiceAgreementResponse extends ServiceAgreementRequest {
42
42
  termsOfServiceDocumentId: string;
43
43
  document: string | undefined;
44
44
  }
45
+ export interface ServiceAgreementUnacceptedDocumentRequest extends ServiceAgreementRequest {
46
+ termsOfServiceDocumentFormat?: string;
47
+ }
45
48
  export interface ServiceAgreementSignRequest {
46
49
  acceptedBy: string;
47
50
  }
@@ -60,6 +63,7 @@ export interface ServiceAgreementAcceptedDocumentResponse {
60
63
  termsOfServiceAcceptanceReference: string;
61
64
  termsOfServiceDocumentFormat: string;
62
65
  }
66
+ export type ServiceAgreementUnacceptedDocumentResponse = ServiceAgreementResponse;
63
67
  export interface ServiceAgreementAcceptanceInfos {
64
68
  data: ServiceAgreementAcceptanceInfo[];
65
69
  }
@@ -8,9 +8,11 @@ import type { Phone } from './phone';
8
8
  export interface Organization {
9
9
  legalName: string;
10
10
  registeredAddress: Address;
11
+ countryOfGoverningLaw?: CountryCode;
11
12
  description?: string;
12
13
  doingBusinessAs?: string;
13
14
  email?: string;
15
+ headOfficeIndicator?: boolean;
14
16
  phone?: Phone;
15
17
  principalPlaceOfBusiness?: Address;
16
18
  registrationNumber?: string;
@@ -21,11 +23,15 @@ export interface Organization {
21
23
  };
22
24
  taxInformation?: TaxInformation[];
23
25
  vatNumber?: string;
24
- vatAbsenceReason?: VatAbsenceReason;
26
+ vatAbsenceReason?: VatAbsenceReason[];
25
27
  type?: CompanyTypesValue | '';
26
28
  }
27
- export declare const vatAbsenceReasons: readonly ["industryExemption", "belowTaxThreshold"];
28
- export type VatAbsenceReason = (typeof vatAbsenceReasons)[number];
29
+ export declare enum VatAbsenceReason {
30
+ IndustryExemption = "industryExemption",
31
+ BelowTaxThreshold = "belowTaxThreshold",
32
+ CountryWithoutVatOrGstSystem = "countryWithoutVatOrGstSystem"
33
+ }
34
+ export declare const vatAbsenceReasons: VatAbsenceReason[];
29
35
  export type TaxInformation = {
30
36
  country: CountryCode;
31
37
  number: string;
@@ -13,6 +13,9 @@ export declare const companyBase: {
13
13
  export declare const companySearchBase: {
14
14
  [key: string]: ScenarioFieldSettings;
15
15
  };
16
+ export declare const businessDetailsBase: {
17
+ [key: string]: ScenarioFieldSettings;
18
+ };
16
19
  export declare const taxIdBase: {
17
20
  [key: string]: ScenarioFieldSettings;
18
21
  };
@@ -22,5 +25,6 @@ export declare const taxInformationBase: {
22
25
  export declare const companyTypes: readonly CompanyTypeModel[];
23
26
  export declare const fieldsPerScenario: ScenarioFields<typeof companyBase>;
24
27
  export declare const companySearchFieldsPerScenario: ScenarioFields<typeof companySearchBase>;
28
+ export declare const businessDetailsFieldsPerScenario: ScenarioFields<typeof businessDetailsBase>;
25
29
  export declare const countryConfig: CountryConfig;
26
30
  export {};
@@ -1,3 +1,4 @@
1
+ import type { BusinessDetailsSchema } from '../components/BusinessDetails/types';
1
2
  import type { CompanySchema } from '../components/Company/types';
2
3
  import type { CompanySearchSchema } from '../components/CompanySearch/types';
3
4
  import type { IndividualSchema } from '../components/Individual/types';
@@ -14,6 +15,7 @@ import type { Remediation } from './models/errors/remediation';
14
15
  import type { FieldConfigurations } from './models/field-configurations';
15
16
  import type { FormList } from './models/form';
16
17
  export declare const parseIndividualScenarios: (scenario: Scenario[] | undefined) => FieldConfigurations<IndividualSchema>;
18
+ export declare function parseBusinessDetailsScenarios(scenario: Scenario[] | undefined, country: CountryCode): FieldConfigurations<BusinessDetailsSchema>;
17
19
  export declare function parseCompanyScenarios(scenario: Scenario[], country: CountryCode): FieldConfigurations<CompanySchema>;
18
20
  export declare function parseCompanySearchScenarios(scenario: Scenario[] | undefined, country: CountryCode): FieldConfigurations<CompanySearchSchema>;
19
21
  export declare function parseTrustScenarios(scenario: Scenario[], country: CountryCode): FieldConfigurations<TrustSchema>;
@@ -23,11 +25,8 @@ export declare function parsePayoutScenarios({ requiredFields, country, bankVeri
23
25
  country: CountryCode;
24
26
  bankVerificationAvailable: boolean | undefined;
25
27
  }): Partial<FieldConfigurations<PayoutAccountSchema>>;
26
- type PropsFromConfiguration<FormSchema> = Required<Pick<BaseOuterFormProps<FormSchema>, 'verifyFields' | 'requiredFields' | 'placeholders' | 'helperText' | 'masks' | 'optionalFields' | 'labels' | 'obscuredFields'>> & {
28
+ type PropsFromConfiguration<FormSchema> = Required<Pick<BaseOuterFormProps<FormSchema>, 'allFields' | 'verifyFields' | 'requiredFields' | 'placeholders' | 'helperText' | 'masks' | 'optionalFields' | 'labels' | 'obscuredFields'>> & {
27
29
  validators: ValidatorRules<FormSchema>;
28
- allFields: {
29
- [Field in keyof FormSchema]: FormSchema[Field];
30
- };
31
30
  };
32
31
  /**
33
32
  * function: getPropsFromScenarios
@@ -24,4 +24,15 @@ export interface CoreOptions {
24
24
  */
25
25
  sdkToken?: string;
26
26
  getSdkToken?(): Promise<TokenResponse>;
27
+ /**
28
+ * When the user's session is set to expire.
29
+ * Should be provided as a Unix timestamp, i.e. milliseconds since epoch (e.g. 1721054807209).
30
+ *
31
+ * N.B. if `expiry` is provided, you **must** also provide `refreshExpiry()`.
32
+ */
33
+ expiry?: number;
34
+ /**
35
+ * A way to refresh the current session. Should return the new {@link expiry} timestamp.
36
+ */
37
+ refreshExpiry?: () => Promise<number>;
27
38
  }
@@ -1,11 +1,17 @@
1
+ import type { CompanyNameAndCountrySchema } from '../components/CompanyNameAndCountry/types';
2
+ import type { LegalArrangement } from '../core/models/api/legal-arrangement';
1
3
  import type { Organization, TaxInformationType } from '../core/models/api/organization';
4
+ import type { SoleProprietor } from '../core/models/api/sole-proprietor';
2
5
  import type { Trust } from '../core/models/api/trust';
3
6
  import type { CountryCode } from '../core/models/country-code';
4
7
  export declare const countryToTaxInfoTypeMap: Record<string, TaxInformationType>;
5
- export declare const updateTaxInformation: <T extends Organization | import("../core/models/api/legal-arrangement").LegalArrangement | Trust>({ taxId, country, exemptedFromTax, isUen, entity, }: {
8
+ export declare const updateTaxInformation: <T extends Organization | LegalArrangement | Trust>({ taxId, country, exemptedFromTax, isUen, entity, }: {
6
9
  taxId: string;
7
10
  country: CountryCode;
8
11
  exemptedFromTax?: boolean;
9
12
  isUen?: boolean;
10
13
  entity: T;
11
14
  }) => T;
15
+ export declare const getUpdatedCountryOfGoverningLaw: (nameAndCountry: CompanyNameAndCountrySchema) => CompanyNameAndCountrySchema;
16
+ export declare const transformCountryOfGoverningLawToLegalEntity: (nameAndCountry: CompanyNameAndCountrySchema, organization: Organization | LegalArrangement) => Organization | LegalArrangement;
17
+ export declare const transformCountryOfGoverningLawToSchema: (nameAndCountry: CompanyNameAndCountrySchema, organization: Organization | SoleProprietor) => CompanyNameAndCountrySchema;
@@ -1,3 +1,4 @@
1
+ import type { BusinessDetailsSchema } from '../components/BusinessDetails/types';
1
2
  import type { CompanySchema } from '../components/Company/types';
2
3
  import type { CompanySearchSchema } from '../components/CompanySearch/types';
3
4
  import type { IndividualSchema } from '../components/Individual/types';
@@ -6,5 +7,5 @@ import type { TrustSchema } from '../components/Trust/types';
6
7
  import type { ExperimentName } from '../core/Context/ExperimentContext/types';
7
8
  import type { ExistingLegalEntity } from '../core/models/api/legal-entity';
8
9
  import type { RecursiveKeyOf } from './getNestedPropertyKeys';
9
- export type AnyTLDSFieldName = RecursiveKeyOf<IndividualSchema> | RecursiveKeyOf<CompanySchema> | RecursiveKeyOf<CompanySearchSchema> | RecursiveKeyOf<SolePropSchema> | RecursiveKeyOf<TrustSchema>;
10
+ export type AnyTLDSFieldName = RecursiveKeyOf<IndividualSchema> | RecursiveKeyOf<CompanySchema> | RecursiveKeyOf<CompanySearchSchema> | RecursiveKeyOf<BusinessDetailsSchema> | RecursiveKeyOf<SolePropSchema> | RecursiveKeyOf<TrustSchema>;
10
11
  export declare const getFieldsWithExistingData: (legalEntity: ExistingLegalEntity, isExperimentEnabled?: (key: ExperimentName) => boolean) => AnyTLDSFieldName[];
@@ -0,0 +1,2 @@
1
+ export * from './mapBusinessDetailsSchemaToLegalEntity';
2
+ export * from './mapLegalEntityToBusinessDetailsSchema';
@@ -0,0 +1,5 @@
1
+ import type { BusinessDetailsSchema } from '../../../components/BusinessDetails/types';
2
+ import type { Document } from '../../../core/models/api/document';
3
+ import type { LegalEntity } from '../../../core/models/api/legal-entity';
4
+ export declare const mapBusinessDetailsDocumentToApiDocument: (data: BusinessDetailsSchema, entityId: string) => Promise<Document[]>;
5
+ export declare const mapBusinessDetailsSchemaToLegalEntity: (data: BusinessDetailsSchema) => LegalEntity;
@@ -0,0 +1,4 @@
1
+ import type { BusinessDetailsSchema } from '../../../components/BusinessDetails/types';
2
+ import type { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
3
+ export declare const mapApiDocumentToBusinessDetailsDocuments: (entityId: string) => BusinessDetailsSchema;
4
+ export declare const mapLegalEntityToBusinessDetailsSchema: (legalEntity: ExistingLegalEntity, isChangingType: boolean) => BusinessDetailsSchema;
@@ -1,4 +1,5 @@
1
1
  import type { CompanySearchSchema } from '../../../components/CompanySearch/types';
2
+ import type { AccountHolderOption } from '../../../components/internal/AccountHolder/types';
2
3
  import type { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
3
4
  export declare const mapApiDocumentToCompanySearchDocuments: (entityId: string) => CompanySearchSchema;
4
- export declare const mapLegalEntityToCompanySearchSchema: (legalEntity: ExistingLegalEntity, isChangingType: boolean) => CompanySearchSchema;
5
+ export declare const mapLegalEntityToCompanySearchSchema: (legalEntity: ExistingLegalEntity, isChangingType: boolean, accountHolder?: AccountHolderOption) => CompanySearchSchema;
@@ -40,9 +40,44 @@ export declare const individualComponentsKeyMapping: {
40
40
  export declare const individualApiKeyMapping: {
41
41
  [x: string]: "personalDetails.firstName" | "personalDetails.lastName" | "personalDetails.issuerState" | "personalDetails.expiryDate" | "personalDetails.phoneNumber" | "personalDetails.email" | "personalDetails.birthDate" | "personalDetails.idNumber" | "personalDetails.licenseCardNumber" | "personalDetails.nationality" | "personalDetails.jobTitle" | "personalDetails.typeOfIdentity" | "personalDetails.idNumberExempt" | "address.country" | "address.postalCode" | "address.city" | "address.stateOrProvince" | "address.otherAddressInformation" | "address.address";
42
42
  };
43
+ export declare const businessDetailsComponentsKeyMapping: {
44
+ 'basicInformation.country': string;
45
+ 'basicInformation.businessName': string;
46
+ 'basicInformation.stateOrProvince': string;
47
+ 'basicInformation.taxInformation': string;
48
+ 'basicInformation.registrationNumber': string;
49
+ 'companyStructure.entityType': string;
50
+ 'additionalInformation.legalCompanyName': string;
51
+ 'additionalInformation.tradingName': string;
52
+ 'additionalInformation.registrationNumber': string;
53
+ 'additionalInformation.taxInformation': string;
54
+ 'additionalInformation.vatNumber': string;
55
+ 'additionalInformation.vatAbsenceReason': string;
56
+ 'additionalInformation.dateOfIncorporation': string;
57
+ 'additionalInformation.isUen': string;
58
+ 'additionalInformation.stockExchangeMIC': string;
59
+ 'additionalInformation.stockISIN': string;
60
+ 'companyRegistrationAddress.registrationAddress.city': string;
61
+ 'companyRegistrationAddress.registrationAddress.country': string;
62
+ 'companyRegistrationAddress.registrationAddress.postalCode': string;
63
+ 'companyRegistrationAddress.registrationAddress.stateOrProvince': string;
64
+ 'companyRegistrationAddress.registrationAddress.address': string;
65
+ 'companyRegistrationAddress.registrationAddress.otherAddressInformation': string;
66
+ 'companyRegistrationAddress.operationalAddress.city': string;
67
+ 'companyRegistrationAddress.operationalAddress.country': string;
68
+ 'companyRegistrationAddress.operationalAddress.postalCode': string;
69
+ 'companyRegistrationAddress.operationalAddress.stateOrProvince': string;
70
+ 'companyRegistrationAddress.operationalAddress.address': string;
71
+ 'companyRegistrationAddress.operationalAddress.otherAddressInformation': string;
72
+ 'additionalInformation.exemptedFromVat': string;
73
+ };
74
+ export declare const businessDetailsApiKeyMapping: {
75
+ [x: string]: "companyRegistrationAddress.registrationAddress.country" | "companyRegistrationAddress.registrationAddress.postalCode" | "companyRegistrationAddress.registrationAddress.city" | "companyRegistrationAddress.registrationAddress.stateOrProvince" | "companyRegistrationAddress.registrationAddress.otherAddressInformation" | "companyRegistrationAddress.registrationAddress.address" | "companyRegistrationAddress.operationalAddress.country" | "companyRegistrationAddress.operationalAddress.postalCode" | "companyRegistrationAddress.operationalAddress.city" | "companyRegistrationAddress.operationalAddress.stateOrProvince" | "companyRegistrationAddress.operationalAddress.otherAddressInformation" | "companyRegistrationAddress.operationalAddress.address" | "companyStructure.entityType" | "basicInformation.country" | "basicInformation.stateOrProvince" | "basicInformation.registrationNumber" | "basicInformation.taxInformation" | "basicInformation.businessName" | "additionalInformation.legalCompanyName" | "additionalInformation.dateOfIncorporation" | "additionalInformation.tradingName" | "additionalInformation.vatAbsenceReason" | "additionalInformation.vatNumber" | "additionalInformation.registrationNumber" | "additionalInformation.stockExchangeMIC" | "additionalInformation.stockISIN" | "additionalInformation.isUen" | "additionalInformation.taxInformation";
76
+ };
43
77
  export declare const companyComponentsKeyMapping: {
44
78
  'companyNameAndCountry.country': string;
45
79
  'companyNameAndCountry.legalCompanyName': string;
80
+ 'companyNameAndCountry.countryOfGoverningLaw': string;
46
81
  'companyType.entityType': string;
47
82
  'companyRegistrationDetails.tradingName': string;
48
83
  'companyRegistrationDetails.registrationNumber': string;
@@ -67,7 +102,7 @@ export declare const companyComponentsKeyMapping: {
67
102
  'companyRegistrationDetails.exemptedFromVat': string;
68
103
  };
69
104
  export declare const companyApiKeyMapping: {
70
- [x: string]: "companyType.entityType" | "companyNameAndCountry.country" | "companyNameAndCountry.legalCompanyName" | "companyRegistrationDetails.dateOfIncorporation" | "companyRegistrationDetails.tradingName" | "companyRegistrationDetails.vatAbsenceReason" | "companyRegistrationDetails.vatNumber" | "companyRegistrationDetails.registrationNumber" | "companyRegistrationDetails.stockExchangeMIC" | "companyRegistrationDetails.stockISIN" | "companyRegistrationDetails.isUen" | "companyRegistrationAddress.registrationAddress.country" | "companyRegistrationAddress.registrationAddress.postalCode" | "companyRegistrationAddress.registrationAddress.city" | "companyRegistrationAddress.registrationAddress.stateOrProvince" | "companyRegistrationAddress.registrationAddress.otherAddressInformation" | "companyRegistrationAddress.registrationAddress.address" | "companyRegistrationAddress.operationalAddress.country" | "companyRegistrationAddress.operationalAddress.postalCode" | "companyRegistrationAddress.operationalAddress.city" | "companyRegistrationAddress.operationalAddress.stateOrProvince" | "companyRegistrationAddress.operationalAddress.otherAddressInformation" | "companyRegistrationAddress.operationalAddress.address";
105
+ [x: string]: "companyType.entityType" | "companyNameAndCountry.country" | "companyNameAndCountry.legalCompanyName" | "companyNameAndCountry.countryOfGoverningLaw" | "companyRegistrationAddress.registrationAddress.country" | "companyRegistrationAddress.registrationAddress.postalCode" | "companyRegistrationAddress.registrationAddress.city" | "companyRegistrationAddress.registrationAddress.stateOrProvince" | "companyRegistrationAddress.registrationAddress.otherAddressInformation" | "companyRegistrationAddress.registrationAddress.address" | "companyRegistrationAddress.operationalAddress.country" | "companyRegistrationAddress.operationalAddress.postalCode" | "companyRegistrationAddress.operationalAddress.city" | "companyRegistrationAddress.operationalAddress.stateOrProvince" | "companyRegistrationAddress.operationalAddress.otherAddressInformation" | "companyRegistrationAddress.operationalAddress.address" | "companyRegistrationDetails.dateOfIncorporation" | "companyRegistrationDetails.tradingName" | "companyRegistrationDetails.vatAbsenceReason" | "companyRegistrationDetails.vatNumber" | "companyRegistrationDetails.registrationNumber" | "companyRegistrationDetails.stockExchangeMIC" | "companyRegistrationDetails.stockISIN" | "companyRegistrationDetails.isUen";
71
106
  };
72
107
  export declare const companySearchComponentsKeyMapping: {
73
108
  'companyBasics.country': string;
@@ -169,6 +204,12 @@ export declare const solePropApiKeyMapping: {
169
204
  * Base api mappings do not contain document mappings as the api used for document upload is different
170
205
  * For remediation mappings adding document mapping additionally along with the apiKeyMapping
171
206
  */
207
+ export declare const remediationBusinessDetailsApiKeyMapping: {
208
+ 'organization.registeredAddress': string;
209
+ registrationDocument: string;
210
+ vatDocument: string;
211
+ proofOfOrganizationTaxInfo: string;
212
+ };
172
213
  export declare const remediationCompanyApiKeyMapping: {
173
214
  'organization.registeredAddress': string;
174
215
  registrationDocument: string;
@@ -2,4 +2,4 @@ import { DocumentType } from '../../core/models/api/document';
2
2
  /**
3
3
  * Returns the appropriate prefix for the document guidance image based on api documentType.
4
4
  */
5
- export declare const getDocumentGuidancePrefix: (documentType: DocumentType, isIcon?: boolean, isFront?: boolean) => "id" | "passport" | "id-front" | "id-back" | "generic-document";
5
+ export declare const getDocumentGuidancePrefix: (documentType: DocumentType, isIcon?: boolean, isFront?: boolean) => "passport" | "id" | "id-front" | "id-back" | "generic-document";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.42.0",
3
+ "version": "2.43.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -70,14 +70,11 @@
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",
74
73
  "classnames": "^2.3.2",
75
74
  "isomorphic-dompurify": "^0.13.0",
76
75
  "lodash": "^4.17.21",
77
76
  "onfido-sdk-ui": "12.3.5",
78
77
  "preact": "^10.17.1",
79
- "react": "npm:@preact/compat",
80
- "react-dom": "npm:@preact/compat",
81
78
  "validator": "^13.5.2"
82
79
  },
83
80
  "devDependencies": {
@@ -91,7 +88,6 @@
91
88
  "@storybook/core-server": "^8.0.4",
92
89
  "@storybook/preact": "^8.0.4",
93
90
  "@storybook/preact-vite": "^8.0.4",
94
- "@tanstack/eslint-plugin-query": "^4.38.0",
95
91
  "@testing-library/jest-dom": "^5.17.0",
96
92
  "@testing-library/preact": "^3.2.3",
97
93
  "@testing-library/user-event": "^14.4.3",
@@ -145,9 +141,7 @@
145
141
  },
146
142
  "@storybook/preact-vite": {
147
143
  "vite": "^4 || ^5"
148
- },
149
- "react": "npm:@preact/compat",
150
- "react-dom": "npm:@preact/compat"
144
+ }
151
145
  },
152
146
  "engines": {
153
147
  "node": ">=20"
@@ -1,2 +0,0 @@
1
- import { QueryClient as TanstackQueryClient } from '@tanstack/react-query';
2
- export declare const QueryClient: TanstackQueryClient;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const QueryClientProvider: ({ children }: {
3
- children: JSX.Element;
4
- }) => JSX.Element;