refactor(core): Update rule typescript-eslint/no-unused-vars to not error when variable starts with _ (#4523)

*  rule and fixes

*  clean up
This commit is contained in:
Michael Kret 2022-11-08 16:28:21 +02:00 committed by GitHub
parent ebf17e1827
commit 479644a499
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
260 changed files with 366 additions and 695 deletions

View file

@ -283,11 +283,6 @@ const config = (module.exports = {
*/
'@typescript-eslint/no-unused-expressions': 'error',
/**
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
*/
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '_' }],
/**
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
*/
@ -367,7 +362,16 @@ const config = (module.exports = {
*
* Disabled because eslint-plugin-diff fails to catch it. TODO: Revisit.
*/
'@typescript-eslint/no-unused-vars': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
// ----------------------------------
// import

View file

@ -1,7 +1,7 @@
/* eslint-disable import/no-cycle */
/* eslint-disable no-param-reassign */
import { DeleteResult, EntityManager, FindManyOptions, In, Not } from 'typeorm';
import { Db, ICredentialsDb } from '..';
import { DeleteResult, EntityManager, In, Not } from 'typeorm';
import { Db } from '..';
import { RoleService } from '../role/role.service';
import { CredentialsService } from './credentials.service';

View file

@ -52,6 +52,7 @@ export class WorkflowsService {
workflow: WorkflowEntity,
workflowId: string,
tags?: string[],
// eslint-disable-next-line @typescript-eslint/no-unused-vars
forceSave?: boolean,
): Promise<WorkflowEntity> {
const shared = await Db.collections.SharedWorkflow.findOne({

View file

@ -9,7 +9,7 @@ module.exports = {
rules: {
// TODO: remove all the following rules
'eqeqeq': 'off',
eqeqeq: 'off',
'id-denylist': 'off',
'import/extensions': 'off',
'import/order': 'off',
@ -25,10 +25,7 @@ module.exports = {
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/naming-convention': [
'error',
{ selector: 'memberLike', format: null },
],
'@typescript-eslint/naming-convention': ['error', { selector: 'memberLike', format: null }],
'@typescript-eslint/no-duplicate-imports': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
@ -49,7 +46,6 @@ module.exports = {
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
@ -171,4 +167,4 @@ module.exports = {
},
},
],
};
};

View file

@ -1,5 +1,5 @@
import { Request, sign } from 'aws4';
import { ICredentialTestRequest, IHttpRequestMethods } from 'n8n-workflow';
import { ICredentialTestRequest } from 'n8n-workflow';
import {
ICredentialDataDecryptedObject,
ICredentialType,
@ -369,9 +369,3 @@ export class Aws implements ICredentialType {
},
};
}
function queryToString(params: IDataObject) {
return Object.keys(params)
.map((key) => key + '=' + params[key])
.join('&');
}

View file

@ -1,6 +1,5 @@
import {
IAuthenticateGeneric,
ICredentialTestFunction,
ICredentialTestRequest,
ICredentialType,
INodeProperties,

View file

@ -1,6 +1,5 @@
import {
IAuthenticateGeneric,
ICredentialTestFunctions,
ICredentialTestRequest,
ICredentialType,
INodeProperties,

View file

@ -1,9 +1,7 @@
import {
IAuthenticateGeneric,
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';

View file

@ -4,7 +4,6 @@ import {
ICredentialTestRequest,
ICredentialType,
IHttpRequestHelper,
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';

View file

@ -1,9 +1,4 @@
import {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
export class NocoDb implements ICredentialType {
name = 'nocoDb';

View file

@ -1,9 +1,4 @@
import {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
export class NocoDbApiToken implements ICredentialType {
name = 'nocoDbApiToken';

View file

@ -1,6 +1,5 @@
import { BINARY_ENCODING } from 'n8n-core';
import {
IAuthenticateGeneric,
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,

View file

@ -1,5 +1,4 @@
import {
IAuthenticate,
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,

View file

@ -1,11 +1,4 @@
import {
IAuthenticateGeneric,
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
export class TwilioApi implements ICredentialType {
name = 'twilioApi';

View file

@ -1,9 +1,7 @@
import {
IAuthenticateGeneric,
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IHttpRequestOptions,
NodePropertyTypes,
} from 'n8n-workflow';

View file

@ -1,11 +1,8 @@
import {
IAuthenticateGeneric,
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IHttpRequestOptions,
INodeProperties,
NodePropertyTypes,
} from 'n8n-workflow';
export class WhatsAppApi implements ICredentialType {

View file

@ -1,12 +1,6 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import {
IDataObject,
ILoadOptionsFunctions,
INodeProperties,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, ILoadOptionsFunctions, INodeProperties, NodeApiError } from 'n8n-workflow';
import { OptionsWithUri } from 'request';

View file

@ -6,7 +6,7 @@ import {
ILoadOptionsFunctions,
IWebhookFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function acuitySchedulingApiRequest(
this:
@ -21,7 +21,7 @@ export async function acuitySchedulingApiRequest(
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
_option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const authenticationMethod = this.getNodeParameter('authentication', 0);

View file

@ -2,8 +2,6 @@ import {
IDataObject,
IExecuteSingleFunctions,
IHttpRequestOptions,
IN8nHttpFullResponse,
INodeExecutionData,
INodeType,
INodeTypeDescription,
} from 'n8n-workflow';

View file

@ -2,13 +2,7 @@ import { OptionsWithUri } from 'request';
import { BINARY_ENCODING, IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import {
IDataObject,
IHookFunctions,
IWebhookFunctions,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeApiError } from 'n8n-workflow';
export async function affinityApiRequest(
this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions,

View file

@ -103,7 +103,7 @@ export async function agileCrmApiRequestUpdate(
endpoint?: string,
// tslint:disable-next-line:no-any
body: any = {},
query: IDataObject = {},
_query: IDataObject = {},
uri?: string,
// tslint:disable-next-line:no-any
): Promise<any> {

View file

@ -2,9 +2,7 @@ import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
INodeListSearchResult,
INodeType,
INodeTypeDescription,
NodeOperationError,
@ -12,17 +10,6 @@ import {
import { apiRequest, apiRequestAllItems, downloadRecordAttachments } from './GenericFunctions';
interface AirtableBase {
id: string;
name: string;
}
interface AirtableTable {
id: string;
name: string;
description: string;
}
export class Airtable implements INodeType {
description: INodeTypeDescription = {
displayName: 'Airtable',

View file

@ -36,8 +36,6 @@ export async function apiRequest(
option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = await this.getCredentials('airtableApi');
query = query || {};
// For some reason for some endpoints the bearer auth does not work

View file

@ -12,7 +12,7 @@ export async function autopilotApiRequest(
body: any = {},
query: IDataObject = {},
uri?: string,
option: IDataObject = {},
_option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = (await this.getCredentials('autopilotApi')) as IDataObject;

View file

@ -8,7 +8,6 @@ import {
INodeTypeDescription,
JsonObject,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { awsApiRequestREST } from './GenericFunctions';
@ -191,10 +190,10 @@ export class AwsLambda implements INodeType {
);
if (responseData !== null && responseData?.errorMessage !== undefined) {
let errorMessage = responseData.errorMessage;
let _errorMessage = responseData.errorMessage;
if (responseData.stackTrace) {
errorMessage += `\n\nStack trace:\n${responseData.stackTrace}`;
_errorMessage += `\n\nStack trace:\n${responseData.stackTrace}`;
}
throw new NodeApiError(this.getNode(), responseData);

View file

@ -6,8 +6,6 @@ import {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { awsApiRequestSOAP } from './GenericFunctions';

View file

@ -1,9 +1,3 @@
import { URL } from 'url';
import { Request, sign } from 'aws4';
import { OptionsWithUri } from 'request';
import { parseString } from 'xml2js';
import {
@ -13,7 +7,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import { ICredentialDataDecryptedObject, IHttpRequestOptions, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IHttpRequestOptions, NodeApiError } from 'n8n-workflow';
export async function awsApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,

View file

@ -5,13 +5,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import {
deepCopy,
ICredentialDataDecryptedObject,
IDataObject,
IHttpRequestOptions,
INodeExecutionData,
} from 'n8n-workflow';
import { deepCopy, IDataObject, IHttpRequestOptions, INodeExecutionData } from 'n8n-workflow';
import { IRequestBody } from './types';

View file

@ -1,10 +1,6 @@
import {
get,
} from 'lodash';
import { get } from 'lodash';
import {
parseString,
} from 'xml2js';
import { parseString } from 'xml2js';
import {
IExecuteFunctions,
@ -13,12 +9,19 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import {
IDataObject, IHttpRequestOptions, JsonObject, NodeApiError,
} from 'n8n-workflow';
export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
import { IDataObject, IHttpRequestOptions, JsonObject, NodeApiError } from 'n8n-workflow';
export async function awsApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
service: string,
method: string,
path: string,
body?: string | Buffer,
query: IDataObject = {},
headers?: object,
_option: IDataObject = {},
_region?: string,
) {
const credentials = await this.getCredentials('aws');
const requestOptions = {
@ -41,8 +44,28 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I
}
}
export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers?: object, options: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
const response = await awsApiRequest.call(this, service, method, path, body, query, headers, options, region);
export async function awsApiRequestREST(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
service: string,
method: string,
path: string,
body?: string,
query: IDataObject = {},
headers?: object,
options: IDataObject = {},
region?: string,
) {
const response = await awsApiRequest.call(
this,
service,
method,
path,
body,
query,
headers,
options,
region,
);
try {
return JSON.parse(response);
} catch (e) {
@ -50,8 +73,28 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions
}
}
export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
const response = await awsApiRequest.call(this, service, method, path, body, query, headers, option, region);
export async function awsApiRequestSOAP(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
service: string,
method: string,
path: string,
body?: string | Buffer,
query: IDataObject = {},
headers?: object,
option: IDataObject = {},
region?: string,
) {
const response = await awsApiRequest.call(
this,
service,
method,
path,
body,
query,
headers,
option,
region,
);
try {
return await new Promise((resolve, reject) => {
parseString(response, { explicitArray: false }, (err, data) => {
@ -66,8 +109,18 @@ export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions
}
}
export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, propertyName: string, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers: IDataObject = {}, option: IDataObject = {}, region?: string): Promise<any> { // tslint:disable-line:no-any
export async function awsApiRequestSOAPAllItems(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
propertyName: string,
service: string,
method: string,
path: string,
body?: string,
query: IDataObject = {},
headers: IDataObject = {},
option: IDataObject = {},
region?: string,
) {
const returnData: IDataObject[] = [];
let responseData;
@ -75,10 +128,23 @@ export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteF
const propertyNameArray = propertyName.split('.');
do {
responseData = await awsApiRequestSOAP.call(this, service, method, path, body, query, headers, option, region);
responseData = await awsApiRequestSOAP.call(
this,
service,
method,
path,
body,
query,
headers,
option,
region,
);
if (get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextMarker`)) {
query['Marker'] = get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextMarker`);
query['Marker'] = get(
responseData,
`${propertyNameArray[0]}.${propertyNameArray[1]}.NextMarker`,
);
}
if (get(responseData, propertyName)) {
if (Array.isArray(get(responseData, propertyName))) {

View file

@ -334,7 +334,6 @@ export class AwsRekognition implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: IDataObject[] = [];
const qs: IDataObject = {};
let responseData;
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;

View file

@ -1,11 +1,5 @@
import { URL } from 'url';
import { Request, sign } from 'aws4';
import { get } from 'lodash';
import { OptionsWithUri } from 'request';
import { parseString } from 'xml2js';
import {
@ -15,7 +9,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import { IDataObject, IHttpRequestOptions, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, IHttpRequestOptions, NodeApiError } from 'n8n-workflow';
import { pascalCase } from 'change-case';
@ -25,10 +19,10 @@ export async function awsApiRequest(
method: string,
path: string,
body?: string | Buffer | IDataObject,
query: IDataObject = {},
_query: IDataObject = {},
headers?: object,
option: IDataObject = {},
region?: string,
_region?: string,
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = await this.getCredentials('aws');
@ -177,12 +171,6 @@ export async function awsApiRequestSOAPAllItems(
return returnData;
}
function queryToString(params: IDataObject) {
return Object.keys(params)
.map((key) => key + '=' + params[key])
.join('&');
}
export function keysTPascalCase(object: IDataObject) {
const data: IDataObject = {};
for (const key of Object.keys(object)) {

View file

@ -9,12 +9,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import {
IDataObject,
IHttpRequestOptions,
JsonObject,
NodeApiError,
} from 'n8n-workflow';
import { IDataObject, IHttpRequestOptions, JsonObject, NodeApiError } from 'n8n-workflow';
export async function awsApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
@ -25,10 +20,9 @@ export async function awsApiRequest(
query: IDataObject = {},
headers?: object,
option: IDataObject = {},
region?: string,
_region?: string,
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = await this.getCredentials('aws');
const requestOptions = {
qs: {
...query,
@ -174,9 +168,3 @@ export async function awsApiRequestSOAPAllItems(
return returnData;
}
function queryToString(params: IDataObject) {
return Object.keys(params)
.map((key) => key + '=' + params[key])
.join('&');
}

View file

@ -1,9 +1,3 @@
import { URL } from 'url';
import { Request, sign } from 'aws4';
import { OptionsWithUri } from 'request';
import { parseString } from 'xml2js';
import {
@ -13,7 +7,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import { IDataObject, IHttpRequestOptions, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, IHttpRequestOptions, NodeApiError } from 'n8n-workflow';
import { get } from 'lodash';
@ -41,7 +35,7 @@ export async function awsApiRequest(
} as IHttpRequestOptions;
try {
return await this.helpers.requestWithAuthentication.call(this,'aws', requestOptions);
return await this.helpers.requestWithAuthentication.call(this, 'aws', requestOptions);
} catch (error) {
throw new NodeApiError(this.getNode(), error, { parseXml: true });
}
@ -96,9 +90,9 @@ export async function awsApiRequestSOAPAllItems(
path: string,
body?: string,
query: IDataObject = {},
headers: IDataObject = {},
option: IDataObject = {},
region?: string,
_headers: IDataObject = {},
_option: IDataObject = {},
_region?: string,
// tslint:disable-next-line:no-any
): Promise<any> {
const returnData: IDataObject[] = [];

View file

@ -18,7 +18,6 @@ import {
ICredentialTestFunctions,
IHttpRequestOptions,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
function getEndpointForService(

View file

@ -11,12 +11,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import {
ICredentialDataDecryptedObject,
IDataObject,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { ICredentialDataDecryptedObject, IDataObject, NodeApiError } from 'n8n-workflow';
import { get } from 'lodash';
@ -100,9 +95,9 @@ export async function awsApiRequestRESTAllItems(
path: string,
body?: string,
query: IDataObject = {},
headers: IDataObject = {},
option: IDataObject = {},
region?: string,
_headers: IDataObject = {},
_option: IDataObject = {},
_region?: string,
// tslint:disable-next-line:no-any
): Promise<any> {
const returnData: IDataObject[] = [];

View file

@ -6,7 +6,7 @@ import { apiRequest } from '../../../transport';
export async function getAll(
this: IExecuteFunctions,
index: number,
_index: number,
): Promise<INodeExecutionData[]> {
const body: IDataObject = {};
const requestMethod = 'GET';

View file

@ -1,4 +1,4 @@
import { BINARY_ENCODING, IExecuteFunctions } from 'n8n-core';
import { IExecuteFunctions } from 'n8n-core';
import { IBinaryData, IBinaryKeyData, IDataObject, NodeOperationError } from 'n8n-workflow';

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
import { OptionsWithUrl } from 'request';

View file

@ -109,7 +109,6 @@ export class Bannerbear implements INodeType {
const returnData: IDataObject[] = [];
const length = items.length;
let responseData;
const qs: IDataObject = {};
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;
for (let i = 0; i < length; i++) {

View file

@ -2,13 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import {
IDataObject,
IHookFunctions,
IWebhookFunctions,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeApiError } from 'n8n-workflow';
import { snakeCase } from 'change-case';

View file

@ -2,7 +2,7 @@ import { IExecuteFunctions } from 'n8n-core';
import { OptionsWithUri } from 'request';
import { IDataObject, ILoadOptionsFunctions, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, ILoadOptionsFunctions, NodeApiError } from 'n8n-workflow';
import { Accumulator, BaserowCredentials, LoadedResource } from './types';

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeOperationError } from 'n8n-workflow';
import { IDataObject, IHookFunctions, IWebhookFunctions } from 'n8n-workflow';
import { beeminderApiRequest, beeminderApiRequestAllItems } from './GenericFunctions';

View file

@ -5,7 +5,7 @@ import {
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function bitbucketApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function bitlyApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function brandfetchApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -2,7 +2,6 @@ import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
INode,
INodeExecutionData,
INodeType,
INodeTypeDescription,

View file

@ -448,7 +448,7 @@ export class Chargebee implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
let item: INodeExecutionData;
let _item: INodeExecutionData;
const credentials = await this.getCredentials('chargebeeApi');
@ -461,7 +461,7 @@ export class Chargebee implements INodeType {
for (let i = 0; i < items.length; i++) {
try {
item = items[i];
_item = items[i];
const resource = this.getNodeParameter('resource', i) as string;
const operation = this.getNodeParameter('operation', i) as string;

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function circleciApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -1,12 +1,6 @@
import { IHookFunctions, IWebhookFunctions } from 'n8n-core';
import {
IDataObject,
INodeType,
INodeTypeDescription,
IWebhookResponseData,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
import {
getAutomaticSecret,

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function clearbitApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -23,7 +23,7 @@ export async function clickupApiRequest(
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
_option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const options: OptionsWithUri = {

View file

@ -12,7 +12,7 @@ export async function clockifyApiRequest(
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
_option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const BASE_URL = 'https://api.clockify.me/api/v1';

View file

@ -1,5 +1,5 @@
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, jsonParse, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, jsonParse, NodeApiError } from 'n8n-workflow';
import { OptionsWithUri } from 'request';
export async function cockpitApiRequest(

View file

@ -1,6 +1,6 @@
import { OptionsWithUri } from 'request';
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function codaApiRequest(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -2,7 +2,7 @@ import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } fro
import { OptionsWithUri } from 'request';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function contentfulApiRequest(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
@ -12,7 +12,7 @@ export async function contentfulApiRequest(
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
_option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = await this.getCredentials('contentfulApi');

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IHookFunctions, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, IHookFunctions, NodeApiError } from 'n8n-workflow';
export async function convertKitApiRequest(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IHookFunctions,

View file

@ -165,7 +165,6 @@ export class Cortex implements INodeType {
const items = this.getInputData();
const returnData: IDataObject[] = [];
const length = items.length;
const qs: IDataObject = {};
let responseData;
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
import moment from 'moment';

View file

@ -373,7 +373,7 @@ export class CrateDb implements INodeType {
pgp.helpers.update(itemCopy, cs) + pgp.as.format(where, itemCopy) + returning,
);
}
const updateItems = await db.multi(pgp.helpers.concat(queries));
const _updateItems = await db.multi(pgp.helpers.concat(queries));
returnItems = this.helpers.returnJsonArray(getItemsCopy(items, columns) as IDataObject[]);
}
} else {

View file

@ -1,14 +1,6 @@
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { OptionsWithUri } from 'request';
import {
IDataObject,
IHttpRequestMethods,
IHttpRequestOptions,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, IHttpRequestMethods, IHttpRequestOptions, NodeApiError } from 'n8n-workflow';
import { get } from 'lodash';
@ -18,11 +10,9 @@ export async function customerIoApiRequest(
endpoint: string,
body: object,
baseApi?: string,
query?: IDataObject,
// tslint:disable-next-line:no-any
): Promise<any> {
_query?: IDataObject,
) {
const credentials = await this.getCredentials('customerIoApi');
query = query || {};
const options: IHttpRequestOptions = {
headers: {
'Content-Type': 'application/json',

View file

@ -7,7 +7,6 @@ import {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
NodeExecutionWithMetadata,
} from 'n8n-workflow';
import { deepLApiRequest } from './GenericFunctions';
@ -132,10 +131,9 @@ export class DeepL implements INodeType {
const { translations } = await deepLApiRequest.call(this, 'GET', '/translate', body);
const [translation] = translations;
const translationJsonArray = this.helpers.returnJsonArray(translation);
const executionData = this.helpers.constructExecutionMetaData(
translationJsonArray,
{ itemData: { item: i } },
);
const executionData = this.helpers.constructExecutionMetaData(translationJsonArray, {
itemData: { item: i },
});
responseData.push(...executionData);
}
}

View file

@ -7,7 +7,7 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function demioApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -7,7 +7,6 @@ import {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
JsonObject,
} from 'n8n-workflow';
import { discourseApiRequest } from './GenericFunctions';

View file

@ -11,7 +11,7 @@ export async function discourseApiRequest(
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
option = {},
_option = {},
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = (await this.getCredentials('discourseApi')) as { url: string };

View file

@ -577,12 +577,12 @@ export class Disqus implements INodeType {
let endpoint = '';
let requestMethod = '';
let body: IDataObject | Buffer;
let _body: IDataObject | Buffer;
let qs: IDataObject;
for (let i = 0; i < items.length; i++) {
try {
body = {};
_body = {};
qs = {};
if (resource === 'forum') {

View file

@ -5,7 +5,7 @@ import {
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function disqusApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -79,7 +79,6 @@ export class Drift implements INodeType {
const returnData: IDataObject[] = [];
const length = items.length;
let responseData;
const qs: IDataObject = {};
const resource = this.getNodeParameter('resource', 0) as string;
const operation = this.getNodeParameter('operation', 0) as string;
for (let i = 0; i < length; i++) {

View file

@ -2,13 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import {
IDataObject,
IHookFunctions,
IWebhookFunctions,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, IHookFunctions, IWebhookFunctions, NodeApiError } from 'n8n-workflow';
export async function driftApiRequest(
this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions,

View file

@ -1,11 +1,7 @@
import { IExecuteFunctions } from 'n8n-core';
import {
ICredentialDataDecryptedObject,
ICredentialsDecrypted,
ICredentialTestFunctions,
IDataObject,
INodeCredentialTestResult,
INodeExecutionData,
INodeType,
INodeTypeDescription,

View file

@ -1,4 +1,4 @@
import { BINARY_ENCODING, IExecuteFunctions } from 'n8n-core';
import { IExecuteFunctions } from 'n8n-core';
import {
deepCopy,
IDataObject,

View file

@ -34,7 +34,7 @@ export async function egoiApiRequest(
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
headers?: object,
_headers?: object,
// tslint:disable-next-line:no-any
): Promise<any> {
const credentials = await this.getCredentials('egoiApi');

View file

@ -61,7 +61,7 @@ export async function elasticSecurityApiRequestAllItems(
body: IDataObject = {},
qs: IDataObject = {},
) {
let page = 1;
let _page = 1;
const returnData: IDataObject[] = [];
let responseData: any; // tslint:disable-line
@ -69,7 +69,7 @@ export async function elasticSecurityApiRequestAllItems(
do {
responseData = await elasticSecurityApiRequest.call(this, method, endpoint, body, qs);
page++;
_page++;
const items = resource === 'case' ? responseData.cases : responseData;

View file

@ -217,7 +217,7 @@ export class EmailReadImapV1 implements INodeType {
const conn = imapConnect(config).then(async (conn) => {
return conn;
});
(await conn).getBoxes((err, boxes) => {});
(await conn).getBoxes((_err, _boxes) => {});
} catch (error) {
console.log(error);
return {

View file

@ -555,7 +555,7 @@ export class EmailReadImapV2 implements INodeType {
// Connect to the IMAP server and open the mailbox
// that we get informed whenever a new email arrives
return imapConnect(config).then(async (conn) => {
conn.on('close', async (hadError: boolean) => {
conn.on('close', async (_hadError: boolean) => {
if (isCurrentlyReconnecting === true) {
Logger.debug(`Email Read Imap: Connected closed for forced reconnecting`);
} else if (closeFunctionWasCalled === true) {

View file

@ -1,11 +1,5 @@
import { IExecuteFunctions } from 'n8n-core';
import {
IDataObject,
INodeExecutionData,
INodeType,
INodeTypeDescription,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
import { createTransport } from 'nodemailer';
import SMTPTransport from 'nodemailer/lib/smtp-transport';

View file

@ -6,7 +6,6 @@ import {
INodeExecutionData,
INodeType,
INodeTypeDescription,
JsonObject,
} from 'n8n-workflow';
import { emeliaApiTest, emeliaGraphqlRequest, loadResource } from './GenericFunctions';

View file

@ -8,7 +8,7 @@ import {
IWebhookFunctions,
} from 'n8n-core';
import { IDataObject, JsonObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow';
export async function eventbriteApiRequest(
this:

View file

@ -27,7 +27,7 @@ function execPromise(command: string): Promise<IExecReturnData> {
stdout: '',
};
return new Promise((resolve, reject) => {
return new Promise((resolve, _reject) => {
exec(command, { cwd: process.cwd() }, (error, stdout, stderr) => {
returnData.stdout = stdout.trim();
returnData.stderr = stderr.trim();

View file

@ -25,7 +25,7 @@ export async function facebookApiRequest(
body: any = {},
qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
_option: IDataObject = {},
// tslint:disable-next-line:no-any
): Promise<any> {
let credentials;

View file

@ -15,7 +15,7 @@ export async function figmaApiRequest(
resource: string,
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
_qs: IDataObject = {},
uri?: string,
option: IDataObject = {},
// tslint:disable-next-line:no-any

View file

@ -5,7 +5,6 @@ import {
INodeType,
INodeTypeDescription,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { flowApiRequest, FlowApiRequestAllItems } from './GenericFunctions';
import { taskFields, taskOpeations } from './TaskDescription';

View file

@ -1,12 +1,6 @@
import { IHookFunctions, IWebhookFunctions } from 'n8n-core';
import {
IDataObject,
INodeType,
INodeTypeDescription,
IWebhookResponseData,
NodeOperationError,
} from 'n8n-workflow';
import { IDataObject, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
import { flowApiRequest } from './GenericFunctions';

View file

@ -5,7 +5,7 @@ import {
IHookFunctions,
ILoadOptionsFunctions,
} from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
export async function flowApiRequest(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,

View file

@ -2,13 +2,7 @@ import { IHookFunctions, IWebhookFunctions } from 'n8n-core';
import { IDataObject, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
import {
apiRequest,
getFields,
getForms,
getSubmission,
IFormstackWebhookResponseBody,
} from './GenericFunctions';
import { apiRequest, getForms, IFormstackWebhookResponseBody } from './GenericFunctions';
export class FormstackTrigger implements INodeType {
description: INodeTypeDescription = {

View file

@ -32,8 +32,6 @@ import {
agentRoleOperations,
announcementFields,
announcementOperations,
assetFields,
assetOperations,
assetTypeFields,
assetTypeOperations,
changeFields,

View file

@ -15,7 +15,6 @@ import {
getAllItemsViewId,
handleListing,
loadResource,
throwOnEmptyFilter,
throwOnEmptyUpdate,
} from './GenericFunctions';

View file

@ -414,7 +414,6 @@ export class Ftp implements INodeType {
const items = this.getInputData();
// const returnData: IDataObject[] = [];
const returnItems: INodeExecutionData[] = [];
const qs: IDataObject = {};
let responseData;
const operation = this.getNodeParameter('operation', 0) as string;

View file

@ -8,7 +8,6 @@ import {
INodeTypeDescription,
IWebhookResponseData,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import { getresponseApiRequest, getResponseApiRequestAllItems } from './GenericFunctions';

View file

@ -212,11 +212,11 @@ export class Git implements INodeType {
};
const operation = this.getNodeParameter('operation', 0) as string;
let item: INodeExecutionData;
let _item: INodeExecutionData;
const returnItems: INodeExecutionData[] = [];
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
try {
item = items[itemIndex];
_item = items[itemIndex];
const repositoryPath = this.getNodeParameter('repositoryPath', itemIndex, '') as string;
const options = this.getNodeParameter('options', itemIndex, {}) as IDataObject;

View file

@ -5,7 +5,6 @@ import {
INodeExecutionData,
INodeType,
INodeTypeDescription,
IPairedItemData,
NodeOperationError,
} from 'n8n-workflow';

View file

@ -1,6 +1,6 @@
import { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
import { OptionsWithUri } from 'request';
/**

View file

@ -978,15 +978,15 @@ export class Gitlab implements INodeType {
const items = this.getInputData();
const returnData: INodeExecutionData[] = [];
let credentials;
let _credentials;
const authenticationMethod = this.getNodeParameter('authentication', 0);
try {
if (authenticationMethod === 'accessToken') {
credentials = await this.getCredentials('gitlabApi');
_credentials = await this.getCredentials('gitlabApi');
} else {
credentials = await this.getCredentials('gitlabOAuth2Api');
_credentials = await this.getCredentials('gitlabOAuth2Api');
}
} catch (error) {
if (this.continueOnFail()) {

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
import moment from 'moment-timezone';

View file

@ -7,7 +7,6 @@ import {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
JsonObject,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';

View file

@ -8,7 +8,6 @@ import {
IDataObject,
INodeProperties,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';
import moment from 'moment-timezone';

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, NodeApiError } from 'n8n-workflow';
import moment from 'moment-timezone';

View file

@ -2,7 +2,7 @@ import { OptionsWithUri } from 'request';
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { IDataObject, IPollFunctions, NodeApiError, NodeOperationError } from 'n8n-workflow';
import { IDataObject, IPollFunctions, NodeApiError } from 'n8n-workflow';
import moment from 'moment-timezone';

View file

@ -57,7 +57,7 @@ export async function googleApiRequestAllItems(
// tslint:disable-next-line:no-any
body: any = {},
qs: IDataObject = {},
headers: IDataObject = {},
_headers: IDataObject = {},
uri: string | null = null,
// tslint:disable-next-line:no-any
): Promise<any> {

View file

@ -7,7 +7,6 @@ import {
INodePropertyOptions,
INodeType,
INodeTypeDescription,
JsonObject,
NodeApiError,
NodeOperationError,
} from 'n8n-workflow';

View file

@ -2,7 +2,6 @@
import { IExecuteFunctions } from 'n8n-core';
import {
IBinaryKeyData,
IDataObject,
ILoadOptionsFunctions,
INodeExecutionData,
@ -785,9 +784,12 @@ export class GmailV2 implements INodeType {
}
//------------------------------------------------------------------//
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), {
itemData: { item: i },
});
const executionData = this.helpers.constructExecutionMetaData(
this.helpers.returnJsonArray(responseData),
{
itemData: { item: i },
},
);
returnData.push(...executionData);
} catch (error) {
error.message = `${error.message} (item ${i})`;

Some files were not shown because too many files have changed in this diff Show more