@adyen/kyc-components 2.7.0 → 2.8.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 (70) hide show
  1. package/dist/es/adyen-kyc-components.es.js +25730 -25030
  2. package/dist/style.css +122464 -14819
  3. package/dist/types/components/BankVerification/types.d.ts +5 -0
  4. package/dist/types/components/BankVerification/verification/widget/component/BankVerificationWidget.d.ts +4 -1
  5. package/dist/types/components/Company/component/CompanyComponent.d.ts +1 -1
  6. package/dist/types/components/Company/types.d.ts +13 -13
  7. package/dist/types/components/CompanyDetails/types.d.ts +1 -0
  8. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  9. package/dist/types/components/Dropins/FormComposer/components/StepProgressIndicator/StepProgressIndicator.d.ts +7 -0
  10. package/dist/types/components/Dropins/PayoutDetailsDropin/components/PayoutDetailsDropinComponent.d.ts +1 -1
  11. package/dist/types/components/Dropins/SolePropDropin/components/SolePropDropinComponent.d.ts +1 -1
  12. package/dist/types/components/Dropins/types.d.ts +6 -6
  13. package/dist/types/components/PayoutDetails/types.d.ts +3 -0
  14. package/dist/types/components/RegistrationAddress/component/RegistrationAddressComponent.d.ts +2 -3
  15. package/dist/types/components/RegistrationAddress/index.d.ts +1 -0
  16. package/dist/types/components/TaskIntros/TaskIntro.d.ts +8 -0
  17. package/dist/types/components/TaskIntros/TaskIntros.d.ts +10 -0
  18. package/dist/types/components/TaskIntros/copy.d.ts +14 -0
  19. package/dist/types/components/TaskIntros/types.d.ts +8 -0
  20. package/dist/types/components/TaskList/types.d.ts +4 -3
  21. package/dist/types/components/UIElement.d.ts +2 -1
  22. package/dist/types/components/UenOrGst/types.d.ts +9 -0
  23. package/dist/types/components/internal/Address/utils.d.ts +1 -1
  24. package/dist/types/components/internal/Button/Button.d.ts +1 -1
  25. package/dist/types/components/internal/Icon/Icon.d.ts +1 -1
  26. package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +6 -0
  27. package/dist/types/core/Context/CoreContext.d.ts +0 -4
  28. package/dist/types/core/Context/CoreProvider.d.ts +1 -4
  29. package/dist/types/core/Context/I18nProvider/I18nContext.d.ts +7 -0
  30. package/dist/types/core/Context/I18nProvider/I18nProvider.d.ts +8 -0
  31. package/dist/types/core/Context/SettingsContext/types.d.ts +12 -1
  32. package/dist/types/core/Services/componentApi/create-trusted-transferInstrument.d.ts +3 -0
  33. package/dist/types/core/Services/componentApi/handle-bank-verification-error.d.ts +3 -0
  34. package/dist/types/core/Services/http.d.ts +1 -1
  35. package/dist/types/core/Services/kycExternalApi/company-deep-search.d.ts +5 -0
  36. package/dist/types/core/Services/kycExternalApi/company-index-search.d.ts +5 -0
  37. package/dist/types/core/Services/kycExternalApi/get-company-data.d.ts +5 -0
  38. package/dist/types/core/Services/kycExternalApi/index.d.ts +5 -0
  39. package/dist/types/core/Services/kycExternalApi/refresh-company-data.d.ts +5 -0
  40. package/dist/types/core/Services/kycExternalApi/verify-tin.d.ts +5 -0
  41. package/dist/types/core/Services/types.d.ts +1 -1
  42. package/dist/types/core/hooks/useAllowedLocales.d.ts +1 -0
  43. package/dist/types/core/hooks/useComponentApi.d.ts +3 -0
  44. package/dist/types/core/hooks/useLocalStorage.d.ts +11 -0
  45. package/dist/types/core/hooks/useSalesChannelsSettings.d.ts +1 -0
  46. package/dist/types/core/hooks/useShouldShowGuidanceIntros.d.ts +7 -0
  47. package/dist/types/core/hooks/useTranslations.d.ts +10 -0
  48. package/dist/types/core/models/api/company-search.d.ts +80 -0
  49. package/dist/types/core/models/api/contracts.d.ts +5 -1
  50. package/dist/types/core/models/api/legal-arrangement.d.ts +2 -1
  51. package/dist/types/core/models/api/organization.d.ts +4 -2
  52. package/dist/types/core/models/api/trusted-transferInstrument.d.ts +8 -0
  53. package/dist/types/core/models/currency.d.ts +1 -0
  54. package/dist/types/core/models/errors/capability-problems.d.ts +2 -2
  55. package/dist/types/core/models/errors/entity-problems.d.ts +1 -1
  56. package/dist/types/core/models/state-code.d.ts +54 -0
  57. package/dist/types/language/Language.d.ts +11 -29
  58. package/dist/types/language/config.d.ts +34 -0
  59. package/dist/types/language/types.d.ts +2 -2
  60. package/dist/types/language/utils.d.ts +9 -22
  61. package/dist/types/openbankingsdk/OpenBankingSDK.d.ts +14 -0
  62. package/dist/types/openbankingsdk/types.d.ts +22 -0
  63. package/dist/types/utils/company-util.d.ts +2 -1
  64. package/dist/types/utils/decision-maker-roles.d.ts +1 -1
  65. package/dist/types/utils/entity-status-util.d.ts +2 -2
  66. package/dist/types/utils/mapping/componentApiMapping.d.ts +18 -17
  67. package/dist/types/utils/toCapitalized.d.ts +1 -0
  68. package/dist/types/utils/toPascalCase.d.ts +1 -0
  69. package/dist/types/utils/trust-util.d.ts +1 -1
  70. package/package.json +33 -32
