mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -2,7 +2,7 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { JsonObject, IDataObject } from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function philipsHueApiRequest(
|
||||
@@ -30,7 +30,7 @@ export async function philipsHueApiRequest(
|
||||
options.headers = Object.assign({}, options.headers, headers);
|
||||
}
|
||||
|
||||
if (Object.keys(body).length === 0) {
|
||||
if (Object.keys(body as IDataObject).length === 0) {
|
||||
delete options.body;
|
||||
}
|
||||
|
||||
@@ -38,20 +38,19 @@ export async function philipsHueApiRequest(
|
||||
delete options.qs;
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
const response = await this.helpers.requestOAuth2.call(this, 'philipsHueOAuth2Api', options, {
|
||||
tokenType: 'Bearer',
|
||||
});
|
||||
return response;
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
export async function getUser(this: IExecuteFunctions | ILoadOptionsFunctions): Promise<any> {
|
||||
const { whitelist } = await philipsHueApiRequest.call(this, 'GET', '/api/0/config', {}, {});
|
||||
//check if there is a n8n user
|
||||
for (const user of Object.keys(whitelist)) {
|
||||
for (const user of Object.keys(whitelist as IDataObject)) {
|
||||
if (whitelist[user].name === 'n8n') {
|
||||
return user;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user