@adyen/kyc-components 3.10.0 → 3.10.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 +58 -45
- package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/types.d.ts +2 -0
- package/dist/types/components/PayoutDetails/types.d.ts +1 -1
- package/dist/types/core/hooks/useAnalytics.d.ts +1 -2
- package/dist/types/core/hooks/useComponentApi.d.ts +2 -6
- package/package.json +1 -1
|
@@ -30049,7 +30049,7 @@ function PayoutDetailsDropinComponent({
|
|
|
30049
30049
|
hideNavigation,
|
|
30050
30050
|
refreshLegalEntity,
|
|
30051
30051
|
navigateBackToTaskList,
|
|
30052
|
-
|
|
30052
|
+
handleCreateTrustedTransferInstrument,
|
|
30053
30053
|
handleBankVerificationError: handleBankVerificationError2,
|
|
30054
30054
|
handleBackClick: externalBackClick
|
|
30055
30055
|
}) {
|
|
@@ -30349,8 +30349,8 @@ function PayoutDetailsDropinComponent({
|
|
|
30349
30349
|
}
|
|
30350
30350
|
return summaryData;
|
|
30351
30351
|
};
|
|
30352
|
-
const createTrustedTransferInstrumentHandler =
|
|
30353
|
-
const trustedTransferInstrument = await
|
|
30352
|
+
const createTrustedTransferInstrumentHandler = handleCreateTrustedTransferInstrument ? async (code2, state2) => {
|
|
30353
|
+
const trustedTransferInstrument = await handleCreateTrustedTransferInstrument(code2, state2);
|
|
30354
30354
|
setTrustedTransferInstrumentId(trustedTransferInstrument.verificationReference);
|
|
30355
30355
|
return trustedTransferInstrument;
|
|
30356
30356
|
} : void 0;
|
|
@@ -33097,7 +33097,8 @@ function DropinComposerComponent({
|
|
|
33097
33097
|
handleUpdateDocument: args.handleUpdateDocument,
|
|
33098
33098
|
handleCreateDocument: args.handleCreateDocument,
|
|
33099
33099
|
handleGetDocument: args.handleGetDocument,
|
|
33100
|
-
handleGetBankVerificationVendors: args.handleGetBankVerificationVendors
|
|
33100
|
+
handleGetBankVerificationVendors: args.handleGetBankVerificationVendors,
|
|
33101
|
+
handleCreateTrustedTransferInstrument: args.handleCreateTrustedTransferInstrument
|
|
33101
33102
|
});
|
|
33102
33103
|
case TaskTypes.TRUST:
|
|
33103
33104
|
return jsx(TrustDropinComponent, {
|
|
@@ -33551,16 +33552,6 @@ const getAddress = async (context, addressId) => {
|
|
|
33551
33552
|
}
|
|
33552
33553
|
});
|
|
33553
33554
|
};
|
|
33554
|
-
const getAnalyticsSession = async (loadingContext, data) => httpPost({
|
|
33555
|
-
loadingContext,
|
|
33556
|
-
errorLevel: "warn",
|
|
33557
|
-
errorMessage: `Failed to get analytics sessionId`,
|
|
33558
|
-
path: `analytics/ui`,
|
|
33559
|
-
authentication: "jwt",
|
|
33560
|
-
headers: {
|
|
33561
|
-
"Content-Type": "application/json"
|
|
33562
|
-
}
|
|
33563
|
-
}, data);
|
|
33564
33555
|
const getIdverificationToken = async (context, request) => {
|
|
33565
33556
|
const {
|
|
33566
33557
|
loadingContext,
|
|
@@ -33727,16 +33718,6 @@ const idVerificationStartcheck = async (context, request) => {
|
|
|
33727
33718
|
}
|
|
33728
33719
|
}, request);
|
|
33729
33720
|
};
|
|
33730
|
-
const pushEvents = async (loadingContext, sessionId, event) => httpPost({
|
|
33731
|
-
loadingContext,
|
|
33732
|
-
errorLevel: "warn",
|
|
33733
|
-
errorMessage: `Failed to push events`,
|
|
33734
|
-
path: `analytics/ui/${sessionId}`,
|
|
33735
|
-
authentication: "jwt",
|
|
33736
|
-
headers: {
|
|
33737
|
-
"Content-Type": "application/json"
|
|
33738
|
-
}
|
|
33739
|
-
}, event);
|
|
33740
33721
|
const searchAddress = async (context, address2) => {
|
|
33741
33722
|
const {
|
|
33742
33723
|
loadingContext,
|
|
@@ -33815,8 +33796,6 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
33815
33796
|
getTransferInstruments: async () => getTransferInstruments(baseRequestContext),
|
|
33816
33797
|
getOnboardingStatus: async () => getOnboardingStatus(baseRequestContext),
|
|
33817
33798
|
generateOnboardingLink: async (config) => generateOnboardingLink(baseRequestContext, config),
|
|
33818
|
-
getAnalyticsSession: async (data) => getAnalyticsSession(loadingContext, data),
|
|
33819
|
-
pushEvents: async (sessionId, event) => pushEvents(loadingContext, sessionId, event),
|
|
33820
33799
|
getPciStatus: async (legalEntityId, data) => getPciStatus({
|
|
33821
33800
|
...baseRequestContext,
|
|
33822
33801
|
legalEntityId
|
|
@@ -34338,6 +34317,11 @@ function OnboardingDropinComponent({
|
|
|
34338
34317
|
getAddress: getAddress2,
|
|
34339
34318
|
getIdVerificationToken,
|
|
34340
34319
|
idVerificationStartCheck,
|
|
34320
|
+
getTransferInstrument: getTransferInstrument2,
|
|
34321
|
+
createTransferInstrument: createTransferInstrument2,
|
|
34322
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
34323
|
+
updateTransferInstrument: updateTransferInstrument2,
|
|
34324
|
+
deleteTransferInstrument: deleteTransferInstrument2,
|
|
34341
34325
|
getPciStatus: getPciStatus2,
|
|
34342
34326
|
getPciTemplate: getPciTemplate2,
|
|
34343
34327
|
signPci: signPci2,
|
|
@@ -34386,7 +34370,12 @@ function OnboardingDropinComponent({
|
|
|
34386
34370
|
handleGetServiceAgreementAcceptanceInfos: getServiceAgreementAcceptanceInfos,
|
|
34387
34371
|
handleGetServiceAgreementStatus: getServiceAgreementStatus2,
|
|
34388
34372
|
handleGetServiceAgreement: getServiceAgreement2,
|
|
34389
|
-
handleSignServiceAgreement: acceptServiceAgreement2
|
|
34373
|
+
handleSignServiceAgreement: acceptServiceAgreement2,
|
|
34374
|
+
handleCreateTransferInstrument: createTransferInstrument2,
|
|
34375
|
+
handleGetTransferInstrument: getTransferInstrument2,
|
|
34376
|
+
handleDeleteTransferInstrument: deleteTransferInstrument2,
|
|
34377
|
+
handleUpdateTransferInstrument: updateTransferInstrument2,
|
|
34378
|
+
handleCreateTrustedTransferInstrument: createTrustedTransferInstrument2
|
|
34390
34379
|
});
|
|
34391
34380
|
}
|
|
34392
34381
|
var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
|
|
@@ -34630,6 +34619,26 @@ const AuthProvider = ({
|
|
|
34630
34619
|
children
|
|
34631
34620
|
});
|
|
34632
34621
|
};
|
|
34622
|
+
const getAnalyticsSession = async (loadingContext, data) => httpPost({
|
|
34623
|
+
loadingContext,
|
|
34624
|
+
errorLevel: "warn",
|
|
34625
|
+
errorMessage: `Failed to get analytics sessionId`,
|
|
34626
|
+
path: `analytics/ui`,
|
|
34627
|
+
authentication: "jwt",
|
|
34628
|
+
headers: {
|
|
34629
|
+
"Content-Type": "application/json"
|
|
34630
|
+
}
|
|
34631
|
+
}, data);
|
|
34632
|
+
const pushEvents = async (loadingContext, sessionId, event) => httpPost({
|
|
34633
|
+
loadingContext,
|
|
34634
|
+
errorLevel: "warn",
|
|
34635
|
+
errorMessage: `Failed to push events`,
|
|
34636
|
+
path: `analytics/ui/${sessionId}`,
|
|
34637
|
+
authentication: "jwt",
|
|
34638
|
+
headers: {
|
|
34639
|
+
"Content-Type": "application/json"
|
|
34640
|
+
}
|
|
34641
|
+
}, event);
|
|
34633
34642
|
const convertToEmbeddedEvent = (eventQueueItem) => {
|
|
34634
34643
|
const [eventType, event] = eventQueueItem;
|
|
34635
34644
|
const hasEventData = typeof event === "object";
|
|
@@ -34644,28 +34653,33 @@ const convertToEmbeddedEvent = (eventQueueItem) => {
|
|
|
34644
34653
|
};
|
|
34645
34654
|
const useAnalytics = async ({
|
|
34646
34655
|
onUserEvent,
|
|
34647
|
-
isEmbeddedDropin,
|
|
34648
34656
|
legalEntityId,
|
|
34649
34657
|
sdkVersion,
|
|
34650
34658
|
componentName
|
|
34651
34659
|
}) => {
|
|
34652
34660
|
const {
|
|
34653
|
-
|
|
34654
|
-
|
|
34655
|
-
} =
|
|
34661
|
+
isEmbeddedDropin,
|
|
34662
|
+
loadingContext: base
|
|
34663
|
+
} = useAuthContext();
|
|
34664
|
+
const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
|
|
34656
34665
|
if (isEmbeddedDropin) {
|
|
34657
|
-
|
|
34658
|
-
|
|
34659
|
-
|
|
34660
|
-
|
|
34661
|
-
|
|
34662
|
-
|
|
34663
|
-
|
|
34664
|
-
|
|
34665
|
-
|
|
34666
|
-
|
|
34667
|
-
|
|
34668
|
-
|
|
34666
|
+
try {
|
|
34667
|
+
const sessionResponse = await getAnalyticsSession(loadingContext, {
|
|
34668
|
+
sdkVersion,
|
|
34669
|
+
componentName,
|
|
34670
|
+
userAgent: navigator.userAgent,
|
|
34671
|
+
legalEntityId
|
|
34672
|
+
});
|
|
34673
|
+
if (!(sessionResponse == null ? void 0 : sessionResponse.id)) {
|
|
34674
|
+
throw Error("Analytics session Id not received");
|
|
34675
|
+
}
|
|
34676
|
+
userEvents.subscribe((data) => {
|
|
34677
|
+
const eventItem = convertToEmbeddedEvent(data);
|
|
34678
|
+
pushEvents(loadingContext, sessionResponse.id, eventItem);
|
|
34679
|
+
});
|
|
34680
|
+
} catch (e) {
|
|
34681
|
+
console.error("Failed to initiate analytics for component", e);
|
|
34682
|
+
}
|
|
34669
34683
|
} else if (onUserEvent) {
|
|
34670
34684
|
userEvents.subscribe(onUserEvent);
|
|
34671
34685
|
}
|
|
@@ -35010,10 +35024,9 @@ const ConfigurationApiProvider = ({
|
|
|
35010
35024
|
isEmbeddedDropin,
|
|
35011
35025
|
loadingContext
|
|
35012
35026
|
} = authContext;
|
|
35013
|
-
const sdkVersion = "3.10.
|
|
35027
|
+
const sdkVersion = "3.10.1";
|
|
35014
35028
|
useAnalytics({
|
|
35015
35029
|
onUserEvent,
|
|
35016
|
-
isEmbeddedDropin,
|
|
35017
35030
|
legalEntityId: rootLegalEntityId,
|
|
35018
35031
|
sdkVersion,
|
|
35019
35032
|
componentName
|
|
@@ -2,4 +2,4 @@ import { LegalEntity } from '../../../../core/models/api/legal-entity';
|
|
|
2
2
|
import { CountryCode } from '../../../../core/models/country-code';
|
|
3
3
|
import { PayoutDetailsDropinProps } from '../../../PayoutDetails/types';
|
|
4
4
|
export declare const getRegistrationCountry: (legalEntityResponse: LegalEntity) => CountryCode;
|
|
5
|
-
export declare function PayoutDetailsDropinComponent({ transferInstrument, setTransferInstrument, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleUpdateTransferInstrument, handleCreateTransferInstrument, handleGetBankVerificationVendors, legalEntityResponse, associatedLegalArrangement, trackingConfig, accountHolder, problems: propProblems, onSubmit: externalOnSubmit, onChange, taskType: propTaskType, taskName, eventEmitter, capabilities, handleHomeClick, homeButtonLabel, hideNavigation, refreshLegalEntity, navigateBackToTaskList,
|
|
5
|
+
export declare function PayoutDetailsDropinComponent({ transferInstrument, setTransferInstrument, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleUpdateTransferInstrument, handleCreateTransferInstrument, handleGetBankVerificationVendors, legalEntityResponse, associatedLegalArrangement, trackingConfig, accountHolder, problems: propProblems, onSubmit: externalOnSubmit, onChange, taskType: propTaskType, taskName, eventEmitter, capabilities, handleHomeClick, homeButtonLabel, hideNavigation, refreshLegalEntity, navigateBackToTaskList, handleCreateTrustedTransferInstrument, handleBankVerificationError, handleBackClick: externalBackClick, }: PayoutDetailsDropinProps): import("preact").JSX.Element;
|
|
@@ -8,6 +8,7 @@ import type { InstantIdVerificationStartCheckRequest, InstantIdVerificationStart
|
|
|
8
8
|
import { ExistingLegalEntity, LegalEntity, PatchLegalEntity } from '../../core/models/api/legal-entity';
|
|
9
9
|
import { ReviewCompletion } from '../../core/models/api/review';
|
|
10
10
|
import { ExistingTransferInstrument, TransferInstrument } from '../../core/models/api/transfer-instrument';
|
|
11
|
+
import { CreateTrustedTransferInstrumentResponse } from '../../core/models/api/trusted-transferInstrument';
|
|
11
12
|
import { OnboardingLinkConfig, OnboardingLinkResponse, OnboardingStatusResponse } from '../../core/models/api/view-verification-status';
|
|
12
13
|
import { CountryCode } from '../../core/models/country-code';
|
|
13
14
|
import { BaseTrackingPayload } from '../../core/utils';
|
|
@@ -56,6 +57,7 @@ export interface DropinAPIHandlers {
|
|
|
56
57
|
handleVerifyTin?(data: TinVerificationRequest): Promise<TinVerificationResponse>;
|
|
57
58
|
handleGetOnboardingStatus?(): Promise<OnboardingStatusResponse>;
|
|
58
59
|
handleGenerateOnboardingLink?(config: OnboardingLinkConfig): Promise<OnboardingLinkResponse>;
|
|
60
|
+
handleCreateTrustedTransferInstrument?(code: string, state: string): Promise<CreateTrustedTransferInstrumentResponse>;
|
|
59
61
|
}
|
|
60
62
|
export interface DropinProps {
|
|
61
63
|
legalEntityResponse?: ExistingLegalEntity;
|
|
@@ -40,7 +40,7 @@ export interface PayoutDetailsProps extends BaseOuterFormProps<PayoutDetailsSche
|
|
|
40
40
|
handleBankVerificationError?: (errorCode: string, errorMessage: string, state: string, metadata?: Map<string, string>) => Promise<BankVerificationErrorResponse>;
|
|
41
41
|
country: CountryCode;
|
|
42
42
|
}
|
|
43
|
-
export type PayoutDropinApiHandlers = Required<Pick<DropinAPIHandlers, 'handleCreateDocument' | 'handleGetDocument' | 'handleUpdateDocument' | 'handleUpdateTransferInstrument' | 'handleCreateTransferInstrument'
|
|
43
|
+
export type PayoutDropinApiHandlers = Required<Pick<DropinAPIHandlers, 'handleCreateDocument' | 'handleGetDocument' | 'handleUpdateDocument' | 'handleUpdateTransferInstrument' | 'handleCreateTransferInstrument'>> & Pick<DropinAPIHandlers, 'handleCreateTrustedTransferInstrument'>;
|
|
44
44
|
export interface PayoutDetailsDropinProps extends Omit<PayoutDetailsProps, 'country' | 'accountHolder'>, Omit<DropinProps, 'legalEntityResponse'>, PayoutDropinApiHandlers {
|
|
45
45
|
accountHolder?: string;
|
|
46
46
|
transferInstrument?: ExistingTransferInstrument;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ComponentMap } from '../../components';
|
|
2
2
|
import { EmbeddedEventItem, EventQueueItem, UserEventCallback } from '../user-events';
|
|
3
3
|
export type useAnalyticsProps = {
|
|
4
|
-
isEmbeddedDropin: boolean;
|
|
5
4
|
legalEntityId: string;
|
|
6
5
|
onUserEvent?: UserEventCallback;
|
|
7
6
|
sdkVersion: string;
|
|
8
7
|
componentName: keyof ComponentMap;
|
|
9
8
|
};
|
|
10
9
|
export declare const convertToEmbeddedEvent: (eventQueueItem: EventQueueItem) => EmbeddedEventItem;
|
|
11
|
-
export declare const useAnalytics: ({ onUserEvent,
|
|
10
|
+
export declare const useAnalytics: ({ onUserEvent, legalEntityId, sdkVersion, componentName, }: useAnalyticsProps) => Promise<void>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DropinAPIHandlers } from '../../components/Dropins/types';
|
|
2
|
-
import { EmbeddedAnalyticsSessionRequest, EmbeddedAnalyticsSessionResponse } from '../models/api/analytics';
|
|
3
2
|
import { TransferInstrumentReference } from '../models/api/transfer-instrument-reference';
|
|
4
|
-
import { BankVerificationErrorResponse
|
|
5
|
-
import { EmbeddedEventItem } from '../user-events';
|
|
3
|
+
import { BankVerificationErrorResponse } from '../models/api/trusted-transferInstrument';
|
|
6
4
|
export type ComponentApi = {
|
|
7
5
|
getLegalEntity: Required<DropinAPIHandlers>['handleGetLegalEntity'];
|
|
8
6
|
updateLegalEntity: Required<DropinAPIHandlers>['handleUpdateLegalEntity'];
|
|
@@ -19,13 +17,11 @@ export type ComponentApi = {
|
|
|
19
17
|
idVerificationStartCheck: Required<DropinAPIHandlers>['handleGetIdVerificationStartCheck'];
|
|
20
18
|
getAddress: Required<DropinAPIHandlers>['handleFindAddress'];
|
|
21
19
|
searchAddress: Required<DropinAPIHandlers>['handleAddressSearch'];
|
|
22
|
-
createTrustedTransferInstrument
|
|
20
|
+
createTrustedTransferInstrument: Required<DropinAPIHandlers>['handleCreateTrustedTransferInstrument'];
|
|
23
21
|
handleBankVerificationError(errorCode: string, errorMessage: string, state: string, metadata?: Map<string, string>): Promise<BankVerificationErrorResponse>;
|
|
24
22
|
getTransferInstruments(): Promise<TransferInstrumentReference[]>;
|
|
25
23
|
getOnboardingStatus: Required<DropinAPIHandlers>['handleGetOnboardingStatus'];
|
|
26
24
|
generateOnboardingLink: Required<DropinAPIHandlers>['handleGenerateOnboardingLink'];
|
|
27
|
-
getAnalyticsSession(data: EmbeddedAnalyticsSessionRequest): Promise<EmbeddedAnalyticsSessionResponse>;
|
|
28
|
-
pushEvents(sessionId: string, event: EmbeddedEventItem): Promise<void>;
|
|
29
25
|
getPciStatus: Required<DropinAPIHandlers>['handleGetPciStatus'];
|
|
30
26
|
getPciTemplate: Required<DropinAPIHandlers>['handleGetPciTemplate'];
|
|
31
27
|
getPciQuestionnaires: Required<DropinAPIHandlers>['handleGetPciQuestionnaires'];
|