diff --git a/packages/cli/src/Queue.ts b/packages/cli/src/Queue.ts index ba02dc4250..9f82a9b2ad 100644 --- a/packages/cli/src/Queue.ts +++ b/packages/cli/src/Queue.ts @@ -66,7 +66,7 @@ export class Queue { : getRedisStandardClient(Redis, clientConfig, (type + '(bull)') as RedisClientType), }); - this.jobQueue.on('global:progress', (jobId, progress: WebhookResponse) => { + this.jobQueue.on('global:progress', (_jobId, progress: WebhookResponse) => { this.activeExecutions.resolveResponsePromise( progress.executionId, this.decodeWebhookResponse(progress.response), diff --git a/packages/cli/src/WaitingWebhooks.ts b/packages/cli/src/WaitingWebhooks.ts index cf16569b99..ba3d6b4344 100644 --- a/packages/cli/src/WaitingWebhooks.ts +++ b/packages/cli/src/WaitingWebhooks.ts @@ -13,7 +13,6 @@ import type { } from '@/Interfaces'; import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData'; import { ExecutionRepository } from '@db/repositories/execution.repository'; -import { OwnershipService } from './services/ownership.service'; import { Logger } from '@/Logger'; import { ConflictError } from './errors/response-errors/conflict.error'; import { NotFoundError } from './errors/response-errors/not-found.error'; @@ -26,7 +25,6 @@ export class WaitingWebhooks implements IWebhookManager { protected readonly logger: Logger, private readonly nodeTypes: NodeTypes, private readonly executionRepository: ExecutionRepository, - private readonly ownershipService: OwnershipService, ) {} // TODO: implement `getWebhookMethods` for CORS support diff --git a/packages/cli/src/commands/worker.ts b/packages/cli/src/commands/worker.ts index c2aa66bf9f..8bb4fad610 100644 --- a/packages/cli/src/commands/worker.ts +++ b/packages/cli/src/commands/worker.ts @@ -385,7 +385,7 @@ export class Worker extends BaseCommand { app.get( '/healthz', - async (req: express.Request, res: express.Response) => { + async (_req: express.Request, res: express.Response) => { this.logger.debug('Health check started!'); const connection = Db.getConnection(); diff --git a/packages/cli/src/controllers/tags.controller.ts b/packages/cli/src/controllers/tags.controller.ts index f097002eac..beaf1e56e7 100644 --- a/packages/cli/src/controllers/tags.controller.ts +++ b/packages/cli/src/controllers/tags.controller.ts @@ -13,7 +13,7 @@ export class TagsController { // TODO: move this into a new decorator `@IfEnabled('workflowTagsDisabled')` @Middleware() - workflowsEnabledMiddleware(req: Request, res: Response, next: NextFunction) { + workflowsEnabledMiddleware(_req: Request, _res: Response, next: NextFunction) { if (this.config.getEnv('workflowTagsDisabled')) throw new BadRequestError('Workflow tags are disabled'); next(); diff --git a/packages/cli/src/environments/sourceControl/middleware/sourceControlEnabledMiddleware.ee.ts b/packages/cli/src/environments/sourceControl/middleware/sourceControlEnabledMiddleware.ee.ts index 2bf64f7ba9..cc0debe3a5 100644 --- a/packages/cli/src/environments/sourceControl/middleware/sourceControlEnabledMiddleware.ee.ts +++ b/packages/cli/src/environments/sourceControl/middleware/sourceControlEnabledMiddleware.ee.ts @@ -3,7 +3,7 @@ import { Container } from 'typedi'; import { isSourceControlLicensed } from '../sourceControlHelper.ee'; import { SourceControlPreferencesService } from '../sourceControlPreferences.service.ee'; -export const sourceControlLicensedAndEnabledMiddleware: RequestHandler = (req, res, next) => { +export const sourceControlLicensedAndEnabledMiddleware: RequestHandler = (_req, res, next) => { const sourceControlPreferencesService = Container.get(SourceControlPreferencesService); if (sourceControlPreferencesService.isSourceControlLicensedAndEnabled()) { next(); @@ -19,7 +19,7 @@ export const sourceControlLicensedAndEnabledMiddleware: RequestHandler = (req, r } }; -export const sourceControlLicensedMiddleware: RequestHandler = (req, res, next) => { +export const sourceControlLicensedMiddleware: RequestHandler = (_req, res, next) => { if (isSourceControlLicensed()) { next(); } else { diff --git a/packages/cli/src/eventbus/middleware/logStreamingEnabled.middleware.ee.ts b/packages/cli/src/eventbus/middleware/logStreamingEnabled.middleware.ee.ts index 621fe3a5b4..4589032ca1 100644 --- a/packages/cli/src/eventbus/middleware/logStreamingEnabled.middleware.ee.ts +++ b/packages/cli/src/eventbus/middleware/logStreamingEnabled.middleware.ee.ts @@ -6,7 +6,7 @@ export function islogStreamingLicensed(): boolean { return Container.get(License).isLogStreamingEnabled(); } -export const logStreamingLicensedMiddleware: RequestHandler = (req, res, next) => { +export const logStreamingLicensedMiddleware: RequestHandler = (_req, res, next) => { if (islogStreamingLicensed()) { next(); } else { diff --git a/packages/cli/src/middlewares/bodyParser.ts b/packages/cli/src/middlewares/bodyParser.ts index f7ee9615b4..d48bf593cc 100644 --- a/packages/cli/src/middlewares/bodyParser.ts +++ b/packages/cli/src/middlewares/bodyParser.ts @@ -17,7 +17,7 @@ const xmlParser = new XmlParser({ }); const payloadSizeMax = config.getEnv('endpoints.payloadSizeMax'); -export const rawBodyReader: RequestHandler = async (req, res, next) => { +export const rawBodyReader: RequestHandler = async (req, _res, next) => { parseIncomingMessage(req); req.readRawBody = async () => { @@ -70,7 +70,7 @@ export const parseBody = async (req: Request) => { } }; -export const bodyParser: RequestHandler = async (req, res, next) => { +export const bodyParser: RequestHandler = async (req, _res, next) => { await parseBody(req); if (!req.body) req.body = {}; next(); diff --git a/packages/cli/src/services/metrics.service.ts b/packages/cli/src/services/metrics.service.ts index 36fb6520f5..aae4652e56 100644 --- a/packages/cli/src/services/metrics.service.ts +++ b/packages/cli/src/services/metrics.service.ts @@ -77,7 +77,7 @@ export class MetricsService extends EventEmitter { } mountMetricsEndpoint(app: express.Application) { - app.get('/metrics', async (req: express.Request, res: express.Response) => { + app.get('/metrics', async (_req: express.Request, res: express.Response) => { const metrics = await promClient.register.metrics(); res.setHeader('Content-Type', promClient.register.contentType); res.send(metrics).end(); diff --git a/packages/cli/src/utils.ts b/packages/cli/src/utils.ts index 028b80b551..f2d99eb0db 100644 --- a/packages/cli/src/utils.ts +++ b/packages/cli/src/utils.ts @@ -91,4 +91,4 @@ export function rightDiff( * Can be used to make sure the type is exhausted * in switch statements or if/else chains. */ -export const assertNever = (value: never) => {}; +export const assertNever = (_value: never) => {}; diff --git a/packages/cli/test/integration/ExternalSecrets/externalSecrets.api.test.ts b/packages/cli/test/integration/ExternalSecrets/externalSecrets.api.test.ts index 6fc394fa8b..1cf03848c5 100644 --- a/packages/cli/test/integration/ExternalSecrets/externalSecrets.api.test.ts +++ b/packages/cli/test/integration/ExternalSecrets/externalSecrets.api.test.ts @@ -240,7 +240,7 @@ describe('POST /external-secrets/providers/:provider', () => { const resp = await authOwnerAgent.post('/external-secrets/providers/dummy').send(testData); expect(resp.status).toBe(200); - const confirmResp = await authOwnerAgent.get('/external-secrets/providers/dummy'); + await authOwnerAgent.get('/external-secrets/providers/dummy'); expect((await getExternalSecretsSettings())?.dummy.settings).toEqual({ username: 'newuser', password: 'testpass', diff --git a/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts b/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts index 390ab89191..00e480f86f 100644 --- a/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts +++ b/packages/cli/test/integration/controllers/invitation/invitation.controller.integration.test.ts @@ -26,7 +26,6 @@ import { import type { User } from '@/databases/entities/User'; import type { UserInvitationResult } from '../../shared/utils/users'; -import { ProjectRepository } from '@/databases/repositories/project.repository'; import { ProjectRelationRepository } from '@/databases/repositories/projectRelation.repository'; describe('InvitationController', () => { @@ -38,12 +37,10 @@ describe('InvitationController', () => { let instanceOwner: User; let userRepository: UserRepository; - let projectRepository: ProjectRepository; let projectRelationRepository: ProjectRelationRepository; beforeAll(async () => { userRepository = Container.get(UserRepository); - projectRepository = Container.get(ProjectRepository); projectRelationRepository = Container.get(ProjectRelationRepository); instanceOwner = await createOwner(); }); diff --git a/packages/cli/test/integration/credentials/credentials.api.ee.test.ts b/packages/cli/test/integration/credentials/credentials.api.ee.test.ts index c711785d91..4ace7b86b3 100644 --- a/packages/cli/test/integration/credentials/credentials.api.ee.test.ts +++ b/packages/cli/test/integration/credentials/credentials.api.ee.test.ts @@ -536,7 +536,7 @@ describe('PUT /credentials/:id/share', () => { test('should respond 200 for non-owned credentials for owners', async () => { const savedCredential = await saveCredential(randomCredentialPayload(), { user: member }); - const response = await authOwnerAgent + await authOwnerAgent .put(`/credentials/${savedCredential.id}/share`) .send({ shareWithIds: [anotherMemberPersonalProject.id] }) .expect(200); diff --git a/packages/cli/test/integration/credentials/credentials.api.test.ts b/packages/cli/test/integration/credentials/credentials.api.test.ts index 9b238d51c9..aa290b04c6 100644 --- a/packages/cli/test/integration/credentials/credentials.api.test.ts +++ b/packages/cli/test/integration/credentials/credentials.api.test.ts @@ -9,7 +9,6 @@ import { ProjectRepository } from '@db/repositories/project.repository'; import type { Project } from '@db/entities/Project'; import { CredentialsRepository } from '@db/repositories/credentials.repository'; import { SharedCredentialsRepository } from '@db/repositories/sharedCredentials.repository'; -import { ProjectService } from '@/services/project.service'; import * as testDb from '../shared/testDb'; import { setupTestServer } from '../shared/utils'; @@ -44,7 +43,6 @@ let authMemberAgent: SuperAgentTest; let projectRepository: ProjectRepository; let sharedCredentialsRepository: SharedCredentialsRepository; -let projectService: ProjectService; beforeEach(async () => { await testDb.truncate(['SharedCredentials', 'Credentials']); @@ -65,7 +63,6 @@ beforeEach(async () => { projectRepository = Container.get(ProjectRepository); sharedCredentialsRepository = Container.get(SharedCredentialsRepository); - projectService = Container.get(ProjectService); }); type GetAllResponse = { body: { data: ListQuery.Credentials.WithOwnedByAndSharedWith[] } }; diff --git a/packages/cli/test/integration/license.api.test.ts b/packages/cli/test/integration/license.api.test.ts index 4bf9dc2995..f00404953b 100644 --- a/packages/cli/test/integration/license.api.test.ts +++ b/packages/cli/test/integration/license.api.test.ts @@ -130,6 +130,5 @@ const DEFAULT_POST_RESPONSE: { data: ILicensePostResponse } = { }, }; -const UNAUTHORIZED_RESPONSE = { status: 'error', message: 'Unauthorized' }; const ACTIVATION_FAILED_MESSAGE = 'Failed to activate license'; const GENERIC_ERROR_MESSAGE = 'Something went wrong'; diff --git a/packages/cli/test/integration/users.api.test.ts b/packages/cli/test/integration/users.api.test.ts index 3c81a2560c..9e968caca4 100644 --- a/packages/cli/test/integration/users.api.test.ts +++ b/packages/cli/test/integration/users.api.test.ts @@ -912,7 +912,7 @@ describe('PATCH /users/:id/role', () => { createTeamProject(), ]); - const [credential1, credential2, credential3] = await Promise.all([ + await Promise.all([ saveCredential(randomCredentialPayload(), { user, role: 'credential:owner', diff --git a/packages/cli/test/integration/variables.test.ts b/packages/cli/test/integration/variables.test.ts index 4a55427000..0cd1ebe824 100644 --- a/packages/cli/test/integration/variables.test.ts +++ b/packages/cli/test/integration/variables.test.ts @@ -306,7 +306,7 @@ describe('PATCH /variables/:id', () => { }); test('should not modify existing variable if one with the same key exists', async () => { - const [var1, var2] = await Promise.all([ + const [var1] = await Promise.all([ createVariable('test1', 'value1'), createVariable(toModify.key, toModify.value), ]); @@ -327,7 +327,7 @@ describe('PATCH /variables/:id', () => { // ---------------------------------------- describe('DELETE /variables/:id', () => { test('should delete a single variable for an owner', async () => { - const [var1, var2, var3] = await Promise.all([ + const [var1] = await Promise.all([ createVariable('test1', 'value1'), createVariable('test2', 'value2'), createVariable('test3', 'value3'), @@ -344,7 +344,7 @@ describe('DELETE /variables/:id', () => { }); test('should not delete a single variable for a member', async () => { - const [var1, var2, var3] = await Promise.all([ + const [var1] = await Promise.all([ createVariable('test1', 'value1'), createVariable('test2', 'value2'), createVariable('test3', 'value3'), diff --git a/packages/cli/test/integration/workflowHistory.api.test.ts b/packages/cli/test/integration/workflowHistory.api.test.ts index 881095d8fb..cfd3921b32 100644 --- a/packages/cli/test/integration/workflowHistory.api.test.ts +++ b/packages/cli/test/integration/workflowHistory.api.test.ts @@ -91,7 +91,7 @@ describe('GET /workflow-history/:workflowId', () => { ), ); - const versions2 = await Promise.all( + await Promise.all( new Array(10).fill(undefined).map(async (_) => await createWorkflowHistoryItem(workflow2.id)), ); diff --git a/packages/cli/test/shared/ExternalSecrets/utils.ts b/packages/cli/test/shared/ExternalSecrets/utils.ts index 068e22576e..93b14e226b 100644 --- a/packages/cli/test/shared/ExternalSecrets/utils.ts +++ b/packages/cli/test/shared/ExternalSecrets/utils.ts @@ -63,7 +63,7 @@ export class DummyProvider extends SecretsProvider { test2: 'value2', }; - async init(settings: SecretsProviderSettings): Promise {} + async init(_settings: SecretsProviderSettings): Promise {} async connect(): Promise { this.state = 'connected'; @@ -101,7 +101,7 @@ export class ErrorProvider extends SecretsProvider { state: SecretsProviderState = 'initializing'; - async init(settings: SecretsProviderSettings): Promise { + async init(_settings: SecretsProviderSettings): Promise { throw new Error(); } @@ -122,11 +122,11 @@ export class ErrorProvider extends SecretsProvider { throw new Error(); } - getSecret(name: string): IDataObject | undefined { + getSecret(_name: string): IDataObject | undefined { throw new Error(); } - hasSecret(name: string): boolean { + hasSecret(_name: string): boolean { throw new Error(); } @@ -144,7 +144,7 @@ export class FailedProvider extends SecretsProvider { state: SecretsProviderState = 'initializing'; - async init(settings: SecretsProviderSettings): Promise {} + async init(_settings: SecretsProviderSettings): Promise {} async connect(): Promise { this.state = 'error'; @@ -185,7 +185,7 @@ export class TestFailProvider extends SecretsProvider { test2: 'value2', }; - async init(settings: SecretsProviderSettings): Promise {} + async init(_settings: SecretsProviderSettings): Promise {} async connect(): Promise { this.state = 'connected'; diff --git a/packages/cli/test/unit/collaboration/collaboration.service.test.ts b/packages/cli/test/unit/collaboration/collaboration.service.test.ts index bb9041b3b6..3edc080bc9 100644 --- a/packages/cli/test/unit/collaboration/collaboration.service.test.ts +++ b/packages/cli/test/unit/collaboration/collaboration.service.test.ts @@ -44,7 +44,7 @@ describe('CollaborationService', () => { workflowId, }; - const expectActiveUsersChangedMessage = (userIds: string[]) => { + const expectActiveUsersChangedMessage = () => { expect(push.sendToUsers).toHaveBeenCalledWith( 'activeWorkflowUsersChanged', { @@ -77,7 +77,7 @@ describe('CollaborationService', () => { mockUserRepository.getByIds.mockResolvedValueOnce([{ id: userId } as User]); await collaborationService.handleUserMessage(userId, message); - expectActiveUsersChangedMessage([userId]); + expectActiveUsersChangedMessage(); }); }); @@ -102,7 +102,7 @@ describe('CollaborationService', () => { mockUserRepository.getByIds.mockResolvedValueOnce([{ id: userId } as User]); await collaborationService.handleUserMessage(userId, message); - expectActiveUsersChangedMessage([userId]); + expectActiveUsersChangedMessage(); }); }); }); diff --git a/packages/cli/test/unit/decorators/OnShutdown.test.ts b/packages/cli/test/unit/decorators/OnShutdown.test.ts index 1870d95122..efef660a21 100644 --- a/packages/cli/test/unit/decorators/OnShutdown.test.ts +++ b/packages/cli/test/unit/decorators/OnShutdown.test.ts @@ -5,12 +5,11 @@ import { mock } from 'jest-mock-extended'; describe('OnShutdown', () => { let shutdownService: ShutdownService; - let registerSpy: jest.SpyInstance; beforeEach(() => { shutdownService = new ShutdownService(mock()); Container.set(ShutdownService, shutdownService); - registerSpy = jest.spyOn(shutdownService, 'register'); + jest.spyOn(shutdownService, 'register'); }); it('should register a methods that is decorated with OnShutdown', () => { @@ -49,6 +48,7 @@ describe('OnShutdown', () => { }); it('should use the given priority', () => { + // @ts-expect-error We are checking the decorator. class TestClass { @OnShutdown(10) async onShutdown() { diff --git a/packages/cli/test/unit/services/redis.service.test.ts b/packages/cli/test/unit/services/redis.service.test.ts index f6f932a4b8..efa426b84a 100644 --- a/packages/cli/test/unit/services/redis.service.test.ts +++ b/packages/cli/test/unit/services/redis.service.test.ts @@ -12,8 +12,6 @@ function setDefaultConfig() { } const PUBSUB_CHANNEL = 'testchannel'; -const LIST_CHANNEL = 'testlist'; -const STREAM_CHANNEL = 'teststream'; describe('RedisService', () => { beforeAll(async () => { @@ -41,7 +39,7 @@ describe('RedisService', () => { expect(sub).toBeDefined(); const mockHandler = jest.fn(); - mockHandler.mockImplementation((channel: string, message: string) => {}); + mockHandler.mockImplementation((_channel: string, _message: string) => {}); sub.addMessageHandler(PUBSUB_CHANNEL, mockHandler); await sub.subscribe(PUBSUB_CHANNEL); await pub.publish(PUBSUB_CHANNEL, 'test'); diff --git a/packages/cli/test/unit/workflowHistoryHelper.test.ts b/packages/cli/test/unit/workflowHistoryHelper.test.ts index 09849b1437..32a6cdd6f0 100644 --- a/packages/cli/test/unit/workflowHistoryHelper.test.ts +++ b/packages/cli/test/unit/workflowHistoryHelper.test.ts @@ -3,11 +3,10 @@ import config from '@/config'; import { getWorkflowHistoryPruneTime } from '@/workflows/workflowHistory/workflowHistoryHelper.ee'; import { mockInstance } from '../shared/mocking'; -let licenseMock: License; let licensePruneTime = -1; beforeAll(async () => { - licenseMock = mockInstance(License, { + mockInstance(License, { getWorkflowHistoryPruneLimit() { return licensePruneTime; },