From 83506bbd678c0b39d665bcf6d7eecfa44ffe2350 Mon Sep 17 00:00:00 2001 From: ezewer Date: Wed, 6 Mar 2024 15:20:24 +1100 Subject: [PATCH] =?UTF-8?q?Replace=20=D0=A1=20Cyrillic=20letter=20"Es"=20w?= =?UTF-8?q?ith=20C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/service.report.json.example | 2 +- .../queue/helpers/get-report-content-type.js | 4 ++-- workers/loc.api/queue/upload-to-s3/index.js | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/service.report.json.example b/config/service.report.json.example index 95f897f3..c7e88141 100644 --- a/config/service.report.json.example +++ b/config/service.report.json.example @@ -14,6 +14,6 @@ }, "isSpamRestrictionMode": true, "isAddedUniqueEndingToReportFileName": false, - "isСompress": true, + "isCompress": true, "isLoggerDisabled": false } diff --git a/workers/loc.api/queue/helpers/get-report-content-type.js b/workers/loc.api/queue/helpers/get-report-content-type.js index 02b88cac..e2656008 100644 --- a/workers/loc.api/queue/helpers/get-report-content-type.js +++ b/workers/loc.api/queue/helpers/get-report-content-type.js @@ -2,11 +2,11 @@ module.exports = (params) => { const { - isСompress, + isCompress, isPDFRequired } = params ?? {} - if (isСompress) { + if (isCompress) { return 'application/zip' } if (isPDFRequired) { diff --git a/workers/loc.api/queue/upload-to-s3/index.js b/workers/loc.api/queue/upload-to-s3/index.js index 7565f0a1..7fd7e3ab 100644 --- a/workers/loc.api/queue/upload-to-s3/index.js +++ b/workers/loc.api/queue/upload-to-s3/index.js @@ -9,7 +9,7 @@ const { } = require('../helpers') const _uploadSignToS3 = async ( - isСompress, + isCompress, deflateFac, grcBfxReq, configs, @@ -17,7 +17,7 @@ const _uploadSignToS3 = async ( fileNameWithoutExt ) => { const fileName = `SIGNATURE_${fileNameWithoutExt}.sig` - const signFileName = isСompress + const signFileName = isCompress ? `SIGNATURE_${fileNameWithoutExt}.zip` : fileName @@ -32,7 +32,7 @@ const _uploadSignToS3 = async ( const signBuffers = await Promise.all(deflateFac.createBuffZip( [signStream], - isСompress, + isCompress, { comment: `SIGNATURE_${fileNameWithoutExt.replace(/_/g, ' ')}` } @@ -42,7 +42,7 @@ const _uploadSignToS3 = async ( const signOpts = { ...configs, contentDisposition: `attachment; filename="${signFileName}"`, - contentType: isСompress + contentType: isCompress ? 'application/zip' : 'application/pgp-signature' } @@ -56,7 +56,7 @@ const _uploadSignToS3 = async ( module.exports = ( { - isСompress, + isCompress, isAddedUniqueEndingToReportFileName }, deflateFac, @@ -108,25 +108,25 @@ module.exports = ( }) const buffers = await Promise.all(deflateFac.createBuffZip( streams, - isСompress, + isCompress, { comment: fileNameWithoutExt.replace(/_/g, ' ') } )) const promises = buffers.map(async (buffer, i) => { - const ext = isСompress ? 'zip' : '' - const singleFileName = isСompress + const ext = isCompress ? 'zip' : '' + const singleFileName = isCompress ? streams[i].data.name.slice(0, -3) : streams[i].data.name - const fileName = isСompress && isMultiExport + const fileName = isCompress && isMultiExport ? `${fileNameWithoutExt}.zip` : `${singleFileName}${ext}` const opts = { ...configs, contentDisposition: `attachment; filename="${fileName}"`, contentType: getReportContentType({ - isСompress, + isCompress, isPDFRequired: subParamsArr[i].isPDFRequired }) } @@ -147,7 +147,7 @@ module.exports = ( if (isSignReq) { const signatureS3 = await _uploadSignToS3( - isСompress, + isCompress, deflateFac, grcBfxReq, configs,