@adyen/kyc-components 3.31.0 → 3.32.1
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.
- package/dist/es/adyen-kyc-components.es.js +688 -399
- package/dist/es/instant-verification-method-NGPLGC6g.js +50 -0
- package/dist/es/tink-logo-WImtH5CL.js +8 -0
- package/dist/style.css +247 -191
- package/dist/types/components/AdditionalInformation/VerifiedBusinessCard.d.ts +1 -1
- package/dist/types/components/AdditionalInformation/utils.d.ts +9 -0
- package/dist/types/components/BusinessSelection/types.d.ts +1 -2
- package/dist/types/components/Company/rules.d.ts +1 -0
- package/dist/types/components/Dropins/PciDropin/components/PciDropinComponent.d.ts +2 -1
- package/dist/types/components/Dropins/PciDropin/types.d.ts +1 -0
- package/dist/types/components/EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent.d.ts +1 -2
- package/dist/types/components/Individual/types.d.ts +1 -1
- package/dist/types/components/Individual/validators.d.ts +2 -1
- package/dist/types/components/PayoutAccount/helpers/mapPayoutAccountSchemaToApiBankAccount.d.ts +1 -1
- package/dist/types/components/PayoutDetails/types.d.ts +4 -1
- package/dist/types/components/PayoutVerificationMethod/component/PreferInstantVerificationMethod/PreferInstantVerificationMethod.d.ts +9 -0
- package/dist/types/components/PayoutVerificationMethod/types.d.ts +5 -0
- package/dist/types/components/RegistrationAddress/types.d.ts +1 -1
- package/dist/types/components/internal/Address/AddressComponent.d.ts +1 -1
- package/dist/types/components/internal/Address/constants.d.ts +2 -1
- package/dist/types/components/internal/Address/types.d.ts +2 -2
- package/dist/types/components/internal/Address/utils.d.ts +2 -3
- package/dist/types/components/internal/Button/Button.d.ts +1 -1
- package/dist/types/components/internal/Button/types.d.ts +1 -0
- package/dist/types/components/internal/Card/Card.d.ts +1 -1
- package/dist/types/components/internal/Card/types.d.ts +3 -0
- package/dist/types/components/internal/Link/Link.d.ts +1 -1
- package/dist/types/components/internal/Link/types.d.ts +1 -0
- package/dist/types/components/internal/Svg/svgs.d.ts +1 -0
- package/dist/types/core/Context/ExperimentContext/types.d.ts +3 -2
- package/dist/types/core/Context/SettingsContext/types.d.ts +3 -1
- package/dist/types/core/hooks/useBusinessData/types.d.ts +1 -2
- package/dist/types/core/hooks/useForm/reducer.d.ts +2 -2
- package/dist/types/core/hooks/useForm/types.d.ts +2 -2
- package/dist/types/core/hooks/useForm/useForm.d.ts +1 -1
- package/dist/types/core/models/api/company-search.d.ts +0 -1
- package/dist/types/core/models/company.d.ts +0 -3
- package/dist/types/core/models/form-rules.d.ts +2 -0
- package/dist/types/core/process-field-configurations.d.ts +2 -1
- package/dist/types/utils/datasetUtil.d.ts +3 -1
- package/dist/types/utils/formUtils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/es/tink-logo-CXMbO28D.js +0 -5
- package/dist/types/components/internal/Card/index.d.ts +0 -2
- package/dist/types/components/internal/FormFields/RadioGroupCard/index.d.ts +0 -3
- package/dist/types/types/index.d.ts +0 -9
|
@@ -7,13 +7,13 @@ import type { LegalEntityAssociation } from '../../core/models/api/legal-entity-
|
|
|
7
7
|
import type { LegalEntityType } from '../../core/models/api/legal-entity-type';
|
|
8
8
|
import type { CountryCode } from '../../core/models/country-code';
|
|
9
9
|
import type { FormModel } from '../../core/models/form';
|
|
10
|
-
import type { AddressSchema } from '../../types';
|
|
11
10
|
import type { ContactDetailsSchema } from '../ContactDetails/types';
|
|
12
11
|
import type { DocumentUploadSchema } from '../DocumentUpload/types';
|
|
13
12
|
import type { DropinAPIHandlers, DropinProps } from '../Dropins/types';
|
|
14
13
|
import type { IdDocumentUploadSchema } from '../IdDocumentUpload/types';
|
|
15
14
|
import type { IdVerificationMethodSchema } from '../IdVerificationMethod/types';
|
|
16
15
|
import type { AccountHolderOption } from '../internal/AccountHolder/types';
|
|
16
|
+
import type { AddressSchema } from '../internal/Address/types';
|
|
17
17
|
import type { PersonalDetailsSchema } from '../PersonalDetails/types';
|
|
18
18
|
import type { TaskTypes } from '../TaskList/types';
|
|
19
19
|
import type { TrustMember } from '../TrustMembers/types';
|
|
@@ -3,10 +3,11 @@ import type { CountryCode } from '../../core/models/country-code';
|
|
|
3
3
|
import type { ValidatorRule } from '../../utils/validation/types';
|
|
4
4
|
import type { PersonalDetailsSchema } from '../PersonalDetails/types';
|
|
5
5
|
import { TaskTypes } from '../TaskList/types';
|
|
6
|
-
export declare const validators: ({ country, isExperimentEnabled, taskType, }: {
|
|
6
|
+
export declare const validators: ({ country, isExperimentEnabled, taskType, isLegalAgeEnforced, }: {
|
|
7
7
|
country: CountryCode;
|
|
8
8
|
isExperimentEnabled?: (experiment: ExperimentName) => boolean;
|
|
9
9
|
taskType?: TaskTypes;
|
|
10
|
+
isLegalAgeEnforced?: boolean;
|
|
10
11
|
}) => {
|
|
11
12
|
birthDate: () => ValidatorRule<string, PersonalDetailsSchema>[];
|
|
12
13
|
nationality: () => ValidatorRule<PersonalDetailsSchema["nationality"], PersonalDetailsSchema>;
|
package/dist/types/components/PayoutAccount/helpers/mapPayoutAccountSchemaToApiBankAccount.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AccountIdentification } from '../../../core/models/api/accountIdentification';
|
|
2
2
|
import type { BankAccount } from '../../../core/models/api/transfer-instrument';
|
|
3
|
-
import type
|
|
3
|
+
import { type CountryCode } from '../../../core/models/country-code';
|
|
4
4
|
import type { PayoutAccountSchema } from '../types';
|
|
5
5
|
export declare const getAccountIdentificationFromPayoutAccountSchema: (payoutAccount: PayoutAccountSchema, bankCountry: CountryCode) => AccountIdentification;
|
|
6
6
|
export declare const mapPayoutAccountSchemaToApiBankAccount: (payoutAccount: PayoutAccountSchema, bankCountry: CountryCode) => BankAccount;
|
|
@@ -10,6 +10,7 @@ import type { FormModel } from '../../core/models/form';
|
|
|
10
10
|
import type { BankDocumentSchema } from '../BankDocument';
|
|
11
11
|
import type { AccountVerificationSchema, CountryBankVerificationVendors } from '../BankVerification/types';
|
|
12
12
|
import type { DropinAPIHandlers, DropinProps } from '../Dropins/types';
|
|
13
|
+
import type { LoadingStatus } from '../internal/LoaderWrapper/constants';
|
|
13
14
|
import type { PayoutAccountSchema } from '../PayoutAccount/types';
|
|
14
15
|
import type { PayoutVerificationMethodSchema } from '../PayoutVerificationMethod/types';
|
|
15
16
|
import type { TaskTypes } from '../TaskList/types';
|
|
@@ -33,14 +34,16 @@ export interface PayoutDetailsProps extends BaseOuterFormProps<PayoutDetailsSche
|
|
|
33
34
|
onNext?: () => void;
|
|
34
35
|
accountHolder: string;
|
|
35
36
|
bankVerificationVendors?: CountryBankVerificationVendors;
|
|
37
|
+
bankVendorsLoadingStatus: LoadingStatus;
|
|
36
38
|
instantVerificationEnabled?: boolean;
|
|
37
39
|
refreshLegalEntity?(): Promise<LegalEntity>;
|
|
38
40
|
createTrustedTransferInstrument?: (code: string, state: string) => Promise<CreateTrustedTransferInstrumentResponse | undefined>;
|
|
39
41
|
handleBankVerificationError?: (errorCode: string, errorMessage: string, state: string, metadata?: Map<string, string>) => Promise<BankVerificationErrorResponse>;
|
|
40
42
|
country: CountryCode;
|
|
43
|
+
handleNextClick(): void;
|
|
41
44
|
}
|
|
42
45
|
export type PayoutDropinApiHandlers = Required<Pick<DropinAPIHandlers, 'handleCreateDocument' | 'handleGetDocument' | 'handleUpdateDocument' | 'handleUpdateTransferInstrument' | 'handleCreateTransferInstrument'>> & Pick<DropinAPIHandlers, 'handleCreateTrustedTransferInstrument'>;
|
|
43
|
-
export interface PayoutDetailsDropinProps extends Omit<PayoutDetailsProps, 'country' | 'accountHolder'>, Omit<DropinProps, 'legalEntityResponse'>, PayoutDropinApiHandlers {
|
|
46
|
+
export interface PayoutDetailsDropinProps extends Omit<PayoutDetailsProps, 'country' | 'accountHolder' | 'handleNextClick' | 'bankVendorsLoadingStatus'>, Omit<DropinProps, 'legalEntityResponse'>, PayoutDropinApiHandlers {
|
|
44
47
|
accountHolder?: string;
|
|
45
48
|
transferInstrument?: ExistingTransferInstrument;
|
|
46
49
|
setTransferInstrument?: Dispatch<StateUpdater<ExistingTransferInstrument | undefined>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VerificationMethod } from '../../types';
|
|
2
|
+
interface PreferInstantVerificationMethodProps {
|
|
3
|
+
providerName: string | undefined;
|
|
4
|
+
bankInfoValidated: boolean;
|
|
5
|
+
instantVerificationAvailable: boolean;
|
|
6
|
+
selectVerificationMethod: (method: VerificationMethod) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const PreferInstantVerificationMethod: ({ providerName, bankInfoValidated, instantVerificationAvailable, selectVerificationMethod, }: PreferInstantVerificationMethodProps) => import("preact").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { BaseInnerFormProps } from '../../core/hooks/useForm';
|
|
2
2
|
import type { ExistingLegalEntity } from '../../core/models/api/legal-entity';
|
|
3
3
|
import type { CountryCode } from '../../core/models/country-code';
|
|
4
|
+
import type { FormModel } from '../../core/models/form';
|
|
4
5
|
import type { CountryBankVerificationVendors } from '../BankVerification/types';
|
|
6
|
+
import type { LoadingStatus } from '../internal/LoaderWrapper/constants';
|
|
5
7
|
export declare const payoutVerificationMethods: readonly ["instantVerification", "manualVerification"];
|
|
6
8
|
export type VerificationMethod = (typeof payoutVerificationMethods)[number];
|
|
7
9
|
export interface PayoutVerificationMethodSchema {
|
|
@@ -12,7 +14,10 @@ export interface PayoutVerificationMethodProps extends BaseInnerFormProps<Payout
|
|
|
12
14
|
country: CountryCode;
|
|
13
15
|
accountHolder: string;
|
|
14
16
|
bankVerificationVendors?: CountryBankVerificationVendors;
|
|
17
|
+
bankVendorsLoadingStatus: LoadingStatus;
|
|
15
18
|
instantVerificationAllowed: boolean;
|
|
16
19
|
bankInfoValidated: boolean;
|
|
17
20
|
legalEntityResponse: ExistingLegalEntity;
|
|
21
|
+
handleNextClick: () => void;
|
|
22
|
+
forms?: FormModel[];
|
|
18
23
|
}
|
|
@@ -2,8 +2,8 @@ import type { BaseOuterFormProps } from '../../core/hooks/useForm';
|
|
|
2
2
|
import type { CountryCode } from '../../core/models/country-code';
|
|
3
3
|
import type { FormModel } from '../../core/models/form';
|
|
4
4
|
import type { TranslationKey } from '../../language/types';
|
|
5
|
-
import type { AddressSchema } from '../../types';
|
|
6
5
|
import type { DropinAPIHandlers } from '../Dropins/types';
|
|
6
|
+
import type { AddressSchema } from '../internal/Address/types';
|
|
7
7
|
export interface RegistrationAddressSchema {
|
|
8
8
|
registrationAddress?: AddressSchema;
|
|
9
9
|
operationalAddress?: AddressSchema;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './Address.scss';
|
|
2
2
|
import type { AddressProps } from './types';
|
|
3
|
-
export declare function AddressComponent({ data, labels, placeholders, helperText, readOnly, hideCountry, fieldValidationErrors, allFields, requiredFields, optionalFields, readOnlyFields, trustedFields, shouldValidate, handleAddressSearch, handleFindAddress, onChange, legalEntityId, verifiedAddress, }: AddressProps): import("preact").JSX.Element;
|
|
3
|
+
export declare function AddressComponent({ data, labels, placeholders, helperText, readOnly, hideCountry, fieldValidationErrors, allFields, requiredFields, optionalFields, readOnlyFields, obscuredFields, trustedFields, shouldValidate, handleAddressSearch, handleFindAddress, onChange, legalEntityId, verifiedAddress, condensed, }: AddressProps): import("preact").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CountryCode } from '../../../core/models/country-code';
|
|
2
|
-
import type { AddressLabels, AddressSchemas } from './types';
|
|
2
|
+
import type { AddressLabels, AddressSchema, AddressSchemas } from './types';
|
|
3
3
|
export declare const ADDRESS_SCHEMA: readonly ["address", "otherAddressInformation", "postalCode", "city", "stateOrProvince", "country"];
|
|
4
4
|
export declare const COUNTRIES_WITH_STATES_DATASET: CountryCode[];
|
|
5
5
|
export declare const COUNTRIES_WITH_HOUSE_NUMBER_FIRST: CountryCode[];
|
|
6
6
|
export declare const COUNTRIES_WITH_COMMA_SEPARATED: CountryCode[];
|
|
7
7
|
export declare const ADDRESS_SCHEMAS: AddressSchemas;
|
|
8
|
+
export declare const CONDENSED_ADDRESS_FIELDS: Partial<Record<CountryCode, Array<keyof AddressSchema>>>;
|
|
8
9
|
export declare const LABELS: AddressLabels;
|
|
@@ -2,7 +2,6 @@ import type { BaseInnerFormProps } from '../../../core/hooks/useForm';
|
|
|
2
2
|
import type { CompanyDatasetResponse } from '../../../core/models/api/company-search';
|
|
3
3
|
import type { CountryCode } from '../../../core/models/country-code';
|
|
4
4
|
import type { TranslationKey } from '../../../language/types';
|
|
5
|
-
import type { AddressField } from '../../../types';
|
|
6
5
|
import type { RecordWithDefault } from '../../../utils/recordWithDefault';
|
|
7
6
|
import type { ValidationRuleResult, ValidatorMode } from '../../../utils/validation/types';
|
|
8
7
|
import type { DropinAPIHandlers } from '../../Dropins/types';
|
|
@@ -26,6 +25,7 @@ export interface AddressProps extends BaseInnerFormProps<AddressSchema> {
|
|
|
26
25
|
legalEntityId?: string;
|
|
27
26
|
verifiedBusiness?: CompanyDatasetResponse | undefined;
|
|
28
27
|
verifiedAddress?: AddressSchema;
|
|
28
|
+
condensed?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export interface FieldContainerProps {
|
|
31
31
|
legalEntityId?: string;
|
|
@@ -49,7 +49,7 @@ export interface ReadOnlyAddressProps {
|
|
|
49
49
|
data: AddressSchema;
|
|
50
50
|
label: TranslationKey;
|
|
51
51
|
}
|
|
52
|
-
export type AddressSchemas = RecordWithDefault<CountryCode,
|
|
52
|
+
export type AddressSchemas = RecordWithDefault<CountryCode, Array<keyof AddressSchema>>;
|
|
53
53
|
export type AddressLabels = {
|
|
54
54
|
[label: string]: RecordWithDefault<CountryCode, TranslationKey>;
|
|
55
55
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CountryCode } from '../../../core/models/country-code';
|
|
2
|
-
import type { AddressSchema } from '../../../types';
|
|
3
2
|
import type { DatasetUtil } from '../../../utils/datasetUtil';
|
|
4
|
-
import type { AddressSchemaLabels } from './types';
|
|
3
|
+
import type { AddressSchema, AddressSchemaLabels } from './types';
|
|
5
4
|
/**
|
|
6
5
|
* Returns the key for a field of the passed country or the default key for that field.
|
|
7
6
|
* @param fieldName - The data to pre-fill the address fields
|
|
@@ -12,7 +11,7 @@ export declare const getKeyForField: (fieldName: string, country?: CountryCode)
|
|
|
12
11
|
* Returns the address schema of the selected country or the default address schema.
|
|
13
12
|
* @param country - The selected country
|
|
14
13
|
*/
|
|
15
|
-
export declare const getAddressSchemaForCountry: (country: CountryCode | undefined) => (
|
|
14
|
+
export declare const getAddressSchemaForCountry: (country: CountryCode | undefined) => (keyof AddressSchema)[];
|
|
16
15
|
/**
|
|
17
16
|
* Returns the field labels for each field in the selected countries address schema.
|
|
18
17
|
* @param country - The selected country
|
|
@@ -2,5 +2,5 @@ import './_button.component.scss';
|
|
|
2
2
|
import '../Link/_link.component.scss';
|
|
3
3
|
import type { JSX } from 'preact';
|
|
4
4
|
import type { ButtonProps } from './types';
|
|
5
|
-
export declare const Button: ({ showAsLink, secondary, tertiary, className, role, small, block, critical, shaded, label, icon, title, disabled, type, onClick, onKeyDown, loading, testId, underline, }: ButtonProps) => JSX.Element;
|
|
5
|
+
export declare const Button: ({ showAsLink, secondary, tertiary, className, role, small, block, critical, shaded, label, icon, iconPosition, title, disabled, type, onClick, onKeyDown, loading, testId, underline, }: ButtonProps) => JSX.Element;
|
|
6
6
|
export default Button;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './_card.component.scss';
|
|
2
2
|
import type { JSX } from 'preact';
|
|
3
3
|
import type { CardProps } from './types';
|
|
4
|
-
export declare function Card({ className, children, stateful, active, disabled, fetching, warning, warningMessage, title, subTitle, headerButton, onClick, onKeyDown, }: CardProps): JSX.Element;
|
|
4
|
+
export declare function Card({ className, children, stateful, active, disabled, fetching, warning, warningMessage, title, subTitle, headerButton, background, onClick, onKeyDown, }: CardProps): JSX.Element;
|
|
@@ -11,11 +11,14 @@ export interface CardProps {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
subTitle?: string;
|
|
13
13
|
headerButton?: ComponentChildren;
|
|
14
|
+
background?: CardVariant;
|
|
14
15
|
onClick?: (e: JSX.TargetedMouseEvent<HTMLElement>) => void;
|
|
15
16
|
onKeyDown?: (e: JSX.TargetedKeyboardEvent<HTMLElement>) => void;
|
|
16
17
|
}
|
|
18
|
+
type CardVariant = 'primary' | 'secondary';
|
|
17
19
|
export interface CardGroupProps {
|
|
18
20
|
children?: ComponentChildren;
|
|
19
21
|
className?: string;
|
|
20
22
|
spaced?: boolean;
|
|
21
23
|
}
|
|
24
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './_link.component.scss';
|
|
2
2
|
import '../Button/_button.component.scss';
|
|
3
3
|
import type LinkProps from './types';
|
|
4
|
-
declare const Link: ({ className, children, href, external, icon, showAsButton, onClick }: LinkProps) => import("preact").JSX.Element;
|
|
4
|
+
declare const Link: ({ className, children, href, external, icon, showAsButton, onClick, iconPosition, }: LinkProps) => import("preact").JSX.Element;
|
|
5
5
|
export default Link;
|
|
@@ -69,6 +69,7 @@ export declare const svgs: {
|
|
|
69
69
|
readonly 'passport-cutoff': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
70
70
|
readonly 'passport-front': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
71
71
|
readonly 'passport-glare': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
72
|
+
readonly 'instant-verification-method': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
72
73
|
readonly 'id-verification-instant': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
73
74
|
readonly 'id-verification-manual': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
74
75
|
readonly 'payout-verification-instant': import("preact").FunctionComponent<import("preact/compat").JSX.SVGAttributes<SVGSVGElement>>;
|
|
@@ -18,9 +18,10 @@ export declare enum ExperimentNames {
|
|
|
18
18
|
EnableAgeVerification = "EnableAgeVerification",
|
|
19
19
|
PreserveMismatchedInitialValues = "PreserveMismatchedInitialValues",
|
|
20
20
|
StrictNameAndAddressValidationV4 = "StrictNameAndAddressValidationV4",
|
|
21
|
-
|
|
21
|
+
EnableNationalitySGHK = "EnableNationalitySGHK",
|
|
22
22
|
EnableAUGovernmentalOrganizationSkipRegistrationNumber = "EnableAUGovernmentalOrganizationSkipRegistrationNumber",
|
|
23
|
-
EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation"
|
|
23
|
+
EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation",
|
|
24
|
+
EnablePreferInstantVerificationFlow = "EnablePreferInstantVerificationFlow"
|
|
24
25
|
}
|
|
25
26
|
export type ExperimentName = `${ExperimentNames}`;
|
|
26
27
|
export type Experiments = {
|
|
@@ -22,7 +22,8 @@ export declare enum SettingNames {
|
|
|
22
22
|
TransferInstrumentLimit = "transferInstrumentLimit",
|
|
23
23
|
ViewOnboardingGuidance = "viewOnboardingGuidance",
|
|
24
24
|
InstantBankVerification = "instantBankVerification",
|
|
25
|
-
ShowServiceAgreementsFirst = "showServiceAgreementsFirst"
|
|
25
|
+
ShowServiceAgreementsFirst = "showServiceAgreementsFirst",
|
|
26
|
+
EnforceLegalAge = "enforceLegalAge"
|
|
26
27
|
}
|
|
27
28
|
export type SettingName = `${SettingNames}`;
|
|
28
29
|
export interface Settings {
|
|
@@ -44,6 +45,7 @@ export interface Settings {
|
|
|
44
45
|
transferInstrumentLimit: number;
|
|
45
46
|
instantBankVerification: boolean;
|
|
46
47
|
showServiceAgreementsFirst: boolean;
|
|
48
|
+
enforceLegalAge: boolean;
|
|
47
49
|
}
|
|
48
50
|
export type ProvidedSettings = Partial<Settings>;
|
|
49
51
|
type BooleanSettingName = {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DropinAPIHandlers } from '../../../components/Dropins/types';
|
|
2
2
|
import type { CompanyDatasetResponse, CompanySearchRequest, CompanySearchResult } from '../../models/api/company-search';
|
|
3
|
-
import type { ProvinceCode } from '../../models/province-code';
|
|
4
3
|
import type { StateCode } from '../../models/state-code';
|
|
5
4
|
import type { HookStatus } from '../types';
|
|
6
5
|
export interface UseBusinessDataOptions {
|
|
@@ -13,7 +12,7 @@ export interface UseBusinessDataOptions {
|
|
|
13
12
|
}
|
|
14
13
|
export type UseBusinessData = {
|
|
15
14
|
searchForBusiness: (data: CompanySearchRequest) => Promise<CompanySearchResult[] | undefined>;
|
|
16
|
-
fetchBusinessData: (company: CompanySearchResult, state?: StateCode
|
|
15
|
+
fetchBusinessData: (company: CompanySearchResult, state?: StateCode) => Promise<CompanyDatasetResponse | undefined>;
|
|
17
16
|
verifyBusinessData: (data: CompanyDatasetResponse, tin: string) => Promise<boolean | undefined>;
|
|
18
17
|
clearTrustedBusinessData: () => Promise<void>;
|
|
19
18
|
resetBusinessData: () => void;
|
|
@@ -10,7 +10,7 @@ export interface InitOptions<FormSchema> {
|
|
|
10
10
|
defaultData?: FormSchema;
|
|
11
11
|
obscuredFields?: (keyof FormSchema)[];
|
|
12
12
|
optionalFields?: (keyof FormSchema)[];
|
|
13
|
-
trustedFields?:
|
|
13
|
+
trustedFields?: string[];
|
|
14
14
|
fieldProblems?: Record<keyof FormSchema, boolean>;
|
|
15
15
|
formatters?: FormatRules<FormSchema>;
|
|
16
16
|
}
|
|
@@ -35,7 +35,7 @@ export interface GetReducerOptions<FormSchema> {
|
|
|
35
35
|
asyncValidate: TriggerAsyncValidation<FormSchema>;
|
|
36
36
|
obscuredFields?: (keyof FormSchema)[];
|
|
37
37
|
optionalFields?: (keyof FormSchema)[];
|
|
38
|
-
trustedFields?:
|
|
38
|
+
trustedFields?: string[];
|
|
39
39
|
formatters?: FormatRules<FormSchema>;
|
|
40
40
|
}
|
|
41
41
|
export type GetReducerResults<FormSchema> = Reducer<FormState<FormSchema>, ReducerAction<FormSchema>>;
|
|
@@ -57,7 +57,7 @@ export interface FormState<FormSchema> {
|
|
|
57
57
|
fieldProblems: Record<keyof FormSchema, boolean>;
|
|
58
58
|
obscuredFields?: Array<keyof FormSchema>;
|
|
59
59
|
optionalFields?: Array<keyof FormSchema>;
|
|
60
|
-
trustedFields?: Array<
|
|
60
|
+
trustedFields?: Array<string>;
|
|
61
61
|
isValid?: boolean;
|
|
62
62
|
dataStoreId?: string;
|
|
63
63
|
local?: FormState<FormSchema> | Partial<FormState<FormSchema>>;
|
|
@@ -150,7 +150,7 @@ export interface BaseInnerFormProps<FormSchema> extends BaseFormProps<FormSchema
|
|
|
150
150
|
optionalFields?: Array<keyof FormSchema>;
|
|
151
151
|
verifyFields?: Array<keyof FormSchema>;
|
|
152
152
|
readOnlyFields?: Array<keyof FormSchema>;
|
|
153
|
-
trustedFields?: Array<
|
|
153
|
+
trustedFields?: Array<string>;
|
|
154
154
|
id?: string;
|
|
155
155
|
dataStoreId?: string;
|
|
156
156
|
capabilities?: CapabilityName[];
|
|
@@ -10,6 +10,6 @@ export interface UseFormOptions<FormSchema> {
|
|
|
10
10
|
fieldProblems?: Record<keyof FormSchema, boolean>;
|
|
11
11
|
obscuredFields?: (keyof FormSchema)[];
|
|
12
12
|
optionalFields?: (keyof FormSchema)[];
|
|
13
|
-
trustedFields?:
|
|
13
|
+
trustedFields?: string[];
|
|
14
14
|
}
|
|
15
15
|
export declare function useForm<FormSchema>({ schema, defaultData, rules, asyncRules, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, shouldValidate, }: UseFormOptions<FormSchema>): Form<FormSchema>;
|
|
@@ -10,9 +10,6 @@ interface CompanyTypeModel {
|
|
|
10
10
|
export declare const companyBase: {
|
|
11
11
|
[key: string]: ScenarioFieldSettings;
|
|
12
12
|
};
|
|
13
|
-
export declare const companySearchBase: {
|
|
14
|
-
[key: string]: ScenarioFieldSettings;
|
|
15
|
-
};
|
|
16
13
|
export declare const businessDetailsBase: {
|
|
17
14
|
[key: string]: ScenarioFieldSettings;
|
|
18
15
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AccountHolderOption } from '../../components/internal/AccountHolder/types';
|
|
1
2
|
import type { TaskTypes } from '../../components/TaskList/types';
|
|
2
3
|
import type { AccountFormatRequirements } from '../../datasets/accountFormats/getAccountFormatForCountry';
|
|
3
4
|
import type { ExperimentName } from '../Context/ExperimentContext/types';
|
|
@@ -14,6 +15,7 @@ export interface FormRulesParams<TLDS extends TopLevelDataSchema> {
|
|
|
14
15
|
requiredFields?: Partial<AccountFormatRequirements>;
|
|
15
16
|
isEmbeddedDropin?: boolean;
|
|
16
17
|
rootLegalEntity?: ExistingLegalEntity;
|
|
18
|
+
accountHolder?: AccountHolderOption;
|
|
17
19
|
}
|
|
18
20
|
export type FormRules<TLDS extends TopLevelDataSchema> = (params: FormRulesParams<TLDS>) => {
|
|
19
21
|
[ruleName: string]: () => string | boolean | undefined;
|
|
@@ -10,6 +10,7 @@ import type { ValidatorRules } from '../utils/validation/types';
|
|
|
10
10
|
import type { BaseOuterFormProps } from './hooks/useForm';
|
|
11
11
|
import type { Scenario } from './models/api/get-scenarios';
|
|
12
12
|
import type { LegalEntityTrustedFields } from './models/api/legal-entity';
|
|
13
|
+
import type { LegalEntityType } from './models/api/legal-entity-type';
|
|
13
14
|
import type { VerificationError } from './models/api/verification-error';
|
|
14
15
|
import type { CountryCode } from './models/country-code';
|
|
15
16
|
import type { Remediation } from './models/errors/remediation';
|
|
@@ -69,5 +70,5 @@ type PropsFromConfiguration<FormSchema> = Required<Pick<BaseOuterFormProps<FormS
|
|
|
69
70
|
* }
|
|
70
71
|
* ```
|
|
71
72
|
*/
|
|
72
|
-
export declare function getPropsFromConfigurations<FormSchema extends object>(scenarioConfiguration: FieldConfigurations<FormSchema> | undefined, forms: FormList, remediationActions: Remediation[], dataMissingErrors: VerificationError[], fieldsWithExistingData: AnyTLDSFieldName[], customRules
|
|
73
|
+
export declare function getPropsFromConfigurations<FormSchema extends object>(scenarioConfiguration: FieldConfigurations<FormSchema> | undefined, forms: FormList, remediationActions: Remediation[], dataMissingErrors: VerificationError[], fieldsWithExistingData: AnyTLDSFieldName[], customRules: {}, customLabels: {}, customValidators: {}, legalEntityType: LegalEntityType, legalEntityTrustedFields?: LegalEntityTrustedFields[]): PropsFromConfiguration<FormSchema> | undefined;
|
|
73
74
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { DataSet } from '../core/models/api/data-set';
|
|
2
2
|
import type { CountryCode } from '../core/models/country-code';
|
|
3
|
+
import type { ProvinceCode } from '../core/models/province-code';
|
|
4
|
+
import type { StateCode } from '../core/models/state-code';
|
|
3
5
|
export type DatasetIdentifier = 'countries' | `states/${CountryCode}`;
|
|
4
6
|
export declare const datasetIdentifier: {
|
|
5
7
|
readonly country: "countries";
|
|
@@ -7,7 +9,7 @@ export declare const datasetIdentifier: {
|
|
|
7
9
|
};
|
|
8
10
|
export type DatasetUtil = {
|
|
9
11
|
getCountryName: (countryCode: CountryCode | undefined) => string | null;
|
|
10
|
-
getStateName: (stateCode:
|
|
12
|
+
getStateName: (stateCode: StateCode | ProvinceCode, countryCode: CountryCode) => string | null;
|
|
11
13
|
setDataset: (datasetKey: string, dataset: DataSet) => void;
|
|
12
14
|
getDataset: (identifier: string) => DataSet;
|
|
13
15
|
getDatasetKey: (identifier: string) => string;
|
|
@@ -14,6 +14,7 @@ export type FormUtils<Schema> = {
|
|
|
14
14
|
isOptionalField: (field: keyof Schema) => boolean;
|
|
15
15
|
isVisibleField: (field: keyof Schema, showIfNotInRequiredFields?: boolean) => boolean;
|
|
16
16
|
isReadOnly: (field: keyof Schema) => boolean;
|
|
17
|
+
isTrusted: (field: keyof Schema) => boolean;
|
|
17
18
|
getVal: (val: Translatable) => string;
|
|
18
19
|
getErrorMessage: (field: keyof Schema, errors: ValidationRuleResults<Schema> | null, fieldProblems: Partial<Record<keyof Schema, boolean>> | undefined) => string | boolean;
|
|
19
20
|
getFieldData: <Fields extends Array<keyof Schema>, FieldSchema extends {
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx } from "preact/compat/jsx-runtime";
|
|
2
|
-
const SvgTinkLogo = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 29 15", role: "img", ...props, children: /* @__PURE__ */ jsx("path", { fill: "#8390A3", d: "M4.26 12.62c-1.01 0-1.36-.47-1.36-1.17V8.36h2.23V6.94H2.91V4.47H1.19v2.47H0v1.44h1.1v3.12c0 1.58 1.05 2.62 2.9 2.62.52 0 .99-.09 1.24-.19l-.06-1.46q-.43.16-.92.15m3.86-5.68H6.3v7.1h1.82zm5.27-.07c-1.11 0-1.87.45-2.3 1.1l-.06-1.03H9.28v7.1h1.82v-4.02c0-.97.64-1.62 1.62-1.62.93 0 1.4.59 1.4 1.6v4.05h1.84V9.58c0-1.64-.95-2.7-2.57-2.7Zm7.71 3.01 2.73-2.94h-2.18l-2.76 3.07V4.46h-1.82v9.58h1.82v-1.8l1.05-1.1 2.1 2.9h2.07l-3-4.16ZM8.12 4.46H6.3v1.57h1.82zM24.7 2.7a2.3 2.3 0 0 0 1.6-.64A2.2 2.2 0 0 0 26.98.5h1.82c0 2.2-1.83 3.97-4.1 3.97z" }) });
|
|
3
|
-
export {
|
|
4
|
-
SvgTinkLogo as default
|
|
5
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ADDRESS_SCHEMA } from '../components/internal/Address/constants';
|
|
2
|
-
export type AddressField = (typeof ADDRESS_SCHEMA)[number];
|
|
3
|
-
export type AddressSchema = {
|
|
4
|
-
[key in AddressField]?: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Visibility options for a fieldset
|
|
8
|
-
*/
|
|
9
|
-
export type FieldsetVisibility = 'editable' | 'hidden' | 'readOnly';
|