Feature/paired item support (#3869)

* Add paired item helper and implement it in some nodes
This commit is contained in:
Omar Ajoue
2022-08-30 17:55:33 +02:00
committed by GitHub
parent 087d3f99f1
commit b2c674591c
150 changed files with 4027 additions and 1625 deletions

View File

@@ -195,7 +195,7 @@ export class OpenWeatherMap implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: IDataObject[] = [];
const returnData: INodeExecutionData[] = [];
const credentials = await this.getCredentials('openWeatherMapApi');
@@ -274,7 +274,11 @@ export class OpenWeatherMap implements INodeType {
throw new NodeApiError(this.getNode(), error);
}
returnData.push(responseData as IDataObject);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
{ itemData: { item: i } },
);
returnData.push(...executionData);
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ json: { error: error.message } });
@@ -284,6 +288,6 @@ export class OpenWeatherMap implements INodeType {
}
}
return [this.helpers.returnJsonArray(returnData)];
return this.prepareOutputData(returnData);
}
}