n8n-3867-progressively-apply-prettier-to-all (#3873)

* 🔨 formatting nodes with prettier
This commit is contained in:
Michael Kret
2022-08-17 18:50:24 +03:00
committed by GitHub
parent f2d326c7f0
commit 91d7e16c81
1072 changed files with 42357 additions and 59109 deletions

View File

@@ -1,17 +1,20 @@
import {
OptionsWithUri,
} from 'request';
import { OptionsWithUri } from 'request';
import {
IExecuteFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import {
IDataObject, NodeApiError,
} from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function philipsHueApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, headers: IDataObject = {}): Promise<any> { // tslint:disable-line:no-any
export async function philipsHueApiRequest(
this: IExecuteFunctions | ILoadOptionsFunctions,
method: string,
resource: string,
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
uri?: string,
headers: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const options: OptionsWithUri = {
headers: {
'Content-Type': 'application/json',
@@ -36,14 +39,18 @@ export async function philipsHueApiRequest(this: IExecuteFunctions | ILoadOption
}
//@ts-ignore
const response = await this.helpers.requestOAuth2.call(this, 'philipsHueOAuth2Api', options, { tokenType: 'Bearer' });
const response = await this.helpers.requestOAuth2.call(this, 'philipsHueOAuth2Api', options, {
tokenType: 'Bearer',
});
return response;
} catch (error) {
throw new NodeApiError(this.getNode(), error);
}
}
export async function getUser(this: IExecuteFunctions | ILoadOptionsFunctions): Promise<any> { // tslint:disable-line:no-any
export async function getUser(
this: IExecuteFunctions | ILoadOptionsFunctions, // tslint:disable-next-line:no-any
): 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)) {