@adyen/kyc-components 3.0.0-beta.28 → 3.0.0-beta.29

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 (26) hide show
  1. package/dist/es/adyen-kyc-components.es.js +154 -183
  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/useAsyncAccountDetailsValidationRules.d.ts +1 -1
  15. package/dist/types/core/hooks/useCompanySearch/types.d.ts +11 -5
  16. package/dist/types/core/hooks/useCompanySearch/useCompanySearch.d.ts +2 -2
  17. package/dist/types/core/models/api/company-search.d.ts +4 -18
  18. package/dist/types/core/models/api/trusted-transferInstrument.d.ts +1 -0
  19. package/dist/types/utils/mapping/companySearch/mapCompanyDataResponseToFormSchema.d.ts +2 -2
  20. package/dist/types/utils/validatorUtils.d.ts +1 -0
  21. package/package.json +1 -1
  22. package/dist/types/core/Services/kycExternalApi/company-deep-search.d.ts +0 -3
  23. package/dist/types/core/Services/kycExternalApi/company-index-search.d.ts +0 -3
  24. package/dist/types/core/Services/kycExternalApi/get-company-data.d.ts +0 -3
  25. package/dist/types/core/Services/kycExternalApi/refresh-company-data.d.ts +0 -3
  26. package/dist/types/core/Services/kycExternalApi/verify-tin.d.ts +0 -3
