From 086bd9e9e420852ea4796ffc45d820da87f1475a Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 11 Oct 2026 16:47:26 -0400 Subject: [PATCH] chore: Replace deprecated koa-router with @koa/router v15 (#14042) * chore: Replace deprecated koa-router with @koa/router v15 * fix: Run optional authentication on all auth provider routes --- package.json | 3 +- plugins/azure/server/auth/azure.ts | 2 +- plugins/discord/server/auth/discord.ts | 2 +- plugins/email/server/auth/email.ts | 2 +- plugins/figma/server/api/figma.ts | 2 +- plugins/github/server/api/github.ts | 2 +- plugins/gitlab/server/api/gitlab.ts | 2 +- plugins/google/server/auth/google.ts | 2 +- plugins/linear/server/api/linear.ts | 2 +- plugins/notion/server/api/notion.ts | 2 +- plugins/oidc/server/auth/oidc.ts | 2 +- plugins/oidc/server/auth/oidcRouter.ts | 2 +- plugins/passkeys/server/api/passkeys.ts | 2 +- plugins/passkeys/server/auth/passkeys.ts | 2 +- plugins/slack/server/api/hooks.ts | 2 +- plugins/slack/server/auth/slack.ts | 2 +- plugins/storage/server/api/files.ts | 2 +- .../server/api/webhookSubscriptions.ts | 2 +- server/main.ts | 2 +- .../api/accessRequests/accessRequests.ts | 2 +- server/routes/api/apiKeys/apiKeys.ts | 2 +- server/routes/api/attachments/attachments.ts | 2 +- server/routes/api/auth/auth.ts | 2 +- .../authenticationProviders.ts | 2 +- server/routes/api/batch/batch.ts | 2 +- server/routes/api/collections/collections.ts | 2 +- server/routes/api/comments/comments.ts | 2 +- server/routes/api/cron/cron.ts | 2 +- server/routes/api/developer/developer.ts | 2 +- server/routes/api/documents/documents.ts | 2 +- server/routes/api/emojis/emojis.ts | 2 +- server/routes/api/events/events.ts | 2 +- .../api/fileOperations/fileOperations.ts | 2 +- .../api/groupMemberships/groupMemberships.ts | 2 +- server/routes/api/groups/groups.ts | 2 +- server/routes/api/imports/imports.ts | 2 +- server/routes/api/index.ts | 6 +- .../routes/api/installation/installation.ts | 2 +- .../routes/api/integrations/integrations.ts | 2 +- .../routes/api/notifications/notifications.ts | 2 +- .../oauthAuthentications.ts | 2 +- .../routes/api/oauthClients/oauthClients.ts | 2 +- server/routes/api/pins/pins.ts | 2 +- server/routes/api/reactions/reactions.ts | 2 +- .../routes/api/relationships/relationships.ts | 2 +- server/routes/api/revisions/revisions.ts | 2 +- server/routes/api/searches/searches.ts | 2 +- server/routes/api/shares/shares.ts | 2 +- server/routes/api/stars/stars.ts | 2 +- .../routes/api/subscriptions/subscriptions.ts | 2 +- server/routes/api/suggestions/suggestions.ts | 2 +- server/routes/api/teams/teams.ts | 2 +- server/routes/api/templates/templates.ts | 2 +- server/routes/api/urls/urls.ts | 2 +- .../api/userMemberships/userMemberships.ts | 2 +- server/routes/api/users/users.ts | 2 +- server/routes/api/views/views.ts | 2 +- server/routes/auth/index.test.ts | 27 +++++++- server/routes/auth/index.ts | 18 ++--- server/routes/discovery/index.ts | 2 +- server/routes/discovery/mcp.ts | 2 +- server/routes/errors.ts | 2 +- server/routes/index.ts | 55 ++++++++------- server/routes/mcp/index.ts | 4 +- server/routes/oauth/index.ts | 2 +- server/types.ts | 13 ++-- server/typings/outlinewiki__koa-passport.d.ts | 4 +- server/utils/PluginManager.ts | 6 +- yarn.lock | 67 +++---------------- 69 files changed, 155 insertions(+), 166 deletions(-) diff --git a/package.json b/package.json index 56aef383b6..3da67fd34b 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "@hocuspocus/provider": "1.1.3", "@hocuspocus/server": "1.1.3", "@juggle/resize-observer": "^3.4.0", + "@koa/router": "^15.7.0", "@linear/sdk": "^97.0.0", "@mermaid-js/layout-elk": "0.2.2", "@modelcontextprotocol/sdk": "^1.31.0", @@ -168,7 +169,6 @@ "koa-helmet": "^6.1.0", "koa-logger": "^3.2.1", "koa-mount": "^4.2.0", - "koa-router": "7.4.0", "koa-send": "5.0.1", "koa-sslify": "5.0.1", "koa-useragent": "^4.1.0", @@ -308,7 +308,6 @@ "@types/koa-compress": "^4.0.7", "@types/koa-logger": "^3.1.5", "@types/koa-mount": "^4.0.5", - "@types/koa-router": "^7.4.9", "@types/koa-send": "^4.1.6", "@types/koa-sslify": "^4.0.6", "@types/koa-useragent": "^2.1.2", diff --git a/plugins/azure/server/auth/azure.ts b/plugins/azure/server/auth/azure.ts index 5b6bf25fa3..06e2efa7dc 100644 --- a/plugins/azure/server/auth/azure.ts +++ b/plugins/azure/server/auth/azure.ts @@ -2,7 +2,7 @@ import passport from "@outlinewiki/koa-passport"; import { Strategy as AzureStrategy } from "@outlinewiki/passport-azure-ad-oauth2"; import jwt from "jsonwebtoken"; import type { Request } from "koa"; -import Router from "koa-router"; +import Router from "@koa/router"; import type { Profile } from "passport"; import { toError } from "@shared/utils/error"; import { slugifyDomain } from "@shared/utils/domains"; diff --git a/plugins/discord/server/auth/discord.ts b/plugins/discord/server/auth/discord.ts index 29e429e3c8..91fc3d93b0 100644 --- a/plugins/discord/server/auth/discord.ts +++ b/plugins/discord/server/auth/discord.ts @@ -6,7 +6,7 @@ import type { RESTGetCurrentUserGuildMemberResult, } from "discord-api-types/v10"; import type { Request } from "koa"; -import Router from "koa-router"; +import Router from "@koa/router"; import { Strategy } from "passport-oauth2"; import { toError } from "@shared/utils/error"; diff --git a/plugins/email/server/auth/email.ts b/plugins/email/server/auth/email.ts index 46bee409de..4671011997 100644 --- a/plugins/email/server/auth/email.ts +++ b/plugins/email/server/auth/email.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { errToString } from "@shared/utils/error"; import { Client, NotificationEventType } from "@shared/types"; import { parseDomain } from "@shared/utils/domains"; diff --git a/plugins/figma/server/api/figma.ts b/plugins/figma/server/api/figma.ts index 3ec95f74a0..ae39125dc9 100644 --- a/plugins/figma/server/api/figma.ts +++ b/plugins/figma/server/api/figma.ts @@ -1,6 +1,6 @@ import { toError } from "@shared/utils/error"; import auth from "@server/middlewares/authentication"; -import Router from "koa-router"; +import Router from "@koa/router"; import * as T from "./schema"; import apexAuthRedirect from "@server/middlewares/apexAuthRedirect"; import type { APIContext } from "@server/types"; diff --git a/plugins/github/server/api/github.ts b/plugins/github/server/api/github.ts index 3d40620992..3f1afb22b2 100644 --- a/plugins/github/server/api/github.ts +++ b/plugins/github/server/api/github.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { find } from "es-toolkit/compat"; import { IntegrationService, IntegrationType } from "@shared/types"; import { createContext } from "@server/context"; diff --git a/plugins/gitlab/server/api/gitlab.ts b/plugins/gitlab/server/api/gitlab.ts index 051ffe9f97..5a90041534 100644 --- a/plugins/gitlab/server/api/gitlab.ts +++ b/plugins/gitlab/server/api/gitlab.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Op } from "sequelize"; import { toError } from "@shared/utils/error"; import { IntegrationService, IntegrationType } from "@shared/types"; diff --git a/plugins/google/server/auth/google.ts b/plugins/google/server/auth/google.ts index e2f6e5d80d..f567cb9a4a 100644 --- a/plugins/google/server/auth/google.ts +++ b/plugins/google/server/auth/google.ts @@ -1,6 +1,6 @@ import passport from "@outlinewiki/koa-passport"; import type { Request } from "koa"; -import Router from "koa-router"; +import Router from "@koa/router"; import { capitalize } from "es-toolkit/compat"; import type { Profile } from "passport"; import { Strategy as GoogleStrategy } from "passport-google-oauth2"; diff --git a/plugins/linear/server/api/linear.ts b/plugins/linear/server/api/linear.ts index 14d50a0575..57fc6bfb1f 100644 --- a/plugins/linear/server/api/linear.ts +++ b/plugins/linear/server/api/linear.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { toError } from "@shared/utils/error"; import { IntegrationService, IntegrationType } from "@shared/types"; import { ValidationError } from "@server/errors"; diff --git a/plugins/notion/server/api/notion.ts b/plugins/notion/server/api/notion.ts index 6b061292c2..4a50a81a38 100644 --- a/plugins/notion/server/api/notion.ts +++ b/plugins/notion/server/api/notion.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { IntegrationService, IntegrationType } from "@shared/types"; import { ValidationError } from "@server/errors"; import apexAuthRedirect from "@server/middlewares/apexAuthRedirect"; diff --git a/plugins/oidc/server/auth/oidc.ts b/plugins/oidc/server/auth/oidc.ts index bee28857af..6cd148d15c 100644 --- a/plugins/oidc/server/auth/oidc.ts +++ b/plugins/oidc/server/auth/oidc.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { toError } from "@shared/utils/error"; import Logger from "@server/logging/Logger"; import env from "../env"; diff --git a/plugins/oidc/server/auth/oidcRouter.ts b/plugins/oidc/server/auth/oidcRouter.ts index 974ad1a711..996c32400e 100644 --- a/plugins/oidc/server/auth/oidcRouter.ts +++ b/plugins/oidc/server/auth/oidcRouter.ts @@ -1,7 +1,7 @@ import passport from "@outlinewiki/koa-passport"; import JWT from "jsonwebtoken"; import type { Context, Request } from "koa"; -import type Router from "koa-router"; +import type Router from "@koa/router"; import { get } from "es-toolkit/compat"; import { toError } from "@shared/utils/error"; import { slugifyDomain } from "@shared/utils/domains"; diff --git a/plugins/passkeys/server/api/passkeys.ts b/plugins/passkeys/server/api/passkeys.ts index fcceae8e6f..31c6b7ad1b 100644 --- a/plugins/passkeys/server/api/passkeys.ts +++ b/plugins/passkeys/server/api/passkeys.ts @@ -3,7 +3,7 @@ import validate from "@server/middlewares/validate"; import { UserPasskey } from "@server/models"; import type { APIContext } from "@server/types"; import { AuthenticationType } from "@server/types"; -import Router from "koa-router"; +import Router from "@koa/router"; import * as T from "./schema"; import { authorize } from "@server/policies"; import { transaction } from "@server/middlewares/transaction"; diff --git a/plugins/passkeys/server/auth/passkeys.ts b/plugins/passkeys/server/auth/passkeys.ts index 15f46eb429..95855add57 100644 --- a/plugins/passkeys/server/auth/passkeys.ts +++ b/plugins/passkeys/server/auth/passkeys.ts @@ -6,7 +6,7 @@ import { } from "@simplewebauthn/server"; import { isoBase64URL } from "@simplewebauthn/server/helpers"; import type { AuthenticatorTransportFuture } from "@simplewebauthn/server"; -import Router from "koa-router"; +import Router from "@koa/router"; import { randomBytes } from "node:crypto"; import { toError } from "@shared/utils/error"; import { User, UserPasskey, Team } from "@server/models"; diff --git a/plugins/slack/server/api/hooks.ts b/plugins/slack/server/api/hooks.ts index 76fdb31db6..dc341e560f 100644 --- a/plugins/slack/server/api/hooks.ts +++ b/plugins/slack/server/api/hooks.ts @@ -1,5 +1,5 @@ import { t } from "i18next"; -import Router from "koa-router"; +import Router from "@koa/router"; import { escapeRegExp } from "es-toolkit/compat"; import queryString from "query-string"; import { z } from "zod"; diff --git a/plugins/slack/server/auth/slack.ts b/plugins/slack/server/auth/slack.ts index 1020ccbc06..6900dcd56a 100644 --- a/plugins/slack/server/auth/slack.ts +++ b/plugins/slack/server/auth/slack.ts @@ -1,6 +1,6 @@ import passport from "@outlinewiki/koa-passport"; import type { Request } from "koa"; -import Router from "koa-router"; +import Router from "@koa/router"; import type { Profile } from "passport"; import { Strategy as SlackStrategy } from "passport-slack-oauth2"; import { toError } from "@shared/utils/error"; diff --git a/plugins/storage/server/api/files.ts b/plugins/storage/server/api/files.ts index 868e30e883..5b52f02534 100644 --- a/plugins/storage/server/api/files.ts +++ b/plugins/storage/server/api/files.ts @@ -1,5 +1,5 @@ import JWT from "jsonwebtoken"; -import Router from "koa-router"; +import Router from "@koa/router"; import mime from "mime-types"; import contentDisposition from "content-disposition"; import { bytesToHumanReadable } from "@shared/utils/files"; diff --git a/plugins/webhooks/server/api/webhookSubscriptions.ts b/plugins/webhooks/server/api/webhookSubscriptions.ts index c285595b2a..dc138f2c55 100644 --- a/plugins/webhooks/server/api/webhookSubscriptions.ts +++ b/plugins/webhooks/server/api/webhookSubscriptions.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { compact, isEmpty } from "es-toolkit/compat"; import { Op, Sequelize, type WhereOptions } from "sequelize"; import { UserRole } from "@shared/types"; diff --git a/server/main.ts b/server/main.ts index 7d0b55b8a5..00ff2bc260 100644 --- a/server/main.ts +++ b/server/main.ts @@ -5,7 +5,7 @@ import type { AddressInfo } from "node:net"; import Koa from "koa"; import helmet from "koa-helmet"; import logger from "koa-logger"; -import Router from "koa-router"; +import Router from "@koa/router"; import stoppable from "stoppable"; import { toError } from "@shared/utils/error"; import env from "./env"; diff --git a/server/routes/api/accessRequests/accessRequests.ts b/server/routes/api/accessRequests/accessRequests.ts index e6dd152d8a..46988ac8c5 100644 --- a/server/routes/api/accessRequests/accessRequests.ts +++ b/server/routes/api/accessRequests/accessRequests.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import auth from "@server/middlewares/authentication"; import { rateLimiter } from "@server/middlewares/rateLimiter"; import { transaction } from "@server/middlewares/transaction"; diff --git a/server/routes/api/apiKeys/apiKeys.ts b/server/routes/api/apiKeys/apiKeys.ts index 713e1c595e..3bbbaff7d5 100644 --- a/server/routes/api/apiKeys/apiKeys.ts +++ b/server/routes/api/apiKeys/apiKeys.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Op, Sequelize, type WhereOptions } from "sequelize"; import auth from "@server/middlewares/authentication"; import { rateLimiter } from "@server/middlewares/rateLimiter"; diff --git a/server/routes/api/attachments/attachments.ts b/server/routes/api/attachments/attachments.ts index ac70e7729d..0fd3543efc 100644 --- a/server/routes/api/attachments/attachments.ts +++ b/server/routes/api/attachments/attachments.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { randomUUID } from "node:crypto"; import { AttachmentPreset } from "@shared/types"; diff --git a/server/routes/api/auth/auth.ts b/server/routes/api/auth/auth.ts index d0ef2cd7d4..1862756772 100644 --- a/server/routes/api/auth/auth.ts +++ b/server/routes/api/auth/auth.ts @@ -1,5 +1,5 @@ import { subHours, subMinutes } from "date-fns"; -import Router from "koa-router"; +import Router from "@koa/router"; import { uniqBy } from "es-toolkit/compat"; import { TeamPreference } from "@shared/types"; import { parseDomain } from "@shared/utils/domains"; diff --git a/server/routes/api/authenticationProviders/authenticationProviders.ts b/server/routes/api/authenticationProviders/authenticationProviders.ts index ff836c9212..63d0bcca83 100644 --- a/server/routes/api/authenticationProviders/authenticationProviders.ts +++ b/server/routes/api/authenticationProviders/authenticationProviders.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { UserRole } from "@shared/types"; import env from "@server/env"; import { InvalidRequestError } from "@server/errors"; diff --git a/server/routes/api/batch/batch.ts b/server/routes/api/batch/batch.ts index 03ebdc40cd..e4acff29c0 100644 --- a/server/routes/api/batch/batch.ts +++ b/server/routes/api/batch/batch.ts @@ -1,7 +1,7 @@ import { chunk, omit, snakeCase } from "es-toolkit/compat"; import type { Middleware } from "koa"; import compose from "koa-compose"; -import Router from "koa-router"; +import Router from "@koa/router"; import auth from "@server/middlewares/authentication"; import { defaultRateLimiter, diff --git a/server/routes/api/collections/collections.ts b/server/routes/api/collections/collections.ts index 3fb4b13c88..372c5ee3a9 100644 --- a/server/routes/api/collections/collections.ts +++ b/server/routes/api/collections/collections.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { randomUUID } from "node:crypto"; import { truncate } from "es-toolkit/compat"; import type { WhereOptions } from "sequelize"; diff --git a/server/routes/api/comments/comments.ts b/server/routes/api/comments/comments.ts index 183cad4ae8..d3b1fb999d 100644 --- a/server/routes/api/comments/comments.ts +++ b/server/routes/api/comments/comments.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { difference } from "es-toolkit/compat"; import { v4 as uuidv4 } from "uuid"; import { MentionType, IconType } from "@shared/types"; diff --git a/server/routes/api/cron/cron.ts b/server/routes/api/cron/cron.ts index 017cb52f1b..495d8b487e 100644 --- a/server/routes/api/cron/cron.ts +++ b/server/routes/api/cron/cron.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import env from "@server/env"; import { AuthenticationError } from "@server/errors"; import Logger from "@server/logging/Logger"; diff --git a/server/routes/api/developer/developer.ts b/server/routes/api/developer/developer.ts index 9725d7dbcd..dfa7166dce 100644 --- a/server/routes/api/developer/developer.ts +++ b/server/routes/api/developer/developer.ts @@ -1,5 +1,5 @@ import type { Context, Next } from "koa"; -import Router from "koa-router"; +import Router from "@koa/router"; import { Op } from "sequelize"; import { randomString, randomElement } from "@shared/random"; import { NotificationEventType } from "@shared/types"; diff --git a/server/routes/api/documents/documents.ts b/server/routes/api/documents/documents.ts index 0465b48351..35bebeaf88 100644 --- a/server/routes/api/documents/documents.ts +++ b/server/routes/api/documents/documents.ts @@ -3,7 +3,7 @@ import fractionalIndex from "fractional-index"; import fs from "fs-extra"; import invariant from "invariant"; import contentDisposition from "content-disposition"; -import Router from "koa-router"; +import Router from "@koa/router"; import { escapeRegExp, has, remove, uniq } from "es-toolkit/compat"; import mime from "mime-types"; import type { Order, ScopeOptions, WhereOptions } from "sequelize"; diff --git a/server/routes/api/emojis/emojis.ts b/server/routes/api/emojis/emojis.ts index 842f78f385..3f9c1b275e 100644 --- a/server/routes/api/emojis/emojis.ts +++ b/server/routes/api/emojis/emojis.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { Op } from "sequelize"; import auth from "@server/middlewares/authentication"; diff --git a/server/routes/api/events/events.ts b/server/routes/api/events/events.ts index a68f1e9025..24c611fec3 100644 --- a/server/routes/api/events/events.ts +++ b/server/routes/api/events/events.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { intersection } from "es-toolkit/compat"; import type { WhereOptions } from "sequelize"; import { Op } from "sequelize"; diff --git a/server/routes/api/fileOperations/fileOperations.ts b/server/routes/api/fileOperations/fileOperations.ts index 772ba60810..fb75c063df 100644 --- a/server/routes/api/fileOperations/fileOperations.ts +++ b/server/routes/api/fileOperations/fileOperations.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { UserRole } from "@shared/types"; import { ValidationError } from "@server/errors"; diff --git a/server/routes/api/groupMemberships/groupMemberships.ts b/server/routes/api/groupMemberships/groupMemberships.ts index 717177fb05..f5426d9b3d 100644 --- a/server/routes/api/groupMemberships/groupMemberships.ts +++ b/server/routes/api/groupMemberships/groupMemberships.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { uniqBy } from "es-toolkit/compat"; import { Op } from "sequelize"; import auth from "@server/middlewares/authentication"; diff --git a/server/routes/api/groups/groups.ts b/server/routes/api/groups/groups.ts index e75e212a03..173cf06d2b 100644 --- a/server/routes/api/groups/groups.ts +++ b/server/routes/api/groups/groups.ts @@ -1,5 +1,5 @@ import { compact, uniqBy } from "es-toolkit"; -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { Op } from "sequelize"; import { MAX_AVATAR_DISPLAY } from "@shared/constants"; diff --git a/server/routes/api/imports/imports.ts b/server/routes/api/imports/imports.ts index a7bb292207..446ed3e914 100644 --- a/server/routes/api/imports/imports.ts +++ b/server/routes/api/imports/imports.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { randomUUID } from "node:crypto"; import { truncate } from "es-toolkit/compat"; import type { WhereOptions } from "sequelize"; diff --git a/server/routes/api/index.ts b/server/routes/api/index.ts index 90843c0e35..484c785526 100644 --- a/server/routes/api/index.ts +++ b/server/routes/api/index.ts @@ -1,7 +1,7 @@ import type { BaseContext } from "koa"; import Koa from "koa"; import bodyParser from "koa-body"; -import Router from "koa-router"; +import Router from "@koa/router"; import type { UserAgentContext } from "koa-useragent"; import userAgent from "koa-useragent"; import env from "@server/env"; @@ -133,11 +133,11 @@ if (env.isDevelopment) { router.use("/", developer.routes()); } -router.register("*", ["get", "post"], (ctx) => { +router.register("{/*path}", ["get", "post"], (ctx) => { ctx.throw(NotFoundError("Endpoint not found")); }); -// Router is embedded in a Koa application wrapper, because koa-router does not +// Router is embedded in a Koa application wrapper, because @koa/router does not // allow middleware to catch any routes which were not explicitly defined. api.use(router.routes()); api.use(router.allowedMethods()); diff --git a/server/routes/api/installation/installation.ts b/server/routes/api/installation/installation.ts index b99b510ccc..e6c3bcaa38 100644 --- a/server/routes/api/installation/installation.ts +++ b/server/routes/api/installation/installation.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Client, UserRole } from "@shared/types"; import teamCreator from "@server/commands/teamCreator"; import { ValidationError } from "@server/errors"; diff --git a/server/routes/api/integrations/integrations.ts b/server/routes/api/integrations/integrations.ts index 572deb8544..187a04aa2c 100644 --- a/server/routes/api/integrations/integrations.ts +++ b/server/routes/api/integrations/integrations.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { Op } from "sequelize"; import { IntegrationType, UserRole } from "@shared/types"; diff --git a/server/routes/api/notifications/notifications.ts b/server/routes/api/notifications/notifications.ts index 13d8c617f2..a3811b080a 100644 --- a/server/routes/api/notifications/notifications.ts +++ b/server/routes/api/notifications/notifications.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { isEmpty, isNil, isNull, isUndefined } from "es-toolkit/compat"; import type { WhereOptions } from "sequelize"; import { Op } from "sequelize"; diff --git a/server/routes/api/oauthAuthentications/oauthAuthentications.ts b/server/routes/api/oauthAuthentications/oauthAuthentications.ts index fbb6d713b6..56a5dfb263 100644 --- a/server/routes/api/oauthAuthentications/oauthAuthentications.ts +++ b/server/routes/api/oauthAuthentications/oauthAuthentications.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { QueryTypes } from "sequelize"; import auth from "@server/middlewares/authentication"; import { rateLimiter } from "@server/middlewares/rateLimiter"; diff --git a/server/routes/api/oauthClients/oauthClients.ts b/server/routes/api/oauthClients/oauthClients.ts index 4ac1b59b34..fe7d39a1f6 100644 --- a/server/routes/api/oauthClients/oauthClients.ts +++ b/server/routes/api/oauthClients/oauthClients.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Op } from "sequelize"; import AuthenticationHelper from "@shared/helpers/AuthenticationHelper"; import { UserRole } from "@shared/types"; diff --git a/server/routes/api/pins/pins.ts b/server/routes/api/pins/pins.ts index 95669c7b6b..79d572d9dd 100644 --- a/server/routes/api/pins/pins.ts +++ b/server/routes/api/pins/pins.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Sequelize, Op, Transaction } from "sequelize"; import pinCreator from "@server/commands/pinCreator"; import auth from "@server/middlewares/authentication"; diff --git a/server/routes/api/reactions/reactions.ts b/server/routes/api/reactions/reactions.ts index 4dcbc88cac..755cf08da7 100644 --- a/server/routes/api/reactions/reactions.ts +++ b/server/routes/api/reactions/reactions.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import auth from "@server/middlewares/authentication"; import validate from "@server/middlewares/validate"; diff --git a/server/routes/api/relationships/relationships.ts b/server/routes/api/relationships/relationships.ts index 43565ea049..121bb7b9f4 100644 --- a/server/routes/api/relationships/relationships.ts +++ b/server/routes/api/relationships/relationships.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { InvalidRequestError } from "@server/errors"; import auth from "@server/middlewares/authentication"; import validate from "@server/middlewares/validate"; diff --git a/server/routes/api/revisions/revisions.ts b/server/routes/api/revisions/revisions.ts index c5a27ce042..0082a3e567 100644 --- a/server/routes/api/revisions/revisions.ts +++ b/server/routes/api/revisions/revisions.ts @@ -1,5 +1,5 @@ import path from "node:path"; -import Router from "koa-router"; +import Router from "@koa/router"; import contentDisposition from "content-disposition"; import { escapeRegExp } from "es-toolkit/compat"; import mime from "mime-types"; diff --git a/server/routes/api/searches/searches.ts b/server/routes/api/searches/searches.ts index 3b6cffa81e..35200caa54 100644 --- a/server/routes/api/searches/searches.ts +++ b/server/routes/api/searches/searches.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import auth from "@server/middlewares/authentication"; import { transaction } from "@server/middlewares/transaction"; import validate from "@server/middlewares/validate"; diff --git a/server/routes/api/shares/shares.ts b/server/routes/api/shares/shares.ts index f3381bf5c0..a779cb147e 100644 --- a/server/routes/api/shares/shares.ts +++ b/server/routes/api/shares/shares.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { isUndefined } from "es-toolkit/compat"; import type { FindOptions, WhereAttributeHash, WhereOptions } from "sequelize"; import { Op } from "sequelize"; diff --git a/server/routes/api/stars/stars.ts b/server/routes/api/stars/stars.ts index b826125d80..5b9dfcb378 100644 --- a/server/routes/api/stars/stars.ts +++ b/server/routes/api/stars/stars.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Sequelize } from "sequelize"; import starCreator from "@server/commands/starCreator"; import auth from "@server/middlewares/authentication"; diff --git a/server/routes/api/subscriptions/subscriptions.ts b/server/routes/api/subscriptions/subscriptions.ts index 25a22e202c..0c07b5d1fb 100644 --- a/server/routes/api/subscriptions/subscriptions.ts +++ b/server/routes/api/subscriptions/subscriptions.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { Transaction } from "sequelize"; import { QueryNotices } from "@shared/types"; diff --git a/server/routes/api/suggestions/suggestions.ts b/server/routes/api/suggestions/suggestions.ts index d68d598fb5..44db5d9ad0 100644 --- a/server/routes/api/suggestions/suggestions.ts +++ b/server/routes/api/suggestions/suggestions.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Op } from "sequelize"; import { Sequelize } from "sequelize-typescript"; import auth from "@server/middlewares/authentication"; diff --git a/server/routes/api/teams/teams.ts b/server/routes/api/teams/teams.ts index b39e33a748..7f6567afb1 100644 --- a/server/routes/api/teams/teams.ts +++ b/server/routes/api/teams/teams.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { UserRole } from "@shared/types"; import teamCreator from "@server/commands/teamCreator"; import teamUpdater from "@server/commands/teamUpdater"; diff --git a/server/routes/api/templates/templates.ts b/server/routes/api/templates/templates.ts index 260351e3dd..805f6c2df1 100644 --- a/server/routes/api/templates/templates.ts +++ b/server/routes/api/templates/templates.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { Op, Sequelize } from "sequelize"; import { ProsemirrorDataHelper } from "@shared/utils/ProsemirrorDataHelper"; diff --git a/server/routes/api/urls/urls.ts b/server/routes/api/urls/urls.ts index 9f83317b0c..3de72bb720 100644 --- a/server/routes/api/urls/urls.ts +++ b/server/routes/api/urls/urls.ts @@ -1,5 +1,5 @@ import dns from "node:dns"; -import Router from "koa-router"; +import Router from "@koa/router"; import { traceFunction } from "@server/logging/tracing"; import isUUID from "validator/lib/isUUID"; import { MentionType, UnfurlResourceType } from "@shared/types"; diff --git a/server/routes/api/userMemberships/userMemberships.ts b/server/routes/api/userMemberships/userMemberships.ts index aad82e3f97..a41202c41c 100644 --- a/server/routes/api/userMemberships/userMemberships.ts +++ b/server/routes/api/userMemberships/userMemberships.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Op, Sequelize } from "sequelize"; import auth from "@server/middlewares/authentication"; import { transaction } from "@server/middlewares/transaction"; diff --git a/server/routes/api/users/users.ts b/server/routes/api/users/users.ts index 737e1955ac..304f851e0d 100644 --- a/server/routes/api/users/users.ts +++ b/server/routes/api/users/users.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import type { WhereOptions } from "sequelize"; import { Op, Sequelize } from "sequelize"; import { NotificationEventType, UserRole } from "@shared/types"; diff --git a/server/routes/api/views/views.ts b/server/routes/api/views/views.ts index 8475262978..7d1de17d0b 100644 --- a/server/routes/api/views/views.ts +++ b/server/routes/api/views/views.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { ValidationError } from "@server/errors"; import auth from "@server/middlewares/authentication"; import { rateLimiter } from "@server/middlewares/rateLimiter"; diff --git a/server/routes/auth/index.test.ts b/server/routes/auth/index.test.ts index e976758598..349fc46bcc 100644 --- a/server/routes/auth/index.test.ts +++ b/server/routes/auth/index.test.ts @@ -1,7 +1,12 @@ import { addMonths } from "date-fns"; import { buildUser, buildCollection } from "@server/test/factories"; -import { getTestServer } from "@server/test/support"; +import { + getTestServer, + setCloudHosted, + setSelfHosted, +} from "@server/test/support"; import { getJWTPayload } from "@server/utils/jwt"; +import { verifyOAuthState } from "@server/utils/oauthState"; const server = getTestServer(); @@ -73,3 +78,23 @@ describe("auth/redirect", () => { expect(res.status).toEqual(401); }); }); + +describe("auth provider routes", () => { + beforeEach(setSelfHosted); + afterEach(setCloudHosted); + + it("should include the signed-in actor in the OAuth state", async () => { + const user = await buildUser(); + const res = await server.get("/auth/google", { + redirect: "manual", + headers: { + Cookie: `accessToken=${user.getSessionToken()}`, + }, + }); + expect(res.status).toEqual(302); + + const location = new URL(res.headers.get("location") ?? ""); + const state = verifyOAuthState(location.searchParams.get("state") ?? ""); + expect(state.actorId).toEqual(user.id); + }); +}); diff --git a/server/routes/auth/index.ts b/server/routes/auth/index.ts index 4121f325fe..d4eafbcc44 100644 --- a/server/routes/auth/index.ts +++ b/server/routes/auth/index.ts @@ -2,7 +2,7 @@ import passport from "@outlinewiki/koa-passport"; import { addMonths } from "date-fns"; import Koa from "koa"; import bodyParser from "koa-body"; -import Router from "koa-router"; +import Router from "@koa/router"; import { AuthenticationError } from "@server/errors"; import authMiddleware from "@server/middlewares/authentication"; import coalesceBody from "@server/middlewares/coaleseBody"; @@ -20,14 +20,16 @@ router.use(passport.initialize()); // dynamically register available authentication provider routes void (async () => { - for (const provider of AuthenticationHelper.providers) { - const resolvedRouter = await provider.value.router; + const resolvedRouters = await Promise.all( + AuthenticationHelper.providers.map((provider) => + Promise.resolve(provider.value.router) + ) + ); + + router.use(authMiddleware({ optional: true })); + for (const resolvedRouter of resolvedRouters) { if (resolvedRouter) { - router.use( - "/", - authMiddleware({ optional: true }), - resolvedRouter.routes() - ); + router.use("/", resolvedRouter.routes()); } } })(); diff --git a/server/routes/discovery/index.ts b/server/routes/discovery/index.ts index 0f541f1fc5..26c7d717b0 100644 --- a/server/routes/discovery/index.ts +++ b/server/routes/discovery/index.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { Day } from "@shared/utils/time"; import { opensearchResponse } from "./opensearch"; import { robotsResponse } from "./robots"; diff --git a/server/routes/discovery/mcp.ts b/server/routes/discovery/mcp.ts index 9d4c4b181d..599b1a86ca 100644 --- a/server/routes/discovery/mcp.ts +++ b/server/routes/discovery/mcp.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; import { TeamPreference } from "@shared/types"; import env from "@server/env"; import { OAuthHelper } from "@server/utils/oauth/OAuthHelper"; diff --git a/server/routes/errors.ts b/server/routes/errors.ts index bba389ee1a..394e1a8d9c 100644 --- a/server/routes/errors.ts +++ b/server/routes/errors.ts @@ -1,4 +1,4 @@ -import Router from "koa-router"; +import Router from "@koa/router"; const router = new Router(); diff --git a/server/routes/index.ts b/server/routes/index.ts index 9b8af4a1e0..0cbde77049 100644 --- a/server/routes/index.ts +++ b/server/routes/index.ts @@ -2,7 +2,7 @@ import crypto from "node:crypto"; import path from "node:path"; import { formatRFC7231 } from "date-fns"; import Koa from "koa"; -import Router from "koa-router"; +import Router from "@koa/router"; import send from "koa-send"; import { languages } from "@shared/i18n"; import { TeamPreference } from "@shared/types"; @@ -25,33 +25,40 @@ const koa = new Koa(); const router = new Router(); // serve public assets -router.use(["/images/*", "/email/*", "/fonts/*"], async (ctx, next) => { - let done; +router.use( + ["/images/{*path}", "/email/{*path}", "/fonts/{*path}"], + async (ctx, next) => { + let done; - if (ctx.method === "HEAD" || ctx.method === "GET") { - try { - done = await send(ctx, ctx.path, { - root: path.resolve(__dirname, "../../../public"), - // 7 day expiry, these assets are mostly static but do not contain a hash - maxAge: Day.ms * 7, - setHeaders: (res) => { - res.setHeader("Access-Control-Allow-Origin", "*"); - }, - }); - } catch (err) { - if (!(err instanceof Error && "status" in err && err.status === 404)) { - throw err; + if (ctx.method === "HEAD" || ctx.method === "GET") { + try { + done = await send(ctx, ctx.path, { + root: path.resolve(__dirname, "../../../public"), + // 7 day expiry, these assets are mostly static but do not contain a hash + maxAge: Day.ms * 7, + setHeaders: (res) => { + res.setHeader("Access-Control-Allow-Origin", "*"); + }, + }); + } catch (err) { + if (!(err instanceof Error && "status" in err && err.status === 404)) { + throw err; + } } } - } - if (!done) { - await next(); + if (!done) { + await next(); + } } -}); +); router.use( - ["/share/:shareId", "/share/:shareId/doc/:documentSlug", "/share/:shareId/*"], + [ + "/share/:shareId", + "/share/:shareId/doc/:documentSlug", + "/share/:shareId/{*path}", + ], (ctx) => { const redirectPath = ctx.path.replace(/^\/share/, "/s"); ctx.redirect(redirectPath + ctx.request.URL.search); @@ -60,7 +67,7 @@ router.use( ); if (env.isProduction) { - router.get("/static/*", async (ctx) => { + router.get("/static/{*path}", async (ctx) => { try { const pathname = ctx.path.substring(8); if (!pathname) { @@ -129,7 +136,7 @@ router.get( renderShare ); router.get("/s/:shareId/doc/:documentSlug", shareDomains(), renderShare); -router.get("/s/:shareId/*", shareDomains(), renderShare); +router.get("/s/:shareId/{*path}", shareDomains(), renderShare); router.get("/embeds/gitlab", renderEmbed); router.get("/embeds/github", renderEmbed); @@ -167,7 +174,7 @@ function isPublicAppPath(path: string) { } // catch all for application -router.get("*", async (ctx, next) => { +router.get("{/*path}", async (ctx, next) => { if (isInvalidAppPath(ctx.path)) { ctx.status = 404; return; diff --git a/server/routes/mcp/index.ts b/server/routes/mcp/index.ts index c060c8c03b..cd84661210 100644 --- a/server/routes/mcp/index.ts +++ b/server/routes/mcp/index.ts @@ -1,6 +1,6 @@ import Koa from "koa"; import bodyParser from "koa-body"; -import Router from "koa-router"; +import Router from "@koa/router"; import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; import type { AuthInfo } from "@modelcontextprotocol/sdk/server/auth/types.js"; import { ErrorCode } from "@modelcontextprotocol/sdk/types.js"; @@ -144,7 +144,7 @@ router.delete("/", async (ctx) => { // Clients probing for a transport we do not implement, such as the legacy // HTTP+SSE endpoints, must not fall through to the application shell -router.all("*", async (ctx) => { +router.all("{/*path}", async (ctx) => { ctx.status = 404; ctx.body = { error: "Not found. MCP requests must be sent to /mcp." }; }); diff --git a/server/routes/oauth/index.ts b/server/routes/oauth/index.ts index ff0486827b..0db17ce567 100644 --- a/server/routes/oauth/index.ts +++ b/server/routes/oauth/index.ts @@ -1,7 +1,7 @@ import OAuth2Server from "@node-oauth/oauth2-server"; import Koa from "koa"; import bodyParser from "koa-body"; -import Router from "koa-router"; +import Router from "@koa/router"; import env from "@server/env"; import { ValidationError, NotFoundError } from "@server/errors"; import { apiContext } from "@server/middlewares/apiContext"; diff --git a/server/types.ts b/server/types.ts index 325f261a05..4a93d246ca 100644 --- a/server/types.ts +++ b/server/types.ts @@ -1,5 +1,5 @@ import type { ParameterizedContext, DefaultContext } from "koa"; -import type { IRouterParamContext } from "koa-router"; +import type { RouterContext } from "@koa/router"; import type { InferAttributes, Model, Transaction } from "sequelize"; import type { z } from "zod"; import type { @@ -92,11 +92,12 @@ export type BaseRes = unknown; export interface APIContext< ReqT = Partial, ResT = BaseRes, -> extends ParameterizedContext< - AppState, - DefaultContext & IRouterParamContext, - ResT -> { +> extends RouterContext { + // Router internals are left untyped so that handlers with a narrower context + // remain assignable to route middleware. + router: never; + matched?: never; + /** Typed and validated version of request, consisting of validated body, query, etc. */ input: ReqT; diff --git a/server/typings/outlinewiki__koa-passport.d.ts b/server/typings/outlinewiki__koa-passport.d.ts index 75976d1adb..1e5a24d167 100644 --- a/server/typings/outlinewiki__koa-passport.d.ts +++ b/server/typings/outlinewiki__koa-passport.d.ts @@ -15,7 +15,7 @@ declare module "@outlinewiki/koa-passport" { // oxlint-disable-next-line import Express from "express"; import { Request } from "koa"; - import { IMiddleware } from "koa-router"; + import { RouterMiddleware } from "@koa/router"; namespace passport { interface AuthenticateOptions { @@ -40,7 +40,7 @@ declare module "@outlinewiki/koa-passport" { } interface Authenticator< - InitializeRet = IMiddleware, + InitializeRet = RouterMiddleware, AuthenticateRet = any, AuthorizeRet = AuthenticateRet, AuthorizeOptions = AuthenticateOptions, diff --git a/server/utils/PluginManager.ts b/server/utils/PluginManager.ts index 0ba1057554..737304cc72 100644 --- a/server/utils/PluginManager.ts +++ b/server/utils/PluginManager.ts @@ -1,6 +1,6 @@ import path from "node:path"; import { glob } from "glob"; -import type Router from "koa-router"; +import type Router from "@koa/router"; import { isArray, sortBy } from "es-toolkit/compat"; import type BaseEmail from "@server/emails/templates/BaseEmail"; import env from "@server/env"; @@ -111,7 +111,9 @@ export class PluginManager { Logger.debug( "plugins", `Plugin(type=${plugin.type}) registered ${ - "name" in plugin.value ? plugin.value.name : "" + "name" in plugin.value && typeof plugin.value.name === "string" + ? plugin.value.name + : "" } ${plugin.description ? `(${plugin.description})` : ""}` ); } diff --git a/yarn.lock b/yarn.lock index cbf2e3d481..2726a03c04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2557,20 +2557,20 @@ __metadata: languageName: node linkType: hard -"@koa/router@npm:^15.4.0": - version: 15.4.0 - resolution: "@koa/router@npm:15.4.0" +"@koa/router@npm:^15.4.0, @koa/router@npm:^15.7.0": + version: 15.7.0 + resolution: "@koa/router@npm:15.7.0" dependencies: debug: "npm:^4.4.3" http-errors: "npm:^2.0.1" koa-compose: "npm:^4.1.0" - path-to-regexp: "npm:^8.3.0" + path-to-regexp: "npm:^8.4.2" peerDependencies: koa: ^2.0.0 || ^3.0.0 peerDependenciesMeta: koa: optional: false - checksum: 10c0/a16e079115a9e228399b5ca264ca999b2e008d86e29e139343b927eb010e889a2cd17f03194796fb41d82df8572ac25ba112d1d3c342c9e27376894412c349d5 + checksum: 10c0/da1f23f07684f5b39db5536cd6d4b77f7e38930786c2c0c13cf27d84ab90b6c9eea5ecf17f8f4c1b87ccc822a874f64c351b6e9b4c2e6c9324765564fce689cb languageName: node linkType: hard @@ -6830,15 +6830,6 @@ __metadata: languageName: node linkType: hard -"@types/koa-router@npm:^7.4.9": - version: 7.4.9 - resolution: "@types/koa-router@npm:7.4.9" - dependencies: - "@types/koa": "npm:*" - checksum: 10c0/296218c302347e5147b8cd5a6f50312a9d9937ad1082f10d97022841a09c9bc2a821cf3ea381d4ca9dff5643e8c03fe2be1af1bdaba8a065579c54abb1a8dfe1 - languageName: node - linkType: hard - "@types/koa-send@npm:^4.1.6": version: 4.1.6 resolution: "@types/koa-send@npm:4.1.6" @@ -7957,7 +7948,7 @@ __metadata: languageName: node linkType: hard -"any-promise@npm:^1.0.0, any-promise@npm:^1.1.0": +"any-promise@npm:^1.0.0": version: 1.3.0 resolution: "any-promise@npm:1.3.0" checksum: 10c0/60f0298ed34c74fef50daab88e8dab786036ed5a7fad02e012ab57e376e0a0b4b29e83b95ea9b5e7d89df762f5f25119b83e00706ecaccb22cfbacee98d74889 @@ -12288,7 +12279,7 @@ __metadata: languageName: node linkType: hard -"http-errors@npm:^1.3.1, http-errors@npm:^1.7.3, http-errors@npm:~1.8.0": +"http-errors@npm:^1.7.3, http-errors@npm:~1.8.0": version: 1.8.1 resolution: "http-errors@npm:1.8.1" dependencies: @@ -13650,15 +13641,6 @@ __metadata: languageName: node linkType: hard -"koa-compose@npm:^3.0.0": - version: 3.2.1 - resolution: "koa-compose@npm:3.2.1" - dependencies: - any-promise: "npm:^1.1.0" - checksum: 10c0/10f695cf75906d0054d60d29e3a18e8df8962f1a050823bf503711819294283aae92fc145b86ea8e5dd438fc938a501145a8b6447e87cb6374084434eeeeed2f - languageName: node - linkType: hard - "koa-compose@npm:^4.1.0": version: 4.1.0 resolution: "koa-compose@npm:4.1.0" @@ -13717,20 +13699,6 @@ __metadata: languageName: node linkType: hard -"koa-router@npm:7.4.0": - version: 7.4.0 - resolution: "koa-router@npm:7.4.0" - dependencies: - debug: "npm:^3.1.0" - http-errors: "npm:^1.3.1" - koa-compose: "npm:^3.0.0" - methods: "npm:^1.0.1" - path-to-regexp: "npm:^1.1.1" - urijs: "npm:^1.19.0" - checksum: 10c0/1a3ca392668e0a42222523ae459555010a493b759b934164d98b497e1b25ba57d7a8ee463cf351f815b620a4762f7c85ad8593b7d1cb7d1b2c26c15fa919c7f3 - languageName: node - linkType: hard - "koa-send@npm:5.0.1, koa-send@npm:^5.0.0, koa-send@npm:^5.0.1": version: 5.0.1 resolution: "koa-send@npm:5.0.1" @@ -14528,13 +14496,6 @@ __metadata: languageName: node linkType: hard -"methods@npm:^1.0.1": - version: 1.1.2 - resolution: "methods@npm:1.1.2" - checksum: 10c0/bdf7cc72ff0a33e3eede03708c08983c4d7a173f91348b4b1e4f47d4cdbf734433ad971e7d1e8c77247d9e5cd8adb81ea4c67b0a2db526b758b2233d7814b8b2 - languageName: node - linkType: hard - "micromatch@npm:^4.0.2": version: 4.0.8 resolution: "micromatch@npm:4.0.8" @@ -15486,6 +15447,7 @@ __metadata: "@hocuspocus/provider": "npm:1.1.3" "@hocuspocus/server": "npm:1.1.3" "@juggle/resize-observer": "npm:^3.4.0" + "@koa/router": "npm:^15.7.0" "@linear/sdk": "npm:^97.0.0" "@mermaid-js/layout-elk": "npm:0.2.2" "@modelcontextprotocol/sdk": "npm:^1.31.0" @@ -15543,7 +15505,6 @@ __metadata: "@types/koa-compress": "npm:^4.0.7" "@types/koa-logger": "npm:^3.1.5" "@types/koa-mount": "npm:^4.0.5" - "@types/koa-router": "npm:^7.4.9" "@types/koa-send": "npm:^4.1.6" "@types/koa-sslify": "npm:^4.0.6" "@types/koa-useragent": "npm:^2.1.2" @@ -15643,7 +15604,6 @@ __metadata: koa-helmet: "npm:^6.1.0" koa-logger: "npm:^3.2.1" koa-mount: "npm:^4.2.0" - koa-router: "npm:7.4.0" koa-send: "npm:5.0.1" koa-sslify: "npm:5.0.1" koa-useragent: "npm:^4.1.0" @@ -16414,7 +16374,7 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^1.1.1, path-to-regexp@npm:^1.7.0": +"path-to-regexp@npm:^1.7.0": version: 1.9.0 resolution: "path-to-regexp@npm:1.9.0" dependencies: @@ -16430,7 +16390,7 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^8.0.0, path-to-regexp@npm:^8.3.0": +"path-to-regexp@npm:^8.0.0, path-to-regexp@npm:^8.4.2": version: 8.4.2 resolution: "path-to-regexp@npm:8.4.2" checksum: 10c0/05b115c49b47ad252ce05faa32930f643f23769c68b8bcfe78ad833545140c48bbffb3266986d6c8d5db13a64cf12e07e0d72d9882cab830efeefa553533ebaf @@ -20449,13 +20409,6 @@ __metadata: languageName: node linkType: hard -"urijs@npm:^1.19.0": - version: 1.19.11 - resolution: "urijs@npm:1.19.11" - checksum: 10c0/96e15eea5b41a99361d506e4d8fcc64dc43f334bd5fd34e08261467b6954b97a6b45929a8d6c79e2dc76aadfd6ca950e0f4bd7f3c0757a08978429634d07eda1 - languageName: node - linkType: hard - "url-parse@npm:^1.5.3": version: 1.5.10 resolution: "url-parse@npm:1.5.10"