@crowi/api 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/app.d.ts +8 -0
- package/dist/app.js +65 -0
- package/dist/app.js.map +1 -0
- package/dist/collab/attach.d.ts +33 -0
- package/dist/collab/attach.js +341 -0
- package/dist/collab/attach.js.map +1 -0
- package/dist/collab/extension-redis.d.ts +25 -0
- package/dist/collab/extension-redis.js +133 -0
- package/dist/collab/extension-redis.js.map +1 -0
- package/dist/common/functions/path2name.d.ts +1 -0
- package/dist/common/functions/path2name.js +22 -0
- package/dist/common/functions/path2name.js.map +1 -0
- package/dist/common/functions/renderIcon.d.ts +1 -0
- package/dist/common/functions/renderIcon.js +9 -0
- package/dist/common/functions/renderIcon.js.map +1 -0
- package/dist/controllers/admin.d.ts +3 -0
- package/dist/controllers/admin.js +474 -0
- package/dist/controllers/admin.js.map +1 -0
- package/dist/controllers/attachment.d.ts +4 -0
- package/dist/controllers/attachment.js +200 -0
- package/dist/controllers/attachment.js.map +1 -0
- package/dist/controllers/backlink.d.ts +3 -0
- package/dist/controllers/backlink.js +42 -0
- package/dist/controllers/backlink.js.map +1 -0
- package/dist/controllers/bookmark.d.ts +3 -0
- package/dist/controllers/bookmark.js +100 -0
- package/dist/controllers/bookmark.js.map +1 -0
- package/dist/controllers/comment.d.ts +3 -0
- package/dist/controllers/comment.js +111 -0
- package/dist/controllers/comment.js.map +1 -0
- package/dist/controllers/index.d.ts +25 -0
- package/dist/controllers/index.js +44 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/installer.d.ts +3 -0
- package/dist/controllers/installer.js +48 -0
- package/dist/controllers/installer.js.map +1 -0
- package/dist/controllers/login.d.ts +4 -0
- package/dist/controllers/login.js +438 -0
- package/dist/controllers/login.js.map +1 -0
- package/dist/controllers/logout.d.ts +5 -0
- package/dist/controllers/logout.js +11 -0
- package/dist/controllers/logout.js.map +1 -0
- package/dist/controllers/me.d.ts +4 -0
- package/dist/controllers/me.js +369 -0
- package/dist/controllers/me.js.map +1 -0
- package/dist/controllers/notification.d.ts +3 -0
- package/dist/controllers/notification.js +88 -0
- package/dist/controllers/notification.js.map +1 -0
- package/dist/controllers/page.d.ts +3 -0
- package/dist/controllers/page.js +881 -0
- package/dist/controllers/page.js.map +1 -0
- package/dist/controllers/revision.d.ts +3 -0
- package/dist/controllers/revision.js +91 -0
- package/dist/controllers/revision.js.map +1 -0
- package/dist/controllers/search.d.ts +3 -0
- package/dist/controllers/search.js +93 -0
- package/dist/controllers/search.js.map +1 -0
- package/dist/controllers/share.d.ts +3 -0
- package/dist/controllers/share.js +207 -0
- package/dist/controllers/share.js.map +1 -0
- package/dist/controllers/shareAccess.d.ts +3 -0
- package/dist/controllers/shareAccess.js +28 -0
- package/dist/controllers/shareAccess.js.map +1 -0
- package/dist/controllers/slack.d.ts +3 -0
- package/dist/controllers/slack.js +87 -0
- package/dist/controllers/slack.js.map +1 -0
- package/dist/controllers/tokenAuth.d.ts +10 -0
- package/dist/controllers/tokenAuth.js +292 -0
- package/dist/controllers/tokenAuth.js.map +1 -0
- package/dist/controllers/user.d.ts +3 -0
- package/dist/controllers/user.js +67 -0
- package/dist/controllers/user.js.map +1 -0
- package/dist/controllers/version.d.ts +4 -0
- package/dist/controllers/version.js +19 -0
- package/dist/controllers/version.js.map +1 -0
- package/dist/crowi/express-init.d.ts +4 -0
- package/dist/crowi/express-init.js +101 -0
- package/dist/crowi/express-init.js.map +1 -0
- package/dist/crowi/index.d.ts +245 -0
- package/dist/crowi/index.js +726 -0
- package/dist/crowi/index.js.map +1 -0
- package/dist/events/activity.d.ts +7 -0
- package/dist/events/activity.js +15 -0
- package/dist/events/activity.js.map +1 -0
- package/dist/events/bookmark.d.ts +8 -0
- package/dist/events/bookmark.js +16 -0
- package/dist/events/bookmark.js.map +1 -0
- package/dist/events/comment.d.ts +6 -0
- package/dist/events/comment.js +14 -0
- package/dist/events/comment.js.map +1 -0
- package/dist/events/config.d.ts +6 -0
- package/dist/events/config.js +12 -0
- package/dist/events/config.js.map +1 -0
- package/dist/events/index.d.ts +17 -0
- package/dist/events/index.js +22 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/mention-dispatch.d.ts +44 -0
- package/dist/events/mention-dispatch.js +151 -0
- package/dist/events/mention-dispatch.js.map +1 -0
- package/dist/events/notification.d.ts +7 -0
- package/dist/events/notification.js +15 -0
- package/dist/events/notification.js.map +1 -0
- package/dist/events/page.d.ts +44 -0
- package/dist/events/page.js +134 -0
- package/dist/events/page.js.map +1 -0
- package/dist/events/render-cache.d.ts +24 -0
- package/dist/events/render-cache.js +63 -0
- package/dist/events/render-cache.js.map +1 -0
- package/dist/events/user.d.ts +9 -0
- package/dist/events/user.js +39 -0
- package/dist/events/user.js.map +1 -0
- package/dist/form/admin/app.d.ts +2 -0
- package/dist/form/admin/app.js +9 -0
- package/dist/form/admin/app.js.map +1 -0
- package/dist/form/admin/auth.d.ts +2 -0
- package/dist/form/admin/auth.js +9 -0
- package/dist/form/admin/auth.js.map +1 -0
- package/dist/form/admin/aws.d.ts +2 -0
- package/dist/form/admin/aws.js +13 -0
- package/dist/form/admin/aws.js.map +1 -0
- package/dist/form/admin/github.d.ts +2 -0
- package/dist/form/admin/github.js +15 -0
- package/dist/form/admin/github.js.map +1 -0
- package/dist/form/admin/google.d.ts +2 -0
- package/dist/form/admin/google.js +13 -0
- package/dist/form/admin/google.js.map +1 -0
- package/dist/form/admin/mail.d.ts +2 -0
- package/dist/form/admin/mail.js +13 -0
- package/dist/form/admin/mail.js.map +1 -0
- package/dist/form/admin/sec.d.ts +2 -0
- package/dist/form/admin/sec.js +10 -0
- package/dist/form/admin/sec.js.map +1 -0
- package/dist/form/admin/slackSetting.d.ts +2 -0
- package/dist/form/admin/slackSetting.js +13 -0
- package/dist/form/admin/slackSetting.js.map +1 -0
- package/dist/form/admin/userEdit.d.ts +2 -0
- package/dist/form/admin/userEdit.js +9 -0
- package/dist/form/admin/userEdit.js.map +1 -0
- package/dist/form/admin/userInvite.d.ts +2 -0
- package/dist/form/admin/userInvite.js +9 -0
- package/dist/form/admin/userInvite.js.map +1 -0
- package/dist/form/comment.d.ts +2 -0
- package/dist/form/comment.js +9 -0
- package/dist/form/comment.js.map +1 -0
- package/dist/form/index.d.ts +25 -0
- package/dist/form/index.js +48 -0
- package/dist/form/index.js.map +1 -0
- package/dist/form/invited.d.ts +2 -0
- package/dist/form/invited.js +13 -0
- package/dist/form/invited.js.map +1 -0
- package/dist/form/login.d.ts +2 -0
- package/dist/form/login.js +11 -0
- package/dist/form/login.js.map +1 -0
- package/dist/form/me/apiToken.d.ts +2 -0
- package/dist/form/me/apiToken.js +9 -0
- package/dist/form/me/apiToken.js.map +1 -0
- package/dist/form/me/password.d.ts +2 -0
- package/dist/form/me/password.js +11 -0
- package/dist/form/me/password.js.map +1 -0
- package/dist/form/me/user.d.ts +2 -0
- package/dist/form/me/user.js +9 -0
- package/dist/form/me/user.js.map +1 -0
- package/dist/form/register.d.ts +2 -0
- package/dist/form/register.js +13 -0
- package/dist/form/register.js.map +1 -0
- package/dist/form/revision.d.ts +2 -0
- package/dist/form/revision.js +13 -0
- package/dist/form/revision.js.map +1 -0
- package/dist/hono/app.d.ts +19 -0
- package/dist/hono/app.js +21 -0
- package/dist/hono/app.js.map +1 -0
- package/dist/hono/handlers/_helpers/errors.d.ts +61 -0
- package/dist/hono/handlers/_helpers/errors.js +51 -0
- package/dist/hono/handlers/_helpers/errors.js.map +1 -0
- package/dist/hono/handlers/_helpers/user-shape.d.ts +46 -0
- package/dist/hono/handlers/_helpers/user-shape.js +23 -0
- package/dist/hono/handlers/_helpers/user-shape.js.map +1 -0
- package/dist/hono/handlers/access-token.d.ts +221 -0
- package/dist/hono/handlers/access-token.js +113 -0
- package/dist/hono/handlers/access-token.js.map +1 -0
- package/dist/hono/handlers/activation.d.ts +117 -0
- package/dist/hono/handlers/activation.js +77 -0
- package/dist/hono/handlers/activation.js.map +1 -0
- package/dist/hono/handlers/admin/app.d.ts +123 -0
- package/dist/hono/handlers/admin/app.js +76 -0
- package/dist/hono/handlers/admin/app.js.map +1 -0
- package/dist/hono/handlers/admin/auth.d.ts +127 -0
- package/dist/hono/handlers/admin/auth.js +91 -0
- package/dist/hono/handlers/admin/auth.js.map +1 -0
- package/dist/hono/handlers/admin/mail.d.ts +168 -0
- package/dist/hono/handlers/admin/mail.js +76 -0
- package/dist/hono/handlers/admin/mail.js.map +1 -0
- package/dist/hono/handlers/admin/plugins.d.ts +409 -0
- package/dist/hono/handlers/admin/plugins.js +257 -0
- package/dist/hono/handlers/admin/plugins.js.map +1 -0
- package/dist/hono/handlers/admin/search.d.ts +57 -0
- package/dist/hono/handlers/admin/search.js +55 -0
- package/dist/hono/handlers/admin/search.js.map +1 -0
- package/dist/hono/handlers/admin/security.d.ts +112 -0
- package/dist/hono/handlers/admin/security.js +71 -0
- package/dist/hono/handlers/admin/security.js.map +1 -0
- package/dist/hono/handlers/admin/share.d.ts +106 -0
- package/dist/hono/handlers/admin/share.js +55 -0
- package/dist/hono/handlers/admin/share.js.map +1 -0
- package/dist/hono/handlers/admin/storage.d.ts +55 -0
- package/dist/hono/handlers/admin/storage.js +40 -0
- package/dist/hono/handlers/admin/storage.js.map +1 -0
- package/dist/hono/handlers/admin/users.d.ts +1230 -0
- package/dist/hono/handlers/admin/users.js +316 -0
- package/dist/hono/handlers/admin/users.js.map +1 -0
- package/dist/hono/handlers/adminCrypto.d.ts +110 -0
- package/dist/hono/handlers/adminCrypto.js +151 -0
- package/dist/hono/handlers/adminCrypto.js.map +1 -0
- package/dist/hono/handlers/app.d.ts +26 -0
- package/dist/hono/handlers/app.js +34 -0
- package/dist/hono/handlers/app.js.map +1 -0
- package/dist/hono/handlers/attachment-stream.d.ts +4 -0
- package/dist/hono/handlers/attachment-stream.js +211 -0
- package/dist/hono/handlers/attachment-stream.js.map +1 -0
- package/dist/hono/handlers/attachment.d.ts +687 -0
- package/dist/hono/handlers/attachment.js +566 -0
- package/dist/hono/handlers/attachment.js.map +1 -0
- package/dist/hono/handlers/autocomplete.d.ts +160 -0
- package/dist/hono/handlers/autocomplete.js +181 -0
- package/dist/hono/handlers/autocomplete.js.map +1 -0
- package/dist/hono/handlers/backlink.d.ts +78 -0
- package/dist/hono/handlers/backlink.js +93 -0
- package/dist/hono/handlers/backlink.js.map +1 -0
- package/dist/hono/handlers/bookmark.d.ts +558 -0
- package/dist/hono/handlers/bookmark.js +166 -0
- package/dist/hono/handlers/bookmark.js.map +1 -0
- package/dist/hono/handlers/comment.d.ts +231 -0
- package/dist/hono/handlers/comment.js +191 -0
- package/dist/hono/handlers/comment.js.map +1 -0
- package/dist/hono/handlers/draft.d.ts +136 -0
- package/dist/hono/handlers/draft.js +191 -0
- package/dist/hono/handlers/draft.js.map +1 -0
- package/dist/hono/handlers/emailChange.d.ts +124 -0
- package/dist/hono/handlers/emailChange.js +79 -0
- package/dist/hono/handlers/emailChange.js.map +1 -0
- package/dist/hono/handlers/installer.d.ts +94 -0
- package/dist/hono/handlers/installer.js +93 -0
- package/dist/hono/handlers/installer.js.map +1 -0
- package/dist/hono/handlers/inviteAccept.d.ts +180 -0
- package/dist/hono/handlers/inviteAccept.js +94 -0
- package/dist/hono/handlers/inviteAccept.js.map +1 -0
- package/dist/hono/handlers/me.d.ts +401 -0
- package/dist/hono/handlers/me.js +390 -0
- package/dist/hono/handlers/me.js.map +1 -0
- package/dist/hono/handlers/notification.d.ts +274 -0
- package/dist/hono/handlers/notification.js +224 -0
- package/dist/hono/handlers/notification.js.map +1 -0
- package/dist/hono/handlers/oauth.d.ts +299 -0
- package/dist/hono/handlers/oauth.js +443 -0
- package/dist/hono/handlers/oauth.js.map +1 -0
- package/dist/hono/handlers/page-collab.d.ts +79 -0
- package/dist/hono/handlers/page-collab.js +98 -0
- package/dist/hono/handlers/page-collab.js.map +1 -0
- package/dist/hono/handlers/page-preview.d.ts +48 -0
- package/dist/hono/handlers/page-preview.js +83 -0
- package/dist/hono/handlers/page-preview.js.map +1 -0
- package/dist/hono/handlers/page.d.ts +2059 -0
- package/dist/hono/handlers/page.js +793 -0
- package/dist/hono/handlers/page.js.map +1 -0
- package/dist/hono/handlers/passwordReset.d.ts +181 -0
- package/dist/hono/handlers/passwordReset.js +101 -0
- package/dist/hono/handlers/passwordReset.js.map +1 -0
- package/dist/hono/handlers/presence.d.ts +178 -0
- package/dist/hono/handlers/presence.js +163 -0
- package/dist/hono/handlers/presence.js.map +1 -0
- package/dist/hono/handlers/revision.d.ts +345 -0
- package/dist/hono/handlers/revision.js +202 -0
- package/dist/hono/handlers/revision.js.map +1 -0
- package/dist/hono/handlers/search.d.ts +208 -0
- package/dist/hono/handlers/search.js +152 -0
- package/dist/hono/handlers/search.js.map +1 -0
- package/dist/hono/handlers/tokenAuth.d.ts +369 -0
- package/dist/hono/handlers/tokenAuth.js +240 -0
- package/dist/hono/handlers/tokenAuth.js.map +1 -0
- package/dist/hono/handlers/user.d.ts +710 -0
- package/dist/hono/handlers/user.js +212 -0
- package/dist/hono/handlers/user.js.map +1 -0
- package/dist/hono/index.d.ts +289 -0
- package/dist/hono/index.js +240 -0
- package/dist/hono/index.js.map +1 -0
- package/dist/hono/middleware/admin.d.ts +5 -0
- package/dist/hono/middleware/admin.js +34 -0
- package/dist/hono/middleware/admin.js.map +1 -0
- package/dist/hono/middleware/auth.d.ts +54 -0
- package/dist/hono/middleware/auth.js +142 -0
- package/dist/hono/middleware/auth.js.map +1 -0
- package/dist/hono/middleware/cors.d.ts +3 -0
- package/dist/hono/middleware/cors.js +86 -0
- package/dist/hono/middleware/cors.js.map +1 -0
- package/dist/hono/middleware/default-hook.d.ts +8 -0
- package/dist/hono/middleware/default-hook.js +17 -0
- package/dist/hono/middleware/default-hook.js.map +1 -0
- package/dist/hono/middleware/error-handler.d.ts +2 -0
- package/dist/hono/middleware/error-handler.js +20 -0
- package/dist/hono/middleware/error-handler.js.map +1 -0
- package/dist/hono/middleware/rate-limit.d.ts +57 -0
- package/dist/hono/middleware/rate-limit.js +42 -0
- package/dist/hono/middleware/rate-limit.js.map +1 -0
- package/dist/hono/middleware/require-scope.d.ts +50 -0
- package/dist/hono/middleware/require-scope.js +64 -0
- package/dist/hono/middleware/require-scope.js.map +1 -0
- package/dist/hono/path-rewrite.d.ts +15 -0
- package/dist/hono/path-rewrite.js +59 -0
- package/dist/hono/path-rewrite.js.map +1 -0
- package/dist/mail/i18n/en.d.ts +2 -0
- package/dist/mail/i18n/en.js +66 -0
- package/dist/mail/i18n/en.js.map +1 -0
- package/dist/mail/i18n/index.d.ts +46 -0
- package/dist/mail/i18n/index.js +31 -0
- package/dist/mail/i18n/index.js.map +1 -0
- package/dist/mail/i18n/ja.d.ts +2 -0
- package/dist/mail/i18n/ja.js +66 -0
- package/dist/mail/i18n/ja.js.map +1 -0
- package/dist/mcp/attach.d.ts +25 -0
- package/dist/mcp/attach.js +104 -0
- package/dist/mcp/attach.js.map +1 -0
- package/dist/mcp/dispatch.d.ts +59 -0
- package/dist/mcp/dispatch.js +70 -0
- package/dist/mcp/dispatch.js.map +1 -0
- package/dist/mcp/result.d.ts +40 -0
- package/dist/mcp/result.js +78 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/server.d.ts +67 -0
- package/dist/mcp/server.js +113 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/page.d.ts +2 -0
- package/dist/mcp/tools/page.js +256 -0
- package/dist/mcp/tools/page.js.map +1 -0
- package/dist/mcp/tools/search.d.ts +2 -0
- package/dist/mcp/tools/search.js +36 -0
- package/dist/mcp/tools/search.js.map +1 -0
- package/dist/middlewares/accessTokenParser.d.ts +4 -0
- package/dist/middlewares/accessTokenParser.js +29 -0
- package/dist/middlewares/accessTokenParser.js.map +1 -0
- package/dist/middlewares/adminRequired.d.ts +10 -0
- package/dist/middlewares/adminRequired.js +35 -0
- package/dist/middlewares/adminRequired.js.map +1 -0
- package/dist/middlewares/applicationInstalled.d.ts +3 -0
- package/dist/middlewares/applicationInstalled.js +20 -0
- package/dist/middlewares/applicationInstalled.js.map +1 -0
- package/dist/middlewares/applicationNotInstalled.d.ts +3 -0
- package/dist/middlewares/applicationNotInstalled.js +13 -0
- package/dist/middlewares/applicationNotInstalled.js.map +1 -0
- package/dist/middlewares/basicAuth.d.ts +4 -0
- package/dist/middlewares/basicAuth.js +23 -0
- package/dist/middlewares/basicAuth.js.map +1 -0
- package/dist/middlewares/csrfVerify.d.ts +4 -0
- package/dist/middlewares/csrfVerify.js +24 -0
- package/dist/middlewares/csrfVerify.js.map +1 -0
- package/dist/middlewares/encodeSpace.d.ts +3 -0
- package/dist/middlewares/encodeSpace.js +14 -0
- package/dist/middlewares/encodeSpace.js.map +1 -0
- package/dist/middlewares/fileAccessRightOrLoginRequired.d.ts +4 -0
- package/dist/middlewares/fileAccessRightOrLoginRequired.js +29 -0
- package/dist/middlewares/fileAccessRightOrLoginRequired.js.map +1 -0
- package/dist/middlewares/index.d.ts +16 -0
- package/dist/middlewares/index.js +30 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/jwtAdminRequired.d.ts +8 -0
- package/dist/middlewares/jwtAdminRequired.js +35 -0
- package/dist/middlewares/jwtAdminRequired.js.map +1 -0
- package/dist/middlewares/jwtAuth.d.ts +4 -0
- package/dist/middlewares/jwtAuth.js +104 -0
- package/dist/middlewares/jwtAuth.js.map +1 -0
- package/dist/middlewares/loginChecker.d.ts +4 -0
- package/dist/middlewares/loginChecker.js +32 -0
- package/dist/middlewares/loginChecker.js.map +1 -0
- package/dist/middlewares/loginRequired.d.ts +4 -0
- package/dist/middlewares/loginRequired.js +88 -0
- package/dist/middlewares/loginRequired.js.map +1 -0
- package/dist/migration/cli-api.d.ts +83 -0
- package/dist/migration/cli-api.js +128 -0
- package/dist/migration/cli-api.js.map +1 -0
- package/dist/migration/migrations/index.d.ts +12 -0
- package/dist/migration/migrations/index.js +24 -0
- package/dist/migration/migrations/index.js.map +1 -0
- package/dist/migration/migrations/page-status-default.d.ts +25 -0
- package/dist/migration/migrations/page-status-default.js +79 -0
- package/dist/migration/migrations/page-status-default.js.map +1 -0
- package/dist/migration/migrations/revisions-schema-unify.d.ts +33 -0
- package/dist/migration/migrations/revisions-schema-unify.js +88 -0
- package/dist/migration/migrations/revisions-schema-unify.js.map +1 -0
- package/dist/migration/migrations/user-unique-prepare.d.ts +1 -0
- package/dist/migration/migrations/user-unique-prepare.js +214 -0
- package/dist/migration/migrations/user-unique-prepare.js.map +1 -0
- package/dist/migration/migrations/wikilink-format.d.ts +97 -0
- package/dist/migration/migrations/wikilink-format.js +418 -0
- package/dist/migration/migrations/wikilink-format.js.map +1 -0
- package/dist/migration/rebuild-api.d.ts +50 -0
- package/dist/migration/rebuild-api.js +45 -0
- package/dist/migration/rebuild-api.js.map +1 -0
- package/dist/migration/rebuild-runner.d.ts +64 -0
- package/dist/migration/rebuild-runner.js +42 -0
- package/dist/migration/rebuild-runner.js.map +1 -0
- package/dist/migration/rebuilds/index.d.ts +26 -0
- package/dist/migration/rebuilds/index.js +69 -0
- package/dist/migration/rebuilds/index.js.map +1 -0
- package/dist/migration/registry.d.ts +15 -0
- package/dist/migration/registry.js +96 -0
- package/dist/migration/registry.js.map +1 -0
- package/dist/migration/run-boot-migrations.d.ts +31 -0
- package/dist/migration/run-boot-migrations.js +95 -0
- package/dist/migration/run-boot-migrations.js.map +1 -0
- package/dist/migration/runner.d.ts +120 -0
- package/dist/migration/runner.js +276 -0
- package/dist/migration/runner.js.map +1 -0
- package/dist/migration/types.d.ts +153 -0
- package/dist/migration/types.js +13 -0
- package/dist/migration/types.js.map +1 -0
- package/dist/models/activity.d.ts +34 -0
- package/dist/models/activity.js +263 -0
- package/dist/models/activity.js.map +1 -0
- package/dist/models/attachment.d.ts +25 -0
- package/dist/models/attachment.js +82 -0
- package/dist/models/attachment.js.map +1 -0
- package/dist/models/backlink.d.ts +19 -0
- package/dist/models/backlink.js +138 -0
- package/dist/models/backlink.js.map +1 -0
- package/dist/models/bookmark.d.ts +28 -0
- package/dist/models/bookmark.js +136 -0
- package/dist/models/bookmark.js.map +1 -0
- package/dist/models/comment.d.ts +21 -0
- package/dist/models/comment.js +87 -0
- package/dist/models/comment.js.map +1 -0
- package/dist/models/config-sensitive.d.ts +21 -0
- package/dist/models/config-sensitive.js +71 -0
- package/dist/models/config-sensitive.js.map +1 -0
- package/dist/models/config.d.ts +34 -0
- package/dist/models/config.js +161 -0
- package/dist/models/config.js.map +1 -0
- package/dist/models/index.d.ts +30 -0
- package/dist/models/index.js +55 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/migration-application.d.ts +54 -0
- package/dist/models/migration-application.js +36 -0
- package/dist/models/migration-application.js.map +1 -0
- package/dist/models/notification.d.ts +28 -0
- package/dist/models/notification.js +285 -0
- package/dist/models/notification.js.map +1 -0
- package/dist/models/oauth-authorization-code.d.ts +34 -0
- package/dist/models/oauth-authorization-code.js +100 -0
- package/dist/models/oauth-authorization-code.js.map +1 -0
- package/dist/models/oauth-client.d.ts +36 -0
- package/dist/models/oauth-client.js +56 -0
- package/dist/models/oauth-client.js.map +1 -0
- package/dist/models/oauth-device-code.d.ts +55 -0
- package/dist/models/oauth-device-code.js +158 -0
- package/dist/models/oauth-device-code.js.map +1 -0
- package/dist/models/oauth-refresh-token.d.ts +31 -0
- package/dist/models/oauth-refresh-token.js +118 -0
- package/dist/models/oauth-refresh-token.js.map +1 -0
- package/dist/models/page-yjs-update.d.ts +35 -0
- package/dist/models/page-yjs-update.js +33 -0
- package/dist/models/page-yjs-update.js.map +1 -0
- package/dist/models/page.d.ts +200 -0
- package/dist/models/page.js +1117 -0
- package/dist/models/page.js.map +1 -0
- package/dist/models/personal-access-token.d.ts +30 -0
- package/dist/models/personal-access-token.js +107 -0
- package/dist/models/personal-access-token.js.map +1 -0
- package/dist/models/plugin-render-cache.d.ts +40 -0
- package/dist/models/plugin-render-cache.js +39 -0
- package/dist/models/plugin-render-cache.js.map +1 -0
- package/dist/models/revision.d.ts +145 -0
- package/dist/models/revision.js +241 -0
- package/dist/models/revision.js.map +1 -0
- package/dist/models/share.d.ts +38 -0
- package/dist/models/share.js +137 -0
- package/dist/models/share.js.map +1 -0
- package/dist/models/shareAccess.d.ts +20 -0
- package/dist/models/shareAccess.js +45 -0
- package/dist/models/shareAccess.js.map +1 -0
- package/dist/models/tracking.d.ts +14 -0
- package/dist/models/tracking.js +14 -0
- package/dist/models/tracking.js.map +1 -0
- package/dist/models/updatePost.d.ts +25 -0
- package/dist/models/updatePost.js +87 -0
- package/dist/models/updatePost.js.map +1 -0
- package/dist/models/user.d.ts +144 -0
- package/dist/models/user.js +681 -0
- package/dist/models/user.js.map +1 -0
- package/dist/models/watcher.d.ts +23 -0
- package/dist/models/watcher.js +75 -0
- package/dist/models/watcher.js.map +1 -0
- package/dist/notifications/attach.d.ts +63 -0
- package/dist/notifications/attach.js +426 -0
- package/dist/notifications/attach.js.map +1 -0
- package/dist/notifications/channel.d.ts +13 -0
- package/dist/notifications/channel.js +18 -0
- package/dist/notifications/channel.js.map +1 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.js +6 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/plugin-context.d.ts +22 -0
- package/dist/plugin/plugin-context.js +126 -0
- package/dist/plugin/plugin-context.js.map +1 -0
- package/dist/plugin/plugin-manager.d.ts +164 -0
- package/dist/plugin/plugin-manager.js +328 -0
- package/dist/plugin/plugin-manager.js.map +1 -0
- package/dist/plugin/plugin-namespace.d.ts +28 -0
- package/dist/plugin/plugin-namespace.js +53 -0
- package/dist/plugin/plugin-namespace.js.map +1 -0
- package/dist/plugin/registries.d.ts +38 -0
- package/dist/plugin/registries.js +71 -0
- package/dist/plugin/registries.js.map +1 -0
- package/dist/plugin/schema-serializer.d.ts +34 -0
- package/dist/plugin/schema-serializer.js +122 -0
- package/dist/plugin/schema-serializer.js.map +1 -0
- package/dist/plugin/topo-sort.d.ts +15 -0
- package/dist/plugin/topo-sort.js +59 -0
- package/dist/plugin/topo-sort.js.map +1 -0
- package/dist/presence/attach.d.ts +36 -0
- package/dist/presence/attach.js +399 -0
- package/dist/presence/attach.js.map +1 -0
- package/dist/renderer/__fixtures__/echo-embed.d.ts +27 -0
- package/dist/renderer/__fixtures__/echo-embed.js +24 -0
- package/dist/renderer/__fixtures__/echo-embed.js.map +1 -0
- package/dist/renderer/cache/index.d.ts +60 -0
- package/dist/renderer/cache/index.js +219 -0
- package/dist/renderer/cache/index.js.map +1 -0
- package/dist/renderer/cache/mongodb-cache.d.ts +82 -0
- package/dist/renderer/cache/mongodb-cache.js +180 -0
- package/dist/renderer/cache/mongodb-cache.js.map +1 -0
- package/dist/renderer/cache/reservation.d.ts +20 -0
- package/dist/renderer/cache/reservation.js +115 -0
- package/dist/renderer/cache/reservation.js.map +1 -0
- package/dist/renderer/core/_mdast-walk.d.ts +35 -0
- package/dist/renderer/core/_mdast-walk.js +45 -0
- package/dist/renderer/core/_mdast-walk.js.map +1 -0
- package/dist/renderer/core/code-block-dispatch.d.ts +31 -0
- package/dist/renderer/core/code-block-dispatch.js +166 -0
- package/dist/renderer/core/code-block-dispatch.js.map +1 -0
- package/dist/renderer/core/code-blocks.d.ts +12 -0
- package/dist/renderer/core/code-blocks.js +32 -0
- package/dist/renderer/core/code-blocks.js.map +1 -0
- package/dist/renderer/core/embed-tags.d.ts +14 -0
- package/dist/renderer/core/embed-tags.js +154 -0
- package/dist/renderer/core/embed-tags.js.map +1 -0
- package/dist/renderer/core/headings.d.ts +16 -0
- package/dist/renderer/core/headings.js +31 -0
- package/dist/renderer/core/headings.js.map +1 -0
- package/dist/renderer/core/index.d.ts +65 -0
- package/dist/renderer/core/index.js +83 -0
- package/dist/renderer/core/index.js.map +1 -0
- package/dist/renderer/core/mention-resolve.d.ts +39 -0
- package/dist/renderer/core/mention-resolve.js +75 -0
- package/dist/renderer/core/mention-resolve.js.map +1 -0
- package/dist/renderer/core/mentions.d.ts +2 -0
- package/dist/renderer/core/mentions.js +83 -0
- package/dist/renderer/core/mentions.js.map +1 -0
- package/dist/renderer/core/syntax-highlight.d.ts +21 -0
- package/dist/renderer/core/syntax-highlight.js +64 -0
- package/dist/renderer/core/syntax-highlight.js.map +1 -0
- package/dist/renderer/core/url-inline-expand.d.ts +9 -0
- package/dist/renderer/core/url-inline-expand.js +157 -0
- package/dist/renderer/core/url-inline-expand.js.map +1 -0
- package/dist/renderer/core/wikilinks.d.ts +2 -0
- package/dist/renderer/core/wikilinks.js +118 -0
- package/dist/renderer/core/wikilinks.js.map +1 -0
- package/dist/renderer/index.d.ts +67 -0
- package/dist/renderer/index.js +99 -0
- package/dist/renderer/index.js.map +1 -0
- package/dist/renderer/pipeline.d.ts +134 -0
- package/dist/renderer/pipeline.js +203 -0
- package/dist/renderer/pipeline.js.map +1 -0
- package/dist/renderer/registry.d.ts +83 -0
- package/dist/renderer/registry.js +130 -0
- package/dist/renderer/registry.js.map +1 -0
- package/dist/renderer/serialize.d.ts +27 -0
- package/dist/renderer/serialize.js +46 -0
- package/dist/renderer/serialize.js.map +1 -0
- package/dist/renderer/version.d.ts +30 -0
- package/dist/renderer/version.js +34 -0
- package/dist/renderer/version.js.map +1 -0
- package/dist/routes/admin.d.ts +4 -0
- package/dist/routes/admin.js +17 -0
- package/dist/routes/admin.js.map +1 -0
- package/dist/routes/api/admin.d.ts +4 -0
- package/dist/routes/api/admin.js +37 -0
- package/dist/routes/api/admin.js.map +1 -0
- package/dist/routes/api/attachment.d.ts +4 -0
- package/dist/routes/api/attachment.js +19 -0
- package/dist/routes/api/attachment.js.map +1 -0
- package/dist/routes/api/bookmark.d.ts +4 -0
- package/dist/routes/api/bookmark.js +15 -0
- package/dist/routes/api/bookmark.js.map +1 -0
- package/dist/routes/api/comment.d.ts +4 -0
- package/dist/routes/api/comment.js +14 -0
- package/dist/routes/api/comment.js.map +1 -0
- package/dist/routes/api/index.d.ts +4 -0
- package/dist/routes/api/index.js +36 -0
- package/dist/routes/api/index.js.map +1 -0
- package/dist/routes/api/like.d.ts +4 -0
- package/dist/routes/api/like.js +13 -0
- package/dist/routes/api/like.js.map +1 -0
- package/dist/routes/api/notification.d.ts +4 -0
- package/dist/routes/api/notification.js +15 -0
- package/dist/routes/api/notification.js.map +1 -0
- package/dist/routes/api/page.d.ts +4 -0
- package/dist/routes/api/page.js +24 -0
- package/dist/routes/api/page.js.map +1 -0
- package/dist/routes/api/revision.d.ts +4 -0
- package/dist/routes/api/revision.js +14 -0
- package/dist/routes/api/revision.js.map +1 -0
- package/dist/routes/api/share.d.ts +4 -0
- package/dist/routes/api/share.js +16 -0
- package/dist/routes/api/share.js.map +1 -0
- package/dist/routes/api/version.d.ts +4 -0
- package/dist/routes/api/version.js +10 -0
- package/dist/routes/api/version.js.map +1 -0
- package/dist/routes/index.d.ts +4 -0
- package/dist/routes/index.js +71 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/login.d.ts +4 -0
- package/dist/routes/login.js +18 -0
- package/dist/routes/login.js.map +1 -0
- package/dist/routes/me.d.ts +4 -0
- package/dist/routes/me.js +24 -0
- package/dist/routes/me.js.map +1 -0
- package/dist/routes/ts-rest/admin/app.d.ts +4 -0
- package/dist/routes/ts-rest/admin/app.js +67 -0
- package/dist/routes/ts-rest/admin/app.js.map +1 -0
- package/dist/routes/ts-rest/admin/auth.d.ts +4 -0
- package/dist/routes/ts-rest/admin/auth.js +95 -0
- package/dist/routes/ts-rest/admin/auth.js.map +1 -0
- package/dist/routes/ts-rest/admin/index.d.ts +10 -0
- package/dist/routes/ts-rest/admin/index.js +35 -0
- package/dist/routes/ts-rest/admin/index.js.map +1 -0
- package/dist/routes/ts-rest/admin/mail.d.ts +4 -0
- package/dist/routes/ts-rest/admin/mail.js +156 -0
- package/dist/routes/ts-rest/admin/mail.js.map +1 -0
- package/dist/routes/ts-rest/admin/plugins.d.ts +4 -0
- package/dist/routes/ts-rest/admin/plugins.js +317 -0
- package/dist/routes/ts-rest/admin/plugins.js.map +1 -0
- package/dist/routes/ts-rest/admin/search.d.ts +4 -0
- package/dist/routes/ts-rest/admin/search.js +67 -0
- package/dist/routes/ts-rest/admin/search.js.map +1 -0
- package/dist/routes/ts-rest/admin/security.d.ts +4 -0
- package/dist/routes/ts-rest/admin/security.js +114 -0
- package/dist/routes/ts-rest/admin/security.js.map +1 -0
- package/dist/routes/ts-rest/admin/share.d.ts +4 -0
- package/dist/routes/ts-rest/admin/share.js +69 -0
- package/dist/routes/ts-rest/admin/share.js.map +1 -0
- package/dist/routes/ts-rest/admin/storage.d.ts +4 -0
- package/dist/routes/ts-rest/admin/storage.js +59 -0
- package/dist/routes/ts-rest/admin/storage.js.map +1 -0
- package/dist/routes/ts-rest/admin/users.d.ts +4 -0
- package/dist/routes/ts-rest/admin/users.js +215 -0
- package/dist/routes/ts-rest/admin/users.js.map +1 -0
- package/dist/routes/ts-rest/adminCrypto.d.ts +4 -0
- package/dist/routes/ts-rest/adminCrypto.js +111 -0
- package/dist/routes/ts-rest/adminCrypto.js.map +1 -0
- package/dist/routes/ts-rest/app.d.ts +4 -0
- package/dist/routes/ts-rest/app.js +23 -0
- package/dist/routes/ts-rest/app.js.map +1 -0
- package/dist/routes/ts-rest/attachment.d.ts +4 -0
- package/dist/routes/ts-rest/attachment.js +830 -0
- package/dist/routes/ts-rest/attachment.js.map +1 -0
- package/dist/routes/ts-rest/auth.d.ts +4 -0
- package/dist/routes/ts-rest/auth.js +70 -0
- package/dist/routes/ts-rest/auth.js.map +1 -0
- package/dist/routes/ts-rest/autocomplete.d.ts +30 -0
- package/dist/routes/ts-rest/autocomplete.js +189 -0
- package/dist/routes/ts-rest/autocomplete.js.map +1 -0
- package/dist/routes/ts-rest/backlink.d.ts +4 -0
- package/dist/routes/ts-rest/backlink.js +106 -0
- package/dist/routes/ts-rest/backlink.js.map +1 -0
- package/dist/routes/ts-rest/bookmark.d.ts +4 -0
- package/dist/routes/ts-rest/bookmark.js +189 -0
- package/dist/routes/ts-rest/bookmark.js.map +1 -0
- package/dist/routes/ts-rest/comment.d.ts +4 -0
- package/dist/routes/ts-rest/comment.js +217 -0
- package/dist/routes/ts-rest/comment.js.map +1 -0
- package/dist/routes/ts-rest/draft.d.ts +22 -0
- package/dist/routes/ts-rest/draft.js +200 -0
- package/dist/routes/ts-rest/draft.js.map +1 -0
- package/dist/routes/ts-rest/index.d.ts +4 -0
- package/dist/routes/ts-rest/index.js +103 -0
- package/dist/routes/ts-rest/index.js.map +1 -0
- package/dist/routes/ts-rest/installer.d.ts +4 -0
- package/dist/routes/ts-rest/installer.js +77 -0
- package/dist/routes/ts-rest/installer.js.map +1 -0
- package/dist/routes/ts-rest/me.d.ts +4 -0
- package/dist/routes/ts-rest/me.js +410 -0
- package/dist/routes/ts-rest/me.js.map +1 -0
- package/dist/routes/ts-rest/notification.d.ts +4 -0
- package/dist/routes/ts-rest/notification.js +241 -0
- package/dist/routes/ts-rest/notification.js.map +1 -0
- package/dist/routes/ts-rest/page-collab.d.ts +29 -0
- package/dist/routes/ts-rest/page-collab.js +90 -0
- package/dist/routes/ts-rest/page-collab.js.map +1 -0
- package/dist/routes/ts-rest/page-preview.d.ts +26 -0
- package/dist/routes/ts-rest/page-preview.js +80 -0
- package/dist/routes/ts-rest/page-preview.js.map +1 -0
- package/dist/routes/ts-rest/page.d.ts +4 -0
- package/dist/routes/ts-rest/page.js +676 -0
- package/dist/routes/ts-rest/page.js.map +1 -0
- package/dist/routes/ts-rest/presence.d.ts +30 -0
- package/dist/routes/ts-rest/presence.js +155 -0
- package/dist/routes/ts-rest/presence.js.map +1 -0
- package/dist/routes/ts-rest/revision.d.ts +4 -0
- package/dist/routes/ts-rest/revision.js +240 -0
- package/dist/routes/ts-rest/revision.js.map +1 -0
- package/dist/routes/ts-rest/search.d.ts +4 -0
- package/dist/routes/ts-rest/search.js +121 -0
- package/dist/routes/ts-rest/search.js.map +1 -0
- package/dist/routes/ts-rest/tokenAuth.d.ts +4 -0
- package/dist/routes/ts-rest/tokenAuth.js +94 -0
- package/dist/routes/ts-rest/tokenAuth.js.map +1 -0
- package/dist/routes/ts-rest/user.d.ts +4 -0
- package/dist/routes/ts-rest/user.js +307 -0
- package/dist/routes/ts-rest/user.js.map +1 -0
- package/dist/service/config.d.ts +50 -0
- package/dist/service/config.js +202 -0
- package/dist/service/config.js.map +1 -0
- package/dist/service/lru.d.ts +11 -0
- package/dist/service/lru.js +47 -0
- package/dist/service/lru.js.map +1 -0
- package/dist/service/mail.d.ts +107 -0
- package/dist/service/mail.js +220 -0
- package/dist/service/mail.js.map +1 -0
- package/dist/service/notification.d.ts +9 -0
- package/dist/service/notification.js +19 -0
- package/dist/service/notification.js.map +1 -0
- package/dist/service/presence.d.ts +219 -0
- package/dist/service/presence.js +602 -0
- package/dist/service/presence.js.map +1 -0
- package/dist/types/error.d.ts +13 -0
- package/dist/types/error.js +13 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/express.d.ts +34 -0
- package/dist/types/express.js +50 -0
- package/dist/types/express.js.map +1 -0
- package/dist/types/mongoose-extensions.d.ts +8 -0
- package/dist/types/mongoose-extensions.js +24 -0
- package/dist/types/mongoose-extensions.js.map +1 -0
- package/dist/util/accessTokenParser.d.ts +1 -0
- package/dist/util/accessTokenParser.js +34 -0
- package/dist/util/accessTokenParser.js.map +1 -0
- package/dist/util/activityDefine.d.ts +15 -0
- package/dist/util/activityDefine.js +52 -0
- package/dist/util/activityDefine.js.map +1 -0
- package/dist/util/admin-config.d.ts +57 -0
- package/dist/util/admin-config.js +99 -0
- package/dist/util/admin-config.js.map +1 -0
- package/dist/util/admin-pager.d.ts +24 -0
- package/dist/util/admin-pager.js +73 -0
- package/dist/util/admin-pager.js.map +1 -0
- package/dist/util/apiPaginate.d.ts +11 -0
- package/dist/util/apiPaginate.js +33 -0
- package/dist/util/apiPaginate.js.map +1 -0
- package/dist/util/apiResponse.d.ts +9 -0
- package/dist/util/apiResponse.js +23 -0
- package/dist/util/apiResponse.js.map +1 -0
- package/dist/util/auth.d.ts +11 -0
- package/dist/util/auth.js +48 -0
- package/dist/util/auth.js.map +1 -0
- package/dist/util/auto-watch.d.ts +35 -0
- package/dist/util/auto-watch.js +24 -0
- package/dist/util/auto-watch.js.map +1 -0
- package/dist/util/autocomplete-match.d.ts +44 -0
- package/dist/util/autocomplete-match.js +80 -0
- package/dist/util/autocomplete-match.js.map +1 -0
- package/dist/util/aws-config-migration.d.ts +11 -0
- package/dist/util/aws-config-migration.js +68 -0
- package/dist/util/aws-config-migration.js.map +1 -0
- package/dist/util/boot-reporter.d.ts +130 -0
- package/dist/util/boot-reporter.js +242 -0
- package/dist/util/boot-reporter.js.map +1 -0
- package/dist/util/collab-cap.d.ts +39 -0
- package/dist/util/collab-cap.js +90 -0
- package/dist/util/collab-cap.js.map +1 -0
- package/dist/util/crypto.d.ts +39 -0
- package/dist/util/crypto.js +105 -0
- package/dist/util/crypto.js.map +1 -0
- package/dist/util/dedup-users.d.ts +96 -0
- package/dist/util/dedup-users.js +149 -0
- package/dist/util/dedup-users.js.map +1 -0
- package/dist/util/editor-cap-counter.d.ts +90 -0
- package/dist/util/editor-cap-counter.js +175 -0
- package/dist/util/editor-cap-counter.js.map +1 -0
- package/dist/util/fileUploader.d.ts +55 -0
- package/dist/util/fileUploader.js +70 -0
- package/dist/util/fileUploader.js.map +1 -0
- package/dist/util/formUtil.d.ts +2 -0
- package/dist/util/formUtil.js +15 -0
- package/dist/util/formUtil.js.map +1 -0
- package/dist/util/githubAuth.d.ts +2 -0
- package/dist/util/githubAuth.js +82 -0
- package/dist/util/githubAuth.js.map +1 -0
- package/dist/util/googleAuth.d.ts +2 -0
- package/dist/util/googleAuth.js +85 -0
- package/dist/util/googleAuth.js.map +1 -0
- package/dist/util/jwt.d.ts +50 -0
- package/dist/util/jwt.js +127 -0
- package/dist/util/jwt.js.map +1 -0
- package/dist/util/linkDetector.d.ts +3 -0
- package/dist/util/linkDetector.js +91 -0
- package/dist/util/linkDetector.js.map +1 -0
- package/dist/util/mail-token.d.ts +24 -0
- package/dist/util/mail-token.js +117 -0
- package/dist/util/mail-token.js.map +1 -0
- package/dist/util/mailer.d.ts +7 -0
- package/dist/util/mailer.js +98 -0
- package/dist/util/mailer.js.map +1 -0
- package/dist/util/map-duplicate-key-error.d.ts +26 -0
- package/dist/util/map-duplicate-key-error.js +41 -0
- package/dist/util/map-duplicate-key-error.js.map +1 -0
- package/dist/util/mongoose-paginate.d.ts +10 -0
- package/dist/util/mongoose-paginate.js +23 -0
- package/dist/util/mongoose-paginate.js.map +1 -0
- package/dist/util/notifications-token.d.ts +35 -0
- package/dist/util/notifications-token.js +140 -0
- package/dist/util/notifications-token.js.map +1 -0
- package/dist/util/oauth-client-seed.d.ts +2 -0
- package/dist/util/oauth-client-seed.js +48 -0
- package/dist/util/oauth-client-seed.js.map +1 -0
- package/dist/util/oauth-redirect-uri.d.ts +2 -0
- package/dist/util/oauth-redirect-uri.js +55 -0
- package/dist/util/oauth-redirect-uri.js.map +1 -0
- package/dist/util/page-response.d.ts +113 -0
- package/dist/util/page-response.js +154 -0
- package/dist/util/page-response.js.map +1 -0
- package/dist/util/page-search-index.d.ts +19 -0
- package/dist/util/page-search-index.js +91 -0
- package/dist/util/page-search-index.js.map +1 -0
- package/dist/util/page-status-migration.d.ts +23 -0
- package/dist/util/page-status-migration.js +48 -0
- package/dist/util/page-status-migration.js.map +1 -0
- package/dist/util/path.d.ts +2 -0
- package/dist/util/path.js +12 -0
- package/dist/util/path.js.map +1 -0
- package/dist/util/pkce.d.ts +13 -0
- package/dist/util/pkce.js +30 -0
- package/dist/util/pkce.js.map +1 -0
- package/dist/util/presence-token.d.ts +21 -0
- package/dist/util/presence-token.js +120 -0
- package/dist/util/presence-token.js.map +1 -0
- package/dist/util/rate-limit.d.ts +67 -0
- package/dist/util/rate-limit.js +87 -0
- package/dist/util/rate-limit.js.map +1 -0
- package/dist/util/rebuild-backlink.d.ts +25 -0
- package/dist/util/rebuild-backlink.js +7 -0
- package/dist/util/rebuild-backlink.js.map +1 -0
- package/dist/util/rebuild-renderer.d.ts +31 -0
- package/dist/util/rebuild-renderer.js +7 -0
- package/dist/util/rebuild-renderer.js.map +1 -0
- package/dist/util/redis-opts.d.ts +17 -0
- package/dist/util/redis-opts.js +40 -0
- package/dist/util/redis-opts.js.map +1 -0
- package/dist/util/regex.d.ts +2 -0
- package/dist/util/regex.js +8 -0
- package/dist/util/regex.js.map +1 -0
- package/dist/util/search-rebuild.d.ts +18 -0
- package/dist/util/search-rebuild.js +28 -0
- package/dist/util/search-rebuild.js.map +1 -0
- package/dist/util/ssr.d.ts +3 -0
- package/dist/util/ssr.js +9 -0
- package/dist/util/ssr.js.map +1 -0
- package/dist/util/storage-copy.d.ts +40 -0
- package/dist/util/storage-copy.js +123 -0
- package/dist/util/storage-copy.js.map +1 -0
- package/dist/util/ts-rest-helpers.d.ts +110 -0
- package/dist/util/ts-rest-helpers.js +110 -0
- package/dist/util/ts-rest-helpers.js.map +1 -0
- package/dist/util/url.d.ts +1 -0
- package/dist/util/url.js +11 -0
- package/dist/util/url.js.map +1 -0
- package/dist/util/user-code.d.ts +10 -0
- package/dist/util/user-code.js +55 -0
- package/dist/util/user-code.js.map +1 -0
- package/dist/util/view.d.ts +10 -0
- package/dist/util/view.js +99 -0
- package/dist/util/view.js.map +1 -0
- package/dist/util/watcher-backfill.d.ts +30 -0
- package/dist/util/watcher-backfill.js +43 -0
- package/dist/util/watcher-backfill.js.map +1 -0
- package/dist/util/ws-token.d.ts +24 -0
- package/dist/util/ws-token.js +134 -0
- package/dist/util/ws-token.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.honoOnError = void 0;
|
|
7
|
+
const debug_1 = __importDefault(require("debug"));
|
|
8
|
+
const debug = (0, debug_1.default)('crowi:hono:onError');
|
|
9
|
+
const INTERNAL_ERROR_BODY = {
|
|
10
|
+
error: {
|
|
11
|
+
code: 'INTERNAL_ERROR',
|
|
12
|
+
message: 'Internal server error',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const honoOnError = (err, c) => {
|
|
16
|
+
debug('Unhandled error in Hono handler:', err);
|
|
17
|
+
return c.json(INTERNAL_ERROR_BODY, 500);
|
|
18
|
+
};
|
|
19
|
+
exports.honoOnError = honoOnError;
|
|
20
|
+
//# sourceMappingURL=error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../src/hono/middleware/error-handler.ts"],"names":[],"mappings":";;;;;;AAOA,kDAA0B;AAM1B,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,oBAAoB,CAAC,CAAC;AAE1C,MAAM,mBAAmB,GAAwB;IAC/C,KAAK,EAAE;QACL,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAC;AAEK,MAAM,WAAW,GAAG,CAAC,GAAU,EAAE,CAAU,EAAY,EAAE;IAC9D,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC;AAHW,QAAA,WAAW,eAGtB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC-0006 Phase 4 Batch 6 — Hono wrapper around `util/rate-limit.ts`.
|
|
3
|
+
*
|
|
4
|
+
* `createRateLimiter` is framework-agnostic (it just exposes
|
|
5
|
+
* `limiter.hit(userId)`), so the Hono side is a thin adapter that:
|
|
6
|
+
*
|
|
7
|
+
* 1. resolves the calling user via `c.get('user')` — the middleware
|
|
8
|
+
* MUST be installed AFTER `createJwtAuth(crowi)` so the user is
|
|
9
|
+
* populated. Apply order is enforced at the registration site
|
|
10
|
+
* (e.g. `autocomplete.ts` / `attachment.ts`); guard at the
|
|
11
|
+
* middleware so a mis-order fails loudly.
|
|
12
|
+
* 2. calls `limiter.hit(userId)` once per request.
|
|
13
|
+
* 3. emits the wire-identical 429 envelopes used by the ts-rest era:
|
|
14
|
+
* - `autocomplete` → `{ error: 'rate_limited', message,
|
|
15
|
+
* retryAfterSeconds }` (top-level shape from
|
|
16
|
+
* `AutocompleteRateLimitErrorSchema`).
|
|
17
|
+
* - `attachment-upload` → `{ error: 'rate_limited', message,
|
|
18
|
+
* details: { retryAfterSeconds } }` (lowercase RFC-0004 envelope
|
|
19
|
+
* from `UploadAttachmentErrorSchema`).
|
|
20
|
+
* A `Retry-After` header (whole seconds) is set on both paths so
|
|
21
|
+
* non-JSON clients can back off without parsing the body.
|
|
22
|
+
* 4. lets the request through (`await next()`) when within budget.
|
|
23
|
+
*
|
|
24
|
+
* Per-`crowi` limiter caching: `withRateLimit` itself does not own a
|
|
25
|
+
* limiter — it is given one by the resource handler so a single
|
|
26
|
+
* `createRateLimiter(...)` instance is shared across every request
|
|
27
|
+
* (Redis backed when `crowi.redis !== null`, in-memory fallback
|
|
28
|
+
* otherwise — see `util/rate-limit.ts`).
|
|
29
|
+
*/
|
|
30
|
+
import type { MiddlewareHandler } from '../../hono';
|
|
31
|
+
import type { RateLimiter } from '../../util/rate-limit';
|
|
32
|
+
import type { CrowiHonoBindings } from '../app';
|
|
33
|
+
/**
|
|
34
|
+
* Wire shape selector. Each migrated endpoint that needs rate-limiting
|
|
35
|
+
* declares which envelope its 429 should use; the helper has no opinion
|
|
36
|
+
* beyond matching the corresponding schema.
|
|
37
|
+
*
|
|
38
|
+
* - `autocomplete-envelope` matches `AutocompleteRateLimitErrorSchema`:
|
|
39
|
+
* `{ error: 'rate_limited', message, retryAfterSeconds }`.
|
|
40
|
+
* - `attachment-upload-envelope` matches `UploadAttachmentErrorSchema`
|
|
41
|
+
* with `error: 'rate_limited'`:
|
|
42
|
+
* `{ error: 'rate_limited', message, details: { retryAfterSeconds } }`.
|
|
43
|
+
*/
|
|
44
|
+
export type RateLimitWireShape = 'autocomplete-envelope' | 'attachment-upload-envelope';
|
|
45
|
+
export interface WithRateLimitOptions {
|
|
46
|
+
limiter: RateLimiter;
|
|
47
|
+
/** Wire shape of the 429 body for this endpoint family. */
|
|
48
|
+
wireShape: RateLimitWireShape;
|
|
49
|
+
/** Human-readable message embedded in the 429 body. */
|
|
50
|
+
message: (retryAfterSeconds: number) => string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Build a Hono middleware that counts one hit against `limiter` and
|
|
54
|
+
* short-circuits with the configured 429 envelope when the per-user
|
|
55
|
+
* budget is exceeded. MUST be installed AFTER `createJwtAuth(crowi)`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const withRateLimit: (options: WithRateLimitOptions) => MiddlewareHandler<CrowiHonoBindings>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withRateLimit = void 0;
|
|
4
|
+
const factory_1 = require("hono/factory");
|
|
5
|
+
/**
|
|
6
|
+
* Build a Hono middleware that counts one hit against `limiter` and
|
|
7
|
+
* short-circuits with the configured 429 envelope when the per-user
|
|
8
|
+
* budget is exceeded. MUST be installed AFTER `createJwtAuth(crowi)`.
|
|
9
|
+
*/
|
|
10
|
+
const withRateLimit = (options) => {
|
|
11
|
+
const { limiter, wireShape, message } = options;
|
|
12
|
+
return (0, factory_1.createMiddleware)(async (c, next) => {
|
|
13
|
+
const user = c.get('user');
|
|
14
|
+
if (!user) {
|
|
15
|
+
// Defensive: jwtAuth populates `user`. A missing value here would
|
|
16
|
+
// mean an apply-order bug at registration; surfacing it as a 401
|
|
17
|
+
// (rather than a 500) keeps the wire predictable.
|
|
18
|
+
return c.json({ error: { code: 'AUTHENTICATION_REQUIRED', message: 'Authentication is required' } }, 401);
|
|
19
|
+
}
|
|
20
|
+
const result = await limiter.hit(user._id.toString());
|
|
21
|
+
if (result.allowed) {
|
|
22
|
+
await next();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
c.header('Retry-After', String(result.retryAfterSeconds));
|
|
26
|
+
if (wireShape === 'autocomplete-envelope') {
|
|
27
|
+
return c.json({
|
|
28
|
+
error: 'rate_limited',
|
|
29
|
+
message: message(result.retryAfterSeconds),
|
|
30
|
+
retryAfterSeconds: result.retryAfterSeconds,
|
|
31
|
+
}, 429);
|
|
32
|
+
}
|
|
33
|
+
// attachment-upload-envelope
|
|
34
|
+
return c.json({
|
|
35
|
+
error: 'rate_limited',
|
|
36
|
+
message: message(result.retryAfterSeconds),
|
|
37
|
+
details: { retryAfterSeconds: result.retryAfterSeconds },
|
|
38
|
+
}, 429);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.withRateLimit = withRateLimit;
|
|
42
|
+
//# sourceMappingURL=rate-limit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../../../src/hono/middleware/rate-limit.ts"],"names":[],"mappings":";;;AA8BA,0CAAgD;AA2BhD;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,OAA6B,EAAwC,EAAE;IACnG,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEhD,OAAO,IAAA,0BAAgB,EAAoB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;QAC3D,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,kEAAkE;YAClE,iEAAiE;YACjE,kDAAkD;YAClD,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,yBAAkC,EAAE,OAAO,EAAE,4BAAqC,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9H,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,IAAI,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QAED,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAE1D,IAAI,SAAS,KAAK,uBAAuB,EAAE,CAAC;YAC1C,OAAO,CAAC,CAAC,IAAI,CACX;gBACE,KAAK,EAAE,cAAuB;gBAC9B,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;gBAC1C,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;aAC5C,EACD,GAAG,CACJ,CAAC;QACJ,CAAC;QAED,6BAA6B;QAC7B,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE,cAAuB;YAC9B,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;YAC1C,OAAO,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,EAAE;SACzD,EACD,GAAG,CACJ,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAzCW,QAAA,aAAa,iBAyCxB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC-0010 — `requireScope(scope)` route guard.
|
|
3
|
+
*
|
|
4
|
+
* Reads `authScopes` (set by `createJwtAuth`) and checks it against the
|
|
5
|
+
* route's required scope via `scopeSatisfies` (which encodes write→read
|
|
6
|
+
* and umbrella read/write implication). On failure it returns
|
|
7
|
+
* `403 INSUFFICIENT_SCOPE` with a `WWW-Authenticate: Bearer
|
|
8
|
+
* error="insufficient_scope"` header (RFC 6750 §3.1) so SDKs can detect a
|
|
9
|
+
* scope shortfall without parsing the body.
|
|
10
|
+
*
|
|
11
|
+
* Web sessions authenticate with `authScopes = ALL_SCOPES`, so every
|
|
12
|
+
* `requireScope` passes for them — the existing UI behaviour is
|
|
13
|
+
* unchanged. Only OAuth tokens (Phase 1) / PATs (Phase 2) are ever
|
|
14
|
+
* narrowed.
|
|
15
|
+
*
|
|
16
|
+
* MUST be installed AFTER `createJwtAuth(crowi)` so `authScopes` is
|
|
17
|
+
* populated; a missing value indicates an apply-order bug at the
|
|
18
|
+
* registration site and is surfaced as 401 (not 500) to keep the wire
|
|
19
|
+
* predictable.
|
|
20
|
+
*/
|
|
21
|
+
import { type Scope } from '@crowi/api-contract';
|
|
22
|
+
import type { Hono } from '../../hono';
|
|
23
|
+
import type { CrowiHonoBindings } from '../app';
|
|
24
|
+
/**
|
|
25
|
+
* A `@hono/zod-openapi` `createRoute(...)` definition exposes its HTTP
|
|
26
|
+
* method + path; we read both to attach the scope guard to the exact
|
|
27
|
+
* `method + path` pair (not the whole prefix — `GET /pages` is read but
|
|
28
|
+
* `POST /pages` is write).
|
|
29
|
+
*/
|
|
30
|
+
type RouteLike = {
|
|
31
|
+
method: string;
|
|
32
|
+
path: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Attach `requireScope(scope)` to a single `method + path` route on the
|
|
36
|
+
* shared Hono chain. Registering as a method-scoped middleware (via
|
|
37
|
+
* `app.on`) BEFORE the `.openapi(route, handler)` call means the guard
|
|
38
|
+
* runs first and the handler only sees scope-satisfied requests.
|
|
39
|
+
*
|
|
40
|
+
* Using the contract route's own `method` / `path` keeps the scope
|
|
41
|
+
* mapping declarative and free of stringly-typed path drift — the path
|
|
42
|
+
* comes from the same object the handler registers.
|
|
43
|
+
*
|
|
44
|
+
* `app` is typed as the bare `Hono` to avoid extending the already-deep
|
|
45
|
+
* `OpenAPIHono` chain (TS2589); the middleware itself is fully typed
|
|
46
|
+
* against `CrowiHonoBindings`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const applyScope: (app: Hono<CrowiHonoBindings>, route: RouteLike, scope: Scope) => void;
|
|
49
|
+
export declare const requireScope: (scope: Scope) => import("../../hono").MiddlewareHandler<CrowiHonoBindings, string, {}, Response>;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requireScope = exports.applyScope = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* RFC-0010 — `requireScope(scope)` route guard.
|
|
6
|
+
*
|
|
7
|
+
* Reads `authScopes` (set by `createJwtAuth`) and checks it against the
|
|
8
|
+
* route's required scope via `scopeSatisfies` (which encodes write→read
|
|
9
|
+
* and umbrella read/write implication). On failure it returns
|
|
10
|
+
* `403 INSUFFICIENT_SCOPE` with a `WWW-Authenticate: Bearer
|
|
11
|
+
* error="insufficient_scope"` header (RFC 6750 §3.1) so SDKs can detect a
|
|
12
|
+
* scope shortfall without parsing the body.
|
|
13
|
+
*
|
|
14
|
+
* Web sessions authenticate with `authScopes = ALL_SCOPES`, so every
|
|
15
|
+
* `requireScope` passes for them — the existing UI behaviour is
|
|
16
|
+
* unchanged. Only OAuth tokens (Phase 1) / PATs (Phase 2) are ever
|
|
17
|
+
* narrowed.
|
|
18
|
+
*
|
|
19
|
+
* MUST be installed AFTER `createJwtAuth(crowi)` so `authScopes` is
|
|
20
|
+
* populated; a missing value indicates an apply-order bug at the
|
|
21
|
+
* registration site and is surfaced as 401 (not 500) to keep the wire
|
|
22
|
+
* predictable.
|
|
23
|
+
*/
|
|
24
|
+
const api_contract_1 = require("@crowi/api-contract");
|
|
25
|
+
const factory_1 = require("hono/factory");
|
|
26
|
+
const auth_1 = require("./auth");
|
|
27
|
+
/**
|
|
28
|
+
* Attach `requireScope(scope)` to a single `method + path` route on the
|
|
29
|
+
* shared Hono chain. Registering as a method-scoped middleware (via
|
|
30
|
+
* `app.on`) BEFORE the `.openapi(route, handler)` call means the guard
|
|
31
|
+
* runs first and the handler only sees scope-satisfied requests.
|
|
32
|
+
*
|
|
33
|
+
* Using the contract route's own `method` / `path` keeps the scope
|
|
34
|
+
* mapping declarative and free of stringly-typed path drift — the path
|
|
35
|
+
* comes from the same object the handler registers.
|
|
36
|
+
*
|
|
37
|
+
* `app` is typed as the bare `Hono` to avoid extending the already-deep
|
|
38
|
+
* `OpenAPIHono` chain (TS2589); the middleware itself is fully typed
|
|
39
|
+
* against `CrowiHonoBindings`.
|
|
40
|
+
*/
|
|
41
|
+
const applyScope = (app, route, scope) => {
|
|
42
|
+
app.on(route.method, route.path, (0, exports.requireScope)(scope));
|
|
43
|
+
};
|
|
44
|
+
exports.applyScope = applyScope;
|
|
45
|
+
const requireScope = (scope) => (0, factory_1.createMiddleware)(async (c, next) => {
|
|
46
|
+
const authScopes = c.get('authScopes');
|
|
47
|
+
if (!authScopes) {
|
|
48
|
+
return c.json(auth_1.AUTH_REQUIRED_BODY, 401);
|
|
49
|
+
}
|
|
50
|
+
if (!(0, api_contract_1.scopeSatisfies)(scope, authScopes)) {
|
|
51
|
+
c.header('WWW-Authenticate', `Bearer error="insufficient_scope", scope="${scope}"`);
|
|
52
|
+
const body = {
|
|
53
|
+
error: {
|
|
54
|
+
code: 'INSUFFICIENT_SCOPE',
|
|
55
|
+
message: `This action requires the '${scope}' scope.`,
|
|
56
|
+
details: { requiredScope: scope },
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
return c.json(body, 403);
|
|
60
|
+
}
|
|
61
|
+
await next();
|
|
62
|
+
});
|
|
63
|
+
exports.requireScope = requireScope;
|
|
64
|
+
//# sourceMappingURL=require-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-scope.js","sourceRoot":"","sources":["../../../src/hono/middleware/require-scope.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,sDAA8F;AAE9F,0CAAgD;AAGhD,iCAA4C;AAU5C;;;;;;;;;;;;;GAaG;AACI,MAAM,UAAU,GAAG,CAAC,GAA4B,EAAE,KAAgB,EAAE,KAAY,EAAQ,EAAE;IAC/F,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB;AAEK,MAAM,YAAY,GAAG,CAAC,KAAY,EAAE,EAAE,CAC3C,IAAA,0BAAgB,EAAoB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE;IACpD,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACvC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,CAAC,CAAC,IAAI,CAAC,yBAAkB,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,IAAA,6BAAc,EAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;QACvC,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,6CAA6C,KAAK,GAAG,CAAC,CAAC;QACpF,MAAM,IAAI,GAA2B;YACnC,KAAK,EAAE;gBACL,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,6BAA6B,KAAK,UAAU;gBACrD,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;aAClC;SACF,CAAC;QACF,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,EAAE,CAAC;AACf,CAAC,CAAC,CAAC;AApBQ,QAAA,YAAY,gBAoBpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a new `Request` whose URL has the leading `/api/v2` removed
|
|
3
|
+
* (`/api/v2/foo/bar` → `/foo/bar`, `/api/v2` → `/`). All other
|
|
4
|
+
* properties (method / headers / body / signal) are preserved by
|
|
5
|
+
* re-using the original `Request` object as the second argument to
|
|
6
|
+
* the `Request` constructor.
|
|
7
|
+
*
|
|
8
|
+
* Requests that do not start with the prefix are returned unchanged.
|
|
9
|
+
*
|
|
10
|
+
* `duplex: 'half'` is passed alongside so the undici-backed `Request`
|
|
11
|
+
* constructor accepts a streaming body (Node 20+ rejects a Request
|
|
12
|
+
* with a stream body unless `duplex` is set). It's a no-op for
|
|
13
|
+
* GET/HEAD or already-buffered bodies.
|
|
14
|
+
*/
|
|
15
|
+
export declare function stripApiV2Prefix(request: Request): Request;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripApiV2Prefix = stripApiV2Prefix;
|
|
4
|
+
/**
|
|
5
|
+
* RFC-0006 Phase 6 Sub-batch D — `/api/v2` prefix stripper.
|
|
6
|
+
*
|
|
7
|
+
* The OpenAPI contracts in `@crowi/api-contract` register every route
|
|
8
|
+
* at its un-prefixed path (`/app/info`, `/pages/:id`, ...) — keeping
|
|
9
|
+
* the path literal short keeps the inferred `AppType` chain shallow,
|
|
10
|
+
* which matters for the `hc<AppType>` client (RFC-0006 Phase 4 hit
|
|
11
|
+
* TS2589 on a deeper chain).
|
|
12
|
+
*
|
|
13
|
+
* Production traffic arrives as `/api/v2/<path>`. Rather than re-mount
|
|
14
|
+
* every route through `app.route('/api/v2', child)` (which re-engages
|
|
15
|
+
* the AppType chain — see the TS2589 note in
|
|
16
|
+
* `packages/api-contract/src/client.ts`), we strip the prefix on the
|
|
17
|
+
* boundary: the production listener in `crowi/index.ts:start()` and
|
|
18
|
+
* the test request listener in `src/test/setup.ts` both pre-process
|
|
19
|
+
* the inbound `Request` here.
|
|
20
|
+
*
|
|
21
|
+
* Paths that do not start with `/api/v2` are returned unchanged — the
|
|
22
|
+
* `/docs` + `/openapi.json` documentation routes inside Hono are
|
|
23
|
+
* already at the root and we want them addressable at
|
|
24
|
+
* `/api/v2/docs` / `/api/v2/openapi.json` once stripped. (See
|
|
25
|
+
* `src/hono/index.ts` for those route registrations.)
|
|
26
|
+
*/
|
|
27
|
+
const PREFIX = '/api/v2';
|
|
28
|
+
/**
|
|
29
|
+
* Return a new `Request` whose URL has the leading `/api/v2` removed
|
|
30
|
+
* (`/api/v2/foo/bar` → `/foo/bar`, `/api/v2` → `/`). All other
|
|
31
|
+
* properties (method / headers / body / signal) are preserved by
|
|
32
|
+
* re-using the original `Request` object as the second argument to
|
|
33
|
+
* the `Request` constructor.
|
|
34
|
+
*
|
|
35
|
+
* Requests that do not start with the prefix are returned unchanged.
|
|
36
|
+
*
|
|
37
|
+
* `duplex: 'half'` is passed alongside so the undici-backed `Request`
|
|
38
|
+
* constructor accepts a streaming body (Node 20+ rejects a Request
|
|
39
|
+
* with a stream body unless `duplex` is set). It's a no-op for
|
|
40
|
+
* GET/HEAD or already-buffered bodies.
|
|
41
|
+
*/
|
|
42
|
+
function stripApiV2Prefix(request) {
|
|
43
|
+
const url = new URL(request.url);
|
|
44
|
+
if (url.pathname === PREFIX) {
|
|
45
|
+
url.pathname = '/';
|
|
46
|
+
}
|
|
47
|
+
else if (url.pathname.startsWith(`${PREFIX}/`)) {
|
|
48
|
+
url.pathname = url.pathname.slice(PREFIX.length);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return request;
|
|
52
|
+
}
|
|
53
|
+
// Re-use the original Request as the init; the constructor copies
|
|
54
|
+
// method / headers / body / signal. Passing a Request as init avoids
|
|
55
|
+
// having to set `duplex: 'half'` manually for stream bodies — the
|
|
56
|
+
// platform inherits the duplex hint from the source Request.
|
|
57
|
+
return new Request(url.toString(), request);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=path-rewrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-rewrite.js","sourceRoot":"","sources":["../../src/hono/path-rewrite.ts"],"names":[],"mappings":";;AAuCA,4CAcC;AArDD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,GAAG,SAAS,CAAC;AAEzB;;;;;;;;;;;;;GAaG;AACH,SAAgB,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC5B,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC;IACrB,CAAC;SAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;SAAM,CAAC;QACN,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,kEAAkE;IAClE,qEAAqE;IACrE,kEAAkE;IAClE,6DAA6D;IAC7D,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.en = void 0;
|
|
4
|
+
exports.en = {
|
|
5
|
+
invite: {
|
|
6
|
+
subject: "You're invited to {{ appTitle }}",
|
|
7
|
+
preheader: 'Accept your invitation and set up your account.',
|
|
8
|
+
heading: "You've been invited",
|
|
9
|
+
intro: 'You have been invited to join the wiki. Click the button below to choose your username and password and activate your account.',
|
|
10
|
+
cta: 'Accept invitation',
|
|
11
|
+
expiresNote: 'This invitation link expires in 7 days.',
|
|
12
|
+
ignoreNote: "If you weren't expecting this invitation, you can safely ignore this email.",
|
|
13
|
+
},
|
|
14
|
+
activation: {
|
|
15
|
+
subject: 'Confirm your email for {{ appTitle }}',
|
|
16
|
+
preheader: 'Confirm your email address to activate your account.',
|
|
17
|
+
heading: 'Confirm your email',
|
|
18
|
+
intro: 'Thanks for registering. Please confirm your email address to activate your account by clicking the button below.',
|
|
19
|
+
cta: 'Confirm email',
|
|
20
|
+
expiresNote: 'This confirmation link expires in 24 hours.',
|
|
21
|
+
ignoreNote: "If you didn't create this account, you can safely ignore this email.",
|
|
22
|
+
},
|
|
23
|
+
passwordReset: {
|
|
24
|
+
subject: 'Reset your password for {{ appTitle }}',
|
|
25
|
+
preheader: 'Reset your password.',
|
|
26
|
+
heading: 'Reset your password',
|
|
27
|
+
intro: 'We received a request to reset your password. Click the button below to choose a new one.',
|
|
28
|
+
cta: 'Reset password',
|
|
29
|
+
expiresNote: 'This password reset link expires in 1 hour.',
|
|
30
|
+
ignoreNote: "If you didn't request a password reset, you can safely ignore this email — your password will stay the same.",
|
|
31
|
+
},
|
|
32
|
+
test: {
|
|
33
|
+
subject: '{{ appTitle }}: test email',
|
|
34
|
+
preheader: 'Your mail settings are working.',
|
|
35
|
+
heading: 'Your mail settings are working',
|
|
36
|
+
intro: 'This is a test message sent from the admin mail settings page. If you received it, outgoing email is configured correctly.',
|
|
37
|
+
},
|
|
38
|
+
passwordChanged: {
|
|
39
|
+
subject: 'Your {{ appTitle }} password was changed',
|
|
40
|
+
preheader: 'Your password was just changed.',
|
|
41
|
+
heading: 'Your password was changed',
|
|
42
|
+
intro: 'This is a confirmation that the password for your account was just changed.',
|
|
43
|
+
ignoreNote: "If you didn't make this change, please reset your password immediately and contact your administrator.",
|
|
44
|
+
},
|
|
45
|
+
adminApprovalPending: {
|
|
46
|
+
subject: 'A new user is awaiting approval on {{ appTitle }}',
|
|
47
|
+
preheader: 'A self-registered user needs your approval.',
|
|
48
|
+
heading: 'A user is awaiting approval',
|
|
49
|
+
intro: 'A new user has registered and is waiting for an administrator to approve their account:',
|
|
50
|
+
cta: 'Review users',
|
|
51
|
+
},
|
|
52
|
+
emailChange: {
|
|
53
|
+
subject: 'Confirm your new email address for {{ appTitle }}',
|
|
54
|
+
preheader: 'Confirm your new email address.',
|
|
55
|
+
heading: 'Confirm your new email address',
|
|
56
|
+
intro: 'A request was made to change the email address for your account to this one. Click the button below to confirm the change.',
|
|
57
|
+
cta: 'Confirm new email',
|
|
58
|
+
expiresNote: 'This confirmation link expires in 24 hours.',
|
|
59
|
+
ignoreNote: "If you didn't request this change, you can safely ignore this email — your address will stay the same.",
|
|
60
|
+
},
|
|
61
|
+
common: {
|
|
62
|
+
footerTagline: 'Empower the team with sharing your knowledge.',
|
|
63
|
+
linkFallback: "If the button above doesn't work, copy and paste this URL into your browser:",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../../src/mail/i18n/en.ts"],"names":[],"mappings":";;;AAEa,QAAA,EAAE,GAAgB;IAC7B,MAAM,EAAE;QACN,OAAO,EAAE,kCAAkC;QAC3C,SAAS,EAAE,iDAAiD;QAC5D,OAAO,EAAE,qBAAqB;QAC9B,KAAK,EAAE,gIAAgI;QACvI,GAAG,EAAE,mBAAmB;QACxB,WAAW,EAAE,yCAAyC;QACtD,UAAU,EAAE,6EAA6E;KAC1F;IACD,UAAU,EAAE;QACV,OAAO,EAAE,uCAAuC;QAChD,SAAS,EAAE,sDAAsD;QACjE,OAAO,EAAE,oBAAoB;QAC7B,KAAK,EAAE,kHAAkH;QACzH,GAAG,EAAE,eAAe;QACpB,WAAW,EAAE,6CAA6C;QAC1D,UAAU,EAAE,sEAAsE;KACnF;IACD,aAAa,EAAE;QACb,OAAO,EAAE,wCAAwC;QACjD,SAAS,EAAE,sBAAsB;QACjC,OAAO,EAAE,qBAAqB;QAC9B,KAAK,EAAE,2FAA2F;QAClG,GAAG,EAAE,gBAAgB;QACrB,WAAW,EAAE,6CAA6C;QAC1D,UAAU,EAAE,8GAA8G;KAC3H;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,4BAA4B;QACrC,SAAS,EAAE,iCAAiC;QAC5C,OAAO,EAAE,gCAAgC;QACzC,KAAK,EAAE,4HAA4H;KACpI;IACD,eAAe,EAAE;QACf,OAAO,EAAE,0CAA0C;QACnD,SAAS,EAAE,iCAAiC;QAC5C,OAAO,EAAE,2BAA2B;QACpC,KAAK,EAAE,6EAA6E;QACpF,UAAU,EAAE,wGAAwG;KACrH;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,mDAAmD;QAC5D,SAAS,EAAE,6CAA6C;QACxD,OAAO,EAAE,6BAA6B;QACtC,KAAK,EAAE,yFAAyF;QAChG,GAAG,EAAE,cAAc;KACpB;IACD,WAAW,EAAE;QACX,OAAO,EAAE,mDAAmD;QAC5D,SAAS,EAAE,iCAAiC;QAC5C,OAAO,EAAE,gCAAgC;QACzC,KAAK,EAAE,4HAA4H;QACnI,GAAG,EAAE,mBAAmB;QACxB,WAAW,EAAE,6CAA6C;QAC1D,UAAU,EAAE,wGAAwG;KACrH;IACD,MAAM,EAAE;QACN,aAAa,EAAE,+CAA+C;QAC9D,YAAY,EAAE,8EAA8E;KAC7F;CACF,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strings for one email type. `subject` / `preheader` / `heading` /
|
|
3
|
+
* `intro` are shared by all; the link-related fields are optional so
|
|
4
|
+
* pure notification mails (no CTA) can omit them.
|
|
5
|
+
*/
|
|
6
|
+
export interface MailMessageStrings {
|
|
7
|
+
/** Subject line. MAY contain `{{ appTitle }}` (rendered standalone). */
|
|
8
|
+
subject: string;
|
|
9
|
+
/** Hidden inbox-preview text. */
|
|
10
|
+
preheader: string;
|
|
11
|
+
/** Main heading. */
|
|
12
|
+
heading: string;
|
|
13
|
+
/** Lead paragraph. */
|
|
14
|
+
intro: string;
|
|
15
|
+
/** Call-to-action button label (omit for notification-only mails). */
|
|
16
|
+
cta?: string;
|
|
17
|
+
/** Note about the link's expiry. */
|
|
18
|
+
expiresNote?: string;
|
|
19
|
+
/** "If you didn't expect this, ignore it" note. */
|
|
20
|
+
ignoreNote?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface MailCatalog {
|
|
23
|
+
invite: MailMessageStrings;
|
|
24
|
+
activation: MailMessageStrings;
|
|
25
|
+
passwordReset: MailMessageStrings;
|
|
26
|
+
/** Test mail from the admin mail settings page. */
|
|
27
|
+
test: MailMessageStrings;
|
|
28
|
+
/** Security notification: the account's password was changed. */
|
|
29
|
+
passwordChanged: MailMessageStrings;
|
|
30
|
+
/** Admin notification: a self-registered user is awaiting approval. */
|
|
31
|
+
adminApprovalPending: MailMessageStrings;
|
|
32
|
+
/** Confirm a requested email-address change (link sent to the new address). */
|
|
33
|
+
emailChange: MailMessageStrings;
|
|
34
|
+
common: {
|
|
35
|
+
/** Small line under the footer logo. */
|
|
36
|
+
footerTagline: string;
|
|
37
|
+
/** Fallback line: "If the button doesn't work, copy this URL". */
|
|
38
|
+
linkFallback: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a `MailCatalog` for a user language. Normalises regional
|
|
43
|
+
* variants (`en-US` / `en-GB` → `en`) and falls back to English for
|
|
44
|
+
* unknown / missing languages.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getMailCatalog(lang?: string): MailCatalog;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMailCatalog = getMailCatalog;
|
|
4
|
+
/**
|
|
5
|
+
* Lightweight i18n for transactional emails. The api has no general
|
|
6
|
+
* i18n runtime (the web uses paraglide), so mail strings live here as
|
|
7
|
+
* typed TS catalogs — one per language, structurally identical (the
|
|
8
|
+
* `MailCatalog` type guarantees no key drifts between en and ja).
|
|
9
|
+
*
|
|
10
|
+
* Catalog strings are brand-neutral and contain NO `{{ }}` placeholders
|
|
11
|
+
* (except `subject`, which the MailService renders standalone). Dynamic
|
|
12
|
+
* brand values (appTitle / appUrl / logoUrl / link URLs) come from
|
|
13
|
+
* `vars` and are placed by the MJML template structure, because a string
|
|
14
|
+
* injected via `{{ t.invite.intro }}` is not re-scanned for further
|
|
15
|
+
* placeholders.
|
|
16
|
+
*/
|
|
17
|
+
const en_1 = require("./en");
|
|
18
|
+
const ja_1 = require("./ja");
|
|
19
|
+
const CATALOGS = { en: en_1.en, ja: ja_1.ja };
|
|
20
|
+
/**
|
|
21
|
+
* Resolve a `MailCatalog` for a user language. Normalises regional
|
|
22
|
+
* variants (`en-US` / `en-GB` → `en`) and falls back to English for
|
|
23
|
+
* unknown / missing languages.
|
|
24
|
+
*/
|
|
25
|
+
function getMailCatalog(lang) {
|
|
26
|
+
if (lang && lang.toLowerCase().startsWith('ja')) {
|
|
27
|
+
return CATALOGS.ja;
|
|
28
|
+
}
|
|
29
|
+
return CATALOGS.en;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mail/i18n/index.ts"],"names":[],"mappings":";;AAiEA,wCAKC;AAtED;;;;;;;;;;;;GAYG;AACH,6BAA0B;AAC1B,6BAA0B;AA4C1B,MAAM,QAAQ,GAAqC,EAAE,EAAE,EAAF,OAAE,EAAE,EAAE,EAAF,OAAE,EAAE,CAAC;AAE9D;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAa;IAC1C,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IACD,OAAO,QAAQ,CAAC,EAAE,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ja = void 0;
|
|
4
|
+
exports.ja = {
|
|
5
|
+
invite: {
|
|
6
|
+
subject: '{{ appTitle }} への招待',
|
|
7
|
+
preheader: '招待を受けてアカウントをセットアップしてください。',
|
|
8
|
+
heading: '招待が届いています',
|
|
9
|
+
intro: 'Wiki に招待されました。下のボタンからユーザー名とパスワードを設定して、アカウントを有効化してください。',
|
|
10
|
+
cta: '招待を受ける',
|
|
11
|
+
expiresNote: 'この招待リンクは 7 日間有効です。',
|
|
12
|
+
ignoreNote: 'この招待に心当たりがない場合は、このメールを無視してください。',
|
|
13
|
+
},
|
|
14
|
+
activation: {
|
|
15
|
+
subject: '{{ appTitle }} のメールアドレス確認',
|
|
16
|
+
preheader: 'メールアドレスを確認してアカウントを有効化してください。',
|
|
17
|
+
heading: 'メールアドレスの確認',
|
|
18
|
+
intro: 'ご登録ありがとうございます。下のボタンからメールアドレスを確認して、アカウントを有効化してください。',
|
|
19
|
+
cta: 'メールアドレスを確認',
|
|
20
|
+
expiresNote: 'この確認リンクは 24 時間有効です。',
|
|
21
|
+
ignoreNote: 'このアカウントに心当たりがない場合は、このメールを無視してください。',
|
|
22
|
+
},
|
|
23
|
+
passwordReset: {
|
|
24
|
+
subject: '{{ appTitle }} のパスワード再設定',
|
|
25
|
+
preheader: 'パスワードを再設定してください。',
|
|
26
|
+
heading: 'パスワードの再設定',
|
|
27
|
+
intro: 'パスワード再設定のリクエストを受け付けました。下のボタンから新しいパスワードを設定してください。',
|
|
28
|
+
cta: 'パスワードを再設定',
|
|
29
|
+
expiresNote: 'このパスワード再設定リンクは 1 時間有効です。',
|
|
30
|
+
ignoreNote: 'パスワード再設定をリクエストしていない場合は、このメールを無視してください。パスワードは変更されません。',
|
|
31
|
+
},
|
|
32
|
+
test: {
|
|
33
|
+
subject: '{{ appTitle }}: テストメール',
|
|
34
|
+
preheader: 'メール設定は正常に動作しています。',
|
|
35
|
+
heading: 'メール設定は正常に動作しています',
|
|
36
|
+
intro: 'これは管理画面のメール設定から送信されたテストメールです。これが届いていれば、メール送信は正しく設定されています。',
|
|
37
|
+
},
|
|
38
|
+
passwordChanged: {
|
|
39
|
+
subject: '{{ appTitle }} のパスワードが変更されました',
|
|
40
|
+
preheader: 'パスワードが変更されました。',
|
|
41
|
+
heading: 'パスワードが変更されました',
|
|
42
|
+
intro: 'あなたのアカウントのパスワードが変更されたことをお知らせします。',
|
|
43
|
+
ignoreNote: 'この変更に心当たりがない場合は、ただちにパスワードを再設定し、管理者に連絡してください。',
|
|
44
|
+
},
|
|
45
|
+
adminApprovalPending: {
|
|
46
|
+
subject: '{{ appTitle }} に承認待ちのユーザーがいます',
|
|
47
|
+
preheader: '自己登録したユーザーの承認が必要です。',
|
|
48
|
+
heading: '承認待ちのユーザーがいます',
|
|
49
|
+
intro: '新しいユーザーが登録し、管理者による承認を待っています:',
|
|
50
|
+
cta: 'ユーザーを確認',
|
|
51
|
+
},
|
|
52
|
+
emailChange: {
|
|
53
|
+
subject: '{{ appTitle }} の新しいメールアドレスの確認',
|
|
54
|
+
preheader: '新しいメールアドレスを確認してください。',
|
|
55
|
+
heading: '新しいメールアドレスの確認',
|
|
56
|
+
intro: 'あなたのアカウントのメールアドレスをこのアドレスに変更するリクエストがありました。下のボタンをクリックして変更を確定してください。',
|
|
57
|
+
cta: '新しいメールアドレスを確認',
|
|
58
|
+
expiresNote: 'この確認リンクは 24 時間有効です。',
|
|
59
|
+
ignoreNote: 'この変更に心当たりがない場合は、このメールを無視してください。メールアドレスは変更されません。',
|
|
60
|
+
},
|
|
61
|
+
common: {
|
|
62
|
+
footerTagline: 'Empower the team with sharing your knowledge.',
|
|
63
|
+
linkFallback: '上のボタンが動作しない場合は、次の URL をブラウザに貼り付けてください:',
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=ja.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ja.js","sourceRoot":"","sources":["../../../src/mail/i18n/ja.ts"],"names":[],"mappings":";;;AAEa,QAAA,EAAE,GAAgB;IAC7B,MAAM,EAAE;QACN,OAAO,EAAE,qBAAqB;QAC9B,SAAS,EAAE,2BAA2B;QACtC,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,wDAAwD;QAC/D,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,oBAAoB;QACjC,UAAU,EAAE,iCAAiC;KAC9C;IACD,UAAU,EAAE;QACV,OAAO,EAAE,2BAA2B;QACpC,SAAS,EAAE,8BAA8B;QACzC,OAAO,EAAE,YAAY;QACrB,KAAK,EAAE,oDAAoD;QAC3D,GAAG,EAAE,YAAY;QACjB,WAAW,EAAE,qBAAqB;QAClC,UAAU,EAAE,oCAAoC;KACjD;IACD,aAAa,EAAE;QACb,OAAO,EAAE,0BAA0B;QACnC,SAAS,EAAE,kBAAkB;QAC7B,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,kDAAkD;QACzD,GAAG,EAAE,WAAW;QAChB,WAAW,EAAE,0BAA0B;QACvC,UAAU,EAAE,sDAAsD;KACnE;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,wBAAwB;QACjC,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,kBAAkB;QAC3B,KAAK,EAAE,2DAA2D;KACnE;IACD,eAAe,EAAE;QACf,OAAO,EAAE,+BAA+B;QACxC,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,kCAAkC;QACzC,UAAU,EAAE,8CAA8C;KAC3D;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,+BAA+B;QACxC,SAAS,EAAE,qBAAqB;QAChC,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,8BAA8B;QACrC,GAAG,EAAE,SAAS;KACf;IACD,WAAW,EAAE;QACX,OAAO,EAAE,+BAA+B;QACxC,SAAS,EAAE,sBAAsB;QACjC,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,mEAAmE;QAC1E,GAAG,EAAE,eAAe;QACpB,WAAW,EAAE,qBAAqB;QAClC,UAAU,EAAE,iDAAiD;KAC9D;IACD,MAAM,EAAE;QACN,aAAa,EAAE,+CAA+C;QAC9D,YAAY,EAAE,wCAAwC;KACvD;CACF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC-0011 §7 — attach the built-in MCP server to the Hono app.
|
|
3
|
+
*
|
|
4
|
+
* `attachMcp(app, crowi)` registers `app.all('/mcp', …)` under
|
|
5
|
+
* `createJwtAuth(crowi)` so the request carries an authenticated user +
|
|
6
|
+
* `authScopes` (PAT or OAuth access token — no new auth code, RFC-0011
|
|
7
|
+
* §5.1). Per-tool scope is NOT enforced here: each tool dispatches to a
|
|
8
|
+
* scoped route that runs `requireScope` itself (RFC-0011 §5.2), so a
|
|
9
|
+
* read-only token calling a write tool gets the route's 403 mapped to an
|
|
10
|
+
* MCP `isError` result.
|
|
11
|
+
*
|
|
12
|
+
* Unlike `collab/attach.ts` / `notifications/attach.ts` (which attach a
|
|
13
|
+
* WS upgrade handler to the `http.Server`), `/mcp` is a normal Hono
|
|
14
|
+
* route, so this is called **inside `buildHonoApp`** (RFC-0011 §7).
|
|
15
|
+
*
|
|
16
|
+
* Transport: `@hono/mcp`'s `StreamableHTTPTransport`, **stateless /
|
|
17
|
+
* per-request** (`sessionIdGenerator: undefined`) — matches Crowi's
|
|
18
|
+
* per-request JWT model and needs no sticky sessions for multi-instance
|
|
19
|
+
* deployments (RFC-0011 §4). A fresh `McpServer` + transport per request
|
|
20
|
+
* binds that request's identity (the forwarded bearer).
|
|
21
|
+
*/
|
|
22
|
+
import type { OpenAPIHono } from '@hono/zod-openapi';
|
|
23
|
+
import type Crowi from '../crowi';
|
|
24
|
+
import type { CrowiHonoBindings } from '../hono/app';
|
|
25
|
+
export declare const attachMcp: (app: OpenAPIHono<CrowiHonoBindings>, crowi: Crowi) => void;
|