@@ -2896,6 +2896,10 @@ function mergeCountryBasedRulesets(defaultRuleset, countryBasedRuleset, country2
2896
2896
  const isUndefinedOrNull = (input) => !!(input === void 0 || input === null);
2897
2897
  const isEmpty = (input) => !!(isUndefinedOrNull(input) || typeof input === "object" && Object.keys(input).length === 0 || typeof input === "string" && /^[\s]*$/.test(input));
2898
2898
  const hasEmptyFields = (input) => input && (Object.keys(input).length === 0 || Object.values(input).some((value) => value === void 0 || value === null || value === ""));
2899
+ const isAccountNumberMasked = (payload) => {
2900
+ var _a;
2901
+ return (payload == null ? void 0 : payload.accountNumber) && ((_a = payload == null ? void 0 : payload.accountNumber) == null ? void 0 : _a.includes("*"));
2902
+ };
2899
2903
  const extractFieldName = (inputString) => {
2900
2904
  const fieldNames = inputString == null ? void 0 : inputString.split(".");
2901
2905
  const fieldName = (fieldNames == null ? void 0 : fieldNames.length) > 0 ? fieldNames[fieldNames.length - 1] : "";
@@ -5974,14 +5978,14 @@ const rules$3 = ({
5974
5978
  }
5975
5979
  },
5976
5980
  stockExchangeMICIfTypePublic: () => {
5977
- var _a;
5978
- if (((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
5981
+ var _a, _b;
5982
+ 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) {
5979
5983
  return "REQUIRED";
5980
5984
  }
5981
5985
  },
5982
5986
  stockISINIfTypePublic: () => {
5983
- var _a;
5984
- if (((_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
5987
+ var _a, _b;
5988
+ 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) {
5985
5989
  return "REQUIRED";
5986
5990
  }
5987
5991
  },
@@ -6001,8 +6005,8 @@ const rules$3 = ({
6001
6005
  }
6002
6006
  },
6003
6007
  companyRegistrationNumberExemptionAllowed: () => {
6004
- var _a;
6005
- const companyType2 = (_a = data == null ? void 0 : data.companyType) == null ? void 0 : _a.entityType;
6008
+ var _a, _b;
6009
+ 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);
6006
6010
  if (country2 === "DE" && (companyType2 === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION || companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE)) {
6007
6011
  return "REQUIRED";
6008
6012
  }
@@ -11109,15 +11113,13 @@ function useCompanySearch({
11109
11113
  taxIdentificationNumber: taxIdentificationNumber2,
11110
11114
  canVerify,
11111
11115
  limit = 15,
11112
- handleChangeFor
11116
+ handleChangeFor,
11117
+ handleCompanyIndexSearch,
11118
+ handleCompanyDeepSearch,
11119
+ handleGetCompanyDataset,
11120
+ handleRefreshCompanyDataset,
11121
+ handleVerifyTin
11113
11122
  }) {
11114
- const {
11115
- verifyTin: verifyTin2,
11116
- companyIndexSearch: companyIndexSearch2,
11117
- companyDeepSearch: companyDeepSearch2,
11118
- getCompanyData: getCompanyData2,
11119
- refreshCompanyData: refreshCompanyData2
11120
- } = useConfigurationApi();
11121
11123
  const [companiesList, setCompaniesList] = useState([]);
11122
11124
  const [selectedCompanyId, setSelectedCompanyId] = useState();
11123
11125
  const [verifiedCompany, setVerifiedCompany] = useState();
@@ -11136,6 +11138,8 @@ function useCompanySearch({
11136
11138
  deepSearch
11137
11139
  }) => {
11138
11140
  try {
11141
+ if (!indexSearch || !deepSearch)
11142
+ return;
11139
11143
  setStatus("loading");
11140
11144
  setCompaniesList([]);
11141
11145
  const {
@@ -11170,11 +11174,13 @@ function useCompanySearch({
11170
11174
  return setStatus("idle");
11171
11175
  }
11172
11176
  try {
11177
+ if (!handleCompanyIndexSearch || !handleCompanyDeepSearch)
11178
+ return;
11173
11179
  setStatus("loading");
11174
11180
  setSelectedCompanyId(void 0);
11175
11181
  const {
11176
11182
  results: indexSearchResults
11177
- } = await companyIndexSearch2({
11183
+ } = await handleCompanyIndexSearch({
11178
11184
  text: legalCompanyName2,
11179
11185
  country: country2,
11180
11186
  state: stateOrProvince2,
@@ -11183,7 +11189,7 @@ function useCompanySearch({
11183
11189
  if (!(indexSearchResults == null ? void 0 : indexSearchResults.length)) {
11184
11190
  const {
11185
11191
  results: deepSearchResults
11186
- } = await companyDeepSearch2({
11192
+ } = await handleCompanyDeepSearch({
11187
11193
  text: legalCompanyName2,
11188
11194
  country: country2,
11189
11195
  state: stateOrProvince2,
@@ -11198,9 +11204,11 @@ function useCompanySearch({
11198
11204
  } finally {
11199
11205
  setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
11200
11206
  }
11201
- }, [companyDeepSearch2, companyIndexSearch2, country2, legalCompanyName2, limit, stateOrProvince2]);
11207
+ }, [handleCompanyIndexSearch, handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
11202
11208
  const verify2 = useCallback(async (companyTIN, company2) => {
11203
11209
  try {
11210
+ if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
11211
+ return;
11204
11212
  setStatus("loading");
11205
11213
  setSelectedCompanyId(company2.id);
11206
11214
  if (!canVerify || !companyTIN) {
@@ -11208,7 +11216,7 @@ function useCompanySearch({
11208
11216
  }
11209
11217
  const {
11210
11218
  matched
11211
- } = await verifyTin2({
11219
+ } = await handleVerifyTin({
11212
11220
  tin: companyTIN,
11213
11221
  name: company2.name
11214
11222
  });
@@ -11221,10 +11229,10 @@ function useCompanySearch({
11221
11229
  status: 200
11222
11230
  }));
11223
11231
  }
11224
- const companyData = isLastUpdateDateCompliant(company2) ? await getCompanyData2({
11232
+ const companyData = isLastUpdateDateCompliant(company2) ? await handleGetCompanyDataset({
11225
11233
  companyId: company2.id,
11226
11234
  country: country2
11227
- }) : await refreshCompanyData2({
11235
+ }) : await handleRefreshCompanyDataset({
11228
11236
  companyId: company2.id,
11229
11237
  country: country2
11230
11238
  });
@@ -11239,7 +11247,7 @@ function useCompanySearch({
11239
11247
  } finally {
11240
11248
  setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
11241
11249
  }
11242
- }, [country2, stateOrProvince2, verifyTin2, canVerify, getCompanyData2, refreshCompanyData2]);
11250
+ }, [country2, stateOrProvince2, canVerify, handleVerifyTin, handleGetCompanyDataset, handleRefreshCompanyDataset]);
11243
11251
  const reset = useCallback(() => {
11244
11252
  setStatus("loading");
11245
11253
  setSelectedCompanyId(void 0);
@@ -11255,7 +11263,7 @@ function useCompanySearch({
11255
11263
  useEffect(() => {
11256
11264
  var _a;
11257
11265
  setError(void 0);
11258
- if (!legalCompanyName2 || !country2 || !stateOrProvince2) {
11266
+ if (!legalCompanyName2 || !country2 || !stateOrProvince2 || !taxIdentificationNumber2) {
11259
11267
  return setStatus("idle");
11260
11268
  }
11261
11269
  if (!verifiedCompany) {
@@ -11264,12 +11272,12 @@ function useCompanySearch({
11264
11272
  companyName: legalCompanyName2,
11265
11273
  companyCountry: country2,
11266
11274
  companyState: stateOrProvince2,
11267
- indexSearch: companyIndexSearch2,
11268
- deepSearch: companyDeepSearch2,
11275
+ indexSearch: handleCompanyIndexSearch,
11276
+ deepSearch: handleCompanyDeepSearch,
11269
11277
  resultsLimit: limit
11270
11278
  })) == null ? void 0 : _a.catch((e) => logger$n.error(e));
11271
11279
  }
11272
- }, [legalCompanyName2, country2, stateOrProvince2, verifiedCompany, searchCompanies, companyIndexSearch2, companyDeepSearch2, limit]);
11280
+ }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit]);
11273
11281
  useEffect(() => {
11274
11282
  setVerifiedCompany(void 0);
11275
11283
  setSelectedCompanyId(void 0);
@@ -11282,9 +11290,9 @@ function useCompanySearch({
11282
11290
  return {
11283
11291
  results: companiesList,
11284
11292
  selectedCompanyId,
11293
+ verifiedCompany,
11285
11294
  status,
11286
11295
  error,
11287
- verifiedCompany,
11288
11296
  retrySearch,
11289
11297
  verify: verify2,
11290
11298
  reset
@@ -12018,7 +12026,12 @@ function CompanyLookup({
12018
12026
  stateOrProvince: stateOrProvince2,
12019
12027
  taxInformationNumber: taxInformationNumber2,
12020
12028
  handleChangeFor,
12021
- setLoading
12029
+ setLoading,
12030
+ handleCompanyIndexSearch,
12031
+ handleCompanyDeepSearch,
12032
+ handleGetCompanyDataset,
12033
+ handleRefreshCompanyDataset,
12034
+ handleVerifyTin
12022
12035
  }) {
12023
12036
  var _a;
12024
12037
  const {
@@ -12040,7 +12053,12 @@ function CompanyLookup({
12040
12053
  stateOrProvince: stateOrProvince2,
12041
12054
  taxIdentificationNumber: taxInformationNumber2,
12042
12055
  canVerify,
12043
- handleChangeFor
12056
+ handleChangeFor,
12057
+ handleCompanyIndexSearch,
12058
+ handleCompanyDeepSearch,
12059
+ handleGetCompanyDataset,
12060
+ handleRefreshCompanyDataset,
12061
+ handleVerifyTin
12044
12062
  });
12045
12063
  const hasInternalError = ((_a = error == null ? void 0 : error.sourceError) == null ? void 0 : _a.errorType) === "internal";
12046
12064
  const displaySkeleton = status === "loading" && !selectedCompanyId;
@@ -12355,7 +12373,12 @@ function CompanyBasics({
12355
12373
  requiredFields,
12356
12374
  maskedFields,
12357
12375
  optionalFields,
12358
- readOnlyFields
12376
+ readOnlyFields,
12377
+ handleCompanyIndexSearch,
12378
+ handleCompanyDeepSearch,
12379
+ handleGetCompanyDataset,
12380
+ handleRefreshCompanyDataset,
12381
+ handleVerifyTin
12359
12382
  }) {
12360
12383
  var _a, _b;
12361
12384
  const {
@@ -12400,6 +12423,17 @@ function CompanyBasics({
12400
12423
  }, i18n);
12401
12424
  const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
12402
12425
  const currentCountryTaxIdNumber = (_b = (_a = formData.taxInformation) == null ? void 0 : _a.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _b.number;
12426
+ const {
12427
+ legalCompanyNameDisabled,
12428
+ countryDisabled,
12429
+ stateOrProvinceDisabled,
12430
+ taxInformationDisabled
12431
+ } = useMemo$1(() => ({
12432
+ legalCompanyNameDisabled: formUtils.isReadOnly("legalCompanyName") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12433
+ countryDisabled: !isAllowedEditPrefilledCountry || formUtils.isReadOnly("country") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12434
+ stateOrProvinceDisabled: formUtils.isReadOnly("stateOrProvince") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12435
+ taxInformationDisabled: formUtils.isReadOnly("taxInformation") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2
12436
+ }), [formData == null ? void 0 : formData.kompanyAddress, formUtils, isAllowedEditPrefilledCountry, loading2]);
12403
12437
  useEffect$1(() => {
12404
12438
  updateStateSlice({
12405
12439
  schema,
@@ -12430,7 +12464,7 @@ function CompanyBasics({
12430
12464
  helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
12431
12465
  legalCompanyName: "legalCompanyName__helperText"
12432
12466
  }),
12433
- readonly: formUtils.isReadOnly("legalCompanyName") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12467
+ readonly: legalCompanyNameDisabled,
12434
12468
  handleChangeFor
12435
12469
  })
12436
12470
  }), formUtils.isRequiredField("country") && jsx("div", {
@@ -12440,7 +12474,7 @@ function CompanyBasics({
12440
12474
  valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
12441
12475
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
12442
12476
  labels: formUtils.getFieldLabels(COUNTRY_FIELD),
12443
- readonly: !isAllowedEditPrefilledCountry || formUtils.isReadOnly("country") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12477
+ readonly: countryDisabled,
12444
12478
  handleChangeFor
12445
12479
  })
12446
12480
  }), formUtils.isRequiredField("stateOrProvince") && jsx("div", {
@@ -12450,7 +12484,7 @@ function CompanyBasics({
12450
12484
  valid: formUtils.getFieldValid(formValid, STATE_FIELD),
12451
12485
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STATE_FIELD),
12452
12486
  labels: formUtils.getFieldLabels(STATE_FIELD),
12453
- readonly: formUtils.isReadOnly("stateOrProvince") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12487
+ readonly: stateOrProvinceDisabled,
12454
12488
  handleChangeFor,
12455
12489
  selectedCountry: formData.country
12456
12490
  })
@@ -12461,7 +12495,7 @@ function CompanyBasics({
12461
12495
  valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
12462
12496
  errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
12463
12497
  labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD),
12464
- readonly: formUtils.isReadOnly("taxInformation") || Boolean(formData == null ? void 0 : formData.kompanyAddress) || loading2,
12498
+ readonly: taxInformationDisabled,
12465
12499
  handleChangeFor,
12466
12500
  country: formData.country,
12467
12501
  canExempt: formUtils.isRequiredField("exemptedFromTax"),
@@ -12475,7 +12509,12 @@ function CompanyBasics({
12475
12509
  stateOrProvince: formData.stateOrProvince,
12476
12510
  taxInformationNumber: currentCountryTaxIdNumber,
12477
12511
  handleChangeFor,
12478
- setLoading
12512
+ setLoading,
12513
+ handleCompanyIndexSearch,
12514
+ handleCompanyDeepSearch,
12515
+ handleGetCompanyDataset,
12516
+ handleRefreshCompanyDataset,
12517
+ handleVerifyTin
12479
12518
  })]
12480
12519
  })]
12481
12520
  });
@@ -14198,6 +14237,9 @@ const companySearchComponentsKeyMapping = {
14198
14237
  const companySearchApiKeyMapping = {
14199
14238
  ...reverseObject(companySearchBaseMapping)
14200
14239
  };
14240
+ const payoutComponentKeyMapping = {
14241
+ ...payoutBaseMapping
14242
+ };
14201
14243
  const payoutApiKeyMapping = {
14202
14244
  ...reverseObject(payoutBaseMapping)
14203
14245
  };
@@ -14352,7 +14394,7 @@ const adjustIdentificationData = (data, apiData) => {
14352
14394
  };
14353
14395
  }
14354
14396
  };
14355
- const mapTransferInstrumentToPayoutAccount = (transferInstrument) => mapWith(transferInstrument, payoutApiKeyMapping);
14397
+ const mapTransferInstrumentToPayoutAccount = (transferInstrument) => mapWith(transferInstrument, payoutComponentKeyMapping);
14356
14398
  const mapPayoutDetailsToTransferInstrument = ({
14357
14399
  data,
14358
14400
  legalEntity
@@ -17855,7 +17897,7 @@ function IndividualComponent(props) {
17855
17897
  });
17856
17898
  }
17857
17899
  const PayoutDetails = "";
17858
- const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2) => {
17900
+ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked2) => {
17859
17901
  const {
17860
17902
  accountIdentification: accountIdentification2
17861
17903
  } = useConfigurationApi();
@@ -17872,7 +17914,7 @@ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2) => {
17872
17914
  console.error("Error fetching account details:", error);
17873
17915
  }
17874
17916
  };
17875
- if (payload && !hasEmptyFields2) {
17917
+ if (payload && !hasEmptyFields2 && !isAccountNumberMasked2) {
17876
17918
  fetchAccountDetails();
17877
17919
  }
17878
17920
  }, [accountIdentification2, hasEmptyFields2, payload]);
@@ -20395,7 +20437,7 @@ function PayoutDetailsComponent(props) {
20395
20437
  const [invalidFieldNames, setInvalidFieldNames] = useState("");
20396
20438
  const debouncedGetAccountIdentificationFromPayoutAccountSchema = useCallback(debounce(getAccountIdentificationFromPayoutAccountSchema, 500), [getAccountIdentificationFromPayoutAccountSchema]);
20397
20439
  const payload = useMemo(() => bankCountry2 ? debouncedGetAccountIdentificationFromPayoutAccountSchema(accountDetailsFromInput, bankCountry2) : {}, [accountDetailsFromInput, bankCountry2, debouncedGetAccountIdentificationFromPayoutAccountSchema]);
20398
- const validateAccountDetails = useAsyncAccountDetailsValidationRules(payload, hasEmptyFields(payload));
20440
+ const validateAccountDetails = useAsyncAccountDetailsValidationRules(payload, hasEmptyFields(payload), isAccountNumberMasked(payload));
20399
20441
  const resetInvalidFieldState = () => {
20400
20442
  setInvalidFieldNames("");
20401
20443
  setArePayoutAccountDetailsInvalid(false);
@@ -25070,7 +25112,12 @@ function CompanySearchComponent(props) {
25070
25112
  activeForm,
25071
25113
  problems,
25072
25114
  handleAddressSearch,
25073
- handleFindAddress
25115
+ handleFindAddress,
25116
+ handleCompanyIndexSearch,
25117
+ handleCompanyDeepSearch,
25118
+ handleGetCompanyDataset,
25119
+ handleRefreshCompanyDataset,
25120
+ handleVerifyTin
25074
25121
  } = props;
25075
25122
  const globalData = useGlobalData();
25076
25123
  const country2 = useMemo(() => {
@@ -25085,7 +25132,12 @@ function CompanySearchComponent(props) {
25085
25132
  children: jsx(CompanyBasicsComponent, {
25086
25133
  ...getFormProps(props, forms.companyBasics.formId),
25087
25134
  id: forms.companyBasics.formId,
25088
- heading: i18n.get(forms.companyBasics.formName)
25135
+ heading: i18n.get(forms.companyBasics.formName),
25136
+ handleCompanyIndexSearch,
25137
+ handleCompanyDeepSearch,
25138
+ handleGetCompanyDataset,
25139
+ handleRefreshCompanyDataset,
25140
+ handleVerifyTin
25089
25141
  })
25090
25142
  }), jsx("div", {
25091
25143
  className: formWrapperClasses(forms.companyRegistrationAddress.formId),
@@ -25203,7 +25255,12 @@ function CompanySearchDropinComponent({
25203
25255
  handleUpdateDocument,
25204
25256
  handleAddressSearch,
25205
25257
  handleFindAddress,
25206
- handleUpdateLegalEntity
25258
+ handleUpdateLegalEntity,
25259
+ handleCompanyIndexSearch,
25260
+ handleCompanyDeepSearch,
25261
+ handleGetCompanyDataset,
25262
+ handleRefreshCompanyDataset,
25263
+ handleVerifyTin
25207
25264
  }) {
25208
25265
  var _a, _b, _c, _d;
25209
25266
  const {
@@ -25363,7 +25420,12 @@ function CompanySearchDropinComponent({
25363
25420
  activeForm,
25364
25421
  shouldValidate,
25365
25422
  handleAddressSearch,
25366
- handleFindAddress
25423
+ handleFindAddress,
25424
+ handleCompanyIndexSearch,
25425
+ handleCompanyDeepSearch,
25426
+ handleGetCompanyDataset,
25427
+ handleRefreshCompanyDataset,
25428
+ handleVerifyTin
25367
25429
  })
25368
25430
  });
25369
25431
  }
@@ -28838,6 +28900,7 @@ function PayoutDetailsDropinComponent({
28838
28900
  const fallbackCurrency = (_a = currencyByCountry[defaultPayoutCountry]) == null ? void 0 : _a[0];
28839
28901
  const accountHolderName = accountHolder2 || getLegalEntityNameBasedOnType(legalEntityResponse);
28840
28902
  const instantVerificationEnabled = Boolean(!transferInstrument && handleGetBankVerificationVendors);
28903
+ const [trustedTransferInstrumentId, setTrustedTransferInstrumentId] = useState();
28841
28904
  const prefilledData = {
28842
28905
  payoutAccountDetails: {
28843
28906
  accountHolder: accountHolderName,
@@ -29030,7 +29093,10 @@ function PayoutDetailsDropinComponent({
29030
29093
  });
29031
29094
  setLoadingStatus("success");
29032
29095
  clearToasts();
29033
- externalOnSubmit == null ? void 0 : externalOnSubmit(dataSubmitted);
29096
+ externalOnSubmit == null ? void 0 : externalOnSubmit({
29097
+ ...dataSubmitted,
29098
+ id: transferInstrument.id
29099
+ });
29034
29100
  } catch (e) {
29035
29101
  setLoadingStatus("success");
29036
29102
  showToast({
@@ -29116,8 +29182,11 @@ function PayoutDetailsDropinComponent({
29116
29182
  submitButtonLabel,
29117
29183
  externalBackClick,
29118
29184
  onSubmit: skipSubmit ? () => {
29185
+ externalOnSubmit == null ? void 0 : externalOnSubmit({
29186
+ ...data,
29187
+ id: trustedTransferInstrumentId
29188
+ });
29119
29189
  navigateBackToTaskList == null ? void 0 : navigateBackToTaskList();
29120
- externalOnSubmit == null ? void 0 : externalOnSubmit(data);
29121
29190
  } : onSubmit
29122
29191
  });
29123
29192
  return jsx(FormWrapper, {
@@ -29172,7 +29241,11 @@ function PayoutDetailsDropinComponent({
29172
29241
  refreshLegalEntity,
29173
29242
  shouldValidate,
29174
29243
  bankVerificationVendors,
29175
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
29244
+ createTrustedTransferInstrument: async (code2, state2) => {
29245
+ const trustedTransferInstrument = await createTrustedTransferInstrument2(code2, state2);
29246
+ setTrustedTransferInstrumentId(trustedTransferInstrument.verificationReference);
29247
+ return trustedTransferInstrument;
29248
+ },
29176
29249
  handleBankVerificationError: handleBankVerificationError2,
29177
29250
  accountDetailsFromInput
29178
29251
  })
@@ -32612,7 +32685,12 @@ function DropinComposerComponent({
32612
32685
  handleAddressSearch: args.handleAddressSearch,
32613
32686
  handleFindAddress: args.handleFindAddress,
32614
32687
  handleHomeClick: navigateBack,
32615
- handleUpdateLegalEntity: args.handleUpdateLegalEntity
32688
+ handleUpdateLegalEntity: args.handleUpdateLegalEntity,
32689
+ handleCompanyIndexSearch: args.handleCompanyIndexSearch,
32690
+ handleCompanyDeepSearch: args.handleCompanyDeepSearch,
32691
+ handleGetCompanyDataset: args.handleGetCompanyDataset,
32692
+ handleRefreshCompanyDataset: args.handleRefreshCompanyDataset,
32693
+ handleVerifyTin: args.handleVerifyTin
32616
32694
  });
32617
32695
  case TaskTypes.TRUST_MEMBER_COMPANY:
32618
32696
  return jsx(CompanyDropinComponent, {
@@ -33799,22 +33877,7 @@ const getEmbeddedApi = ({
33799
33877
  getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
33800
33878
  getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
33801
33879
  validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1(baseRequestContext, phoneNumber2),
33802
- verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request),
33803
- companyIndexSearch: () => {
33804
- throw new Error("companyIndexSearch: Not implemented in onboarding component api");
33805
- },
33806
- companyDeepSearch: () => {
33807
- throw new Error("companyDeepSearch: Not implemented in onboarding component api");
33808
- },
33809
- getCompanyData: () => {
33810
- throw new Error("getCompanyData: Not implemented in onboarding component api");
33811
- },
33812
- refreshCompanyData: () => {
33813
- throw new Error("refreshCompanyData: Not implemented in onboarding component api");
33814
- },
33815
- verifyTin: () => {
33816
- throw new Error("verifyTin: Not implemented in onboarding component api");
33817
- }
33880
+ verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request)
33818
33881
  };
33819
33882
  };
33820
33883
  const accountIdentification = async (context, payoutAccountDetails) => {
@@ -33834,46 +33897,6 @@ const accountIdentification = async (context, payoutAccountDetails) => {
33834
33897
  }
33835
33898
  });
33836
33899
  };
33837
- const companyDeepSearch = async (context, data) => {
33838
- const {
33839
- loadingContext,
33840
- clientKey
33841
- } = context;
33842
- return httpPost({
33843
- loadingContext,
33844
- clientKey,
33845
- errorLevel: "warn",
33846
- errorMessage: "Failed to use companyDeepSearch",
33847
- errorHandler: async (response) => {
33848
- const error = await response;
33849
- throw new AdyenKycSdkError(error.message, error);
33850
- },
33851
- path: "v1/companyIndex/deepSearch",
33852
- headers: {
33853
- "Content-Type": "application/json"
33854
- }
33855
- }, data);
33856
- };
33857
- const companyIndexSearch = async (context, data) => {
33858
- const {
33859
- loadingContext,
33860
- clientKey
33861
- } = context;
33862
- return httpPost({
33863
- loadingContext,
33864
- clientKey,
33865
- errorLevel: "warn",
33866
- errorMessage: "Failed to use companyIndexSearch",
33867
- errorHandler: async (response) => {
33868
- const error = await response;
33869
- throw new AdyenKycSdkError(error.message, error);
33870
- },
33871
- path: "v1/companyIndex/indexSearch",
33872
- headers: {
33873
- "Content-Type": "application/json"
33874
- }
33875
- }, data);
33876
- };
33877
33900
  const getAllowedCountries = async (context) => {
33878
33901
  const {
33879
33902
  loadingContext,
@@ -33900,26 +33923,6 @@ const getAllowedLocales = async (context) => {
33900
33923
  clientKey
33901
33924
  });
33902
33925
  };
33903
- const getCompanyData = async (context, data) => {
33904
- const {
33905
- loadingContext,
33906
- clientKey
33907
- } = context;
33908
- return httpPost({
33909
- loadingContext,
33910
- clientKey,
33911
- errorLevel: "warn",
33912
- errorMessage: "Failed to use getCompanyData",
33913
- errorHandler: async (response) => {
33914
- const error = await response;
33915
- throw new AdyenKycSdkError(error.message, error);
33916
- },
33917
- path: "v1/companyData/fullDataset",
33918
- headers: {
33919
- "Content-Type": "application/json"
33920
- }
33921
- }, data);
33922
- };
33923
33926
  const getConfiguration = async (context, request) => {
33924
33927
  const {
33925
33928
  loadingContext,
@@ -33957,26 +33960,6 @@ const getDataset = async (context, name, locale) => {
33957
33960
  return datasetResponse;
33958
33961
  });
33959
33962
  };
33960
- const refreshCompanyData = async (context, data) => {
33961
- const {
33962
- loadingContext,
33963
- clientKey
33964
- } = context;
33965
- return httpPost({
33966
- loadingContext,
33967
- clientKey,
33968
- errorLevel: "warn",
33969
- errorMessage: "Failed to use refreshCompanyData",
33970
- errorHandler: async (response) => {
33971
- const error = await response;
33972
- throw new AdyenKycSdkError(error.message, error);
33973
- },
33974
- path: "v1/companyData/refreshDataset",
33975
- headers: {
33976
- "Content-Type": "application/json"
33977
- }
33978
- }, data);
33979
- };
33980
33963
  const validatePhoneNumber = async (context, phoneNumber2) => {
33981
33964
  const {
33982
33965
  loadingContext,
@@ -34028,26 +34011,6 @@ const verifyIdNumber = async (context, request) => {
34028
34011
  logger$3.warn("WARNING: idNumber verification failed - error:", e);
34029
34012
  }
34030
34013
  };
34031
- const verifyTin = async (context, data) => {
34032
- const {
34033
- loadingContext,
34034
- clientKey
34035
- } = context;
34036
- return httpPost({
34037
- loadingContext,
34038
- clientKey,
34039
- errorLevel: "warn",
34040
- errorMessage: "Failed to use verifyTin",
34041
- errorHandler: async (response) => {
34042
- const error = await response;
34043
- throw new AdyenKycSdkError(error.message, error);
34044
- },
34045
- path: "v1/tinVerification/verifyTin",
34046
- headers: {
34047
- "Content-Type": "application/json"
34048
- }
34049
- }, data);
34050
- };
34051
34014
  const getKycExternalApi = ({
34052
34015
  loadingContext,
34053
34016
  clientKey
@@ -34083,27 +34046,7 @@ const getKycExternalApi = ({
34083
34046
  loadingContext,
34084
34047
  clientKey
34085
34048
  }, phoneNumber2),
34086
- getImageUrl: () => `${loadingContext}static/images/`,
34087
- companyIndexSearch: async (request) => companyIndexSearch({
34088
- loadingContext,
34089
- clientKey
34090
- }, request),
34091
- companyDeepSearch: async (request) => companyDeepSearch({
34092
- loadingContext,
34093
- clientKey
34094
- }, request),
34095
- getCompanyData: async (request) => getCompanyData({
34096
- loadingContext,
34097
- clientKey
34098
- }, request),
34099
- refreshCompanyData: async (request) => refreshCompanyData({
34100
- loadingContext,
34101
- clientKey
34102
- }, request),
34103
- verifyTin: async (request) => verifyTin({
34104
- loadingContext,
34105
- clientKey
34106
- }, request)
34049
+ getImageUrl: () => `${loadingContext}static/images/`
34107
34050
  });
34108
34051
  const ConfigurationApiProvider = ({
34109
34052
  children,
@@ -34587,6 +34530,34 @@ const companySearchDropinSchema = {
34587
34530
  type: "function",
34588
34531
  required: true
34589
34532
  },
34533
+ handleAddressSearch: {
34534
+ type: "function",
34535
+ required: true
34536
+ },
34537
+ handleFindAddress: {
34538
+ type: "function",
34539
+ required: true
34540
+ },
34541
+ handleCompanyIndexSearch: {
34542
+ type: "function",
34543
+ required: true
34544
+ },
34545
+ handleCompanyDeepSearch: {
34546
+ type: "function",
34547
+ required: true
34548
+ },
34549
+ handleGetCompanyDataset: {
34550
+ type: "function",
34551
+ required: true
34552
+ },
34553
+ handleRefreshCompanyDataset: {
34554
+ type: "function",
34555
+ required: true
34556
+ },
34557
+ handleVerifyTin: {
34558
+ type: "function",
34559
+ required: true
34560
+ },
34590
34561
  onChange: {
34591
34562
  type: "function"
34592
34563
  },
@@ -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;
@@ -24,7 +24,9 @@ export interface PayoutDetailsProps extends BaseOuterFormProps<PayoutDetailsSche
24
24
  activeForm?: FormModel;
25
25
  forms?: FormModel[];
26
26
  problems?: any;
27
- onSubmit?: (data: PayoutDetailsSchema) => void;
27
+ onSubmit?: (data: PayoutDetailsSchema & {
28
+ id: string;
29
+ }) => void;
28
30
  legalEntityResponse: ExistingLegalEntity;
29
31
  taskType?: TaskTypes;
30
32
  handleGetBankVerificationVendors?: DropinAPIHandlers['handleGetBankVerificationVendors'];
@@ -1,5 +1,4 @@
1
1
  import { AccountIdentification } from '../../models/api/accountIdentification';
2
- import { CompanyDataResponse, CompanyDeepSearchRequest, CompanyDeepSearchResponse, CompanyIndexSearchRequest, CompanyIndexSearchResponse, GetCompanyDataRequest, RefreshCompanyDataRequest, TinVerificationRequest, TinVerificationResponse } from '../../models/api/company-search';
3
2
  import { DataSet } from '../../models/api/data-set';
4
3
  import { GetPayoutAccountFormatResponse } from '../../models/api/get-account-format';
5
4
  import { GetAllowedCountriesResponse } from '../../models/api/get-allowed-countries';
@@ -20,10 +19,5 @@ export type ConfigurationApi = {
20
19
  verifyIdNumber: (request: VerifyIdNumberRequest) => Promise<VerifyIdNumberResponse | undefined>;
21
20
  validatePhoneNumber: (phoneNumber: string) => Promise<ValidationResponse>;
22
21
  getImageUrl: () => string;
23
- companyIndexSearch: (request: CompanyIndexSearchRequest) => Promise<CompanyIndexSearchResponse>;
24
- companyDeepSearch: (request: CompanyDeepSearchRequest) => Promise<CompanyDeepSearchResponse>;
25
- getCompanyData: (request: GetCompanyDataRequest) => Promise<CompanyDataResponse>;
26
- refreshCompanyData: (request: RefreshCompanyDataRequest) => Promise<CompanyDataResponse>;
27
- verifyTin: (request: TinVerificationRequest) => Promise<TinVerificationResponse>;
28
22
  };
29
23
  export declare const ConfigurationApiContext: import("preact").Context<ConfigurationApi>;
@@ -1,12 +1,7 @@
1
1
  export * from './account-identification';
2
- export * from './company-deep-search';
3
- export * from './company-index-search';
4
2
  export * from './get-allowed-countries';
5
3
  export * from './get-allowed-locales';
6
- export * from './get-company-data';
7
4
  export * from './get-configuration';
8
5
  export * from './get-dataset';
9
- export * from './refresh-company-data';
10
6
  export * from './validate-phone-number';
11
7
  export * from './verify-id-number';
12
- export * from './verify-tin';
@@ -1,3 +1,3 @@
1
1
  import { AccountIdentification } from '../models/api/accountIdentification';
2
2
  import { AccountValidationResponse } from '../models/errors/validation-error';
3
- export declare const useAsyncAccountDetailsValidationRules: (payload: AccountIdentification, hasEmptyFields: boolean) => AccountValidationResponse;
3
+ export declare const useAsyncAccountDetailsValidationRules: (payload: AccountIdentification, hasEmptyFields: boolean, isAccountNumberMasked: boolean) => AccountValidationResponse;
@@ -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;
@@ -15,6 +15,7 @@ export declare function mergeCountryBasedRulesets(defaultRuleset: Ruleset, count
15
15
  export declare const isUndefinedOrNull: (input: any) => boolean;
16
16
  export declare const isEmpty: <T>(input: T) => input is null;
17
17
  export declare const hasEmptyFields: (input: any) => boolean;
18
+ export declare const isAccountNumberMasked: (payload: any) => boolean;
18
19
  export declare const findEmptyKeys: (obj: any) => string[];
19
20
  export declare const extractFieldName: (inputString: string) => string;
20
21
  export declare const mapKeyToFieldName: (i18n: any, key: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.0.0-beta.28",
3
+ "version": "3.0.0-beta.29",
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>;