@adyen/kyc-components 2.44.0 → 2.45.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 (38) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1171 -382
  2. package/dist/style.css +1098 -2248
  3. package/dist/types/components/BusinessDetails/forms.d.ts +2 -1
  4. package/dist/types/components/CompanyOtherDetails/types.d.ts +2 -1
  5. package/dist/types/components/CompanyRegistrationDetails/types.d.ts +1 -0
  6. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  7. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
  8. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureCompany.d.ts +4 -0
  9. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureParentCompany.d.ts +4 -0
  10. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureUltimateParentCompany.d.ts +4 -0
  11. package/dist/types/components/Dropins/HighExposureDropin/components/HighExposureDropinComponent.d.ts +6 -0
  12. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +34 -0
  13. package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +3 -0
  14. package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +2 -0
  15. package/dist/types/components/Individual/types.d.ts +3 -1
  16. package/dist/types/components/index.d.ts +2 -0
  17. package/dist/types/components/internal/FormFields/Field/Field.d.ts +5 -3
  18. package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +8 -0
  19. package/dist/types/components/internal/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +4 -1
  20. package/dist/types/components/internal/StockISINField/types.d.ts +1 -1
  21. package/dist/types/components/internal/StockTickerSymbol/StockTickerSymbolField.d.ts +3 -0
  22. package/dist/types/components/internal/StockTickerSymbol/fieldConfig.d.ts +3 -0
  23. package/dist/types/components/internal/StockTickerSymbol/index.d.ts +1 -0
  24. package/dist/types/components/internal/StockTickerSymbol/types.d.ts +5 -0
  25. package/dist/types/components/internal/TaxId/fieldConfig.d.ts +3 -0
  26. package/dist/types/core/Context/StateContext/types.d.ts +2 -1
  27. package/dist/types/core/Services/componentApi/push-events.d.ts +1 -2
  28. package/dist/types/core/hooks/useAnalytics.d.ts +9 -3
  29. package/dist/types/core/hooks/useCanSeeEntitySelection.d.ts +6 -0
  30. package/dist/types/core/process-field-configurations.d.ts +2 -0
  31. package/dist/types/core/user-events.d.ts +4 -8
  32. package/dist/types/core/utils.d.ts +1 -1
  33. package/dist/types/utils/api/processValidationErrors.d.ts +4 -1
  34. package/dist/types/utils/get-props.d.ts +17 -0
  35. package/dist/types/utils/getNestedPropertyKeys.d.ts +1 -1
  36. package/dist/types/utils/mapping/componentApiMapping.d.ts +16 -3
  37. package/dist/types/utils/mapping/mapping.d.ts +4 -1
  38. package/package.json +4 -2
@@ -7,6 +7,7 @@ import type { LegalCompanyNameFieldSchema } from '../internal/LegalCompanyNameFi
7
7
  import type { StateFieldSchema } from '../internal/StateField/types';
8
8
  import type { StockExchangeMICFieldSchema } from '../internal/StockExchangeMICField/types';
9
9
  import type { StockISINFieldSchema } from '../internal/StockISINField/types';
10
+ import type { StockTickerSymbolFieldSchema } from '../internal/StockTickerSymbol/types';
10
11
  import type { TaxInformationFieldSchema } from '../internal/TaxInformationField';
11
12
  import type { TradingNameFieldSchema } from '../internal/TradingNameField/types';
12
13
  import type { VatNumberFieldSchema } from '../internal/VatNumberField';
@@ -15,7 +16,7 @@ interface BusinessNameFieldSchema {
15
16
  }
16
17
  export interface BasicInformationSchema extends CountryFieldSchema, BusinessNameFieldSchema, StateFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema {
17
18
  }
