emdash 0.22.0 → 0.24.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-hUy8vOB-.d.mts → adapters-DAAjOID4.d.mts} +1 -1
- package/dist/{adapters-hUy8vOB-.d.mts.map → adapters-DAAjOID4.d.mts.map} +1 -1
- package/dist/{allowed-origins-DjlhyfNN.mjs → allowed-origins-D5FxMUo8.mjs} +2 -2
- package/dist/{allowed-origins-DjlhyfNN.mjs.map → allowed-origins-D5FxMUo8.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +15 -15
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +3 -3
- package/dist/{api-BDuM4bEy.mjs → api-d_0wi9fW.mjs} +20 -20
- package/dist/{api-BDuM4bEy.mjs.map → api-d_0wi9fW.mjs.map} +1 -1
- package/dist/{api-tokens-ViYKeIp9.mjs → api-tokens-D6ppjIVi.mjs} +2 -2
- package/dist/{api-tokens-ViYKeIp9.mjs.map → api-tokens-D6ppjIVi.mjs.map} +1 -1
- package/dist/{apply-wDqQoxX4.mjs → apply-BE9UaWX0.mjs} +17 -17
- package/dist/{apply-wDqQoxX4.mjs.map → apply-BE9UaWX0.mjs.map} +1 -1
- package/dist/astro/index.d.mts +11 -11
- package/dist/astro/index.mjs +36 -11
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.mjs +7 -7
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +5 -3
- 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 +362 -141
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +8 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +8 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +8 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +13 -12
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +13 -12
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +13 -12
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +11 -11
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +35 -34
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +35 -34
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +34 -33
- 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 +34 -33
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +34 -33
- 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 +35 -34
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +35 -34
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +34 -33
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +34 -33
- 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 +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +34 -33
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
- package/dist/astro/routes/api/auth/logout.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +7 -7
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +12 -12
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/index.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +3 -3
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +10 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +13 -12
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +39 -39
- package/dist/astro/routes/api/media/_id_/confirm.mjs +7 -7
- package/dist/astro/routes/api/media/_id_.mjs +7 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
- package/dist/astro/routes/api/media/providers/index.mjs +3 -3
- package/dist/astro/routes/api/media/upload-url.mjs +9 -9
- package/dist/astro/routes/api/media.mjs +12 -12
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/translations.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_.mjs +8 -8
- package/dist/astro/routes/api/menus/index.mjs +8 -8
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +4 -4
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +9 -9
- package/dist/astro/routes/api/redirects/404s/summary.mjs +9 -9
- package/dist/astro/routes/api/redirects/_id_.mjs +10 -10
- package/dist/astro/routes/api/redirects/index.mjs +10 -10
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +34 -33
- 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 +34 -33
- 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 +34 -33
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +34 -33
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +34 -33
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +8 -7
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +34 -33
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +34 -33
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +10 -10
- package/dist/astro/routes/api/search/index.mjs +9 -9
- package/dist/astro/routes/api/search/rebuild.mjs +10 -10
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +9 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +9 -9
- package/dist/astro/routes/api/sections/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +11 -11
- package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
- package/dist/astro/routes/api/setup/admin.mjs +10 -10
- package/dist/astro/routes/api/setup/dev-bypass.mjs +23 -22
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +24 -23
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +4 -4
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +12 -12
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +12 -12
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +12 -12
- package/dist/astro/routes/api/taxonomies/index.mjs +12 -12
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +5 -5
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- 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 +7 -7
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -9
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +5 -5
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +8 -8
- package/dist/astro/routes/sitemap.xml.mjs +6 -6
- package/dist/astro/types.d.mts +12 -12
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-C0EYoUeV.mjs → authorize-B__u-iZJ.mjs} +2 -2
- package/dist/{authorize-C0EYoUeV.mjs.map → authorize-B__u-iZJ.mjs.map} +1 -1
- package/dist/{byline-CC0WS4Gu.mjs → byline-C-YajfV7.mjs} +18 -76
- package/dist/byline-C-YajfV7.mjs.map +1 -0
- package/dist/{byline-fields-53i9Et0x.mjs → byline-fields-B-KXkg5R.mjs} +2 -2
- package/dist/{byline-fields-53i9Et0x.mjs.map → byline-fields-B-KXkg5R.mjs.map} +1 -1
- package/dist/{byline-fields-DNp0HNKc.mjs → byline-fields-DaMKzkhO.mjs} +1 -1
- package/dist/{byline-fields-DNp0HNKc.mjs.map → byline-fields-DaMKzkhO.mjs.map} +1 -1
- package/dist/{byline-fields-jy07PZJM.d.mts → byline-fields-RFPkDLRw.d.mts} +21 -1
- package/dist/byline-fields-RFPkDLRw.d.mts.map +1 -0
- package/dist/{bylines-CCO1CYnH.mjs → bylines-BMtJnPnG.mjs} +7 -7
- package/dist/{bylines-CCO1CYnH.mjs.map → bylines-BMtJnPnG.mjs.map} +1 -1
- package/dist/{bylines-DGekMGGm.mjs → bylines-D4KADDAi.mjs} +4 -4
- package/dist/{bylines-DGekMGGm.mjs.map → bylines-D4KADDAi.mjs.map} +1 -1
- package/dist/{cache-pXTpun6s.mjs → cache-BUJe2w6Z.mjs} +2 -2
- package/dist/{cache-pXTpun6s.mjs.map → cache-BUJe2w6Z.mjs.map} +1 -1
- package/dist/{challenge-store-C6E_kWTs.mjs → challenge-store-LhiqMccz.mjs} +1 -1
- package/dist/{challenge-store-C6E_kWTs.mjs.map → challenge-store-LhiqMccz.mjs.map} +1 -1
- package/dist/{chunks-SyjZaYwV.mjs → chunks-BHgcHh2C.mjs} +2 -2
- package/dist/{chunks-SyjZaYwV.mjs.map → chunks-BHgcHh2C.mjs.map} +1 -1
- package/dist/cli/index.mjs +25 -24
- 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 -2
- package/dist/{comment-80UyJJUR.mjs → comment-BDx50EX5.mjs} +2 -2
- package/dist/{comment-80UyJJUR.mjs.map → comment-BDx50EX5.mjs.map} +1 -1
- package/dist/{comment-reaction-B6AdcpXw.mjs → comment-reaction-Gv_pgfI3.mjs} +2 -2
- package/dist/{comment-reaction-B6AdcpXw.mjs.map → comment-reaction-Gv_pgfI3.mjs.map} +1 -1
- package/dist/{comments-CtPkT2tp.mjs → comments-CXHuQ6jI.mjs} +3 -3
- package/dist/{comments-CtPkT2tp.mjs.map → comments-CXHuQ6jI.mjs.map} +1 -1
- package/dist/{components-D6ZnrzbB.mjs → components-CYt4uVK9.mjs} +1 -1
- package/dist/{components-D6ZnrzbB.mjs.map → components-CYt4uVK9.mjs.map} +1 -1
- package/dist/{content-2PTDNnoh.mjs → content-PoVGKjp0.mjs} +3 -3
- package/dist/{content-2PTDNnoh.mjs.map → content-PoVGKjp0.mjs.map} +1 -1
- package/dist/{context-f1__jpzF.mjs → context-Dvws41_A.mjs} +62 -24
- package/dist/context-Dvws41_A.mjs.map +1 -0
- package/dist/{cron-CQPxBjYs.mjs → cron-C5LVoNmP.mjs} +14 -2
- package/dist/cron-C5LVoNmP.mjs.map +1 -0
- package/dist/{dashboard-BOESNcwE.mjs → dashboard-DsYU8JKS.mjs} +4 -4
- package/dist/{dashboard-BOESNcwE.mjs.map → dashboard-DsYU8JKS.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-CrC5w3Jz.mjs → db-errors-UXB1CK42.mjs} +1 -1
- package/dist/{db-errors-CrC5w3Jz.mjs.map → db-errors-UXB1CK42.mjs.map} +1 -1
- package/dist/{default-CpBEPn6a.mjs → default-CeRG-Ot4.mjs} +1 -1
- package/dist/{default-CpBEPn6a.mjs.map → default-CeRG-Ot4.mjs.map} +1 -1
- package/dist/{device-flow-Bn-qiDrw.mjs → device-flow-DENDCQ9F.mjs} +4 -4
- package/dist/{device-flow-Bn-qiDrw.mjs.map → device-flow-DENDCQ9F.mjs.map} +1 -1
- package/dist/{email-console-B9VS6eN4.mjs → email-console-DJP32ucW.mjs} +1 -1
- package/dist/{email-console-B9VS6eN4.mjs.map → email-console-DJP32ucW.mjs.map} +1 -1
- package/dist/{error-BQ1pxs0L.mjs → error-lq_fL-RS.mjs} +2 -2
- package/dist/{error-BQ1pxs0L.mjs.map → error-lq_fL-RS.mjs.map} +1 -1
- package/dist/{escape-BtbJWyaW.mjs → escape-Bjio4ZsM.mjs} +1 -1
- package/dist/{escape-BtbJWyaW.mjs.map → escape-Bjio4ZsM.mjs.map} +1 -1
- package/dist/field-defs-cache-CYYx8xlG.mjs +77 -0
- package/dist/field-defs-cache-CYYx8xlG.mjs.map +1 -0
- package/dist/{fts-manager-DtiWqwNJ.mjs → fts-manager-DW_NR-Fs.mjs} +2 -2
- package/dist/{fts-manager-DtiWqwNJ.mjs.map → fts-manager-DW_NR-Fs.mjs.map} +1 -1
- package/dist/{hash-BowcuPwv.mjs → hash-DrvzIXcz.mjs} +1 -1
- package/dist/{hash-BowcuPwv.mjs.map → hash-DrvzIXcz.mjs.map} +1 -1
- package/dist/{import-DqSGOlmR.mjs → import-Bb1T9WJS.mjs} +3 -3
- package/dist/{import-DqSGOlmR.mjs.map → import-Bb1T9WJS.mjs.map} +1 -1
- package/dist/{index-C2dLNT6S.d.mts → index-BroXT-vD.d.mts} +136 -38
- package/dist/index-BroXT-vD.d.mts.map +1 -0
- package/dist/{index-ZDEwR7qW.d.mts → index-qbL02uhs.d.mts} +3 -3
- package/dist/{index-ZDEwR7qW.d.mts.map → index-qbL02uhs.d.mts.map} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.mjs +55 -54
- package/dist/{load-Dtoo7KcJ.mjs → load-DMFi4n1p.mjs} +2 -2
- package/dist/{load-Dtoo7KcJ.mjs.map → load-DMFi4n1p.mjs.map} +1 -1
- package/dist/{loader-C8Z48Uof.mjs → loader-BR2SgfEc.mjs} +77 -12
- package/dist/loader-BR2SgfEc.mjs.map +1 -0
- package/dist/{manifest-schema-DDSbwkAL.mjs → manifest-schema-BWKnQYQF.mjs} +1 -1
- package/dist/{manifest-schema-DDSbwkAL.mjs.map → manifest-schema-BWKnQYQF.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- 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 +11 -9
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-Bw0sA6rb.mjs → media-CTjJoJTh.mjs} +2 -2
- package/dist/{media-Bw0sA6rb.mjs.map → media-CTjJoJTh.mjs.map} +1 -1
- package/dist/{media-allowlist-DunzrKFM.mjs → media-allowlist-B77I5_bw.mjs} +2 -2
- package/dist/{media-allowlist-DunzrKFM.mjs.map → media-allowlist-B77I5_bw.mjs.map} +1 -1
- package/dist/{media-url-S22B6aPr.mjs → media-url-O4rm9-SQ.mjs} +1 -1
- package/dist/{media-url-S22B6aPr.mjs.map → media-url-O4rm9-SQ.mjs.map} +1 -1
- package/dist/{menus-CYs0WZoL.mjs → menus-8O6xNcYW.mjs} +2 -2
- package/dist/{menus-CYs0WZoL.mjs.map → menus-8O6xNcYW.mjs.map} +1 -1
- package/dist/{menus-DOs1MQJg.mjs → menus-GvRSpgIA.mjs} +57 -14
- package/dist/menus-GvRSpgIA.mjs.map +1 -0
- package/dist/{mime-DYpsOAny.mjs → mime-BTzvzJ8M.mjs} +1 -1
- package/dist/{mime-DYpsOAny.mjs.map → mime-BTzvzJ8M.mjs.map} +1 -1
- package/dist/{mode-CFh8Dw8G.mjs → mode-BB0F8xTC.mjs} +1 -1
- package/dist/{mode-CFh8Dw8G.mjs.map → mode-BB0F8xTC.mjs.map} +1 -1
- package/dist/{normalize-Uam4_Vkr.mjs → normalize-ClbNIenm.mjs} +1 -1
- package/dist/{normalize-Uam4_Vkr.mjs.map → normalize-ClbNIenm.mjs.map} +1 -1
- package/dist/{oauth-authorization-BN-t83Uy.mjs → oauth-authorization-CsvzIp_F.mjs} +4 -4
- package/dist/{oauth-authorization-BN-t83Uy.mjs.map → oauth-authorization-CsvzIp_F.mjs.map} +1 -1
- package/dist/{oauth-clients-R6I_V0qz.mjs → oauth-clients-C9SYwEbZ.mjs} +1 -1
- package/dist/{oauth-clients-R6I_V0qz.mjs.map → oauth-clients-C9SYwEbZ.mjs.map} +1 -1
- package/dist/{oauth-state-store-Csoc6kkR.mjs → oauth-state-store---zrApfB.mjs} +1 -1
- package/dist/{oauth-state-store-Csoc6kkR.mjs.map → oauth-state-store---zrApfB.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-d7VYjTpx.mjs → oauth-user-lookup-SHsWRlG9.mjs} +1 -1
- package/dist/{oauth-user-lookup-d7VYjTpx.mjs.map → oauth-user-lookup-SHsWRlG9.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-DFFpvNJU.d.mts → options-CqECG0gM.d.mts} +3 -3
- package/dist/{options-DFFpvNJU.d.mts.map → options-CqECG0gM.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-qrHlnzTy.mjs → parse-DHI873qU.mjs} +2 -2
- package/dist/{parse-qrHlnzTy.mjs.map → parse-DHI873qU.mjs.map} +1 -1
- package/dist/{passkey-config-BJTbcnI5.mjs → passkey-config-C0YfSBko.mjs} +1 -1
- package/dist/{passkey-config-BJTbcnI5.mjs.map → passkey-config-C0YfSBko.mjs.map} +1 -1
- package/dist/{placeholder-CIDCpyEY.mjs → placeholder-B0s2mWu5.mjs} +1 -1
- package/dist/{placeholder-CIDCpyEY.mjs.map → placeholder-B0s2mWu5.mjs.map} +1 -1
- package/dist/{placeholder-CirPauNG.d.mts → placeholder-QoI4gEzP.d.mts} +1 -1
- package/dist/{placeholder-CirPauNG.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 +2 -2
- package/dist/{portable-text-BIFhrU6T.mjs → portable-text-BICg8bTk.mjs} +1 -1
- package/dist/{portable-text-BIFhrU6T.mjs.map → portable-text-BICg8bTk.mjs.map} +1 -1
- package/dist/{preview-IDye9SPQ.mjs → preview-DKGCt2_p.mjs} +2 -2
- package/dist/{preview-IDye9SPQ.mjs.map → preview-DKGCt2_p.mjs.map} +1 -1
- package/dist/{public-url-8lFyQ8ZF.mjs → public-url-CTVqgMmg.mjs} +1 -1
- package/dist/{public-url-8lFyQ8ZF.mjs.map → public-url-CTVqgMmg.mjs.map} +1 -1
- package/dist/{query-B1RVFUNM.mjs → query-DZdlS6Cu.mjs} +92 -14
- package/dist/query-DZdlS6Cu.mjs.map +1 -0
- package/dist/{rate-limit-DfNAqIWW.mjs → rate-limit-D1Y6VFVP.mjs} +2 -2
- package/dist/{rate-limit-DfNAqIWW.mjs.map → rate-limit-D1Y6VFVP.mjs.map} +1 -1
- package/dist/{redirect-Bifv_yHv.mjs → redirect-C1KVGYWe.mjs} +2 -2
- package/dist/{redirect-Bifv_yHv.mjs.map → redirect-C1KVGYWe.mjs.map} +1 -1
- package/dist/{redirect-B4wuX2A5.mjs → redirect-CS-PHtNh.mjs} +1 -1
- package/dist/{redirect-B4wuX2A5.mjs.map → redirect-CS-PHtNh.mjs.map} +1 -1
- package/dist/{redirects-CT_vb3NV.mjs → redirects-DgnypVir.mjs} +4 -4
- package/dist/{redirects-CT_vb3NV.mjs.map → redirects-DgnypVir.mjs.map} +1 -1
- package/dist/{redirects-DUvXgzCX.mjs → redirects-x9eFPeyi.mjs} +4 -2
- package/dist/redirects-x9eFPeyi.mjs.map +1 -0
- package/dist/{registry-CjK96fHD.mjs → registry-CJkCubOJ.mjs} +4 -4
- package/dist/{registry-CjK96fHD.mjs.map → registry-CJkCubOJ.mjs.map} +1 -1
- package/dist/{request-meta-ei3ATilC.mjs → request-meta-CmS1tDFf.mjs} +2 -2
- package/dist/{request-meta-ei3ATilC.mjs.map → request-meta-CmS1tDFf.mjs.map} +1 -1
- package/dist/{resolve-CpbBglV0.mjs → resolve-C7I0qiR0.mjs} +1 -1
- package/dist/{resolve-CpbBglV0.mjs.map → resolve-C7I0qiR0.mjs.map} +1 -1
- package/dist/{runner-DYYnW530.mjs → runner-BsquExlK.mjs} +246 -174
- package/dist/runner-BsquExlK.mjs.map +1 -0
- package/dist/{runner-jdXtFEd3.d.mts → runner-CEtq-6Sm.d.mts} +2 -2
- package/dist/{runner-jdXtFEd3.d.mts.map → runner-CEtq-6Sm.d.mts.map} +1 -1
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +2 -2
- package/dist/{schema-5z2Jfnbm.mjs → schema-DMjXuvNU.mjs} +4 -4
- package/dist/{schema-5z2Jfnbm.mjs.map → schema-DMjXuvNU.mjs.map} +1 -1
- package/dist/{search-D9FkoM-k.mjs → search-D1wKk3lc.mjs} +4 -4
- package/dist/{search-D9FkoM-k.mjs.map → search-D1wKk3lc.mjs.map} +1 -1
- package/dist/{secrets-BUE5UQys.mjs → secrets-BSf9pRRY.mjs} +2 -2
- package/dist/{secrets-BUE5UQys.mjs.map → secrets-BSf9pRRY.mjs.map} +1 -1
- package/dist/{sections-DWYZo6HK.mjs → sections-CCMic8dB.mjs} +3 -3
- package/dist/{sections-DWYZo6HK.mjs.map → sections-CCMic8dB.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +17 -16
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-Cu47j3mJ.mjs → seo-3QrZ1EPT.mjs} +2 -2
- package/dist/{seo-Cu47j3mJ.mjs.map → seo-3QrZ1EPT.mjs.map} +1 -1
- package/dist/{seo-DRnqnstF.mjs → seo-DCEF-AVr.mjs} +1 -1
- package/dist/{seo-DRnqnstF.mjs.map → seo-DCEF-AVr.mjs.map} +1 -1
- package/dist/{service-DTmtqCnw.mjs → service-CQHK_10l.mjs} +3 -3
- package/dist/{service-DTmtqCnw.mjs.map → service-CQHK_10l.mjs.map} +1 -1
- package/dist/{session-user-DmtPMNa1.mjs → session-user-B8aLtKAH.mjs} +1 -1
- package/dist/{session-user-DmtPMNa1.mjs.map → session-user-B8aLtKAH.mjs.map} +1 -1
- package/dist/{settings-DUrVDN0c.mjs → settings-C3Yi5Co3.mjs} +3 -3
- package/dist/{settings-DUrVDN0c.mjs.map → settings-C3Yi5Co3.mjs.map} +1 -1
- package/dist/{settings-yaxu9mU-.mjs → settings-D9rvaLuY.mjs} +4 -4
- package/dist/{settings-yaxu9mU-.mjs.map → settings-D9rvaLuY.mjs.map} +1 -1
- package/dist/{setup-complete-BWFHzgvZ.mjs → setup-complete-gEiySUc-.mjs} +1 -1
- package/dist/{setup-complete-BWFHzgvZ.mjs.map → setup-complete-gEiySUc-.mjs.map} +1 -1
- package/dist/{setup-nonce-DFWG-J5c.mjs → setup-nonce-DzS50zme.mjs} +1 -1
- package/dist/{setup-nonce-DFWG-J5c.mjs.map → setup-nonce-DzS50zme.mjs.map} +1 -1
- package/dist/{single-flight-cache-B5p5cNOL.mjs → single-flight-cache-Cdfkic3t.mjs} +1 -1
- package/dist/{single-flight-cache-B5p5cNOL.mjs.map → single-flight-cache-Cdfkic3t.mjs.map} +1 -1
- package/dist/{site-url-BOTPgmeM.mjs → site-url-BLebyON8.mjs} +1 -1
- package/dist/{site-url-BOTPgmeM.mjs.map → site-url-BLebyON8.mjs.map} +1 -1
- package/dist/{ssrf-B0VeRLrp.mjs → ssrf-BRKb343l.mjs} +1 -1
- package/dist/{ssrf-B0VeRLrp.mjs.map → ssrf-BRKb343l.mjs.map} +1 -1
- package/dist/{status-CB2basWJ.mjs → status-vUK0SA17.mjs} +1 -1
- package/dist/{status-CB2basWJ.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-Be9B1jEj.mjs → taxonomies-CurpLtNC.mjs} +52 -24
- package/dist/taxonomies-CurpLtNC.mjs.map +1 -0
- package/dist/{taxonomies-CJmkEpdS.mjs → taxonomies-DhLaNJji.mjs} +34 -27
- package/dist/taxonomies-DhLaNJji.mjs.map +1 -0
- package/dist/{taxonomy-B2HQuVf5.mjs → taxonomy-BBUlGug5.mjs} +33 -7
- package/dist/taxonomy-BBUlGug5.mjs.map +1 -0
- package/dist/{tokens-BvrJvIB6.mjs → tokens-LeuXF9gG.mjs} +1 -1
- package/dist/{tokens-BvrJvIB6.mjs.map → tokens-LeuXF9gG.mjs.map} +1 -1
- package/dist/{transport-k7YjfmEn.d.mts → transport-BZ-03aFT.d.mts} +1 -1
- package/dist/{transport-k7YjfmEn.d.mts.map → transport-BZ-03aFT.d.mts.map} +1 -1
- package/dist/{transport-B4rXnSTf.mjs → transport-_2nBz7e9.mjs} +1 -1
- package/dist/{transport-B4rXnSTf.mjs.map → transport-_2nBz7e9.mjs.map} +1 -1
- package/dist/{trusted-proxy-DY1_UqHr.mjs → trusted-proxy-DZY5WCn2.mjs} +1 -1
- package/dist/{trusted-proxy-DY1_UqHr.mjs.map → trusted-proxy-DZY5WCn2.mjs.map} +1 -1
- package/dist/{types-Czg1S3gB.d.mts → types-B-gIxFCE.d.mts} +1 -1
- package/dist/{types-Czg1S3gB.d.mts.map → types-B-gIxFCE.d.mts.map} +1 -1
- package/dist/{types-DXLVzV2w.d.mts → types-BG8_XTLj.d.mts} +1 -1
- package/dist/{types-DXLVzV2w.d.mts.map → types-BG8_XTLj.d.mts.map} +1 -1
- package/dist/{types-CWGYDYqF.d.mts → types-BWh2MjmA.d.mts} +15 -2
- package/dist/types-BWh2MjmA.d.mts.map +1 -0
- package/dist/{types-CgvhU-hF.d.mts → types-BWqGVhFn.d.mts} +1 -1
- package/dist/{types-CgvhU-hF.d.mts.map → types-BWqGVhFn.d.mts.map} +1 -1
- package/dist/{types-DYF2_Vf4.mjs → types-CQAugunJ.mjs} +1 -1
- package/dist/{types-DYF2_Vf4.mjs.map → types-CQAugunJ.mjs.map} +1 -1
- package/dist/{types-DPCpkzvS.d.mts → types-CTLJYMhN.d.mts} +1 -1
- package/dist/{types-DPCpkzvS.d.mts.map → types-CTLJYMhN.d.mts.map} +1 -1
- package/dist/{types-CmivgZbp.d.mts → types-CUsXGRVj.d.mts} +1 -1
- package/dist/{types-CmivgZbp.d.mts.map → types-CUsXGRVj.d.mts.map} +1 -1
- package/dist/{types-DXOIbece.mjs → types-CmI1OyQg.mjs} +2 -2
- package/dist/types-CmI1OyQg.mjs.map +1 -0
- package/dist/{types-CKNXt63n.d.mts → types-DrYMm9s5.d.mts} +1 -1
- package/dist/{types-CKNXt63n.d.mts.map → types-DrYMm9s5.d.mts.map} +1 -1
- package/dist/{types-CIKX2HO5.d.mts → types-TTx8uP7V.d.mts} +2 -2
- package/dist/{types-CIKX2HO5.d.mts.map → types-TTx8uP7V.d.mts.map} +1 -1
- package/dist/{types-DCNNfeCv.d.mts → types-fS7-VTdR.d.mts} +1 -1
- package/dist/{types-DCNNfeCv.d.mts.map → types-fS7-VTdR.d.mts.map} +1 -1
- package/dist/{user-Db-Rti_z.mjs → user-JAuc8VUf.mjs} +3 -3
- package/dist/{user-Db-Rti_z.mjs.map → user-JAuc8VUf.mjs.map} +1 -1
- package/dist/{utils-LbHcSRTj.mjs → utils-B7A57fm9.mjs} +1 -1
- package/dist/{utils-LbHcSRTj.mjs.map → utils-B7A57fm9.mjs.map} +1 -1
- package/dist/{validate-Bwl64sxv.mjs → validate-BzXHWnkV.mjs} +2 -2
- package/dist/{validate-Bwl64sxv.mjs.map → validate-BzXHWnkV.mjs.map} +1 -1
- package/dist/{validate-CE2M0nvx.d.mts → validate-DOFrIb-c.d.mts} +5 -5
- package/dist/{validate-CE2M0nvx.d.mts.map → validate-DOFrIb-c.d.mts.map} +1 -1
- package/dist/{validation-C_yOvFaO.mjs → validation-CY1gk4Ar.mjs} +6 -6
- package/dist/{validation-C_yOvFaO.mjs.map → validation-CY1gk4Ar.mjs.map} +1 -1
- package/dist/version-B5nHxI5Y.mjs +7 -0
- package/dist/{version-RnYXYjzD.mjs.map → version-B5nHxI5Y.mjs.map} +1 -1
- package/dist/{widgets-8GONuRHo.mjs → widgets-Dri0spI4.mjs} +3 -3
- package/dist/{widgets-8GONuRHo.mjs.map → widgets-Dri0spI4.mjs.map} +1 -1
- package/dist/{zod-generator-D481JjzD.mjs → zod-generator-xEHODMJf.mjs} +51 -15
- package/dist/zod-generator-xEHODMJf.mjs.map +1 -0
- package/package.json +8 -7
- package/src/api/handlers/taxonomies.ts +62 -32
- package/src/api/schemas/bylines.ts +8 -0
- package/src/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/src/astro/integration/shims/use-sync-external-store.js +1 -0
- package/src/astro/integration/virtual-modules.ts +8 -0
- package/src/astro/integration/vite-config.ts +56 -9
- 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 +4 -8
- package/src/astro/middleware.ts +103 -31
- package/src/astro/routes/admin.astro +5 -1
- package/src/astro/routes/api/schema/index.ts +9 -3
- package/src/cli/commands/export-seed.ts +15 -11
- package/src/components/Block.astro +71 -0
- 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/migrations/045_taxonomy_parent_group.ts +68 -0
- package/src/database/migrations/runner.ts +2 -0
- package/src/database/repositories/byline.ts +14 -0
- package/src/database/repositories/taxonomy.ts +50 -7
- package/src/database/repositories/types.ts +13 -0
- package/src/emdash-runtime.ts +226 -71
- package/src/loader.ts +161 -13
- package/src/media/local-runtime.ts +18 -5
- 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 +201 -19
- package/src/schema/zod-generator.ts +53 -8
- package/src/taxonomies/index.ts +46 -8
- package/src/ui.ts +5 -0
- package/src/virtual-modules.d.ts +13 -0
- package/dist/byline-CC0WS4Gu.mjs.map +0 -1
- package/dist/byline-fields-jy07PZJM.d.mts.map +0 -1
- package/dist/context-f1__jpzF.mjs.map +0 -1
- package/dist/cron-CQPxBjYs.mjs.map +0 -1
- package/dist/index-C2dLNT6S.d.mts.map +0 -1
- package/dist/loader-C8Z48Uof.mjs.map +0 -1
- package/dist/menus-DOs1MQJg.mjs.map +0 -1
- package/dist/query-B1RVFUNM.mjs.map +0 -1
- package/dist/redirects-DUvXgzCX.mjs.map +0 -1
- package/dist/runner-DYYnW530.mjs.map +0 -1
- package/dist/taxonomies-Be9B1jEj.mjs.map +0 -1
- package/dist/taxonomies-CJmkEpdS.mjs.map +0 -1
- package/dist/taxonomy-B2HQuVf5.mjs.map +0 -1
- package/dist/types-CWGYDYqF.d.mts.map +0 -1
- package/dist/types-DXOIbece.mjs.map +0 -1
- package/dist/version-RnYXYjzD.mjs +0 -7
- package/dist/zod-generator-D481JjzD.mjs.map +0 -1
- /package/dist/{api-tokens-BVH-H8Z9.mjs → api-tokens-B4BQybOp.mjs} +0 -0
- /package/dist/{ssrf-Cz1e2QPn.mjs → ssrf-CcX9zvMK.mjs} +0 -0
- /package/dist/{types-Bfr2Pj6z.mjs → types-BvbeGEtr.mjs} +0 -0
|
@@ -1,81 +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-BsquExlK.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, t as getMenu, v as definePlugin } from "../menus-
|
|
5
|
+
import { _ as resolveExclusiveHooks, g as createHookPipeline, m as EmailPipeline, p as PluginRouteRegistry, t as getMenu, v as definePlugin } from "../menus-GvRSpgIA.mjs";
|
|
6
6
|
import { t as after } from "../after-B1IIdH3Y.mjs";
|
|
7
7
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
8
8
|
import "../object-cache-SEb2IM4Z.mjs";
|
|
9
|
-
import { r as RevisionRepository, t as ContentRepository } from "../content-
|
|
9
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-PoVGKjp0.mjs";
|
|
10
10
|
import "../base64-CmWvODNW.mjs";
|
|
11
|
-
import "../types-
|
|
12
|
-
import { t as MediaRepository } from "../media-
|
|
13
|
-
import "../user-
|
|
14
|
-
import "../taxonomy-
|
|
15
|
-
import "../comment-
|
|
11
|
+
import "../types-CmI1OyQg.mjs";
|
|
12
|
+
import { t as MediaRepository } from "../media-CTjJoJTh.mjs";
|
|
13
|
+
import "../user-JAuc8VUf.mjs";
|
|
14
|
+
import "../taxonomy-BBUlGug5.mjs";
|
|
15
|
+
import "../comment-BDx50EX5.mjs";
|
|
16
16
|
import { t as OptionsRepository } from "../options-DTTML-Tx.mjs";
|
|
17
|
-
import "../context-
|
|
18
|
-
import "../menus-
|
|
19
|
-
import "../redirect-
|
|
17
|
+
import "../context-Dvws41_A.mjs";
|
|
18
|
+
import "../menus-8O6xNcYW.mjs";
|
|
19
|
+
import "../redirect-C1KVGYWe.mjs";
|
|
20
20
|
import { i as setRequestCacheEntry, r as requestCached } from "../request-cache-KCNHp_RJ.mjs";
|
|
21
21
|
import "../byline-registry-BOjqDOim.mjs";
|
|
22
22
|
import { n as initWithLock, t as createInitLock } from "../init-lock-6b309ZrF.mjs";
|
|
23
|
-
import "../
|
|
24
|
-
import
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import "../
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
23
|
+
import "../field-defs-cache-CYYx8xlG.mjs";
|
|
24
|
+
import "../byline-C-YajfV7.mjs";
|
|
25
|
+
import { n as normalizeMediaValue } from "../normalize-ClbNIenm.mjs";
|
|
26
|
+
import "../placeholder-B0s2mWu5.mjs";
|
|
27
|
+
import "../seo-3QrZ1EPT.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-d_0wi9fW.mjs";
|
|
30
|
+
import "../dashboard-DsYU8JKS.mjs";
|
|
31
|
+
import { n as hashString } from "../hash-DrvzIXcz.mjs";
|
|
32
|
+
import { t as FTSManager } from "../fts-manager-DW_NR-Fs.mjs";
|
|
33
|
+
import { n as SchemaRegistry } from "../registry-CJkCubOJ.mjs";
|
|
33
34
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
34
|
-
import {
|
|
35
|
-
import "../schema-
|
|
36
|
-
import "../zod-generator-
|
|
37
|
-
import "../seo-
|
|
38
|
-
import "../sections-
|
|
39
|
-
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-
|
|
40
|
-
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-
|
|
41
|
-
import "../settings-
|
|
42
|
-
import "../resolve-
|
|
43
|
-
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-
|
|
44
|
-
import "../taxonomies-
|
|
45
|
-
import { r as normalizeManifestRoute } from "../manifest-schema-
|
|
46
|
-
import "../types-
|
|
47
|
-
import "../ssrf-
|
|
48
|
-
import "../error-
|
|
49
|
-
import "../parse-
|
|
50
|
-
import "../redirects-
|
|
51
|
-
import "../byline-fields-
|
|
52
|
-
import "../status-
|
|
53
|
-
import { a as invalidateUrlPatternCache } from "../query-
|
|
54
|
-
import "../import-
|
|
55
|
-
import { t as getTrustedProxyHeaders } from "../trusted-proxy-
|
|
56
|
-
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-
|
|
57
|
-
import "../ssrf-
|
|
58
|
-
import { n as CronExecutor } from "../cron-
|
|
59
|
-
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-
|
|
60
|
-
import "../utils-
|
|
61
|
-
import "../tokens-
|
|
62
|
-
import "../preview-
|
|
63
|
-
import "../comment-reaction-
|
|
64
|
-
import "../bylines-
|
|
65
|
-
import { n as getWidgetAreas } from "../widgets-
|
|
66
|
-
import "../apply-
|
|
67
|
-
import "../load-
|
|
68
|
-
import "../search-
|
|
35
|
+
import { a as getDb } from "../loader-BR2SgfEc.mjs";
|
|
36
|
+
import "../schema-DMjXuvNU.mjs";
|
|
37
|
+
import "../zod-generator-xEHODMJf.mjs";
|
|
38
|
+
import "../seo-DCEF-AVr.mjs";
|
|
39
|
+
import "../sections-CCMic8dB.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-D9rvaLuY.mjs";
|
|
42
|
+
import "../settings-C3Yi5Co3.mjs";
|
|
43
|
+
import "../resolve-C7I0qiR0.mjs";
|
|
44
|
+
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-CurpLtNC.mjs";
|
|
45
|
+
import "../taxonomies-DhLaNJji.mjs";
|
|
46
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-BWKnQYQF.mjs";
|
|
47
|
+
import "../types-BvbeGEtr.mjs";
|
|
48
|
+
import "../ssrf-BRKb343l.mjs";
|
|
49
|
+
import "../error-lq_fL-RS.mjs";
|
|
50
|
+
import "../parse-DHI873qU.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-DZdlS6Cu.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-Gv_pgfI3.mjs";
|
|
65
|
+
import "../bylines-BMtJnPnG.mjs";
|
|
66
|
+
import { n as getWidgetAreas } from "../widgets-Dri0spI4.mjs";
|
|
67
|
+
import "../apply-BE9UaWX0.mjs";
|
|
68
|
+
import "../load-DMFi4n1p.mjs";
|
|
69
|
+
import "../search-D1wKk3lc.mjs";
|
|
69
70
|
import "../index.mjs";
|
|
70
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
71
|
-
import { t as getAuthMode } from "../mode-
|
|
72
|
-
import { t as cleanupExpiredChallenges } from "../challenge-store-
|
|
73
|
-
import { a as validateEncryptionKeyAtStartup } from "../secrets-
|
|
74
|
-
import { t as resolveSessionUser } from "../session-user-
|
|
71
|
+
import { n as VERSION, t as COMMIT } from "../version-B5nHxI5Y.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";
|
|
75
76
|
import { Kysely, sql } from "kysely";
|
|
76
77
|
import { defineMiddleware } from "astro:middleware";
|
|
77
78
|
import virtualConfig from "virtual:emdash/config";
|
|
78
|
-
import { createDialect, createRequestScopedDb } from "virtual:emdash/dialect";
|
|
79
|
+
import { createCoalescingDialect, createDialect, createRequestScopedDb } from "virtual:emdash/dialect";
|
|
79
80
|
import { mediaProviders } from "virtual:emdash/media-providers";
|
|
80
81
|
import { plugins } from "virtual:emdash/plugins";
|
|
81
82
|
import * as virtualSandboxRunnerModule from "virtual:emdash/sandbox-runner";
|
|
@@ -373,6 +374,25 @@ function getDbHolder() {
|
|
|
373
374
|
}
|
|
374
375
|
return holder;
|
|
375
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
|
+
}
|
|
376
396
|
const storageCache = /* @__PURE__ */ new Map();
|
|
377
397
|
const sandboxedPluginCache = /* @__PURE__ */ new Map();
|
|
378
398
|
/**
|
|
@@ -406,7 +426,20 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
406
426
|
configuredPlugins;
|
|
407
427
|
sandboxedPlugins;
|
|
408
428
|
sandboxedPluginEntries;
|
|
409
|
-
|
|
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
|
+
}
|
|
410
443
|
_hooks;
|
|
411
444
|
config;
|
|
412
445
|
mediaProviders;
|
|
@@ -454,7 +487,6 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
454
487
|
this.configuredPlugins = parts.configuredPlugins;
|
|
455
488
|
this.sandboxedPlugins = parts.sandboxedPlugins;
|
|
456
489
|
this.sandboxedPluginEntries = parts.sandboxedPluginEntries;
|
|
457
|
-
this.schemaRegistry = new SchemaRegistry(parts.db);
|
|
458
490
|
this._hooks = parts.hooks;
|
|
459
491
|
this.enabledPlugins = parts.enabledPlugins;
|
|
460
492
|
this.pluginStates = parts.pluginStates;
|
|
@@ -571,10 +603,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
571
603
|
async rebuildHookPipeline() {
|
|
572
604
|
const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
|
|
573
605
|
await EmDashRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
|
|
574
|
-
if (this.email) newPipeline.setContextFactory({
|
|
575
|
-
db: this.db,
|
|
576
|
-
emailPipeline: this.email
|
|
577
|
-
});
|
|
606
|
+
if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
|
|
578
607
|
if (this.cronScheduler) {
|
|
579
608
|
const scheduler = this.cronScheduler;
|
|
580
609
|
newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
|
|
@@ -824,29 +853,100 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
824
853
|
}
|
|
825
854
|
};
|
|
826
855
|
const db = await phase("rt.db", "DB init + migrations", () => EmDashRuntime.getDatabase(deps));
|
|
856
|
+
const resolveDb = () => {
|
|
857
|
+
return getRequestContext()?.db ?? db;
|
|
858
|
+
};
|
|
827
859
|
await phase("rt.secrets", "Validate encryption key", () => validateEncryptionKeyAtStartup());
|
|
828
860
|
const storage = EmDashRuntime.getStorage(deps);
|
|
829
861
|
let pluginStates = /* @__PURE__ */ new Map();
|
|
830
862
|
let siteInfo;
|
|
831
|
-
|
|
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 () => {
|
|
832
897
|
try {
|
|
833
|
-
const states = await
|
|
898
|
+
const states = await readDb.selectFrom("_plugin_state").select(["plugin_id", "status"]).execute();
|
|
834
899
|
pluginStates = new Map(states.map((s) => [s.plugin_id, s.status]));
|
|
835
900
|
} catch {}
|
|
836
901
|
}), phase("rt.site", "Site info options", async () => {
|
|
837
902
|
try {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
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
|
|
847
919
|
};
|
|
848
920
|
} catch {}
|
|
849
|
-
})
|
|
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-BE9UaWX0.mjs").then((n) => n.n);
|
|
929
|
+
const { loadSeed } = await import("../load-DMFi4n1p.mjs").then((n) => n.r);
|
|
930
|
+
const { validateSeed } = await import("../validate-BzXHWnkV.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 {}
|
|
850
950
|
const enabledPlugins = /* @__PURE__ */ new Set();
|
|
851
951
|
for (const plugin of deps.plugins) {
|
|
852
952
|
const status = pluginStates.get(plugin.id);
|
|
@@ -907,6 +1007,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
907
1007
|
const enabledPluginList = allPipelinePlugins.filter((p) => enabledPlugins.has(p.id));
|
|
908
1008
|
const pipelineFactoryOptions = {
|
|
909
1009
|
db,
|
|
1010
|
+
getDb: resolveDb,
|
|
910
1011
|
storage: storage ?? void 0,
|
|
911
1012
|
siteInfo
|
|
912
1013
|
};
|
|
@@ -920,7 +1021,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
920
1021
|
const mediaProviderEntries = deps.mediaProviderEntries ?? [];
|
|
921
1022
|
const providerContext = {
|
|
922
1023
|
db,
|
|
923
|
-
storage
|
|
1024
|
+
storage,
|
|
1025
|
+
getDb: resolveDb
|
|
924
1026
|
};
|
|
925
1027
|
for (const entry of mediaProviderEntries) try {
|
|
926
1028
|
const provider = entry.createProvider(providerContext);
|
|
@@ -936,16 +1038,13 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
936
1038
|
const result = await pipelineRef.current.invokeCronHook(pluginId, event);
|
|
937
1039
|
if (!result.success && result.error) throw result.error;
|
|
938
1040
|
};
|
|
939
|
-
pipeline.setContextFactory({
|
|
940
|
-
db,
|
|
941
|
-
emailPipeline
|
|
942
|
-
});
|
|
1041
|
+
pipeline.setContextFactory({ emailPipeline });
|
|
943
1042
|
let cronExecutor = null;
|
|
944
1043
|
let cronScheduler = null;
|
|
945
1044
|
const runtimeRef = { current: null };
|
|
946
1045
|
await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
|
|
947
1046
|
try {
|
|
948
|
-
cronExecutor = new CronExecutor(
|
|
1047
|
+
cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
|
|
949
1048
|
const executorForRecovery = cronExecutor;
|
|
950
1049
|
after(async () => {
|
|
951
1050
|
try {
|
|
@@ -1038,26 +1137,6 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1038
1137
|
log: kyselyLogOption()
|
|
1039
1138
|
});
|
|
1040
1139
|
await runMigrations(db);
|
|
1041
|
-
try {
|
|
1042
|
-
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()]);
|
|
1043
|
-
const setupDone = (() => {
|
|
1044
|
-
try {
|
|
1045
|
-
return setupOption && JSON.parse(setupOption.value) === true;
|
|
1046
|
-
} catch {
|
|
1047
|
-
return false;
|
|
1048
|
-
}
|
|
1049
|
-
})();
|
|
1050
|
-
if (collectionCount.count === 0 && !setupDone) {
|
|
1051
|
-
const { applySeed } = await import("../apply-wDqQoxX4.mjs").then((n) => n.n);
|
|
1052
|
-
const { loadSeed } = await import("../load-Dtoo7KcJ.mjs").then((n) => n.r);
|
|
1053
|
-
const { validateSeed } = await import("../validate-Bwl64sxv.mjs").then((n) => n.n);
|
|
1054
|
-
const seed = await loadSeed();
|
|
1055
|
-
if (validateSeed(seed).valid) {
|
|
1056
|
-
await applySeed(db, seed, { onConflict: "skip" });
|
|
1057
|
-
console.log("Auto-seeded default collections");
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
} catch {}
|
|
1061
1140
|
if (isCurrentClaim()) holder.cache.set(cacheKey, db);
|
|
1062
1141
|
return db;
|
|
1063
1142
|
}, {
|
|
@@ -1584,7 +1663,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1584
1663
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1585
1664
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1586
1665
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1587
|
-
const { validateContentData } = await import("../validation-
|
|
1666
|
+
const { validateContentData } = await import("../validation-CY1gk4Ar.mjs");
|
|
1588
1667
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1589
1668
|
if (!validation.ok) return {
|
|
1590
1669
|
success: false,
|
|
@@ -1600,7 +1679,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1600
1679
|
return result;
|
|
1601
1680
|
}
|
|
1602
1681
|
async handleContentUpdate(collection, id, body) {
|
|
1603
|
-
const { ContentRepository } = await import("../content-
|
|
1682
|
+
const { ContentRepository } = await import("../content-PoVGKjp0.mjs").then((n) => n.n);
|
|
1604
1683
|
const repo = new ContentRepository(this.db);
|
|
1605
1684
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1606
1685
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1627,7 +1706,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1627
1706
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1628
1707
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1629
1708
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1630
|
-
const { validateContentData } = await import("../validation-
|
|
1709
|
+
const { validateContentData } = await import("../validation-CY1gk4Ar.mjs");
|
|
1631
1710
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1632
1711
|
if (!validation.ok) return {
|
|
1633
1712
|
success: false,
|
|
@@ -1883,6 +1962,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1883
1962
|
if (trustedPlugin && this.enabledPlugins.has(trustedPlugin.id)) {
|
|
1884
1963
|
const routeRegistry = new PluginRouteRegistry({
|
|
1885
1964
|
db: this.db,
|
|
1965
|
+
storage: this.storage ?? void 0,
|
|
1886
1966
|
emailPipeline: this.email ?? void 0,
|
|
1887
1967
|
trustedProxyHeaders: getTrustedProxyHeaders(this.config)
|
|
1888
1968
|
});
|
|
@@ -2167,6 +2247,120 @@ function createPublicMediaUrlResolver(storage) {
|
|
|
2167
2247
|
return (key) => resolvePublicMediaUrl(storage, key);
|
|
2168
2248
|
}
|
|
2169
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
|
+
|
|
2170
2364
|
//#endregion
|
|
2171
2365
|
//#region src/astro/middleware/stream-end-metrics.ts
|
|
2172
2366
|
/**
|
|
@@ -2190,13 +2384,6 @@ function createPublicMediaUrlResolver(storage) {
|
|
|
2190
2384
|
*/
|
|
2191
2385
|
const STREAM_END_PREFIX = "[emdash-stream-end]";
|
|
2192
2386
|
/**
|
|
2193
|
-
* Astro attaches AstroCookies to outgoing responses via a well-known global
|
|
2194
|
-
* symbol. Constructing a new Response drops non-header metadata, so the
|
|
2195
|
-
* symbol must be forwarded explicitly or `cookies.set()` calls are silently
|
|
2196
|
-
* dropped. Same pattern as finalizeResponse in ../middleware.ts.
|
|
2197
|
-
*/
|
|
2198
|
-
const ASTRO_COOKIES_SYMBOL$1 = Symbol.for("astro.cookies");
|
|
2199
|
-
/**
|
|
2200
2387
|
* Wrap a response body so the FINAL request metrics are emitted when the
|
|
2201
2388
|
* body finishes streaming. Returns the response unchanged when
|
|
2202
2389
|
* instrumentation is disabled, the body is null, or no request metrics
|
|
@@ -2227,8 +2414,8 @@ function wrapBodyForStreamMetrics(response) {
|
|
|
2227
2414
|
if (recorder) flushRecorder(recorder);
|
|
2228
2415
|
} });
|
|
2229
2416
|
const wrapped = new Response(response.body.pipeThrough(transform), response);
|
|
2230
|
-
const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL
|
|
2231
|
-
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);
|
|
2232
2419
|
wrapped.headers.delete("Content-Length");
|
|
2233
2420
|
return wrapped;
|
|
2234
2421
|
}
|
|
@@ -2401,6 +2588,7 @@ function buildDependencies(config) {
|
|
|
2401
2588
|
config,
|
|
2402
2589
|
plugins: getPlugins(),
|
|
2403
2590
|
createDialect,
|
|
2591
|
+
createCoalescingDialect,
|
|
2404
2592
|
createStorage,
|
|
2405
2593
|
createScheduler,
|
|
2406
2594
|
sandboxEnabled: sandboxModule.sandboxEnabled,
|
|
@@ -2450,15 +2638,56 @@ async function getRuntime(config, initTimings) {
|
|
|
2450
2638
|
async function runScheduledTasks(options = {}) {
|
|
2451
2639
|
const config = getConfig();
|
|
2452
2640
|
if (!config) return { published: [] };
|
|
2453
|
-
|
|
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
|
+
}
|
|
2454
2673
|
}
|
|
2455
2674
|
/**
|
|
2456
|
-
*
|
|
2457
|
-
*
|
|
2458
|
-
*
|
|
2459
|
-
*
|
|
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.
|
|
2460
2680
|
*/
|
|
2461
|
-
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/");
|
|
2462
2691
|
/**
|
|
2463
2692
|
* Baseline security headers applied to all responses.
|
|
2464
2693
|
* Admin routes get additional headers (strict CSP) from auth middleware.
|
|
@@ -2467,9 +2696,9 @@ function finalizeResponse(response, serverTimings) {
|
|
|
2467
2696
|
const res = new Response(response.body, response);
|
|
2468
2697
|
const astroCookies = Reflect.get(response, ASTRO_COOKIES_SYMBOL);
|
|
2469
2698
|
if (astroCookies !== void 0) Reflect.set(res, ASTRO_COOKIES_SYMBOL, astroCookies);
|
|
2470
|
-
res.headers.set("X-Content-Type-Options", "nosniff");
|
|
2471
|
-
res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
2472
|
-
res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
|
|
2699
|
+
if (!res.headers.has("X-Content-Type-Options")) res.headers.set("X-Content-Type-Options", "nosniff");
|
|
2700
|
+
if (!res.headers.has("Referrer-Policy")) res.headers.set("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
2701
|
+
if (!res.headers.has("Permissions-Policy")) res.headers.set("Permissions-Policy", "camera=(), microphone=(), geolocation=(), payment=()");
|
|
2473
2702
|
if (!res.headers.has("Content-Security-Policy")) res.headers.set("X-Frame-Options", "SAMEORIGIN");
|
|
2474
2703
|
if (serverTimings && serverTimings.length > 0) res.headers.set("Server-Timing", serverTimings.map((t) => {
|
|
2475
2704
|
const dur = Math.round(t.dur);
|
|
@@ -2561,7 +2790,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2561
2790
|
if (!isSetupVerified() && !context.isPrerendered) {
|
|
2562
2791
|
const t0 = performance.now();
|
|
2563
2792
|
try {
|
|
2564
|
-
const { getDb } = await import("../loader-
|
|
2793
|
+
const { getDb } = await import("../loader-BR2SgfEc.mjs").then((n) => n.o);
|
|
2565
2794
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
2566
2795
|
markSetupVerified();
|
|
2567
2796
|
} catch (error) {
|
|
@@ -2632,11 +2861,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2632
2861
|
const acceptsHtml = (request.headers.get("accept") ?? "").split(",", 1)[0].trim().startsWith("text/html");
|
|
2633
2862
|
return runWithContext(ctx, async () => {
|
|
2634
2863
|
if (acceptsHtml) after(() => prefetchLayoutData());
|
|
2635
|
-
|
|
2636
|
-
return await runAnon();
|
|
2637
|
-
} finally {
|
|
2638
|
-
anonScoped.commit();
|
|
2639
|
-
}
|
|
2864
|
+
return finishScoped(anonScoped, runAnon);
|
|
2640
2865
|
});
|
|
2641
2866
|
}
|
|
2642
2867
|
return runAnon();
|
|
@@ -2698,7 +2923,9 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2698
2923
|
collectPageFragments: runtime.collectPageFragments.bind(runtime),
|
|
2699
2924
|
ensureSearchHealthy: runtime.ensureSearchHealthy.bind(runtime),
|
|
2700
2925
|
storage: runtime.storage,
|
|
2701
|
-
db
|
|
2926
|
+
get db() {
|
|
2927
|
+
return runtime.db;
|
|
2928
|
+
},
|
|
2702
2929
|
getPublicMediaUrl: createPublicMediaUrlResolver(runtime.storage),
|
|
2703
2930
|
hooks: runtime.hooks,
|
|
2704
2931
|
email: runtime.email,
|
|
@@ -2747,13 +2974,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2747
2974
|
editMode: false,
|
|
2748
2975
|
db: scoped.db,
|
|
2749
2976
|
metrics
|
|
2750
|
-
},
|
|
2751
|
-
try {
|
|
2752
|
-
return await renderAndFinalize();
|
|
2753
|
-
} finally {
|
|
2754
|
-
scoped.commit();
|
|
2755
|
-
}
|
|
2756
|
-
});
|
|
2977
|
+
}, () => finishScoped(scoped, renderAndFinalize));
|
|
2757
2978
|
}
|
|
2758
2979
|
return renderAndFinalize();
|
|
2759
2980
|
};
|