@adyen/kyc-components 2.24.1 → 2.25.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 (24) hide show
  1. package/dist/es/adyen-kyc-components.es.js +146 -179
  2. package/dist/types/components/CompanyBasics/component/CompanyBasicsComponent.d.ts +1 -1
  3. package/dist/types/components/CompanyBasics/types.d.ts +8 -1
  4. package/dist/types/components/CompanyLookup/component/CompanyLookupComponent.d.ts +1 -1
  5. package/dist/types/components/CompanyLookup/types.d.ts +13 -7
  6. package/dist/types/components/CompanySearch/forms.d.ts +1 -1
  7. package/dist/types/components/CompanySearch/types.d.ts +7 -2
  8. package/dist/types/components/CompanyStructure/types.d.ts +0 -1
  9. package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +1 -1
  10. package/dist/types/components/Dropins/types.d.ts +6 -0
  11. package/dist/types/components/PayoutDetails/types.d.ts +3 -1
  12. package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +0 -6
  13. package/dist/types/core/Services/kycExternalApi/index.d.ts +0 -5
  14. package/dist/types/core/hooks/useCompanySearch/types.d.ts +11 -5
  15. package/dist/types/core/hooks/useCompanySearch/useCompanySearch.d.ts +2 -2
  16. package/dist/types/core/models/api/company-search.d.ts +4 -18
  17. package/dist/types/core/models/api/trusted-transferInstrument.d.ts +1 -0
  18. package/dist/types/utils/mapping/companySearch/mapCompanyDataResponseToFormSchema.d.ts +2 -2
  19. package/package.json +1 -1
  20. package/dist/types/core/Services/kycExternalApi/company-deep-search.d.ts +0 -3
  21. package/dist/types/core/Services/kycExternalApi/company-index-search.d.ts +0 -3
  22. package/dist/types/core/Services/kycExternalApi/get-company-data.d.ts +0 -3
  23. package/dist/types/core/Services/kycExternalApi/refresh-company-data.d.ts +0 -3
  24. package/dist/types/core/Services/kycExternalApi/verify-tin.d.ts +0 -3
@@ -5928,14 +5928,14 @@ const rules$3 = ({
5928
5928
  }
5929
5929
  },
