fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import type { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import type { IDataObject, IHttpRequestMethods, IHttpRequestOptions } from 'n8n-workflow';
|
||||
import type {
|
||||
IDataObject,
|
||||
IHttpRequestMethods,
|
||||
IHttpRequestOptions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function pushoverApiRequest(
|
||||
@@ -24,12 +29,12 @@ export async function pushoverApiRequest(
|
||||
};
|
||||
|
||||
try {
|
||||
if (Object.keys(body).length === 0) {
|
||||
if (Object.keys(body as IDataObject).length === 0) {
|
||||
delete options.body;
|
||||
}
|
||||
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'pushoverApi', options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ export class Pushover implements INodeType {
|
||||
async getSounds(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const { sounds } = await pushoverApiRequest.call(this, 'GET', '/sounds.json', {});
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
for (const key of Object.keys(sounds)) {
|
||||
for (const key of Object.keys(sounds as IDataObject)) {
|
||||
returnData.push({
|
||||
name: sounds[key],
|
||||
value: key,
|
||||
@@ -373,7 +373,7 @@ export class Pushover implements INodeType {
|
||||
|
||||
responseData = await pushoverApiRequest.call(this, 'POST', '/messages.json', body);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
|
||||
Reference in New Issue
Block a user