fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)

This commit is contained in:
Michael Kret
2023-02-28 05:39:43 +02:00
committed by GitHub
parent 3172ea376e
commit bb4db58819
560 changed files with 2227 additions and 1919 deletions

View File

@@ -14,6 +14,7 @@ import type {
INodeExecutionData,
INodeProperties,
IPollFunctions,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
@@ -72,7 +73,7 @@ export async function notionApiRequest(
json: true,
};
options = Object.assign({}, options, option);
if (Object.keys(body).length === 0) {
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
if (!uri) {
@@ -80,7 +81,7 @@ export async function notionApiRequest(
}
return await this.helpers.request(options);
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -107,7 +108,7 @@ export async function notionApiRequestAllItems(
} else {
body.start_cursor = next_cursor;
}
returnData.push.apply(returnData, responseData[propertyName]);
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
if (query.limit && query.limit <= returnData.length) {
return returnData;
}
@@ -192,23 +193,20 @@ function getLink(text: { textLink: string; isLink: boolean }) {
return {};
}
function getTexts(
texts: [
{
textType: string;
text: string;
isLink: boolean;
range: boolean;
textLink: string;
mentionType: string;
dateStart: string;
dateEnd: string;
date: string;
annotationUi: IDataObject;
expression: string;
},
],
) {
type TextData = {
textType: string;
text: string;
isLink: boolean;
range: boolean;
textLink: string;
mentionType: string;
dateStart: string;
dateEnd: string;
date: string;
annotationUi: IDataObject;
expression: string;
};
function getTexts(texts: TextData[]) {
const results = [];
for (const text of texts) {
if (text.textType === 'text') {
@@ -261,7 +259,7 @@ function getTextBlocks(block: IDataObject) {
text:
block.richText === false
? formatText(block.textContent as string).text
: getTexts(((block.text as IDataObject).text as any) || []),
: getTexts(((block.text as IDataObject).text as TextData[]) || []),
};
}
@@ -305,7 +303,7 @@ function getPropertyKeyValue(
if (value.richText === false) {
result = { rich_text: [{ text: { content: value.textContent } }] };
} else {
result = { rich_text: getTexts(value.text.text) };
result = { rich_text: getTexts(value.text.text as TextData[]) };
}
break;
case 'title':
@@ -324,10 +322,10 @@ function getPropertyKeyValue(
result = {
type: 'relation',
relation: value.relationValue
.filter((relation: any) => {
.filter((relation: IDataObject) => {
return relation && typeof relation === 'string';
})
.reduce((acc: [], cur: any) => {
.reduce((acc: string[], cur: string) => {
return acc.concat(cur.split(',').map((relation: string) => relation.trim()));
}, [])
.filter((relation: string) => {
@@ -384,21 +382,21 @@ function getPropertyKeyValue(
};
break;
case 'date':
const format = getDateFormat(value.includeTime);
const format = getDateFormat(value.includeTime as boolean);
const timezoneValue = value.timezone === 'default' ? timezone : value.timezone;
if (value.range === true) {
result = {
type: 'date',
date: {
start: moment.tz(value.dateStart, timezoneValue).format(format),
end: moment.tz(value.dateEnd, timezoneValue).format(format),
start: moment.tz(value.dateStart as number, timezoneValue as string).format(format),
end: moment.tz(value.dateEnd as number, timezoneValue as string).format(format),
},
};
} else {
result = {
type: 'date',
date: {
start: moment.tz(value.date, timezoneValue).format(format),
start: moment.tz(value.date as number, timezoneValue as string).format(format),
end: null,
},
};
@@ -448,7 +446,13 @@ export function mapProperties(
(property) =>
[
`${property.key.split('|')[0]}`,
getPropertyKeyValue.call(this, property, property.key.split('|')[1], timezone, version),
getPropertyKeyValue.call(
this,
property,
property.key.split('|')[1] as string,
timezone,
version,
),
] as const,
)
.filter(([, value]) => value)
@@ -472,7 +476,7 @@ export function mapSorting(data: SortData[]) {
export function mapFilters(filtersList: IDataObject[], timezone: string) {
return filtersList.reduce((obj, value: { [key: string]: any }) => {
let key = getNameAndType(value.key).type;
let key = getNameAndType(value.key as string).type;
let valuePropertyName =
key === 'last_edited_time' ? value[camelCase(key)] : value[`${camelCase(key)}Value`];
@@ -500,16 +504,16 @@ export function mapFilters(filtersList: IDataObject[], timezone: string) {
}
if (value.type === 'formula') {
const vpropertyName = value[`${camelCase(value.returnType)}Value`];
const vpropertyName = value[`${camelCase(value.returnType as string)}Value`];
return Object.assign(obj, {
['property']: getNameAndType(value.key).name,
['property']: getNameAndType(value.key as string).name,
[key]: { [value.returnType]: { [`${value.condition}`]: vpropertyName } },
});
}
return Object.assign(obj, {
['property']: getNameAndType(value.key).name,
['property']: getNameAndType(value.key as string).name,
[key]: { [`${value.condition}`]: valuePropertyName },
});
}, {});
@@ -518,9 +522,9 @@ export function mapFilters(filtersList: IDataObject[], timezone: string) {
function simplifyProperty(property: any) {
let result: any;
const type = (property as IDataObject).type as string;
if (['text'].includes(property.type)) {
if (['text'].includes(property.type as string)) {
result = property.plain_text;
} else if (['rich_text', 'title'].includes(property.type)) {
} else if (['rich_text', 'title'].includes(property.type as string)) {
if (Array.isArray(property[type]) && property[type].length !== 0) {
result = property[type].map((text: any) => simplifyProperty(text) as string).join('');
} else {
@@ -536,32 +540,32 @@ function simplifyProperty(property: any) {
'email',
'phone_number',
'date',
].includes(property.type)
].includes(property.type as string)
) {
result = property[type];
} else if (['created_by', 'last_edited_by', 'select'].includes(property.type)) {
} else if (['created_by', 'last_edited_by', 'select'].includes(property.type as string)) {
result = property[type] ? property[type].name : null;
} else if (['people'].includes(property.type)) {
} else if (['people'].includes(property.type as string)) {
if (Array.isArray(property[type])) {
result = property[type].map((person: any) => person.person?.email || {});
} else {
result = property[type];
}
} else if (['multi_select'].includes(property.type)) {
} else if (['multi_select'].includes(property.type as string)) {
if (Array.isArray(property[type])) {
result = property[type].map((e: IDataObject) => e.name || {});
} else {
result = property[type].options.map((e: IDataObject) => e.name || {});
}
} else if (['relation'].includes(property.type)) {
} else if (['relation'].includes(property.type as string)) {
if (Array.isArray(property[type])) {
result = property[type].map((e: IDataObject) => e.id || {});
} else {
result = property[type].database_id;
}
} else if (['formula'].includes(property.type)) {
} else if (['formula'].includes(property.type as string)) {
result = property[type][property[type].type];
} else if (['rollup'].includes(property.type)) {
} else if (['rollup'].includes(property.type as string)) {
const rollupFunction = property[type].function as string;
if (rollupFunction.startsWith('count') || rollupFunction.includes('empty')) {
result = property[type].number;
@@ -570,13 +574,13 @@ function simplifyProperty(property: any) {
}
} else if (rollupFunction.startsWith('show') && property[type].type === 'array') {
const elements = property[type].array.map(simplifyProperty).flat();
result = rollupFunction === 'show_unique' ? [...new Set(elements)] : elements;
result = rollupFunction === 'show_unique' ? [...new Set(elements as string)] : elements;
}
} else if (['files'].includes(property.type)) {
} else if (['files'].includes(property.type as string)) {
result = property[type].map(
(file: { type: string; [key: string]: any }) => file[file.type].url,
);
} else if (['status'].includes(property.type)) {
} else if (['status'].includes(property.type as string)) {
result = property[type].name;
}
return result;
@@ -584,7 +588,7 @@ function simplifyProperty(property: any) {
export function simplifyProperties(properties: any) {
const results: any = {};
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
results[`${key}`] = simplifyProperty(properties[key]);
}
return results;
@@ -620,20 +624,20 @@ export function simplifyObjects(objects: any, download = false, version = 2) {
} else if (object === 'page' && parent.type === 'database_id') {
results.push({
id,
...(version === 2 ? { name: getPropertyTitle(properties) } : {}),
...(version === 2 ? { name: getPropertyTitle(properties as IDataObject) } : {}),
...(version === 2 ? { url } : {}),
...(version === 2
? { ...prepend('property', simplifyProperties(properties)) }
? { ...prepend('property', simplifyProperties(properties) as IDataObject) }
: { ...simplifyProperties(properties) }),
});
} as IDataObject);
} else if (download && json.object === 'page' && json.parent.type === 'database_id') {
results.push({
json: {
id: json.id,
...(version === 2 ? { name: getPropertyTitle(json.properties) } : {}),
...(version === 2 ? { name: getPropertyTitle(json.properties as IDataObject) } : {}),
...(version === 2 ? { url: json.url } : {}),
...(version === 2
? { ...prepend('property', simplifyProperties(json.properties)) }
? { ...prepend('property', simplifyProperties(json.properties) as IDataObject) }
: { ...simplifyProperties(json.properties) }),
},
binary,
@@ -790,8 +794,19 @@ export function getConditions() {
return elements;
}
export type FileRecord = {
properties: {
[key: string]:
| any
| {
id: string;
type: string;
files: [{ external: { url: string } } | { file: { url: string } }];
};
};
};
// prettier-ignore
export async function downloadFiles(this: IExecuteFunctions | IPollFunctions, records: [{ properties: { [key: string]: any | { id: string; type: string; files: [{ external: { url: string } } | { file: { url: string } }] } } }]): Promise<INodeExecutionData[]> {
export async function downloadFiles(this: IExecuteFunctions | IPollFunctions, records: FileRecord[]): Promise<INodeExecutionData[]> {
const elements: INodeExecutionData[] = [];
for (const record of records) {
@@ -807,10 +822,10 @@ export async function downloadFiles(this: IExecuteFunctions | IPollFunctions, re
'',
{},
{},
file?.file?.url || file?.external?.url,
file?.file?.url as string || file?.external?.url as string,
{ json: false, encoding: null },
);
element.binary![`${key}_${index}`] = await this.helpers.prepareBinaryData(data);
element.binary![`${key}_${index}`] = await this.helpers.prepareBinaryData(data as Buffer);
}
}
}

View File

@@ -216,7 +216,7 @@ export class NotionTrigger implements INodeType {
}
// if something changed after the last check
if (Array.isArray(data) && data.length && Object.keys(data[0]).length !== 0) {
if (Array.isArray(data) && data.length && Object.keys(data[0] as IDataObject).length !== 0) {
do {
body.page_size = 10;
const { results, has_more, next_cursor } = await notionApiRequest.call(
@@ -228,7 +228,7 @@ export class NotionTrigger implements INodeType {
'',
option,
);
records.push(...results);
records.push(...(results as IDataObject[]));
hasMore = has_more;
if (next_cursor !== null) {
body.start_cursor = next_cursor;

View File

@@ -10,6 +10,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';
import type { SortData } from '../GenericFunctions';
import {
extractDatabaseId,
extractDatabaseMentionRLC,
@@ -51,7 +52,7 @@ export class NotionV1 implements INodeType {
extractValue: true,
}) as string;
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
//remove parameters that cannot be set from the API.
if (
![
@@ -62,7 +63,7 @@ export class NotionV1 implements INodeType {
'formula',
'files',
'rollup',
].includes(properties[key].type)
].includes(properties[key].type as string)
) {
returnData.push({
name: `${key} - (${properties[key].type})`,
@@ -87,7 +88,7 @@ export class NotionV1 implements INodeType {
extractValue: true,
}) as string;
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
returnData.push({
name: `${key} - (${properties[key].type})`,
value: `${key}|${properties[key].type}`,
@@ -155,7 +156,7 @@ export class NotionV1 implements INodeType {
parent: { database_id: databaseId },
} = await notionApiRequest.call(this, 'GET', `/pages/${pageId}`);
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
//remove parameters that cannot be set from the API.
if (
![
@@ -165,7 +166,7 @@ export class NotionV1 implements INodeType {
'last_edited_by',
'formula',
'files',
].includes(properties[key].type)
].includes(properties[key].type as string)
) {
returnData.push({
name: `${key} - (${properties[key].type})`,
@@ -254,7 +255,7 @@ export class NotionV1 implements INodeType {
);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(block),
this.helpers.returnJsonArray(block as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -288,7 +289,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -305,7 +306,7 @@ export class NotionV1 implements INodeType {
responseData = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -333,7 +334,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -379,7 +380,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -394,7 +395,7 @@ export class NotionV1 implements INodeType {
}) as string;
const returnAll = this.getNodeParameter('returnAll', i);
const filters = this.getNodeParameter('options.filter', i, {}) as IDataObject;
const sort = this.getNodeParameter('options.sort.sortValue', i, []) as IDataObject[];
const sort = this.getNodeParameter('options.sort.sortValue', i, []) as SortData[];
const body: IDataObject = {
filter: {},
};
@@ -418,7 +419,6 @@ export class NotionV1 implements INodeType {
delete body.filter;
}
if (sort) {
//@ts-expect-error
body.sorts = mapSorting(sort);
}
if (returnAll) {
@@ -446,7 +446,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -477,7 +477,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -492,7 +492,7 @@ export class NotionV1 implements INodeType {
responseData = await notionApiRequest.call(this, 'GET', `/users/${userId}`);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -510,7 +510,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -549,7 +549,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -566,7 +566,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -619,7 +619,7 @@ export class NotionV1 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);

View File

@@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow';
import { jsonParse, NodeApiError } from 'n8n-workflow';
import type { SortData } from '../GenericFunctions';
import type { SortData, FileRecord } from '../GenericFunctions';
import {
downloadFiles,
extractDatabaseId,
@@ -55,7 +55,7 @@ export class NotionV2 implements INodeType {
extractValue: true,
}) as string;
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
//remove parameters that cannot be set from the API.
if (
![
@@ -65,7 +65,7 @@ export class NotionV2 implements INodeType {
'last_edited_by',
'formula',
'rollup',
].includes(properties[key].type)
].includes(properties[key].type as string)
) {
returnData.push({
name: `${key}`,
@@ -90,7 +90,7 @@ export class NotionV2 implements INodeType {
extractValue: true,
}) as string;
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
returnData.push({
name: `${key}`,
value: `${key}|${properties[key].type}`,
@@ -161,7 +161,7 @@ export class NotionV2 implements INodeType {
parent: { database_id: databaseId },
} = await notionApiRequest.call(this, 'GET', `/pages/${pageId}`);
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
//remove parameters that cannot be set from the API.
if (
![
@@ -171,7 +171,7 @@ export class NotionV2 implements INodeType {
'last_edited_by',
'formula',
'rollup',
].includes(properties[key].type)
].includes(properties[key].type as string)
) {
returnData.push({
name: `${key}`,
@@ -261,7 +261,7 @@ export class NotionV2 implements INodeType {
);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(block),
this.helpers.returnJsonArray(block as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -302,7 +302,7 @@ export class NotionV2 implements INodeType {
}));
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -323,7 +323,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -355,7 +355,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -407,7 +407,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -422,7 +422,7 @@ export class NotionV2 implements INodeType {
}) as string;
const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`);
let titleKey = '';
for (const key of Object.keys(properties)) {
for (const key of Object.keys(properties as IDataObject)) {
if (properties[key].type === 'title') {
titleKey = key;
}
@@ -479,7 +479,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -498,7 +498,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -569,14 +569,14 @@ export class NotionV2 implements INodeType {
responseData = responseData.results;
}
if (download) {
responseData = await downloadFiles.call(this, responseData);
responseData = await downloadFiles.call(this, responseData as FileRecord[]);
}
if (simple) {
responseData = simplifyObjects(responseData, download);
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -607,7 +607,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -622,7 +622,7 @@ export class NotionV2 implements INodeType {
responseData = await notionApiRequest.call(this, 'GET', `/users/${userId}`);
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -640,7 +640,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -663,7 +663,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -700,7 +700,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);
@@ -751,7 +751,7 @@ export class NotionV2 implements INodeType {
}
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
this.helpers.returnJsonArray(responseData as IDataObject),
{ itemData: { item: i } },
);
returnData.push(...executionData);