diff --git a/packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.ts b/packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.ts index dd81fa9cfbd50..aa3ce82a965f0 100644 --- a/packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.ts +++ b/packages/@n8n/benchmark/src/n8n-api-client/n8n-api-client.ts @@ -2,7 +2,7 @@ import type { AxiosError, AxiosRequestConfig } from 'axios'; import axios from 'axios'; export class N8nApiClient { - constructor(public readonly apiBaseUrl: string) {} + constructor(readonly apiBaseUrl: string) {} async waitForInstanceToBecomeOnline(): Promise { const HEALTH_ENDPOINT = 'healthz'; diff --git a/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts b/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts index 3bdcd0d1fd094..ab023398169ac 100644 --- a/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.ts @@ -32,14 +32,14 @@ class MemoryChatBufferSingleton { this.memoryBuffer = new Map(); } - public static getInstance(): MemoryChatBufferSingleton { + static getInstance(): MemoryChatBufferSingleton { if (!MemoryChatBufferSingleton.instance) { MemoryChatBufferSingleton.instance = new MemoryChatBufferSingleton(); } return MemoryChatBufferSingleton.instance; } - public async getMemory( + async getMemory( sessionKey: string, memoryParams: BufferWindowMemoryInput, ): Promise { diff --git a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts index 5c507a5196f17..f92c8abd41166 100644 --- a/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts +++ b/packages/@n8n/nodes-langchain/nodes/vector_store/shared/MemoryVectorStoreManager.ts @@ -11,7 +11,7 @@ export class MemoryVectorStoreManager { this.vectorStoreBuffer = new Map(); } - public static getInstance(embeddings: Embeddings): MemoryVectorStoreManager { + static getInstance(embeddings: Embeddings): MemoryVectorStoreManager { if (!MemoryVectorStoreManager.instance) { MemoryVectorStoreManager.instance = new MemoryVectorStoreManager(embeddings); } else { @@ -27,7 +27,7 @@ export class MemoryVectorStoreManager { return MemoryVectorStoreManager.instance; } - public async getVectorStore(memoryKey: string): Promise { + async getVectorStore(memoryKey: string): Promise { let vectorStoreInstance = this.vectorStoreBuffer.get(memoryKey); if (!vectorStoreInstance) { @@ -38,7 +38,7 @@ export class MemoryVectorStoreManager { return vectorStoreInstance; } - public async addDocuments( + async addDocuments( memoryKey: string, documents: Document[], clearStore?: boolean, diff --git a/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts b/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts index 7a5c7baf4631d..fea0d9446911d 100644 --- a/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts +++ b/packages/@n8n/task-runner/src/js-task-runner/built-ins-parser/built-ins-parser.ts @@ -21,7 +21,7 @@ export class BuiltInsParser { /** * Parses which built-in variables are accessed in the given code */ - public parseUsedBuiltIns(code: string): Result { + parseUsedBuiltIns(code: string): Result { return toResult(() => { const wrappedCode = `async function VmCodeWrapper() { ${code} }`; const ast = parse(wrappedCode, { ecmaVersion: 2025, sourceType: 'module' }); diff --git a/packages/@n8n_io/eslint-config/base.js b/packages/@n8n_io/eslint-config/base.js index 629749289a6d5..0864a20a7b786 100644 --- a/packages/@n8n_io/eslint-config/base.js +++ b/packages/@n8n_io/eslint-config/base.js @@ -316,6 +316,11 @@ const config = (module.exports = { */ '@typescript-eslint/return-await': ['error', 'always'], + /** + * https://typescript-eslint.io/rules/explicit-member-accessibility/ + */ + '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }], + // ---------------------------------- // eslint-plugin-import // ---------------------------------- diff --git a/packages/cli/src/collaboration/collaboration.state.ts b/packages/cli/src/collaboration/collaboration.state.ts index f8f606a2adc43..556dee2ace4e7 100644 --- a/packages/cli/src/collaboration/collaboration.state.ts +++ b/packages/cli/src/collaboration/collaboration.state.ts @@ -27,7 +27,7 @@ export class CollaborationState { * After how many minutes of inactivity a user should be removed * as being an active user of a workflow. */ - public readonly inactivityCleanUpTime = 15 * Time.minutes.toMilliseconds; + readonly inactivityCleanUpTime = 15 * Time.minutes.toMilliseconds; constructor(private readonly cache: CacheService) {} diff --git a/packages/cli/src/databases/repositories/test-run.repository.ee.ts b/packages/cli/src/databases/repositories/test-run.repository.ee.ts index 3be1eb379067c..1e889aadc758f 100644 --- a/packages/cli/src/databases/repositories/test-run.repository.ee.ts +++ b/packages/cli/src/databases/repositories/test-run.repository.ee.ts @@ -12,7 +12,7 @@ export class TestRunRepository extends Repository { super(TestRun, dataSource.manager); } - public async createTestRun(testDefinitionId: string) { + async createTestRun(testDefinitionId: string) { const testRun = this.create({ status: 'new', testDefinition: { id: testDefinitionId }, @@ -21,15 +21,15 @@ export class TestRunRepository extends Repository { return await this.save(testRun); } - public async markAsRunning(id: string) { + async markAsRunning(id: string) { return await this.update(id, { status: 'running', runAt: new Date() }); } - public async markAsCompleted(id: string, metrics: AggregatedTestRunMetrics) { + async markAsCompleted(id: string, metrics: AggregatedTestRunMetrics) { return await this.update(id, { status: 'completed', completedAt: new Date(), metrics }); } - public async getMany(testDefinitionId: string, options: ListQuery.Options) { + async getMany(testDefinitionId: string, options: ListQuery.Options) { const findManyOptions: FindManyOptions = { where: { testDefinition: { id: testDefinitionId } }, order: { createdAt: 'DESC' }, diff --git a/packages/cli/src/environments/source-control/source-control-export.service.ee.ts b/packages/cli/src/environments/source-control/source-control-export.service.ee.ts index 9c495bbb8d21b..03352410f435f 100644 --- a/packages/cli/src/environments/source-control/source-control-export.service.ee.ts +++ b/packages/cli/src/environments/source-control/source-control-export.service.ee.ts @@ -71,7 +71,7 @@ export class SourceControlExportService { } } - public rmFilesFromExportFolder(filesToBeDeleted: Set): Set { + rmFilesFromExportFolder(filesToBeDeleted: Set): Set { try { filesToBeDeleted.forEach((e) => rmSync(e)); } catch (error) { diff --git a/packages/cli/src/environments/source-control/source-control-import.service.ee.ts b/packages/cli/src/environments/source-control/source-control-import.service.ee.ts index b24fe74530359..2e7da80c13312 100644 --- a/packages/cli/src/environments/source-control/source-control-import.service.ee.ts +++ b/packages/cli/src/environments/source-control/source-control-import.service.ee.ts @@ -65,7 +65,7 @@ export class SourceControlImportService { ); } - public async getRemoteVersionIdsFromFiles(): Promise { + async getRemoteVersionIdsFromFiles(): Promise { const remoteWorkflowFiles = await glob('*.json', { cwd: this.workflowExportFolder, absolute: true, @@ -91,7 +91,7 @@ export class SourceControlImportService { ); } - public async getLocalVersionIdsFromDb(): Promise { + async getLocalVersionIdsFromDb(): Promise { const localWorkflows = await Container.get(WorkflowRepository).find({ select: ['id', 'name', 'versionId', 'updatedAt'], }); @@ -119,7 +119,7 @@ export class SourceControlImportService { }) as SourceControlWorkflowVersionId[]; } - public async getRemoteCredentialsFromFiles(): Promise< + async getRemoteCredentialsFromFiles(): Promise< Array > { const remoteCredentialFiles = await glob('*.json', { @@ -146,9 +146,7 @@ export class SourceControlImportService { >; } - public async getLocalCredentialsFromDb(): Promise< - Array - > { + async getLocalCredentialsFromDb(): Promise> { const localCredentials = await Container.get(CredentialsRepository).find({ select: ['id', 'name', 'type'], }); @@ -160,7 +158,7 @@ export class SourceControlImportService { })) as Array; } - public async getRemoteVariablesFromFile(): Promise { + async getRemoteVariablesFromFile(): Promise { const variablesFile = await glob(SOURCE_CONTROL_VARIABLES_EXPORT_FILE, { cwd: this.gitFolder, absolute: true, @@ -174,11 +172,11 @@ export class SourceControlImportService { return []; } - public async getLocalVariablesFromDb(): Promise { + async getLocalVariablesFromDb(): Promise { return await this.variablesService.getAllCached(); } - public async getRemoteTagsAndMappingsFromFile(): Promise<{ + async getRemoteTagsAndMappingsFromFile(): Promise<{ tags: TagEntity[]; mappings: WorkflowTagMapping[]; }> { @@ -197,7 +195,7 @@ export class SourceControlImportService { return { tags: [], mappings: [] }; } - public async getLocalTagsAndMappingsFromDb(): Promise<{ + async getLocalTagsAndMappingsFromDb(): Promise<{ tags: TagEntity[]; mappings: WorkflowTagMapping[]; }> { @@ -210,7 +208,7 @@ export class SourceControlImportService { return { tags: localTags, mappings: localMappings }; } - public async importWorkflowFromWorkFolder(candidates: SourceControlledFile[], userId: string) { + async importWorkflowFromWorkFolder(candidates: SourceControlledFile[], userId: string) { const personalProject = await Container.get(ProjectRepository).getPersonalProjectForUserOrFail(userId); const workflowManager = this.activeWorkflowManager; @@ -297,7 +295,7 @@ export class SourceControlImportService { }>; } - public async importCredentialsFromWorkFolder(candidates: SourceControlledFile[], userId: string) { + async importCredentialsFromWorkFolder(candidates: SourceControlledFile[], userId: string) { const personalProject = await Container.get(ProjectRepository).getPersonalProjectForUserOrFail(userId); const candidateIds = candidates.map((c) => c.id); @@ -371,7 +369,7 @@ export class SourceControlImportService { return importCredentialsResult.filter((e) => e !== undefined); } - public async importTagsFromWorkFolder(candidate: SourceControlledFile) { + async importTagsFromWorkFolder(candidate: SourceControlledFile) { let mappedTags; try { this.logger.debug(`Importing tags from file ${candidate.file}`); @@ -433,7 +431,7 @@ export class SourceControlImportService { return mappedTags; } - public async importVariablesFromWorkFolder( + async importVariablesFromWorkFolder( candidate: SourceControlledFile, valueOverrides?: { [key: string]: string; diff --git a/packages/cli/src/environments/source-control/source-control-preferences.service.ee.ts b/packages/cli/src/environments/source-control/source-control-preferences.service.ee.ts index d3a34d784f28b..7c061b6c3c5be 100644 --- a/packages/cli/src/environments/source-control/source-control-preferences.service.ee.ts +++ b/packages/cli/src/environments/source-control/source-control-preferences.service.ee.ts @@ -41,7 +41,7 @@ export class SourceControlPreferencesService { this.sshKeyName = path.join(this.sshFolder, SOURCE_CONTROL_SSH_KEY_NAME); } - public get sourceControlPreferences(): SourceControlPreferences { + get sourceControlPreferences(): SourceControlPreferences { return { ...this._sourceControlPreferences, connected: this._sourceControlPreferences.connected ?? false, @@ -49,14 +49,14 @@ export class SourceControlPreferencesService { } // merge the new preferences with the existing preferences when setting - public set sourceControlPreferences(preferences: Partial) { + set sourceControlPreferences(preferences: Partial) { this._sourceControlPreferences = SourceControlPreferences.merge( preferences, this._sourceControlPreferences, ); } - public isSourceControlSetup() { + isSourceControlSetup() { return ( this.isSourceControlLicensedAndEnabled() && this.getPreferences().repositoryUrl && diff --git a/packages/cli/src/environments/source-control/source-control.service.ee.ts b/packages/cli/src/environments/source-control/source-control.service.ee.ts index 58c213f03c1b7..e010210262f62 100644 --- a/packages/cli/src/environments/source-control/source-control.service.ee.ts +++ b/packages/cli/src/environments/source-control/source-control.service.ee.ts @@ -81,7 +81,7 @@ export class SourceControlService { }); } - public async sanityCheck(): Promise { + async sanityCheck(): Promise { try { const foldersExisted = sourceControlFoldersExistCheck( [this.gitFolder, this.sshFolder], diff --git a/packages/cli/src/evaluation/test-runner/test-runner.service.ee.ts b/packages/cli/src/evaluation/test-runner/test-runner.service.ee.ts index 36781d6839ebc..9fcbe1de7c5bc 100644 --- a/packages/cli/src/evaluation/test-runner/test-runner.service.ee.ts +++ b/packages/cli/src/evaluation/test-runner/test-runner.service.ee.ts @@ -186,7 +186,7 @@ export class TestRunnerService { /** * Creates a new test run for the given test definition. */ - public async runTest(user: User, test: TestDefinition): Promise { + async runTest(user: User, test: TestDefinition): Promise { const workflow = await this.workflowRepository.findById(test.workflowId); assert(workflow, 'Workflow not found'); diff --git a/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts b/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts index 6c6a928a676b2..3f3cb50b185dd 100644 --- a/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts +++ b/packages/cli/src/eventbus/message-event-bus-writer/message-event-bus-log-writer.ts @@ -70,7 +70,7 @@ export class MessageEventBusLogWriter { this.globalConfig = Container.get(GlobalConfig); } - public get worker(): Worker | undefined { + get worker(): Worker | undefined { return this._worker; } diff --git a/packages/cli/src/executions/execution.service.ts b/packages/cli/src/executions/execution.service.ts index 67eb145b19204..433955254f698 100644 --- a/packages/cli/src/executions/execution.service.ts +++ b/packages/cli/src/executions/execution.service.ts @@ -504,7 +504,7 @@ export class ExecutionService { } } - public async annotate( + async annotate( executionId: string, updateData: ExecutionRequest.ExecutionUpdatePayload, sharedWorkflowIds: string[], diff --git a/packages/cli/src/push/__tests__/websocket.push.test.ts b/packages/cli/src/push/__tests__/websocket.push.test.ts index 209f91b17e4ed..2362e5a0c6854 100644 --- a/packages/cli/src/push/__tests__/websocket.push.test.ts +++ b/packages/cli/src/push/__tests__/websocket.push.test.ts @@ -11,15 +11,15 @@ import { mockInstance } from '@test/mocking'; jest.useFakeTimers(); class MockWebSocket extends EventEmitter { - public isAlive = true; + isAlive = true; - public ping = jest.fn(); + ping = jest.fn(); - public send = jest.fn(); + send = jest.fn(); - public terminate = jest.fn(); + terminate = jest.fn(); - public close = jest.fn(); + close = jest.fn(); } const createMockWebSocket = () => new MockWebSocket() as unknown as jest.Mocked; diff --git a/packages/cli/src/push/index.ts b/packages/cli/src/push/index.ts index 3b29d85242c88..0007001e33355 100644 --- a/packages/cli/src/push/index.ts +++ b/packages/cli/src/push/index.ts @@ -36,7 +36,7 @@ const useWebSockets = config.getEnv('push.backend') === 'websocket'; */ @Service() export class Push extends TypedEmitter { - public isBidirectional = useWebSockets; + isBidirectional = useWebSockets; private backend = useWebSockets ? Container.get(WebSocketPush) : Container.get(SSEPush); diff --git a/packages/cli/src/runners/errors/task-runner-disconnected-error.ts b/packages/cli/src/runners/errors/task-runner-disconnected-error.ts index 3f4f468b1a658..e29958adfba79 100644 --- a/packages/cli/src/runners/errors/task-runner-disconnected-error.ts +++ b/packages/cli/src/runners/errors/task-runner-disconnected-error.ts @@ -2,10 +2,10 @@ import type { TaskRunner } from '@n8n/task-runner'; import { ApplicationError } from 'n8n-workflow'; export class TaskRunnerDisconnectedError extends ApplicationError { - public description: string; + description: string; constructor( - public readonly runnerId: TaskRunner['id'], + readonly runnerId: TaskRunner['id'], isCloudDeployment: boolean, ) { super('Node execution failed'); diff --git a/packages/cli/src/runners/errors/task-runner-oom-error.ts b/packages/cli/src/runners/errors/task-runner-oom-error.ts index f846d98768f8b..5c78bef816dbc 100644 --- a/packages/cli/src/runners/errors/task-runner-oom-error.ts +++ b/packages/cli/src/runners/errors/task-runner-oom-error.ts @@ -3,10 +3,10 @@ import { ApplicationError } from 'n8n-workflow'; import type { TaskRunner } from '../task-broker.service'; export class TaskRunnerOomError extends ApplicationError { - public description: string; + description: string; constructor( - public readonly runnerId: TaskRunner['id'], + readonly runnerId: TaskRunner['id'], isCloudDeployment: boolean, ) { super('Node ran out of memory.', { level: 'error' }); diff --git a/packages/cli/src/runners/errors/task-runner-restart-loop-error.ts b/packages/cli/src/runners/errors/task-runner-restart-loop-error.ts index b788d83808c80..fa02430adeb0b 100644 --- a/packages/cli/src/runners/errors/task-runner-restart-loop-error.ts +++ b/packages/cli/src/runners/errors/task-runner-restart-loop-error.ts @@ -2,8 +2,8 @@ import { ApplicationError } from 'n8n-workflow'; export class TaskRunnerRestartLoopError extends ApplicationError { constructor( - public readonly howManyTimes: number, - public readonly timePeriodMs: number, + readonly howManyTimes: number, + readonly timePeriodMs: number, ) { const message = `Task runner has restarted ${howManyTimes} times within ${timePeriodMs / 1000} seconds. This is an abnormally high restart rate that suggests a bug or other issue is preventing your runner process from starting up. If this issues persists, please file a report at: https://github.com/n8n-io/n8n/issues`; diff --git a/packages/cli/src/runners/node-process-oom-detector.ts b/packages/cli/src/runners/node-process-oom-detector.ts index e6debb8551c39..a97df32974146 100644 --- a/packages/cli/src/runners/node-process-oom-detector.ts +++ b/packages/cli/src/runners/node-process-oom-detector.ts @@ -6,7 +6,7 @@ import type { ChildProcess } from 'node:child_process'; * memory (OOMs). */ export class NodeProcessOomDetector { - public get didProcessOom() { + get didProcessOom() { return this._didProcessOom; } diff --git a/packages/cli/src/runners/sliding-window-signal.ts b/packages/cli/src/runners/sliding-window-signal.ts index 5954f7bade2b1..3e88f0df95752 100644 --- a/packages/cli/src/runners/sliding-window-signal.ts +++ b/packages/cli/src/runners/sliding-window-signal.ts @@ -36,7 +36,7 @@ export class SlidingWindowSignal { + async getSignal(): Promise { const timeSinceLastEvent = Date.now() - this.lastSignalTime; if (timeSinceLastEvent <= this.windowSizeInMs) return this.lastSignal; diff --git a/packages/cli/src/runners/task-runner-process.ts b/packages/cli/src/runners/task-runner-process.ts index d989107718b1f..2716383f17430 100644 --- a/packages/cli/src/runners/task-runner-process.ts +++ b/packages/cli/src/runners/task-runner-process.ts @@ -28,17 +28,17 @@ export type TaskRunnerProcessEventMap = { */ @Service() export class TaskRunnerProcess extends TypedEmitter { - public get isRunning() { + get isRunning() { return this.process !== null; } /** The process ID of the task runner process */ - public get pid() { + get pid() { return this.process?.pid; } /** Promise that resolves when the process has exited */ - public get runPromise() { + get runPromise() { return this._runPromise; } diff --git a/packages/cli/src/runners/task-runner-server.ts b/packages/cli/src/runners/task-runner-server.ts index 62039faf749cc..2b1f481b0e338 100644 --- a/packages/cli/src/runners/task-runner-server.ts +++ b/packages/cli/src/runners/task-runner-server.ts @@ -31,7 +31,7 @@ export class TaskRunnerServer { readonly app: express.Application; - public get port() { + get port() { return (this.server?.address() as AddressInfo)?.port; } diff --git a/packages/cli/src/sso/saml/saml.service.ee.ts b/packages/cli/src/sso/saml/saml.service.ee.ts index ce69a39e6d0ad..3672c8fe6ff23 100644 --- a/packages/cli/src/sso/saml/saml.service.ee.ts +++ b/packages/cli/src/sso/saml/saml.service.ee.ts @@ -68,7 +68,7 @@ export class SamlService { }, }; - public get samlPreferences(): SamlPreferences { + get samlPreferences(): SamlPreferences { return { ...this._samlPreferences, loginEnabled: isSamlLoginEnabled(), diff --git a/packages/cli/src/webhooks/__tests__/webhook-form-data.test.ts b/packages/cli/src/webhooks/__tests__/webhook-form-data.test.ts index 1b43143d382d1..8eb308f7e45c0 100644 --- a/packages/cli/src/webhooks/__tests__/webhook-form-data.test.ts +++ b/packages/cli/src/webhooks/__tests__/webhook-form-data.test.ts @@ -14,7 +14,7 @@ jest.unmock('node:fs'); /** Test server for testing the form data parsing */ class TestServer { - public agent: TestAgent; + agent: TestAgent; private app: express.Application; diff --git a/packages/core/src/CreateNodeAsTool.ts b/packages/core/src/CreateNodeAsTool.ts index 7c67b6ac58386..a84c56421048f 100644 --- a/packages/core/src/CreateNodeAsTool.ts +++ b/packages/core/src/CreateNodeAsTool.ts @@ -388,7 +388,7 @@ class AIParametersParser { * Creates a DynamicStructuredTool from a node. * @returns A DynamicStructuredTool instance. */ - public createTool(): DynamicStructuredTool { + createTool(): DynamicStructuredTool { const { node, nodeType } = this.options; const schema = this.getSchema(); const description = this.getDescription(); diff --git a/packages/core/src/decorators/__tests__/memoized.test.ts b/packages/core/src/decorators/__tests__/memoized.test.ts index f29ea4d4694b1..053138c60cbbd 100644 --- a/packages/core/src/decorators/__tests__/memoized.test.ts +++ b/packages/core/src/decorators/__tests__/memoized.test.ts @@ -53,7 +53,7 @@ describe('Memoized Decorator', () => { class InvalidClass { // @ts-expect-error this code will fail at compile time and at runtime @Memoized - public normalProperty = 42; + normalProperty = 42; } new InvalidClass(); }).toThrow(AssertionError);