From 8e138ddf2d8847cc7b94cf6ab7201093f15d0e12 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 29 Apr 2020 16:12:16 -0500 Subject: [PATCH] :zap: added compression option --- .../nodes-base/nodes/SpreadsheetFile.node.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/nodes-base/nodes/SpreadsheetFile.node.ts b/packages/nodes-base/nodes/SpreadsheetFile.node.ts index 594754ef99..b1d1c14190 100644 --- a/packages/nodes-base/nodes/SpreadsheetFile.node.ts +++ b/packages/nodes-base/nodes/SpreadsheetFile.node.ts @@ -173,6 +173,24 @@ export class SpreadsheetFile implements INodeType { placeholder: 'Add Option', default: {}, options: [ + { + displayName: 'Compression', + name: 'compression', + type: 'boolean', + displayOptions: { + show: { + '/operation': [ + 'toFile', + ], + '/fileFormat': [ + 'xlsx', + 'ods', + ], + }, + }, + default: false, + description: 'Weather compression will be applied or not', + }, { displayName: 'File Name', name: 'fileName', @@ -342,10 +360,16 @@ export class SpreadsheetFile implements INodeType { wopts.bookType = 'rtf'; } else if (fileFormat === 'ods') { wopts.bookType = 'ods'; + if (options.compression) { + wopts.compression = true; + } } else if (fileFormat === 'xls') { wopts.bookType = 'xls'; } else if (fileFormat === 'xlsx') { wopts.bookType = 'xlsx'; + if (options.compression) { + wopts.compression = true; + } } // Convert the data in the correct format