feat(Convert to File Node): Operation to convert a string in a plain text file, option to format JSON when creating file (#8620)

This commit is contained in:
Michael Kret
2024-02-13 16:52:37 +02:00
committed by GitHub
parent e597fbc78f
commit d18cba37a4
7 changed files with 530 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ import type {
import * as spreadsheet from './actions/spreadsheet.operation';
import * as toBinary from './actions/toBinary.operation';
import * as toText from './actions/toText.operation';
import * as toJson from './actions/toJson.operation';
import * as iCall from './actions/iCall.operation';
@@ -17,7 +18,7 @@ export class ConvertToFile implements INodeType {
name: 'convertToFile',
icon: 'file:convertToFile.svg',
group: ['input'],
version: 1,
version: [1, 1.1],
description: 'Convert JSON data to binary data',
defaults: {
name: 'Convert to File',
@@ -67,6 +68,12 @@ export class ConvertToFile implements INodeType {
action: 'Convert to RTF',
description: 'Transform input data into a table in an RTF file',
},
{
name: 'Convert to Text File',
value: 'toText',
action: 'Convert to text file',
description: 'Transform input data string into a file',
},
{
name: 'Convert to XLS',
value: 'xls',
@@ -90,6 +97,7 @@ export class ConvertToFile implements INodeType {
},
...spreadsheet.description,
...toBinary.description,
...toText.description,
...toJson.description,
...iCall.description,
],
@@ -112,6 +120,10 @@ export class ConvertToFile implements INodeType {
returnData = await toBinary.execute.call(this, items);
}
if (operation === 'toText') {
returnData = await toText.execute.call(this, items);
}
if (operation === 'iCal') {
returnData = await iCall.execute.call(this, items);
}