emdash 0.21.0 → 0.23.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-BxSmgtbF.d.mts → adapters-DAAjOID4.d.mts} +1 -1
- package/dist/{adapters-BxSmgtbF.d.mts.map → adapters-DAAjOID4.d.mts.map} +1 -1
- package/dist/after-B1IIdH3Y.mjs +29 -0
- package/dist/after-B1IIdH3Y.mjs.map +1 -0
- package/dist/{allowed-origins-BqC8cul8.mjs → allowed-origins-D5FxMUo8.mjs} +2 -2
- package/dist/{allowed-origins-BqC8cul8.mjs.map → allowed-origins-D5FxMUo8.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +20 -19
- 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 -4
- package/dist/{api-DxjIV2o8.mjs → api-BQ_yKRdG.mjs} +31 -25
- package/dist/api-BQ_yKRdG.mjs.map +1 -0
- package/dist/{api-tokens-BFFkB0jB.mjs → api-tokens-D6ppjIVi.mjs} +13 -3
- package/dist/api-tokens-D6ppjIVi.mjs.map +1 -0
- package/dist/{apply-CLjxheyb.mjs → apply-CWRyxIoO.mjs} +18 -18
- package/dist/{apply-CLjxheyb.mjs.map → apply-CWRyxIoO.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 +122 -26
- 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.mjs +6 -6
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +8 -6
- 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 +444 -149
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
- 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 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +18 -16
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +18 -16
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +18 -16
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +15 -13
- 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 -10
- 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 -10
- 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 +41 -39
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +41 -39
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +40 -38
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +40 -38
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +40 -38
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +40 -38
- 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 +40 -38
- 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 +40 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +40 -38
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +40 -38
- 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 +41 -39
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +40 -38
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +41 -39
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +40 -38
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +40 -38
- 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 +40 -38
- 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 -8
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/index.mjs +7 -7
- 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 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -11
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +8 -8
- 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 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +13 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +16 -15
- 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 -13
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -8
- 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 -8
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -15
- 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 -8
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
- 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 -12
- 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 +17 -15
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +12 -12
- 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 +19 -17
- 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 -46
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -8
- package/dist/astro/routes/api/media/_id_.mjs +8 -8
- 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 -10
- package/dist/astro/routes/api/media.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +11 -9
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +11 -9
- 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 -5
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +11 -11
- package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -11
- package/dist/astro/routes/api/redirects/_id_.mjs +12 -12
- package/dist/astro/routes/api/redirects/index.mjs +12 -12
- 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 +40 -38
- 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 +40 -38
- 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 +40 -38
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +40 -38
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +40 -38
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +9 -8
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +40 -38
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +40 -38
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +11 -11
- package/dist/astro/routes/api/search/index.mjs +10 -10
- package/dist/astro/routes/api/search/rebuild.mjs +11 -11
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +10 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +10 -10
- package/dist/astro/routes/api/sections/index.mjs +10 -10
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +16 -15
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -12
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +30 -27
- 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 +30 -28
- 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 -9
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -14
- 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 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -14
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- 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 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/index.mjs +11 -11
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +10 -9
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -12
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +11 -10
- 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-D5gfBVU5.mjs → authorize-Cse0k7B0.mjs} +2 -2
- package/dist/{authorize-D5gfBVU5.mjs.map → authorize-Cse0k7B0.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-V_Qp1Ziw.mjs → byline-DVo-liaP.mjs} +27 -76
- package/dist/byline-DVo-liaP.mjs.map +1 -0
- package/dist/{byline-fields-B0NO1yUB.mjs → byline-fields-B-KXkg5R.mjs} +3 -3
- package/dist/{byline-fields-B0NO1yUB.mjs.map → byline-fields-B-KXkg5R.mjs.map} +1 -1
- package/dist/{byline-fields-nBVqK_Ff.mjs → byline-fields-DaMKzkhO.mjs} +2 -2
- package/dist/{byline-fields-nBVqK_Ff.mjs.map → byline-fields-DaMKzkhO.mjs.map} +1 -1
- package/dist/{byline-fields-CQJRIQkn.d.mts → byline-fields-RFPkDLRw.d.mts} +56 -31
- package/dist/byline-fields-RFPkDLRw.d.mts.map +1 -0
- package/dist/{byline-registry-DedidtqC.mjs → byline-registry-BOjqDOim.mjs} +3 -3
- package/dist/{byline-registry-DedidtqC.mjs.map → byline-registry-BOjqDOim.mjs.map} +1 -1
- package/dist/{bylines-DfGDnred.mjs → bylines-f5ppBpD5.mjs} +8 -8
- package/dist/{bylines-DfGDnred.mjs.map → bylines-f5ppBpD5.mjs.map} +1 -1
- package/dist/{bylines-B2NWnIwS.mjs → bylines-pIKgc_TL.mjs} +10 -4
- package/dist/{bylines-B2NWnIwS.mjs.map → bylines-pIKgc_TL.mjs.map} +1 -1
- package/dist/{cache-DTTHWD8n.mjs → cache-Q6V4U-Xz.mjs} +3 -3
- package/dist/{cache-DTTHWD8n.mjs.map → cache-Q6V4U-Xz.mjs.map} +1 -1
- package/dist/{challenge-store-woE0bbCf.mjs → challenge-store-LhiqMccz.mjs} +1 -1
- package/dist/{challenge-store-woE0bbCf.mjs.map → challenge-store-LhiqMccz.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-Dyb-AutY.mjs +85 -0
- package/dist/comment-reaction-Dyb-AutY.mjs.map +1 -0
- package/dist/{comments-D2hNuxNa.mjs → comments-Cczx7AvD.mjs} +3 -3
- package/dist/{comments-D2hNuxNa.mjs.map → comments-Cczx7AvD.mjs.map} +1 -1
- package/dist/{components-DYKp2gmo.mjs → components-CYt4uVK9.mjs} +1 -1
- package/dist/{components-DYKp2gmo.mjs.map → components-CYt4uVK9.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-Cm4pt1Ws.mjs → context-B1W8soLv.mjs} +64 -26
- package/dist/context-B1W8soLv.mjs.map +1 -0
- package/dist/{cron-DdEVrQ2Y.mjs → cron-C5LVoNmP.mjs} +14 -2
- package/dist/cron-C5LVoNmP.mjs.map +1 -0
- package/dist/{dashboard-C-UYpps0.mjs → dashboard-CYjpQZ6-.mjs} +4 -4
- package/dist/{dashboard-C-UYpps0.mjs.map → dashboard-CYjpQZ6-.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-BluWkwGI.mjs → db-errors-UXB1CK42.mjs} +1 -1
- package/dist/{db-errors-BluWkwGI.mjs.map → db-errors-UXB1CK42.mjs.map} +1 -1
- package/dist/{default-NHGuJzQ3.mjs → default-CeRG-Ot4.mjs} +1 -1
- package/dist/{default-NHGuJzQ3.mjs.map → default-CeRG-Ot4.mjs.map} +1 -1
- package/dist/{device-flow-BQApWgnW.mjs → device-flow-DENDCQ9F.mjs} +5 -5
- package/dist/{device-flow-BQApWgnW.mjs.map → device-flow-DENDCQ9F.mjs.map} +1 -1
- package/dist/{email-console-BbU3RbWv.mjs → email-console-DJP32ucW.mjs} +1 -1
- package/dist/{email-console-BbU3RbWv.mjs.map → email-console-DJP32ucW.mjs.map} +1 -1
- package/dist/{error-CNn_w7jf.mjs → error-Bl6kZgtt.mjs} +2 -2
- package/dist/{error-CNn_w7jf.mjs.map → error-Bl6kZgtt.mjs.map} +1 -1
- package/dist/{escape-DPgcxcpL.mjs → escape-Bjio4ZsM.mjs} +1 -1
- package/dist/{escape-DPgcxcpL.mjs.map → escape-Bjio4ZsM.mjs.map} +1 -1
- package/dist/field-defs-cache-ztrdzUGb.mjs +77 -0
- package/dist/field-defs-cache-ztrdzUGb.mjs.map +1 -0
- package/dist/{fts-manager-Cx5z8jdA.mjs → fts-manager-CQuHt-vS.mjs} +2 -2
- package/dist/{fts-manager-Cx5z8jdA.mjs.map → fts-manager-CQuHt-vS.mjs.map} +1 -1
- package/dist/{hash-DlvIFn0b.mjs → hash-DrvzIXcz.mjs} +1 -1
- package/dist/{hash-DlvIFn0b.mjs.map → hash-DrvzIXcz.mjs.map} +1 -1
- package/dist/{import-KyxT1Mbs.mjs → import-Bb1T9WJS.mjs} +4 -4
- package/dist/{import-KyxT1Mbs.mjs.map → import-Bb1T9WJS.mjs.map} +1 -1
- package/dist/{index-D2VAiumu.d.mts → index-BaIj5hIq.d.mts} +198 -21
- package/dist/index-BaIj5hIq.d.mts.map +1 -0
- package/dist/{index-uT2yR66F.d.mts → index-qbL02uhs.d.mts} +3 -3
- package/dist/{index-uT2yR66F.d.mts.map → index-qbL02uhs.d.mts.map} +1 -1
- package/dist/index.d.mts +18 -17
- package/dist/index.mjs +64 -61
- package/dist/{init-lock-DlBHjf9-.mjs → init-lock-6b309ZrF.mjs} +2 -29
- package/dist/init-lock-6b309ZrF.mjs.map +1 -0
- package/dist/{load-Dq91b_DK.mjs → load-BNo-ER8C.mjs} +2 -2
- package/dist/{load-Dq91b_DK.mjs.map → load-BNo-ER8C.mjs.map} +1 -1
- package/dist/{loader-BqWjcH3h.mjs → loader-Dn74CG1b.mjs} +70 -11
- package/dist/loader-Dn74CG1b.mjs.map +1 -0
- package/dist/{manifest-schema-DFPeqMAn.mjs → manifest-schema-BWKnQYQF.mjs} +1 -1
- package/dist/{manifest-schema-DFPeqMAn.mjs.map → manifest-schema-BWKnQYQF.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 +19 -11
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +16 -13
- 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-_A0SuDn4.mjs → media-allowlist-B77I5_bw.mjs} +2 -2
- package/dist/{media-allowlist-_A0SuDn4.mjs.map → media-allowlist-B77I5_bw.mjs.map} +1 -1
- package/dist/{media-url-CqLd69IO.mjs → media-url-O4rm9-SQ.mjs} +1 -1
- package/dist/{media-url-CqLd69IO.mjs.map → media-url-O4rm9-SQ.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-Ryk9L7fT.mjs → menus-DS8VTZgo.mjs} +167 -24
- package/dist/menus-DS8VTZgo.mjs.map +1 -0
- package/dist/{mime-YbtlEtvS.mjs → mime-BTzvzJ8M.mjs} +1 -1
- package/dist/{mime-YbtlEtvS.mjs.map → mime-BTzvzJ8M.mjs.map} +1 -1
- package/dist/{mode-CGXzIbD8.mjs → mode-BB0F8xTC.mjs} +1 -1
- package/dist/{mode-CGXzIbD8.mjs.map → mode-BB0F8xTC.mjs.map} +1 -1
- package/dist/{normalize-DKsg36ty.mjs → normalize-ClbNIenm.mjs} +1 -1
- package/dist/{normalize-DKsg36ty.mjs.map → normalize-ClbNIenm.mjs.map} +1 -1
- package/dist/{oauth-authorization-C2kVyjXI.mjs → oauth-authorization-CsvzIp_F.mjs} +5 -5
- package/dist/{oauth-authorization-C2kVyjXI.mjs.map → oauth-authorization-CsvzIp_F.mjs.map} +1 -1
- package/dist/{oauth-clients-BC873NCV.mjs → oauth-clients-C9SYwEbZ.mjs} +1 -1
- package/dist/{oauth-clients-BC873NCV.mjs.map → oauth-clients-C9SYwEbZ.mjs.map} +1 -1
- package/dist/{oauth-state-store-Cd--TUaq.mjs → oauth-state-store---zrApfB.mjs} +1 -1
- package/dist/{oauth-state-store-Cd--TUaq.mjs.map → oauth-state-store---zrApfB.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-e4wOvDud.mjs → oauth-user-lookup-SHsWRlG9.mjs} +1 -1
- package/dist/{oauth-user-lookup-e4wOvDud.mjs.map → oauth-user-lookup-SHsWRlG9.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-9kLgkE8m.d.mts → options-CqECG0gM.d.mts} +3 -3
- package/dist/{options-9kLgkE8m.d.mts.map → options-CqECG0gM.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-DzSrk1t8.mjs → parse-C9hpjUyY.mjs} +2 -2
- package/dist/{parse-DzSrk1t8.mjs.map → parse-C9hpjUyY.mjs.map} +1 -1
- package/dist/{passkey-config-BpjbE_Uv.mjs → passkey-config-C0YfSBko.mjs} +1 -1
- package/dist/{passkey-config-BpjbE_Uv.mjs.map → passkey-config-C0YfSBko.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-2xumZh4g.mjs → placeholder-B0s2mWu5.mjs} +1 -1
- package/dist/{placeholder-2xumZh4g.mjs.map → placeholder-B0s2mWu5.mjs.map} +1 -1
- package/dist/{placeholder-BevVKfay.d.mts → placeholder-QoI4gEzP.d.mts} +1 -1
- package/dist/{placeholder-BevVKfay.d.mts.map → placeholder-QoI4gEzP.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-1cIrOb1Y.mjs → portable-text-BICg8bTk.mjs} +2 -135
- package/dist/portable-text-BICg8bTk.mjs.map +1 -0
- package/dist/{preview-Dqv2hwXr.mjs → preview-DKGCt2_p.mjs} +2 -2
- package/dist/{preview-Dqv2hwXr.mjs.map → preview-DKGCt2_p.mjs.map} +1 -1
- package/dist/{public-url-D_zARuvZ.mjs → public-url-CTVqgMmg.mjs} +1 -1
- package/dist/{public-url-D_zARuvZ.mjs.map → public-url-CTVqgMmg.mjs.map} +1 -1
- package/dist/{query-Crm038Mc.mjs → query-DgUHZLWB.mjs} +230 -31
- package/dist/query-DgUHZLWB.mjs.map +1 -0
- package/dist/{rate-limit-hRTBqmw1.mjs → rate-limit-BuQ5d4X_.mjs} +2 -2
- package/dist/{rate-limit-hRTBqmw1.mjs.map → rate-limit-BuQ5d4X_.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/{redirect-C-OOkyku.mjs → redirect-CS-PHtNh.mjs} +1 -1
- package/dist/{redirect-C-OOkyku.mjs.map → redirect-CS-PHtNh.mjs.map} +1 -1
- package/dist/{redirects-CP3TnTLO.mjs → redirects-BZ8Mxn8H.mjs} +6 -6
- package/dist/{redirects-CP3TnTLO.mjs.map → redirects-BZ8Mxn8H.mjs.map} +1 -1
- package/dist/{redirects-6Zg2SoYo.mjs → redirects-x9eFPeyi.mjs} +10 -3
- package/dist/redirects-x9eFPeyi.mjs.map +1 -0
- package/dist/{registry-diMzD1Wf.mjs → registry-CK1SS6pi.mjs} +6 -6
- package/dist/{registry-diMzD1Wf.mjs.map → registry-CK1SS6pi.mjs.map} +1 -1
- package/dist/{request-cache-UwmBAiUK.mjs → request-cache-KCNHp_RJ.mjs} +1 -1
- package/dist/{request-cache-UwmBAiUK.mjs.map → request-cache-KCNHp_RJ.mjs.map} +1 -1
- package/dist/{request-meta-DPechd0W.mjs → request-meta-CmS1tDFf.mjs} +2 -2
- package/dist/{request-meta-DPechd0W.mjs.map → request-meta-CmS1tDFf.mjs.map} +1 -1
- package/dist/{resolve-B3NUUtVY.mjs → resolve-C7I0qiR0.mjs} +1 -1
- package/dist/{resolve-B3NUUtVY.mjs.map → resolve-C7I0qiR0.mjs.map} +1 -1
- package/dist/{runner-C8vcbvCe.d.mts → runner-CEtq-6Sm.d.mts} +2 -2
- package/dist/{runner-C8vcbvCe.d.mts.map → runner-CEtq-6Sm.d.mts.map} +1 -1
- package/dist/{runner--4wMWwKM.mjs → runner-DYYnW530.mjs} +201 -170
- package/dist/runner-DYYnW530.mjs.map +1 -0
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +3 -3
- package/dist/{schema-BDOkd3OU.mjs → schema-CbFRFoM7.mjs} +13 -8
- package/dist/schema-CbFRFoM7.mjs.map +1 -0
- package/dist/{search-Bs_J_EW-.mjs → search-C-waE_YW.mjs} +4 -4
- package/dist/{search-Bs_J_EW-.mjs.map → search-C-waE_YW.mjs.map} +1 -1
- package/dist/{secrets-C8xmE6mR.mjs → secrets-BSf9pRRY.mjs} +5 -5
- package/dist/{secrets-C8xmE6mR.mjs.map → secrets-BSf9pRRY.mjs.map} +1 -1
- package/dist/{sections-P0zuBlyz.mjs → sections-osX9U-YJ.mjs} +3 -3
- package/dist/{sections-P0zuBlyz.mjs.map → sections-osX9U-YJ.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +23 -21
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-DpNgGQjF.mjs → seo-4FovMwNS.mjs} +5 -2
- package/dist/seo-4FovMwNS.mjs.map +1 -0
- package/dist/{seo-CLhm-Fmb.mjs → seo-DCEF-AVr.mjs} +1 -1
- package/dist/{seo-CLhm-Fmb.mjs.map → seo-DCEF-AVr.mjs.map} +1 -1
- package/dist/{service-CDQQnT8W.mjs → service-jby1RRmU.mjs} +3 -3
- package/dist/{service-CDQQnT8W.mjs.map → service-jby1RRmU.mjs.map} +1 -1
- package/dist/session-user-B8aLtKAH.mjs +51 -0
- package/dist/session-user-B8aLtKAH.mjs.map +1 -0
- package/dist/{settings-sO0Fif4p.mjs → settings-4bRT2NIf.mjs} +3 -3
- package/dist/{settings-sO0Fif4p.mjs.map → settings-4bRT2NIf.mjs.map} +1 -1
- package/dist/{settings-BjBsmVAo.mjs → settings-t-H2jPuJ.mjs} +18 -10
- package/dist/settings-t-H2jPuJ.mjs.map +1 -0
- package/dist/{setup-complete-CMMr-oZU.mjs → setup-complete-gEiySUc-.mjs} +2 -2
- package/dist/{setup-complete-CMMr-oZU.mjs.map → setup-complete-gEiySUc-.mjs.map} +1 -1
- package/dist/{setup-nonce-169xl4fV.mjs → setup-nonce-DzS50zme.mjs} +1 -1
- package/dist/{setup-nonce-169xl4fV.mjs.map → setup-nonce-DzS50zme.mjs.map} +1 -1
- package/dist/{single-flight-cache-C0UV1Npg.mjs → single-flight-cache-Cdfkic3t.mjs} +2 -2
- package/dist/{single-flight-cache-C0UV1Npg.mjs.map → single-flight-cache-Cdfkic3t.mjs.map} +1 -1
- package/dist/{site-url-vtsuOvSD.mjs → site-url-BLebyON8.mjs} +2 -2
- package/dist/{site-url-vtsuOvSD.mjs.map → site-url-BLebyON8.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-XO05Voq6.mjs → ssrf-BRKb343l.mjs} +1 -1
- package/dist/{ssrf-XO05Voq6.mjs.map → ssrf-BRKb343l.mjs.map} +1 -1
- package/dist/{status-2gZklYuj.mjs → status-vUK0SA17.mjs} +1 -1
- package/dist/{status-2gZklYuj.mjs.map → status-vUK0SA17.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-DuESHWKI.mjs → taxonomies-BBB8O-CU.mjs} +7 -7
- package/dist/{taxonomies-DuESHWKI.mjs.map → taxonomies-BBB8O-CU.mjs.map} +1 -1
- package/dist/{taxonomies-BBxYA38v.mjs → taxonomies-Dxrc_szG.mjs} +177 -123
- package/dist/taxonomies-Dxrc_szG.mjs.map +1 -0
- package/dist/{taxonomy-CdllE4oq.mjs → taxonomy-B2HQuVf5.mjs} +19 -6
- package/dist/taxonomy-B2HQuVf5.mjs.map +1 -0
- package/dist/{tokens-DMkVjxrx.mjs → tokens-LeuXF9gG.mjs} +2 -2
- package/dist/{tokens-DMkVjxrx.mjs.map → tokens-LeuXF9gG.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-jdvsZEIt.d.mts → transport-BZ-03aFT.d.mts} +1 -1
- package/dist/{transport-jdvsZEIt.d.mts.map → transport-BZ-03aFT.d.mts.map} +1 -1
- package/dist/transport-_2nBz7e9.mjs +135 -0
- package/dist/transport-_2nBz7e9.mjs.map +1 -0
- package/dist/{trusted-proxy-CHp41Fjj.mjs → trusted-proxy-DZY5WCn2.mjs} +1 -1
- package/dist/{trusted-proxy-CHp41Fjj.mjs.map → trusted-proxy-DZY5WCn2.mjs.map} +1 -1
- package/dist/{types-Del0VMij.d.mts → types-B-gIxFCE.d.mts} +9 -1
- package/dist/{types-Del0VMij.d.mts.map → types-B-gIxFCE.d.mts.map} +1 -1
- package/dist/{types-DdkL6fyv.d.mts → types-BG8_XTLj.d.mts} +1 -1
- package/dist/{types-DdkL6fyv.d.mts.map → types-BG8_XTLj.d.mts.map} +1 -1
- package/dist/{types-BTnnBYVX.d.mts → types-BWh2MjmA.d.mts} +15 -2
- package/dist/types-BWh2MjmA.d.mts.map +1 -0
- package/dist/{types-CkEuk-Zr.d.mts → types-BWqGVhFn.d.mts} +1 -1
- package/dist/{types-CkEuk-Zr.d.mts.map → types-BWqGVhFn.d.mts.map} +1 -1
- package/dist/{types-DejCHqWT.mjs → types-CQAugunJ.mjs} +1 -1
- package/dist/{types-DejCHqWT.mjs.map → types-CQAugunJ.mjs.map} +1 -1
- package/dist/{types-Bzfk2yC8.d.mts → types-CTLJYMhN.d.mts} +1 -1
- package/dist/{types-Bzfk2yC8.d.mts.map → types-CTLJYMhN.d.mts.map} +1 -1
- package/dist/{types-BFgYtuKd.d.mts → types-CUsXGRVj.d.mts} +1 -1
- package/dist/{types-BFgYtuKd.d.mts.map → types-CUsXGRVj.d.mts.map} +1 -1
- package/dist/{types-BXSUSAjt.mjs → types-DXOIbece.mjs} +3 -3
- package/dist/types-DXOIbece.mjs.map +1 -0
- package/dist/{types-u_XxjbS8.d.mts → types-DrYMm9s5.d.mts} +1 -1
- package/dist/{types-u_XxjbS8.d.mts.map → types-DrYMm9s5.d.mts.map} +1 -1
- package/dist/{types-DO7whVYU.d.mts → types-TTx8uP7V.d.mts} +2 -2
- package/dist/{types-DO7whVYU.d.mts.map → types-TTx8uP7V.d.mts.map} +1 -1
- package/dist/types-fS7-VTdR.d.mts +124 -0
- package/dist/types-fS7-VTdR.d.mts.map +1 -0
- package/dist/{types-BIduXPJk.mjs → types-tM44hEcf.mjs} +1 -1
- package/dist/{types-BIduXPJk.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-C4M981Br.mjs → utils-B7A57fm9.mjs} +2 -2
- package/dist/{utils-C4M981Br.mjs.map → utils-B7A57fm9.mjs.map} +1 -1
- package/dist/{validate-DGhQPXzI.mjs → validate-0Utjspbs.mjs} +3 -3
- package/dist/{validate-DGhQPXzI.mjs.map → validate-0Utjspbs.mjs.map} +1 -1
- package/dist/{validate-cJOiOvT2.d.mts → validate-DOFrIb-c.d.mts} +5 -5
- package/dist/{validate-cJOiOvT2.d.mts.map → validate-DOFrIb-c.d.mts.map} +1 -1
- package/dist/{validation-DVHjPM1M.mjs → validation-D9EnzH1T.mjs} +6 -6
- package/dist/{validation-DVHjPM1M.mjs.map → validation-D9EnzH1T.mjs.map} +1 -1
- package/dist/version-BgVM_1MU.mjs +7 -0
- package/dist/{version-BOjj_cfz.mjs.map → version-BgVM_1MU.mjs.map} +1 -1
- package/dist/{widgets-Ci6hLwfO.mjs → widgets-BSTzPUYa.mjs} +4 -4
- package/dist/{widgets-Ci6hLwfO.mjs.map → widgets-BSTzPUYa.mjs.map} +1 -1
- package/dist/{zod-generator-CarzgPAu.mjs → zod-generator-ElVQOav7.mjs} +51 -15
- package/dist/zod-generator-ElVQOav7.mjs.map +1 -0
- package/package.json +19 -6
- package/src/api/handlers/api-tokens.ts +19 -0
- package/src/api/handlers/comment-reactions.ts +165 -0
- package/src/api/handlers/schema.ts +8 -0
- package/src/api/schemas/bylines.ts +8 -0
- package/src/api/schemas/comments.ts +10 -0
- package/src/astro/image-endpoint.ts +84 -0
- package/src/astro/index.ts +6 -0
- package/src/astro/integration/index.ts +83 -22
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/runtime.ts +65 -1
- package/src/astro/integration/virtual-modules.ts +40 -0
- package/src/astro/integration/vite-config.ts +25 -1
- package/src/astro/middleware/auth.ts +4 -3
- package/src/astro/middleware/request-context.ts +6 -1
- package/src/astro/middleware/scoped-db.ts +131 -0
- package/src/astro/middleware/stream-end-metrics.ts +15 -9
- package/src/astro/middleware.ts +131 -31
- package/src/astro/object-cache/adapters.ts +50 -0
- package/src/astro/prefetch.ts +77 -0
- package/src/astro/routes/admin.astro +5 -1
- package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
- package/src/astro/routes/api/schema/index.ts +9 -3
- 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/cli/commands/export-seed.ts +10 -7
- package/src/comments/query.ts +78 -7
- package/src/comments/ranking.ts +58 -0
- package/src/components/Block.astro +71 -0
- package/src/components/Comments.astro +136 -1
- package/src/components/EmDashMedia.astro +1 -2
- package/src/components/Image.astro +36 -2
- package/src/components/InlinePortableTextEditor.tsx +10 -2
- package/src/components/index.ts +5 -0
- package/src/components/portable-text-text-align.ts +38 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +5 -1
- package/src/content/converters/prosemirror-to-portable-text.ts +8 -0
- package/src/content/converters/types.ts +1 -0
- 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 +27 -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/repositories/types.ts +13 -0
- package/src/database/types.ts +9 -0
- package/src/emdash-runtime.ts +244 -75
- package/src/index.ts +22 -0
- package/src/loader.ts +97 -5
- package/src/mcp/server.ts +307 -20
- package/src/media/image-endpoint.ts +167 -0
- package/src/media/local-runtime.ts +18 -5
- 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/plugins/context.ts +94 -22
- package/src/plugins/cron.ts +18 -2
- package/src/plugins/routes.ts +40 -1
- package/src/query.ts +304 -18
- package/src/schema/query.ts +11 -4
- package/src/schema/zod-generator.ts +53 -8
- package/src/settings/index.ts +18 -5
- package/src/taxonomies/index.ts +263 -165
- package/src/ui.ts +5 -0
- package/src/virtual-modules.d.ts +24 -0
- package/dist/api-DxjIV2o8.mjs.map +0 -1
- package/dist/api-tokens-BFFkB0jB.mjs.map +0 -1
- package/dist/byline-V_Qp1Ziw.mjs.map +0 -1
- package/dist/byline-fields-CQJRIQkn.d.mts.map +0 -1
- package/dist/comment-sqQxNpN3.mjs.map +0 -1
- package/dist/content-BIlVx-RX.mjs.map +0 -1
- package/dist/context-Cm4pt1Ws.mjs.map +0 -1
- package/dist/cron-DdEVrQ2Y.mjs.map +0 -1
- package/dist/index-D2VAiumu.d.mts.map +0 -1
- package/dist/init-lock-DlBHjf9-.mjs.map +0 -1
- package/dist/loader-BqWjcH3h.mjs.map +0 -1
- package/dist/menus-DX4_E01q.mjs.map +0 -1
- package/dist/menus-Ryk9L7fT.mjs.map +0 -1
- package/dist/query-Crm038Mc.mjs.map +0 -1
- package/dist/redirects-6Zg2SoYo.mjs.map +0 -1
- package/dist/runner--4wMWwKM.mjs.map +0 -1
- package/dist/schema-BDOkd3OU.mjs.map +0 -1
- package/dist/seo-DpNgGQjF.mjs.map +0 -1
- package/dist/settings-BjBsmVAo.mjs.map +0 -1
- package/dist/taxonomies-BBxYA38v.mjs.map +0 -1
- package/dist/taxonomy-CdllE4oq.mjs.map +0 -1
- package/dist/transport-1cIrOb1Y.mjs.map +0 -1
- package/dist/types-BTnnBYVX.d.mts.map +0 -1
- package/dist/types-BXSUSAjt.mjs.map +0 -1
- package/dist/version-BOjj_cfz.mjs +0 -7
- package/dist/zod-generator-CarzgPAu.mjs.map +0 -1
- /package/dist/{api-tokens-C7ywRx7l.mjs → api-tokens-B4BQybOp.mjs} +0 -0
- /package/dist/{ssrf-CRZGzjdL.mjs → ssrf-CcX9zvMK.mjs} +0 -0
- /package/dist/{types-BoRm8-pp.mjs → types-BvbeGEtr.mjs} +0 -0
|
@@ -1,77 +1,82 @@
|
|
|
1
|
-
import { i as runMigrations, t as MIGRATION_RACE_WAIT_MS } from "../runner
|
|
1
|
+
import { i as runMigrations, t as MIGRATION_RACE_WAIT_MS } from "../runner-DYYnW530.mjs";
|
|
2
2
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
3
3
|
import { o as isSqlite } from "../dialect-helpers-DRI5pyY3.mjs";
|
|
4
4
|
import { i as setI18nConfig } from "../config-CVssduLe.mjs";
|
|
5
|
-
import { _ as resolveExclusiveHooks, g as createHookPipeline, m as EmailPipeline, p as PluginRouteRegistry, v as definePlugin } from "../menus-
|
|
6
|
-
import {
|
|
7
|
-
import "../base64-CqR-7kqF.mjs";
|
|
8
|
-
import "../types-BXSUSAjt.mjs";
|
|
9
|
-
import { t as MediaRepository } from "../media-JOf3pNkw.mjs";
|
|
10
|
-
import "../user-C0um7wrg.mjs";
|
|
11
|
-
import "../taxonomy-CdllE4oq.mjs";
|
|
12
|
-
import "../comment-sqQxNpN3.mjs";
|
|
13
|
-
import { t as OptionsRepository } from "../options-BPCVnesz.mjs";
|
|
14
|
-
import "../context-Cm4pt1Ws.mjs";
|
|
15
|
-
import "../menus-DX4_E01q.mjs";
|
|
16
|
-
import "../redirect-CRWIt8Zj.mjs";
|
|
17
|
-
import { n as initWithLock, r as after, t as createInitLock } from "../init-lock-DlBHjf9-.mjs";
|
|
5
|
+
import { _ as resolveExclusiveHooks, g as createHookPipeline, m as EmailPipeline, p as PluginRouteRegistry, t as getMenu, v as definePlugin } from "../menus-DS8VTZgo.mjs";
|
|
6
|
+
import { t as after } from "../after-B1IIdH3Y.mjs";
|
|
18
7
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
19
|
-
import
|
|
20
|
-
import "../
|
|
21
|
-
import "../
|
|
22
|
-
import
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import "../
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
8
|
+
import "../object-cache-SEb2IM4Z.mjs";
|
|
9
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-2PTDNnoh.mjs";
|
|
10
|
+
import "../base64-CmWvODNW.mjs";
|
|
11
|
+
import "../types-DXOIbece.mjs";
|
|
12
|
+
import { t as MediaRepository } from "../media-Bw0sA6rb.mjs";
|
|
13
|
+
import "../user-Db-Rti_z.mjs";
|
|
14
|
+
import "../taxonomy-B2HQuVf5.mjs";
|
|
15
|
+
import "../comment-80UyJJUR.mjs";
|
|
16
|
+
import { t as OptionsRepository } from "../options-DTTML-Tx.mjs";
|
|
17
|
+
import "../context-B1W8soLv.mjs";
|
|
18
|
+
import "../menus-CYs0WZoL.mjs";
|
|
19
|
+
import "../redirect-Bifv_yHv.mjs";
|
|
20
|
+
import { i as setRequestCacheEntry, r as requestCached } from "../request-cache-KCNHp_RJ.mjs";
|
|
21
|
+
import "../byline-registry-BOjqDOim.mjs";
|
|
22
|
+
import { n as initWithLock, t as createInitLock } from "../init-lock-6b309ZrF.mjs";
|
|
23
|
+
import "../field-defs-cache-ztrdzUGb.mjs";
|
|
24
|
+
import "../byline-DVo-liaP.mjs";
|
|
25
|
+
import { n as normalizeMediaValue } from "../normalize-ClbNIenm.mjs";
|
|
26
|
+
import "../placeholder-B0s2mWu5.mjs";
|
|
27
|
+
import "../seo-4FovMwNS.mjs";
|
|
28
|
+
import { n as isMissingTableError } from "../db-errors-UXB1CK42.mjs";
|
|
29
|
+
import { $ as handleContentGet, B as handleMediaUpdate, G as handleContentAuthors, H as handleRevisionList, I as handleMediaCreate, J as handleContentCountTrashed, K as handleContentCompare, L as handleMediaDelete, Q as handleContentDuplicate, R as handleMediaGet, S as PluginStateRepository, U as handleRevisionRestore, V as handleRevisionGet, X as handleContentDelete, Y as handleContentCreate, Z as handleContentDiscardDraft, _ as loadBundleFromR2, at as handleContentRestore, ct as handleContentUnpublish, dt as validateRev, et as handleContentGetIncludingTrashed, it as handleContentPublish, lt as handleContentUnschedule, nt as handleContentListTrashed, ot as handleContentSchedule, q as handleContentCountScheduled, rt as handleContentPermanentDelete, s as normalizeRegistryConfig, st as handleContentTranslations, tt as handleContentList, ut as handleContentUpdate, z as handleMediaList } from "../api-BQ_yKRdG.mjs";
|
|
30
|
+
import "../dashboard-CYjpQZ6-.mjs";
|
|
31
|
+
import { n as hashString } from "../hash-DrvzIXcz.mjs";
|
|
32
|
+
import { t as FTSManager } from "../fts-manager-CQuHt-vS.mjs";
|
|
33
|
+
import { n as SchemaRegistry } from "../registry-CK1SS6pi.mjs";
|
|
31
34
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
32
|
-
import {
|
|
33
|
-
import "../schema-
|
|
34
|
-
import "../zod-generator-
|
|
35
|
-
import "../seo-
|
|
36
|
-
import "../sections-
|
|
37
|
-
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-
|
|
38
|
-
import { o as invalidateSiteSettingsCache } from "../settings-
|
|
39
|
-
import "../settings-
|
|
40
|
-
import "../resolve-
|
|
41
|
-
import "../taxonomies-
|
|
42
|
-
import "../taxonomies-
|
|
43
|
-
import { r as normalizeManifestRoute } from "../manifest-schema-
|
|
44
|
-
import "../types-
|
|
45
|
-
import "../ssrf-
|
|
46
|
-
import "../error-
|
|
47
|
-
import "../parse-
|
|
48
|
-
import "../redirects-
|
|
49
|
-
import "../byline-fields-
|
|
50
|
-
import "../status-
|
|
51
|
-
import { a as invalidateUrlPatternCache } from "../query-
|
|
52
|
-
import "../import-
|
|
53
|
-
import { t as getTrustedProxyHeaders } from "../trusted-proxy-
|
|
54
|
-
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-
|
|
55
|
-
import "../ssrf-
|
|
56
|
-
import { n as CronExecutor } from "../cron-
|
|
57
|
-
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-
|
|
58
|
-
import "../utils-
|
|
59
|
-
import "../tokens-
|
|
60
|
-
import "../preview-
|
|
61
|
-
import "../
|
|
62
|
-
import "../
|
|
63
|
-
import "../
|
|
64
|
-
import "../
|
|
65
|
-
import "../
|
|
35
|
+
import { a as getDb } from "../loader-Dn74CG1b.mjs";
|
|
36
|
+
import "../schema-CbFRFoM7.mjs";
|
|
37
|
+
import "../zod-generator-ElVQOav7.mjs";
|
|
38
|
+
import "../seo-DCEF-AVr.mjs";
|
|
39
|
+
import "../sections-osX9U-YJ.mjs";
|
|
40
|
+
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-Cdfkic3t.mjs";
|
|
41
|
+
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-t-H2jPuJ.mjs";
|
|
42
|
+
import "../settings-4bRT2NIf.mjs";
|
|
43
|
+
import "../resolve-C7I0qiR0.mjs";
|
|
44
|
+
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-Dxrc_szG.mjs";
|
|
45
|
+
import "../taxonomies-BBB8O-CU.mjs";
|
|
46
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-BWKnQYQF.mjs";
|
|
47
|
+
import "../types-BvbeGEtr.mjs";
|
|
48
|
+
import "../ssrf-BRKb343l.mjs";
|
|
49
|
+
import "../error-Bl6kZgtt.mjs";
|
|
50
|
+
import "../parse-C9hpjUyY.mjs";
|
|
51
|
+
import "../redirects-x9eFPeyi.mjs";
|
|
52
|
+
import "../byline-fields-B-KXkg5R.mjs";
|
|
53
|
+
import "../status-vUK0SA17.mjs";
|
|
54
|
+
import { a as invalidateUrlPatternCache } from "../query-DgUHZLWB.mjs";
|
|
55
|
+
import "../import-Bb1T9WJS.mjs";
|
|
56
|
+
import { t as getTrustedProxyHeaders } from "../trusted-proxy-DZY5WCn2.mjs";
|
|
57
|
+
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-CmS1tDFf.mjs";
|
|
58
|
+
import "../ssrf-CcX9zvMK.mjs";
|
|
59
|
+
import { n as CronExecutor } from "../cron-C5LVoNmP.mjs";
|
|
60
|
+
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-DJP32ucW.mjs";
|
|
61
|
+
import "../utils-B7A57fm9.mjs";
|
|
62
|
+
import "../tokens-LeuXF9gG.mjs";
|
|
63
|
+
import "../preview-DKGCt2_p.mjs";
|
|
64
|
+
import "../comment-reaction-Dyb-AutY.mjs";
|
|
65
|
+
import "../bylines-f5ppBpD5.mjs";
|
|
66
|
+
import { n as getWidgetAreas } from "../widgets-BSTzPUYa.mjs";
|
|
67
|
+
import "../apply-CWRyxIoO.mjs";
|
|
68
|
+
import "../load-BNo-ER8C.mjs";
|
|
69
|
+
import "../search-C-waE_YW.mjs";
|
|
66
70
|
import "../index.mjs";
|
|
67
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
68
|
-
import { t as getAuthMode } from "../mode-
|
|
69
|
-
import { t as cleanupExpiredChallenges } from "../challenge-store-
|
|
70
|
-
import { a as validateEncryptionKeyAtStartup } from "../secrets-
|
|
71
|
+
import { n as VERSION, t as COMMIT } from "../version-BgVM_1MU.mjs";
|
|
72
|
+
import { t as getAuthMode } from "../mode-BB0F8xTC.mjs";
|
|
73
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-LhiqMccz.mjs";
|
|
74
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-BSf9pRRY.mjs";
|
|
75
|
+
import { t as resolveSessionUser } from "../session-user-B8aLtKAH.mjs";
|
|
71
76
|
import { Kysely, sql } from "kysely";
|
|
72
77
|
import { defineMiddleware } from "astro:middleware";
|
|
73
78
|
import virtualConfig from "virtual:emdash/config";
|
|
74
|
-
import { createDialect, createRequestScopedDb } from "virtual:emdash/dialect";
|
|
79
|
+
import { createCoalescingDialect, createDialect, createRequestScopedDb } from "virtual:emdash/dialect";
|
|
75
80
|
import { mediaProviders } from "virtual:emdash/media-providers";
|
|
76
81
|
import { plugins } from "virtual:emdash/plugins";
|
|
77
82
|
import * as virtualSandboxRunnerModule from "virtual:emdash/sandbox-runner";
|
|
@@ -369,6 +374,25 @@ function getDbHolder() {
|
|
|
369
374
|
}
|
|
370
375
|
return holder;
|
|
371
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Auto-seed runs at most once per isolate per database. Its lock + "done" set
|
|
379
|
+
* live on globalThis (same bundler-duplication reasoning as the db cache) so a
|
|
380
|
+
* reclaimed-and-rerun `create()` can't seed a second time concurrently. The
|
|
381
|
+
* lock polls rather than sharing a promise, so it is safe to await across a
|
|
382
|
+
* cancelled owner in workerd.
|
|
383
|
+
*/
|
|
384
|
+
const SEED_HOLDER_KEY = Symbol.for("emdash:seed-state");
|
|
385
|
+
function getSeedHolder() {
|
|
386
|
+
let holder = globalSymbolStore[SEED_HOLDER_KEY];
|
|
387
|
+
if (!holder) {
|
|
388
|
+
holder = {
|
|
389
|
+
done: /* @__PURE__ */ new Set(),
|
|
390
|
+
lock: createInitLock()
|
|
391
|
+
};
|
|
392
|
+
globalSymbolStore[SEED_HOLDER_KEY] = holder;
|
|
393
|
+
}
|
|
394
|
+
return holder;
|
|
395
|
+
}
|
|
372
396
|
const storageCache = /* @__PURE__ */ new Map();
|
|
373
397
|
const sandboxedPluginCache = /* @__PURE__ */ new Map();
|
|
374
398
|
/**
|
|
@@ -402,7 +426,20 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
402
426
|
configuredPlugins;
|
|
403
427
|
sandboxedPlugins;
|
|
404
428
|
sandboxedPluginEntries;
|
|
405
|
-
|
|
429
|
+
/**
|
|
430
|
+
* Schema registry bound to the current request/event-scoped connection.
|
|
431
|
+
* Built per access (SchemaRegistry just wraps a db) against `this.db`, the
|
|
432
|
+
* ALS-aware getter — never a captured snapshot of the singleton. On a
|
|
433
|
+
* connection-backed adapter (Postgres over Hyperdrive) a captured singleton
|
|
434
|
+
* would query a socket opened by an earlier event and trip workerd's
|
|
435
|
+
* cross-request I/O guard; the catch in handlers like handleContentUpdate
|
|
436
|
+
* would then silently treat a revision-enabled collection as non-revisioned
|
|
437
|
+
* and write draft edits to live columns. Same reasoning as the per-call
|
|
438
|
+
* registry in _buildManifest().
|
|
439
|
+
*/
|
|
440
|
+
get schemaRegistry() {
|
|
441
|
+
return new SchemaRegistry(this.db);
|
|
442
|
+
}
|
|
406
443
|
_hooks;
|
|
407
444
|
config;
|
|
408
445
|
mediaProviders;
|
|
@@ -450,7 +487,6 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
450
487
|
this.configuredPlugins = parts.configuredPlugins;
|
|
451
488
|
this.sandboxedPlugins = parts.sandboxedPlugins;
|
|
452
489
|
this.sandboxedPluginEntries = parts.sandboxedPluginEntries;
|
|
453
|
-
this.schemaRegistry = new SchemaRegistry(parts.db);
|
|
454
490
|
this._hooks = parts.hooks;
|
|
455
491
|
this.enabledPlugins = parts.enabledPlugins;
|
|
456
492
|
this.pluginStates = parts.pluginStates;
|
|
@@ -567,10 +603,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
567
603
|
async rebuildHookPipeline() {
|
|
568
604
|
const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
|
|
569
605
|
await EmDashRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
|
|
570
|
-
if (this.email) newPipeline.setContextFactory({
|
|
571
|
-
db: this.db,
|
|
572
|
-
emailPipeline: this.email
|
|
573
|
-
});
|
|
606
|
+
if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
|
|
574
607
|
if (this.cronScheduler) {
|
|
575
608
|
const scheduler = this.cronScheduler;
|
|
576
609
|
newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
|
|
@@ -820,29 +853,100 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
820
853
|
}
|
|
821
854
|
};
|
|
822
855
|
const db = await phase("rt.db", "DB init + migrations", () => EmDashRuntime.getDatabase(deps));
|
|
856
|
+
const resolveDb = () => {
|
|
857
|
+
return getRequestContext()?.db ?? db;
|
|
858
|
+
};
|
|
823
859
|
await phase("rt.secrets", "Validate encryption key", () => validateEncryptionKeyAtStartup());
|
|
824
860
|
const storage = EmDashRuntime.getStorage(deps);
|
|
825
861
|
let pluginStates = /* @__PURE__ */ new Map();
|
|
826
862
|
let siteInfo;
|
|
827
|
-
|
|
863
|
+
let seedGate = {
|
|
864
|
+
collectionCount: 1,
|
|
865
|
+
setupDone: true
|
|
866
|
+
};
|
|
867
|
+
const reqCtx = getRequestContext();
|
|
868
|
+
const ownsConfiguredDb = !!deps.config.database && !(reqCtx?.dbIsIsolated && reqCtx.db);
|
|
869
|
+
let readDb = db;
|
|
870
|
+
let readDbDisposable;
|
|
871
|
+
if (ownsConfiguredDb && deps.createCoalescingDialect && deps.config.database) try {
|
|
872
|
+
const dialect = deps.createCoalescingDialect(deps.config.database.config);
|
|
873
|
+
if (dialect) {
|
|
874
|
+
readDb = new Kysely({
|
|
875
|
+
dialect,
|
|
876
|
+
log: kyselyLogOption()
|
|
877
|
+
});
|
|
878
|
+
readDbDisposable = readDb;
|
|
879
|
+
}
|
|
880
|
+
} catch {
|
|
881
|
+
readDb = db;
|
|
882
|
+
}
|
|
883
|
+
const optionsRepo = new OptionsRepository(readDb);
|
|
884
|
+
const readSiteInfo = async () => {
|
|
885
|
+
const siteOpts = await optionsRepo.getMany([
|
|
886
|
+
"emdash:site_title",
|
|
887
|
+
"emdash:site_url",
|
|
888
|
+
"emdash:locale"
|
|
889
|
+
]);
|
|
890
|
+
return {
|
|
891
|
+
siteName: siteOpts.get("emdash:site_title") ?? void 0,
|
|
892
|
+
siteUrl: siteOpts.get("emdash:site_url") ?? void 0,
|
|
893
|
+
locale: siteOpts.get("emdash:locale") ?? void 0
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
const coldStartReads = [phase("rt.plugins", "Plugin states", async () => {
|
|
828
897
|
try {
|
|
829
|
-
const states = await
|
|
898
|
+
const states = await readDb.selectFrom("_plugin_state").select(["plugin_id", "status"]).execute();
|
|
830
899
|
pluginStates = new Map(states.map((s) => [s.plugin_id, s.status]));
|
|
831
900
|
} catch {}
|
|
832
901
|
}), phase("rt.site", "Site info options", async () => {
|
|
833
902
|
try {
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
903
|
+
siteInfo = await readSiteInfo();
|
|
904
|
+
} catch {}
|
|
905
|
+
})];
|
|
906
|
+
if (ownsConfiguredDb) coldStartReads.push(phase("rt.seedcheck", "Auto-seed gate", async () => {
|
|
907
|
+
try {
|
|
908
|
+
const [collectionCount, setupOption] = await Promise.all([readDb.selectFrom("_emdash_collections").select((eb) => eb.fn.countAll().as("count")).executeTakeFirstOrThrow(), readDb.selectFrom("options").select("value").where("name", "=", "emdash:setup_complete").executeTakeFirst()]);
|
|
909
|
+
const setupDone = (() => {
|
|
910
|
+
try {
|
|
911
|
+
return !!setupOption && JSON.parse(setupOption.value) === true;
|
|
912
|
+
} catch {
|
|
913
|
+
return false;
|
|
914
|
+
}
|
|
915
|
+
})();
|
|
916
|
+
seedGate = {
|
|
917
|
+
collectionCount: collectionCount.count,
|
|
918
|
+
setupDone
|
|
843
919
|
};
|
|
844
920
|
} catch {}
|
|
845
|
-
})
|
|
921
|
+
}));
|
|
922
|
+
await Promise.all(coldStartReads);
|
|
923
|
+
if (seedGate.collectionCount === 0 && !seedGate.setupDone) {
|
|
924
|
+
const seedKey = deps.config.database?.entrypoint ?? "default";
|
|
925
|
+
const seedHolder = getSeedHolder();
|
|
926
|
+
try {
|
|
927
|
+
await initWithLock(seedHolder.lock, () => seedHolder.done.has(seedKey) ? true : void 0, async () => {
|
|
928
|
+
const { applySeed } = await import("../apply-CWRyxIoO.mjs").then((n) => n.n);
|
|
929
|
+
const { loadSeed } = await import("../load-BNo-ER8C.mjs").then((n) => n.r);
|
|
930
|
+
const { validateSeed } = await import("../validate-0Utjspbs.mjs").then((n) => n.n);
|
|
931
|
+
const seed = await loadSeed();
|
|
932
|
+
if (validateSeed(seed).valid) {
|
|
933
|
+
await applySeed(db, seed, { onConflict: "skip" });
|
|
934
|
+
console.log("Auto-seeded default collections");
|
|
935
|
+
}
|
|
936
|
+
seedHolder.done.add(seedKey);
|
|
937
|
+
return true;
|
|
938
|
+
}, {
|
|
939
|
+
deadlineMs: DB_INIT_DEADLINE_MS,
|
|
940
|
+
anchor: (promise) => after(() => promise)
|
|
941
|
+
});
|
|
942
|
+
try {
|
|
943
|
+
siteInfo = await readSiteInfo();
|
|
944
|
+
} catch {}
|
|
945
|
+
} catch {}
|
|
946
|
+
}
|
|
947
|
+
if (readDbDisposable) try {
|
|
948
|
+
await readDbDisposable.destroy();
|
|
949
|
+
} catch {}
|
|
846
950
|
const enabledPlugins = /* @__PURE__ */ new Set();
|
|
847
951
|
for (const plugin of deps.plugins) {
|
|
848
952
|
const status = pluginStates.get(plugin.id);
|
|
@@ -903,6 +1007,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
903
1007
|
const enabledPluginList = allPipelinePlugins.filter((p) => enabledPlugins.has(p.id));
|
|
904
1008
|
const pipelineFactoryOptions = {
|
|
905
1009
|
db,
|
|
1010
|
+
getDb: resolveDb,
|
|
906
1011
|
storage: storage ?? void 0,
|
|
907
1012
|
siteInfo
|
|
908
1013
|
};
|
|
@@ -916,7 +1021,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
916
1021
|
const mediaProviderEntries = deps.mediaProviderEntries ?? [];
|
|
917
1022
|
const providerContext = {
|
|
918
1023
|
db,
|
|
919
|
-
storage
|
|
1024
|
+
storage,
|
|
1025
|
+
getDb: resolveDb
|
|
920
1026
|
};
|
|
921
1027
|
for (const entry of mediaProviderEntries) try {
|
|
922
1028
|
const provider = entry.createProvider(providerContext);
|
|
@@ -932,16 +1038,13 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
932
1038
|
const result = await pipelineRef.current.invokeCronHook(pluginId, event);
|
|
933
1039
|
if (!result.success && result.error) throw result.error;
|
|
934
1040
|
};
|
|
935
|
-
pipeline.setContextFactory({
|
|
936
|
-
db,
|
|
937
|
-
emailPipeline
|
|
938
|
-
});
|
|
1041
|
+
pipeline.setContextFactory({ emailPipeline });
|
|
939
1042
|
let cronExecutor = null;
|
|
940
1043
|
let cronScheduler = null;
|
|
941
1044
|
const runtimeRef = { current: null };
|
|
942
1045
|
await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
|
|
943
1046
|
try {
|
|
944
|
-
cronExecutor = new CronExecutor(
|
|
1047
|
+
cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
|
|
945
1048
|
const executorForRecovery = cronExecutor;
|
|
946
1049
|
after(async () => {
|
|
947
1050
|
try {
|
|
@@ -1034,26 +1137,6 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1034
1137
|
log: kyselyLogOption()
|
|
1035
1138
|
});
|
|
1036
1139
|
await runMigrations(db);
|
|
1037
|
-
try {
|
|
1038
|
-
const [collectionCount, setupOption] = await Promise.all([db.selectFrom("_emdash_collections").select((eb) => eb.fn.countAll().as("count")).executeTakeFirstOrThrow(), db.selectFrom("options").select("value").where("name", "=", "emdash:setup_complete").executeTakeFirst()]);
|
|
1039
|
-
const setupDone = (() => {
|
|
1040
|
-
try {
|
|
1041
|
-
return setupOption && JSON.parse(setupOption.value) === true;
|
|
1042
|
-
} catch {
|
|
1043
|
-
return false;
|
|
1044
|
-
}
|
|
1045
|
-
})();
|
|
1046
|
-
if (collectionCount.count === 0 && !setupDone) {
|
|
1047
|
-
const { applySeed } = await import("../apply-CLjxheyb.mjs").then((n) => n.n);
|
|
1048
|
-
const { loadSeed } = await import("../load-Dq91b_DK.mjs").then((n) => n.r);
|
|
1049
|
-
const { validateSeed } = await import("../validate-DGhQPXzI.mjs").then((n) => n.n);
|
|
1050
|
-
const seed = await loadSeed();
|
|
1051
|
-
if (validateSeed(seed).valid) {
|
|
1052
|
-
await applySeed(db, seed, { onConflict: "skip" });
|
|
1053
|
-
console.log("Auto-seeded default collections");
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
} catch {}
|
|
1057
1140
|
if (isCurrentClaim()) holder.cache.set(cacheKey, db);
|
|
1058
1141
|
return db;
|
|
1059
1142
|
}, {
|
|
@@ -1109,7 +1192,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1109
1192
|
allowedHosts: entry.allowedHosts,
|
|
1110
1193
|
storage: entry.storage,
|
|
1111
1194
|
adminPages,
|
|
1112
|
-
adminWidgets
|
|
1195
|
+
adminWidgets,
|
|
1196
|
+
portableTextBlocks: entry.portableTextBlocks,
|
|
1197
|
+
fieldWidgets: entry.fieldWidgets
|
|
1113
1198
|
});
|
|
1114
1199
|
plugins.push(resolved);
|
|
1115
1200
|
console.log(`EmDash: Loaded plugin ${entry.id}:${entry.version} in-process (sandbox bypassed)`);
|
|
@@ -1421,7 +1506,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1421
1506
|
sandboxed: true,
|
|
1422
1507
|
adminMode: hasAdminPages || hasWidgets ? "blocks" : "none",
|
|
1423
1508
|
adminPages: entry.adminPages ?? [],
|
|
1424
|
-
dashboardWidgets: entry.adminWidgets ?? []
|
|
1509
|
+
dashboardWidgets: entry.adminWidgets ?? [],
|
|
1510
|
+
portableTextBlocks: entry.portableTextBlocks,
|
|
1511
|
+
fieldWidgets: entry.fieldWidgets
|
|
1425
1512
|
};
|
|
1426
1513
|
}
|
|
1427
1514
|
for (const [pluginId, meta] of marketplaceManifestCache) {
|
|
@@ -1576,7 +1663,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1576
1663
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1577
1664
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1578
1665
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1579
|
-
const { validateContentData } = await import("../validation-
|
|
1666
|
+
const { validateContentData } = await import("../validation-D9EnzH1T.mjs");
|
|
1580
1667
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1581
1668
|
if (!validation.ok) return {
|
|
1582
1669
|
success: false,
|
|
@@ -1592,7 +1679,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1592
1679
|
return result;
|
|
1593
1680
|
}
|
|
1594
1681
|
async handleContentUpdate(collection, id, body) {
|
|
1595
|
-
const { ContentRepository } = await import("../content-
|
|
1682
|
+
const { ContentRepository } = await import("../content-2PTDNnoh.mjs").then((n) => n.n);
|
|
1596
1683
|
const repo = new ContentRepository(this.db);
|
|
1597
1684
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1598
1685
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1619,7 +1706,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1619
1706
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1620
1707
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1621
1708
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1622
|
-
const { validateContentData } = await import("../validation-
|
|
1709
|
+
const { validateContentData } = await import("../validation-D9EnzH1T.mjs");
|
|
1623
1710
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1624
1711
|
if (!validation.ok) return {
|
|
1625
1712
|
success: false,
|
|
@@ -1875,6 +1962,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1875
1962
|
if (trustedPlugin && this.enabledPlugins.has(trustedPlugin.id)) {
|
|
1876
1963
|
const routeRegistry = new PluginRouteRegistry({
|
|
1877
1964
|
db: this.db,
|
|
1965
|
+
storage: this.storage ?? void 0,
|
|
1878
1966
|
emailPipeline: this.email ?? void 0,
|
|
1879
1967
|
trustedProxyHeaders: getTrustedProxyHeaders(this.config)
|
|
1880
1968
|
});
|
|
@@ -2159,6 +2247,120 @@ function createPublicMediaUrlResolver(storage) {
|
|
|
2159
2247
|
return (key) => resolvePublicMediaUrl(storage, key);
|
|
2160
2248
|
}
|
|
2161
2249
|
|
|
2250
|
+
//#endregion
|
|
2251
|
+
//#region src/astro/middleware/scoped-db.ts
|
|
2252
|
+
/**
|
|
2253
|
+
* Request-scoped database lifecycle helpers.
|
|
2254
|
+
*
|
|
2255
|
+
* Extracted from middleware.ts so they can be unit-tested without pulling in
|
|
2256
|
+
* the virtual:emdash/* module graph. The middleware imports these to settle a
|
|
2257
|
+
* request-scoped db adapter's lifecycle around the response.
|
|
2258
|
+
*/
|
|
2259
|
+
/**
|
|
2260
|
+
* Astro attaches AstroCookies to outgoing responses via a well-known global
|
|
2261
|
+
* symbol. Cloning a Response (`new Response(body, init)`) drops non-header
|
|
2262
|
+
* metadata, so any helper that wraps the response must explicitly forward this
|
|
2263
|
+
* symbol or `cookies.set()` calls will be silently dropped. `Symbol.for`
|
|
2264
|
+
* returns the same registry symbol everywhere, so this matches the copy in
|
|
2265
|
+
* middleware.ts.
|
|
2266
|
+
*/
|
|
2267
|
+
const ASTRO_COOKIES_SYMBOL = Symbol.for("astro.cookies");
|
|
2268
|
+
/**
|
|
2269
|
+
* Run a request-scoped db's `close()` once the response body has finished
|
|
2270
|
+
* streaming. Astro streams HTML and components issue DB queries during that
|
|
2271
|
+
* stream, so a connection-backed adapter (e.g. Postgres over Hyperdrive) must
|
|
2272
|
+
* not be torn down until the body is flushed. Bodyless responses (redirects,
|
|
2273
|
+
* 304s, errors) close immediately. A guard makes close idempotent and a stream
|
|
2274
|
+
* `cancel` (client disconnect) still triggers it so connections never leak.
|
|
2275
|
+
*
|
|
2276
|
+
* No-op for adapters without a `close` (D1): the response passes through.
|
|
2277
|
+
*/
|
|
2278
|
+
function wrapResponseForScopedClose(response, close) {
|
|
2279
|
+
let closed = false;
|
|
2280
|
+
const runClose = () => {
|
|
2281
|
+
if (closed) return;
|
|
2282
|
+
closed = true;
|
|
2283
|
+
try {
|
|
2284
|
+
close();
|
|
2285
|
+
} catch (error) {
|
|
2286
|
+
console.error("[emdash] request-scoped db close failed:", error);
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
if (!response.body) {
|
|
2290
|
+
runClose();
|
|
2291
|
+
return response;
|
|
2292
|
+
}
|
|
2293
|
+
const transform = new TransformStream({
|
|
2294
|
+
flush: runClose,
|
|
2295
|
+
cancel: runClose
|
|
2296
|
+
});
|
|
2297
|
+
const wrapped = new Response(response.body.pipeThrough(transform), response);
|
|
2298
|
+
const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL);
|
|
2299
|
+
if (astroCookies !== void 0) Reflect.set(wrapped, ASTRO_COOKIES_SYMBOL, astroCookies);
|
|
2300
|
+
wrapped.headers.delete("Content-Length");
|
|
2301
|
+
return wrapped;
|
|
2302
|
+
}
|
|
2303
|
+
/**
|
|
2304
|
+
* Run the request body under a request-scoped db, then settle its lifecycle:
|
|
2305
|
+
* `commit()` runs before the response is returned (so per-request state like a
|
|
2306
|
+
* D1 bookmark cookie is persisted in the headers, even if render throws), while
|
|
2307
|
+
* `close()` (if any) is deferred to stream-end so a connection-backed adapter
|
|
2308
|
+
* isn't torn down mid-render. On error the connection is closed immediately
|
|
2309
|
+
* before rethrowing so it never leaks.
|
|
2310
|
+
*
|
|
2311
|
+
* On the error path both `commit()` and `close()` are defended: a throw from
|
|
2312
|
+
* either is logged and swallowed so it can't replace the propagating render
|
|
2313
|
+
* error (which is the one the caller needs to see). On the success path
|
|
2314
|
+
* `commit()` is guarded too — if it throws, the connection is closed before the
|
|
2315
|
+
* failure is surfaced, so it never leaks. For the current adapters `commit()`
|
|
2316
|
+
* is a no-op (Hyperdrive) or a cookie write (D1, no `close`) and `close()` is
|
|
2317
|
+
* fire-and-forget, so these guards only matter for a future connection-backed
|
|
2318
|
+
* adapter with throwing teardown, but the helper is generic and must not leak
|
|
2319
|
+
* or mask.
|
|
2320
|
+
*/
|
|
2321
|
+
async function finishScoped(scoped, run) {
|
|
2322
|
+
let response;
|
|
2323
|
+
try {
|
|
2324
|
+
response = await run();
|
|
2325
|
+
} catch (error) {
|
|
2326
|
+
commitSafely(scoped.commit);
|
|
2327
|
+
closeSafely(scoped.close);
|
|
2328
|
+
throw error;
|
|
2329
|
+
}
|
|
2330
|
+
try {
|
|
2331
|
+
scoped.commit();
|
|
2332
|
+
} catch (error) {
|
|
2333
|
+
closeSafely(scoped.close);
|
|
2334
|
+
throw error;
|
|
2335
|
+
}
|
|
2336
|
+
return scoped.close ? wrapResponseForScopedClose(response, scoped.close) : response;
|
|
2337
|
+
}
|
|
2338
|
+
/**
|
|
2339
|
+
* Run commit() swallowing any error. Used where an exception is already
|
|
2340
|
+
* propagating (or about to be thrown) and a commit failure must neither mask it
|
|
2341
|
+
* nor skip the subsequent close().
|
|
2342
|
+
*/
|
|
2343
|
+
function commitSafely(commit) {
|
|
2344
|
+
try {
|
|
2345
|
+
commit();
|
|
2346
|
+
} catch (error) {
|
|
2347
|
+
console.error("[emdash] request-scoped db commit failed during error handling:", error);
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Run close() swallowing any error. Used on the error/commit-failure paths
|
|
2352
|
+
* where another exception is the one the caller must see; a throwing teardown
|
|
2353
|
+
* must not replace it.
|
|
2354
|
+
*/
|
|
2355
|
+
function closeSafely(close) {
|
|
2356
|
+
if (!close) return;
|
|
2357
|
+
try {
|
|
2358
|
+
close();
|
|
2359
|
+
} catch (error) {
|
|
2360
|
+
console.error("[emdash] request-scoped db close failed during error handling:", error);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2162
2364
|
//#endregion
|
|
2163
2365
|
//#region src/astro/middleware/stream-end-metrics.ts
|
|
2164
2366
|
/**
|
|
@@ -2182,13 +2384,6 @@ function createPublicMediaUrlResolver(storage) {
|
|
|
2182
2384
|
*/
|
|
2183
2385
|
const STREAM_END_PREFIX = "[emdash-stream-end]";
|
|
2184
2386
|
/**
|
|
2185
|
-
* Astro attaches AstroCookies to outgoing responses via a well-known global
|
|
2186
|
-
* symbol. Constructing a new Response drops non-header metadata, so the
|
|
2187
|
-
* symbol must be forwarded explicitly or `cookies.set()` calls are silently
|
|
2188
|
-
* dropped. Same pattern as finalizeResponse in ../middleware.ts.
|
|
2189
|
-
*/
|
|
2190
|
-
const ASTRO_COOKIES_SYMBOL$1 = Symbol.for("astro.cookies");
|
|
2191
|
-
/**
|
|
2192
2387
|
* Wrap a response body so the FINAL request metrics are emitted when the
|
|
2193
2388
|
* body finishes streaming. Returns the response unchanged when
|
|
2194
2389
|
* instrumentation is disabled, the body is null, or no request metrics
|
|
@@ -2201,6 +2396,7 @@ function wrapBodyForStreamMetrics(response) {
|
|
|
2201
2396
|
const metrics = ctx?.metrics;
|
|
2202
2397
|
if (!metrics) return response;
|
|
2203
2398
|
const recorder = ctx?.queryRecorder;
|
|
2399
|
+
if (recorder) recorder.deferredFlush = true;
|
|
2204
2400
|
const transform = new TransformStream({ flush() {
|
|
2205
2401
|
const snapshot = {
|
|
2206
2402
|
route: recorder?.route,
|
|
@@ -2215,14 +2411,75 @@ function wrapBodyForStreamMetrics(response) {
|
|
|
2215
2411
|
cacheMisses: metrics.cacheMisses
|
|
2216
2412
|
};
|
|
2217
2413
|
console.log(`${STREAM_END_PREFIX} ${JSON.stringify(snapshot)}`);
|
|
2414
|
+
if (recorder) flushRecorder(recorder);
|
|
2218
2415
|
} });
|
|
2219
2416
|
const wrapped = new Response(response.body.pipeThrough(transform), response);
|
|
2220
|
-
const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL
|
|
2221
|
-
if (astroCookies !== void 0) Reflect.set(wrapped, ASTRO_COOKIES_SYMBOL
|
|
2417
|
+
const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL);
|
|
2418
|
+
if (astroCookies !== void 0) Reflect.set(wrapped, ASTRO_COOKIES_SYMBOL, astroCookies);
|
|
2222
2419
|
wrapped.headers.delete("Content-Length");
|
|
2223
2420
|
return wrapped;
|
|
2224
2421
|
}
|
|
2225
2422
|
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region src/astro/prefetch.ts
|
|
2425
|
+
/**
|
|
2426
|
+
* Eager, transparent prefetch of site-global "chrome" data.
|
|
2427
|
+
*
|
|
2428
|
+
* On a public page render, the shared layout pulls the same site-global data on
|
|
2429
|
+
* every request -- menus, widget areas, taxonomy term lists, site settings --
|
|
2430
|
+
* but each is awaited inside a separately-rendered Astro component, so they
|
|
2431
|
+
* execute as serial DB round trips. This fires them all CONCURRENTLY at the
|
|
2432
|
+
* very start of the request, before `next()`:
|
|
2433
|
+
*
|
|
2434
|
+
* - On remote backends (D1, Durable Objects) the round trips overlap instead
|
|
2435
|
+
* of serializing, collapsing ~N sequential RTTs into ~1 wall-clock RTT. On
|
|
2436
|
+
* a coalescing backend they additionally batch into a single round trip.
|
|
2437
|
+
* - The results land in the per-request `requestCached` store under the exact
|
|
2438
|
+
* keys the layout helpers use, so when the components render they hit a warm
|
|
2439
|
+
* (in-flight or resolved) cache entry instead of issuing their own query.
|
|
2440
|
+
*
|
|
2441
|
+
* Nothing here changes what templates call -- it warms the real helpers, so the
|
|
2442
|
+
* cache keys and value shapes are guaranteed identical. The caller gates this to
|
|
2443
|
+
* the public-page path on a request-scoped (remote) backend; it is a no-op-ish
|
|
2444
|
+
* waste on synchronous local SQLite, so don't call it there.
|
|
2445
|
+
*
|
|
2446
|
+
* Fire-and-forget: never awaited by middleware, never throws (a prefetch failure
|
|
2447
|
+
* must not affect the request -- the helpers will simply run on demand).
|
|
2448
|
+
*/
|
|
2449
|
+
/** Warm widget areas: one bulk load, primed under each per-area cache key. */
|
|
2450
|
+
async function prefetchWidgetAreas() {
|
|
2451
|
+
const areas = await getWidgetAreas();
|
|
2452
|
+
for (const area of areas) setRequestCacheEntry(`widget-area:${area.name}`, area);
|
|
2453
|
+
}
|
|
2454
|
+
/** Warm every taxonomy's term list via the real helper (primes per-name keys). */
|
|
2455
|
+
async function prefetchTaxonomyTerms() {
|
|
2456
|
+
const defs = await getTaxonomyDefs();
|
|
2457
|
+
await Promise.allSettled(defs.map((def) => getTaxonomyTerms(def.name)));
|
|
2458
|
+
}
|
|
2459
|
+
/** Warm every menu via the real helper (primes `menu:${name}:${locale}`). */
|
|
2460
|
+
async function prefetchMenus() {
|
|
2461
|
+
const rows = await (await getDb()).selectFrom("_emdash_menus").select("name").distinct().execute();
|
|
2462
|
+
const names = [...new Set(rows.map((r) => r.name))];
|
|
2463
|
+
await Promise.allSettled(names.map((name) => getMenu(name)));
|
|
2464
|
+
}
|
|
2465
|
+
/**
|
|
2466
|
+
* Concurrently warm the site-global layout data for the current request.
|
|
2467
|
+
* Safe to call only inside the request ALS frame that owns the (remote)
|
|
2468
|
+
* request-scoped db. Never throws.
|
|
2469
|
+
*/
|
|
2470
|
+
async function prefetchLayoutData() {
|
|
2471
|
+
try {
|
|
2472
|
+
await Promise.allSettled([
|
|
2473
|
+
getSiteSettings(),
|
|
2474
|
+
prefetchMenus(),
|
|
2475
|
+
prefetchWidgetAreas(),
|
|
2476
|
+
prefetchTaxonomyTerms()
|
|
2477
|
+
]);
|
|
2478
|
+
} catch (error) {
|
|
2479
|
+
console.error("[emdash] layout prefetch failed (non-fatal):", error);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2226
2483
|
//#endregion
|
|
2227
2484
|
//#region src/astro/public-plugin-api-routes.ts
|
|
2228
2485
|
function pluginRouteNotFound() {
|
|
@@ -2331,6 +2588,7 @@ function buildDependencies(config) {
|
|
|
2331
2588
|
config,
|
|
2332
2589
|
plugins: getPlugins(),
|
|
2333
2590
|
createDialect,
|
|
2591
|
+
createCoalescingDialect,
|
|
2334
2592
|
createStorage,
|
|
2335
2593
|
createScheduler,
|
|
2336
2594
|
sandboxEnabled: sandboxModule.sandboxEnabled,
|
|
@@ -2380,15 +2638,56 @@ async function getRuntime(config, initTimings) {
|
|
|
2380
2638
|
async function runScheduledTasks(options = {}) {
|
|
2381
2639
|
const config = getConfig();
|
|
2382
2640
|
if (!config) return { published: [] };
|
|
2383
|
-
|
|
2641
|
+
const runtime = await getRuntime(config);
|
|
2642
|
+
const scoped = createRequestScopedDb$1({
|
|
2643
|
+
config: config.database?.config,
|
|
2644
|
+
isAuthenticated: false,
|
|
2645
|
+
isWrite: true,
|
|
2646
|
+
cookies: NOOP_COOKIE_JAR,
|
|
2647
|
+
url: CRON_EVENT_URL
|
|
2648
|
+
});
|
|
2649
|
+
if (!scoped?.close) return runtime.runScheduledTasks(options);
|
|
2650
|
+
const parent = getRequestContext();
|
|
2651
|
+
const ctx = parent ? {
|
|
2652
|
+
...parent,
|
|
2653
|
+
db: scoped.db
|
|
2654
|
+
} : {
|
|
2655
|
+
editMode: false,
|
|
2656
|
+
db: scoped.db,
|
|
2657
|
+
metrics: createRequestMetrics(performance.now())
|
|
2658
|
+
};
|
|
2659
|
+
try {
|
|
2660
|
+
return await runWithContext(ctx, () => runtime.runScheduledTasks(options));
|
|
2661
|
+
} finally {
|
|
2662
|
+
try {
|
|
2663
|
+
scoped.commit();
|
|
2664
|
+
} catch (error) {
|
|
2665
|
+
console.error("[scheduled] request-scoped db commit failed:", error);
|
|
2666
|
+
}
|
|
2667
|
+
try {
|
|
2668
|
+
scoped.close();
|
|
2669
|
+
} catch (error) {
|
|
2670
|
+
console.error("[scheduled] request-scoped db close failed:", error);
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2384
2673
|
}
|
|
2385
2674
|
/**
|
|
2386
|
-
*
|
|
2387
|
-
*
|
|
2388
|
-
*
|
|
2389
|
-
*
|
|
2675
|
+
* A cookie jar that reads nothing and writes nothing, for request-scoped db
|
|
2676
|
+
* adapters invoked outside an HTTP request (the Cron Trigger sweep). Connection
|
|
2677
|
+
* adapters like Hyperdrive ignore cookies entirely; the D1 session adapter
|
|
2678
|
+
* reads/writes a bookmark cookie, but cron never reaches that path (it has no
|
|
2679
|
+
* `close()`), so the no-ops are never observed.
|
|
2390
2680
|
*/
|
|
2391
|
-
const
|
|
2681
|
+
const NOOP_COOKIE_JAR = {
|
|
2682
|
+
get: () => void 0,
|
|
2683
|
+
set: () => {}
|
|
2684
|
+
};
|
|
2685
|
+
/**
|
|
2686
|
+
* Synthetic URL for the cron sweep's request-scoped db opts. Only the D1
|
|
2687
|
+
* session adapter inspects `url` (for cookie `secure`), and cron doesn't take
|
|
2688
|
+
* that path, so the value is never used — it exists to satisfy the contract.
|
|
2689
|
+
*/
|
|
2690
|
+
const CRON_EVENT_URL = new URL("https://cron.emdash.internal/");
|
|
2392
2691
|
/**
|
|
2393
2692
|
* Baseline security headers applied to all responses.
|
|
2394
2693
|
* Admin routes get additional headers (strict CSP) from auth middleware.
|
|
@@ -2483,15 +2782,15 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2483
2782
|
const hasPreviewToken = url.searchParams.has("_preview");
|
|
2484
2783
|
const playgroundDb = locals.__playgroundDb;
|
|
2485
2784
|
const hasSessionCookie = cookies.get("astro-session") !== void 0;
|
|
2486
|
-
const sessionUser = context.isPrerendered || !hasSessionCookie ? null : await context.session
|
|
2785
|
+
const sessionUser = context.isPrerendered || !hasSessionCookie ? null : await resolveSessionUser(context.session);
|
|
2487
2786
|
if (!isEmDashRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
|
|
2488
2787
|
if (!sessionUser && !playgroundDb) {
|
|
2489
2788
|
const timings = [];
|
|
2490
2789
|
const mwStart = performance.now();
|
|
2491
|
-
if (!isSetupVerified()) {
|
|
2790
|
+
if (!isSetupVerified() && !context.isPrerendered) {
|
|
2492
2791
|
const t0 = performance.now();
|
|
2493
2792
|
try {
|
|
2494
|
-
const { getDb } = await import("../loader-
|
|
2793
|
+
const { getDb } = await import("../loader-Dn74CG1b.mjs").then((n) => n.o);
|
|
2495
2794
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
2496
2795
|
markSetupVerified();
|
|
2497
2796
|
} catch (error) {
|
|
@@ -2515,7 +2814,8 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2515
2814
|
handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
|
|
2516
2815
|
collectPageMetadata: runtime.collectPageMetadata.bind(runtime),
|
|
2517
2816
|
collectPageFragments: runtime.collectPageFragments.bind(runtime),
|
|
2518
|
-
getPublicMediaUrl: createPublicMediaUrlResolver(runtime.storage)
|
|
2817
|
+
getPublicMediaUrl: createPublicMediaUrlResolver(runtime.storage),
|
|
2818
|
+
storage: runtime.storage
|
|
2519
2819
|
};
|
|
2520
2820
|
} catch {}
|
|
2521
2821
|
timings.push({
|
|
@@ -2550,19 +2850,18 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2550
2850
|
};
|
|
2551
2851
|
if (anonScoped) {
|
|
2552
2852
|
const parent = getRequestContext();
|
|
2553
|
-
|
|
2853
|
+
const ctx = parent ? {
|
|
2554
2854
|
...parent,
|
|
2555
2855
|
db: anonScoped.db
|
|
2556
2856
|
} : {
|
|
2557
2857
|
editMode: false,
|
|
2558
2858
|
db: anonScoped.db,
|
|
2559
2859
|
metrics
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
}
|
|
2860
|
+
};
|
|
2861
|
+
const acceptsHtml = (request.headers.get("accept") ?? "").split(",", 1)[0].trim().startsWith("text/html");
|
|
2862
|
+
return runWithContext(ctx, async () => {
|
|
2863
|
+
if (acceptsHtml) after(() => prefetchLayoutData());
|
|
2864
|
+
return finishScoped(anonScoped, runAnon);
|
|
2566
2865
|
});
|
|
2567
2866
|
}
|
|
2568
2867
|
return runAnon();
|
|
@@ -2624,7 +2923,9 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2624
2923
|
collectPageFragments: runtime.collectPageFragments.bind(runtime),
|
|
2625
2924
|
ensureSearchHealthy: runtime.ensureSearchHealthy.bind(runtime),
|
|
2626
2925
|
storage: runtime.storage,
|
|
2627
|
-
db
|
|
2926
|
+
get db() {
|
|
2927
|
+
return runtime.db;
|
|
2928
|
+
},
|
|
2628
2929
|
getPublicMediaUrl: createPublicMediaUrlResolver(runtime.storage),
|
|
2629
2930
|
hooks: runtime.hooks,
|
|
2630
2931
|
email: runtime.email,
|
|
@@ -2673,13 +2974,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2673
2974
|
editMode: false,
|
|
2674
2975
|
db: scoped.db,
|
|
2675
2976
|
metrics
|
|
2676
|
-
},
|
|
2677
|
-
try {
|
|
2678
|
-
return await renderAndFinalize();
|
|
2679
|
-
} finally {
|
|
2680
|
-
scoped.commit();
|
|
2681
|
-
}
|
|
2682
|
-
});
|
|
2977
|
+
}, () => finishScoped(scoped, renderAndFinalize));
|
|
2683
2978
|
}
|
|
2684
2979
|
return renderAndFinalize();
|
|
2685
2980
|
};
|
|
@@ -2707,7 +3002,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2707
3002
|
metrics
|
|
2708
3003
|
}, run);
|
|
2709
3004
|
} finally {
|
|
2710
|
-
if (queryRecorder) flushRecorder(queryRecorder);
|
|
3005
|
+
if (queryRecorder && !queryRecorder.deferredFlush) flushRecorder(queryRecorder);
|
|
2711
3006
|
}
|
|
2712
3007
|
});
|
|
2713
3008
|
|