From 1dc894e279a61ff4905565eb7aa79e7cb13af610 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 18 Jul 2024 21:56:20 +0300 Subject: [PATCH] server-esm: Fix the remaining compilation errors --- spec/support/etapi.ts | 2 +- src/app.ts | 2 +- src/routes/routes.ts | 2 +- src/services/branches.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/support/etapi.ts b/spec/support/etapi.ts index 00310d9cc..15f32c7f3 100644 --- a/spec/support/etapi.ts +++ b/spec/support/etapi.ts @@ -210,7 +210,7 @@ function checkStatus(response: Response): void { } } -export { +export default { describeEtapi, getEtapi, getEtapiResponse, diff --git a/src/app.ts b/src/app.ts index def1b9341..e6da1bcfe 100644 --- a/src/app.ts +++ b/src/app.ts @@ -20,7 +20,7 @@ if (!utils.isElectron()) { app.use(compression()); // HTTP compression } -app.use(helmet.default({ +app.use(helmet({ hidePoweredBy: false, // errors out in electron contentSecurityPolicy: false, crossOriginEmbedderPolicy: false diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 59dd50b22..578df6cfe 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -106,7 +106,7 @@ function register(app: express.Application) { route(GET, '/login', [auth.checkAppInitialized, auth.checkPasswordSet], loginRoute.loginPage); route(GET, '/set-password', [auth.checkAppInitialized, auth.checkPasswordNotSet], loginRoute.setPasswordPage); - const loginRateLimiter = rateLimit.rateLimit({ + const loginRateLimiter = rateLimit({ windowMs: 15 * 60 * 1000, // 15 minutes max: 10, // limit each IP to 10 requests per windowMs skipSuccessfulRequests: true // successful auth to rate-limited ETAPI routes isn't counted. However, successful auth to /login is still counted! diff --git a/src/services/branches.ts b/src/services/branches.ts index 1344270ff..88454c4ab 100644 --- a/src/services/branches.ts +++ b/src/services/branches.ts @@ -1,6 +1,6 @@ import treeService from "./tree.js"; import sql from "./sql.js"; -import BBranch from "../becca/entities/bbranch.js.js"; +import BBranch from "../becca/entities/bbranch.js"; function moveBranchToNote(branchToMove: BBranch, targetParentNoteId: string) { if (branchToMove.parentNoteId === targetParentNoteId) {