5930
5930
  stockExchangeMICIfTypePublic: () => {
5931
- var _a;
5932
- if (((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
5931
+ var _a, _b;
5932
+ if (((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY || ((_b = data == null ? void 0 : data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
5933
5933
  return "REQUIRED";
5934
5934
  }
5935
5935
  },
5936
5936
  stockISINIfTypePublic: () => {
5937
- var _a;
5938
- if (((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
5937
+ var _a, _b;
5938
+ if (((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY || ((_b = data == null ? void 0 : data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
5939
5939
  return "REQUIRED";
5940
5940
  }
5941
5941
  },
@@ -5955,8 +5955,8 @@ const rules$3 = ({
5955
5955
  }
5956
5956
  },
5957
5957
  companyRegistrationNumberExemptionAllowed: () => {
5958
- var _a;
5959
- const companyType2 = (_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType;
5958
+ var _a, _b;
5959
+ const companyType2 = ((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) || ((_b = data == null ? void 0 : data.companyStructure) == null ? void 0 : _b.entityType);
5960
5960
  if (country2 === "DE" && (companyType2 === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION || companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE)) {
5961
5961
  return "REQUIRED";
5962
5962
  }
@@ -11056,15 +11056,13 @@ function useCompanySearch({
11056
11056
  taxIdentificationNumber: taxIdentificationNumber2,
11057
11057
  canVerify,
11058
11058
  limit = 15,
11059
- handleChangeFor
11059
+ handleChangeFor,
11060
+ handleCompanyIndexSearch,
11061
+ handleCompanyDeepSearch,
11062
+ handleGetCompanyDataset,
11063
+ handleRefreshCompanyDataset,
11064
+ handleVerifyTin
11060
11065
  }) {
11061
- const {
11062
- verifyTin: verifyTin2,
11063
- companyIndexSearch: companyIndexSearch2,
11064
- companyDeepSearch: companyDeepSearch2,
11065
- getCompanyData: getCompanyData2,
11066
- refreshCompanyData: refreshCompanyData2
11067
- } = useConfigurationApi();
11068
11066
  const [companiesList, setCompaniesList] = useState([]);
11069
11067
  const [selectedCompanyId, setSelectedCompanyId] = useState();
11070
11068
  const [verifiedCompany, setVerifiedCompany] = useState();
@@ -11083,6 +11081,8 @@ function useCompanySearch({
11083
11081
  deepSearch
11084
11082
  }) => {
11085
11083
  try {
11084
+ if (!indexSearch || !deepSearch)
11085
+ return;
11086
11086
  setStatus("loading");
11087
11087
  setCompaniesList([]);
11088
11088
  const {
@@ -11117,11 +11117,13 @@ function useCompanySearch({
11117
11117
  return setStatus("idle");
11118
11118
  }
11119
11119
  try {
11120
+ if (!handleCompanyIndexSearch || !handleCompanyDeepSearch)
11121
+ return;
11120
11122
  setStatus("loading");
11121
11123
  setSelectedCompanyId(void 0);
11122
11124
  const {
11123
11125
  results: indexSearchResults
11124
- } = await companyIndexSearch2({
11126
+ } = await handleCompanyIndexSearch({
11125
11127
  text: legalCompanyName2,
11126
11128
  country: country2,
11127
11129
  state: stateOrProvince2,
@@ -11130,7 +11132,7 @@ function useCompanySearch({
11130
11132
  if (!(indexSearchResults == null ? void 0 : indexSearchResults.length)) {
11131
11133
  const {
11132
11134
  results: deepSearchResults
11133
- } = await companyDeepSearch2({
11135
+ } = await handleCompanyDeepSearch({
11134
11136
  text: legalCompanyName2,
11135
11137
  country: country2,
11136
11138
  state: stateOrProvince2,
@@ -11145,9 +11147,11 @@ function useCompanySearch({
11145
11147
  } finally {
11146
11148
  setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
11147
11149
  }
11148
- }, [companyDeepSearch2, companyIndexSearch2, country2, legalCompanyName2, limit, stateOrProvince2]);
11150
+ }, [handleCompanyIndexSearch, handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
11149
11151
  const verify2 = useCallback(async (companyTIN, company2) => {
11150
11152
  try {
11153
+ if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
11154
+ return;
11151
11155
  setStatus("loading");
11152
11156
  setSelectedCompanyId(company2.id);
11153
11157
  if (!canVerify || !companyTIN) {
@@ -11155,7 +11159,7 @@ function useCompanySearch({
11155
11159
  }
11156
11160
  const {
11157
11161
  matched
11158
- } = await verifyTin2({
11162
+ } = await handleVerifyTin({
11159
11163
  tin: companyTIN,
11160
11164
  name: company2.name
11161
11165
  });
@@ -11168,10 +11172,10 @@ function useCompanySearch({
11168
11172
  status: 200
11169
11173
  }));
11170
11174
  }
11171
- const companyData = isLastUpdateDateCompliant(company2) ? await getCompanyData2({
11175
+ const companyData = isLastUpdateDateCompliant(company2) ? await handleGetCompanyDataset({
11172
11176
  companyId: company2.id,
11173
11177
  country: country2
11174
- }) : await refreshCompanyData2({
11178
+ }) : await handleRefreshCompanyDataset({
11175
11179
  companyId: company2.id,
11176
11180
  country: country2
11177
11181
  });
@@ -11186,7 +11190,7 @@ function useCompanySearch({
11186
11190
  } finally {
11187
11191
  setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
11188
11192
  }
11189
- }, [country2, stateOrProvince2, verifyTin2, canVerify, getCompanyData2, refreshCompanyData2]);
11193
+ }, [country2, stateOrProvince2, canVerify, handleVerifyTin, handleGetCompanyDataset, handleRefreshCompanyDataset]);
11190
11194
  const reset = useCallback(() => {
11191
11195
  setStatus("loading");
11192
11196
  setSelectedCompanyId(void 0);
@@ -11202,7 +11206,7 @@ function useCompanySearch({
11202
11206
  useEffect(() => {
11203
11207
  var _a;
11204
11208
  setError(void 0);
11205
- if (!legalCompanyName2 || !country2 || !stateOrProvince2) {
11209
+ if (!legalCompanyName2 || !country2 || !stateOrProvince2 || !taxIdentificationNumber2) {
11206
11210
  return setStatus("idle");
11207
11211
  }
11208
11212
  if (!verifiedCompany) {
@@ -11211,12 +11215,12 @@ function useCompanySearch({
11211
11215
  companyName: legalCompanyName2,
11212
11216
  companyCountry: country2,
11213
11217
  companyState: stateOrProvince2,
11214
- indexSearch: companyIndexSearch2,
11215
- deepSearch: companyDeepSearch2,
11218
+ indexSearch: handleCompanyIndexSearch,
11219
+ deepSearch: handleCompanyDeepSearch,
11216
11220
  resultsLimit: limit
11217
11221
  })) == null ? void 0 : _a.catch((e) => logger$l.error(e));
11218
11222
  }
11219
- }, [legalCompanyName2, country2, stateOrProvince2, verifiedCompany, searchCompanies, companyIndexSearch2, companyDeepSearch2, limit]);
11223
+ }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit]);
11220
11224
  useEffect(() => {
11221
11225
  setVerifiedCompany(void 0);
11222
11226
  setSelectedCompanyId(void 0);
@@ -11229,9 +11233,9 @@ function useCompanySearch({
11229
11233
  return {
11230
11234
  results: companiesList,
11231
11235
  selectedCompanyId,
11236
+ verifiedCompany,
11232
11237
  status,
11233
11238
  error,
11234
- verifiedCompany,
11235
11239
  retrySearch,
11236
11240
  verify: verify2,
11237
11241
  reset
@@ -11965,7 +11969,12 @@ function CompanyLookup({
11965
11969
  stateOrProvince: stateOrProvince2,
11966
11970
  taxInformationNumber: taxInformationNumber2,
11967
11971
  handleChangeFor,
11968
- setLoading
11972
+ setLoading,
11973
+ handleCompanyIndexSearch,
11974
+ handleCompanyDeepSearch,
11975
+ handleGetCompanyDataset,
11976
+ handleRefreshCompanyDataset,
11977
+ handleVerifyTin
11969
11978
  }) {
11970
11979
  var _a;
11971
11980
  const {
@@ -11987,7 +11996,12 @@ function CompanyLookup({
11987
11996
  stateOrProvince: stateOrProvince2,
11988
11997
  taxIdentificationNumber: taxInformationNumber2,
11989
11998
  canVerify,
11990
- handleChangeFor
11999
+ handleChangeFor,
12000
+ handleCompanyIndexSearch,
12001
+ handleCompanyDeepSearch,
12002
+ handleGetCompanyDataset,
12003
+ handleRefreshCompanyDataset,
12004
+ handleVerifyTin
11991
12005
  });
11992
12006
  const hasInternalError = ((_a = error == null ? void 0 : error.sourceError) == null ? void 0 : _a.errorType) === "internal";
11993
12007
  const displaySkeleton = status === "loading" && !selectedCompanyId;
@@ -12302,7 +12316,12 @@ function CompanyBasics({
12302
12316
  requiredFields,
12303
12317
  maskedFields,
12304
12318
  optionalFields,
12305
- readOnlyFields
12319
+ readOnlyFields,
12320
+ handleCompanyIndexSearch,
12321
+ handleCompanyDeepSearch,
12322
+ handleGetCompanyDataset,
12323
+ handleRefreshCompanyDataset,
12324
+ handleVerifyTin
12306
12325
  }) {
12307
12326
  var _a, _b;
12308
12327
  const {
@@ -12347,6 +12366,17 @@ function CompanyBasics({
12347
12366
  }, i18n);
12348
12367
  const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
12349
12368
  const currentCountryTaxIdNumber = (_b = (_a = formData.taxInformation) == null ? void 0 : _a.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _b.number;
12369
+ const {
12370
+ legalCompanyNameDisabled,
12371
+ countryDisabled,
12372
+ stateOrProvinceDisabled,
12373
+ taxInformationDisabled
12374
+ } = useMemo$1(() => ({
12375
+ legalCompanyNameDisabled: formUtils.isReadOnly("legalCompanyName") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12376
+ countryDisabled: !isAllowedEditPrefilledCountry || formUtils.isReadOnly("country") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12377
+ stateOrProvinceDisabled: formUtils.isReadOnly("stateOrProvince") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12378
+ taxInformationDisabled: formUtils.isReadOnly("taxInformation") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2
12379
+ }), [formData == null ? void 0 : formData.kompanyAddress, formUtils, isAllowedEditPrefilledCountry, loading2]);
12350
12380
  useEffect$1(() => {
12351
12381
  updateStateSlice({
12352
12382
  schema,
@@ -12377,7 +12407,7 @@ function CompanyBasics({
12377
12407
  helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
12378
12408
  legalCompanyName: "legalCompanyName__helperText"
12379
12409
  }),
12380
- readonly: formUtils.isReadOnly("legalCompanyName") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12410
+ readonly: legalCompanyNameDisabled,
12381
12411
  handleChangeFor
12382
12412
  })
12383
12413
  }), formUtils.isRequiredField("country") && jsx("div", {
@@ -12387,7 +12417,7 @@ function CompanyBasics({
12387
12417
  valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
12388
12418
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
12389
12419
  labels: formUtils.getFieldLabels(COUNTRY_FIELD),
12390
- readonly: !isAllowedEditPrefilledCountry || formUtils.isReadOnly("country") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12420
+ readonly: countryDisabled,
12391
12421
  handleChangeFor
12392
12422
  })
12393
12423
  }), formUtils.isRequiredField("stateOrProvince") && jsx("div", {
@@ -12397,7 +12427,7 @@ function CompanyBasics({
12397
12427
  valid: formUtils.getFieldValid(formValid, STATE_FIELD),
12398
12428
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STATE_FIELD),
12399
12429
  labels: formUtils.getFieldLabels(STATE_FIELD),
12400
- readonly: formUtils.isReadOnly("stateOrProvince") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12430
+ readonly: stateOrProvinceDisabled,
12401
12431
  handleChangeFor,
12402
12432
  selectedCountry: formData.country
12403
12433
  })
@@ -12408,7 +12438,7 @@ function CompanyBasics({
12408
12438
  valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
12409
12439
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
12410
12440
  labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD),
12411
- readonly: formUtils.isReadOnly("taxInformation") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12441
+ readonly: taxInformationDisabled,
12412
12442
  handleChangeFor,
12413
12443
  country: formData.country,
12414
12444
  canExempt: formUtils.isRequiredField("exemptedFromTax"),
@@ -12422,7 +12452,12 @@ function CompanyBasics({
12422
12452
  stateOrProvince: formData.stateOrProvince,
12423
12453
  taxInformationNumber: currentCountryTaxIdNumber,
12424
12454
  handleChangeFor,
12425
- setLoading
12455
+ setLoading,
12456
+ handleCompanyIndexSearch,
12457
+ handleCompanyDeepSearch,
12458
+ handleGetCompanyDataset,
12459
+ handleRefreshCompanyDataset,
12460
+ handleVerifyTin
12426
12461
  })]
12427
12462
  })]
12428
12463
  });
@@ -24778,7 +24813,12 @@ function CompanySearchComponent(props) {
24778
24813
  activeForm,
24779
24814
  problems,
24780
24815
  handleAddressSearch,
24781
- handleFindAddress
24816
+ handleFindAddress,
24817
+ handleCompanyIndexSearch,
24818
+ handleCompanyDeepSearch,
24819
+ handleGetCompanyDataset,
24820
+ handleRefreshCompanyDataset,
24821
+ handleVerifyTin
24782
24822
  } = props;
24783
24823
  const globalData = useGlobalData();
24784
24824
  const country2 = useMemo(() => {
@@ -24793,7 +24833,12 @@ function CompanySearchComponent(props) {
24793
24833
  children: jsx(CompanyBasicsComponent, {
24794
24834
  ...getFormProps(props, forms.companyBasics.formId),
24795
24835
  id: forms.companyBasics.formId,
24796
- heading: i18n.get(forms.companyBasics.formName)
24836
+ heading: i18n.get(forms.companyBasics.formName),
24837
+ handleCompanyIndexSearch,
24838
+ handleCompanyDeepSearch,
24839
+ handleGetCompanyDataset,
24840
+ handleRefreshCompanyDataset,
24841
+ handleVerifyTin
24797
24842
  })
24798
24843
  }), jsx("div", {
24799
24844
  className: formWrapperClasses(forms.companyRegistrationAddress.formId),
@@ -24911,7 +24956,12 @@ function CompanySearchDropinComponent({
24911
24956
  handleUpdateDocument,
24912
24957
  handleAddressSearch,
24913
24958
  handleFindAddress,
24914
- handleUpdateLegalEntity
24959
+ handleUpdateLegalEntity,
24960
+ handleCompanyIndexSearch,
24961
+ handleCompanyDeepSearch,
24962
+ handleGetCompanyDataset,
24963
+ handleRefreshCompanyDataset,
24964
+ handleVerifyTin
24915
24965
  }) {
24916
24966
  var _a, _b, _c, _d;
24917
24967
  const {
@@ -25071,7 +25121,12 @@ function CompanySearchDropinComponent({
25071
25121
  activeForm,
25072
25122
  shouldValidate,
25073
25123
  handleAddressSearch,
25074
- handleFindAddress
25124
+ handleFindAddress,
25125
+ handleCompanyIndexSearch,
25126
+ handleCompanyDeepSearch,
25127
+ handleGetCompanyDataset,
25128
+ handleRefreshCompanyDataset,
25129
+ handleVerifyTin
25075
25130
  })
25076
25131
  });
25077
25132
  }
@@ -28528,6 +28583,7 @@ function PayoutDetailsDropinComponent({
28528
28583
  const fallbackCurrency = (_a = currencyByCountry[defaultPayoutCountry]) == null ? void 0 : _a[0];
28529
28584
  const accountHolderName = accountHolder2 || getLegalEntityNameBasedOnType(legalEntityResponse);
28530
28585
  const instantVerificationEnabled = Boolean(!transferInstrument && handleGetBankVerificationVendors);
28586
+ const [trustedTransferInstrumentId, setTrustedTransferInstrumentId] = useState();
28531
28587
  const prefilledData = {
28532
28588
  payoutAccountDetails: {
28533
28589
  accountHolder: accountHolderName,
@@ -28720,7 +28776,10 @@ function PayoutDetailsDropinComponent({
28720
28776
  });
28721
28777
  setLoadingStatus("success");
28722
28778
  clearToasts();
28723
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
28779
+ externalOnSubmit == null ? void 0 : externalOnSubmit({
28780
+ ...dataSubmitted,
28781
+ id: transferInstrument2.id
28782
+ });
28724
28783
  } catch (e) {
28725
28784
  setLoadingStatus("success");
28726
28785
  showToast({
@@ -28807,7 +28866,13 @@ function PayoutDetailsDropinComponent({
28807
28866
  externalBackClick,
28808
28867
  onSubmit,
28809
28868
  skipSubmit,
28810
- onSkipSubmit: navigateBackToTaskList
28869
+ onSkipSubmit: () => {
28870
+ externalOnSubmit == null ? void 0 : externalOnSubmit({
28871
+ ...data,
28872
+ id: trustedTransferInstrumentId
28873
+ });
28874
+ navigateBackToTaskList == null ? void 0 : navigateBackToTaskList();
28875
+ }
28811
28876
  });
28812
28877
  return jsx(FormWrapper, {
28813
28878
  taskName: taskName ?? isExperimentEnabled("EnableNewEntryFlow") ? "bankAccountDetails" : "payoutDetails",
@@ -28861,7 +28926,11 @@ function PayoutDetailsDropinComponent({
28861
28926
  refreshLegalEntity,
28862
28927
  shouldValidate,
28863
28928
  bankVerificationVendors,
28864
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
28929
+ createTrustedTransferInstrument: async (code2, state2) => {
28930
+ const trustedTransferInstrument = await createTrustedTransferInstrument2(code2, state2);
28931
+ setTrustedTransferInstrumentId(trustedTransferInstrument.verificationReference);
28932
+ return trustedTransferInstrument;
28933
+ },
28865
28934
  handleBankVerificationError: handleBankVerificationError2
28866
28935
  })
28867
28936
  });
@@ -32300,7 +32369,12 @@ function DropinComposerComponent({
32300
32369
  handleAddressSearch: args.handleAddressSearch,
32301
32370
  handleFindAddress: args.handleFindAddress,
32302
32371
  handleHomeClick: navigateBack,
32303
- handleUpdateLegalEntity: args.handleUpdateLegalEntity
32372
+ handleUpdateLegalEntity: args.handleUpdateLegalEntity,
32373
+ handleCompanyIndexSearch: args.handleCompanyIndexSearch,
32374
+ handleCompanyDeepSearch: args.handleCompanyDeepSearch,
32375
+ handleGetCompanyDataset: args.handleGetCompanyDataset,
32376
+ handleRefreshCompanyDataset: args.handleRefreshCompanyDataset,
32377
+ handleVerifyTin: args.handleVerifyTin
32304
32378
  });
32305
32379
  case TaskTypes.TRUST_MEMBER_COMPANY:
32306
32380
  return jsx(CompanyDropinComponent, {
@@ -33136,64 +33210,9 @@ const getEmbeddedApi = ({
33136
33210
  getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
33137
33211
  getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
33138
33212
  validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1(baseRequestContext, phoneNumber2),
33139
- verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request),
33140
- companyIndexSearch: () => {
33141
- throw new Error("companyIndexSearch: Not implemented in onboarding component api");
33142
- },
33143
- companyDeepSearch: () => {
33144
- throw new Error("companyDeepSearch: Not implemented in onboarding component api");
33145
- },
33146
- getCompanyData: () => {
33147
- throw new Error("getCompanyData: Not implemented in onboarding component api");
33148
- },
33149
- refreshCompanyData: () => {
33150
- throw new Error("refreshCompanyData: Not implemented in onboarding component api");
33151
- },
33152
- verifyTin: () => {
33153
- throw new Error("verifyTin: Not implemented in onboarding component api");
33154
- }
33213
+ verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request)
33155
33214
  };
33156
33215
  };
33157
- const companyDeepSearch = async (context, data) => {
33158
- const {
33159
- loadingContext,
33160
- clientKey
33161
- } = context;
33162
- return httpPost({
33163
- loadingContext,
33164
- clientKey,
33165
- errorLevel: "warn",
33166
- errorMessage: "Failed to use companyDeepSearch",
33167
- errorHandler: async (response) => {
33168
- const error = await response;
33169
- throw new AdyenKycSdkError(error.message, error);
33170
- },
33171
- path: "v1/companyIndex/deepSearch",
33172
- headers: {
33173
- "Content-Type": "application/json"
33174
- }
33175
- }, data);
33176
- };
33177
- const companyIndexSearch = async (context, data) => {
33178
- const {
33179
- loadingContext,
33180
- clientKey
33181
- } = context;
33182
- return httpPost({
33183
- loadingContext,
33184
- clientKey,
33185
- errorLevel: "warn",
33186
- errorMessage: "Failed to use companyIndexSearch",
33187
- errorHandler: async (response) => {
33188
- const error = await response;
33189
- throw new AdyenKycSdkError(error.message, error);
33190
- },
33191
- path: "v1/companyIndex/indexSearch",
33192
- headers: {
33193
- "Content-Type": "application/json"
33194
- }
33195
- }, data);
33196
- };
33197
33216
  const getAllowedCountries = async (context) => {
33198
33217
  const {
33199
33218
  loadingContext,
@@ -33220,26 +33239,6 @@ const getAllowedLocales = async (context) => {
33220
33239
  clientKey
33221
33240
  });
33222
33241
  };
33223
- const getCompanyData = async (context, data) => {
33224
- const {
33225
- loadingContext,
33226
- clientKey
33227
- } = context;
33228
- return httpPost({
33229
- loadingContext,
33230
- clientKey,
33231
- errorLevel: "warn",
33232
- errorMessage: "Failed to use getCompanyData",
33233
- errorHandler: async (response) => {
33234
- const error = await response;
33235
- throw new AdyenKycSdkError(error.message, error);
33236
- },
33237
- path: "v1/companyData/fullDataset",
33238
- headers: {
33239
- "Content-Type": "application/json"
33240
- }
33241
- }, data);
33242
- };
33243
33242
  const getConfiguration = async (context, request) => {
33244
33243
  const {
33245
33244
  loadingContext,
@@ -33277,26 +33276,6 @@ const getDataset = async (context, name, locale) => {
33277
33276
  return datasetResponse;
33278
33277
  });
33279
33278
  };
33280
- const refreshCompanyData = async (context, data) => {
33281
- const {
33282
- loadingContext,
33283
- clientKey
33284
- } = context;
33285
- return httpPost({
33286
- loadingContext,
33287
- clientKey,
33288
- errorLevel: "warn",
33289
- errorMessage: "Failed to use refreshCompanyData",
33290
- errorHandler: async (response) => {
33291
- const error = await response;
33292
- throw new AdyenKycSdkError(error.message, error);
33293
- },
33294
- path: "v1/companyData/refreshDataset",
33295
- headers: {
33296
- "Content-Type": "application/json"
33297
- }
33298
- }, data);
33299
- };
33300
33279
  const validatePhoneNumber = async (context, phoneNumber2) => {
33301
33280
  const {
33302
33281
  loadingContext,
@@ -33348,26 +33327,6 @@ const verifyIdNumber = async (context, request) => {
33348
33327
  logger$3.warn("WARNING: idNumber verification failed - error:", e);
33349
33328
  }
33350
33329
  };
33351
- const verifyTin = async (context, data) => {
33352
- const {
33353
- loadingContext,
33354
- clientKey
33355
- } = context;
33356
- return httpPost({
33357
- loadingContext,
33358
- clientKey,
33359
- errorLevel: "warn",
33360
- errorMessage: "Failed to use verifyTin",
33361
- errorHandler: async (response) => {
33362
- const error = await response;
33363
- throw new AdyenKycSdkError(error.message, error);
33364
- },
33365
- path: "v1/tinVerification/verifyTin",
33366
- headers: {
33367
- "Content-Type": "application/json"
33368
- }
33369
- }, data);
33370
- };
33371
33330
  const getKycExternalApi = ({
33372
33331
  loadingContext,
33373
33332
  clientKey
@@ -33399,27 +33358,7 @@ const getKycExternalApi = ({
33399
33358
  loadingContext,
33400
33359
  clientKey
33401
33360
  }, phoneNumber2),
33402
- getImageUrl: () => `${loadingContext}static/images/`,
33403
- companyIndexSearch: async (request) => companyIndexSearch({
33404
- loadingContext,
33405
- clientKey
33406
- }, request),
33407
- companyDeepSearch: async (request) => companyDeepSearch({
33408
- loadingContext,
33409
- clientKey
33410
- }, request),
33411
- getCompanyData: async (request) => getCompanyData({
33412
- loadingContext,
33413
- clientKey
33414
- }, request),
33415
- refreshCompanyData: async (request) => refreshCompanyData({
33416
- loadingContext,
33417
- clientKey
33418
- }, request),
33419
- verifyTin: async (request) => verifyTin({
33420
- loadingContext,
33421
- clientKey
33422
- }, request)
33361
+ getImageUrl: () => `${loadingContext}static/images/`
33423
33362
  });
33424
33363
  const ConfigurationApiProvider = ({
33425
33364
  children,
@@ -33903,6 +33842,34 @@ const companySearchDropinSchema = {
33903
33842
  type: "function",
33904
33843
  required: true
33905
33844
  },
33845
+ handleAddressSearch: {
33846
+ type: "function",
33847
+ required: true
33848
+ },
33849
+ handleFindAddress: {
33850
+ type: "function",
33851
+ required: true
33852
+ },
33853
+ handleCompanyIndexSearch: {
33854
+ type: "function",
33855
+ required: true
33856
+ },
33857
+ handleCompanyDeepSearch: {
33858
+ type: "function",
33859
+ required: true
33860
+ },
33861
+ handleGetCompanyDataset: {
33862
+ type: "function",
33863
+ required: true
33864
+ },
33865
+ handleRefreshCompanyDataset: {
33866
+ type: "function",
33867
+ required: true
33868
+ },
33869
+ handleVerifyTin: {
33870
+ type: "function",
33871
+ required: true
33872
+ },
33906
33873
  onChange: {
33907
33874
  type: "function"
33908
33875
  },
@@ -3,6 +3,6 @@ import { CompanySearchSchema } from '../../CompanySearch/types';
3
3
  import { CompanyBasicsProps, CompanyBasicsSchema } from '../types';
4
4
  export declare const COMPANY_BASICS_FORM_ID: keyof CompanySearchSchema;
5
5
  export declare const companyBasicsFields: Array<keyof CompanyBasicsSchema>;
6
- declare function CompanyBasics({ data, labels, placeholders, helperText, heading, description, readOnly, shouldValidate, formVerificationErrors, fieldValidationErrors, requiredFields, maskedFields, optionalFields, readOnlyFields, }: CompanyBasicsProps): import("preact/compat").JSX.Element;
6
+ declare function CompanyBasics({ data, labels, placeholders, helperText, heading, description, readOnly, shouldValidate, formVerificationErrors, fieldValidationErrors, requiredFields, maskedFields, optionalFields, readOnlyFields, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, }: CompanyBasicsProps): import("preact/compat").JSX.Element;
7
7
  export declare const CompanyBasicsComponent: typeof CompanyBasics;
8
8
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { BaseInnerFormProps } from '../../core/hooks/useForm';
2
+ import type { DropinAPIHandlers } from '../Dropins/types';
2
3
  import type { CountryFieldSchema } from '../internal/CountryField/types';
3
4
  import type { LegalCompanyNameFieldSchema } from '../internal/LegalCompanyNameField/types';
4
5
  import type { StateFieldSchema } from '../internal/StateField/types';
@@ -6,4 +7,10 @@ import type { TaxInformationFieldSchema } from '../internal/TaxInformationField/
6
7
  export interface CompanyBasicsSchema extends LegalCompanyNameFieldSchema, CountryFieldSchema, StateFieldSchema, TaxInformationFieldSchema {
7
8
  kompanyAddress?: string;
8
9
  }
9
- export type CompanyBasicsProps = BaseInnerFormProps<CompanyBasicsSchema>;
10
+ export interface CompanyBasicsProps extends BaseInnerFormProps<CompanyBasicsSchema> {
11
+ handleCompanyIndexSearch: DropinAPIHandlers['handleCompanyIndexSearch'];
12
+ handleCompanyDeepSearch: DropinAPIHandlers['handleCompanyDeepSearch'];
13
+ handleGetCompanyDataset: DropinAPIHandlers['handleGetCompanyDataset'];
14
+ handleRefreshCompanyDataset: DropinAPIHandlers['handleRefreshCompanyDataset'];
15
+ handleVerifyTin: DropinAPIHandlers['handleVerifyTin'];
16
+ }
@@ -1,5 +1,5 @@
1
1
  import './CompanyLookupComponent.scss';
2
2
  import { CompanyLookupComponentProps } from '../types';
3
- declare function CompanyLookup({ defaultData, canVerify, legalCompanyName, country, stateOrProvince, taxInformationNumber, handleChangeFor, setLoading, }: CompanyLookupComponentProps): import("preact/compat").JSX.Element;
3
+ declare function CompanyLookup({ defaultData, canVerify, legalCompanyName, country, stateOrProvince, taxInformationNumber, handleChangeFor, setLoading, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, }: CompanyLookupComponentProps): import("preact/compat").JSX.Element;
4
4
  export declare const CompanyLookupComponent: typeof CompanyLookup;
5
5
  export {};
@@ -1,12 +1,13 @@
1
- import { StateUpdater } from 'preact/hooks';
2
- import { HookStatus } from '../../core/hooks/types';
3
- import { CompanyDataResponse, CompanySearchResult } from '../../core/models/api/company-search';
1
+ import type { StateUpdater } from 'preact/hooks';
2
+ import type { HookStatus } from '../../core/hooks/types';
3
+ import type { CompanyDatasetResponse, CompanySearchResult } from '../../core/models/api/company-search';
4
4
  import type { CountryCode } from '../../core/models/country-code';
5
5
  import type { ProvinceCode } from '../../core/models/province-code';
6
6
  import type { StateCode } from '../../core/models/state-code';
7
- import Language from '../../language';
7
+ import type Language from '../../language';
8
8
  import type { ValidatorMode } from '../../utils/validation/types';
9
9
  import type { CompanyBasicsSchema } from '../CompanyBasics/types';
10
+ import type { DropinAPIHandlers } from '../Dropins/types';
10
11
  export interface LookupResultBodyProps {
11
12
  registrationNumber: string;
12
13
  address: string | undefined;
@@ -25,7 +26,7 @@ export interface LookupResultProps {
25
26
  isVerified: boolean;
26
27
  isError: boolean;
27
28
  tin: string;
28
- verifiedCompany: CompanyDataResponse | undefined;
29
+ verifiedCompany: CompanyDatasetResponse | undefined;
29
30
  onSelect: (tin: string, company: CompanySearchResult) => Promise<void>;
30
31
  }
31
32
  export interface CompanyLookupResultsHeaderProps {
@@ -34,7 +35,7 @@ export interface CompanyLookupResultsHeaderProps {
34
35
  i18n: Language;
35
36
  hasInternalError: boolean;
36
37
  selectedCompanyId: string | undefined;
37
- verifiedCompany: CompanyDataResponse | undefined;
38
+ verifiedCompany: CompanyDatasetResponse | undefined;
38
39
  retrySearch: () => Promise<void>;
39
40
  reset: () => void;
40
41
  }
@@ -45,7 +46,7 @@ export interface CompanyLookupResultsListProps {
45
46
  i18n: Language;
46
47
  hasInternalError: boolean;
47
48
  tin: string | undefined;
48
- verifiedCompany: CompanyDataResponse | undefined;
49
+ verifiedCompany: CompanyDatasetResponse | undefined;
49
50
  verify: (tin: string, company: CompanySearchResult) => Promise<void>;
50
51
  }
51
52
  export interface CompanyLookupComponentProps {
@@ -57,4 +58,9 @@ export interface CompanyLookupComponentProps {
57
58
  taxInformationNumber?: string;
58
59
  handleChangeFor: (key: keyof CompanyBasicsSchema, mode?: ValidatorMode) => (e: any) => void;
59
60
  setLoading: StateUpdater<boolean>;
61
+ handleCompanyIndexSearch: DropinAPIHandlers['handleCompanyIndexSearch'];
62
+ handleCompanyDeepSearch: DropinAPIHandlers['handleCompanyDeepSearch'];
63
+ handleGetCompanyDataset: DropinAPIHandlers['handleGetCompanyDataset'];
64
+ handleRefreshCompanyDataset: DropinAPIHandlers['handleRefreshCompanyDataset'];
65
+ handleVerifyTin: DropinAPIHandlers['handleVerifyTin'];
60
66
  }
@@ -15,7 +15,7 @@ export declare const forms: {
15
15
  readonly formId: keyof CompanySearchSchema;
16
16
  readonly formName: "companyStructureFormName";
17
17
  readonly formDescription: "companyStructureFormDescription";
18
- readonly fields: (keyof import("../CompanyStructure/types").CompanyStructureSchema)[];
18
+ readonly fields: "entityType"[];
19
19
  };
20
20
  readonly companyOtherDetails: {
21
21
  readonly formId: keyof CompanySearchSchema;
@@ -16,7 +16,12 @@ export interface CompanySearchSchema {
16
16
  }
17
17
  export interface CompanySearchProps extends BaseOuterFormProps<CompanySearchSchema> {
18
18
  forms?: FormModel[];
19
+ handleAddressSearch: DropinAPIHandlers['handleAddressSearch'];
20
+ handleFindAddress: DropinAPIHandlers['handleFindAddress'];
21
+ handleCompanyIndexSearch: DropinAPIHandlers['handleCompanyIndexSearch'];
22
+ handleCompanyDeepSearch: DropinAPIHandlers['handleCompanyDeepSearch'];
23
+ handleGetCompanyDataset: DropinAPIHandlers['handleGetCompanyDataset'];
24
+ handleRefreshCompanyDataset: DropinAPIHandlers['handleRefreshCompanyDataset'];
25
+ handleVerifyTin: DropinAPIHandlers['handleVerifyTin'];
19
26
  onSubmit?: (company: CompanySearchSchema) => void;
20
- handleAddressSearch?: DropinAPIHandlers['handleAddressSearch'];
21
- handleFindAddress?: DropinAPIHandlers['handleFindAddress'];
22
27
  }
@@ -2,6 +2,5 @@ import type { BaseInnerFormProps } from '../../core/hooks/useForm';
2
2
  import type { CompanyTypesValue } from '../../core/models/api/company-types-value';
3
3
  export interface CompanyStructureSchema {
4
4
  entityType: CompanyTypesValue;
5
- accountHolder?: string;
6
5
  }
7
6
  export type CompanyStructureProps = BaseInnerFormProps<CompanyStructureSchema>;
@@ -1,2 +1,2 @@
1
1
  import { CompanySearchDropinProps } from '../types';
2
- export declare function CompanySearchDropinComponent({ legalEntityResponse, parentLegalEntity, trackingConfig, eventEmitter, taskType, taskName, hideDropinLayout, homeButtonLabel, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, }: CompanySearchDropinProps): import("preact").JSX.Element;
2
+ export declare function CompanySearchDropinComponent({ legalEntityResponse, parentLegalEntity, trackingConfig, eventEmitter, taskType, taskName, hideDropinLayout, homeButtonLabel, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, }: CompanySearchDropinProps): import("preact").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import type { State, TopLevelDataSchema } from '../../core/Context/StateContext/types';
2
2
  import type { Address, AddressSearchRequest, AddressSearchResponse } from '../../core/models/api/address-search';
3
+ import type { CompanyDatasetRequest, CompanyDatasetResponse, CompanySearchRequest, CompanySearchResponse, TinVerificationRequest, TinVerificationResponse } from '../../core/models/api/company-search';
3
4
  import type { DownloadPci, PciQuestionnaireIds, PciQuestionnaires, PciStatus, PciStatusRequest, PciTemplateRequest, PciTemplateResponse, ServiceAgreementAcceptanceInfos, ServiceAgreementRequest, ServiceAgreementResponse, ServiceAgreementSignRequest, ServiceAgreementSignResponse, ServiceAgreementStatus, SignedBy } from '../../core/models/api/contracts';
4
5
  import { Document, ExistingDocument } from '../../core/models/api/document';
5
6
  import { BankVerificationVendorsResponse } from '../../core/models/api/get-bankVerification-providers';
@@ -47,6 +48,11 @@ export interface DropinAPIHandlers {
47
48
  handleFindAddress?(addressId: string): Promise<Address>;
48
49
  handleGetIdVerificationToken?(legalEntityId: string, data: InstantIdVerificationTokenRequest): Promise<InstantIdVerificationTokenResponse>;
49
50
  handleGetIdVerificationStartCheck?(legalEntityId: string, data: InstantIdVerificationStartCheckRequest): Promise<InstantIdVerificationStartCheckResponse>;
51
+ handleCompanyIndexSearch?(data: CompanySearchRequest): Promise<CompanySearchResponse>;
52
+ handleCompanyDeepSearch?(data: CompanySearchRequest): Promise<CompanySearchResponse>;
53
+ handleGetCompanyDataset?(data: CompanyDatasetRequest): Promise<CompanyDatasetResponse>;
54
+ handleRefreshCompanyDataset?(data: CompanyDatasetRequest): Promise<CompanyDatasetResponse>;
55
+ handleVerifyTin?(data: TinVerificationRequest): Promise<TinVerificationResponse>;
50
56
  }
51
57
  export interface DropinProps {
52
58
  legalEntityResponse?: ExistingLegalEntity;
@@ -23,7 +23,9 @@ export interface PayoutDetailsProps extends BaseOuterFormProps<PayoutDetailsSche
23
23
  activeForm?: FormModel;
24
24
  forms?: FormModel[];
25
25
  problems?: any;
26
- onSubmit?: (data: PayoutDetailsSchema) => void;
26
+ onSubmit?: (data: PayoutDetailsSchema & {
27
+ id: string;
28
+ }) => void;
27
29
  legalEntityResponse: ExistingLegalEntity;
28
30
  taskType?: TaskTypes;
29
31
  handleGetBankVerificationVendors?: DropinAPIHandlers['handleGetBankVerificationVendors'];
@@ -1,4 +1,3 @@
1
- import { CompanyDataResponse, CompanyDeepSearchRequest, CompanyDeepSearchResponse, CompanyIndexSearchRequest, CompanyIndexSearchResponse, GetCompanyDataRequest, RefreshCompanyDataRequest, TinVerificationRequest, TinVerificationResponse } from '../../models/api/company-search';
2
1
  import { DataSet } from '../../models/api/data-set';
3
2
  import { GetPayoutAccountFormatResponse } from '../../models/api/get-account-format';
4
3
  import { GetAllowedCountriesResponse } from '../../models/api/get-allowed-countries';
@@ -18,10 +17,5 @@ export type ConfigurationApi = {
18
17
  verifyIdNumber: (request: VerifyIdNumberRequest) => Promise<VerifyIdNumberResponse | undefined>;
19
18
  validatePhoneNumber: (phoneNumber: string) => Promise<ValidationResponse>;
20
19
  getImageUrl: () => string;
21
- companyIndexSearch: (request: CompanyIndexSearchRequest) => Promise<CompanyIndexSearchResponse>;
22
- companyDeepSearch: (request: CompanyDeepSearchRequest) => Promise<CompanyDeepSearchResponse>;
23
- getCompanyData: (request: GetCompanyDataRequest) => Promise<CompanyDataResponse>;
24
- refreshCompanyData: (request: RefreshCompanyDataRequest) => Promise<CompanyDataResponse>;
25
- verifyTin: (request: TinVerificationRequest) => Promise<TinVerificationResponse>;
26
20
  };
27
21
  export declare const ConfigurationApiContext: import("preact").Context<ConfigurationApi>;
@@ -1,11 +1,6 @@
1
- export * from './company-deep-search';
2
- export * from './company-index-search';
3
1
  export * from './get-allowed-countries';
4
2
  export * from './get-allowed-locales';
5
- export * from './get-company-data';
6
3
  export * from './get-configuration';
7
4
  export * from './get-dataset';
8
- export * from './refresh-company-data';
9
5
  export * from './validate-phone-number';
10
6
  export * from './verify-id-number';
11
- export * from './verify-tin';
@@ -1,7 +1,8 @@
1
1
  import { CompanyBasicsSchema } from '../../../components/CompanyBasics/types';
2
+ import { DropinAPIHandlers } from '../../../components/Dropins/types';
2
3
  import { ValidatorMode } from '../../../utils/validation/types';
3
4
  import { AdyenKycSdkError } from '../../error';
4
- import { CompanyDataResponse, CompanyDeepSearchRequest, CompanyDeepSearchResponse, CompanyIndexSearchRequest, CompanyIndexSearchResponse, CompanySearchResult } from '../../models/api/company-search';
5
+ import { CompanyDatasetResponse, CompanySearchResult } from '../../models/api/company-search';
5
6
  import { CountryCode } from '../../models/country-code';
6
7
  import { ProvinceCode } from '../../models/province-code';
7
8
  import { StateCode, StateCodeUS } from '../../models/state-code';
@@ -11,13 +12,13 @@ export interface CompanySearchError extends Error {
11
12
  errorCode: string;
12
13
  errorType: string;
13
14
  }
14
- export interface SearchOptions {
15
+ export interface SearchCompaniesOptions {
15
16
  companyName: string;
16
17
  companyCountry: CountryCode;
17
18
  companyState: StateCodeUS;
18
19
  resultsLimit?: number;
19
- indexSearch: (request: CompanyIndexSearchRequest) => Promise<CompanyIndexSearchResponse>;
20
- deepSearch: (request: CompanyDeepSearchRequest) => Promise<CompanyDeepSearchResponse>;
20
+ indexSearch: DropinAPIHandlers['handleCompanyIndexSearch'];
21
+ deepSearch: DropinAPIHandlers['handleCompanyDeepSearch'];
21
22
  }
22
23
  export interface UseCompanySearchOptions {
23
24
  defaultData: CompanyBasicsSchema | undefined;
@@ -28,13 +29,18 @@ export interface UseCompanySearchOptions {
28
29
  canVerify: boolean;
29
30
  limit?: number;
30
31
  handleChangeFor: (key: keyof CompanyBasicsSchema, mode?: ValidatorMode) => (e: any) => void;
32
+ handleCompanyIndexSearch: DropinAPIHandlers['handleCompanyIndexSearch'];
33
+ handleCompanyDeepSearch: DropinAPIHandlers['handleCompanyDeepSearch'];
34
+ handleGetCompanyDataset: DropinAPIHandlers['handleGetCompanyDataset'];
35
+ handleRefreshCompanyDataset: DropinAPIHandlers['handleRefreshCompanyDataset'];
36
+ handleVerifyTin: DropinAPIHandlers['handleVerifyTin'];
31
37
  }
32
38
  export type UseCompanySearch = {
33
39
  results: readonly CompanySearchResult[];
34
40
  selectedCompanyId: string | undefined;
35
41
  status: HookStatus;
36
42
  error: AdyenKycSdkError | undefined;
37
- verifiedCompany: CompanyDataResponse | undefined;
43
+ verifiedCompany: CompanyDatasetResponse | undefined;
38
44
  retrySearch: () => Promise<void>;
39
45
  verify: (tin: string, company: CompanySearchResult) => Promise<void>;
40
46
  reset: () => void;
@@ -1,5 +1,5 @@
1
- import { UseCompanySearch, UseCompanySearchOptions } from './types';
1
+ import type { UseCompanySearch, UseCompanySearchOptions } from './types';
2
2
  export declare const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 157766400000;
3
3
  export declare const MED_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 94694400000;
4
4
  export declare const HIGH_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 31536000000;
5
- export declare function useCompanySearch({ defaultData, legalCompanyName, country, stateOrProvince, taxIdentificationNumber, canVerify, limit, handleChangeFor, }: UseCompanySearchOptions): UseCompanySearch;
5
+ export declare function useCompanySearch({ defaultData, legalCompanyName, country, stateOrProvince, taxIdentificationNumber, canVerify, limit, handleChangeFor, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, }: UseCompanySearchOptions): UseCompanySearch;
@@ -1,6 +1,6 @@
1
1
  import type { CountryCode } from '../country-code';
2
2
  import type { StateCodeUS } from '../state-code';
3
- interface CompanySearchRequest {
3
+ export interface CompanySearchRequest {
4
4
  /**
5
5
  * @description A free-form value representing a partial company name
6
6
  */
@@ -18,14 +18,6 @@ interface CompanySearchRequest {
18
18
  */
19
19
  limit?: number;
20
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
21
  export interface CompanySearchResult {
30
22
  id: string;
31
23
  name: string;
@@ -33,13 +25,10 @@ export interface CompanySearchResult {
33
25
  requestTime: string;
34
26
  lastUpdate?: string;
35
27
  }
36
- export type CompanyIndexSearchResponse = {
28
+ export type CompanySearchResponse = {
37
29
  results: Array<CompanySearchResult>;
38
30
  };
39
- export type CompanyDeepSearchResponse = {
40
- results: Array<CompanySearchResult>;
41
- };
42
- interface CompanyDataRequest {
31
+ export interface CompanyDatasetRequest {
43
32
  /**
44
33
  * @description Company Id returned from index search
45
34
  */
@@ -49,9 +38,7 @@ interface CompanyDataRequest {
49
38
  */
50
39
  country?: CountryCode;
51
40
  }
52
- export type GetCompanyDataRequest = CompanyDataRequest;
53
- export type RefreshCompanyDataRequest = CompanyDataRequest;
54
- export interface CompanyDataResponse extends CompanySearchResult {
41
+ export interface CompanyDatasetResponse extends CompanySearchResult {
55
42
  country: CountryCode;
56
43
  organizationType: string;
57
44
  address: string;
@@ -73,4 +60,3 @@ export interface TinVerificationRequest {
73
60
  export interface TinVerificationResponse {
74
61
  matched: boolean;
75
62
  }
76
- export {};
@@ -1,5 +1,6 @@
1
1
  import { AccountVerificationResponse } from '../../../components/BankVerification/types';
2
2
  export type CreateTrustedTransferInstrumentResponse = {
3
+ verificationReference: string;
3
4
  accounts: AccountVerificationResponse[];
4
5
  };
5
6
  export type BankVerificationErrorResponse = {
@@ -1,3 +1,3 @@
1
1
  import type { CompanySearchSchema } from '../../../components/CompanySearch/types';
2
- import type { CompanyDataResponse } from '../../../core/models/api/company-search';
3
- export declare const mapCompanyDataResponseToFormSchema: (company: CompanyDataResponse) => CompanySearchSchema;
2
+ import type { CompanyDatasetResponse } from '../../../core/models/api/company-search';
3
+ export declare const mapCompanyDataResponseToFormSchema: (company: CompanyDatasetResponse) => CompanySearchSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.24.1",
3
+ "version": "2.25.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1,3 +0,0 @@
1
- import type { CompanyDeepSearchRequest, CompanyDeepSearchResponse } from '../../models/api/company-search';
2
- import type { RequestContext } from '../types';
3
- export declare const companyDeepSearch: (context: RequestContext, data: CompanyDeepSearchRequest) => Promise<CompanyDeepSearchResponse>;
@@ -1,3 +0,0 @@
1
- import type { CompanyIndexSearchRequest, CompanyIndexSearchResponse } from '../../models/api/company-search';
2
- import type { RequestContext } from '../types';
3
- export declare const companyIndexSearch: (context: RequestContext, data: CompanyIndexSearchRequest) => Promise<CompanyIndexSearchResponse>;
@@ -1,3 +0,0 @@
1
- import type { CompanyDataResponse, GetCompanyDataRequest } from '../../models/api/company-search';
2
- import type { RequestContext } from '../types';
3
- export declare const getCompanyData: (context: RequestContext, data: GetCompanyDataRequest) => Promise<CompanyDataResponse>;
@@ -1,3 +0,0 @@
1
- import type { CompanyDataResponse, RefreshCompanyDataRequest } from '../../models/api/company-search';
2
- import type { RequestContext } from '../types';
3
- export declare const refreshCompanyData: (context: RequestContext, data: RefreshCompanyDataRequest) => Promise<CompanyDataResponse>;
@@ -1,3 +0,0 @@
1
- import type { TinVerificationRequest, TinVerificationResponse } from '../../models/api/company-search';
2
- import type { RequestContext } from '../types';
3
- export declare const verifyTin: (context: RequestContext, data: TinVerificationRequest) => Promise<TinVerificationResponse>;