mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -7,7 +7,7 @@ import type {
|
||||
|
||||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { IDataObject, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
// Interface in n8n
|
||||
@@ -176,7 +176,7 @@ export async function apiRequest(
|
||||
try {
|
||||
return await this.helpers.request(options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2024,7 +2024,11 @@ export class Telegram implements INodeType {
|
||||
);
|
||||
|
||||
const fileName = filePath.split('/').pop();
|
||||
const data = await this.helpers.prepareBinaryData(file.body, fileName);
|
||||
|
||||
const data = await this.helpers.prepareBinaryData(
|
||||
file.body as Buffer,
|
||||
fileName as string,
|
||||
);
|
||||
|
||||
returnData.push({
|
||||
json: responseData,
|
||||
@@ -2035,7 +2039,7 @@ export class Telegram implements INodeType {
|
||||
}
|
||||
} else if (resource === 'chat' && operation === 'administrators') {
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData.result),
|
||||
this.helpers.returnJsonArray(responseData.result as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
@@ -2043,7 +2047,7 @@ export class Telegram implements INodeType {
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
|
||||
@@ -164,7 +164,6 @@ export class TelegramTrigger implements INodeType {
|
||||
],
|
||||
};
|
||||
|
||||
// @ts-ignore (because of request)
|
||||
webhookMethods = {
|
||||
default: {
|
||||
async checkExists(this: IHookFunctions): Promise<boolean> {
|
||||
@@ -281,7 +280,7 @@ export class TelegramTrigger implements INodeType {
|
||||
|
||||
const binaryData = await this.helpers.prepareBinaryData(
|
||||
data as unknown as Buffer,
|
||||
fileName,
|
||||
fileName as string,
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user