@adyen/kyc-components 2.34.2 → 2.36.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.
- package/dist/es/adyen-kyc-components.es.js +409 -233
- package/dist/style.css +6 -13
- package/dist/types/components/BaseElement.d.ts +1 -1
- package/dist/types/components/CompanyStructure/component/CompanyStructureComponent.d.ts +1 -3
- package/dist/types/components/Dropins/types.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/{OnboardingRedirect/OnboardingRedirectComponent.d.ts → ViewVerificationStatus/ViewVerificationStatusComponent.d.ts} +6 -5
- package/dist/types/components/EmbeddedDropins/{OnboardingRedirect → ViewVerificationStatus}/content.d.ts +1 -1
- package/dist/types/components/EmbeddedDropins/ViewVerificationStatus/index.d.ts +2 -0
- package/dist/types/components/EmbeddedDropins/{OnboardingRedirect → ViewVerificationStatus}/types.d.ts +1 -1
- package/dist/types/components/UIElement.d.ts +2 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/internal/CollapsibleContainer/types.d.ts +1 -1
- package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiProvider.d.ts +5 -1
- package/dist/types/core/Context/SettingsContext/types.d.ts +2 -2
- package/dist/types/core/Context/SettingsContext/useSetting.d.ts +1 -1
- package/dist/types/core/SDKValidation/index.d.ts +1 -1
- package/dist/types/core/Services/componentApi/generate-onboarding-link.d.ts +1 -1
- package/dist/types/core/Services/componentApi/get-analytics-session.d.ts +2 -0
- package/dist/types/core/Services/componentApi/get-onboarding-status.d.ts +1 -1
- package/dist/types/core/Services/componentApi/push-events.d.ts +2 -0
- package/dist/types/core/core.d.ts +1 -1
- package/dist/types/core/hooks/useAnalytics.d.ts +11 -0
- package/dist/types/core/hooks/useAssociatedLegalArrangement.d.ts +2 -0
- package/dist/types/core/hooks/useComponentApi.d.ts +4 -0
- package/dist/types/core/models/api/analytics.d.ts +9 -0
- package/dist/types/core/models/api/{onboarding-redirect.d.ts → view-verification-status.d.ts} +6 -6
- package/dist/types/core/user-events.d.ts +7 -8
- package/dist/types/utils/masking/maskTypes.d.ts +5 -0
- package/dist/types/utils/masking/matchAgainstMask.d.ts +3 -0
- package/dist/types/utils/masking/shiftRight.d.ts +15 -0
- package/package.json +1 -1
- package/dist/types/components/EmbeddedDropins/OnboardingRedirect/index.d.ts +0 -2
- package/dist/types/core/hooks/useTrust.d.ts +0 -11
package/dist/style.css
CHANGED
|
@@ -101552,7 +101552,6 @@ a.adl-button:disabled, a.adl-button.adl-button--disabled {
|
|
|
101552
101552
|
background-color: #fff;
|
|
101553
101553
|
padding: 32px;
|
|
101554
101554
|
border-radius: 8px;
|
|
101555
|
-
z-index: 2;
|
|
101556
101555
|
}/* #region Spacing */
|
|
101557
101556
|
/* #endregion */
|
|
101558
101557
|
/* #region Colors */
|
|
@@ -111014,7 +111013,7 @@ a.adl-button:disabled, a.adl-button.adl-button--disabled {
|
|
|
111014
111013
|
.adl-u-width-auto {
|
|
111015
111014
|
width: auto !important;
|
|
111016
111015
|
}
|
|
111017
|
-
.adyen-
|
|
111016
|
+
.adyen-view-verification-status {
|
|
111018
111017
|
color: #00112c;
|
|
111019
111018
|
font-family: fakt, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, oxygen, ubuntu, cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
111020
111019
|
font-size: 15px;
|
|
@@ -111026,24 +111025,18 @@ a.adl-button:disabled, a.adl-button.adl-button--disabled {
|
|
|
111026
111025
|
overflow: hidden;
|
|
111027
111026
|
position: relative;
|
|
111028
111027
|
}
|
|
111029
|
-
.adyen-
|
|
111030
|
-
.adyen-
|
|
111031
|
-
.adyen-
|
|
111028
|
+
.adyen-view-verification-status *,
|
|
111029
|
+
.adyen-view-verification-status *::before,
|
|
111030
|
+
.adyen-view-verification-status *::after {
|
|
111032
111031
|
box-sizing: border-box;
|
|
111033
111032
|
}
|
|
111034
|
-
.adyen-
|
|
111035
|
-
margin: 0 0 18px 0;
|
|
111036
|
-
color: #394962;
|
|
111037
|
-
font-size: 21px;
|
|
111038
|
-
line-height: 1.4;
|
|
111039
|
-
}
|
|
111040
|
-
.adyen-onboarding-redirect__description {
|
|
111033
|
+
.adyen-view-verification-status__description {
|
|
111041
111034
|
color: #394962;
|
|
111042
111035
|
font-size: 15px;
|
|
111043
111036
|
line-height: 1.4;
|
|
111044
111037
|
margin: 0 0 12px 0;
|
|
111045
111038
|
}
|
|
111046
|
-
.adyen-
|
|
111039
|
+
.adyen-view-verification-status__button {
|
|
111047
111040
|
font-size: 15px;
|
|
111048
111041
|
line-height: 1.4;
|
|
111049
111042
|
}
|
|
@@ -11,7 +11,7 @@ export declare abstract class BaseElement<P extends BaseElementProps> {
|
|
|
11
11
|
_component?: JSX.Element;
|
|
12
12
|
eventEmitter: EventEmitter;
|
|
13
13
|
private readonly _parentInstance?;
|
|
14
|
-
|
|
14
|
+
constructor(props: P);
|
|
15
15
|
abstract render(): JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
* Mounts an element into the dom
|
|
@@ -3,6 +3,4 @@ import { CompanySearchSchema } from '../../CompanySearch/types';
|
|
|
3
3
|
import { CompanyStructureProps, CompanyStructureSchema } from '../types';
|
|
4
4
|
export declare const COMPANY_STRUCTURE_FORM_ID: keyof CompanySearchSchema;
|
|
5
5
|
export declare const companyStructureFields: Array<keyof CompanyStructureSchema>;
|
|
6
|
-
declare function
|
|
7
|
-
export declare const CompanyStructureComponent: typeof CompanyStructure;
|
|
8
|
-
export {};
|
|
6
|
+
export declare function CompanyStructureComponent({ data, labels, heading, description, formVerificationErrors, fieldValidationErrors, requiredFields, kompanyVerifiedData, }: CompanyStructureProps): import("preact").JSX.Element;
|
|
@@ -6,9 +6,9 @@ import { Document, ExistingDocument } from '../../core/models/api/document';
|
|
|
6
6
|
import { BankVerificationVendorsResponse } from '../../core/models/api/get-bankVerification-providers';
|
|
7
7
|
import type { InstantIdVerificationStartCheckRequest, InstantIdVerificationStartCheckResponse, InstantIdVerificationTokenRequest, InstantIdVerificationTokenResponse } from '../../core/models/api/instant-id-verification';
|
|
8
8
|
import { ExistingLegalEntity, LegalEntity, PatchLegalEntity } from '../../core/models/api/legal-entity';
|
|
9
|
-
import { OnboardingLinkConfig, OnboardingLinkResponse, OnboardingStatusResponse } from '../../core/models/api/onboarding-redirect';
|
|
10
9
|
import { ReviewCompletion } from '../../core/models/api/review';
|
|
11
10
|
import { TransferInstrument } from '../../core/models/api/transfer-instrument';
|
|
11
|
+
import { OnboardingLinkConfig, OnboardingLinkResponse, OnboardingStatusResponse } from '../../core/models/api/view-verification-status';
|
|
12
12
|
import { CountryCode } from '../../core/models/country-code';
|
|
13
13
|
import { BaseTrackingPayload } from '../../core/utils';
|
|
14
14
|
import { TranslationKey } from '../../language/types';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './ViewVerificationStatusComponent.scss';
|
|
2
2
|
import { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
|
|
3
|
-
import { OnboardingStatus } from '../../../core/models/api/
|
|
3
|
+
import { OnboardingStatus } from '../../../core/models/api/view-verification-status';
|
|
4
4
|
import EventEmitter from '../../EventEmitter';
|
|
5
5
|
import { ErrorEntity, OnboardingRedirectConfig, OnboardingUrlTarget } from './types';
|
|
6
|
-
export interface
|
|
6
|
+
export interface ViewVerificationStatusComponentProps {
|
|
7
7
|
legalEntityId: ExistingLegalEntity['id'];
|
|
8
|
-
|
|
8
|
+
hideExplanation?: boolean;
|
|
9
9
|
returnUrl?: string;
|
|
10
|
+
redirectTarget?: OnboardingUrlTarget;
|
|
10
11
|
onStatusChange?: (status: OnboardingStatus) => void;
|
|
11
12
|
onError?: (errorEntity: ErrorEntity) => void;
|
|
12
13
|
onRedirect?: (config: OnboardingRedirectConfig) => void;
|
|
13
14
|
eventEmitter?: EventEmitter;
|
|
14
15
|
}
|
|
15
|
-
export declare function
|
|
16
|
+
export declare function ViewVerificationStatusComponent({ legalEntityId, hideExplanation, returnUrl, redirectTarget, onStatusChange, onError, onRedirect, eventEmitter, }: ViewVerificationStatusComponentProps): import("preact").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OnboardingRedirectContent, OnboardingStatus } from '../../../core/models/api/
|
|
1
|
+
import { OnboardingRedirectContent, OnboardingStatus } from '../../../core/models/api/view-verification-status';
|
|
2
2
|
export declare function getContentByStatus(status: OnboardingStatus): OnboardingRedirectContent | undefined;
|
|
@@ -7,15 +7,16 @@ import { SettingsProps } from '../core/Context/SettingsContext/types';
|
|
|
7
7
|
import { UserEventCallback } from '../core/user-events';
|
|
8
8
|
import { BaseElement, BaseElementProps } from './BaseElement';
|
|
9
9
|
import EventEmitter from './EventEmitter';
|
|
10
|
+
import { ComponentMap } from './index';
|
|
10
11
|
export interface BasicComponentProps {
|
|
11
12
|
eventEmitter?: EventEmitter;
|
|
12
13
|
}
|
|
13
14
|
export interface UIElementProps<ComponentProps extends BasicComponentProps> extends BaseElementProps, CoreProviderProps, AuthProviderProps, I18nProviderProps, SettingsProps, ExperimentsProps {
|
|
14
15
|
onUserEvent?: UserEventCallback;
|
|
15
16
|
component: (props: ComponentProps) => JSX.Element;
|
|
17
|
+
componentName: keyof ComponentMap;
|
|
16
18
|
componentProps: ComponentProps;
|
|
17
19
|
}
|
|
18
20
|
export declare class UIElement<ComponentProps extends BasicComponentProps = BasicComponentProps> extends BaseElement<UIElementProps<ComponentProps>> {
|
|
19
|
-
constructor(props: UIElementProps<ComponentProps>);
|
|
20
21
|
render: () => JSX.Element;
|
|
21
22
|
}
|
|
@@ -12,7 +12,7 @@ import { SolePropDropinComponent } from './Dropins/SolePropDropin';
|
|
|
12
12
|
import { TrustDropinComponent } from './Dropins/TrustDropin';
|
|
13
13
|
import { CreateIndividualComponent } from './EmbeddedDropins/CreateIndividualComponent/CreateIndividualComponent';
|
|
14
14
|
import { CreateTransferInstrumentComponent } from './EmbeddedDropins/CreateTransferInstrumentComponent/CreateTransferInstrumentComponent';
|
|
15
|
-
import {
|
|
15
|
+
import { ViewVerificationStatusComponent } from './EmbeddedDropins/ViewVerificationStatus';
|
|
16
16
|
/**
|
|
17
17
|
* Maps each component with a Component element.
|
|
18
18
|
*/
|
|
@@ -27,7 +27,7 @@ export declare const componentsMap: {
|
|
|
27
27
|
readonly pci: typeof PciDropinComponent;
|
|
28
28
|
readonly createTransferInstrumentComponent: typeof CreateTransferInstrumentComponent;
|
|
29
29
|
readonly createIndividualComponent: typeof CreateIndividualComponent;
|
|
30
|
-
readonly
|
|
30
|
+
readonly viewVerificationStatusComponent: typeof ViewVerificationStatusComponent;
|
|
31
31
|
};
|
|
32
32
|
export type ComponentMap = typeof componentsMap;
|
|
33
33
|
export type ComponentProps<Name extends keyof ComponentMap> = Parameters<ComponentMap[Name]>[0];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { ComponentChildren } from 'preact';
|
|
2
|
+
import { ComponentMap } from '../../../components';
|
|
3
|
+
import { UserEventCallback } from '../../user-events';
|
|
2
4
|
interface ConfigurationApiContextProviderProps {
|
|
3
5
|
children: ComponentChildren;
|
|
6
|
+
onUserEvent?: UserEventCallback;
|
|
4
7
|
rootLegalEntityId: string;
|
|
8
|
+
componentName: keyof ComponentMap;
|
|
5
9
|
}
|
|
6
|
-
export declare const ConfigurationApiProvider: ({ children, rootLegalEntityId, }: ConfigurationApiContextProviderProps) => import("preact").JSX.Element;
|
|
10
|
+
export declare const ConfigurationApiProvider: ({ children, onUserEvent, rootLegalEntityId, componentName, }: ConfigurationApiContextProviderProps) => import("preact").JSX.Element;
|
|
7
11
|
export {};
|
|
@@ -10,7 +10,6 @@ export declare enum SettingNames {
|
|
|
10
10
|
AllowIntraRegionCrossBorderPayout = "allowIntraRegionCrossBorderPayout",
|
|
11
11
|
AllowLegalEntityTypeChange = "changeLegalEntityType",
|
|
12
12
|
AllowPrefilledCountryEdit = "editPrefilledCountry",
|
|
13
|
-
LimitToOneTransferInstrument = "limitToOneTransferInstrument",
|
|
14
13
|
RequirePciSignEcommerce = "requirePciSignEcommerce",
|
|
15
14
|
RequirePciSignPos = "requirePciSignPos",
|
|
16
15
|
RequirePciSignEcomMoto = "requirePciSignEcomMoto",
|
|
@@ -19,6 +18,7 @@ export declare enum SettingNames {
|
|
|
19
18
|
HideOnboardingIntroductionOrganization = "hideOnboardingIntroductionOrganization",
|
|
20
19
|
HideOnboardingIntroductionTrust = "hideOnboardingIntroductionTrust",
|
|
21
20
|
HideOnboardingIntroductionSoleProprietor = "hideOnboardingIntroductionSoleProprietor",
|
|
21
|
+
TransferInstrumentLimit = "transferInstrumentLimit",
|
|
22
22
|
ViewOnboardingGuidance = "viewOnboardingGuidance"
|
|
23
23
|
}
|
|
24
24
|
export type SettingName = `${SettingNames}`;
|
|
@@ -37,7 +37,7 @@ export interface Settings {
|
|
|
37
37
|
hideOnboardingIntroductionTrust: boolean;
|
|
38
38
|
hideOnboardingIntroductionSoleProprietor: boolean;
|
|
39
39
|
viewOnboardingGuidance: boolean;
|
|
40
|
-
|
|
40
|
+
transferInstrumentLimit: number;
|
|
41
41
|
}
|
|
42
42
|
export type ProvidedSettings = Partial<Settings>;
|
|
43
43
|
type BooleanSettingName = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Settings } from './types';
|
|
2
|
-
export declare const useSetting: <S extends "acceptedCountries" | "allowBankAccountFormatSelection" | "allowIntraRegionCrossBorderPayout" | "changeLegalEntityType" | "editPrefilledCountry" | "
|
|
2
|
+
export declare const useSetting: <S extends "acceptedCountries" | "allowBankAccountFormatSelection" | "allowIntraRegionCrossBorderPayout" | "changeLegalEntityType" | "editPrefilledCountry" | "requirePciSignEcommerce" | "requirePciSignPos" | "requirePciSignEcomMoto" | "requirePciSignPosMoto" | "hideOnboardingIntroductionIndividual" | "hideOnboardingIntroductionOrganization" | "hideOnboardingIntroductionTrust" | "hideOnboardingIntroductionSoleProprietor" | "transferInstrumentLimit" | "viewOnboardingGuidance">(settingName: S) => Settings[S];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ComponentOptions } from '../../components';
|
|
2
2
|
import { CoreOptions } from '../types';
|
|
3
3
|
export declare const validateCoreOptions: (coreOptions: CoreOptions) => void;
|
|
4
|
-
export declare const validateForComponent: <Name extends "payoutAccount" | "pci" | "
|
|
4
|
+
export declare const validateForComponent: <Name extends "payoutAccount" | "pci" | "individualDropin" | "companyDropin" | "companySearchDropin" | "taskList" | "trustDropin" | "soleProprietorDropin" | "createTransferInstrumentComponent" | "createIndividualComponent" | "viewVerificationStatusComponent">(componentName: Name, options: ComponentOptions<Name>) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OnboardingLinkConfig, OnboardingLinkResponse } from '../../models/api/
|
|
1
|
+
import { OnboardingLinkConfig, OnboardingLinkResponse } from '../../models/api/view-verification-status';
|
|
2
2
|
import { ComponentApiRequestContext } from '../types';
|
|
3
3
|
export declare const generateOnboardingLink: (context: ComponentApiRequestContext, config: OnboardingLinkConfig) => Promise<OnboardingLinkResponse>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OnboardingStatusResponse } from '../../models/api/
|
|
1
|
+
import { OnboardingStatusResponse } from '../../models/api/view-verification-status';
|
|
2
2
|
import { ComponentApiRequestContext } from '../types';
|
|
3
3
|
export declare const getOnboardingStatus: (context: ComponentApiRequestContext) => Promise<OnboardingStatusResponse>;
|
|
@@ -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" | "
|
|
11
|
+
create: <Name extends "payoutAccount" | "pci" | "individualDropin" | "companyDropin" | "companySearchDropin" | "taskList" | "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
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentMap } from '../../components';
|
|
2
|
+
import { EmbeddedEventItem, EventQueueItem, UserEventCallback } from '../user-events';
|
|
3
|
+
export type useAnalyticsProps = {
|
|
4
|
+
isEmbeddedDropin: boolean;
|
|
5
|
+
legalEntityId: string;
|
|
6
|
+
onUserEvent?: UserEventCallback;
|
|
7
|
+
sdkVersion: string;
|
|
8
|
+
componentName: keyof ComponentMap;
|
|
9
|
+
};
|
|
10
|
+
export declare const convertToEmbeddedEvent: (eventQueueItem: EventQueueItem) => EmbeddedEventItem;
|
|
11
|
+
export declare const useAnalytics: ({ onUserEvent, isEmbeddedDropin, legalEntityId, sdkVersion, componentName, }: useAnalyticsProps) => Promise<void>;
|
|
@@ -6,6 +6,8 @@ interface UseAssociatedLegalArrangementOptions {
|
|
|
6
6
|
}
|
|
7
7
|
interface UseAssociatedLegalArrangement {
|
|
8
8
|
associatedLegalArrangement: ExistingLegalEntity | undefined;
|
|
9
|
+
setAssociatedLegalArrangement: (le: ExistingLegalEntity) => void;
|
|
10
|
+
refreshAssociatedLegalArrangement: () => void;
|
|
9
11
|
}
|
|
10
12
|
export declare function useAssociatedLegalArrangement({ rootLegalEntity, getLegalEntity, }: UseAssociatedLegalArrangementOptions): UseAssociatedLegalArrangement;
|
|
11
13
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DropinAPIHandlers } from '../../components/Dropins/types';
|
|
2
|
+
import { EmbeddedAnalyticsSessionRequest, EmbeddedAnalyticsSessionResponse } from '../models/api/analytics';
|
|
2
3
|
import { BankVerificationErrorResponse, CreateTrustedTransferInstrumentResponse } from '../models/api/trusted-transferInstrument';
|
|
4
|
+
import { EmbeddedEventItem } from '../user-events';
|
|
3
5
|
export type ComponentApi = {
|
|
4
6
|
getLegalEntity: Required<DropinAPIHandlers>['handleGetLegalEntity'];
|
|
5
7
|
updateLegalEntity: Required<DropinAPIHandlers>['handleUpdateLegalEntity'];
|
|
@@ -19,6 +21,8 @@ export type ComponentApi = {
|
|
|
19
21
|
handleBankVerificationError: (errorCode: string, errorMessage: string, state: string, metadata?: Map<string, string>) => Promise<BankVerificationErrorResponse>;
|
|
20
22
|
getOnboardingStatus: Required<DropinAPIHandlers>['handleGetOnboardingStatus'];
|
|
21
23
|
generateOnboardingLink: Required<DropinAPIHandlers>['handleGenerateOnboardingLink'];
|
|
24
|
+
getAnalyticsSession(data: EmbeddedAnalyticsSessionRequest): Promise<EmbeddedAnalyticsSessionResponse>;
|
|
25
|
+
pushEvents(sessionId: string, event: EmbeddedEventItem): Promise<void>;
|
|
22
26
|
};
|
|
23
27
|
export declare const COMPONENTS_API_VERSION = "v1";
|
|
24
28
|
/**
|
package/dist/types/core/models/api/{onboarding-redirect.d.ts → view-verification-status.d.ts}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TranslationKey } from '../../../language/types';
|
|
2
2
|
export declare enum OnboardingStatus {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
AWAITING_DATA = "AWAITING_DATA",
|
|
4
|
+
IN_REVIEW = "IN_REVIEW",
|
|
5
|
+
UNSUCCESSFUL = "UNSUCCESSFUL",
|
|
6
|
+
REJECTED = "REJECTED",
|
|
7
|
+
VERIFIED = "VERIFIED"
|
|
7
8
|
}
|
|
8
9
|
export interface OnboardingRedirectContent {
|
|
9
|
-
header: TranslationKey;
|
|
10
10
|
description: TranslationKey[];
|
|
11
|
-
ctaButton
|
|
11
|
+
ctaButton?: TranslationKey;
|
|
12
12
|
}
|
|
13
13
|
export interface OnboardingStatusResponse {
|
|
14
14
|
status: OnboardingStatus;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export interface UserEvent {
|
|
2
|
-
/** How many times has the event occurred */
|
|
3
|
-
count?: number;
|
|
4
|
-
/** Duration of the event */
|
|
5
|
-
dur?: number;
|
|
6
|
-
/** Sum to report with the event */
|
|
7
|
-
sum?: number;
|
|
8
2
|
/** Object with segments should be a flat object (arbitrary key/value pairs for event data) */
|
|
9
3
|
segmentation?: {
|
|
10
4
|
[key: string]: string | number | boolean | any[] | null;
|
|
@@ -13,9 +7,14 @@ export interface UserEvent {
|
|
|
13
7
|
type UserEventWithKey = UserEvent & {
|
|
14
8
|
key: string;
|
|
15
9
|
};
|
|
16
|
-
type EventType = 'track_pageview' | 'add_event' | 'start_event' | 'end_event';
|
|
17
|
-
type EventQueueItem = [EventType, string | UserEventWithKey];
|
|
10
|
+
export type EventType = 'track_pageview' | 'add_event' | 'start_event' | 'end_event';
|
|
11
|
+
export type EventQueueItem = [EventType, string | UserEventWithKey];
|
|
18
12
|
export type UserEventCallback = (eventQueueItem: EventQueueItem) => void;
|
|
13
|
+
export type EmbeddedEventItem = {
|
|
14
|
+
eventType: EventType;
|
|
15
|
+
eventName: string;
|
|
16
|
+
eventData?: UserEvent;
|
|
17
|
+
};
|
|
19
18
|
declare class UserEvents {
|
|
20
19
|
private readonly queue;
|
|
21
20
|
private readonly subscriptions;
|
|
@@ -10,6 +10,11 @@ export interface InputToken {
|
|
|
10
10
|
optional?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export type MaskToken = NonInputToken | InputToken;
|
|
13
|
+
export interface PossibleShift {
|
|
14
|
+
fromIndex: number;
|
|
15
|
+
shiftDistance: number;
|
|
16
|
+
}
|
|
13
17
|
export interface Mask {
|
|
14
18
|
tokens: MaskToken[];
|
|
19
|
+
possibleShifts: PossibleShift[];
|
|
15
20
|
}
|
|
@@ -12,6 +12,9 @@ export interface MismatchResult {
|
|
|
12
12
|
partialDisplayValue: string;
|
|
13
13
|
}
|
|
14
14
|
export type MaskResult = CorrectResult | MismatchResult;
|
|
15
|
+
export type MatchedToken = MaskToken & {
|
|
16
|
+
char: string;
|
|
17
|
+
};
|
|
15
18
|
/**
|
|
16
19
|
* Takes some pure value e.g. `NL123456` and a {@link Mask}, and returns a `partialCorrect`,
|
|
17
20
|
* `correct` or `mismatch` {@link MaskResult} accordingly.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaskToken, PossibleShift } from './maskTypes';
|
|
2
|
+
import type { MatchedToken } from './matchAgainstMask';
|
|
3
|
+
export declare const shiftRight: (possibleShifts: PossibleShift[], matchedTokens: MatchedToken[], remainingTokens: MaskToken[]) => {
|
|
4
|
+
matchedTokens: MatchedToken[];
|
|
5
|
+
remainingTokens: MaskToken[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Returns all possible shifts of optional inputs, sorted by best to worst
|
|
9
|
+
* @param mask
|
|
10
|
+
*/
|
|
11
|
+
export declare const findPossibleShifts: (mask: MaskToken[]) => PossibleShift[];
|
|
12
|
+
export declare const tryShift: (matchedTokens: MatchedToken[], remainingTokens: MaskToken[], fromIndex: number, shiftDistance: number) => {
|
|
13
|
+
matchedTokens: MatchedToken[];
|
|
14
|
+
remainingTokens: MaskToken[];
|
|
15
|
+
} | "notPossible";
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DropinAPIHandlers } from '../../components/Dropins/types';
|
|
2
|
-
import { ExistingLegalEntity } from '../models/api/legal-entity';
|
|
3
|
-
interface UseTrustArgs {
|
|
4
|
-
rootLegalEntity: ExistingLegalEntity;
|
|
5
|
-
handleGetLegalEntity: NonNullable<DropinAPIHandlers['handleGetLegalEntity']>;
|
|
6
|
-
}
|
|
7
|
-
export declare const useTrust: ({ rootLegalEntity, handleGetLegalEntity, }: UseTrustArgs) => [
|
|
8
|
-
ExistingLegalEntity | undefined,
|
|
9
|
-
() => Promise<ExistingLegalEntity | undefined>
|
|
10
|
-
];
|
|
11
|
-
export {};
|