@@ -1,4 +1,4 @@
1
- import { HttpOptions } from './types';
1
+ import type { HttpOptions } from './types';
2
2
  export declare const http: <T>(options: HttpOptions, data?: any, responseType?: XMLHttpRequestResponseType) => Promise<T>;
3
3
  export declare const httpGet: <T>(options: HttpOptions, data?: any) => Promise<T>;
4
4
  export declare const httpPost: <T>(options: HttpOptions, data?: any) => Promise<T>;
@@ -0,0 +1,5 @@
1
+ import type { CompanyDeepSearchRequest, CompanyDeepSearchResponse } from '../../models/api/company-search';
2
+ export declare const companyDeepSearch: (context: {
3
+ loadingContext: string;
4
+ clientKey: string;
5
+ }, data: CompanyDeepSearchRequest) => Promise<CompanyDeepSearchResponse>;
@@ -0,0 +1,5 @@
1
+ import type { CompanyIndexSearchRequest, CompanyIndexSearchResponse } from '../../models/api/company-search';
2
+ export declare const companyIndexSearch: (context: {
3
+ loadingContext: string;
4
+ clientKey: string;
5
+ }, data: CompanyIndexSearchRequest) => Promise<CompanyIndexSearchResponse>;
@@ -0,0 +1,5 @@
1
+ import type { CompanyDataResponse, GetCompanyDataRequest } from '../../models/api/company-search';
2
+ export declare const getCompanyData: (context: {
3
+ loadingContext: string;
4
+ clientKey: string;
5
+ }, data: GetCompanyDataRequest) => Promise<CompanyDataResponse>;
@@ -1,7 +1,12 @@
1
+ export * from './company-deep-search';
2
+ export * from './company-index-search';
1
3
  export * from './get-account-format';
2
4
  export * from './get-allowed-countries';
3
5
  export * from './get-allowed-locales';
6
+ export * from './get-company-data';
4
7
  export * from './get-configuration';
5
8
  export * from './get-dataset';
9
+ export * from './refresh-company-data';
6
10
  export * from './validate-phone-number';
7
11
  export * from './verify-id-number';
