From fc9a4697c8c9248eb144151a1d26534b82484199 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Thu, 4 Sep 2025 20:58:28 +0200 Subject: [PATCH] Fxi linting issue by executing `npm run prettier` --- .../src/services/org-vault-export.service.ts | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts b/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts index 7c6736df6da..78f0ff36392 100644 --- a/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts +++ b/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts @@ -138,44 +138,49 @@ export class OrganizationVaultExportService const restrictions = await firstValueFrom(this.restrictedItemTypesService.restricted$); promises.push( - this.vaultExportApiService.getOrganizationExport(organizationId as OrganizationId).then((exportData) => { - const exportPromises: any = []; - if (exportData != null) { - if (exportData.collections != null && exportData.collections.length > 0) { - exportData.collections.forEach((c) => { - const collection = Collection.fromCollectionData( - new CollectionData(c as CollectionDetailsResponse), - ); - exportPromises.push( - firstValueFrom(this.keyService.activeUserOrgKeys$) - .then((keys) => - collection.decrypt(keys[organizationId as OrganizationId], this.encryptService), - ) - .then((decCol) => { - decCollections.push(decCol); - }), - ); - }); - } - if (exportData.ciphers != null && exportData.ciphers.length > 0) { - exportData.ciphers - .filter((c) => c.deletedDate === null) - .forEach(async (c) => { - const cipher = new Cipher(new CipherData(c)); + this.vaultExportApiService + .getOrganizationExport(organizationId as OrganizationId) + .then((exportData) => { + const exportPromises: any = []; + if (exportData != null) { + if (exportData.collections != null && exportData.collections.length > 0) { + exportData.collections.forEach((c) => { + const collection = Collection.fromCollectionData( + new CollectionData(c as CollectionDetailsResponse), + ); exportPromises.push( - this.cipherService.decrypt(cipher, activeUserId).then((decCipher) => { - if ( - !this.restrictedItemTypesService.isCipherRestricted(decCipher, restrictions) - ) { - decCiphers.push(decCipher); - } - }), + firstValueFrom(this.keyService.activeUserOrgKeys$) + .then((keys) => + collection.decrypt( + keys[organizationId as OrganizationId], + this.encryptService, + ), + ) + .then((decCol) => { + decCollections.push(decCol); + }), ); }); + } + if (exportData.ciphers != null && exportData.ciphers.length > 0) { + exportData.ciphers + .filter((c) => c.deletedDate === null) + .forEach(async (c) => { + const cipher = new Cipher(new CipherData(c)); + exportPromises.push( + this.cipherService.decrypt(cipher, activeUserId).then((decCipher) => { + if ( + !this.restrictedItemTypesService.isCipherRestricted(decCipher, restrictions) + ) { + decCiphers.push(decCipher); + } + }), + ); + }); + } } - } - return Promise.all(exportPromises); - }), + return Promise.all(exportPromises); + }), ); await Promise.all(promises); @@ -192,7 +197,9 @@ export class OrganizationVaultExportService const restrictions = await firstValueFrom(this.restrictedItemTypesService.restricted$); - const exportData = await this.vaultExportApiService.getOrganizationExport(organizationId as OrganizationId); + const exportData = await this.vaultExportApiService.getOrganizationExport( + organizationId as OrganizationId, + ); if (exportData == null) { return;