refactor(core): Deprecate prepareOutputData (no-changelog) (#7091)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-09-05 12:59:02 +02:00
committed by GitHub
parent c04a996fb4
commit 6aa7b93473
241 changed files with 331 additions and 379 deletions

View File

@@ -1,6 +1,7 @@
import set from 'lodash/set';
import type {
IExecuteFunctions,
INodeExecutionData,
INodeParameters,
INodeTypeData,
@@ -9,8 +10,6 @@ import type {
} from 'n8n-workflow';
import { deepCopy } from 'n8n-workflow';
import type { IExecuteFunctions } from '@/Interfaces';
export const predefinedNodesTypes: INodeTypeData = {
'n8n-nodes-base.if': {
sourcePath: '',
@@ -241,7 +240,7 @@ export const predefinedNodesTypes: INodeTypeData = {
},
],
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
async execute(this: IExecuteFunctions) {
const returnDataTrue: INodeExecutionData[] = [];
const returnDataFalse: INodeExecutionData[] = [];
@@ -415,9 +414,7 @@ export const predefinedNodesTypes: INodeTypeData = {
},
],
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
// const itemsInput2 = this.getInputData(1);
async execute(this: IExecuteFunctions) {
const returnData: INodeExecutionData[] = [];
const mode = this.getNodeParameter('mode', 0) as string;
@@ -461,9 +458,8 @@ export const predefinedNodesTypes: INodeTypeData = {
outputs: ['main'],
properties: [],
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
return this.prepareOutputData(items);
async execute(this: IExecuteFunctions) {
return [this.getInputData()];
},
},
},
@@ -507,7 +503,7 @@ export const predefinedNodesTypes: INodeTypeData = {
},
],
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
async execute(this: IExecuteFunctions) {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
@@ -522,7 +518,7 @@ export const predefinedNodesTypes: INodeTypeData = {
returnData.push(newItem);
}
return this.prepareOutputData(returnData);
return [returnData];
},
},
},
@@ -646,7 +642,7 @@ export const predefinedNodesTypes: INodeTypeData = {
},
],
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
async execute(this: IExecuteFunctions) {
const items = this.getInputData();
if (items.length === 0) {
@@ -714,7 +710,7 @@ export const predefinedNodesTypes: INodeTypeData = {
returnData.push(newItem);
}
return this.prepareOutputData(returnData);
return [returnData];
},
},
},
@@ -736,9 +732,7 @@ export const predefinedNodesTypes: INodeTypeData = {
properties: [],
},
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
return this.prepareOutputData(items);
return [this.getInputData()];
},
},
},