12
+ export * from './verify-tin';
@@ -0,0 +1,5 @@
1
+ import type { CompanyDataResponse, RefreshCompanyDataRequest } from '../../models/api/company-search';
2
+ export declare const refreshCompanyData: (context: {
3
+ loadingContext: string;
4
+ clientKey: string;
5
+ }, data: RefreshCompanyDataRequest) => Promise<CompanyDataResponse>;
@@ -0,0 +1,5 @@
1
+ import type { TinVerificationRequest, TinVerificationResponse } from '../../models/api/company-search';
2
+ export declare const verifyTin: (context: {
3
+ loadingContext: string;
4
+ clientKey: string;
5
+ }, data: TinVerificationRequest) => Promise<TinVerificationResponse>;
@@ -1,4 +1,4 @@
1
- import { NonEmbeddedAuthContextType } from '../Context/AuthContext/AuthContext';
1
+ import type { NonEmbeddedAuthContextType } from '../Context/AuthContext/AuthContext';
2
2
  export type FetchErrorLevel = 'silent' | 'info' | 'warn' | 'error' | 'fatal';
3
3
  export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH';
4
4
  export type RequestContext = Partial<NonEmbeddedAuthContextType> & Required<Pick<NonEmbeddedAuthContextType, 'clientKey'>> & {
@@ -0,0 +1 @@
1
+ export declare const useAllowedLocales: () => string[] | undefined;
@@ -1,4 +1,5 @@
1
1
  import { DropinAPIHandlers } from '../../components/Dropins/types';
2
+ import { BankVerificationErrorResponse, CreateTrustedTransferInstrumentResponse } from '../models/api/trusted-transferInstrument';
2
3
  export type ComponentApi = {
3
4
  getLegalEntity: Required<DropinAPIHandlers>['handleGetLegalEntity'];
4
5
  getTransferInstrument: Required<DropinAPIHandlers>['handleGetTransferInstrument'];
@@ -8,6 +9,8 @@ export type ComponentApi = {
8
9
  updateDocument: Required<DropinAPIHandlers>['handleUpdateDocument'];
9
10
  createTransferInstrument: Required<DropinAPIHandlers>['handleCreateTransferInstrument'];
10
11
  updateTransferInstrument: Required<DropinAPIHandlers>['handleUpdateTransferInstrument'];
12
+ createTrustedTransferInstrument: (code: string, state: string) => Promise<CreateTrustedTransferInstrumentResponse>;
13
+ handleBankVerificationError: (errorCode: string, errorMessage: string, state: string, metadata?: Map<string, string>) => Promise<BankVerificationErrorResponse>;
11
14
  };
12
15
  export declare const COMPONENTS_API_VERSION = "v1";
13
16
  /**
@@ -0,0 +1,11 @@
1
+ import { StateUpdater } from 'preact/hooks';
2
+ type Serializer<T> = (object: T | undefined) => string;
3
+ type Parser<T> = (val: string) => T | undefined;
4
+ type Setter<T> = StateUpdater<T | undefined>;
5
+ type Options<T> = Partial<{
6
+ serializer: Serializer<T>;
7
+ parser: Parser<T>;
8
+ syncData: boolean;
9
+ }>;
10
+ export declare function useLocalStorage<T>(key: string, defaultValue: T, options?: Options<T>): [T, Setter<T>];
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useSalesChannelsSettings(): string[];
@@ -0,0 +1,7 @@
1
+ import { ExistingLegalEntity } from '../models/api/legal-entity';
2
+ export declare const useHasSeenIntro: (legalEntityId: string) => {
3
+ hasSeenIntro: boolean;
4
+ setHasSeenIntro: (value: boolean | ((prevState: boolean) => boolean)) => void;
5
+ };
6
+ export declare const guidanceAvailableForGivenLE: (legalEntity: ExistingLegalEntity) => boolean;
7
+ export declare const useShouldShowGuidanceIntros: (legalEntity: ExistingLegalEntity) => boolean;
@@ -0,0 +1,10 @@
1
+ import { Translations } from '../../language/types';
2
+ interface LoadedTranslationsState {
3
+ translations: Translations;
4
+ locale: string;
5
+ }
6
+ export declare const useTranslations: ({ locale, allowedLocales, }: {
7
+ locale: string;
8
+ allowedLocales: string[] | undefined;
9
+ }) => LoadedTranslationsState;
10
+ export {};
@@ -0,0 +1,80 @@
1
+ import type { CountryCode } from '../country-code';
2
+ import type { StateCodeUS } from '../state-code';
3
+ export interface CompanySearchRequest {
4
+ /**
5
+ * @description A free-form value representing a partial company name
6
+ */
7
+ text: string;
8
+ /**
9
+ * @description Country code to limit the search within - two character format
10
+ */
11
+ country: CountryCode;
12
+ /**
13
+ * @description State code if the country is US (currently only enabled for US) - two character format
14
+ */
15
+ state: StateCodeUS;
16
+ /**
17
+ * @description (optional) Limit number of results
18
+ */
19
+ limit?: number;
20
+ }
21
+ /**
22
+ * @description Index search for company ID within kompany datastore using their current company data cache
23
+ */
24
+ export type CompanyIndexSearchRequest = CompanySearchRequest;
25
+ /**
26
+ * @description Deep search for company ID requesting new data from the external datastore (e.g. Secretary of State) that kompany uses to fetch results
27
+ */
28
+ export type CompanyDeepSearchRequest = CompanySearchRequest;
29
+ export interface CompanySearchResult {
30
+ id: string;
31
+ name: string;
32
+ registrationNumber: string;
33
+ requestTime: string;
34
+ lastUpdate: string;
35
+ }
36
+ export type CompanyIndexSearchResponse = {
37
+ results: Array<CompanySearchResult>;
38
+ };
39
+ export type CompanyDeepSearchResponse = {
40
+ results: Array<CompanySearchResult>;
41
+ };
42
+ export interface TinVerificationRequest {
43
+ /**
44
+ * @description Nine letter Tax Identification Number with or without hyphens
45
+ */
46
+ tin: string;
47
+ /**
48
+ * @description Company name
49
+ */
50
+ name: string;
51
+ }
52
+ export interface TinVerificationResponse {
53
+ matched: boolean;
54
+ }
55
+ export interface CompanyDataRequest {
56
+ /**
57
+ * @description Company Id returned from index search
58
+ */
59
+ companyId: string;
60
+ /**
61
+ * @description (optional) Country code
62
+ */
63
+ country?: CountryCode;
64
+ }
65
+ export type GetCompanyDataRequest = CompanyDataRequest;
66
+ export type RefreshCompanyDataRequest = CompanyDataRequest;
67
+ export interface CompanyDataResponse {
68
+ id: string;
69
+ name: string;
70
+ country: CountryCode;
71
+ registrationNumber: string;
72
+ organizationType: string;
73
+ address: string;
74
+ requestTime: string;
75
+ lastUpdate: string;
76
+ street?: string;
77
+ city?: string;
78
+ state?: StateCodeUS;
79
+ zipcode?: string;
80
+ }
@@ -1,6 +1,10 @@
1
- import { ServiceAgreementAcceptanceInfo, ServiceAgreementType } from '../../../components/Dropins/ServiceAgreementDropinComponent/types';
1
+ import type { ServiceAgreementAcceptanceInfo, ServiceAgreementType } from '../../../components/Dropins/ServiceAgreementDropinComponent/types';
2
2
  export interface PciTemplateRequest {
3
3
  language: string;
4
+ additionalSalesChannels?: string[];
5
+ }
6
+ export interface PciStatusRequest {
7
+ additionalSalesChannels?: string[];
4
8
  }
5
9
  export interface PciTemplateResponse extends PciTemplateRequest {
6
10
  pciTemplateReferences: PciTemplateReferences;
@@ -1,5 +1,5 @@
1
1
  import { Address } from './address';
2
- import { TaxInformation, VatAbsenceReason } from './organization';
2
+ import { TaxInformation, TaxInformationType, VatAbsenceReason } from './organization';
3
3
  export interface LegalArrangement {
4
4
  name: string;
5
5
  countryOfGoverningLaw: string;
@@ -11,5 +11,6 @@ export interface LegalArrangement {
11
11
  vatAbsenceReason?: VatAbsenceReason;
12
12
  registrationNumber?: string;
13
13
  principalPlaceOfBusiness?: Address;
14
+ uenOrGst?: TaxInformationType;
14
15
  }
15
16
  export type LegalArrangementType = 'trust' | 'soleProprietorship';
@@ -1,3 +1,4 @@
1
+ import { CountryCode } from '../country-code';
1
2
  import { Address } from './address';
2
3
  import { CompanyTypesValue } from './company-types-value';
3
4
  import { Phone } from './phone';
@@ -19,12 +20,13 @@ export interface Organization {
19
20
  vatNumber?: string;
20
21
  vatAbsenceReason?: VatAbsenceReason;
21
22
  type?: CompanyTypesValue;
23
+ uenOrGst?: TaxInformationType;
22
24
  }
23
25
  export declare const vatAbsenceReasons: readonly ["industryExemption", "belowTaxThreshold"];
24
26
  export type VatAbsenceReason = (typeof vatAbsenceReasons)[number];
25
27
  export type TaxInformation = {
26
- country: string;
28
+ country: CountryCode;
27
29
  number: string;
28
30
  type: TaxInformationType;
29
31
  };
30
- export type TaxInformationType = 'SSN' | 'EIN' | 'ITIN' | 'ABN' | 'UEN';
32
+ export type TaxInformationType = 'SSN' | 'EIN' | 'ITIN' | 'ABN' | 'UEN' | 'GST';
@@ -0,0 +1,8 @@
1
+ import { AccountVerificationResponse } from '../../../components/BankVerification/types';
2
+ export type CreateTrustedTransferInstrumentResponse = {
3
+ accounts: AccountVerificationResponse[];
4
+ };
5
+ export type BankVerificationErrorResponse = {
6
+ error: string;
7
+ message: string;
8
+ };
@@ -8,6 +8,7 @@ export declare enum Currency {
8
8
  DKK = "DKK",
9
9
  EUR = "EUR",
10
10
  GBP = "GBP",
11
+ HKD = "HKD",
11
12
  HUF = "HUF",
12
13
  HRK = "HRK",
13
14
  PLN = "PLN",
@@ -1,5 +1,5 @@
1
- import { EntityType } from '../api/entity-type';
2
- import { EntityProblems } from './entity-problems';
1
+ import type { EntityType } from '../api/entity-type';
2
+ import type { EntityProblems } from './entity-problems';
3
3
  export type CapabilityProblems = {
4
4
  [entityType in EntityType]: {
5
5
  [entityId: string]: EntityProblems;
@@ -1,4 +1,4 @@
1
- import { TaskStatus } from '../../../components/TaskList/types';
1
+ import type { TaskStatus } from '../../../components/TaskList/types';
2
2
  import { EntityType } from '../api/entity-type';
3
3
  import { LegalEntityType } from '../api/legal-entity-type';
4
4
  import { VerificationError } from '../api/verification-error';
@@ -0,0 +1,54 @@
1
+ export declare const enum StateCodesUS {
2
+ Alabama = "AL",
3
+ Alaska = "AK",
4
+ Arizona = "AZ",
5
+ Arkansas = "AR",
6
+ California = "CA",
7
+ Colorado = "CO",
8
+ Connecticut = "CT",
9
+ Delaware = "DE",
10
+ DistrictOfColumbia = "DC",
11
+ Florida = "FL",
12
+ Georgia = "GA",
13
+ Hawaii = "HI",
14
+ Idaho = "ID",
15
+ Illinois = "IL",
16
+ Indiana = "IN",
17
+ Iowa = "IA",
18
+ Kansas = "KS",
19
+ Kentucky = "KY",
20
+ Louisiana = "LA",
21
+ Maine = "ME",
22
+ Maryland = "MD",
23
+ Massachusetts = "MA",
24
+ Michigan = "MI",
25
+ Minnesota = "MN",
26
+ Mississippi = "MS",
27
+ Missouri = "MO",
28
+ Montana = "MT",
29
+ Nebraska = "NE",
30
+ Nevada = "NV",
31
+ NewHampshire = "NH",
32
+ NewJersey = "NJ",
33
+ NewMexico = "NM",
34
+ NewYork = "NY",
35
+ NorthCarolina = "NC",
36
+ NorthDakota = "ND",
37
+ Ohio = "OH",
38
+ Oklahoma = "OK",
39
+ Oregon = "OR",
40
+ Pennsylvania = "PA",
41
+ RhodeIsland = "RI",
42
+ SouthCarolina = "SC",
43
+ SouthDakota = "SD",
44
+ Tennessee = "TN",
45
+ Texas = "TX",
46
+ Utah = "UT",
47
+ Vermont = "VT",
48
+ Virginia = "VA",
49
+ Washington = "WA",
50
+ WestVirginia = "WV",
51
+ Wisconsin = "WI",
52
+ Wyoming = "WY"
53
+ }
54
+ export type StateCodeUS = `${StateCodesUS}`;
@@ -1,11 +1,17 @@
1
1
  import { CustomTranslations, TranslationKey, Translations } from './types';
2
2
  import { GetTranslationOptions } from './utils';
3
3
  declare class Language {
4
- private supportedLocales;
5
- customTranslations: CustomTranslations;
6
- languageCode: string;
7
- locale: string;
8
- translations: Translations;
4
+ private readonly supportedLocales;
5
+ readonly translations: Translations;
6
+ readonly customTranslations: CustomTranslations;
7
+ readonly languageCode: string;
8
+ readonly locale: string;
9
+ constructor({ locale, translations, customTranslations, allowedLocales, }: {
10
+ customTranslations?: CustomTranslations;
11
+ locale?: string;
12
+ translations?: Translations;
13
+ allowedLocales?: string[];
14
+ });
9
15
  /**
10
16
  * Returns a translated string from a key in the current {@link Language.locale}
11
17
  * @param key - Translation key
@@ -19,29 +25,5 @@ declare class Language {
19
25
  * @param options - Options for {@link Intl.DateTimeFormatOptions}
20
26
  */
21
27
  date(date: string, options?: Intl.DateTimeFormatOptions): string;
22
- /**
23
- * initialize the i18n language -- setting local, supported locales and translations
24
- * @param customTranslations - translation passed to the SDK to override some keys
25
- * @param locale - passed to the SDK locale or fallback
26
- * @param allowedLocales - allowed locales listed from the KYC external API that we can switch to
27
- *
28
- */
29
- initialize({ customTranslations, locale, allowedLocales, loadingContext, clientKey, }: {
30
- customTranslations?: {};
31
- locale?: string;
32
- allowedLocales?: string[];
33
- loadingContext: any;
34
- clientKey: any;
35
- }): Promise<void>;
36
- /**
37
- * Returns the translations according to the selected locale
38
- * @param locale - Currently selected locale
39
- * @returns Translations
40
- */
41
- loadTranslations({ locale, loadingContext, clientKey }: {
42
- locale?: string;
43
- loadingContext: any;
44
- clientKey: any;
45
- }): Promise<any>;
46
28
  }
47
29
  export default Language;
@@ -300,7 +300,9 @@ export declare const defaultTranslation: {
300
300
  provideAllDirectors: string;
301
301
  addDecisionMaker: string;
302
302
  decisionMakers: string;
303
+ goToIntro: string;
303
304
  goToOverview: string;
305
+ goToOverviewFromIntro: string;
304
306
  saveAndGoToOverview: string;
305
307
  pleaseEnsureTheFollowing: string;
306
308
  edit: string;
@@ -422,6 +424,8 @@ export declare const defaultTranslation: {
422
424
  numerodeIVA: string;
423
425
  NIF: string;
424
426
  uen: string;
427
+ gst: string;
428
+ number: string;
425
429
  nric: string;
426
430
  hkid: string;
427
431
  NIFdeIVA: string;
@@ -712,6 +716,7 @@ export declare const defaultTranslation: {
712
716
  businessRegistrationNumber__HK: string;
713
717
  doNotHaveBusinessNumber: string;
714
718
  "UEN/GST": string;
719
+ UEN: string;
715
720
  "IRD/GST": string;
716
721
  enterNameExactlyAsAppearInID: string;
717
722
  enterLastNameExactlyAsAppearInID: string;
@@ -1027,4 +1032,33 @@ export declare const defaultTranslation: {
1027
1032
  lastNameOfSettlor: string;
1028
1033
  enterSettlorsFirstNameExactlyAsItAppearsInID: string;
1029
1034
  enterSettlorsLastNameExactlyAsItAppearsInID: string;
1035
+ taskIntroPrologueTitle: string;
1036
+ taskIntroPrologueDescriptionP1: string;
1037
+ taskIntroPrologueDescriptionP2: string;
1038
+ taskIntroCompanyTitle: string;
1039
+ taskIntroCompanyDescriptionP1: string;
1040
+ taskIntroCompanyDescriptionP2: string;
1041
+ taskIntroDecisionMakerOverviewTitle: string;
1042
+ taskIntroDecisionMakerOverviewDescriptionP1: string;
1043
+ taskIntroDecisionMakerOverviewDescriptionP2: string;
1044
+ taskIntroDecisionMakerOverviewDescriptionP3: string;
1045
+ taskIntroDecisionMakerOverviewDescriptionLI1: string;
1046
+ taskIntroDecisionMakerOverviewDescriptionLI2: string;
1047
+ taskIntroDecisionMakerOverviewDescriptionLI3: string;
1048
+ taskIntroIndividualTitle: string;
1049
+ taskIntroIndividualDescriptionP1: string;
1050
+ taskIntroIndividualDescriptionP2: string;
1051
+ taskIntroIndividualDescriptionP3: string;
1052
+ taskIntroIndividualDescriptionLI1: string;
1053
+ taskIntroIndividualDescriptionLI2: string;
1054
+ taskIntroIndividualDescriptionLI3: string;
1055
+ taskIntroPayoutTitle: string;
1056
+ taskIntroPayoutOrganizationDescriptionP1: string;
1057
+ taskIntroPayoutOrganizationDescriptionP2: string;
1058
+ taskIntroPayoutIndividualDescriptionP1: string;
1059
+ taskIntroPayoutIndividualDescriptionP2: string;
1060
+ taskIntroEpilogueTitle: string;
1061
+ taskIntroEpilogueDescriptionP1: string;
1062
+ taskIntroEpilogueDescriptionP2: string;
1063
+ taskIntroEpilogueDescriptionP3: string;
1030
1064
  };
@@ -3,7 +3,7 @@ export type TranslationKey = keyof typeof translations;
3
3
  export type TranslationItem = string;
4
4
  export type Translations = Record<TranslationKey, TranslationItem>;
5
5
  export type CustomTranslations = {
6
- [key: string]: {
7
- [message: string]: string;
6
+ [locale: string]: {
7
+ [translationKey: string]: string;
8
8
  };
9
9
  };
@@ -1,54 +1,41 @@
1
1
  import { CountryCode } from '../core/models/country-code';
2
- import { CustomTranslations } from './types';
2
+ import { CustomTranslations, TranslationItem, TranslationKey, Translations } from './types';
3
3
  /**
4
4
  * Matches a string with one of the locales
5
- * @param locale -
6
- * @param supportedLocales -
7
5
 
8
6
  * @example
9
7
  * matchLocale('en-GB');
10
8
  * // 'en-US'
11
9
  */
12
- export declare function matchLocale(locale: string, supportedLocales: any): string;
10
+ export declare const matchLocale: (locale: string, supportedLocales: string[]) => string | null;
13
11
  /**
14
12
  * Returns a locale with the proper format
15
- * @param localeParam -
16
13
  *
17
14
  * @example
18
15
  * formatLocale('En_us');
19
16
  * // 'en-US'
20
17
  */
21
- export declare function formatLocale(localeParam: string): string;
18
+ export declare function formatLocale(localeParam: string): string | null;
22
19
  /**
23
20
  * Checks the locale format.
24
21
  * Also checks if it's on the locales array.
25
22
  * If it is not, tries to match it with one.
26
- * @param locale -
27
- * @param supportedLocales -
28
23
  */
29
- export declare function parseLocale(locale: string, supportedLocales?: string[]): string;
24
+ export declare function parseLocale(locale: string, supportedLocales?: string[]): string | null;
30
25
  /**
31
26
  * Formats the locales inside the customTranslations object against the supportedLocales
32
- * @param customTranslations -
33
- * @param supportedLocales -
34
27
  */
35
- export declare function formatCustomTranslations(supportedLocales: string[], customTranslations?: object): CustomTranslations;
36
- export declare const replaceTranslationValues: (translation: string, values: Record<string, string | number>) => string;
28
+ export declare const formatCustomTranslations: (supportedLocales: string[], customTranslations?: CustomTranslations) => CustomTranslations;
29
+ export declare const replaceTranslationValues: (translation: string, values?: Record<string, string | number>) => string;
37
30
  export interface GetTranslationOptions {
38
31
  localizeFor?: CountryCode;
39
32
  values?: Record<string, string | number>;
40
33
  }
41
34
  /**
42
- * Returns an array with all the locales
43
- * @param locale - The locale the user wants to use
44
- * @param customTranslations -
35
+ * Returns a translation string by key
45
36
  */
46
- export declare const getTranslations: ({ locale, loadingContext, clientKey, customTranslations, }: {
47
- locale: any;
48
- loadingContext: any;
49
- clientKey: any;
50
- customTranslations?: {};
51
- }) => Promise<any>;
37
+ export declare const getTranslationByKey: (translations: Translations, key: TranslationKey, options?: GetTranslationOptions) => TranslationItem | null;
38
+ export declare const getTranslationKeysByPrefix: (translations: Translations, keyPrefix: string) => TranslationKey[];
52
39
  /**
53
40
  * Returns a LanguageCode from locale
54
41
  * @param locale - The locale the user wants to use
@@ -0,0 +1,14 @@
1
+ import './OpenBankingSDKStyles.scss';
2
+ import { OpenBankingParameters } from './types';
3
+ export declare class OpenBankingSDK {
4
+ private readonly divElement;
5
+ private readonly link;
6
+ private readonly successHandler;
7
+ private readonly errorHandler;
8
+ private iframe?;
9
+ private listener?;
10
+ private constructor();
11
+ static create(parameters: OpenBankingParameters): OpenBankingSDK;
12
+ open(): void;
13
+ destroy(): void;
14
+ }
@@ -0,0 +1,22 @@
1
+ export type OpenBankingParameters = {
2
+ divElement: HTMLDivElement;
3
+ link: string;
4
+ successHandler: SuccessHandler;
5
+ errorHandler: ErrorHandler;
6
+ };
7
+ interface AccountVerificationReportMessage {
8
+ type: 'account_verification_report';
9
+ code: string;
10
+ state: string;
11
+ }
12
+ interface ErrorMessage {
13
+ type: 'error';
14
+ error_code: string;
15
+ error_message: string;
16
+ state: string;
17
+ metadata?: Map<string, string>;
18
+ }
19
+ export type OpenBankingMessage = AccountVerificationReportMessage | ErrorMessage;
20
+ export type SuccessHandler = (code: string, state: string) => void;
21
+ export type ErrorHandler = (errorCode: string, errorMessage: string, state: string, metadata?: Map<string, string>) => void;
22
+ export {};
@@ -1,8 +1,9 @@
1
1
  import { Organization } from '../core/models/api/organization';
2
2
  import { Trust } from '../core/models/api/trust';
3
+ import { CountryCode } from '../core/models/country-code';
3
4
  export declare const updateTaxInformation: <T extends Organization | import("../core/models/api/legal-arrangement").LegalArrangement | Trust>({ taxId, country, exemptedFromTax, entity, }: {
4
5
  taxId: string;
5
- country: string;
6
+ country: CountryCode;
6
7
  exemptedFromTax?: boolean;
7
8
  entity: T;
8
9
  }) => T;