mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
Feature/paired item support (#3869)
* Add paired item helper and implement it in some nodes
This commit is contained in:
@@ -137,7 +137,7 @@ export class GoogleBigQuery implements INodeType {
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const items = this.getInputData();
|
||||
const returnData: IDataObject[] = [];
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
const length = items.length;
|
||||
const qs: IDataObject = {};
|
||||
let responseData;
|
||||
@@ -192,7 +192,7 @@ export class GoogleBigQuery implements INodeType {
|
||||
returnData.push(responseData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ error: error.message });
|
||||
returnData.push({ json: { error: error.message } });
|
||||
} else {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
}
|
||||
@@ -226,13 +226,6 @@ export class GoogleBigQuery implements INodeType {
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
Object.assign(qs, options);
|
||||
|
||||
// if (qs.useInt64Timestamp !== undefined) {
|
||||
// qs.formatOptions = {
|
||||
// useInt64Timestamp: qs.useInt64Timestamp,
|
||||
// };
|
||||
// delete qs.useInt64Timestamp;
|
||||
// }
|
||||
|
||||
if (qs.selectedFields) {
|
||||
fields = (qs.selectedFields as string).split(',');
|
||||
}
|
||||
@@ -246,10 +239,6 @@ export class GoogleBigQuery implements INodeType {
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
returnData.push.apply(
|
||||
returnData,
|
||||
simple ? simplify(responseData, fields) : responseData,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
responseData = await googleApiRequest.call(
|
||||
@@ -259,22 +248,30 @@ export class GoogleBigQuery implements INodeType {
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
returnData.push.apply(
|
||||
returnData,
|
||||
simple ? simplify(responseData.rows, fields) : responseData.rows,
|
||||
);
|
||||
}
|
||||
|
||||
responseData = simple ? simplify(responseData.rows, fields) : responseData.rows;
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
returnData.push({ error: error.message });
|
||||
const executionErrorData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray({ error: error.message }),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionErrorData);
|
||||
continue;
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error, { itemIndex: i });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [this.helpers.returnJsonArray(returnData)];
|
||||
return this.prepareOutputData(returnData);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user