18
- export interface AdditionalInformationSchema extends LegalCompanyNameFieldSchema, TradingNameFieldSchema, DateOfIncorporationFieldSchema, StockISINFieldSchema, StockExchangeMICFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema, VatNumberFieldSchema {
19
+ export interface AdditionalInformationSchema extends LegalCompanyNameFieldSchema, TradingNameFieldSchema, DateOfIncorporationFieldSchema, StockISINFieldSchema, StockExchangeMICFieldSchema, StockTickerSymbolFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema, VatNumberFieldSchema {
19
20
  }
20
21
  export declare const FIELDS_NEEDED_FOR_COMPANY_SEARCH: Array<keyof BusinessNameFieldSchema | keyof BasicInformationSchema | keyof AdditionalInformationSchema>;
21
22
  export declare const getForms: (country: CountryCode) => FormList;
@@ -6,10 +6,11 @@ import type { BusinessRegistrationNumberFieldSchema } from '../internal/Business
6
6
  import type { DateOfIncorporationFieldSchema } from '../internal/DateOfIncorporationField/types';
7
7
  import type { StockExchangeMICFieldSchema } from '../internal/StockExchangeMICField/types';
8
8
  import type { StockISINFieldSchema } from '../internal/StockISINField/types';
9
+ import type { StockTickerSymbolFieldSchema } from '../internal/StockTickerSymbol/types';
9
10
  import type { TaxInformationFieldSchema } from '../internal/TaxInformationField/types';
10
11
  import type { TradingNameFieldSchema } from '../internal/TradingNameField/types';
11
12
  import type { VatNumberFieldSchema } from '../internal/VatNumberField/types';
12
- export interface CompanyOtherDetailsSchema extends DateOfIncorporationFieldSchema, TradingNameFieldSchema, StockISINFieldSchema, StockExchangeMICFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema, VatNumberFieldSchema {
13
+ export interface CompanyOtherDetailsSchema extends DateOfIncorporationFieldSchema, TradingNameFieldSchema, StockISINFieldSchema, StockExchangeMICFieldSchema, StockTickerSymbolFieldSchema, TaxInformationFieldSchema, BusinessRegistrationNumberFieldSchema, VatNumberFieldSchema {
13
14
  }
14
15
  export interface CompanyOtherDetailsProps extends BaseInnerFormProps<CompanyOtherDetailsSchema> {
15
16
  country: CountryCode;
@@ -9,6 +9,7 @@ export interface CompanyRegistrationDetailsSchema extends BusinessRegistrationNu
9
9
  sameNameAsLegalName?: boolean;
10
10
  stockExchangeMIC?: string;
11
11
  stockISIN?: string;
12
+ stockTickerSymbol?: string;
12
13
  dateOfIncorporation?: string;
13
14
  isUen?: boolean;
14
15
  }
@@ -1,2 +1,2 @@
1
1
  import type { CompanyDropinProps } from '../types';
2
- export declare function CompanyDropinComponent({ country: parentCountry, problems: propProblems, hideDropinLayout, taskName, capabilities, homeButtonLabel, taskType, trackingConfig, associationDetail, parentLegalEntity, legalEntityResponse, isTargetLegalEntityType, onSubmit: onExternalSubmit, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleCreateLegalEntity, handleUpdateLegalEntity, handleHomeClick, onTypeSwitch, onChange, accountHolder, }: CompanyDropinProps): import("preact").JSX.Element;
2
+ export declare function CompanyDropinComponent({ country: parentCountry, problems: propProblems, hideDropinLayout, taskName, capabilities, homeButtonLabel, taskType, trackingConfig, associationDetail, parentLegalEntity, legalEntityResponse, isTargetLegalEntityType, onSubmit: onExternalSubmit, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleCreateLegalEntity, handleUpdateLegalEntity, handleHomeClick, onTypeSwitch, onChange, }: CompanyDropinProps): import("preact").JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import type { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
2
2
  import type { CompanyProps, CompanySchema } from '../../Company/types';
3
- import type { AccountHolderOption } from '../../internal/AccountHolder/types';
4
3
  import type { TrustMember } from '../../TrustMembers/types';
5
4
  import type { DropinAPIHandlers, DropinProps } from '../types';
6
5
  export interface CompanyDropinProps extends Omit<CompanyProps, 'isTopLevelEntity'>, DropinAPIHandlers, DropinProps {
@@ -8,5 +7,4 @@ export interface CompanyDropinProps extends Omit<CompanyProps, 'isTopLevelEntity
8
7
  associationDetail?: TrustMember;
9
8
  isTargetLegalEntityType?: boolean;
10
9
  onSubmit?: (company: CompanySchema) => void;
11
- accountHolder?: AccountHolderOption;
12
10
  }
@@ -0,0 +1,4 @@
1
+ import type { HighExposureCompanyDetailsProps, HighExposureCompanySchema } from '../types';
2
+ export declare const highExposureCompanyDetailsFields: Array<keyof HighExposureCompanySchema>;
3
+ declare function AdditionalFieldsForHighExposureCompany({ requiredFields, ...props }: HighExposureCompanyDetailsProps): import("preact").JSX.Element;
4
+ export default AdditionalFieldsForHighExposureCompany;
@@ -0,0 +1,4 @@
1
+ import type { HighExposureParentCompanyDetailsProps, HighExposureParentCompanySchema } from '../types';
2
+ export declare const highExposureParentCompanyDetailsFields: Array<keyof HighExposureParentCompanySchema>;
3
+ declare function AdditionalFieldsForHighExposureParentCompany({ requiredFields, ...props }: HighExposureParentCompanyDetailsProps): import("preact").JSX.Element;
4
+ export default AdditionalFieldsForHighExposureParentCompany;
@@ -0,0 +1,4 @@
1
+ import type { HighExposureUltimateParentCompanyDetailsProps, HighExposureUltimateParentCompanySchema } from '../types';
2
+ export declare const highExposureUltimateParentCompanyDetailsFields: Array<keyof HighExposureUltimateParentCompanySchema>;
3
+ declare function AdditionalFieldsForHighExposureUltimateParentCompany({ requiredFields, ...props }: HighExposureUltimateParentCompanyDetailsProps): import("preact").JSX.Element;
4
+ export default AdditionalFieldsForHighExposureUltimateParentCompany;
@@ -0,0 +1,6 @@
1
+ import type { FormList } from '../../../../core/models/form';
2
+ import type { HighExposureDropinProps } from '../types';
3
+ export declare const highExposureForms: FormList;
4
+ export declare const ultimateParentCompanyFormId: string;
5
+ declare function HighExposureDropinComponent(props: HighExposureDropinProps): import("preact").JSX.Element;
6
+ export default HighExposureDropinComponent;
@@ -0,0 +1,34 @@
1
+ import type { BaseInnerFormProps, BaseOuterFormProps } from '../../../core/hooks/useForm';
2
+ import type { CapabilityName } from '../../../core/models/api/capability';
3
+ import type { ExistingLegalEntity, LegalEntity } from '../../../core/models/api/legal-entity';
4
+ import type { CountryCode } from '../../../core/models/country-code';
5
+ import type { FormModel } from '../../../core/models/form';
6
+ import type { DropinProps } from '../types';
7
+ export interface HighExposureCompanySchema {
8
+ country?: CountryCode;
9
+ numberOfEmployees?: number;
10
+ }
11
+ export type HighExposureParentCompanySchema = HighExposureCompanySchema;
12
+ export type HighExposureUltimateParentCompanySchema = HighExposureCompanySchema;
13
+ export interface HighExposureSchema {
14
+ company?: HighExposureCompanySchema;
15
+ parentCompany?: HighExposureParentCompanySchema;
16
+ ultimateParentCompany?: HighExposureParentCompanySchema;
17
+ }
18
+ export interface HighExposureDropinProps extends BaseOuterFormProps<HighExposureSchema> {
19
+ capabilities?: CapabilityName[];
20
+ activeForm?: FormModel;
21
+ forms?: FormModel[];
22
+ country: CountryCode;
23
+ }
24
+ export interface HighExposureProps extends HighExposureDropinProps, DropinProps {
25
+ legalEntityId: ExistingLegalEntity['id'];
26
+ legalEntity?: LegalEntity;
27
+ parentLegalEntity?: ExistingLegalEntity;
28
+ onSubmit?: (data: HighExposureSchema) => void;
29
+ }
30
+ export interface HighExposureCompanyDetailsProps extends BaseInnerFormProps<HighExposureCompanySchema> {
31
+ country: CountryCode;
32
+ }
33
+ export type HighExposureParentCompanyDetailsProps = HighExposureCompanyDetailsProps;
34
+ export type HighExposureUltimateParentCompanyDetailsProps = HighExposureCompanyDetailsProps;
@@ -0,0 +1,3 @@
1
+ import type { ValidatorRules } from '../../../utils/validation/types';
2
+ import type { HighExposureCompanySchema } from './types';
3
+ export declare const highExposureCompanyDetailsValidations: ValidatorRules<HighExposureCompanySchema>;
@@ -0,0 +1,2 @@
1
+ import type { HighExposureProps } from '../../Dropins/HighExposureDropin/types';
2
+ export declare function UpdateLegalEntityForHighExposure({ parentLegalEntity, capabilities, country, trackingConfig, problems: problemsProp, onSubmit: externalOnSubmit, onChange, hideDropinLayout, handleHomeClick, homeButtonLabel, legalEntityId, }: HighExposureProps): import("preact").JSX.Element;
@@ -12,6 +12,7 @@ import type { DocumentUploadSchema } from '../DocumentUpload/types';
12
12
  import type { DropinAPIHandlers, DropinProps } from '../Dropins/types';
13
13
  import type { IdDocumentUploadSchema } from '../IdDocumentUpload/types';
14
14
  import type { IdVerificationMethodSchema } from '../IdVerificationMethod/types';
15
+ import type { AccountHolderOption } from '../internal/AccountHolder/types';
15
16
  import type { PersonalDetailsSchema } from '../PersonalDetails/types';
16
17
  import type { TaskTypes } from '../TaskList/types';
17
18
  import type { TrustMember } from '../TrustMembers/types';
@@ -39,8 +40,9 @@ export interface IndividualProps extends BaseOuterFormProps<IndividualSchema> {
39
40
  onNext?(e: any, callbacks: any, isValid: any): void;
40
41
  onBack?(): void;
41
42
  hideNavigation?: boolean;
43
+ accountHolder: AccountHolderOption | null;
42
44
  }
43
- export interface IndividualDropinProps extends Omit<IndividualProps, 'legalEntityId'>, IndividualDropinApiHandlers, DropinProps {
45
+ export interface IndividualDropinProps extends Omit<IndividualProps, 'legalEntityId' | 'accountHolder'>, IndividualDropinApiHandlers, DropinProps {
44
46
  parentLegalEntity?: ExistingLegalEntity;
45
47
  trustMember?: TrustMember;
46
48
  isTargetLegalEntityType?: boolean;
@@ -13,6 +13,7 @@ import { SolePropDropinComponent } from './Dropins/SolePropDropin';
13
13
  import { TrustDropinComponent } from './Dropins/TrustDropin';
14
14
  import { CreateIndividualComponent } from './EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent';
15
15
  import { CreateTransferInstrumentComponent } from './EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent';
16
+ import { UpdateLegalEntityForHighExposure } from './EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure';
16
17
  import { ViewVerificationStatusComponent } from './EmbeddedDropins/ViewVerificationStatus';
17
18
  /**
18
19
  * Maps each component with a Component element.
@@ -30,6 +31,7 @@ export declare const componentsMap: {
30
31
  readonly createTransferInstrumentComponent: typeof CreateTransferInstrumentComponent;
31
32
  readonly createIndividualComponent: typeof CreateIndividualComponent;
32
33
  readonly viewVerificationStatusComponent: typeof ViewVerificationStatusComponent;
34
+ readonly updateLegalEntityForHighExposureComponent: typeof UpdateLegalEntityForHighExposure;
33
35
  };
34
36
  export type ComponentMap = typeof componentsMap;
35
37
  export type ComponentProps<Name extends keyof ComponentMap> = Parameters<ComponentMap[Name]>[0];
@@ -1,10 +1,12 @@
1
1
  import './Field.scss';
2
- import type { ComponentProps, JSX } from 'preact';
2
+ import type { ComponentChildren, ComponentProps, JSX } from 'preact';
3
3
  import type { FieldProps } from './types';
4
- export type MaybeLabelElementProps = (ComponentProps<'label'> & {
4
+ export type MaybeLabelElementProps = {
5
+ children: ComponentChildren;
6
+ } & ((ComponentProps<'label'> & {
5
7
  useLabelElement: true;
6
8
  }) | (ComponentProps<'div'> & {
7
9
  useLabelElement: false;
8
- });
10
+ }));
9
11
  declare const Field: ({ className, classNameModifiers, children, dataPlaceholder, disabled, optional, errorMessage, filled, focused, helper, inputWrapperModifiers, isLoading, isValid, label, name, onBlur, onFieldBlur, onFocus, onFocusField, showErrorIconBottom, useLabelElement, helperPosition, wrapperRef, }: FieldProps) => JSX.Element;
10
12
  export default Field;
@@ -123,6 +123,14 @@ export declare const taxIdNumberOptions: {
123
123
  readonly id: "uen";
124
124
  readonly name: "uen";
125
125
  }];
126
+ readonly JE: readonly [{
127
+ readonly id: "taxIdentificationNumber";
128
+ readonly name: "taxIdentificationNumber";
129
+ }, {
130
+ readonly id: "socialSecurityNumber";
131
+ readonly name: "socialSecurityNumber";
132
+ readonly applicableOnlyFor: readonly [CompanyTypesValue.SOLE_PROPRIETORSHIP];
133
+ }];
126
134
  };
127
135
  export declare const getTaxIdNumberOptions: (country: CountryCode, companyType: CompanyTypesValue | LegalEntityType.TRUST | undefined) => readonly TaxIdNumberOption[] | undefined;
128
136
  export type TaxIdNumberType = (typeof taxIdNumberOptions)[keyof typeof taxIdNumberOptions][number]['id'];
@@ -1,3 +1,5 @@
1
+ import type { CompanyTypesValue } from '../../../core/models/api/company-types-value';
2
+ import type { LegalEntityType } from '../../../core/models/api/legal-entity-type';
1
3
  import type { CountryCode } from '../../../core/models/country-code';
2
4
  import type { TaxIdNumberType } from './countryIdNumberTypes';
3
5
  /**
@@ -6,5 +8,6 @@ import type { TaxIdNumberType } from './countryIdNumberTypes';
6
8
  * We don't store this choice in the API.
7
9
  * @param taxId the existing tax ID number
8
10
  * @param country the country of the LE
11
+ * @param companyType the company type, e.g. `nonProfit`
9
12
  */
10
- export declare const inferTaxIdNumberType: (taxId: string, country: CountryCode) => TaxIdNumberType | undefined;
13
+ export declare const inferTaxIdNumberType: (taxId: string, country: CountryCode, companyType: CompanyTypesValue | LegalEntityType.TRUST | undefined) => TaxIdNumberType | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { BaseFormFieldProps } from '../../../core/hooks/useForm/types';
2
2
  export interface StockISINFieldSchema {
3
- stockISIN?: string | undefined;
3
+ stockISIN?: string;
4
4
  }
5
5
  export type StockISINFieldProps = BaseFormFieldProps<StockISINFieldSchema>;
@@ -0,0 +1,3 @@
1
+ import type { StockTickerSymbolFieldProps, StockTickerSymbolFieldSchema } from './types';
2
+ export declare const STOCK_TICKER_SYMBOL_FIELD: Array<keyof StockTickerSymbolFieldSchema>;
3
+ export declare function StockTickerSymbolField({ data, valid, errors, labels, placeholders, readonly, mask, guidanceText, handleChangeFor, }: StockTickerSymbolFieldProps): import("preact").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { FieldMetadata } from '../../../core/models/country-config';
2
+ import type { StockTickerSymbolFieldSchema } from './types';
3
+ export declare const stockTickerSymbolFieldMetadata: FieldMetadata<StockTickerSymbolFieldSchema, 'stockTickerSymbol'>;
@@ -0,0 +1 @@
1
+ export * from './StockTickerSymbolField';
@@ -0,0 +1,5 @@
1
+ import type { BaseFormFieldProps } from '../../../core/hooks/useForm';
2
+ export interface StockTickerSymbolFieldSchema {
3
+ stockTickerSymbol?: string;
4
+ }
5
+ export type StockTickerSymbolFieldProps = BaseFormFieldProps<StockTickerSymbolFieldSchema>;
@@ -1,8 +1,11 @@
1
+ import { CompanyTypesValue } from '../../../core/models/api/company-types-value';
2
+ import type { LegalEntityType } from '../../../core/models/api/legal-entity-type';
1
3
  import type { FieldMetadata } from '../../../core/models/country-config';
2
4
  import type { PerCountryFieldConfig } from '../../../core/models/field-configurations';
3
5
  import type { TaxIdNumberType } from '../IdFieldTypeSelector/countryIdNumberTypes';
4
6
  import type { TaxIdSchema } from './types';
5
7
  export interface FieldConfigParams {
8
+ companyType: CompanyTypesValue | LegalEntityType.TRUST | undefined;
6
9
  taxIdNumberType: TaxIdNumberType | undefined;
7
10
  }
8
11
  export declare const defaultFieldMetadata: FieldMetadata<TaxIdSchema, 'taxId'>;
@@ -1,6 +1,7 @@
1
1
  import type { BusinessDetailsSchema } from '../../../components/BusinessDetails/types';
2
2
  import type { CompanySchema } from '../../../components/Company/types';
3
3
  import type { CompanySearchSchema } from '../../../components/CompanySearch/types';
4
+ import type { HighExposureSchema } from '../../../components/Dropins/HighExposureDropin/types';
4
5
  import type { TrustMemberSchema } from '../../../components/Dropins/RoleAndTypeDropin/types';
5
6
  import type { IndividualSchema } from '../../../components/Individual/types';
6
7
  import type { PayoutDetailsSchema } from '../../../components/PayoutDetails/types';
@@ -48,7 +49,7 @@ export type StateModel<TLDS extends TopLevelDataSchema = TopLevelDataSchema> = {
48
49
  prevState?: State<TLDS>;
49
50
  };
50
51
  };
51
- export type TopLevelDataSchema = IndividualSchema | BusinessDetailsSchema | CompanySchema | CompanySearchSchema | PayoutDetailsSchema | TrustSchema | TrustMemberSchema | SolePropSchema;
52
+ export type TopLevelDataSchema = IndividualSchema | BusinessDetailsSchema | CompanySchema | CompanySearchSchema | PayoutDetailsSchema | TrustSchema | TrustMemberSchema | SolePropSchema | HighExposureSchema;
52
53
  export type AnyFormIdOfTLDS = keyof IndividualSchema | keyof BusinessDetailsSchema | keyof CompanySchema | keyof CompanySearchSchema | keyof PayoutDetailsSchema | keyof TrustSchema | keyof TrustMemberSchema | keyof SolePropSchema;
53
54
  export interface State<TLDS extends TopLevelDataSchema> {
54
55
  data: TLDS;
@@ -1,2 +1 @@
1
- import type { EmbeddedEventItem } from '../../user-events';
2
- export declare const pushEvents: (loadingContext: string, sessionId: string, event: EmbeddedEventItem) => Promise<void>;
1
+ export declare const pushEvents: <T>(loadingContext: string, sessionId: string, event: T) => Promise<unknown>;
@@ -1,10 +1,16 @@
1
1
  import type { ComponentMap } from '../../components';
2
- import type { EmbeddedEventItem, EventQueueItem, UserEventCallback } from '../user-events';
3
- export type useAnalyticsProps = {
2
+ import type { EventData, EventQueueItem, EventType, UserEventCallback } from '../user-events';
3
+ export type UseAnalyticsProps = {
4
4
  legalEntityId: string;
5
5
  onUserEvent?: UserEventCallback;
6
6
  sdkVersion: string;
7
7
  componentName: keyof ComponentMap;
8
8
  };
9
+ type EmbeddedEventItem = {
10
+ eventType: EventType;
11
+ eventName: string;
12
+ eventData: EventData;
13
+ };
9
14
  export declare const convertToEmbeddedEvent: (eventQueueItem: EventQueueItem) => EmbeddedEventItem;
10
- export declare const useAnalytics: ({ onUserEvent, legalEntityId, sdkVersion, componentName, }: useAnalyticsProps) => Promise<void>;
15
+ export declare const useAnalytics: ({ onUserEvent, legalEntityId, sdkVersion, componentName, }: UseAnalyticsProps) => Promise<void>;
16
+ export {};
@@ -0,0 +1,6 @@
1
+ interface UseCanSeeEntitySelection {
2
+ canSeeEntitySelection: boolean;
3
+ setCanSeeEntitySelection: (hasSeen: boolean) => void;
4
+ }
5
+ export declare const useCanSeeEntitySelection: (legalEntityId: string) => UseCanSeeEntitySelection;
6
+ export {};
@@ -1,6 +1,7 @@
1
1
  import type { BusinessDetailsSchema } from '../components/BusinessDetails/types';
2
2
  import type { CompanySchema } from '../components/Company/types';
3
3
  import type { CompanySearchSchema } from '../components/CompanySearch/types';
4
+ import type { HighExposureSchema } from '../components/Dropins/HighExposureDropin/types';
4
5
  import type { IndividualSchema } from '../components/Individual/types';
5
6
  import type { PayoutAccountSchema } from '../components/PayoutAccount/types';
6
7
  import type { SolePropSchema } from '../components/SoleProp/types';
@@ -19,6 +20,7 @@ export declare function parseBusinessDetailsScenarios(scenario: Scenario[] | und
19
20
  export declare function parseCompanyScenarios(scenario: Scenario[], country: CountryCode): FieldConfigurations<CompanySchema>;
20
21
  export declare function parseCompanySearchScenarios(scenario: Scenario[] | undefined, country: CountryCode): FieldConfigurations<CompanySearchSchema>;
21
22
  export declare function parseTrustScenarios(scenario: Scenario[], country: CountryCode): FieldConfigurations<TrustSchema>;
23
+ export declare const parseHighExposureScenarios: (scenario: Scenario[] | undefined) => FieldConfigurations<HighExposureSchema>;
22
24
  export declare function parseSolePropScenarios(scenario: Scenario[], country: CountryCode): FieldConfigurations<SolePropSchema>;
23
25
  export declare function parsePayoutScenarios({ requiredFields, country, bankVerificationAvailable, }: {
24
26
  requiredFields: (keyof PayoutAccountSchema)[] | undefined;
@@ -1,8 +1,9 @@
1
+ export interface EventData {
2
+ [key: string]: string | number | boolean | any[] | null;
3
+ }
1
4
  export interface UserEvent {
2
5
  /** Object with segments should be a flat object (arbitrary key/value pairs for event data) */
3
- segmentation?: {
4
- [key: string]: string | number | boolean | any[] | null;
5
- };
6
+ segmentation?: EventData;
6
7
  }
7
8
  type UserEventWithKey = UserEvent & {
8
9
  key: string;
@@ -10,11 +11,6 @@ type UserEventWithKey = UserEvent & {
10
11
  export type EventType = 'track_pageview' | 'add_event' | 'start_event' | 'end_event';
11
12
  export type EventQueueItem = [EventType, string | UserEventWithKey];
12
13
  export type UserEventCallback = (eventQueueItem: EventQueueItem) => void;
13
- export type EmbeddedEventItem = {
14
- eventType: EventType;
15
- eventName: string;
16
- eventData?: UserEvent;
17
- };
18
14
  declare class UserEvents {
19
15
  private readonly queue;
20
16
  private readonly subscriptions;
@@ -7,7 +7,7 @@ type BaseTrackingPayloadParams = {
7
7
  };
8
8
  parentLegalEntity?: LegalEntity;
9
9
  legalEntity?: LegalEntity;
10
- task: TaskTypes;
10
+ task?: TaskTypes;
11
11
  };
12
12
  export type BaseTrackingPayload = {
13
13
  task: TaskTypes;
@@ -4,6 +4,9 @@ import type { ValidationError } from '../../core/models/errors/validation-error'
4
4
  * Processes server validation errors received from an erroneous HTTP response.
5
5
  * @param validationError - the validation error contain all invalid fields.
6
6
  * @param dropinTask - the dropin page we are processing validations for.
7
+ * @param keyMappings - the actual keymappings, for non-task components
7
8
  */
8
- declare const processValidationErrors: (validationError: ValidationError, dropinTask: TaskTypes) => {};
9
+ declare const processValidationErrors: <T extends string>(validationError: ValidationError, dropinTask?: TaskTypes, keyMappings?: {
10
+ [key: string]: T;
11
+ }) => {};
9
12
  export default processValidationErrors;
@@ -1,3 +1,20 @@
1
1
  import type { BaseFormProps, BaseInnerFormProps, BaseOuterFormProps } from '../core/hooks/useForm';
2
2
  export declare function getFormProps<OuterFormProps extends BaseOuterFormProps<OuterFormSchema>, NestedFormProps extends BaseFormProps<NestedFormSchema>, OuterFormSchema, NestedFormSchema>(props: OuterFormProps, innerFormId: keyof OuterFormSchema): NestedFormProps | null;
3
+ export declare function removeFormLayer<OuterFormSchema>(obj: Partial<{
4
+ [InnerFormName in keyof OuterFormSchema]: (keyof OuterFormSchema[InnerFormName])[];
5
+ }> | undefined, formId: string): {};
6
+ /**
7
+ * TL;DR; Digs one level deeper in BaseOuterFormProps like getFormProps, while preserving BaseOuterFormProps structure
8
+ *
9
+ * we want to preserve getFormProps' utility of digging into the data structure without turning
10
+ * the special fields like requiredFields into arrays, like BaseInnerFormProps.
11
+ *
12
+ * This is also an opportunity to add feature for the special fields to be able to be "dug" into
13
+ * like an object.
14
+ *
15
+ * This will be done by using a "formA.formB" notation.
16
+ * @param props
17
+ * @param innerFormId
18
+ */
19
+ export declare function getNestedOuterFormPropsFromOuterFormProps<OuterFormProps extends BaseOuterFormProps<OuterFormSchema>, NestedFormProps extends BaseOuterFormProps<NestedFormSchema>, OuterFormSchema, NestedFormSchema>(props: OuterFormProps, innerFormId: keyof OuterFormSchema): NestedFormProps | null;
3
20
  export declare function getFieldProps<OuterFormProps extends BaseInnerFormProps<OuterFormSchema>, NestedFormProps extends BaseInnerFormProps<NestedFormSchema>, OuterFormSchema extends NestedFormSchema, NestedFormSchema>(props: OuterFormProps, innerFormFields: (keyof NestedFormSchema)[]): NestedFormProps | null;
@@ -10,5 +10,5 @@ type RecursiveKeyOfHandleValue<TValue, Text extends string> = TValue extends any
10
10
  * Includes those nested within other objects, e.g. `'name.firstName'`.
11
11
  * @param includeUndefined - whether to include properties which are defined but have a value of `undefined`.
12
12
  */
13
- export declare function getNestedPropertyKeys<T extends object>(obj: T, includeUndefined?: boolean): Array<RecursiveKeyOf<T>>;
13
+ export declare function getNestedPropertyKeys<T extends object>(obj: T, includeUndefined?: boolean, includeFalsy?: boolean): Array<RecursiveKeyOf<T>>;
14
14
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { CompanySchema } from '../../components/Company/types';
2
+ import type { HighExposureSchema } from '../../components/Dropins/HighExposureDropin/types';
2
3
  import type { IndividualSchema } from '../../components/Individual/types';
3
4
  import type { SolePropSchema } from '../../components/SoleProp/types';
4
5
  import type { TrustSchema } from '../../components/Trust/types';
@@ -13,6 +14,7 @@ export declare const mandatoryApiFields: {
13
14
  ORGANIZATION: Array<Partial<RecursiveKeyOf<CompanySchema>>>;
14
15
  SOLE_PROPRIETORSHIP: Array<Partial<RecursiveKeyOf<SolePropSchema>>>;
15
16
  TRUST: Array<Partial<RecursiveKeyOf<TrustSchema>>>;
17
+ HIGH_EXPOSURE: Array<Partial<RecursiveKeyOf<HighExposureSchema>>>;
16
18
  };
17
19
  export declare const individualObscuredFields: Array<RecursiveKeyOf<IndividualSchema>>;
18
20
  export declare const individualComponentsKeyMapping: {
@@ -57,6 +59,7 @@ export declare const businessDetailsComponentsKeyMapping: {
57
59
  'additionalInformation.isUen': string;
58
60
  'additionalInformation.stockExchangeMIC': string;
59
61
  'additionalInformation.stockISIN': string;
62
+ 'additionalInformation.stockTickerSymbol': string;
60
63
  'companyRegistrationAddress.registrationAddress.city': string;
61
64
  'companyRegistrationAddress.registrationAddress.country': string;
62
65
  'companyRegistrationAddress.registrationAddress.postalCode': string;
@@ -72,7 +75,7 @@ export declare const businessDetailsComponentsKeyMapping: {
72
75
  'additionalInformation.exemptedFromVat': string;
73
76
  };
74
77
  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";
78
+ [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.stockTickerSymbol" | "additionalInformation.isUen" | "additionalInformation.taxInformation";
76
79
  };
77
80
  export declare const companyComponentsKeyMapping: {
78
81
  'companyNameAndCountry.country': string;
@@ -87,6 +90,7 @@ export declare const companyComponentsKeyMapping: {
87
90
  'companyRegistrationDetails.isUen': string;
88
91
  'companyRegistrationDetails.stockExchangeMIC': string;
89
92
  'companyRegistrationDetails.stockISIN': string;
93
+ 'companyRegistrationDetails.stockTickerSymbol': string;
90
94
  'companyRegistrationAddress.registrationAddress.city': string;
91
95
  'companyRegistrationAddress.registrationAddress.country': string;
92
96
  'companyRegistrationAddress.registrationAddress.postalCode': string;
@@ -102,7 +106,7 @@ export declare const companyComponentsKeyMapping: {
102
106
  'companyRegistrationDetails.exemptedFromVat': string;
103
107
  };
104
108
  export declare const companyApiKeyMapping: {
105
- [x: string]: "companyType.entityType" | "companyNameAndCountry.country" | "companyNameAndCountry.legalCompanyName" | "companyNameAndCountry.countryOfGoverningLaw" | "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";
109
+ [x: string]: "companyType.entityType" | "companyNameAndCountry.country" | "companyNameAndCountry.legalCompanyName" | "companyNameAndCountry.countryOfGoverningLaw" | "companyRegistrationDetails.dateOfIncorporation" | "companyRegistrationDetails.tradingName" | "companyRegistrationDetails.vatAbsenceReason" | "companyRegistrationDetails.vatNumber" | "companyRegistrationDetails.registrationNumber" | "companyRegistrationDetails.stockExchangeMIC" | "companyRegistrationDetails.stockISIN" | "companyRegistrationDetails.stockTickerSymbol" | "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";
106
110
  };
107
111
  export declare const companySearchComponentsKeyMapping: {
108
112
  'companyBasics.country': string;
@@ -131,10 +135,11 @@ export declare const companySearchComponentsKeyMapping: {
131
135
  'companyOtherDetails.isUen': string;
132
136
  'companyOtherDetails.stockExchangeMIC': string;
133
137
  'companyOtherDetails.stockISIN': string;
138
+ 'companyOtherDetails.stockTickerSymbol': string;
134
139
  'companyOtherDetails.exemptedFromVat': string;
135
140
  };
136
141
  export declare const companySearchApiKeyMapping: {
137
- [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" | "companyBasics.country" | "companyBasics.stateOrProvince" | "companyBasics.legalCompanyName" | "companyBasics.taxInformation" | "companyOtherDetails.dateOfIncorporation" | "companyOtherDetails.tradingName" | "companyOtherDetails.vatAbsenceReason" | "companyOtherDetails.vatNumber" | "companyOtherDetails.registrationNumber" | "companyOtherDetails.stockExchangeMIC" | "companyOtherDetails.stockISIN" | "companyOtherDetails.isUen" | "companyOtherDetails.taxInformation";
142
+ [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" | "companyBasics.country" | "companyBasics.stateOrProvince" | "companyBasics.legalCompanyName" | "companyBasics.taxInformation" | "companyOtherDetails.dateOfIncorporation" | "companyOtherDetails.tradingName" | "companyOtherDetails.vatAbsenceReason" | "companyOtherDetails.vatNumber" | "companyOtherDetails.registrationNumber" | "companyOtherDetails.stockExchangeMIC" | "companyOtherDetails.stockISIN" | "companyOtherDetails.stockTickerSymbol" | "companyOtherDetails.isUen" | "companyOtherDetails.taxInformation";
138
143
  };
139
144
  export declare const payoutComponentKeyMapping: {
140
145
  'payoutAccountDetails.transferInstrumentId': string;
@@ -174,6 +179,14 @@ export declare const trustComponentsKeyMapping: {
174
179
  export declare const trustApiKeyMapping: {
175
180
  [x: string]: "trustRegistrationDetails.country" | "trustRegistrationDetails.registrationNumber" | "trustRegistrationDetails.trustType" | "trustRegistrationDetails.legalName" | "trustRegistrationAddress.registrationAddress.country" | "trustRegistrationAddress.registrationAddress.postalCode" | "trustRegistrationAddress.registrationAddress.city" | "trustRegistrationAddress.registrationAddress.stateOrProvince" | "trustRegistrationAddress.registrationAddress.otherAddressInformation" | "trustRegistrationAddress.registrationAddress.address" | "trustRegistrationAddress.operationalAddress.country" | "trustRegistrationAddress.operationalAddress.postalCode" | "trustRegistrationAddress.operationalAddress.city" | "trustRegistrationAddress.operationalAddress.stateOrProvince" | "trustRegistrationAddress.operationalAddress.otherAddressInformation" | "trustRegistrationAddress.operationalAddress.address";
176
181
  };
182
+ export declare const highExposureComponentsKeyMapping: {
183
+ 'company.numberOfEmployees': string;
184
+ 'parentCompany.numberOfEmployees': string;
185
+ 'ultimateParentCompany.numberOfEmployees': string;
186
+ };
187
+ export declare const highExposureApiKeyMapping: {
188
+ [x: string]: "company.numberOfEmployees" | "parentCompany.numberOfEmployees" | "ultimateParentCompany.numberOfEmployees";
189
+ };
177
190
  export declare const solePropComponentsKeyMapping: {
178
191
  'solePropNameAndCountry.country': string;
179
192
  'solePropNameAndCountry.legalCompanyName': string;
@@ -1,5 +1,6 @@
1
1
  import type { BankDocumentSchema } from '../../components/BankDocument/types';
2
2
  import type { CompanySchema } from '../../components/Company/types';
3
+ import type { HighExposureSchema } from '../../components/Dropins/HighExposureDropin/types';
3
4
  import type { IndividualSchema } from '../../components/Individual/types';
4
5
  import type { AccountHolderOption } from '../../components/internal/AccountHolder/types';
5
6
  import type { PayoutDetailsSchema } from '../../components/PayoutDetails/types';
@@ -34,8 +35,10 @@ export declare const mapLegalEntityToCompany: (legalEntity: LegalEntity, isChang
34
35
  export declare const mapCompanyToLegalEntity: (data: CompanySchema) => LegalEntity;
35
36
  export declare const mapLegalEntityToTrust: (legalEntity: LegalEntity) => TrustSchema;
36
37
  export declare const mapTrustToLegalEntity: (data: TrustSchema) => LegalEntity;
38
+ export declare const mapLegalEntityToHighExposure: (legalEntity: LegalEntity) => HighExposureSchema;
39
+ export declare const mapHighExposureToLegalEntity: (data: HighExposureSchema) => LegalEntity;
37
40
  export declare const mapLegalEntityToSoleProp: (legalEntity: LegalEntity) => SolePropSchema;
38
- export declare const mapSolePropToLegalEntity: (data: SolePropSchema, isCountryOfGoverningLawEnabled?: boolean) => LegalEntity;
41
+ export declare const mapSolePropToLegalEntity: (data: SolePropSchema) => LegalEntity;
39
42
  export type IndividualDocumentFields = Pick<IndividualSchema, 'idDocument' | 'proofOfResidence' | 'proofOfNationalId'>;
40
43
  export declare const getPage: ({ attachments }: Document, pageType?: PageType) => Attachment;
41
44
  export declare const getPageName: (document: Document, pageType?: PageType) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.44.0",
3
+ "version": "2.45.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -70,10 +70,11 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@adyen/adyen-document-viewer": "^1.1.0",
73
+ "@adyen/bento-design-tokens": "^1.13.1",
73
74
  "@adyen/openbankingsdk": "^0.1.2",
74
75
  "classnames": "^2.3.2",
75
76
  "isomorphic-dompurify": "^0.13.0",
76
- "lodash": "^4.17.21",
77
+ "lodash-es": "^4.17.21",
77
78
  "onfido-sdk-ui": "12.3.5",
78
79
  "preact": "^10.17.1",
79
80
  "validator": "^13.5.2"
@@ -94,6 +95,7 @@
94
95
  "@testing-library/user-event": "^14.4.3",
95
96
  "@types/dompurify": "^3.0.5",
96
97
  "@types/inquirer": "^9.0.3",
98
+ "@types/lodash-es": "^4.17.12",
97
99
  "@types/validator": "^13.12.0",
98
100
  "@typescript-eslint/eslint-plugin": "^5.62.0",
99
101
  "@typescript-eslint/parser": "^5.62.0",