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

@@ -4,6 +4,12 @@ import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeApiError } from 'n8n-workflow';
/**
* Return the base API URL based on the user's environment.
*/
const getBaseUrl = ({ environment, domain, subdomain }: ERPNextApiCredentials) =>
environment === 'cloudHosted' ? `https://${subdomain}.erpnext.com` : domain;
export async function erpNextApiRequest(
this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions,
method: string,
@@ -24,7 +30,7 @@ export async function erpNextApiRequest(
method,
body,
qs: query,
uri: uri || `${baseUrl}${resource}`,
uri: uri ?? `${baseUrl}${resource}`,
json: true,
rejectUnauthorized: !credentials.allowUnauthorizedCerts,
};
@@ -77,12 +83,6 @@ export async function erpNextApiRequestAllItems(
return returnData;
}
/**
* Return the base API URL based on the user's environment.
*/
const getBaseUrl = ({ environment, domain, subdomain }: ERPNextApiCredentials) =>
environment === 'cloudHosted' ? `https://${subdomain}.erpnext.com` : domain;
type ERPNextApiCredentials = {
apiKey: string;
apiSecret: string;