refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)

This commit is contained in:
Michael Kret
2023-01-13 19:11:56 +02:00
committed by GitHub
parent d7732ea150
commit 6608e69457
254 changed files with 2687 additions and 2675 deletions

View File

@@ -303,7 +303,9 @@ export class Aws implements ICredentialType {
} else if (service) {
endpointString = `https://${service}.${credentials.region}.amazonaws.com`;
}
endpoint = new URL(endpointString!.replace('{region}', credentials.region as string) + path);
endpoint = new URL(
endpointString!.replace('{region}', credentials.region as string) + (path as string),
);
} else {
// If no endpoint is set, we try to decompose the path and use the default endpoint
const customUrl = new URL(`${requestOptions.baseURL!}${requestOptions.url}${path ?? ''}`);

View File

@@ -6,6 +6,12 @@ import {
INodeProperties,
} from 'n8n-workflow';
const getAuthenticationType = (data: string): 'accessToken' | 'apiKey' => {
// The access token is a JWT, so it will always include dots to separate
// header, payoload and signature.
return data.includes('.') ? 'accessToken' : 'apiKey';
};
export class CalendlyApi implements ICredentialType {
name = 'calendlyApi';
@@ -49,9 +55,3 @@ export class CalendlyApi implements ICredentialType {
},
};
}
const getAuthenticationType = (data: string): 'accessToken' | 'apiKey' => {
// The access token is a JWT, so it will always include dots to separate
// header, payoload and signature.
return data.includes('.') ? 'accessToken' : 'apiKey';
};

View File

@@ -27,7 +27,7 @@ export class LemlistApi implements ICredentialType {
credentials: ICredentialDataDecryptedObject,
requestOptions: IHttpRequestOptions,
): Promise<IHttpRequestOptions> {
const encodedApiKey = Buffer.from(':' + credentials.apiKey).toString('base64');
const encodedApiKey = Buffer.from(':' + (credentials.apiKey as string)).toString('base64');
requestOptions.headers!.Authorization = `Basic ${encodedApiKey}`;
requestOptions.headers!['user-agent'] = 'n8n';
return requestOptions;