fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { OptionsWithUri } from 'request';
|
||||
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { IDataObject, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
@@ -48,10 +48,14 @@ export async function googleApiRequest(
|
||||
const [message, ...rest] = parsedError.error.message.split('\n');
|
||||
const description = rest.join('\n');
|
||||
const httpCode = parsedError.error.code;
|
||||
throw new NodeApiError(this.getNode(), error, { message, description, httpCode });
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject, {
|
||||
message,
|
||||
description,
|
||||
httpCode,
|
||||
});
|
||||
}
|
||||
}
|
||||
throw new NodeApiError(this.getNode(), error, { message: error.message });
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject, { message: error.message });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,16 +79,16 @@ export async function googleApiRequestAllItems(
|
||||
query.offset = 0;
|
||||
|
||||
responseData = await googleApiRequest.call(this, method, endpoint, body, query, uri);
|
||||
rows = rows.concat(responseData.rows);
|
||||
rows = rows.concat(responseData.rows as IDataObject[]);
|
||||
query.offset = rows.length;
|
||||
|
||||
while (responseData.rowCount > rows.length) {
|
||||
responseData = await googleApiRequest.call(this, method, endpoint, body, query, uri);
|
||||
rows = rows.concat(responseData.rows);
|
||||
rows = rows.concat(responseData.rows as IDataObject[]);
|
||||
query.offset = rows.length;
|
||||
}
|
||||
responseData.rows = rows;
|
||||
returnData.push(responseData);
|
||||
returnData.push(responseData as IDataObject);
|
||||
} else {
|
||||
do {
|
||||
responseData = await googleApiRequest.call(this, method, endpoint, body, query, uri);
|
||||
@@ -94,7 +98,7 @@ export async function googleApiRequestAllItems(
|
||||
} else {
|
||||
body.pageToken = responseData.nextPageToken;
|
||||
}
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
|
||||
} while (
|
||||
(responseData.nextPageToken !== undefined && responseData.nextPageToken !== '') ||
|
||||
responseData[propertyName]?.[0].nextPageToken !== undefined
|
||||
|
||||
Reference in New Issue
Block a user