emdash 0.20.0 → 0.22.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/dist/{adapters-BzIHV3sw.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
- package/dist/{adapters-BzIHV3sw.d.mts.map → adapters-hUy8vOB-.d.mts.map} +1 -1
- package/dist/after-B1IIdH3Y.mjs +29 -0
- package/dist/after-B1IIdH3Y.mjs.map +1 -0
- package/dist/{allowed-origins-B1u7Qnvg.mjs → allowed-origins-DjlhyfNN.mjs} +2 -2
- package/dist/{allowed-origins-B1u7Qnvg.mjs.map → allowed-origins-DjlhyfNN.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +20 -18
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +4 -3
- package/dist/{api-DStv36ik.mjs → api-BDuM4bEy.mjs} +31 -25
- package/dist/api-BDuM4bEy.mjs.map +1 -0
- package/dist/{api-tokens-DPfhPu5V.mjs → api-tokens-ViYKeIp9.mjs} +13 -3
- package/dist/api-tokens-ViYKeIp9.mjs.map +1 -0
- package/dist/{apply-Dr7snAMT.mjs → apply-wDqQoxX4.mjs} +18 -18
- package/dist/{apply-Dr7snAMT.mjs.map → apply-wDqQoxX4.mjs.map} +1 -1
- package/dist/astro/image-endpoint.d.mts +8 -0
- package/dist/astro/image-endpoint.d.mts.map +1 -0
- package/dist/astro/image-endpoint.mjs +55 -0
- package/dist/astro/image-endpoint.mjs.map +1 -0
- package/dist/astro/index.d.mts +36 -11
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +160 -35
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +12 -10
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +14 -5
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +5 -4
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +157 -80
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -9
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +15 -12
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -6
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -9
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -6
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -9
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +40 -37
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +40 -37
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +40 -37
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +40 -37
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +39 -36
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +39 -36
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +39 -36
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/index.mjs +7 -6
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +8 -7
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -6
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -10
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +16 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +9 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +179 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -11
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -14
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -7
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +10 -8
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +12 -11
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +16 -14
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +10 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +12 -11
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +18 -15
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +213 -45
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -7
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +8 -7
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +10 -9
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +13 -12
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -8
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +11 -8
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -8
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -8
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +11 -8
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +11 -8
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +5 -4
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +12 -11
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +12 -11
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +39 -36
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +39 -36
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +39 -36
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +39 -36
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +39 -36
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +7 -7
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +39 -36
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +39 -36
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +11 -10
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +10 -9
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +11 -10
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +10 -9
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +10 -9
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +10 -9
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +16 -13
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -12
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +12 -11
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +29 -26
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +29 -26
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.d.mts.map +1 -1
- package/dist/astro/routes/api/snapshot.mjs +10 -8
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -13
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -7
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +8 -7
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -10
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -10
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/index.mjs +11 -10
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +10 -8
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -11
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +11 -9
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +16 -12
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-DsMSVSaY.mjs → authorize-C0EYoUeV.mjs} +2 -2
- package/dist/{authorize-DsMSVSaY.mjs.map → authorize-C0EYoUeV.mjs.map} +1 -1
- package/dist/{base64-CqR-7kqF.mjs → base64-CmWvODNW.mjs} +1 -1
- package/dist/{base64-CqR-7kqF.mjs.map → base64-CmWvODNW.mjs.map} +1 -1
- package/dist/{byline-DUx48sJp.mjs → byline-CC0WS4Gu.mjs} +40 -18
- package/dist/byline-CC0WS4Gu.mjs.map +1 -0
- package/dist/{byline-fields-8TMtkBnH.mjs → byline-fields-53i9Et0x.mjs} +3 -3
- package/dist/{byline-fields-8TMtkBnH.mjs.map → byline-fields-53i9Et0x.mjs.map} +1 -1
- package/dist/{byline-fields--WxSNS79.mjs → byline-fields-DNp0HNKc.mjs} +2 -2
- package/dist/{byline-fields--WxSNS79.mjs.map → byline-fields-DNp0HNKc.mjs.map} +1 -1
- package/dist/{byline-fields-DbibsvTl.d.mts → byline-fields-jy07PZJM.d.mts} +9 -4
- package/dist/byline-fields-jy07PZJM.d.mts.map +1 -0
- package/dist/{byline-registry-CWP7I71B.mjs → byline-registry-BOjqDOim.mjs} +3 -3
- package/dist/{byline-registry-CWP7I71B.mjs.map → byline-registry-BOjqDOim.mjs.map} +1 -1
- package/dist/{bylines-s8c2DXbH.mjs → bylines-CCO1CYnH.mjs} +8 -8
- package/dist/{bylines-s8c2DXbH.mjs.map → bylines-CCO1CYnH.mjs.map} +1 -1
- package/dist/{bylines-BdxWCnPL.mjs → bylines-DGekMGGm.mjs} +10 -4
- package/dist/{bylines-BdxWCnPL.mjs.map → bylines-DGekMGGm.mjs.map} +1 -1
- package/dist/{cache-B_HzASVT.mjs → cache-pXTpun6s.mjs} +3 -3
- package/dist/{cache-B_HzASVT.mjs.map → cache-pXTpun6s.mjs.map} +1 -1
- package/dist/{challenge-store-DXX3rfdI.mjs → challenge-store-C6E_kWTs.mjs} +1 -1
- package/dist/{challenge-store-DXX3rfdI.mjs.map → challenge-store-C6E_kWTs.mjs.map} +1 -1
- package/dist/{chunks-BerYVuve.mjs → chunks-SyjZaYwV.mjs} +2 -2
- package/dist/{chunks-BerYVuve.mjs.map → chunks-SyjZaYwV.mjs.map} +1 -1
- package/dist/cli/index.mjs +29 -27
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/{comment-sqQxNpN3.mjs → comment-80UyJJUR.mjs} +11 -3
- package/dist/comment-80UyJJUR.mjs.map +1 -0
- package/dist/comment-reaction-B6AdcpXw.mjs +85 -0
- package/dist/comment-reaction-B6AdcpXw.mjs.map +1 -0
- package/dist/{comments-Vkivawyl.mjs → comments-CtPkT2tp.mjs} +3 -3
- package/dist/{comments-Vkivawyl.mjs.map → comments-CtPkT2tp.mjs.map} +1 -1
- package/dist/{components-CK0cuUoH.mjs → components-D6ZnrzbB.mjs} +1 -1
- package/dist/{components-CK0cuUoH.mjs.map → components-D6ZnrzbB.mjs.map} +1 -1
- package/dist/{content-BIlVx-RX.mjs → content-2PTDNnoh.mjs} +22 -7
- package/dist/content-2PTDNnoh.mjs.map +1 -0
- package/dist/{context-Y7BRkWes.mjs → context-f1__jpzF.mjs} +11 -11
- package/dist/{context-Y7BRkWes.mjs.map → context-f1__jpzF.mjs.map} +1 -1
- package/dist/{cron-BJ2ClIlj.mjs → cron-CQPxBjYs.mjs} +1 -1
- package/dist/{cron-BJ2ClIlj.mjs.map → cron-CQPxBjYs.mjs.map} +1 -1
- package/dist/{dashboard-2JgAMWxK.mjs → dashboard-BOESNcwE.mjs} +4 -4
- package/dist/{dashboard-2JgAMWxK.mjs.map → dashboard-BOESNcwE.mjs.map} +1 -1
- package/dist/database/instrumentation.d.mts +19 -0
- package/dist/database/instrumentation.d.mts.map +1 -1
- package/dist/database/instrumentation.mjs +8 -1
- package/dist/database/instrumentation.mjs.map +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{db-errors-CtzxKBxe.mjs → db-errors-CrC5w3Jz.mjs} +1 -1
- package/dist/{db-errors-CtzxKBxe.mjs.map → db-errors-CrC5w3Jz.mjs.map} +1 -1
- package/dist/{default-IlBaTFxM.mjs → default-CpBEPn6a.mjs} +1 -1
- package/dist/{default-IlBaTFxM.mjs.map → default-CpBEPn6a.mjs.map} +1 -1
- package/dist/{device-flow-R23SIbQ2.mjs → device-flow-Bn-qiDrw.mjs} +5 -5
- package/dist/{device-flow-R23SIbQ2.mjs.map → device-flow-Bn-qiDrw.mjs.map} +1 -1
- package/dist/{email-console-DHT2Fbpj.mjs → email-console-B9VS6eN4.mjs} +1 -1
- package/dist/{email-console-DHT2Fbpj.mjs.map → email-console-B9VS6eN4.mjs.map} +1 -1
- package/dist/{error-RwM4dD35.mjs → error-BQ1pxs0L.mjs} +2 -2
- package/dist/{error-RwM4dD35.mjs.map → error-BQ1pxs0L.mjs.map} +1 -1
- package/dist/{escape-Ds07EEyu.mjs → escape-BtbJWyaW.mjs} +1 -1
- package/dist/{escape-Ds07EEyu.mjs.map → escape-BtbJWyaW.mjs.map} +1 -1
- package/dist/{fts-manager-1RgHmopc.mjs → fts-manager-DtiWqwNJ.mjs} +2 -2
- package/dist/{fts-manager-1RgHmopc.mjs.map → fts-manager-DtiWqwNJ.mjs.map} +1 -1
- package/dist/{hash-9w3pd3-m.mjs → hash-BowcuPwv.mjs} +1 -1
- package/dist/{hash-9w3pd3-m.mjs.map → hash-BowcuPwv.mjs.map} +1 -1
- package/dist/{import-Dh8bWmyq.mjs → import-DqSGOlmR.mjs} +4 -4
- package/dist/{import-Dh8bWmyq.mjs.map → import-DqSGOlmR.mjs.map} +1 -1
- package/dist/{index-B1keaX5Y.d.mts → index-C2dLNT6S.d.mts} +169 -14
- package/dist/index-C2dLNT6S.d.mts.map +1 -0
- package/dist/{index-DR56od45.d.mts → index-ZDEwR7qW.d.mts} +3 -3
- package/dist/{index-DR56od45.d.mts.map → index-ZDEwR7qW.d.mts.map} +1 -1
- package/dist/index.d.mts +18 -17
- package/dist/index.mjs +63 -59
- package/dist/init-lock-6b309ZrF.mjs +56 -0
- package/dist/init-lock-6b309ZrF.mjs.map +1 -0
- package/dist/{load-BBetCvLC.mjs → load-Dtoo7KcJ.mjs} +2 -2
- package/dist/{load-BBetCvLC.mjs.map → load-Dtoo7KcJ.mjs.map} +1 -1
- package/dist/{loader-ZN1ll-d-.mjs → loader-C8Z48Uof.mjs} +4 -4
- package/dist/{loader-ZN1ll-d-.mjs.map → loader-C8Z48Uof.mjs.map} +1 -1
- package/dist/{manifest-schema-BtwbL_vj.mjs → manifest-schema-DDSbwkAL.mjs} +1 -1
- package/dist/{manifest-schema-BtwbL_vj.mjs.map → manifest-schema-DDSbwkAL.mjs.map} +1 -1
- package/dist/media/image-endpoint.d.mts +74 -0
- package/dist/media/image-endpoint.d.mts.map +1 -0
- package/dist/media/image-endpoint.mjs +162 -0
- package/dist/media/image-endpoint.mjs.map +1 -0
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +11 -11
- package/dist/media/local-runtime.mjs +9 -7
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-JOf3pNkw.mjs → media-Bw0sA6rb.mjs} +2 -2
- package/dist/{media-JOf3pNkw.mjs.map → media-Bw0sA6rb.mjs.map} +1 -1
- package/dist/{media-allowlist-Dknq-OFY.mjs → media-allowlist-DunzrKFM.mjs} +2 -2
- package/dist/{media-allowlist-Dknq-OFY.mjs.map → media-allowlist-DunzrKFM.mjs.map} +1 -1
- package/dist/{media-url-VClf8glU.mjs → media-url-S22B6aPr.mjs} +1 -1
- package/dist/{media-url-VClf8glU.mjs.map → media-url-S22B6aPr.mjs.map} +1 -1
- package/dist/{menus-DX4_E01q.mjs → menus-CYs0WZoL.mjs} +20 -6
- package/dist/menus-CYs0WZoL.mjs.map +1 -0
- package/dist/{menus-DrQLusqj.mjs → menus-DOs1MQJg.mjs} +120 -20
- package/dist/menus-DOs1MQJg.mjs.map +1 -0
- package/dist/{mime-CCEzze7W.mjs → mime-DYpsOAny.mjs} +1 -1
- package/dist/{mime-CCEzze7W.mjs.map → mime-DYpsOAny.mjs.map} +1 -1
- package/dist/{mode-CO2vQHfq.mjs → mode-CFh8Dw8G.mjs} +1 -1
- package/dist/{mode-CO2vQHfq.mjs.map → mode-CFh8Dw8G.mjs.map} +1 -1
- package/dist/{normalize-CK5o04zr.mjs → normalize-Uam4_Vkr.mjs} +1 -1
- package/dist/{normalize-CK5o04zr.mjs.map → normalize-Uam4_Vkr.mjs.map} +1 -1
- package/dist/{oauth-authorization-Bw4NdF_S.mjs → oauth-authorization-BN-t83Uy.mjs} +5 -5
- package/dist/{oauth-authorization-Bw4NdF_S.mjs.map → oauth-authorization-BN-t83Uy.mjs.map} +1 -1
- package/dist/{oauth-clients-BGGFp57s.mjs → oauth-clients-R6I_V0qz.mjs} +1 -1
- package/dist/{oauth-clients-BGGFp57s.mjs.map → oauth-clients-R6I_V0qz.mjs.map} +1 -1
- package/dist/{oauth-state-store-97x0xtN2.mjs → oauth-state-store-Csoc6kkR.mjs} +1 -1
- package/dist/{oauth-state-store-97x0xtN2.mjs.map → oauth-state-store-Csoc6kkR.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-B_vnZHKO.mjs → oauth-user-lookup-d7VYjTpx.mjs} +1 -1
- package/dist/{oauth-user-lookup-B_vnZHKO.mjs.map → oauth-user-lookup-d7VYjTpx.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +15 -0
- package/dist/object-cache/memory.d.mts.map +1 -0
- package/dist/object-cache/memory.mjs +56 -0
- package/dist/object-cache/memory.mjs.map +1 -0
- package/dist/object-cache-SEb2IM4Z.mjs +373 -0
- package/dist/object-cache-SEb2IM4Z.mjs.map +1 -0
- package/dist/{options-DyYIYpPd.d.mts → options-DFFpvNJU.d.mts} +3 -3
- package/dist/{options-DyYIYpPd.d.mts.map → options-DFFpvNJU.d.mts.map} +1 -1
- package/dist/{options-BPCVnesz.mjs → options-DTTML-Tx.mjs} +1 -1
- package/dist/{options-BPCVnesz.mjs.map → options-DTTML-Tx.mjs.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-CrGndy1A.mjs → parse-qrHlnzTy.mjs} +2 -2
- package/dist/{parse-CrGndy1A.mjs.map → parse-qrHlnzTy.mjs.map} +1 -1
- package/dist/{passkey-config-C3QgnQnU.mjs → passkey-config-BJTbcnI5.mjs} +1 -1
- package/dist/{passkey-config-C3QgnQnU.mjs.map → passkey-config-BJTbcnI5.mjs.map} +1 -1
- package/dist/{patterns-p-RBdTbM.mjs → patterns-BKmjvM7K.mjs} +1 -1
- package/dist/{patterns-p-RBdTbM.mjs.map → patterns-BKmjvM7K.mjs.map} +1 -1
- package/dist/{placeholder-BZxr8W1j.mjs → placeholder-CIDCpyEY.mjs} +1 -1
- package/dist/{placeholder-BZxr8W1j.mjs.map → placeholder-CIDCpyEY.mjs.map} +1 -1
- package/dist/{placeholder-CVBv5z8k.d.mts → placeholder-CirPauNG.d.mts} +1 -1
- package/dist/{placeholder-CVBv5z8k.d.mts.map → placeholder-CirPauNG.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +4 -2
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{transport-CmpLD7W3.mjs → portable-text-BIFhrU6T.mjs} +2 -135
- package/dist/portable-text-BIFhrU6T.mjs.map +1 -0
- package/dist/{preview-BfuRkVKW.mjs → preview-IDye9SPQ.mjs} +2 -2
- package/dist/{preview-BfuRkVKW.mjs.map → preview-IDye9SPQ.mjs.map} +1 -1
- package/dist/{public-url-BFVC2OTJ.mjs → public-url-8lFyQ8ZF.mjs} +1 -1
- package/dist/{public-url-BFVC2OTJ.mjs.map → public-url-8lFyQ8ZF.mjs.map} +1 -1
- package/dist/{query-CbUcI4Xk.mjs → query-B1RVFUNM.mjs} +159 -31
- package/dist/query-B1RVFUNM.mjs.map +1 -0
- package/dist/{rate-limit-C7hjdkS5.mjs → rate-limit-DfNAqIWW.mjs} +2 -2
- package/dist/{rate-limit-C7hjdkS5.mjs.map → rate-limit-DfNAqIWW.mjs.map} +1 -1
- package/dist/{redirect-B_q19j4v.mjs → redirect-B4wuX2A5.mjs} +1 -1
- package/dist/{redirect-B_q19j4v.mjs.map → redirect-B4wuX2A5.mjs.map} +1 -1
- package/dist/{redirect-CRWIt8Zj.mjs → redirect-Bifv_yHv.mjs} +3 -3
- package/dist/{redirect-CRWIt8Zj.mjs.map → redirect-Bifv_yHv.mjs.map} +1 -1
- package/dist/{redirects-DxVoR7PI.mjs → redirects-CT_vb3NV.mjs} +24 -18
- package/dist/redirects-CT_vb3NV.mjs.map +1 -0
- package/dist/{redirects-CCbCqCCd.mjs → redirects-DUvXgzCX.mjs} +14 -10
- package/dist/redirects-DUvXgzCX.mjs.map +1 -0
- package/dist/{registry-brYh-rAT.mjs → registry-CjK96fHD.mjs} +6 -6
- package/dist/{registry-brYh-rAT.mjs.map → registry-CjK96fHD.mjs.map} +1 -1
- package/dist/{request-cache-D32LpnmI.mjs → request-cache-KCNHp_RJ.mjs} +1 -1
- package/dist/{request-cache-D32LpnmI.mjs.map → request-cache-KCNHp_RJ.mjs.map} +1 -1
- package/dist/{request-meta-7ByVLxB-.mjs → request-meta-ei3ATilC.mjs} +2 -2
- package/dist/{request-meta-7ByVLxB-.mjs.map → request-meta-ei3ATilC.mjs.map} +1 -1
- package/dist/{resolve-BqYMVG0D.mjs → resolve-CpbBglV0.mjs} +1 -1
- package/dist/{resolve-BqYMVG0D.mjs.map → resolve-CpbBglV0.mjs.map} +1 -1
- package/dist/{runner--4wMWwKM.mjs → runner-DYYnW530.mjs} +201 -170
- package/dist/runner-DYYnW530.mjs.map +1 -0
- package/dist/{runner-DTdhuI9i.d.mts → runner-jdXtFEd3.d.mts} +2 -2
- package/dist/{runner-DTdhuI9i.d.mts.map → runner-jdXtFEd3.d.mts.map} +1 -1
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +3 -3
- package/dist/{schema-C1E70ug_.mjs → schema-5z2Jfnbm.mjs} +13 -8
- package/dist/schema-5z2Jfnbm.mjs.map +1 -0
- package/dist/{search-B3SGZw91.mjs → search-D9FkoM-k.mjs} +4 -4
- package/dist/{search-B3SGZw91.mjs.map → search-D9FkoM-k.mjs.map} +1 -1
- package/dist/{secrets-ChPTmy9x.mjs → secrets-BUE5UQys.mjs} +23 -13
- package/dist/secrets-BUE5UQys.mjs.map +1 -0
- package/dist/{sections-D_lVzwRZ.mjs → sections-DWYZo6HK.mjs} +3 -3
- package/dist/{sections-D_lVzwRZ.mjs.map → sections-DWYZo6HK.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +22 -20
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-B5e6y9Wk.mjs → seo-Cu47j3mJ.mjs} +5 -2
- package/dist/seo-Cu47j3mJ.mjs.map +1 -0
- package/dist/{seo-D_LPkOtu.mjs → seo-DRnqnstF.mjs} +1 -1
- package/dist/{seo-D_LPkOtu.mjs.map → seo-DRnqnstF.mjs.map} +1 -1
- package/dist/{service-ChDcsTBs.mjs → service-DTmtqCnw.mjs} +3 -3
- package/dist/{service-ChDcsTBs.mjs.map → service-DTmtqCnw.mjs.map} +1 -1
- package/dist/session-user-DmtPMNa1.mjs +51 -0
- package/dist/session-user-DmtPMNa1.mjs.map +1 -0
- package/dist/{settings-Cv47v9u8.mjs → settings-DUrVDN0c.mjs} +3 -3
- package/dist/{settings-Cv47v9u8.mjs.map → settings-DUrVDN0c.mjs.map} +1 -1
- package/dist/settings-yaxu9mU-.mjs +245 -0
- package/dist/settings-yaxu9mU-.mjs.map +1 -0
- package/dist/{setup-complete-yvPE4OsP.mjs → setup-complete-BWFHzgvZ.mjs} +2 -2
- package/dist/{setup-complete-yvPE4OsP.mjs.map → setup-complete-BWFHzgvZ.mjs.map} +1 -1
- package/dist/{setup-nonce-C9aFzb94.mjs → setup-nonce-DFWG-J5c.mjs} +1 -1
- package/dist/{setup-nonce-C9aFzb94.mjs.map → setup-nonce-DFWG-J5c.mjs.map} +1 -1
- package/dist/single-flight-cache-B5p5cNOL.mjs +104 -0
- package/dist/single-flight-cache-B5p5cNOL.mjs.map +1 -0
- package/dist/{site-url-CnHlmAs9.mjs → site-url-BOTPgmeM.mjs} +2 -2
- package/dist/{site-url-CnHlmAs9.mjs.map → site-url-BOTPgmeM.mjs.map} +1 -1
- package/dist/{slugify-Cjh1ssOZ.mjs → slugify-Cce3dTdg.mjs} +1 -1
- package/dist/{slugify-Cjh1ssOZ.mjs.map → slugify-Cce3dTdg.mjs.map} +1 -1
- package/dist/{ssrf-BsVGIE0Z.mjs → ssrf-B0VeRLrp.mjs} +1 -1
- package/dist/{ssrf-BsVGIE0Z.mjs.map → ssrf-B0VeRLrp.mjs.map} +1 -1
- package/dist/status-CB2basWJ.mjs +30 -0
- package/dist/status-CB2basWJ.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-BdAmbOwx.mjs → taxonomies-Be9B1jEj.mjs} +156 -122
- package/dist/taxonomies-Be9B1jEj.mjs.map +1 -0
- package/dist/{taxonomies-BILwiyGk.mjs → taxonomies-CJmkEpdS.mjs} +7 -7
- package/dist/{taxonomies-BILwiyGk.mjs.map → taxonomies-CJmkEpdS.mjs.map} +1 -1
- package/dist/{taxonomy-CdllE4oq.mjs → taxonomy-B2HQuVf5.mjs} +19 -6
- package/dist/taxonomy-B2HQuVf5.mjs.map +1 -0
- package/dist/{tokens-Bx2afeT-.mjs → tokens-BvrJvIB6.mjs} +2 -2
- package/dist/{tokens-Bx2afeT-.mjs.map → tokens-BvrJvIB6.mjs.map} +1 -1
- package/dist/{transaction-x2tJQ-A1.mjs → transaction-qfqpPVpu.mjs} +1 -1
- package/dist/{transaction-x2tJQ-A1.mjs.map → transaction-qfqpPVpu.mjs.map} +1 -1
- package/dist/transport-B4rXnSTf.mjs +135 -0
- package/dist/transport-B4rXnSTf.mjs.map +1 -0
- package/dist/{transport-B7PPP2CC.d.mts → transport-k7YjfmEn.d.mts} +1 -1
- package/dist/{transport-B7PPP2CC.d.mts.map → transport-k7YjfmEn.d.mts.map} +1 -1
- package/dist/{trusted-proxy-B4AfnoAp.mjs → trusted-proxy-DY1_UqHr.mjs} +1 -1
- package/dist/{trusted-proxy-B4AfnoAp.mjs.map → trusted-proxy-DY1_UqHr.mjs.map} +1 -1
- package/dist/{types-CPAPl93j.d.mts → types-CIKX2HO5.d.mts} +2 -2
- package/dist/{types-CPAPl93j.d.mts.map → types-CIKX2HO5.d.mts.map} +1 -1
- package/dist/{types-D4kUqbHh.d.mts → types-CKNXt63n.d.mts} +1 -1
- package/dist/{types-D4kUqbHh.d.mts.map → types-CKNXt63n.d.mts.map} +1 -1
- package/dist/{types-DTniiNto.d.mts → types-CWGYDYqF.d.mts} +2 -2
- package/dist/{types-DTniiNto.d.mts.map → types-CWGYDYqF.d.mts.map} +1 -1
- package/dist/{types-BH8-30hc.d.mts → types-CgvhU-hF.d.mts} +1 -1
- package/dist/{types-BH8-30hc.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
- package/dist/{types-BFgrqwSk.d.mts → types-CmivgZbp.d.mts} +1 -1
- package/dist/{types-BFgrqwSk.d.mts.map → types-CmivgZbp.d.mts.map} +1 -1
- package/dist/{types-BPzXTV9x.d.mts → types-Czg1S3gB.d.mts} +9 -1
- package/dist/{types-BPzXTV9x.d.mts.map → types-Czg1S3gB.d.mts.map} +1 -1
- package/dist/types-DCNNfeCv.d.mts +124 -0
- package/dist/types-DCNNfeCv.d.mts.map +1 -0
- package/dist/{types-BUUVn1zr.d.mts → types-DPCpkzvS.d.mts} +1 -1
- package/dist/{types-BUUVn1zr.d.mts.map → types-DPCpkzvS.d.mts.map} +1 -1
- package/dist/{types-S15DXXNi.d.mts → types-DXLVzV2w.d.mts} +1 -1
- package/dist/{types-S15DXXNi.d.mts.map → types-DXLVzV2w.d.mts.map} +1 -1
- package/dist/{types-BXSUSAjt.mjs → types-DXOIbece.mjs} +3 -3
- package/dist/{types-BXSUSAjt.mjs.map → types-DXOIbece.mjs.map} +1 -1
- package/dist/{types-DpFmlNyB.mjs → types-DYF2_Vf4.mjs} +1 -1
- package/dist/{types-DpFmlNyB.mjs.map → types-DYF2_Vf4.mjs.map} +1 -1
- package/dist/{types-DZk_y-MU.mjs → types-tM44hEcf.mjs} +1 -1
- package/dist/{types-DZk_y-MU.mjs.map → types-tM44hEcf.mjs.map} +1 -1
- package/dist/{user-C0um7wrg.mjs → user-Db-Rti_z.mjs} +3 -3
- package/dist/{user-C0um7wrg.mjs.map → user-Db-Rti_z.mjs.map} +1 -1
- package/dist/{utils-C4Ih4DML.mjs → utils-LbHcSRTj.mjs} +2 -2
- package/dist/{utils-C4Ih4DML.mjs.map → utils-LbHcSRTj.mjs.map} +1 -1
- package/dist/{validate-Bz4vqcX1.mjs → validate-Bwl64sxv.mjs} +3 -3
- package/dist/{validate-Bz4vqcX1.mjs.map → validate-Bwl64sxv.mjs.map} +1 -1
- package/dist/{validate-CNwkPWzz.d.mts → validate-CE2M0nvx.d.mts} +5 -5
- package/dist/{validate-CNwkPWzz.d.mts.map → validate-CE2M0nvx.d.mts.map} +1 -1
- package/dist/{validation-DgGTJm3u.mjs → validation-C_yOvFaO.mjs} +6 -6
- package/dist/{validation-DgGTJm3u.mjs.map → validation-C_yOvFaO.mjs.map} +1 -1
- package/dist/version-RnYXYjzD.mjs +7 -0
- package/dist/{version-D-5txk2m.mjs.map → version-RnYXYjzD.mjs.map} +1 -1
- package/dist/{widgets-DZfmAbE4.mjs → widgets-8GONuRHo.mjs} +4 -4
- package/dist/{widgets-DZfmAbE4.mjs.map → widgets-8GONuRHo.mjs.map} +1 -1
- package/dist/{zod-generator-Djo_VHCt.mjs → zod-generator-D481JjzD.mjs} +3 -3
- package/dist/{zod-generator-Djo_VHCt.mjs.map → zod-generator-D481JjzD.mjs.map} +1 -1
- package/package.json +18 -6
- package/src/api/handlers/api-tokens.ts +19 -0
- package/src/api/handlers/comment-reactions.ts +165 -0
- package/src/api/handlers/redirects.ts +24 -13
- package/src/api/handlers/schema.ts +8 -0
- package/src/api/schemas/comments.ts +10 -0
- package/src/api/schemas/redirects.ts +11 -4
- package/src/astro/image-endpoint.ts +84 -0
- package/src/astro/index.ts +6 -0
- package/src/astro/integration/index.ts +127 -30
- package/src/astro/integration/routes.ts +51 -9
- package/src/astro/integration/runtime.ts +65 -1
- package/src/astro/integration/virtual-modules.ts +32 -0
- package/src/astro/integration/vite-config.ts +16 -0
- package/src/astro/middleware/auth.ts +4 -3
- package/src/astro/middleware/redirect.ts +12 -0
- package/src/astro/middleware/stream-end-metrics.ts +11 -1
- package/src/astro/middleware.ts +41 -3
- package/src/astro/object-cache/adapters.ts +50 -0
- package/src/astro/prefetch.ts +77 -0
- package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
- package/src/astro/routes/api/setup/dev-bypass.ts +5 -1
- package/src/astro/routes/api/snapshot.ts +3 -1
- package/src/astro/session-user.ts +57 -0
- package/src/astro/types.ts +1 -0
- package/src/bylines/field-defs-cache.ts +70 -20
- package/src/cli/commands/doctor.ts +1 -1
- package/src/comments/query.ts +78 -7
- package/src/comments/ranking.ts +58 -0
- package/src/components/Comments.astro +136 -1
- package/src/config/secrets.ts +28 -14
- package/src/database/instrumentation.ts +21 -1
- package/src/database/migrations/044_comment_reactions.ts +56 -0
- package/src/database/migrations/runner.ts +2 -0
- package/src/database/repositories/byline.ts +13 -0
- package/src/database/repositories/comment-reaction.ts +132 -0
- package/src/database/repositories/comment.ts +10 -0
- package/src/database/repositories/content.ts +25 -3
- package/src/database/repositories/menu.ts +13 -1
- package/src/database/repositories/seo.ts +3 -0
- package/src/database/repositories/taxonomy.ts +13 -1
- package/src/database/types.ts +9 -0
- package/src/emdash-runtime.ts +23 -9
- package/src/index.ts +22 -0
- package/src/mcp/server.ts +307 -20
- package/src/media/image-endpoint.ts +167 -0
- package/src/menus/index.ts +11 -4
- package/src/object-cache/codec.ts +73 -0
- package/src/object-cache/index.ts +495 -0
- package/src/object-cache/memory.ts +91 -0
- package/src/object-cache/types.ts +124 -0
- package/src/plugins/adapt-sandbox-entry.ts +11 -1
- package/src/query.ts +196 -17
- package/src/redirects/status.ts +27 -0
- package/src/schema/query.ts +11 -4
- package/src/settings/index.ts +30 -17
- package/src/taxonomies/index.ts +237 -165
- package/src/utils/{isolate-cache.ts → single-flight-cache.ts} +26 -21
- package/src/virtual-modules.d.ts +11 -0
- package/dist/api-DStv36ik.mjs.map +0 -1
- package/dist/api-tokens-DPfhPu5V.mjs.map +0 -1
- package/dist/byline-DUx48sJp.mjs.map +0 -1
- package/dist/byline-fields-DbibsvTl.d.mts.map +0 -1
- package/dist/comment-sqQxNpN3.mjs.map +0 -1
- package/dist/content-BIlVx-RX.mjs.map +0 -1
- package/dist/index-B1keaX5Y.d.mts.map +0 -1
- package/dist/menus-DX4_E01q.mjs.map +0 -1
- package/dist/menus-DrQLusqj.mjs.map +0 -1
- package/dist/query-CbUcI4Xk.mjs.map +0 -1
- package/dist/redirects-CCbCqCCd.mjs.map +0 -1
- package/dist/redirects-DxVoR7PI.mjs.map +0 -1
- package/dist/runner--4wMWwKM.mjs.map +0 -1
- package/dist/schema-C1E70ug_.mjs.map +0 -1
- package/dist/secrets-ChPTmy9x.mjs.map +0 -1
- package/dist/seo-B5e6y9Wk.mjs.map +0 -1
- package/dist/settings-DfxiWY_s.mjs +0 -411
- package/dist/settings-DfxiWY_s.mjs.map +0 -1
- package/dist/taxonomies-BdAmbOwx.mjs.map +0 -1
- package/dist/taxonomy-CdllE4oq.mjs.map +0 -1
- package/dist/transport-CmpLD7W3.mjs.map +0 -1
- package/dist/version-D-5txk2m.mjs +0 -7
- /package/dist/{api-tokens-Oq39ba-Z.mjs → api-tokens-BVH-H8Z9.mjs} +0 -0
- /package/dist/{ssrf-BvgVcfNQ.mjs → ssrf-Cz1e2QPn.mjs} +0 -0
- /package/dist/{types-CZI4E3qG.mjs → types-Bfr2Pj6z.mjs} +0 -0
|
@@ -17,6 +17,7 @@ import type { AstroIntegration, AstroIntegrationLogger } from "astro";
|
|
|
17
17
|
import { validateAllowedOrigins, validateOriginShape } from "../../auth/allowed-origins.js";
|
|
18
18
|
import { INTERNAL_MEDIA_PREFIX } from "../../media/normalize.js";
|
|
19
19
|
import type { ResolvedPlugin } from "../../plugins/types.js";
|
|
20
|
+
import { VERSION } from "../../version.js";
|
|
20
21
|
import { local } from "../storage/adapters.js";
|
|
21
22
|
import { notoSans } from "./font-provider.js";
|
|
22
23
|
import {
|
|
@@ -69,26 +70,21 @@ interface ImageRemotePattern {
|
|
|
69
70
|
/**
|
|
70
71
|
* Build `image.remotePatterns` entries so Astro will optimize EmDash media.
|
|
71
72
|
*
|
|
72
|
-
* Astro's image services only transform
|
|
73
|
-
*
|
|
74
|
-
* media sources automatically:
|
|
73
|
+
* Astro's image services only build a transform URL for sources allowed via
|
|
74
|
+
* `image.domains` / `image.remotePatterns` (relative URLs are never optimized —
|
|
75
|
+
* see `isRemoteAllowed`). We authorize the media sources automatically:
|
|
75
76
|
*
|
|
76
|
-
* 1. The storage adapter's public URL host (R2 custom domain, S3/CDN)
|
|
77
|
-
* media served directly from a public bucket is optimized.
|
|
77
|
+
* 1. The storage adapter's public URL host (R2 custom domain, S3/CDN).
|
|
78
78
|
* 2. The site's own origin, scoped to the media proxy route
|
|
79
|
-
* (`/_emdash/api/media/file/**`), so same-origin proxied media
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* build time, so we register a host-agnostic pattern scoped to the media
|
|
86
|
-
* route. This is dev-only — it never ships in a production build — so the
|
|
87
|
-
* missing host check can't be abused on a deployed site.
|
|
79
|
+
* (`/_emdash/api/media/file/**`), so same-origin proxied media is optimized.
|
|
80
|
+
* The components absolutize the media URL against this origin; EmDash's
|
|
81
|
+
* wrapped image endpoint then serves the bytes from storage (so the absolute
|
|
82
|
+
* URL is never fetched). Only registered when `siteUrl` is known at build.
|
|
83
|
+
* 3. In `astro dev` the dev-server origin isn't known at build time, so we
|
|
84
|
+
* register a host-agnostic pattern scoped to the media route. Dev-only.
|
|
88
85
|
*
|
|
89
|
-
* Returns an empty array when no source is statically known (
|
|
90
|
-
*
|
|
91
|
-
* a plain `<img>`.
|
|
86
|
+
* Returns an empty array when no source is statically known (production build,
|
|
87
|
+
* local storage, no `siteUrl`), in which case media renders as a plain `<img>`.
|
|
92
88
|
*
|
|
93
89
|
* @internal Exported for unit testing.
|
|
94
90
|
*/
|
|
@@ -146,6 +142,59 @@ export function buildImageRemotePatterns(
|
|
|
146
142
|
return patterns;
|
|
147
143
|
}
|
|
148
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Stock image endpoints EmDash may safely replace with its storage-backed
|
|
147
|
+
* wrapper. Our wrapper delegates non-EmDash images to the platform's transform
|
|
148
|
+
* endpoint, so we only override endpoints whose transform we can delegate to.
|
|
149
|
+
*/
|
|
150
|
+
const OVERRIDABLE_IMAGE_ENDPOINTS = new Set([
|
|
151
|
+
"astro/assets/endpoint/generic",
|
|
152
|
+
"astro/assets/endpoint/node",
|
|
153
|
+
"astro/assets/endpoint/dev",
|
|
154
|
+
"@astrojs/cloudflare/image-transform-endpoint",
|
|
155
|
+
]);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Stock endpoints that deliberately don't transform (the user opted into
|
|
159
|
+
* passthrough). We leave these untouched -- and without a warning, since it's a
|
|
160
|
+
* supported choice, not a custom endpoint. Overriding would route non-EmDash
|
|
161
|
+
* images through a transformer the passthrough setup doesn't provide.
|
|
162
|
+
*/
|
|
163
|
+
const PASSTHROUGH_IMAGE_ENDPOINTS = new Set(["@astrojs/cloudflare/image-passthrough-endpoint"]);
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Decide which image endpoint to install (if any). EmDash wraps Astro's image
|
|
167
|
+
* endpoint so EmDash media bytes load from storage; the wrapper delegates other
|
|
168
|
+
* images back to the platform's stock endpoint.
|
|
169
|
+
*
|
|
170
|
+
* Returns `{ entrypoint }` to install, `{ warn }` to skip with a warning (a
|
|
171
|
+
* custom endpoint we can't delegate to), or `{}` to skip silently (opted out).
|
|
172
|
+
*
|
|
173
|
+
* @internal Exported for unit testing.
|
|
174
|
+
*/
|
|
175
|
+
export function resolveImageEndpoint(opts: {
|
|
176
|
+
imagesDisabled: boolean;
|
|
177
|
+
currentEntrypoint: string | undefined;
|
|
178
|
+
isCloudflare: boolean;
|
|
179
|
+
}): { entrypoint?: string; warn?: string } {
|
|
180
|
+
if (opts.imagesDisabled) return {};
|
|
181
|
+
const current = opts.currentEntrypoint;
|
|
182
|
+
if (current === undefined || OVERRIDABLE_IMAGE_ENDPOINTS.has(current)) {
|
|
183
|
+
return {
|
|
184
|
+
entrypoint: opts.isCloudflare
|
|
185
|
+
? "@emdash-cms/cloudflare/image-endpoint"
|
|
186
|
+
: "emdash/image-endpoint",
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
// A deliberate passthrough setup: leave it alone, no warning.
|
|
190
|
+
if (PASSTHROUGH_IMAGE_ENDPOINTS.has(current)) return {};
|
|
191
|
+
return {
|
|
192
|
+
warn:
|
|
193
|
+
`A custom image.endpoint (${current}) is configured; EmDash will not wrap ` +
|
|
194
|
+
`it, so storage-backed media may render unoptimized.`,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
149
198
|
// Terminal formatting
|
|
150
199
|
const dim = (s: string) => `\x1b[2m${s}\x1b[22m`;
|
|
151
200
|
const bold = (s: string) => `\x1b[1m${s}\x1b[22m`;
|
|
@@ -155,15 +204,24 @@ const cyan = (s: string) => `\x1b[36m${s}\x1b[39m`;
|
|
|
155
204
|
function printBanner(_logger: AstroIntegrationLogger): void {
|
|
156
205
|
const banner = `
|
|
157
206
|
|
|
158
|
-
${bold(cyan("— E M D A S H —"))}
|
|
207
|
+
${bold(cyan("— E M D A S H —"))} ${dim(`v${VERSION}`)}
|
|
159
208
|
`;
|
|
160
209
|
console.log(banner);
|
|
161
210
|
}
|
|
162
211
|
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
212
|
+
/**
|
|
213
|
+
* Print dev-server route info with absolute (clickable) URLs, including the
|
|
214
|
+
* dev-bypass shortcut that skips passkey auth. Dev only -- the dev-bypass
|
|
215
|
+
* endpoint returns 403 in production.
|
|
216
|
+
*/
|
|
217
|
+
function printDevServerInfo(baseUrl: string, mcpEnabled: boolean): void {
|
|
218
|
+
const devBypassUrl = `${baseUrl}/_emdash/api/setup/dev-bypass?redirect=/_emdash/admin`;
|
|
219
|
+
console.log(`\n ${dim("›")} Admin UI ${cyan(`${baseUrl}/_emdash/admin`)}`);
|
|
220
|
+
if (mcpEnabled) {
|
|
221
|
+
console.log(` ${dim("›")} MCP server ${cyan(`${baseUrl}/_emdash/api/mcp`)}`);
|
|
222
|
+
}
|
|
223
|
+
console.log(` ${dim("›")} Dev bypass ${cyan(devBypassUrl)}`);
|
|
224
|
+
console.log(` ${dim("Skips passkey setup/auth and signs you in as a dev admin")}`);
|
|
167
225
|
console.log("");
|
|
168
226
|
}
|
|
169
227
|
|
|
@@ -298,6 +356,10 @@ export function emdash(config: EmDashConfig = {}): AstroIntegration {
|
|
|
298
356
|
// Check if auth is an AuthDescriptor (has entrypoint) indicating external auth
|
|
299
357
|
const useExternalAuth = !!(resolvedConfig.auth && "entrypoint" in resolvedConfig.auth);
|
|
300
358
|
|
|
359
|
+
// Captured in astro:config:setup so the astro:server:setup hook can tell
|
|
360
|
+
// whether we're running `astro dev` (where the dev-bypass shortcut applies).
|
|
361
|
+
let astroCommand: "dev" | "build" | "preview" | "sync" | undefined;
|
|
362
|
+
|
|
301
363
|
return {
|
|
302
364
|
name: "emdash",
|
|
303
365
|
hooks: {
|
|
@@ -309,6 +371,7 @@ export function emdash(config: EmDashConfig = {}): AstroIntegration {
|
|
|
309
371
|
config: astroConfig,
|
|
310
372
|
command,
|
|
311
373
|
}) => {
|
|
374
|
+
astroCommand = command;
|
|
312
375
|
printBanner(logger);
|
|
313
376
|
// Capture the host's Astro version so the runtime can expose it
|
|
314
377
|
// to the admin and the registry install gate for `env:astro`
|
|
@@ -345,7 +408,9 @@ export function emdash(config: EmDashConfig = {}): AstroIntegration {
|
|
|
345
408
|
const securityConfig: Record<string, unknown> = {
|
|
346
409
|
checkOrigin: false,
|
|
347
410
|
...(resolvedConfig.siteUrl
|
|
348
|
-
? {
|
|
411
|
+
? {
|
|
412
|
+
allowedDomains: [{ hostname: new URL(resolvedConfig.siteUrl).hostname }],
|
|
413
|
+
}
|
|
349
414
|
: {}),
|
|
350
415
|
};
|
|
351
416
|
|
|
@@ -385,19 +450,32 @@ export function emdash(config: EmDashConfig = {}): AstroIntegration {
|
|
|
385
450
|
},
|
|
386
451
|
];
|
|
387
452
|
|
|
388
|
-
// Authorize media sources
|
|
389
|
-
//
|
|
390
|
-
//
|
|
391
|
-
// user-configured remotePatterns are preserved.
|
|
453
|
+
// Authorize media sources so Astro's image service builds transform
|
|
454
|
+
// URLs for them (it won't optimize an un-allowed source). `updateConfig`
|
|
455
|
+
// merges arrays, so user-configured remotePatterns are preserved.
|
|
392
456
|
const imageRemotePatterns = buildImageRemotePatterns(
|
|
393
457
|
resolvedConfig.storage,
|
|
394
458
|
resolvedConfig.siteUrl,
|
|
395
459
|
command,
|
|
396
460
|
);
|
|
397
461
|
|
|
462
|
+
// Wrap Astro's image endpoint so EmDash media bytes load straight from
|
|
463
|
+
// storage (Access-safe) instead of over HTTP. Skip when the user opts
|
|
464
|
+
// out or has a custom endpoint we can't delegate back to.
|
|
465
|
+
const { entrypoint: imageEndpoint, warn: imageEndpointWarning } = resolveImageEndpoint({
|
|
466
|
+
imagesDisabled: resolvedConfig.images === false,
|
|
467
|
+
currentEntrypoint: astroConfig.image?.endpoint?.entrypoint,
|
|
468
|
+
isCloudflare: astroConfig.adapter?.name === "@astrojs/cloudflare",
|
|
469
|
+
});
|
|
470
|
+
if (imageEndpointWarning) logger.warn(imageEndpointWarning);
|
|
471
|
+
|
|
472
|
+
const imageConfig: Record<string, unknown> = {};
|
|
473
|
+
if (imageRemotePatterns.length) imageConfig.remotePatterns = imageRemotePatterns;
|
|
474
|
+
if (imageEndpoint) imageConfig.endpoint = { entrypoint: imageEndpoint };
|
|
475
|
+
|
|
398
476
|
updateConfig({
|
|
399
477
|
security: securityConfig,
|
|
400
|
-
...(
|
|
478
|
+
...(Object.keys(imageConfig).length ? { image: imageConfig } : {}),
|
|
401
479
|
// fonts is a valid AstroConfig key but may not be in the
|
|
402
480
|
// type definition for the minimum supported Astro version
|
|
403
481
|
...({ fonts: emdashFonts } as Record<string, unknown>),
|
|
@@ -413,7 +491,7 @@ export function emdash(config: EmDashConfig = {}): AstroIntegration {
|
|
|
413
491
|
});
|
|
414
492
|
|
|
415
493
|
// Inject all core routes
|
|
416
|
-
injectCoreRoutes(injectRoute);
|
|
494
|
+
injectCoreRoutes(injectRoute, { srcDir: astroConfig.srcDir });
|
|
417
495
|
|
|
418
496
|
// Inject routes from pluggable auth providers (authProviders config)
|
|
419
497
|
if (resolvedConfig.authProviders?.length) {
|
|
@@ -473,9 +551,28 @@ export function emdash(config: EmDashConfig = {}): AstroIntegration {
|
|
|
473
551
|
order: "pre",
|
|
474
552
|
});
|
|
475
553
|
|
|
476
|
-
|
|
554
|
+
// Route info is printed with absolute, clickable URLs once the
|
|
555
|
+
// dev server is listening (see astro:server:setup), since the
|
|
556
|
+
// port isn't known yet here. Nothing useful to print for build.
|
|
477
557
|
},
|
|
478
558
|
"astro:server:setup": ({ server, logger }) => {
|
|
559
|
+
// Print route info with absolute, clickable URLs once the server
|
|
560
|
+
// is listening. Only in `astro dev` -- the dev-bypass shortcut is
|
|
561
|
+
// dev-only and the port is unknown until now.
|
|
562
|
+
if (astroCommand === "dev") {
|
|
563
|
+
server.httpServer?.once("listening", () => {
|
|
564
|
+
const address = server.httpServer?.address();
|
|
565
|
+
if (!address || typeof address === "string") return;
|
|
566
|
+
let host = address.address;
|
|
567
|
+
if (host === "::1" || host === "::" || host === "0.0.0.0") {
|
|
568
|
+
host = "localhost";
|
|
569
|
+
} else if (address.family === "IPv6") {
|
|
570
|
+
host = `[${host}]`;
|
|
571
|
+
}
|
|
572
|
+
printDevServerInfo(`http://${host}:${address.port}`, resolvedConfig.mcp !== false);
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
|
|
479
576
|
// Generate types once the server is listening.
|
|
480
577
|
// The endpoint returns the types content; we write the file here
|
|
481
578
|
// (in Node) because workerd has no real filesystem access.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Defines and injects all EmDash routes into the Astro application.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
7
8
|
import { createRequire } from "node:module";
|
|
8
9
|
import { dirname, resolve } from "node:path";
|
|
9
10
|
import { fileURLToPath } from "node:url";
|
|
@@ -41,10 +42,42 @@ function resolveRoute(route: string): string {
|
|
|
41
42
|
/** Route injection function type */
|
|
42
43
|
type InjectRoute = (route: { pattern: string; entrypoint: string }) => void;
|
|
43
44
|
|
|
45
|
+
interface InjectCoreRoutesOptions {
|
|
46
|
+
srcDir?: URL;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ROUTE_OVERRIDE_EXTENSIONS = [
|
|
50
|
+
".astro",
|
|
51
|
+
".js",
|
|
52
|
+
".ts",
|
|
53
|
+
".jsx",
|
|
54
|
+
".tsx",
|
|
55
|
+
".mjs",
|
|
56
|
+
".mts",
|
|
57
|
+
".md",
|
|
58
|
+
".mdx",
|
|
59
|
+
".html",
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Detect whether the host site defines its own root-level public route file.
|
|
64
|
+
*/
|
|
65
|
+
export function hasUserDefinedPublicRoute(srcDir: URL, basename: string): boolean {
|
|
66
|
+
const srcDirPath = fileURLToPath(srcDir);
|
|
67
|
+
return ROUTE_OVERRIDE_EXTENSIONS.some(
|
|
68
|
+
(extension) =>
|
|
69
|
+
existsSync(resolve(srcDirPath, "pages", `${basename}${extension}`)) ||
|
|
70
|
+
existsSync(resolve(srcDirPath, "pages", basename, `index${extension}`)),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
44
74
|
/**
|
|
45
75
|
* Injects all core EmDash routes.
|
|
46
76
|
*/
|
|
47
|
-
export function injectCoreRoutes(
|
|
77
|
+
export function injectCoreRoutes(
|
|
78
|
+
injectRoute: InjectRoute,
|
|
79
|
+
options: InjectCoreRoutesOptions = {},
|
|
80
|
+
): void {
|
|
48
81
|
// Inject admin shell route
|
|
49
82
|
injectRoute({
|
|
50
83
|
pattern: "/_emdash/admin/[...path]",
|
|
@@ -725,6 +758,11 @@ export function injectCoreRoutes(injectRoute: InjectRoute): void {
|
|
|
725
758
|
entrypoint: resolveRoute("api/comments/[collection]/[contentId]/index.ts"),
|
|
726
759
|
});
|
|
727
760
|
|
|
761
|
+
injectRoute({
|
|
762
|
+
pattern: "/_emdash/api/comments/[collection]/[contentId]/reactions",
|
|
763
|
+
entrypoint: resolveRoute("api/comments/[collection]/[contentId]/reactions.ts"),
|
|
764
|
+
});
|
|
765
|
+
|
|
728
766
|
// Comment routes (admin)
|
|
729
767
|
injectRoute({
|
|
730
768
|
pattern: "/_emdash/api/admin/comments",
|
|
@@ -752,20 +790,24 @@ export function injectCoreRoutes(injectRoute: InjectRoute): void {
|
|
|
752
790
|
});
|
|
753
791
|
|
|
754
792
|
// SEO routes (public, at site root)
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
793
|
+
if (!options.srcDir || !hasUserDefinedPublicRoute(options.srcDir, "sitemap.xml")) {
|
|
794
|
+
injectRoute({
|
|
795
|
+
pattern: "/sitemap.xml",
|
|
796
|
+
entrypoint: resolveRoute("sitemap.xml.ts"),
|
|
797
|
+
});
|
|
798
|
+
}
|
|
759
799
|
|
|
760
800
|
injectRoute({
|
|
761
801
|
pattern: "/sitemap-[collection].xml",
|
|
762
802
|
entrypoint: resolveRoute("sitemap-[collection].xml.ts"),
|
|
763
803
|
});
|
|
764
804
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
805
|
+
if (!options.srcDir || !hasUserDefinedPublicRoute(options.srcDir, "robots.txt")) {
|
|
806
|
+
injectRoute({
|
|
807
|
+
pattern: "/robots.txt",
|
|
808
|
+
entrypoint: resolveRoute("robots.txt.ts"),
|
|
809
|
+
});
|
|
810
|
+
}
|
|
769
811
|
|
|
770
812
|
// Setup wizard API routes
|
|
771
813
|
injectRoute({
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
import type { AuthDescriptor, AuthProviderDescriptor } from "../../auth/types.js";
|
|
11
11
|
import type { DatabaseDescriptor } from "../../db/adapters.js";
|
|
12
12
|
import type { MediaProviderDescriptor } from "../../media/types.js";
|
|
13
|
-
import type {
|
|
13
|
+
import type { ObjectCacheDescriptor } from "../../object-cache/types.js";
|
|
14
|
+
import type {
|
|
15
|
+
FieldWidgetConfig,
|
|
16
|
+
PortableTextBlockConfig,
|
|
17
|
+
ResolvedPlugin,
|
|
18
|
+
} from "../../plugins/types.js";
|
|
14
19
|
import type { ExperimentalConfig } from "../../registry/types.js";
|
|
15
20
|
import type { StorageDescriptor } from "../storage/types.js";
|
|
16
21
|
|
|
@@ -98,6 +103,15 @@ export interface PluginDescriptor<TOptions = Record<string, unknown>> {
|
|
|
98
103
|
adminPages?: PluginAdminPage[];
|
|
99
104
|
/** Dashboard widgets */
|
|
100
105
|
adminWidgets?: PluginDashboardWidget[];
|
|
106
|
+
/**
|
|
107
|
+
* Portable Text block types this plugin contributes to the editor.
|
|
108
|
+
* Declarative (Block Kit) — surfaced in the admin slash menu and consumed
|
|
109
|
+
* from the manifest, so standard/sandboxed plugins can contribute blocks
|
|
110
|
+
* without a native render component.
|
|
111
|
+
*/
|
|
112
|
+
portableTextBlocks?: PortableTextBlockConfig[];
|
|
113
|
+
/** Field widget types this plugin contributes for schema-field editing UIs. */
|
|
114
|
+
fieldWidgets?: FieldWidgetConfig[];
|
|
101
115
|
|
|
102
116
|
// === Sandbox-specific fields (for sandboxed plugins) ===
|
|
103
117
|
|
|
@@ -151,6 +165,56 @@ export interface EmDashConfig {
|
|
|
151
165
|
* Storage configuration (for media)
|
|
152
166
|
*/
|
|
153
167
|
storage?: StorageDescriptor;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Optional distributed object cache for query results.
|
|
171
|
+
*
|
|
172
|
+
* Off by default. When configured, content and chrome (settings, menus,
|
|
173
|
+
* taxonomies) reads are cached in a fast key/value store and served without
|
|
174
|
+
* touching the database on repeat requests across isolates. This offloads
|
|
175
|
+
* read pressure from D1/SQLite, which is especially valuable on Cloudflare
|
|
176
|
+
* where D1 has far lower request capacity than KV.
|
|
177
|
+
*
|
|
178
|
+
* Use a backend adapter:
|
|
179
|
+
* - `memoryCache()` from `emdash/astro` — in-isolate (Node / local dev)
|
|
180
|
+
* - `kvCache({ binding: "CACHE" })` from `@emdash-cms/cloudflare` — KV
|
|
181
|
+
*
|
|
182
|
+
* Preview and visual-edit requests bypass the cache, so editors previewing
|
|
183
|
+
* see live content. All other reads — including authenticated browsing outside
|
|
184
|
+
* edit mode — are served from the cache, which only ever stores published
|
|
185
|
+
* content. After an edit, anonymous visitors may see stale content until other
|
|
186
|
+
* isolates pick up the bumped epoch: immediate with the memory backend, and on
|
|
187
|
+
* KV bounded by KV's edge-cache propagation (eventual consistency, up to ~60s)
|
|
188
|
+
* plus the isolate-local `revalidate` window (default 1s).
|
|
189
|
+
*
|
|
190
|
+
* Scheduled content becomes visible at query time (no write event fires when
|
|
191
|
+
* its publish time passes), so a cached list/entry won't surface a newly-due
|
|
192
|
+
* scheduled item until the next write to that collection or until the
|
|
193
|
+
* entry's TTL lapses (`defaultTtl`, default 1h). Sites that rely on precise
|
|
194
|
+
* scheduled publishing should lower `defaultTtl` accordingly.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* import { kvCache } from "@emdash-cms/cloudflare";
|
|
199
|
+
*
|
|
200
|
+
* emdash({
|
|
201
|
+
* database: d1({ binding: "DB" }),
|
|
202
|
+
* objectCache: kvCache({ binding: "CACHE" }),
|
|
203
|
+
* })
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
objectCache?: ObjectCacheDescriptor;
|
|
207
|
+
/**
|
|
208
|
+
* Image optimization.
|
|
209
|
+
*
|
|
210
|
+
* By default EmDash wraps Astro's image endpoint so media served from
|
|
211
|
+
* storage is optimized through the normal `<Image>` / `getImage` pipeline,
|
|
212
|
+
* loading source bytes directly from the storage adapter (works behind
|
|
213
|
+
* Cloudflare Access). Set to `false` to leave Astro's image endpoint
|
|
214
|
+
* untouched -- media then renders as a plain `<img>` unless your image
|
|
215
|
+
* service can fetch it over HTTP.
|
|
216
|
+
*/
|
|
217
|
+
images?: boolean;
|
|
154
218
|
/**
|
|
155
219
|
* Trusted plugins to load (run in main isolate)
|
|
156
220
|
*
|
|
@@ -33,6 +33,9 @@ export const RESOLVED_VIRTUAL_DIALECT_ID = "\0" + VIRTUAL_DIALECT_ID;
|
|
|
33
33
|
export const VIRTUAL_STORAGE_ID = "virtual:emdash/storage";
|
|
34
34
|
export const RESOLVED_VIRTUAL_STORAGE_ID = "\0" + VIRTUAL_STORAGE_ID;
|
|
35
35
|
|
|
36
|
+
export const VIRTUAL_OBJECT_CACHE_ID = "virtual:emdash/object-cache";
|
|
37
|
+
export const RESOLVED_VIRTUAL_OBJECT_CACHE_ID = "\0" + VIRTUAL_OBJECT_CACHE_ID;
|
|
38
|
+
|
|
36
39
|
export const VIRTUAL_ADMIN_REGISTRY_ID = "virtual:emdash/admin-registry";
|
|
37
40
|
export const RESOLVED_VIRTUAL_ADMIN_REGISTRY_ID = "\0" + VIRTUAL_ADMIN_REGISTRY_ID;
|
|
38
41
|
|
|
@@ -128,6 +131,31 @@ export const createStorage = _createStorage;
|
|
|
128
131
|
`;
|
|
129
132
|
}
|
|
130
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Generates the object-cache virtual module.
|
|
136
|
+
*
|
|
137
|
+
* Statically imports the configured object-cache backend's `createObjectCache`
|
|
138
|
+
* factory and embeds its serializable config. When no object cache is
|
|
139
|
+
* configured, exports `undefined` so the runtime read-through layer becomes a
|
|
140
|
+
* transparent passthrough (cache off by default).
|
|
141
|
+
*/
|
|
142
|
+
export function generateObjectCacheModule(
|
|
143
|
+
entrypoint?: string,
|
|
144
|
+
config?: Record<string, unknown>,
|
|
145
|
+
): string {
|
|
146
|
+
if (!entrypoint) {
|
|
147
|
+
return [
|
|
148
|
+
`export const createObjectCache = undefined;`,
|
|
149
|
+
`export const objectCacheConfig = undefined;`,
|
|
150
|
+
].join("\n");
|
|
151
|
+
}
|
|
152
|
+
return `
|
|
153
|
+
import { createObjectCache as _createObjectCache } from "${entrypoint}";
|
|
154
|
+
export const createObjectCache = _createObjectCache;
|
|
155
|
+
export const objectCacheConfig = ${JSON.stringify(config ?? {})};
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
|
|
131
159
|
/**
|
|
132
160
|
* Generates the auth virtual module.
|
|
133
161
|
* Statically imports the configured auth provider.
|
|
@@ -220,6 +248,8 @@ export function generatePluginsModule(descriptors: PluginDescriptor[]): string {
|
|
|
220
248
|
storage: descriptor.storage,
|
|
221
249
|
adminPages: descriptor.adminPages,
|
|
222
250
|
adminWidgets: descriptor.adminWidgets,
|
|
251
|
+
portableTextBlocks: descriptor.portableTextBlocks,
|
|
252
|
+
fieldWidgets: descriptor.fieldWidgets,
|
|
223
253
|
})})`,
|
|
224
254
|
);
|
|
225
255
|
} else {
|
|
@@ -589,6 +619,8 @@ export const sandboxedPlugins = [];
|
|
|
589
619
|
storage: ${JSON.stringify(descriptor.storage ?? {})},
|
|
590
620
|
adminPages: ${JSON.stringify(descriptor.adminPages ?? [])},
|
|
591
621
|
adminWidgets: ${JSON.stringify(descriptor.adminWidgets ?? [])},
|
|
622
|
+
portableTextBlocks: ${JSON.stringify(descriptor.portableTextBlocks ?? [])},
|
|
623
|
+
fieldWidgets: ${JSON.stringify(descriptor.fieldWidgets ?? [])},
|
|
592
624
|
adminEntry: ${JSON.stringify(descriptor.adminEntry)},
|
|
593
625
|
// Code read from: ${filePath}
|
|
594
626
|
code: ${JSON.stringify(code)},
|
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
RESOLVED_VIRTUAL_DIALECT_ID,
|
|
23
23
|
VIRTUAL_STORAGE_ID,
|
|
24
24
|
RESOLVED_VIRTUAL_STORAGE_ID,
|
|
25
|
+
VIRTUAL_OBJECT_CACHE_ID,
|
|
26
|
+
RESOLVED_VIRTUAL_OBJECT_CACHE_ID,
|
|
25
27
|
VIRTUAL_ADMIN_REGISTRY_ID,
|
|
26
28
|
RESOLVED_VIRTUAL_ADMIN_REGISTRY_ID,
|
|
27
29
|
VIRTUAL_PLUGINS_ID,
|
|
@@ -50,6 +52,7 @@ import {
|
|
|
50
52
|
generateConfigModule,
|
|
51
53
|
generateDialectModule,
|
|
52
54
|
generateStorageModule,
|
|
55
|
+
generateObjectCacheModule,
|
|
53
56
|
generateAuthModule,
|
|
54
57
|
generateAuthProvidersModule,
|
|
55
58
|
generatePluginsModule,
|
|
@@ -176,6 +179,9 @@ export function createVirtualModulesPlugin(options: VitePluginOptions): Plugin {
|
|
|
176
179
|
if (id === VIRTUAL_STORAGE_ID) {
|
|
177
180
|
return RESOLVED_VIRTUAL_STORAGE_ID;
|
|
178
181
|
}
|
|
182
|
+
if (id === VIRTUAL_OBJECT_CACHE_ID) {
|
|
183
|
+
return RESOLVED_VIRTUAL_OBJECT_CACHE_ID;
|
|
184
|
+
}
|
|
179
185
|
if (id === VIRTUAL_ADMIN_REGISTRY_ID) {
|
|
180
186
|
return RESOLVED_VIRTUAL_ADMIN_REGISTRY_ID;
|
|
181
187
|
}
|
|
@@ -227,6 +233,14 @@ export function createVirtualModulesPlugin(options: VitePluginOptions): Plugin {
|
|
|
227
233
|
if (id === RESOLVED_VIRTUAL_STORAGE_ID) {
|
|
228
234
|
return generateStorageModule(resolvedConfig.storage?.entrypoint);
|
|
229
235
|
}
|
|
236
|
+
// Generate the object-cache module — statically imports the
|
|
237
|
+
// configured backend factory, or exports undefined (cache off).
|
|
238
|
+
if (id === RESOLVED_VIRTUAL_OBJECT_CACHE_ID) {
|
|
239
|
+
return generateObjectCacheModule(
|
|
240
|
+
resolvedConfig.objectCache?.entrypoint,
|
|
241
|
+
resolvedConfig.objectCache?.config,
|
|
242
|
+
);
|
|
243
|
+
}
|
|
230
244
|
// Generate plugins module that imports and instantiates all plugins
|
|
231
245
|
if (id === RESOLVED_VIRTUAL_PLUGINS_ID) {
|
|
232
246
|
return generatePluginsModule(pluginDescriptors);
|
|
@@ -435,6 +449,8 @@ export function createViteConfig(
|
|
|
435
449
|
// Top-level deps (use astro > path for pnpm compat)
|
|
436
450
|
"astro > zod/v4",
|
|
437
451
|
"astro > zod/v4/core",
|
|
452
|
+
// zod-generator imports the bare `zod` entry, not `zod/v4`
|
|
453
|
+
"emdash > zod",
|
|
438
454
|
"@emdash-cms/cloudflare > kysely-d1",
|
|
439
455
|
// Astro internal deps not covered by @astrojs/cloudflare adapter
|
|
440
456
|
"astro/virtual-modules/middleware.js",
|
|
@@ -32,6 +32,7 @@ import { resolveApiToken, resolveOAuthToken } from "../../api/handlers/api-token
|
|
|
32
32
|
import { hasScope } from "../../auth/api-tokens.js";
|
|
33
33
|
import { getAuthMode, type ExternalAuthMode } from "../../auth/mode.js";
|
|
34
34
|
import type { ExternalAuthConfig } from "../../auth/types.js";
|
|
35
|
+
import { resolveSessionUser } from "../session-user.js";
|
|
35
36
|
import type { EmDashHandlers } from "../types.js";
|
|
36
37
|
import { buildEmDashCsp } from "./csp.js";
|
|
37
38
|
|
|
@@ -407,7 +408,7 @@ async function handlePluginRouteAuth(
|
|
|
407
408
|
try {
|
|
408
409
|
// Try session auth (sets locals.user if session exists)
|
|
409
410
|
const { session } = context;
|
|
410
|
-
const sessionUser = await session
|
|
411
|
+
const sessionUser = await resolveSessionUser(session);
|
|
411
412
|
if (sessionUser?.id && emdash?.db) {
|
|
412
413
|
const adapter = createKyselyAdapter(emdash.db);
|
|
413
414
|
const user = await adapter.getUserById(sessionUser.id);
|
|
@@ -435,7 +436,7 @@ async function handlePublicRouteAuth(
|
|
|
435
436
|
const { emdash } = locals;
|
|
436
437
|
|
|
437
438
|
try {
|
|
438
|
-
const sessionUser = await session
|
|
439
|
+
const sessionUser = await resolveSessionUser(session);
|
|
439
440
|
if (sessionUser?.id && emdash?.db) {
|
|
440
441
|
const adapter = createKyselyAdapter(emdash.db);
|
|
441
442
|
const user = await adapter.getUserById(sessionUser.id);
|
|
@@ -650,7 +651,7 @@ async function handlePasskeyAuth(
|
|
|
650
651
|
|
|
651
652
|
try {
|
|
652
653
|
// Check session for user (session.get returns a Promise)
|
|
653
|
-
const sessionUser = await session
|
|
654
|
+
const sessionUser = await resolveSessionUser(session);
|
|
654
655
|
|
|
655
656
|
if (!sessionUser?.id) {
|
|
656
657
|
if (isApiRoute) {
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
matchCachedPatterns,
|
|
24
24
|
setCachedRedirects,
|
|
25
25
|
} from "../../redirects/cache.js";
|
|
26
|
+
import { isTerminalStatus } from "../../redirects/status.js";
|
|
26
27
|
|
|
27
28
|
/** Paths that should never be intercepted by redirects */
|
|
28
29
|
const SKIP_PREFIXES = ["/_emdash", "/_image"];
|
|
@@ -80,6 +81,12 @@ export const onRequest = defineMiddleware(async (context, next) => {
|
|
|
80
81
|
exact = cached.exact.get(alt);
|
|
81
82
|
}
|
|
82
83
|
if (exact) {
|
|
84
|
+
// Terminal statuses (410 Gone / 451): serve the status directly,
|
|
85
|
+
// with no Location header.
|
|
86
|
+
if (isTerminalStatus(exact.type)) {
|
|
87
|
+
repo.recordHit(exact.id).catch(() => {});
|
|
88
|
+
return new Response(null, { status: exact.type });
|
|
89
|
+
}
|
|
83
90
|
const dest = exact.destination;
|
|
84
91
|
if (dest.startsWith("//") || dest.startsWith("/\\")) return next();
|
|
85
92
|
repo.recordHit(exact.id).catch(() => {});
|
|
@@ -91,6 +98,11 @@ export const onRequest = defineMiddleware(async (context, next) => {
|
|
|
91
98
|
const patternMatch = matchCachedPatterns(cached.patterns, pathname);
|
|
92
99
|
if (patternMatch) {
|
|
93
100
|
const { redirect, destination } = patternMatch;
|
|
101
|
+
// Terminal statuses (410 Gone / 451): serve the status directly.
|
|
102
|
+
if (isTerminalStatus(redirect.type)) {
|
|
103
|
+
repo.recordHit(redirect.id).catch(() => {});
|
|
104
|
+
return new Response(null, { status: redirect.type });
|
|
105
|
+
}
|
|
94
106
|
if (destination.startsWith("//") || destination.startsWith("/\\")) return next();
|
|
95
107
|
repo.recordHit(redirect.id).catch(() => {});
|
|
96
108
|
const code = isRedirectCode(redirect.type) ? redirect.type : 301;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* in normal production traffic.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { isInstrumentationEnabled } from "../../database/instrumentation.js";
|
|
21
|
+
import { flushRecorder, isInstrumentationEnabled } from "../../database/instrumentation.js";
|
|
22
22
|
import { getRequestContext } from "../../request-context.js";
|
|
23
23
|
|
|
24
24
|
export const STREAM_END_PREFIX = "[emdash-stream-end]";
|
|
@@ -64,6 +64,14 @@ export function wrapBodyForStreamMetrics(response: Response): Response {
|
|
|
64
64
|
if (!metrics) return response;
|
|
65
65
|
const recorder = ctx?.queryRecorder;
|
|
66
66
|
|
|
67
|
+
// Claim the per-query flush: the recorder is mutated in-place by the
|
|
68
|
+
// Kysely log hook for the whole request, including queries issued by
|
|
69
|
+
// components while the body streams. Flushing here (rather than when
|
|
70
|
+
// middleware returns) is what captures those streaming queries. The
|
|
71
|
+
// flag tells the middleware's fallback flush to leave this recorder
|
|
72
|
+
// to us.
|
|
73
|
+
if (recorder) recorder.deferredFlush = true;
|
|
74
|
+
|
|
67
75
|
const transform = new TransformStream<Uint8Array, Uint8Array>({
|
|
68
76
|
flush() {
|
|
69
77
|
const snapshot: StreamEndSnapshot = {
|
|
@@ -79,6 +87,8 @@ export function wrapBodyForStreamMetrics(response: Response): Response {
|
|
|
79
87
|
cacheMisses: metrics.cacheMisses,
|
|
80
88
|
};
|
|
81
89
|
console.log(`${STREAM_END_PREFIX} ${JSON.stringify(snapshot)}`);
|
|
90
|
+
// Emit the full per-query log now that streaming is complete.
|
|
91
|
+
if (recorder) flushRecorder(recorder);
|
|
82
92
|
},
|
|
83
93
|
});
|
|
84
94
|
|