@adyen/kyc-components 2.16.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12481,13 +12481,23 @@ const mapExistingFile = (name) => ({
12481
12481
  existing: true
12482
12482
  });
12483
12483
  const mapApiIdDocumentToSchema = (idDocument2) => {
12484
+ const {
12485
+ type,
12486
+ attachments
12487
+ } = idDocument2;
12484
12488
  const {
12485
12489
  hasBackPage
12486
12490
  } = idDocumentTypeOptions.find(({
12487
12491
  id: id2
12488
- }) => id2 === idDocument2.type);
12489
- const frontPage2 = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
12490
- const backPage2 = hasBackPage ? getPage(idDocument2, "back") : void 0;
12492
+ }) => id2 === type);
12493
+ let frontPage2;
12494
+ let backPage2;
12495
+ if ((attachments == null ? void 0 : attachments.length) === 1) {
12496
+ frontPage2 = getPage(idDocument2);
12497
+ } else {
12498
+ frontPage2 = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
12499
+ backPage2 = hasBackPage ? getPage(idDocument2, "back") : void 0;
12500
+ }
12491
12501
  return {
12492
12502
  ...frontPage2 ? {
12493
12503
  idFrontPage: [mapExistingFile(frontPage2.pageName)]
@@ -12495,7 +12505,7 @@ const mapApiIdDocumentToSchema = (idDocument2) => {
12495
12505
  ...backPage2 ? {
12496
12506
  idBackPage: [mapExistingFile(backPage2.pageName)]
12497
12507
  } : {},
12498
- idDocumentType: idDocument2.type
12508
+ idDocumentType: type
12499
12509
  };
12500
12510
  };
12501
12511
  const mapApiDocumentToIndividualDocuments = (entityId) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [