mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
removed generated paired items
This commit is contained in:
parent
3e0c6cb3d2
commit
b2e44499d1
|
@ -10,7 +10,6 @@ import type {
|
|||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { oldVersionNotice } from '../../../utils/descriptions';
|
||||
import { generatePairedItemData } from '../../../utils/utilities';
|
||||
import type { IRecord } from './GenericFunctions';
|
||||
import { apiRequest, apiRequestAllItems, downloadRecordAttachments } from './GenericFunctions';
|
||||
|
||||
|
@ -737,24 +736,16 @@ export class AirtableV1 implements INodeType {
|
|||
const downloadFieldNames = (
|
||||
this.getNodeParameter('downloadFieldNames', 0) as string
|
||||
).split(',');
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
|
||||
const data = await downloadRecordAttachments.call(
|
||||
this,
|
||||
responseData.records as IRecord[],
|
||||
downloadFieldNames,
|
||||
pairedItem,
|
||||
);
|
||||
return [data];
|
||||
}
|
||||
|
||||
// We can return from here
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
return [
|
||||
this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(returnData), {
|
||||
itemData,
|
||||
}),
|
||||
];
|
||||
return [this.helpers.returnJsonArray(returnData)];
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ json: { error: error.message } });
|
||||
|
|
|
@ -4,11 +4,7 @@ import type {
|
|||
INodeProperties,
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import {
|
||||
generatePairedItemData,
|
||||
updateDisplayOptions,
|
||||
wrapData,
|
||||
} from '../../../../../utils/utilities';
|
||||
import { updateDisplayOptions, wrapData } from '../../../../../utils/utilities';
|
||||
import { apiRequest } from '../../transport';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
|
@ -111,11 +107,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
bases = bases.filter((base) => permissionLevel.includes(base.permissionLevel as string));
|
||||
}
|
||||
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
|
||||
const returnData = this.helpers.constructExecutionMetaData(wrapData(bases), {
|
||||
itemData,
|
||||
});
|
||||
const returnData = wrapData(bases);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import type {
|
|||
INodeProperties,
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import { generatePairedItemData, updateDisplayOptions } from '../../../../../utils/utilities';
|
||||
import { updateDisplayOptions } from '../../../../../utils/utilities';
|
||||
import { apiRequest, apiRequestAllItems, downloadRecordAttachments } from '../../transport';
|
||||
import type { IRecord } from '../../helpers/interfaces';
|
||||
import { flattenOutput } from '../../helpers/utils';
|
||||
|
@ -155,12 +155,9 @@ export async function execute(
|
|||
const endpoint = `${base}/${table}`;
|
||||
|
||||
let itemsLength = items.length ? 1 : 0;
|
||||
let fallbackPairedItems;
|
||||
|
||||
if (nodeVersion >= 2.1) {
|
||||
itemsLength = items.length;
|
||||
} else {
|
||||
fallbackPairedItems = generatePairedItemData(items.length);
|
||||
}
|
||||
|
||||
for (let i = 0; i < itemsLength; i++) {
|
||||
|
@ -207,7 +204,7 @@ export async function execute(
|
|||
this,
|
||||
responseData.records as IRecord[],
|
||||
options.downloadFields as string[],
|
||||
fallbackPairedItems || [{ item: i }],
|
||||
nodeVersion >= 2.1 ? [{ item: i }] : undefined,
|
||||
);
|
||||
returnData.push(...itemWithAttachments);
|
||||
continue;
|
||||
|
@ -219,7 +216,7 @@ export async function execute(
|
|||
json: flattenOutput(record),
|
||||
})) as INodeExecutionData[];
|
||||
|
||||
const itemData = fallbackPairedItems || [{ item: i }];
|
||||
const itemData = nodeVersion >= 2.1 ? [{ item: i }] : [];
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(records, {
|
||||
itemData,
|
||||
|
|
|
@ -5,7 +5,7 @@ import type {
|
|||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
|
||||
import { getWorkflowInfo } from './GenericFunctions';
|
||||
|
||||
export class ExecuteWorkflow implements INodeType {
|
||||
|
@ -278,8 +278,6 @@ export class ExecuteWorkflow implements INodeType {
|
|||
items,
|
||||
);
|
||||
|
||||
const fallbackPairedItemData = generatePairedItemData(items.length);
|
||||
|
||||
for (const output of workflowResult) {
|
||||
const sameLength = output.length === items.length;
|
||||
|
||||
|
@ -288,17 +286,14 @@ export class ExecuteWorkflow implements INodeType {
|
|||
|
||||
if (sameLength) {
|
||||
item.pairedItem = { item: itemIndex };
|
||||
} else {
|
||||
item.pairedItem = fallbackPairedItemData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return workflowResult;
|
||||
} catch (error) {
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
if (this.continueOnFail()) {
|
||||
return [[{ json: { error: error.message }, pairedItem }]];
|
||||
return [[{ json: { error: error.message } }]];
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
type INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData, updateDisplayOptions } from '@utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import type { JsonToSpreadsheetBinaryOptions, JsonToSpreadsheetBinaryFormat } from '@utils/binary';
|
||||
|
||||
import { convertJsonToSpreadsheetBinary } from '@utils/binary';
|
||||
|
@ -99,7 +99,6 @@ export async function execute(
|
|||
) {
|
||||
let returnData: INodeExecutionData[] = [];
|
||||
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
try {
|
||||
const options = this.getNodeParameter('options', 0, {}) as JsonToSpreadsheetBinaryOptions;
|
||||
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0, 'data');
|
||||
|
@ -117,7 +116,6 @@ export async function execute(
|
|||
binary: {
|
||||
[binaryPropertyName]: binaryData,
|
||||
},
|
||||
pairedItem,
|
||||
};
|
||||
|
||||
returnData = [newItem];
|
||||
|
@ -127,7 +125,6 @@ export async function execute(
|
|||
json: {
|
||||
error: error.message,
|
||||
},
|
||||
pairedItem,
|
||||
});
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), error);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData, updateDisplayOptions } from '@utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
import { createBinaryFromJson } from '@utils/binary';
|
||||
import { encodeDecodeOptions } from '@utils/descriptions';
|
||||
|
||||
|
@ -92,7 +92,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
|
||||
const mode = this.getNodeParameter('mode', 0, 'once') as string;
|
||||
if (mode === 'once') {
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
try {
|
||||
const options = this.getNodeParameter('options', 0, {});
|
||||
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0, 'data');
|
||||
|
@ -114,7 +113,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
binary: {
|
||||
[binaryPropertyName]: binaryData,
|
||||
},
|
||||
pairedItem,
|
||||
};
|
||||
|
||||
returnData = [newItem];
|
||||
|
@ -124,7 +122,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
json: {
|
||||
error: error.message,
|
||||
},
|
||||
pairedItem,
|
||||
});
|
||||
}
|
||||
throw new NodeOperationError(this.getNode(), error);
|
||||
|
|
|
@ -18,7 +18,7 @@ import type {
|
|||
INodeTypeDescription,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { formatPrivateKey, generatePairedItemData } from '@utils/utilities';
|
||||
import { formatPrivateKey } from '@utils/utilities';
|
||||
|
||||
interface ReturnFtpItem {
|
||||
type: string;
|
||||
|
@ -549,9 +549,7 @@ export class Ftp implements INodeType {
|
|||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
|
||||
return [[{ json: { error: error.message }, pairedItem }]];
|
||||
return [[{ json: { error: error.message } }]];
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import type {
|
|||
import { NodeConnectionType, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
|
||||
import { googleApiRequest, googleApiRequestAllItems, simplify } from './GenericFunctions';
|
||||
|
||||
import { recordFields, recordOperations } from './RecordDescription';
|
||||
|
@ -196,8 +196,6 @@ export class GoogleBigQueryV1 implements INodeType {
|
|||
|
||||
body.rows = rows;
|
||||
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
try {
|
||||
responseData = await googleApiRequest.call(
|
||||
this,
|
||||
|
@ -206,17 +204,11 @@ export class GoogleBigQueryV1 implements INodeType {
|
|||
body,
|
||||
);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
returnData.push(...executionData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionErrorData = this.helpers.returnJsonArray({ error: error.message });
|
||||
returnData.push(...executionErrorData);
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject, { itemIndex: 0 });
|
||||
|
|
|
@ -9,7 +9,7 @@ import { v4 as uuid } from 'uuid';
|
|||
import type { TableSchema } from '../../helpers/interfaces';
|
||||
import { checkSchema, wrapData } from '../../helpers/utils';
|
||||
import { googleBigQueryApiRequest } from '../../transport';
|
||||
import { generatePairedItemData, updateDisplayOptions } from '@utils/utilities';
|
||||
import { updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
{
|
||||
|
@ -225,7 +225,6 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
}
|
||||
}
|
||||
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
for (let i = 0; i < rows.length; i += batchSize) {
|
||||
const batch = rows.slice(i, i + batchSize);
|
||||
body.rows = batch;
|
||||
|
@ -278,10 +277,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
|
|||
});
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
wrapData(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = wrapData(responseData as IDataObject[]);
|
||||
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ import type {
|
|||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, jsonParse } from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
import {
|
||||
fullDocumentToJson,
|
||||
googleApiRequest,
|
||||
|
@ -122,7 +121,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
|||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
let responseData;
|
||||
|
||||
|
@ -137,7 +136,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
|||
if (nodeVersion >= 1.1) {
|
||||
itemsLength = items.length;
|
||||
} else {
|
||||
fallbackPairedItems = generatePairedItemData(items.length);
|
||||
fallbackPairedItems = [];
|
||||
}
|
||||
|
||||
if (resource === 'document') {
|
||||
|
@ -173,10 +172,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType {
|
|||
.filter((el: IDataObject) => !!el);
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
|
||||
returnData.push(...executionData);
|
||||
} else if (operation === 'create') {
|
||||
|
|
|
@ -14,7 +14,7 @@ import type {
|
|||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { getGoogleAccessToken } from '../../GenericFunctions';
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
|
||||
import type {
|
||||
ILookupValues,
|
||||
ISheetUpdateData,
|
||||
|
@ -296,12 +296,9 @@ export class GoogleSheetsV1 implements INodeType {
|
|||
returnData = [];
|
||||
}
|
||||
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
|
||||
const lookupOutput = returnData.map((item) => {
|
||||
return {
|
||||
json: item,
|
||||
pairedItem,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-wor
|
|||
import type { SheetProperties } from '../../helpers/GoogleSheets.types';
|
||||
import type { GoogleSheet } from '../../helpers/GoogleSheet';
|
||||
import { getColumnNumber, untilSheetSelected } from '../../helpers/GoogleSheets.utils';
|
||||
import { generatePairedItemData, wrapData } from '../../../../../../utils/utilities';
|
||||
import { wrapData } from '../../../../../../utils/utilities';
|
||||
|
||||
export const description: SheetProperties = [
|
||||
{
|
||||
|
@ -165,10 +165,7 @@ export async function execute(
|
|||
await sheet.spreadsheetBatchUpdate(requests);
|
||||
}
|
||||
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
const returnData = this.helpers.constructExecutionMetaData(wrapData({ success: true }), {
|
||||
itemData,
|
||||
});
|
||||
const returnData = wrapData({ success: true });
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ import { NodeApiError, NodeConnectionType, NodeOperationError } from 'n8n-workfl
|
|||
|
||||
import { snakeCase } from 'change-case';
|
||||
import set from 'lodash/set';
|
||||
import { generatePairedItemData } from '../../../utils/utilities';
|
||||
|
||||
import {
|
||||
clean,
|
||||
getAssociations,
|
||||
|
@ -1192,12 +1192,7 @@ export class HubspotV2 implements INodeType {
|
|||
);
|
||||
}
|
||||
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
returnData.push(...executionData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import type {
|
|||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { ApplicationError, NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
|
||||
export class Kafka implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
@ -260,7 +259,6 @@ export class Kafka implements INodeType {
|
|||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
const length = items.length;
|
||||
|
||||
|
@ -400,15 +398,12 @@ export class Kafka implements INodeType {
|
|||
|
||||
await producer.disconnect();
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData);
|
||||
|
||||
return [executionData];
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
return [[{ json: { error: error.message }, pairedItem: itemData }]];
|
||||
return [[{ json: { error: error.message } }]];
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import type {
|
|||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeConnectionType } from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
import {
|
||||
microsoftApiRequest,
|
||||
microsoftApiRequestAllItems,
|
||||
|
@ -176,7 +175,6 @@ export class MicrosoftExcelV1 implements INodeType {
|
|||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
const length = items.length;
|
||||
let qs: IDataObject = {};
|
||||
|
@ -248,18 +246,12 @@ export class MicrosoftExcelV1 implements INodeType {
|
|||
{ 'workbook-session-id': id },
|
||||
);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
|
||||
returnData.push(...executionData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionErrorData = this.helpers.returnJsonArray({ error: error.message });
|
||||
returnData.push(...executionErrorData);
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -8,7 +8,7 @@ import type { ExcelResponse } from '../../helpers/interfaces';
|
|||
import { prepareOutput } from '../../helpers/utils';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { tableRLC, workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
import { generatePairedItemData, processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
import { processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
workbookRLC,
|
||||
|
@ -272,11 +272,7 @@ export async function execute(
|
|||
);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionErrorData = this.helpers.returnJsonArray({ error: error.message });
|
||||
returnData.push(...executionErrorData);
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from '../../helpers/utils';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
import { generatePairedItemData, processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
import { processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
workbookRLC,
|
||||
|
@ -373,11 +373,7 @@ export async function execute(
|
|||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionErrorData = this.helpers.returnJsonArray({ error: error.message });
|
||||
returnData.push(...executionErrorData);
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from '../../helpers/utils';
|
||||
import { microsoftApiRequest } from '../../transport';
|
||||
import { workbookRLC, worksheetRLC } from '../common.descriptions';
|
||||
import { generatePairedItemData, processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
import { processJsonInput, updateDisplayOptions } from '@utils/utilities';
|
||||
|
||||
const properties: INodeProperties[] = [
|
||||
workbookRLC,
|
||||
|
@ -380,11 +380,7 @@ export async function execute(
|
|||
);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionErrorData = this.helpers.returnJsonArray({ error: error.message });
|
||||
returnData.push(...executionErrorData);
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { IDataObject, IExecuteFunctions, INode, INodeExecutionData } from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import type { ExcelResponse, SheetData, UpdateSummary } from './interfaces';
|
||||
import { generatePairedItemData, wrapData } from '@utils/utilities';
|
||||
import { wrapData } from '@utils/utilities';
|
||||
|
||||
type PrepareOutputConfig = {
|
||||
rawData: boolean;
|
||||
|
@ -60,11 +60,7 @@ export function prepareOutput(
|
|||
returnData.push(...executionData);
|
||||
}
|
||||
} else {
|
||||
const itemData = generatePairedItemData(this.getInputData().length);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
wrapData({ [config.dataProperty || 'data']: responseData }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = wrapData({ [config.dataProperty || 'data']: responseData });
|
||||
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
NodeConnectionType,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { flatten, generatePairedItemData, getResolvables } from '@utils/utilities';
|
||||
import { flatten, getResolvables } from '@utils/utilities';
|
||||
|
||||
import {
|
||||
configurePool,
|
||||
|
@ -343,12 +343,7 @@ export class MicrosoftSql implements INodeType {
|
|||
responseData = await deleteOperation(tables, pool);
|
||||
}
|
||||
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
returnData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData },
|
||||
);
|
||||
returnData = this.helpers.returnJsonArray(responseData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
responseData = items;
|
||||
|
|
|
@ -18,7 +18,6 @@ import type {
|
|||
Sort,
|
||||
} from 'mongodb';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
import { nodeProperties } from './MongoDbProperties';
|
||||
|
||||
import {
|
||||
|
@ -120,7 +119,7 @@ export class MongoDb implements INodeType {
|
|||
if (nodeVersion >= 1.1) {
|
||||
itemsLength = items.length;
|
||||
} else {
|
||||
fallbackPairedItems = generatePairedItemData(items.length);
|
||||
fallbackPairedItems = [];
|
||||
}
|
||||
|
||||
if (operation === 'aggregate') {
|
||||
|
@ -233,7 +232,6 @@ export class MongoDb implements INodeType {
|
|||
}
|
||||
|
||||
if (operation === 'findOneAndReplace') {
|
||||
fallbackPairedItems = fallbackPairedItems ?? generatePairedItemData(items.length);
|
||||
const fields = prepareFields(this.getNodeParameter('fields', 0) as string);
|
||||
const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false) as boolean;
|
||||
const dateFields = prepareFields(
|
||||
|
@ -268,14 +266,10 @@ export class MongoDb implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
returnData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(updateItems),
|
||||
{ itemData: fallbackPairedItems },
|
||||
);
|
||||
returnData = this.helpers.returnJsonArray(updateItems);
|
||||
}
|
||||
|
||||
if (operation === 'findOneAndUpdate') {
|
||||
fallbackPairedItems = fallbackPairedItems ?? generatePairedItemData(items.length);
|
||||
const fields = prepareFields(this.getNodeParameter('fields', 0) as string);
|
||||
const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false) as boolean;
|
||||
const dateFields = prepareFields(
|
||||
|
@ -310,14 +304,10 @@ export class MongoDb implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
returnData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(updateItems),
|
||||
{ itemData: fallbackPairedItems },
|
||||
);
|
||||
returnData = this.helpers.returnJsonArray(updateItems);
|
||||
}
|
||||
|
||||
if (operation === 'insert') {
|
||||
fallbackPairedItems = fallbackPairedItems ?? generatePairedItemData(items.length);
|
||||
let responseData: IDataObject[] = [];
|
||||
try {
|
||||
// Prepare the data to insert and copy it to be returned
|
||||
|
@ -348,14 +338,10 @@ export class MongoDb implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
returnData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: fallbackPairedItems },
|
||||
);
|
||||
returnData = this.helpers.returnJsonArray(responseData);
|
||||
}
|
||||
|
||||
if (operation === 'update') {
|
||||
fallbackPairedItems = fallbackPairedItems ?? generatePairedItemData(items.length);
|
||||
const fields = prepareFields(this.getNodeParameter('fields', 0) as string);
|
||||
const useDotNotation = this.getNodeParameter('options.useDotNotation', 0, false) as boolean;
|
||||
const dateFields = prepareFields(
|
||||
|
@ -390,10 +376,7 @@ export class MongoDb implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
returnData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(updateItems),
|
||||
{ itemData: fallbackPairedItems },
|
||||
);
|
||||
returnData = this.helpers.returnJsonArray(updateItems);
|
||||
}
|
||||
|
||||
await client.close();
|
||||
|
|
|
@ -7,7 +7,6 @@ import type {
|
|||
} from 'n8n-workflow';
|
||||
import { NodeOperationError, jsonParse } from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData } from '../../../../utils/utilities';
|
||||
import type {
|
||||
ColumnInfo,
|
||||
EnumInfo,
|
||||
|
@ -234,17 +233,15 @@ export function configureQueryRunner(
|
|||
.flat();
|
||||
|
||||
if (!returnData.length) {
|
||||
const pairedItem = generatePairedItemData(queries.length);
|
||||
|
||||
if ((options?.nodeVersion as number) < 2.3) {
|
||||
if (emptyReturnData.length) {
|
||||
emptyReturnData[0].pairedItem = pairedItem;
|
||||
emptyReturnData[0].pairedItem = undefined;
|
||||
}
|
||||
returnData = emptyReturnData;
|
||||
} else {
|
||||
returnData = queries.every((query) => isSelectQuery(query.query))
|
||||
? []
|
||||
: [{ json: { success: true }, pairedItem }];
|
||||
: [{ json: { success: true } }];
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
|
|
|
@ -10,7 +10,6 @@ import type {
|
|||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
import {
|
||||
getFieldsObject,
|
||||
quickbaseApiRequest,
|
||||
|
@ -117,7 +116,6 @@ export class QuickBase implements INodeType {
|
|||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
const length = items.length;
|
||||
const qs: IDataObject = {};
|
||||
|
@ -295,10 +293,7 @@ export class QuickBase implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
@ -465,10 +460,7 @@ export class QuickBase implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
@ -548,10 +540,7 @@ export class QuickBase implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData },
|
||||
);
|
||||
const executionData = this.helpers.returnJsonArray(responseData as IDataObject[]);
|
||||
|
||||
returnData.push(...executionData);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
|
||||
import glob from 'fast-glob';
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
|
||||
export class ReadBinaryFiles implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
@ -48,7 +47,6 @@ export class ReadBinaryFiles implements INodeType {
|
|||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const fileSelector = this.getNodeParameter('fileSelector', 0) as string;
|
||||
const dataPropertyName = this.getNodeParameter('dataPropertyName', 0);
|
||||
const pairedItem = generatePairedItemData(this.getInputData().length);
|
||||
|
||||
const files = await glob(fileSelector);
|
||||
|
||||
|
@ -60,7 +58,6 @@ export class ReadBinaryFiles implements INodeType {
|
|||
[dataPropertyName]: await this.helpers.prepareBinaryData(stream, filePath),
|
||||
},
|
||||
json: {},
|
||||
pairedItem,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
} from 'n8n-workflow';
|
||||
import set from 'lodash/set';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { formatPrivateKey, generatePairedItemData } from '../../utils/utilities';
|
||||
import { formatPrivateKey } from '../../utils/utilities';
|
||||
|
||||
export class RespondToWebhook implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
|
@ -444,11 +444,7 @@ export class RespondToWebhook implements INodeType {
|
|||
this.sendResponse(response);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
const returnData = this.helpers.constructExecutionMetaData(
|
||||
[{ json: { error: error.message } }],
|
||||
{ itemData },
|
||||
);
|
||||
const returnData = [{ json: { error: error.message } }];
|
||||
return [returnData];
|
||||
}
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@ import type {
|
|||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IPairedItemData,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import Parser from 'rss-parser';
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
|
||||
// Utility function
|
||||
|
||||
|
@ -76,7 +76,7 @@ export class RssFeedRead implements INodeType {
|
|||
if (nodeVersion >= 1.1) {
|
||||
itemsLength = items.length;
|
||||
} else {
|
||||
fallbackPairedItems = generatePairedItemData(items.length);
|
||||
fallbackPairedItems = [] as IPairedItemData[];
|
||||
}
|
||||
|
||||
for (let i = 0; i < itemsLength; i++) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import {
|
|||
fromFileOptions,
|
||||
toFileOptions,
|
||||
} from '../description';
|
||||
import { flattenObject, generatePairedItemData } from '@utils/utilities';
|
||||
import { flattenObject } from '@utils/utilities';
|
||||
import { oldVersionNotice } from '@utils/descriptions';
|
||||
|
||||
export class SpreadsheetFileV1 implements INodeType {
|
||||
|
@ -58,7 +58,6 @@ export class SpreadsheetFileV1 implements INodeType {
|
|||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
|
||||
|
@ -230,7 +229,6 @@ export class SpreadsheetFileV1 implements INodeType {
|
|||
const newItem: INodeExecutionData = {
|
||||
json: {},
|
||||
binary: {},
|
||||
pairedItem,
|
||||
};
|
||||
|
||||
let fileName = `spreadsheet.${fileFormat}`;
|
||||
|
@ -247,7 +245,6 @@ export class SpreadsheetFileV1 implements INodeType {
|
|||
json: {
|
||||
error: error.message,
|
||||
},
|
||||
pairedItem,
|
||||
});
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { toFileOptions, toFileProperties } from '../description';
|
||||
import { generatePairedItemData } from '@utils/utilities';
|
||||
import type { JsonToSpreadsheetBinaryFormat, JsonToSpreadsheetBinaryOptions } from '@utils/binary';
|
||||
import { convertJsonToSpreadsheetBinary } from '@utils/binary';
|
||||
|
||||
|
@ -10,8 +9,6 @@ export const description: INodeProperties[] = [...toFileProperties, toFileOption
|
|||
export async function execute(this: IExecuteFunctions, items: INodeExecutionData[]) {
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
|
||||
const pairedItem = generatePairedItemData(items.length);
|
||||
|
||||
try {
|
||||
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0);
|
||||
const fileFormat = this.getNodeParameter('fileFormat', 0) as JsonToSpreadsheetBinaryFormat;
|
||||
|
@ -24,7 +21,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
binary: {
|
||||
[binaryPropertyName]: binaryData,
|
||||
},
|
||||
pairedItem,
|
||||
};
|
||||
|
||||
returnData.push(newItem);
|
||||
|
@ -34,7 +30,6 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
json: {
|
||||
error: error.message,
|
||||
},
|
||||
pairedItem,
|
||||
});
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -7,7 +7,6 @@ import type {
|
|||
} from 'n8n-workflow';
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { generatePairedItemData } from '../../utils/utilities';
|
||||
import type { IRecord } from './GenericFunction';
|
||||
import { apiRequest, apiRequestAllItems } from './GenericFunction';
|
||||
|
||||
|
@ -283,11 +282,7 @@ export class Stackby implements INodeType {
|
|||
);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData },
|
||||
);
|
||||
const executionErrorData = this.helpers.returnJsonArray({ error: error.message });
|
||||
returnData.push(...executionErrorData);
|
||||
} else {
|
||||
throw error;
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
type INodeType,
|
||||
type INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { generatePairedItemData } from '../../../utils/utilities';
|
||||
|
||||
import {
|
||||
type Aggregations,
|
||||
NUMERICAL_AGGREGATIONS,
|
||||
|
@ -318,9 +318,7 @@ export class Summarize implements INodeType {
|
|||
checkIfFieldExists.call(this, newItems, fieldsToSummarize, getValue);
|
||||
} catch (error) {
|
||||
if (options.continueIfFieldNotFound) {
|
||||
const itemData = generatePairedItemData(items.length);
|
||||
|
||||
return [[{ json: {}, pairedItem: itemData }]];
|
||||
return [[{ json: {} }]];
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue