From 15d81bd10ddabcb1e4d4c768df0952fb8e201af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 17 May 2024 15:56:38 +0200 Subject: [PATCH] fix type errors in workflow, core, nodes-langchain, and nodes-base --- .../nodes/agents/Agent/Agent.node.ts | 6 ++--- .../agents/ConversationalAgent/execute.ts | 2 +- .../agents/OpenAiFunctionsAgent/execute.ts | 2 +- .../agents/PlanAndExecuteAgent/execute.ts | 2 +- .../agents/Agent/agents/ReActAgent/execute.ts | 2 +- .../agents/Agent/agents/SqlAgent/execute.ts | 3 +-- .../agents/Agent/agents/ToolsAgent/execute.ts | 7 ++---- .../OpenAiAssistant/OpenAiAssistant.node.ts | 2 +- .../ChainRetrievalQA/ChainRetrievalQa.node.ts | 2 +- .../V1/ChainSummarizationV1.node.ts | 2 +- .../V2/ChainSummarizationV2.node.ts | 2 +- .../MemoryChatRetriever.node.ts | 4 ++-- .../test/OutputParserStructured.node.test.ts | 4 ++-- .../VectorStoreInMemoryInsert.node.ts | 2 +- .../VectorStorePineconeInsert.node.ts | 2 +- .../VectorStoreQdrant.node.ts | 2 +- .../VectorStoreSupabaseInsert.node.ts | 2 +- .../VectorStoreZepInsert.node.ts | 2 +- .../shared/createVectorStoreNode.ts | 4 ++-- packages/core/src/Secrets.ts | 6 ++--- .../core/test/ObjectStore.manager.test.ts | 14 +++++++----- .../nodes/AgileCrm/GenericFunctions.ts | 2 +- .../nodes/Clockify/GenericFunctions.ts | 2 +- .../nodes/Cloudflare/GenericFunctions.ts | 2 +- .../nodes/Code/test/Code.node.test.ts | 3 +-- .../test/v2/node/channel/create.test.ts | 2 +- .../v2/node/channel/deleteChannel.test.ts | 2 +- .../Discord/test/v2/node/channel/get.test.ts | 3 ++- .../test/v2/node/channel/getAll.test.ts | 2 +- .../test/v2/node/channel/update.test.ts | 2 +- .../test/v2/node/member/getAll.test.ts | 2 +- .../test/v2/node/member/roleAdd.test.ts | 2 +- .../test/v2/node/member/roleRemove.test.ts | 2 +- .../v2/node/message/deleteMessage.test.ts | 2 +- .../Discord/test/v2/node/message/get.test.ts | 2 +- .../test/v2/node/message/getAll.test.ts | 2 +- .../test/v2/node/message/react.test.ts | 2 +- .../Discord/test/v2/node/message/send.test.ts | 2 +- .../test/v2/node/webhook/sendLegacy.test.ts | 2 +- .../nodes/GoToWebinar/GenericFunctions.ts | 2 +- .../test/v2/node/executeQuery.test.ts | 2 +- .../test/v2/node/insert.autoMapMode.test.ts | 2 +- .../test/v2/node/insert.manualMode.test.ts | 2 +- .../Drive/test/v2/node/drive/create.test.ts | 2 +- .../test/v2/node/drive/deleteDrive.test.ts | 2 +- .../Drive/test/v2/node/drive/get.test.ts | 2 +- .../Drive/test/v2/node/drive/list.test.ts | 5 +++-- .../Drive/test/v2/node/drive/update.test.ts | 2 +- .../Drive/test/v2/node/file/move.test.ts | 1 + .../Drive/test/v2/node/file/upload.test.ts | 1 + .../test/v2/node/fileFolder/search.test.ts | 1 + .../Drive/test/v2/node/folder/create.test.ts | 2 +- .../test/v2/node/folder/deleteFolder.test.ts | 4 ++-- .../Drive/test/v2/node/folder/share.test.ts | 2 +- .../GoogleFirebaseCloudFirestore.node.ts | 6 ++--- .../nodes/Google/Gmail/GenericFunctions.ts | 3 --- .../nodes/Google/Gmail/v2/GmailV2.node.ts | 6 ++--- .../nodes/Google/Sheet/v1/GenericFunctions.ts | 2 +- .../Sheet/v2/helpers/GoogleSheets.utils.ts | 2 +- .../nodes/Hubspot/V1/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Line/GenericFunctions.ts | 2 +- .../nodes/Matrix/GenericFunctions.ts | 1 - .../nodes-base/nodes/Matrix/Matrix.node.ts | 2 +- .../Excel/test/v2/node/table/addTable.test.ts | 2 +- .../Excel/test/v2/node/table/append.test.ts | 2 +- .../test/v2/node/table/convertToRange.test.ts | 2 +- .../test/v2/node/table/deleteTable.test.ts | 2 +- .../Excel/test/v2/node/table/getRows.test.ts | 2 +- .../Excel/test/v2/node/table/lookup.test.ts | 2 +- .../v2/node/workbook/addWorksheet.test.ts | 2 +- .../v2/node/workbook/deleteWorkbook.test.ts | 2 +- .../test/v2/node/workbook/getAll.test.ts | 2 +- .../test/v2/node/worksheet/append.test.ts | 1 + .../test/v2/node/worksheet/clear.test.ts | 2 +- .../v2/node/worksheet/deleteWorksheet.test.ts | 2 +- .../test/v2/node/worksheet/getAll.test.ts | 2 +- .../test/v2/node/worksheet/readRows.test.ts | 1 + .../test/v2/node/worksheet/update.test.ts | 1 + .../test/v2/node/worksheet/upsert.test.ts | 1 + .../test/v2/node/folderMessage/getAll.test.ts | 2 +- .../Microsoft/Outlook/v1/GenericFunctions.ts | 22 +------------------ .../nodes/Microsoft/Sql/MicrosoftSql.node.ts | 2 +- .../actions/chatMessage/create.operation.ts | 7 +----- .../Microsoft/Teams/v2/actions/router.ts | 1 - .../nodes/MySql/test/v2/runQueries.test.ts | 1 + .../Peekalink/test/Peekalink.node.test.ts | 10 +++++++-- .../nodes/QuickBooks/GenericFunctions.ts | 7 +----- .../nodes/QuickBooks/QuickBooks.node.ts | 6 ++--- .../nodes/SeaTable/GenericFunctions.ts | 4 ++-- .../nodes/Snowflake/GenericFunctions.ts | 2 +- .../nodes/Supabase/GenericFunctions.ts | 1 - .../nodes/Supabase/RowDescription.ts | 2 -- .../nodes/TheHive/QueryFunctions.ts | 8 +++---- .../nodes/TheHiveProject/actions/router.ts | 2 +- .../nodes/UProc/GenericFunctions.ts | 1 - .../Venafi/ProtectCloud/GenericFunctions.ts | 1 - .../VenafiTlsProtectCloud.node.ts | 2 -- .../nodes/Wufoo/GenericFunctions.ts | 1 - .../Postgres/Postgres.node.functions.test.ts | 2 +- packages/workflow/test/AugmentObject.test.ts | 8 +++---- 100 files changed, 130 insertions(+), 160 deletions(-) diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts index f655ebd2543c0..1d15d718401d4 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/Agent.node.ts @@ -46,7 +46,7 @@ function getInputs( [NodeConnectionType.AiOutputParser]: 'Output Parser', }; - return inputs.map(({ type, filter, required }) => { + return inputs.map(({ type, filter }) => { const input: INodeInputConfiguration = { type, displayName: type in displayNames ? displayNames[type] : undefined, @@ -370,13 +370,13 @@ export class Agent implements INodeType { if (agentType === 'conversationalAgent') { return await conversationalAgentExecute.call(this, nodeVersion); } else if (agentType === 'toolsAgent') { - return await toolsAgentExecute.call(this, nodeVersion); + return await toolsAgentExecute.call(this); } else if (agentType === 'openAiFunctionsAgent') { return await openAiFunctionsAgentExecute.call(this, nodeVersion); } else if (agentType === 'reActAgent') { return await reActAgentAgentExecute.call(this, nodeVersion); } else if (agentType === 'sqlAgent') { - return await sqlAgentAgentExecute.call(this, nodeVersion); + return await sqlAgentAgentExecute.call(this); } else if (agentType === 'planAndExecuteAgent') { return await planAndExecuteAgentExecute.call(this, nodeVersion); } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts index fd14107627de4..2647bcfcfd211 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ConversationalAgent/execute.ts @@ -120,5 +120,5 @@ export async function conversationalAgentExecute( } } - return await this.prepareOutputData(returnData); + return [returnData]; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts index d6173c2847f00..5a58b9a46d227 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.ts @@ -125,5 +125,5 @@ export async function openAiFunctionsAgentExecute( } } - return await this.prepareOutputData(returnData); + return [returnData]; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts index 3957f867cd2ce..21a416426dfa5 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/PlanAndExecuteAgent/execute.ts @@ -100,5 +100,5 @@ export async function planAndExecuteAgentExecute( } } - return await this.prepareOutputData(returnData); + return [returnData]; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts index a2a6392a5ff13..dd958141c9e9a 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ReActAgent/execute.ts @@ -121,5 +121,5 @@ export async function reActAgentAgentExecute( } } - return await this.prepareOutputData(returnData); + return [returnData]; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts index 36bc126868198..1820c0e9117cc 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/SqlAgent/execute.ts @@ -28,7 +28,6 @@ const parseTablesString = (tablesString: string) => export async function sqlAgentAgentExecute( this: IExecuteFunctions, - nodeVersion: number, ): Promise { this.logger.verbose('Executing SQL Agent'); @@ -152,5 +151,5 @@ export async function sqlAgentAgentExecute( } } - return await this.prepareOutputData(returnData); + return [returnData]; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts index 65265f704e54c..11cc3a4de2047 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/execute.ts @@ -39,10 +39,7 @@ function getOutputParserSchema(outputParser: BaseOutputParser): ZodObject { +export async function toolsAgentExecute(this: IExecuteFunctions): Promise { this.logger.verbose('Executing Tools Agent'); const model = await this.getInputConnectionData(NodeConnectionType.AiLanguageModel, 0); @@ -185,5 +182,5 @@ export async function toolsAgentExecute( } } - return await this.prepareOutputData(returnData); + return [returnData]; } diff --git a/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts b/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts index 77fa3911e02f5..449fcd41c493b 100644 --- a/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.ts @@ -392,6 +392,6 @@ export class OpenAiAssistant implements INodeType { } } - return await this.prepareOutputData(returnData); + return [returnData]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts index cc5cba5b7ca9c..8647db9b953be 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.ts @@ -189,6 +189,6 @@ export class ChainRetrievalQa implements INodeType { throw error; } } - return await this.prepareOutputData(returnData); + return [returnData]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts index a5d19432774e8..bc18739647dad 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.ts @@ -258,6 +258,6 @@ export class ChainSummarizationV1 implements INodeType { returnData.push({ json: { response } }); } - return await this.prepareOutputData(returnData); + return [returnData]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts index 9d05b0a7c5115..d441e6f728eb7 100644 --- a/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.ts @@ -425,6 +425,6 @@ export class ChainSummarizationV2 implements INodeType { } } - return await this.prepareOutputData(returnData); + return [returnData]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts index 9d8b220f493fb..6b9bf6203f964 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.ts @@ -98,7 +98,7 @@ export class MemoryChatRetriever implements INodeType { const messages = await memory?.chatHistory.getMessages(); if (simplifyOutput && messages) { - return await this.prepareOutputData(simplifyMessages(messages)); + return [simplifyMessages(messages)]; } const serializedMessages = @@ -107,6 +107,6 @@ export class MemoryChatRetriever implements INodeType { return { json: serializedMessage as unknown as IDataObject }; }) ?? []; - return await this.prepareOutputData(serializedMessages); + return [serializedMessages]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/test/OutputParserStructured.node.test.ts b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/test/OutputParserStructured.node.test.ts index 6daac7ab9d139..b4dd6708eb629 100644 --- a/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/test/OutputParserStructured.node.test.ts +++ b/packages/@n8n/nodes-langchain/nodes/output_parser/OutputParserStructured/test/OutputParserStructured.node.test.ts @@ -1,4 +1,4 @@ -import type { IExecuteFunctions, IWorkflowDataProxyData } from 'n8n-workflow'; +import type { IExecuteFunctions, INode, IWorkflowDataProxyData } from 'n8n-workflow'; import { mock } from 'jest-mock-extended'; import { normalizeItems } from 'n8n-core'; import type { z } from 'zod'; @@ -12,7 +12,7 @@ describe('OutputParserStructured', () => { }); const workflowDataProxy = mock({ $input: mock() }); thisArg.getWorkflowDataProxy.mockReturnValue(workflowDataProxy); - thisArg.getNode.mockReturnValue({ typeVersion: 1.1 }); + thisArg.getNode.mockReturnValue(mock({ typeVersion: 1.1 })); thisArg.addInputData.mockReturnValue({ index: 0 }); thisArg.addOutputData.mockReturnValue(); diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts index c9c1b560b9c17..225201a5e1265 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts @@ -108,6 +108,6 @@ export class VectorStoreInMemoryInsert implements INodeType { clearStore, ); - return await this.prepareOutputData(serializedDocuments); + return [serializedDocuments]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts index b024f9b09bd49..93e3e4d0419fa 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts @@ -134,6 +134,6 @@ export class VectorStorePineconeInsert implements INodeType { pineconeIndex, }); - return await this.prepareOutputData(serializedDocuments); + return [serializedDocuments]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts index f183d1b1fe9e6..7714b800f5ef3 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.ts @@ -46,7 +46,7 @@ export const VectorStoreQdrant = createVectorStoreNode({ methods: { listSearch: { qdrantCollectionsSearch } }, insertFields, sharedFields, - async getVectorStoreClient(context, filter, embeddings, itemIndex) { + async getVectorStoreClient(context, _, embeddings, itemIndex) { const collection = context.getNodeParameter('qdrantCollection', itemIndex, '', { extractValue: true, }) as string; diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts index d2e772af9e4f3..1eae86971a325 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts @@ -122,6 +122,6 @@ export class VectorStoreSupabaseInsert implements INodeType { queryName, }); - return await this.prepareOutputData(serializedDocuments); + return [serializedDocuments]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts index 53606927700b2..6b2581970840f 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts @@ -139,6 +139,6 @@ export class VectorStoreZepInsert implements INodeType { await ZepVectorStore.fromDocuments(processedDocuments, embeddings, zepConfig); - return await this.prepareOutputData(serializedDocuments); + return [serializedDocuments]; } } diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts index e9045bd107309..7eb40d6371040 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/createVectorStoreNode.ts @@ -240,7 +240,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) => void logAiEvent(this, 'n8n.ai.vector.store.searched', { query: prompt }); } - return await this.prepareOutputData(resultData); + return [resultData]; } if (mode === 'insert') { @@ -270,7 +270,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) => } } - return await this.prepareOutputData(resultData); + return [resultData]; } throw new NodeOperationError( diff --git a/packages/core/src/Secrets.ts b/packages/core/src/Secrets.ts index dbe8730dbe6e6..d5693dd8f1634 100644 --- a/packages/core/src/Secrets.ts +++ b/packages/core/src/Secrets.ts @@ -3,7 +3,7 @@ import { ExpressionError } from 'n8n-workflow'; function buildSecretsValueProxy(value: IDataObject): unknown { return new Proxy(value, { - get(target, valueName) { + get(_target, valueName) { if (typeof valueName !== 'string') { return; } @@ -27,7 +27,7 @@ export function getSecretsProxy(additionalData: IWorkflowExecuteAdditionalData): return new Proxy( {}, { - get(target, providerName) { + get(_target, providerName) { if (typeof providerName !== 'string') { return {}; } @@ -35,7 +35,7 @@ export function getSecretsProxy(additionalData: IWorkflowExecuteAdditionalData): return new Proxy( {}, { - get(target2, secretName) { + get(_target2, secretName) { if (typeof secretName !== 'string') { return; } diff --git a/packages/core/test/ObjectStore.manager.test.ts b/packages/core/test/ObjectStore.manager.test.ts index dc91e3322173b..abc1f24c3aa01 100644 --- a/packages/core/test/ObjectStore.manager.test.ts +++ b/packages/core/test/ObjectStore.manager.test.ts @@ -1,7 +1,9 @@ import fs from 'node:fs/promises'; +import { mock } from 'jest-mock-extended'; import { ObjectStoreManager } from '@/BinaryData/ObjectStore.manager'; import { ObjectStoreService } from '@/ObjectStore/ObjectStore.service.ee'; import { isStream } from '@/ObjectStore/utils'; +import type { MetadataResponseHeaders } from '@/ObjectStore/types'; import { mockInstance, toFileId, toStream } from './utils'; jest.mock('fs/promises'); @@ -74,11 +76,13 @@ describe('getMetadata()', () => { const mimeType = 'text/plain'; const fileName = 'file.txt'; - objectStoreService.getMetadata.mockResolvedValue({ - 'content-length': '1', - 'content-type': mimeType, - 'x-amz-meta-filename': fileName, - }); + objectStoreService.getMetadata.mockResolvedValue( + mock({ + 'content-length': '1', + 'content-type': mimeType, + 'x-amz-meta-filename': fileName, + }), + ); const metadata = await objectStoreManager.getMetadata(fileId); diff --git a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts index 69b725adf2ba4..f308b94c90bc0 100644 --- a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts @@ -96,7 +96,7 @@ export async function agileCrmApiRequestAllItems( export async function agileCrmApiRequestUpdate( this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods = 'PUT', - endpoint?: string, + _endpoint?: string, body: any = {}, _query: IDataObject = {}, uri?: string, diff --git a/packages/nodes-base/nodes/Clockify/GenericFunctions.ts b/packages/nodes-base/nodes/Clockify/GenericFunctions.ts index 0a5a09bfff76e..26b3715b65234 100644 --- a/packages/nodes-base/nodes/Clockify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Clockify/GenericFunctions.ts @@ -14,7 +14,7 @@ export async function clockifyApiRequest( body: any = {}, qs: IDataObject = {}, - uri?: string, + _uri?: string, _option: IDataObject = {}, ): Promise { const BASE_URL = 'https://api.clockify.me/api/v1'; diff --git a/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts b/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts index 0ad5801325a0c..3c6fc5c4163c4 100644 --- a/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cloudflare/GenericFunctions.ts @@ -15,7 +15,7 @@ export async function cloudflareApiRequest( resource: string, body = {}, qs: IDataObject = {}, - uri?: string, + _uri?: string, headers: IDataObject = {}, ): Promise { const options: IRequestOptions = { diff --git a/packages/nodes-base/nodes/Code/test/Code.node.test.ts b/packages/nodes-base/nodes/Code/test/Code.node.test.ts index 2b827877e8e34..4331b3b7e879e 100644 --- a/packages/nodes-base/nodes/Code/test/Code.node.test.ts +++ b/packages/nodes-base/nodes/Code/test/Code.node.test.ts @@ -1,7 +1,7 @@ import { anyNumber, mock } from 'jest-mock-extended'; import { NodeVM } from '@n8n/vm2'; import type { IExecuteFunctions, IWorkflowDataProxyData } from 'n8n-workflow'; -import { ApplicationError, NodeHelpers } from 'n8n-workflow'; +import { ApplicationError } from 'n8n-workflow'; import { normalizeItems } from 'n8n-core'; import { Code } from '../Code.node'; import { ValidationError } from '../ValidationError'; @@ -22,7 +22,6 @@ describe('Code Node unit test', () => { const thisArg = mock({ getNode: () => mock(), helpers: { normalizeItems }, - prepareOutputData: NodeHelpers.prepareOutputData, }); const workflowDataProxy = mock({ $input: mock() }); thisArg.getWorkflowDataProxy.mockReturnValue(workflowDataProxy); diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/channel/create.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/channel/create.test.ts index cbd0fbb0771dc..b0e0168a6db84 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/channel/create.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/channel/create.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'POST') { return { id: '1168528323006181417', diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/channel/deleteChannel.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/channel/deleteChannel.test.ts index 75477631a903d..4e80537759021 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/channel/deleteChannel.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/channel/deleteChannel.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'DELETE') { return { id: '1168528323006181417', diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/channel/get.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/channel/get.test.ts index 002e570603652..b5049a3f854c8 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/channel/get.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/channel/get.test.ts @@ -5,10 +5,11 @@ import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers'; import type { WorkflowTestData } from '@test/nodes/types'; import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; +// TODO: use nock const requestApiSpy = jest.spyOn(transport, 'requestApi'); requestApiSpy.mockImplementation( - async (options: IRequestOptions, credentialType: string, endpoint: string) => { + async (_options: IRequestOptions, _credentialType: string, endpoint: string) => { if (endpoint === '/users/@me/guilds') { return { headers: {}, diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/channel/getAll.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/channel/getAll.test.ts index 41c7cb1b5795f..7ad2b24113be5 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/channel/getAll.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/channel/getAll.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'GET') { return [ { diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/channel/update.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/channel/update.test.ts index bd7e7851c67c8..072990d8ff828 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/channel/update.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/channel/update.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string, _) => { if (method === 'PATCH') { return { id: '1168516240332034067', diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/member/getAll.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/member/getAll.test.ts index 13d8297a70974..e84dcd1ad7839 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/member/getAll.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/member/getAll.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'GET') { return [ { diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/member/roleAdd.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/member/roleAdd.test.ts index 836c54158d8fa..0de1100e60b6e 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/member/roleAdd.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/member/roleAdd.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'PUT') { return { success: true, diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/member/roleRemove.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/member/roleRemove.test.ts index e2cb066f13043..a523f6699a925 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/member/roleRemove.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/member/roleRemove.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'DELETE') { return { success: true, diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/message/deleteMessage.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/message/deleteMessage.test.ts index c7810af48fdf4..5afd6c6c30bbc 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/message/deleteMessage.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/message/deleteMessage.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'DELETE') { return { success: true, diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/message/get.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/message/get.test.ts index efea97d9420bd..775a266a61fce 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/message/get.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/message/get.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'GET') { return { id: '1168777380144369718', diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/message/getAll.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/message/getAll.test.ts index 70adce6cf0f4d..8c5a9cc4795d2 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/message/getAll.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/message/getAll.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'GET') { return [ { diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/message/react.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/message/react.test.ts index 780a3029bfb83..52f16534525d0 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/message/react.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/message/react.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'PUT') { return { success: true, diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/message/send.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/message/send.test.ts index 3094cec6e31b1..3ccc3ea598567 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/message/send.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/message/send.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'POST') { return { id: '1168784010269433998', diff --git a/packages/nodes-base/nodes/Discord/test/v2/node/webhook/sendLegacy.test.ts b/packages/nodes-base/nodes/Discord/test/v2/node/webhook/sendLegacy.test.ts index e19917d245692..df93c22b11829 100644 --- a/packages/nodes-base/nodes/Discord/test/v2/node/webhook/sendLegacy.test.ts +++ b/packages/nodes-base/nodes/Discord/test/v2/node/webhook/sendLegacy.test.ts @@ -7,7 +7,7 @@ import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; const discordApiRequestSpy = jest.spyOn(transport, 'discordApiRequest'); -discordApiRequestSpy.mockImplementation(async (method: string, endpoint) => { +discordApiRequestSpy.mockImplementation(async (method: string) => { if (method === 'POST') { return { id: '1168768986385747999', diff --git a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts index 414a0e1cbb4ce..4d85e51375b4c 100644 --- a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts @@ -14,7 +14,7 @@ import moment from 'moment-timezone'; import * as losslessJSON from 'lossless-json'; -function convertLosslessNumber(key: any, value: any) { +function convertLosslessNumber(_: any, value: any) { if (value?.isLosslessNumber) { return value.toString(); } else { diff --git a/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/executeQuery.test.ts b/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/executeQuery.test.ts index 95a52e559d2a5..39cefa7319002 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/executeQuery.test.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/executeQuery.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.autoMapMode.test.ts b/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.autoMapMode.test.ts index 7caccca38f90a..001a06315f202 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.autoMapMode.test.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.autoMapMode.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.manualMode.test.ts b/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.manualMode.test.ts index 6af6c8e51c588..0d0215d5cd594 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.manualMode.test.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/test/v2/node/insert.manualMode.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/create.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/create.test.ts index 55b84d77631d9..42a17bfdad3cb 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/create.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/create.test.ts @@ -36,7 +36,7 @@ describe('test GoogleDriveV2: drive create', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with', async () => { + it('should be called with', async () => { const nodeParameters = { resource: 'drive', name: 'newDrive', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/deleteDrive.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/deleteDrive.test.ts index e18249797ecad..b249195a8a12e 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/deleteDrive.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/deleteDrive.test.ts @@ -26,7 +26,7 @@ describe('test GoogleDriveV2: drive deleteDrive', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with', async () => { + it('should be called with', async () => { const nodeParameters = { resource: 'drive', operation: 'deleteDrive', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/get.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/get.test.ts index d46cb35fb9150..55cb301fcca05 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/get.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/get.test.ts @@ -26,7 +26,7 @@ describe('test GoogleDriveV2: drive get', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with', async () => { + it('should be called with', async () => { const nodeParameters = { resource: 'drive', operation: 'get', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/list.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/list.test.ts index 3d5507386daac..8865e7b303365 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/list.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/list.test.ts @@ -1,4 +1,5 @@ import nock from 'nock'; +import type { IHttpRequestMethods } from 'n8n-workflow'; import * as list from '../../../../v2/actions/drive/list.operation'; @@ -33,7 +34,7 @@ describe('test GoogleDriveV2: drive list', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with limit', async () => { + it('should be called with limit', async () => { const nodeParameters = { resource: 'drive', operation: 'list', @@ -54,7 +55,7 @@ describe('test GoogleDriveV2: drive list', () => { ); }); - it('shuold be called with returnAll true', async () => { + it('should be called with returnAll true', async () => { const nodeParameters = { resource: 'drive', operation: 'list', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/update.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/update.test.ts index 534379fd54eef..d60521cf0057f 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/update.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/drive/update.test.ts @@ -26,7 +26,7 @@ describe('test GoogleDriveV2: drive update', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with', async () => { + it('should be called with', async () => { const nodeParameters = { resource: 'drive', operation: 'update', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/move.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/move.test.ts index ead8e50d666b4..51196a28581ec 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/move.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/move.test.ts @@ -1,4 +1,5 @@ import nock from 'nock'; +import type { IHttpRequestMethods } from 'n8n-workflow'; import * as move from '../../../../v2/actions/file/move.operation'; diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/upload.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/upload.test.ts index abc98839f9a26..1eadf887fd991 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/upload.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/file/upload.test.ts @@ -1,4 +1,5 @@ import nock from 'nock'; +import type { IHttpRequestMethods } from 'n8n-workflow'; import * as upload from '../../../../v2/actions/file/upload.operation'; diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/fileFolder/search.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/fileFolder/search.test.ts index df26385aa44fd..f971edfc30ff7 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/fileFolder/search.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/fileFolder/search.test.ts @@ -1,4 +1,5 @@ import nock from 'nock'; +import type { IHttpRequestMethods } from 'n8n-workflow'; import * as search from '../../../../v2/actions/fileFolder/search.operation'; diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/create.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/create.test.ts index 37858c78dc6be..ec3c17b287aef 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/create.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/create.test.ts @@ -26,7 +26,7 @@ describe('test GoogleDriveV2: folder create', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with', async () => { + it('should be called with', async () => { const nodeParameters = { resource: 'folder', name: 'testFolder 2', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/deleteFolder.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/deleteFolder.test.ts index b141d206a17bf..36c2f0abc265a 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/deleteFolder.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/deleteFolder.test.ts @@ -26,7 +26,7 @@ describe('test GoogleDriveV2: folder deleteFolder', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with PATCH', async () => { + it('should be called with PATCH', async () => { const nodeParameters = { resource: 'folder', operation: 'deleteFolder', @@ -52,7 +52,7 @@ describe('test GoogleDriveV2: folder deleteFolder', () => { ); }); - it('shuold be called with DELETE', async () => { + it('should be called with DELETE', async () => { const nodeParameters = { resource: 'folder', operation: 'deleteFolder', diff --git a/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/share.test.ts b/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/share.test.ts index d5854e38f5698..0f1692caac822 100644 --- a/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/share.test.ts +++ b/packages/nodes-base/nodes/Google/Drive/test/v2/node/folder/share.test.ts @@ -26,7 +26,7 @@ describe('test GoogleDriveV2: folder share', () => { jest.unmock('../../../../v2/transport'); }); - it('shuold be called with', async () => { + it('should be called with', async () => { const nodeParameters = { resource: 'folder', operation: 'share', diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts index 49c76afbb43e1..0ab78a0cf6186 100644 --- a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts @@ -102,7 +102,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType { const projectId = this.getNodeParameter('projectId', 0) as string; const database = this.getNodeParameter('database', 0) as string; const simple = this.getNodeParameter('simple', 0) as boolean; - const documentList = items.map((item: IDataObject, i: number) => { + const documentList = items.map((_: IDataObject, i: number) => { const collection = this.getNodeParameter('collection', i) as string; const documentId = this.getNodeParameter('documentId', i) as string; return `projects/${projectId}/databases/${database}/documents/${collection}/${documentId}`; @@ -221,7 +221,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType { returnData.push(...executionData); } else if (operation === 'delete') { await Promise.all( - items.map(async (item: IDataObject, i: number) => { + items.map(async (_: IDataObject, i: number) => { const projectId = this.getNodeParameter('projectId', i) as string; const database = this.getNodeParameter('database', i) as string; const collection = this.getNodeParameter('collection', i) as string; @@ -332,7 +332,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType { const simple = this.getNodeParameter('simple', 0) as boolean; await Promise.all( - items.map(async (item: IDataObject, i: number) => { + items.map(async (_: IDataObject, i: number) => { const query = this.getNodeParameter('query', i) as string; responseData = await googleApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index 8e0bfa58d4c2f..23172a6879c12 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -477,7 +477,6 @@ export function prepareEmailBody( export async function prepareEmailAttachments( this: IExecuteFunctions, options: IDataObject, - items: INodeExecutionData[], itemIndex: number, ) { const attachmentsList: IDataObject[] = []; @@ -536,7 +535,6 @@ export function unescapeSnippets(items: INodeExecutionData[]) { export async function replyToEmail( this: IExecuteFunctions, - items: INodeExecutionData[], gmailId: string, options: IDataObject, itemIndex: number, @@ -558,7 +556,6 @@ export async function replyToEmail( attachments = await prepareEmailAttachments.call( this, options.attachmentsUi as IDataObject, - items, itemIndex, ); if (attachments.length) { diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts index ab91df91358f8..9fdc9a358ae51 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts @@ -325,7 +325,6 @@ export class GmailV2 implements INodeType { attachments = await prepareEmailAttachments.call( this, options.attachmentsUi as IDataObject, - items, i, ); if (attachments.length) { @@ -374,7 +373,7 @@ export class GmailV2 implements INodeType { const messageIdGmail = this.getNodeParameter('messageId', i) as string; const options = this.getNodeParameter('options', i); - responseData = await replyToEmail.call(this, items, messageIdGmail, options, i); + responseData = await replyToEmail.call(this, messageIdGmail, options, i); } if (operation === 'get') { //https://developers.google.com/gmail/api/v1/reference/users/messages/get @@ -581,7 +580,6 @@ export class GmailV2 implements INodeType { attachments = await prepareEmailAttachments.call( this, options.attachmentsUi as IDataObject, - items, i, ); if (attachments.length) { @@ -793,7 +791,7 @@ export class GmailV2 implements INodeType { const messageIdGmail = this.getNodeParameter('messageId', i) as string; const options = this.getNodeParameter('options', i); - responseData = await replyToEmail.call(this, items, messageIdGmail, options, i); + responseData = await replyToEmail.call(this, messageIdGmail, options, i); } if (operation === 'trash') { //https://developers.google.com/gmail/api/reference/rest/v1/users.threads/trash diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts index c5c3feae78f21..540367aabd085 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts @@ -95,7 +95,7 @@ export async function googleApiRequestAllItems( export function hexToRgb(hex: string) { // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; - hex = hex.replace(shorthandRegex, (m, r, g, b) => { + hex = hex.replace(shorthandRegex, (_, r, g, b) => { return r + r + g + g + b + b; }); diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.ts b/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.ts index be64a34e83e81..828a0fde77f5b 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheets.utils.ts @@ -77,7 +77,7 @@ export function getColumnNumber(colPosition: string): number { export function hexToRgb(hex: string) { // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; - hex = hex.replace(shorthandRegex, (m, r, g, b) => { + hex = hex.replace(shorthandRegex, (_, r, g, b) => { return r + r + g + g + b + b; }); diff --git a/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts index 630ef73f0fb03..9fa600730d182 100644 --- a/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts @@ -78,7 +78,7 @@ export async function hubspotApiRequest( */ export async function hubspotApiRequestAllItems( this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, - propertyName: string, + _propertyName: string, method: IHttpRequestMethods, endpoint: string, // tslint:disable-next-line:no-any diff --git a/packages/nodes-base/nodes/Line/GenericFunctions.ts b/packages/nodes-base/nodes/Line/GenericFunctions.ts index d779bdd3b9457..01ffb695062f5 100644 --- a/packages/nodes-base/nodes/Line/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Line/GenericFunctions.ts @@ -12,7 +12,7 @@ import { NodeApiError } from 'n8n-workflow'; export async function lineApiRequest( this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: IHttpRequestMethods, - resource: string, + _resource: string, body: any = {}, qs: IDataObject = {}, diff --git a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts index cb8370f6bd1dd..112db518da881 100644 --- a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts @@ -57,7 +57,6 @@ export async function matrixApiRequest( export async function handleMatrixCall( this: IExecuteFunctions, - item: IDataObject, index: number, resource: string, operation: string, diff --git a/packages/nodes-base/nodes/Matrix/Matrix.node.ts b/packages/nodes-base/nodes/Matrix/Matrix.node.ts index 4f744252e6eba..5cdb8917aa838 100644 --- a/packages/nodes-base/nodes/Matrix/Matrix.node.ts +++ b/packages/nodes-base/nodes/Matrix/Matrix.node.ts @@ -143,7 +143,7 @@ export class Matrix implements INodeType { for (let i = 0; i < items.length; i++) { try { - const responseData = await handleMatrixCall.call(this, items[i], i, resource, operation); + const responseData = await handleMatrixCall.call(this, i, resource, operation); const executionData = this.helpers.constructExecutionMetaData( this.helpers.returnJsonArray(responseData as IDataObject[]), { itemData: { item: i } }, diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/addTable.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/addTable.test.ts index 44165a998b4e5..cb0054e315e13 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/addTable.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/addTable.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/append.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/append.test.ts index 7762ed48947cd..446abb5b5e5cc 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/append.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/append.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/convertToRange.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/convertToRange.test.ts index 636d991408624..faba8409efc53 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/convertToRange.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/convertToRange.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/deleteTable.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/deleteTable.test.ts index 15f7943c8eae9..62616cf156bac 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/deleteTable.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/deleteTable.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/getRows.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/getRows.test.ts index 78366e91644c8..e9627700c9e70 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/getRows.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/getRows.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/lookup.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/lookup.test.ts index ef2b667d5b0cb..e468b62336570 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/lookup.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/table/lookup.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/addWorksheet.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/addWorksheet.test.ts index b939b19b97faf..2c62bd6967611 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/addWorksheet.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/addWorksheet.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/deleteWorkbook.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/deleteWorkbook.test.ts index 126dad3093624..007f579d21e13 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/deleteWorkbook.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/deleteWorkbook.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/getAll.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/getAll.test.ts index cdb1138e0fb6f..bdcf6a6333c0e 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/getAll.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/workbook/getAll.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/append.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/append.test.ts index d6fc5b4cab310..6a5d2994c3185 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/append.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/append.test.ts @@ -1,5 +1,6 @@ import nock from 'nock'; import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers'; +import type { IHttpRequestMethods } from 'n8n-workflow'; jest.mock('../../../../v2/transport', () => { const originalModule = jest.requireActual('../../../../v2/transport'); diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/clear.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/clear.test.ts index dbb3a0d96dd56..7d60587541932 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/clear.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/clear.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/deleteWorksheet.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/deleteWorksheet.test.ts index e53b95d668d80..06711c01832bb 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/deleteWorksheet.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/deleteWorksheet.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/getAll.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/getAll.test.ts index 445ca6f43431d..dbdd0a2ac7e2b 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/getAll.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/getAll.test.ts @@ -1,4 +1,4 @@ -import type { INodeTypes } from 'n8n-workflow'; +import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow'; import nock from 'nock'; import * as transport from '../../../../v2/transport'; diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/readRows.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/readRows.test.ts index 16b90626e8f79..5b30396c1c371 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/readRows.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/readRows.test.ts @@ -1,5 +1,6 @@ import nock from 'nock'; import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers'; +import type { IHttpRequestMethods } from 'n8n-workflow'; jest.mock('../../../../v2/transport', () => { const originalModule = jest.requireActual('../../../../v2/transport'); diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/update.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/update.test.ts index 4da95e1302bfa..befac7425767b 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/update.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/update.test.ts @@ -1,5 +1,6 @@ import nock from 'nock'; import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers'; +import type { IHttpRequestMethods } from 'n8n-workflow'; jest.mock('../../../../v2/transport', () => { const originalModule = jest.requireActual('../../../../v2/transport'); diff --git a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/upsert.test.ts b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/upsert.test.ts index d370fcbdab143..eb5012e60a695 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/upsert.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/test/v2/node/worksheet/upsert.test.ts @@ -1,5 +1,6 @@ import nock from 'nock'; import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers'; +import type { IHttpRequestMethods } from 'n8n-workflow'; jest.mock('../../../../v2/transport', () => { const originalModule = jest.requireActual('../../../../v2/transport'); diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/test/v2/node/folderMessage/getAll.test.ts b/packages/nodes-base/nodes/Microsoft/Outlook/test/v2/node/folderMessage/getAll.test.ts index aff8f0c203e9c..694bb3d103b0e 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/test/v2/node/folderMessage/getAll.test.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/test/v2/node/folderMessage/getAll.test.ts @@ -10,7 +10,7 @@ jest.mock('../../../../v2/transport', () => { const originalModule = jest.requireActual('../../../../v2/transport'); return { ...originalModule, - microsoftApiRequestAllItems: jest.fn(async function (method: string) { + microsoftApiRequestAllItems: jest.fn(async function () { return [ { '@odata.etag': 'W/"CQAAABYAAABZf4De/LkrSqpPI8eyjUmAAAFW3CAj"', diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts index b29c295f98c19..17d175a46b791 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/v1/GenericFunctions.ts @@ -7,7 +7,7 @@ import type { IRequestOptions, JsonObject, } from 'n8n-workflow'; -import { BINARY_ENCODING, NodeApiError } from 'n8n-workflow'; +import { NodeApiError } from 'n8n-workflow'; export async function microsoftApiRequest( this: IExecuteFunctions | ILoadOptionsFunctions, @@ -222,23 +222,3 @@ export async function downloadAttachments( } return elements; } - -export async function binaryToAttachments( - this: IExecuteFunctions, - attachments: IDataObject[], - items: INodeExecutionData[], - i: number, -) { - return await Promise.all( - attachments.map(async (attachment) => { - const binaryPropertyName = attachment.binaryPropertyName as string; - const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName); - const dataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName); - return { - '@odata.type': '#microsoft.graph.fileAttachment', - name: binaryData.fileName, - contentBytes: dataBuffer.toString(BINARY_ENCODING), - }; - }), - ); -} diff --git a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts index e6c713cdcab3b..b51faa3f8da58 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts @@ -275,7 +275,7 @@ export class MicrosoftSql implements INodeType { responseData = items; } else if (operation === 'update') { const updateKeys = items.map( - (item, index) => this.getNodeParameter('updateKey', index) as string, + (_, index) => this.getNodeParameter('updateKey', index) as string, ); const tables = createTableStruct( diff --git a/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/chatMessage/create.operation.ts b/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/chatMessage/create.operation.ts index 2fbce171bf6d7..fbb5d568395ef 100644 --- a/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/chatMessage/create.operation.ts +++ b/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/chatMessage/create.operation.ts @@ -64,12 +64,7 @@ const displayOptions = { export const description = updateDisplayOptions(displayOptions, properties); -export async function execute( - this: IExecuteFunctions, - i: number, - nodeVersion: number, - instanceId: string, -) { +export async function execute(this: IExecuteFunctions, i: number, instanceId: string) { // https://docs.microsoft.com/en-us/graph/api/channel-post-messages?view=graph-rest-1.0&tabs=http const chatId = this.getNodeParameter('chatId', i, '', { extractValue: true }) as string; diff --git a/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/router.ts b/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/router.ts index 8497958357fea..d3111a95e3462 100644 --- a/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/router.ts +++ b/packages/nodes-base/nodes/Microsoft/Teams/v2/actions/router.ts @@ -46,7 +46,6 @@ export async function router(this: IExecuteFunctions): Promise { const pool = createFakePool(fakeConnection); const mockExecuteFns = createMockExecuteFunction({}, mySqlMockNode); + // @ts-expect-error pool.query = jest.fn(async () => [ [[{ finishedAt: '2023-12-30' }], [{ finishedAt: '2023-12-31' }]], ]); diff --git a/packages/nodes-base/nodes/Peekalink/test/Peekalink.node.test.ts b/packages/nodes-base/nodes/Peekalink/test/Peekalink.node.test.ts index f1262863ce643..a51dc545feba4 100644 --- a/packages/nodes-base/nodes/Peekalink/test/Peekalink.node.test.ts +++ b/packages/nodes-base/nodes/Peekalink/test/Peekalink.node.test.ts @@ -44,7 +44,10 @@ describe('Peekalink Node', () => { typeVersion: 1, position: [960, 380], credentials: { - peekalinkApi: 'token', + peekalinkApi: { + id: '1', + name: 'peekalink', + }, }, }, ], @@ -113,7 +116,10 @@ describe('Peekalink Node', () => { typeVersion: 1, position: [960, 380], credentials: { - peekalinkApi: 'token', + peekalinkApi: { + id: '1', + name: 'peekalink', + }, }, }, ], diff --git a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts index 3f28e2d56a29e..ebf727c3661f9 100644 --- a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts @@ -296,12 +296,7 @@ export async function loadResource(this: ILoadOptionsFunctions, resource: string /** * Populate the `Line` property in a request body. */ -export function processLines( - this: IExecuteFunctions, - body: IDataObject, - lines: IDataObject[], - resource: string, -) { +export function processLines(this: IExecuteFunctions, lines: IDataObject[], resource: string) { lines.forEach((line) => { if (resource === 'bill') { if (line.DetailType === 'AccountBasedExpenseLineDetail') { diff --git a/packages/nodes-base/nodes/QuickBooks/QuickBooks.node.ts b/packages/nodes-base/nodes/QuickBooks/QuickBooks.node.ts index 8d10c9a439fa1..33b94ab11e67f 100644 --- a/packages/nodes-base/nodes/QuickBooks/QuickBooks.node.ts +++ b/packages/nodes-base/nodes/QuickBooks/QuickBooks.node.ts @@ -263,7 +263,7 @@ export class QuickBooks implements INodeType { }, } as IDataObject; - body.Line = processLines.call(this, body, lines, resource); + body.Line = processLines.call(this, lines, resource); const additionalFields = this.getNodeParameter('additionalFields', i); @@ -528,7 +528,7 @@ export class QuickBooks implements INodeType { }, } as IDataObject; - body.Line = processLines.call(this, body, lines, resource); + body.Line = processLines.call(this, lines, resource); const additionalFields = this.getNodeParameter('additionalFields', i); body = populateFields.call(this, body, additionalFields, resource); @@ -688,7 +688,7 @@ export class QuickBooks implements INodeType { }, } as IDataObject; - body.Line = processLines.call(this, body, lines, resource); + body.Line = processLines.call(this, lines, resource); const additionalFields = this.getNodeParameter('additionalFields', i); diff --git a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts index fe431813210f7..b8ffb713279f7 100644 --- a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts @@ -67,7 +67,7 @@ function endpointCtxExpr(ctx: ICtx, endpoint: string): string { return endpoint.replace( /({{ *(access_token|dtable_uuid|server) *}})/g, - (match: string, expr: string, name: TEndpointVariableName) => { + (match: string, _: string, name: TEndpointVariableName) => { return endpointVariables[name] || match; }, ); @@ -228,7 +228,7 @@ export const split = (subject: string): string[] => normalize(subject) .split(/\s*((?:[^\\,]*?(?:\\[\s\S])*)*?)\s*(?:,|$)/) .filter((s) => s.length) - .map((s) => s.replace(/\\([\s\S])/gm, ($0, $1) => $1)); + .map((s) => s.replace(/\\([\s\S])/gm, (_, $1) => $1)); export function columnNamesToArray(columnNames: string): string[] { return columnNames ? split(columnNames).filter(nonInternalPredicate).filter(uniquePredicate) : []; diff --git a/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts b/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts index 6e2d332048b2f..406752a5c5da7 100644 --- a/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Snowflake/GenericFunctions.ts @@ -21,7 +21,7 @@ export async function execute( conn.execute({ sqlText, binds, - complete: (error, stmt, rows) => (error ? reject(error) : resolve(rows)), + complete: (error, _, rows) => (error ? reject(error) : resolve(rows)), }); }); } diff --git a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts index 4366409e2aa19..b66248f9f5e6e 100644 --- a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts @@ -66,7 +66,6 @@ export function getFilters( filterTypeDisplayName = 'Filter', filterFixedCollectionDisplayName = 'Filters', - filterStringDisplayName = 'Filters (String)', mustMatchOptions = [ { name: 'Any Filter', diff --git a/packages/nodes-base/nodes/Supabase/RowDescription.ts b/packages/nodes-base/nodes/Supabase/RowDescription.ts index c1a5a7691da74..d8fb67e6d2c36 100644 --- a/packages/nodes-base/nodes/Supabase/RowDescription.ts +++ b/packages/nodes-base/nodes/Supabase/RowDescription.ts @@ -74,7 +74,6 @@ export const rowFields: INodeProperties[] = [ ...getFilters(['row'], ['update'], { includeNoneOption: false, filterTypeDisplayName: 'Select Type', - filterStringDisplayName: 'Select Condition (String)', filterFixedCollectionDisplayName: 'Select Conditions', mustMatchOptions: [ { @@ -177,7 +176,6 @@ export const rowFields: INodeProperties[] = [ ...getFilters(['row'], ['delete'], { includeNoneOption: false, filterTypeDisplayName: 'Select Type', - filterStringDisplayName: 'Select Condition (String)', filterFixedCollectionDisplayName: 'Select Conditions', mustMatchOptions: [ { diff --git a/packages/nodes-base/nodes/TheHive/QueryFunctions.ts b/packages/nodes-base/nodes/TheHive/QueryFunctions.ts index 40b74d8865904..ad7b88c9ca3bb 100644 --- a/packages/nodes-base/nodes/TheHive/QueryFunctions.ts +++ b/packages/nodes-base/nodes/TheHive/QueryFunctions.ts @@ -29,19 +29,19 @@ export function Eq(field: string, value: any): IQueryObject { return { _field: field, _value: value }; } -export function Gt(field: string, value: any): IQueryObject { +export function Gt(_field: string, value: any): IQueryObject { return { _gt: { field: value } }; } -export function Gte(field: string, value: any): IQueryObject { +export function Gte(_field: string, value: any): IQueryObject { return { _gte: { field: value } }; } -export function Lt(field: string, value: any): IQueryObject { +export function Lt(_field: string, value: any): IQueryObject { return { _lt: { field: value } }; } -export function Lte(field: string, value: any): IQueryObject { +export function Lte(_field: string, value: any): IQueryObject { return { _lte: { field: value } }; } export function And(...criteria: IQueryObject[]): IQueryObject { diff --git a/packages/nodes-base/nodes/TheHiveProject/actions/router.ts b/packages/nodes-base/nodes/TheHiveProject/actions/router.ts index 0cb6866edab5c..03fe0a25e4e28 100644 --- a/packages/nodes-base/nodes/TheHiveProject/actions/router.ts +++ b/packages/nodes-base/nodes/TheHiveProject/actions/router.ts @@ -76,5 +76,5 @@ export async function router(this: IExecuteFunctions): Promise { const options: IHttpRequestOptions = { diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts index de82bd7585ab1..933f8175ccf88 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts @@ -19,7 +19,6 @@ export async function venafiApiRequest( resource: string, body = {}, qs: IDataObject = {}, - uri?: string, option: IDataObject = {}, ): Promise { const operation = this.getNodeParameter('operation', 0); diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts index 25a09ea38a4bd..0a7834b57fed5 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts @@ -301,7 +301,6 @@ export class VenafiTlsProtectCloud implements INodeType { `/outagedetection/v1/certificates/${certificateId}/contents`, {}, qs, - undefined, { encoding: null, json: false, resolveWithFullResponse: true, cert: true }, ); } else { @@ -342,7 +341,6 @@ export class VenafiTlsProtectCloud implements INodeType { `/outagedetection/v1/certificates/${certificateId}/keystore`, body, {}, - undefined, { encoding: null, json: false, resolveWithFullResponse: true }, ); } diff --git a/packages/nodes-base/nodes/Wufoo/GenericFunctions.ts b/packages/nodes-base/nodes/Wufoo/GenericFunctions.ts index 9007d215a8319..0488af024c8c5 100644 --- a/packages/nodes-base/nodes/Wufoo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Wufoo/GenericFunctions.ts @@ -14,7 +14,6 @@ export async function wufooApiRequest( body: any = {}, qs: IDataObject = {}, - uri?: string, option: IDataObject = {}, ): Promise { const credentials = await this.getCredentials('wufooApi'); diff --git a/packages/nodes-base/test/nodes/Postgres/Postgres.node.functions.test.ts b/packages/nodes-base/test/nodes/Postgres/Postgres.node.functions.test.ts index 018d34bdb1c64..8080c711fbfda 100644 --- a/packages/nodes-base/test/nodes/Postgres/Postgres.node.functions.test.ts +++ b/packages/nodes-base/test/nodes/Postgres/Postgres.node.functions.test.ts @@ -53,7 +53,7 @@ describe('pgUpdate', () => { }, ]; - const results = await PostgresFun.pgUpdate(getNodeParam, pgp, db, items); + await PostgresFun.pgUpdate(getNodeParam, pgp, db, items); expect(db.any).toHaveBeenCalledWith( 'update "myschema"."mytable" as t set "id"=v."id","name"=v."name" from (values(1234,\'test\')) as v("id","name") WHERE v."id" = t."id" RETURNING *', diff --git a/packages/workflow/test/AugmentObject.test.ts b/packages/workflow/test/AugmentObject.test.ts index 25cc6d4317b23..fcb126e4ebc18 100644 --- a/packages/workflow/test/AugmentObject.test.ts +++ b/packages/workflow/test/AugmentObject.test.ts @@ -290,7 +290,7 @@ describe('AugmentObject', () => { }); test('should work with complex values on first level', () => { - const originalObject = { + const originalObject: any = { a: { b: { cc: '3', @@ -483,7 +483,7 @@ describe('AugmentObject', () => { test('should be faster than doing a deepCopy', () => { const iterations = 100; - const originalObject: IDataObject = { + const originalObject: any = { a: { b: { c: { @@ -530,7 +530,7 @@ describe('AugmentObject', () => { }); test('should return property descriptors', () => { - const originalObject = { + const originalObject: any = { x: { y: {}, z: {}, @@ -559,7 +559,7 @@ describe('AugmentObject', () => { }); test('should return valid values on `has` calls', () => { - const originalObject = { + const originalObject: any = { x: { y: {}, },