mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)
This commit is contained in:
@@ -9,6 +9,23 @@ import {
|
||||
|
||||
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
async function getMetadata(
|
||||
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
oauthTokenData: IDataObject,
|
||||
) {
|
||||
const credentials = await this.getCredentials('mailchimpOAuth2Api');
|
||||
const options: OptionsWithUrl = {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `OAuth ${oauthTokenData.access_token}`,
|
||||
},
|
||||
method: 'GET',
|
||||
url: credentials.metadataUrl as string,
|
||||
json: true,
|
||||
};
|
||||
return this.helpers.request(options);
|
||||
}
|
||||
|
||||
export async function mailchimpApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
endpoint: string,
|
||||
@@ -55,7 +72,6 @@ export async function mailchimpApiRequest(
|
||||
);
|
||||
|
||||
options.url = `${api_endpoint}/3.0${endpoint}`;
|
||||
//@ts-ignore
|
||||
return await this.helpers.requestOAuth2.call(this, 'mailchimpOAuth2Api', options, {
|
||||
tokenType: 'Bearer',
|
||||
});
|
||||
@@ -100,23 +116,6 @@ export function validateJSON(json: string | undefined): any {
|
||||
return result;
|
||||
}
|
||||
|
||||
async function getMetadata(
|
||||
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
oauthTokenData: IDataObject,
|
||||
) {
|
||||
const credentials = await this.getCredentials('mailchimpOAuth2Api');
|
||||
const options: OptionsWithUrl = {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `OAuth ${oauthTokenData.access_token}`,
|
||||
},
|
||||
method: 'GET',
|
||||
url: credentials.metadataUrl as string,
|
||||
json: true,
|
||||
};
|
||||
return this.helpers.request(options);
|
||||
}
|
||||
|
||||
export const campaignFieldsMetadata = [
|
||||
'*',
|
||||
'campaigns.id',
|
||||
|
||||
Reference in New Issue
Block a user