emdash 0.29.0 → 0.31.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-DPAkL6QF.d.mts → adapters-C0ONzkUP.d.mts} +10 -1
- package/dist/adapters-C0ONzkUP.d.mts.map +1 -0
- package/dist/{allowed-origins-FXB-FplB.mjs → allowed-origins-CCEi9bPI.mjs} +2 -2
- package/dist/{allowed-origins-FXB-FplB.mjs.map → allowed-origins-CCEi9bPI.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +19 -19
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -4
- package/dist/{api-DVbHNApo.mjs → api-EibxGP-V.mjs} +260 -160
- package/dist/api-EibxGP-V.mjs.map +1 -0
- package/dist/api-tokens-Cvmixds7.mjs +3 -0
- package/dist/{api-tokens-UYBkl17d.mjs → api-tokens-uPt8UDpx.mjs} +2 -2
- package/dist/{api-tokens-UYBkl17d.mjs.map → api-tokens-uPt8UDpx.mjs.map} +1 -1
- package/dist/{apply-D23iUV4q.mjs → apply-fGHCAwWN.mjs} +42 -44
- package/dist/apply-fGHCAwWN.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -13
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +90 -11
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -11
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +56 -107
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +7 -7
- package/dist/astro/middleware/request-context.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +47 -3
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +410 -123
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +5 -1
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -1
- package/dist/astro/routes/PluginRegistry.mjs +2 -1
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -9
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +16 -15
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -22
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +20 -18
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +13 -12
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -10
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +11 -10
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +12 -10
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- 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 -40
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +41 -40
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +46 -40
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +39 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts +9 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +78 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +40 -39
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +43 -40
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +46 -40
- 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 -39
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +46 -41
- 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 -39
- 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 -39
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +44 -41
- 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 -39
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +45 -42
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +41 -40
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +40 -39
- 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 -39
- 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 +4 -4
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/accept.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/complete.mjs +13 -12
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +10 -9
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -11
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +5 -5
- package/dist/astro/routes/api/auth/me.mjs +9 -8
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +6 -3
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +15 -5
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +11 -5
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +8 -7
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -10
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +13 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +4 -4
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +13 -12
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +14 -13
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +20 -19
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +18 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -4
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +19 -18
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -9
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +12 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- 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 +17 -16
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -12
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +13 -13
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -11
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +11 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -12
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +11 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +17 -16
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -12
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +24 -23
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +7 -8
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +149 -45
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +9 -8
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/usage.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/usage.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs +37 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +26 -10
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +4 -3
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +10 -9
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +31 -11
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +10 -9
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +10 -9
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +29 -16
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
- 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 +52 -24
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +20 -32
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +13 -12
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +13 -12
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +16 -15
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +11 -11
- package/dist/astro/routes/api/relations/index.mjs +16 -15
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +40 -39
- 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 -39
- 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 -39
- 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 -39
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +40 -39
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +9 -9
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +40 -39
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +40 -39
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +13 -12
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +12 -11
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +13 -12
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +8 -8
- package/dist/astro/routes/api/search/suggest.mjs +12 -11
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +12 -11
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +12 -11
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts +9 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +48 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/index.d.mts +8 -0
- package/dist/astro/routes/api/settings/backups/archives/index.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +23 -0
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/export.d.mts +8 -0
- package/dist/astro/routes/api/settings/backups/export.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/export.mjs +35 -0
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/index.d.mts +9 -0
- package/dist/astro/routes/api/settings/backups/index.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/index.mjs +52 -0
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings.mjs +14 -13
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +19 -15
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +18 -14
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +26 -26
- package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
- package/dist/astro/routes/api/setup/index.mjs +28 -27
- 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.mjs +8 -215
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +15 -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 +15 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +15 -14
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +15 -14
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +6 -6
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +4 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +4 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/index.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +7 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +11 -11
- package/dist/astro/routes/sitemap.xml.mjs +8 -8
- package/dist/astro/types.d.mts +38 -17
- 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-BmCwQCib.mjs → authorize-6WPZa1xZ.mjs} +7 -4
- package/dist/authorize-6WPZa1xZ.mjs.map +1 -0
- package/dist/backup-Qr9PaGUo.mjs +241 -0
- package/dist/backup-Qr9PaGUo.mjs.map +1 -0
- package/dist/{base64-C74Msx8h.mjs → base64-B-PsqheR.mjs} +8 -4
- package/dist/base64-B-PsqheR.mjs.map +1 -0
- package/dist/{byline-BWb5H-65.mjs → byline-BTOxUlFF.mjs} +6 -6
- package/dist/{byline-BWb5H-65.mjs.map → byline-BTOxUlFF.mjs.map} +1 -1
- package/dist/{byline-fields-DO6bAYK8.mjs → byline-fields-CdU_LTF1.mjs} +1 -1
- package/dist/{byline-fields-DO6bAYK8.mjs.map → byline-fields-CdU_LTF1.mjs.map} +1 -1
- package/dist/{bylines-CHojDMpj.mjs → bylines-FyZu6TbJ.mjs} +7 -7
- package/dist/{bylines-CHojDMpj.mjs.map → bylines-FyZu6TbJ.mjs.map} +1 -1
- package/dist/{bylines-BGuKFaBy.mjs → bylines-oVN0iPwX.mjs} +12 -8
- package/dist/bylines-oVN0iPwX.mjs.map +1 -0
- package/dist/{cache-BeR7RfN8.mjs → cache-DDwy3JDW.mjs} +2 -2
- package/dist/{cache-BeR7RfN8.mjs.map → cache-DDwy3JDW.mjs.map} +1 -1
- package/dist/{challenge-store-B426wQ6O.mjs → challenge-store-BFzgFRog.mjs} +1 -1
- package/dist/{challenge-store-B426wQ6O.mjs.map → challenge-store-BFzgFRog.mjs.map} +1 -1
- package/dist/{chunks-BU5_nrAC.mjs → chunks-Bq-5DPrD.mjs} +2 -2
- package/dist/{chunks-BU5_nrAC.mjs.map → chunks-Bq-5DPrD.mjs.map} +1 -1
- package/dist/cli/index.mjs +139 -32
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +54 -3
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +16 -4
- package/dist/client/index.mjs.map +1 -1
- package/dist/{comment-SWh31kS0.mjs → comment-B9cUud8H.mjs} +2 -2
- package/dist/{comment-SWh31kS0.mjs.map → comment-B9cUud8H.mjs.map} +1 -1
- package/dist/{comment-reaction-DgcpziXI.mjs → comment-reaction-VUXO981F.mjs} +2 -2
- package/dist/{comment-reaction-DgcpziXI.mjs.map → comment-reaction-VUXO981F.mjs.map} +1 -1
- package/dist/{comments-kZYGppMS.mjs → comments-PXj1E9Si.mjs} +3 -3
- package/dist/{comments-kZYGppMS.mjs.map → comments-PXj1E9Si.mjs.map} +1 -1
- package/dist/{components-CliOkZAs.mjs → components-DZkL4Fx0.mjs} +1 -1
- package/dist/{components-CliOkZAs.mjs.map → components-DZkL4Fx0.mjs.map} +1 -1
- package/dist/{config-CVssduLe.mjs → config-B6b_BobR.mjs} +6 -2
- package/dist/config-B6b_BobR.mjs.map +1 -0
- package/dist/{content-BO61Sx4j.mjs → content-BC43pICM.mjs} +53 -19
- package/dist/content-BC43pICM.mjs.map +1 -0
- package/dist/{content-refresh-BkkApzeS.mjs → content-refresh-CPMSauD3.mjs} +96 -4
- package/dist/content-refresh-CPMSauD3.mjs.map +1 -0
- package/dist/{context-DtSFYFuS.mjs → context-DOurRIrb.mjs} +97 -74
- package/dist/context-DOurRIrb.mjs.map +1 -0
- package/dist/{cron-YFJ7uNVA.mjs → cron-BlKIMD_e.mjs} +1 -1
- package/dist/{cron-YFJ7uNVA.mjs.map → cron-BlKIMD_e.mjs.map} +1 -1
- package/dist/{dashboard-xo_gPs_D.mjs → dashboard-CBm4zhc3.mjs} +4 -4
- package/dist/{dashboard-xo_gPs_D.mjs.map → dashboard-CBm4zhc3.mjs.map} +1 -1
- package/dist/database/pg-migration-lock.d.mts.map +1 -1
- package/dist/database/pg-migration-lock.mjs +1 -4
- package/dist/database/pg-migration-lock.mjs.map +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/index.mjs.map +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-BKuXh_fi.mjs → db-errors-CcWLaRiR.mjs} +4 -2
- package/dist/db-errors-CcWLaRiR.mjs.map +1 -0
- package/dist/{default-DY5ovGUG.mjs → default-C4v9KP56.mjs} +1 -1
- package/dist/{default-DY5ovGUG.mjs.map → default-C4v9KP56.mjs.map} +1 -1
- package/dist/{device-flow-CPXQ_QfW.mjs → device-flow-BeA6lUS1.mjs} +5 -6
- package/dist/device-flow-BeA6lUS1.mjs.map +1 -0
- package/dist/{dialect-helpers-Cue7QQOR.mjs → dialect-helpers-BtOwo2us.mjs} +60 -14
- package/dist/dialect-helpers-BtOwo2us.mjs.map +1 -0
- package/dist/{email-console-CjkQc7oY.mjs → email-console-C-9Ng8DM.mjs} +1 -1
- package/dist/{email-console-CjkQc7oY.mjs.map → email-console-C-9Ng8DM.mjs.map} +1 -1
- package/dist/error-DJ98TRbQ.mjs +90 -0
- package/dist/error-DJ98TRbQ.mjs.map +1 -0
- package/dist/{error-CfJMLSkd.mjs → errors-DtEXIQQV.mjs} +15 -84
- package/dist/errors-DtEXIQQV.mjs.map +1 -0
- package/dist/{escape-r8_GbEU2.mjs → escape-CFedIB1C.mjs} +1 -1
- package/dist/{escape-r8_GbEU2.mjs.map → escape-CFedIB1C.mjs.map} +1 -1
- package/dist/{field-defs-cache-BVrNCgSj.mjs → field-defs-cache-KfNJ_qLQ.mjs} +2 -2
- package/dist/{field-defs-cache-BVrNCgSj.mjs.map → field-defs-cache-KfNJ_qLQ.mjs.map} +1 -1
- package/dist/{fts-manager-BD9s77qh.mjs → fts-manager-hyCU9OOp.mjs} +3 -3
- package/dist/{fts-manager-BD9s77qh.mjs.map → fts-manager-hyCU9OOp.mjs.map} +1 -1
- package/dist/{hreflang-CgIxhH4k.d.mts → hreflang-CIxH_LKz.d.mts} +2 -2
- package/dist/{hreflang-CgIxhH4k.d.mts.map → hreflang-CIxH_LKz.d.mts.map} +1 -1
- package/dist/{hreflang-pAWUiPd_.mjs → hreflang-CbYeCzl9.mjs} +7 -7
- package/dist/{hreflang-pAWUiPd_.mjs.map → hreflang-CbYeCzl9.mjs.map} +1 -1
- package/dist/{import-2jHtLzsO.mjs → import-oDYCgNYQ.mjs} +4 -4
- package/dist/{import-2jHtLzsO.mjs.map → import-oDYCgNYQ.mjs.map} +1 -1
- package/dist/{index-DxjWLKGT.d.mts → index-BEui-cRd.d.mts} +3 -3
- package/dist/{index-DxjWLKGT.d.mts.map → index-BEui-cRd.d.mts.map} +1 -1
- package/dist/{index-BXOCyLj0.d.mts → index-BcEH_FfS.d.mts} +812 -16
- package/dist/index-BcEH_FfS.d.mts.map +1 -0
- package/dist/index.d.mts +18 -19
- package/dist/index.mjs +61 -60
- package/dist/{load-DgoWMdRX.mjs → load-Dg5gtWma.mjs} +2 -2
- package/dist/{load-DgoWMdRX.mjs.map → load-Dg5gtWma.mjs.map} +1 -1
- package/dist/{loader-Rb8QlGZp.mjs → loader-D4rigvjR.mjs} +170 -6
- package/dist/loader-D4rigvjR.mjs.map +1 -0
- package/dist/{manifest-schema-DeGNma2O.mjs → manifest-schema-bCq54i7F.mjs} +16 -2
- package/dist/manifest-schema-bCq54i7F.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts +30 -2
- package/dist/media/image-endpoint.d.mts.map +1 -1
- package/dist/media/image-endpoint.mjs +29 -3
- package/dist/media/image-endpoint.mjs.map +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +12 -13
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +6 -6
- package/dist/media-BJ6SRY3g.mjs +247 -0
- package/dist/media-BJ6SRY3g.mjs.map +1 -0
- package/dist/{media-allowlist-Dc05vKtt.mjs → media-allowlist-jUppPWFy.mjs} +1 -1
- package/dist/{media-allowlist-Dc05vKtt.mjs.map → media-allowlist-jUppPWFy.mjs.map} +1 -1
- package/dist/{media-D2ZFowpn.mjs → media-its1WLYv.mjs} +2 -2
- package/dist/{media-D2ZFowpn.mjs.map → media-its1WLYv.mjs.map} +1 -1
- package/dist/media-upload-DNu3QySc.mjs +145 -0
- package/dist/media-upload-DNu3QySc.mjs.map +1 -0
- package/dist/{media-url-DgIEYZr4.mjs → media-url-BCm5vBn6.mjs} +1 -1
- package/dist/{media-url-DgIEYZr4.mjs.map → media-url-BCm5vBn6.mjs.map} +1 -1
- package/dist/{media-usage-B__v9NMm.mjs → media-usage-DPQ3K4xB.mjs} +138 -5
- package/dist/{media-usage-B__v9NMm.mjs.map → media-usage-DPQ3K4xB.mjs.map} +1 -1
- package/dist/{menus-BpfevlJD.mjs → menus-BMGzWyWH.mjs} +15 -8
- package/dist/menus-BMGzWyWH.mjs.map +1 -0
- package/dist/{menus-BtvH7Z7t.mjs → menus-CPf_SW7u.mjs} +234 -13
- package/dist/menus-CPf_SW7u.mjs.map +1 -0
- package/dist/{mode-BVnhGZ2o.mjs → mode-fiXRMfeA.mjs} +1 -1
- package/dist/{mode-BVnhGZ2o.mjs.map → mode-fiXRMfeA.mjs.map} +1 -1
- package/dist/{oauth-authorization-BWqWTHBK.mjs → oauth-authorization-oqfbBuMH.mjs} +5 -6
- package/dist/oauth-authorization-oqfbBuMH.mjs.map +1 -0
- package/dist/{oauth-clients-43_XADoa.mjs → oauth-clients-BlrUHAsf.mjs} +1 -1
- package/dist/{oauth-clients-43_XADoa.mjs.map → oauth-clients-BlrUHAsf.mjs.map} +1 -1
- package/dist/{oauth-state-store-BRSUEkmx.mjs → oauth-state-store-DnvjRMy6.mjs} +2 -1
- package/dist/{oauth-state-store-BRSUEkmx.mjs.map → oauth-state-store-DnvjRMy6.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-Ctgemb0k.mjs → oauth-user-lookup-oUllxvAv.mjs} +1 -1
- package/dist/{oauth-user-lookup-Ctgemb0k.mjs.map → oauth-user-lookup-oUllxvAv.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-COXGTtqd.d.mts → options-BqMkWfYa.d.mts} +6 -6
- package/dist/{options-COXGTtqd.d.mts.map → options-BqMkWfYa.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs.map +1 -1
- package/dist/{parse-GLksnn-B.mjs → parse-53zyxlpv.mjs} +4 -12
- package/dist/{parse-GLksnn-B.mjs.map → parse-53zyxlpv.mjs.map} +1 -1
- package/dist/{passkey-config-CjA1UbDj.mjs → passkey-config-C-SKpc0-.mjs} +1 -1
- package/dist/{passkey-config-CjA1UbDj.mjs.map → passkey-config-C-SKpc0-.mjs.map} +1 -1
- package/dist/{placeholder-DR-eeZr-.d.mts → placeholder-Dop47JMM.d.mts} +1 -1
- package/dist/{placeholder-DR-eeZr-.d.mts.map → placeholder-Dop47JMM.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +21 -2
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +18 -17
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugin-utils.mjs +8 -6
- package/dist/plugin-utils.mjs.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -11
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +15 -3
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{portable-text-BAkgEKcv.mjs → portable-text-sDj92Kxv.mjs} +1 -1
- package/dist/{portable-text-BAkgEKcv.mjs.map → portable-text-sDj92Kxv.mjs.map} +1 -1
- package/dist/{preview-Rloa09Wp.mjs → preview-D4Jnbfx7.mjs} +2 -2
- package/dist/{preview-Rloa09Wp.mjs.map → preview-D4Jnbfx7.mjs.map} +1 -1
- package/dist/{public-url-C0cEvrRu.mjs → public-url-DSGTnJFw.mjs} +5 -3
- package/dist/public-url-DSGTnJFw.mjs.map +1 -0
- package/dist/{query-ZzvXyxWq.mjs → query-BbJQ-dGg.mjs} +15 -15
- package/dist/{query-ZzvXyxWq.mjs.map → query-BbJQ-dGg.mjs.map} +1 -1
- package/dist/{query-BxT95opY.mjs → query-DdFGHzQF.mjs} +3 -3
- package/dist/{query-BxT95opY.mjs.map → query-DdFGHzQF.mjs.map} +1 -1
- package/dist/{rate-limit-Cg4Rvc_-.mjs → rate-limit-D3IEiUi2.mjs} +2 -2
- package/dist/{rate-limit-Cg4Rvc_-.mjs.map → rate-limit-D3IEiUi2.mjs.map} +1 -1
- package/dist/{redirect-Ch3E98qZ.mjs → redirect-BoUac4NT.mjs} +10 -4
- package/dist/redirect-BoUac4NT.mjs.map +1 -0
- package/dist/{redirect-Ce_6Yb6z.mjs → redirect-Botom7X6.mjs} +1 -1
- package/dist/{redirect-Ce_6Yb6z.mjs.map → redirect-Botom7X6.mjs.map} +1 -1
- package/dist/{redirects-CXmVGRNZ.mjs → redirects-ChbpqKiS.mjs} +4 -4
- package/dist/{redirects-CXmVGRNZ.mjs.map → redirects-ChbpqKiS.mjs.map} +1 -1
- package/dist/{redirects-CeD7K7EX.mjs → redirects-D457qwt0.mjs} +10 -181
- package/dist/redirects-D457qwt0.mjs.map +1 -0
- package/dist/{registry-CyIXPi4E.mjs → registry-y21kjhfG.mjs} +97 -8
- package/dist/registry-y21kjhfG.mjs.map +1 -0
- package/dist/{relation-Ba68Tm4Z.mjs → relation-Du0r04E0.mjs} +3 -3
- package/dist/{relation-Ba68Tm4Z.mjs.map → relation-Du0r04E0.mjs.map} +1 -1
- package/dist/{relations-CbBpoOys.d.mts → relations-BKybBoOX.d.mts} +315 -9
- package/dist/relations-BKybBoOX.d.mts.map +1 -0
- package/dist/{relations-BmBmX4Eb.mjs → relations-CZMpBqEd.mjs} +3 -3
- package/dist/{relations-BmBmX4Eb.mjs.map → relations-CZMpBqEd.mjs.map} +1 -1
- package/dist/{relations-C8hVyEy0.mjs → relations-DtX1UMBH.mjs} +13 -7
- package/dist/relations-DtX1UMBH.mjs.map +1 -0
- package/dist/{request-meta-DCwktC5P.mjs → request-meta-DzXYYI-n.mjs} +2 -2
- package/dist/{request-meta-DCwktC5P.mjs.map → request-meta-DzXYYI-n.mjs.map} +1 -1
- package/dist/{resolve-Cd9dzclN.mjs → resolve-DFr4kq72.mjs} +2 -2
- package/dist/{resolve-Cd9dzclN.mjs.map → resolve-DFr4kq72.mjs.map} +1 -1
- package/dist/{runner-jt65bF7F.mjs → runner-BdeLEgad.mjs} +334 -200
- package/dist/runner-BdeLEgad.mjs.map +1 -0
- package/dist/{runner-CiNdIk3y.d.mts → runner-Dd8m8k9F.d.mts} +2 -2
- package/dist/{runner-CiNdIk3y.d.mts.map → runner-Dd8m8k9F.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -12
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +4 -4
- package/dist/{schema-DwjufZ1S.mjs → schema-BH8P8vaC.mjs} +3 -3
- package/dist/{schema-DwjufZ1S.mjs.map → schema-BH8P8vaC.mjs.map} +1 -1
- package/dist/scopes-DTIkIaGA.mjs +27 -0
- package/dist/scopes-DTIkIaGA.mjs.map +1 -0
- package/dist/{search-Cl875CVE.mjs → search-D-Yhpmvs.mjs} +8 -7
- package/dist/search-D-Yhpmvs.mjs.map +1 -0
- package/dist/{secrets-CO_bEmII.mjs → secrets-CQ-69kF9.mjs} +25 -19
- package/dist/secrets-CQ-69kF9.mjs.map +1 -0
- package/dist/{sections-DTKzgoiS.mjs → sections-CzVBAKjw.mjs} +3 -3
- package/dist/{sections-DTKzgoiS.mjs.map → sections-CzVBAKjw.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +20 -20
- package/dist/seo/index.d.mts +14 -3
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +17 -17
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-BjrbXAd_.mjs → seo-C3GDfT0V.mjs} +1 -1
- package/dist/{seo-BjrbXAd_.mjs.map → seo-C3GDfT0V.mjs.map} +1 -1
- package/dist/{seo-BLm6SXzS.mjs → seo-kJzVAmmu.mjs} +2 -2
- package/dist/{seo-BLm6SXzS.mjs.map → seo-kJzVAmmu.mjs.map} +1 -1
- package/dist/{service-D6zDmKXy.mjs → service-CQnc276a.mjs} +3 -3
- package/dist/{service-D6zDmKXy.mjs.map → service-CQnc276a.mjs.map} +1 -1
- package/dist/{session-user-DoSs6YM8.mjs → session-user-DbHqKDKe.mjs} +1 -1
- package/dist/{session-user-DoSs6YM8.mjs.map → session-user-DbHqKDKe.mjs.map} +1 -1
- package/dist/{settings-BuQYvLfy.mjs → settings-C2PaBS49.mjs} +4 -4
- package/dist/{settings-BuQYvLfy.mjs.map → settings-C2PaBS49.mjs.map} +1 -1
- package/dist/{settings-CmS3TwXf.mjs → settings-Dtc0DU31.mjs} +3 -3
- package/dist/{settings-CmS3TwXf.mjs.map → settings-Dtc0DU31.mjs.map} +1 -1
- package/dist/{setup-complete-BPNgLHlU.mjs → setup-complete-CdIlqloh.mjs} +1 -1
- package/dist/{setup-complete-BPNgLHlU.mjs.map → setup-complete-CdIlqloh.mjs.map} +1 -1
- package/dist/{setup-nonce-DEPZX96T.mjs → setup-nonce-DqiIPr-J.mjs} +1 -1
- package/dist/{setup-nonce-DEPZX96T.mjs.map → setup-nonce-DqiIPr-J.mjs.map} +1 -1
- package/dist/{single-flight-cache-DEtW-OEG.mjs → single-flight-cache-C2exrGAi.mjs} +1 -1
- package/dist/{single-flight-cache-DEtW-OEG.mjs.map → single-flight-cache-C2exrGAi.mjs.map} +1 -1
- package/dist/{site-url-CcLy5D5s.mjs → site-url-NGJT6NTU.mjs} +1 -1
- package/dist/{site-url-CcLy5D5s.mjs.map → site-url-NGJT6NTU.mjs.map} +1 -1
- package/dist/snapshot-BdpUJKD-.mjs +216 -0
- package/dist/snapshot-BdpUJKD-.mjs.map +1 -0
- package/dist/{ssrf-TrKYJAy0.mjs → ssrf-CviKqWmq.mjs} +1 -1
- package/dist/{ssrf-TrKYJAy0.mjs.map → ssrf-CviKqWmq.mjs.map} +1 -1
- package/dist/state-xxv6ZTMv.mjs +128 -0
- package/dist/state-xxv6ZTMv.mjs.map +1 -0
- package/dist/{status-D3Gy1Zc6.mjs → status-COfycGIU.mjs} +1 -1
- package/dist/{status-D3Gy1Zc6.mjs.map → status-COfycGIU.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-pUkuD6nj.mjs → taxonomies-HI9fnTdp.mjs} +8 -8
- package/dist/{taxonomies-pUkuD6nj.mjs.map → taxonomies-HI9fnTdp.mjs.map} +1 -1
- package/dist/{taxonomies-ClS4RKaZ.mjs → taxonomies-rMeBzOjX.mjs} +26 -17
- package/dist/taxonomies-rMeBzOjX.mjs.map +1 -0
- package/dist/{taxonomy-BkxbUMSw.mjs → taxonomy-0mCI25HN.mjs} +51 -13
- package/dist/taxonomy-0mCI25HN.mjs.map +1 -0
- package/dist/{tokens-BV6fgl5A.mjs → tokens-DVltpO2D.mjs} +2 -2
- package/dist/{tokens-BV6fgl5A.mjs.map → tokens-DVltpO2D.mjs.map} +1 -1
- package/dist/{transport-DTFhhPOg.mjs → transport-CKrlqSpD.mjs} +1 -1
- package/dist/{transport-DTFhhPOg.mjs.map → transport-CKrlqSpD.mjs.map} +1 -1
- package/dist/{transport-DmlmzD2U.d.mts → transport-Vd7VdqHv.d.mts} +1 -1
- package/dist/{transport-DmlmzD2U.d.mts.map → transport-Vd7VdqHv.d.mts.map} +1 -1
- package/dist/{trusted-proxy-CSgZVESw.mjs → trusted-proxy-CwjQj0YG.mjs} +1 -1
- package/dist/{trusted-proxy-CSgZVESw.mjs.map → trusted-proxy-CwjQj0YG.mjs.map} +1 -1
- package/dist/{types-B6-N9cBB.d.mts → types-B4vm81VH.d.mts} +1 -1
- package/dist/{types-B6-N9cBB.d.mts.map → types-B4vm81VH.d.mts.map} +1 -1
- package/dist/{types-Cm4Cz-8M.d.mts → types-B97jg3aW.d.mts} +6 -1
- package/dist/{types-Cm4Cz-8M.d.mts.map → types-B97jg3aW.d.mts.map} +1 -1
- package/dist/{types-BNZsPL9z.mjs → types-BD40g7zz.mjs} +1 -1
- package/dist/{types-BNZsPL9z.mjs.map → types-BD40g7zz.mjs.map} +1 -1
- package/dist/{types-QnlQIyPE.d.mts → types-BNfPHfay.d.mts} +1 -1
- package/dist/{types-QnlQIyPE.d.mts.map → types-BNfPHfay.d.mts.map} +1 -1
- package/dist/{types-DLIrNtv5.d.mts → types-BfYUPJdP.d.mts} +2 -2
- package/dist/{types-DLIrNtv5.d.mts.map → types-BfYUPJdP.d.mts.map} +1 -1
- package/dist/{types-CtDVagM4.d.mts → types-BvB7gDOD.d.mts} +38 -4
- package/dist/types-BvB7gDOD.d.mts.map +1 -0
- package/dist/{types-B_pmP7Yq.d.mts → types-C7U0HlEr.d.mts} +1 -1
- package/dist/{types-B_pmP7Yq.d.mts.map → types-C7U0HlEr.d.mts.map} +1 -1
- package/dist/{types-Ch8pFMEm.mjs → types-CrRUFdej.mjs} +3 -3
- package/dist/{types-Ch8pFMEm.mjs.map → types-CrRUFdej.mjs.map} +1 -1
- package/dist/{types-momGysZk.d.mts → types-DPKhI5ib.d.mts} +9 -1
- package/dist/types-DPKhI5ib.d.mts.map +1 -0
- package/dist/{types-BCVuUPrL.d.mts → types-Kmaxdarz.d.mts} +1 -1
- package/dist/{types-BCVuUPrL.d.mts.map → types-Kmaxdarz.d.mts.map} +1 -1
- package/dist/{types-qljd1hsL.d.mts → types-iVeZ5g6N.d.mts} +1 -1
- package/dist/{types-qljd1hsL.d.mts.map → types-iVeZ5g6N.d.mts.map} +1 -1
- package/dist/{user-DTxX_Fha.mjs → user-aTXqmXBz.mjs} +3 -3
- package/dist/{user-DTxX_Fha.mjs.map → user-aTXqmXBz.mjs.map} +1 -1
- package/dist/{utils-Cz8PVrl4.mjs → utils-BbUgmeZG.mjs} +1 -1
- package/dist/{utils-Cz8PVrl4.mjs.map → utils-BbUgmeZG.mjs.map} +1 -1
- package/dist/{validate-C3CpWlNt.mjs → validate-CDT1jl6_.mjs} +11 -6
- package/dist/validate-CDT1jl6_.mjs.map +1 -0
- package/dist/{validate-9jLuE301.d.mts → validate-DULfgpJP.d.mts} +5 -5
- package/dist/{validate-9jLuE301.d.mts.map → validate-DULfgpJP.d.mts.map} +1 -1
- package/dist/{validation-DM2K_NJC.mjs → validation-DlD0E35W.mjs} +10 -10
- package/dist/{validation-DM2K_NJC.mjs.map → validation-DlD0E35W.mjs.map} +1 -1
- package/dist/version-Ci6bw6YK.mjs +7 -0
- package/dist/{version-BlIJvNAZ.mjs.map → version-Ci6bw6YK.mjs.map} +1 -1
- package/dist/{widgets-B_X6_UXJ.mjs → widgets-5fipNkMT.mjs} +3 -3
- package/dist/{widgets-B_X6_UXJ.mjs.map → widgets-5fipNkMT.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-tADW4KTa.d.mts → wxr-taxonomies-B4tMuN5T.d.mts} +1 -1
- package/dist/{wxr-taxonomies-tADW4KTa.d.mts.map → wxr-taxonomies-B4tMuN5T.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-oNJB2S81.mjs → wxr-taxonomies-BmUnBNgz.mjs} +4 -4
- package/dist/{wxr-taxonomies-oNJB2S81.mjs.map → wxr-taxonomies-BmUnBNgz.mjs.map} +1 -1
- package/dist/{zod-generator-CrfV79De.mjs → zod-generator-CwkHWz4f.mjs} +2 -2
- package/dist/{zod-generator-CrfV79De.mjs.map → zod-generator-CwkHWz4f.mjs.map} +1 -1
- package/package.json +8 -8
- package/src/api/authorize.ts +10 -1
- package/src/api/error.ts +5 -5
- package/src/api/errors.ts +14 -0
- package/src/api/handlers/backup.ts +312 -0
- package/src/api/handlers/bylines.ts +5 -4
- package/src/api/handlers/content.ts +61 -9
- package/src/api/handlers/device-flow.ts +2 -3
- package/src/api/handlers/index.ts +16 -0
- package/src/api/handlers/marketplace.ts +38 -0
- package/src/api/handlers/media-upload.ts +210 -0
- package/src/api/handlers/media-usage.ts +211 -2
- package/src/api/handlers/menus.ts +11 -6
- package/src/api/handlers/oauth-authorization.ts +2 -6
- package/src/api/handlers/plugin-settings.ts +218 -0
- package/src/api/handlers/plugins.ts +41 -0
- package/src/api/handlers/registry.ts +39 -0
- package/src/api/handlers/relations.ts +7 -2
- package/src/api/handlers/snapshot.ts +21 -3
- package/src/api/handlers/taxonomies.ts +22 -14
- package/src/api/openapi/document.ts +48 -6
- package/src/api/parse.ts +1 -15
- package/src/api/public-url.ts +4 -2
- package/src/api/schemas/bylines.ts +4 -4
- package/src/api/schemas/common.ts +13 -8
- package/src/api/schemas/media-usage.ts +72 -0
- package/src/api/schemas/media.ts +32 -1
- package/src/api/schemas/menus.ts +2 -1
- package/src/api/schemas/relations.ts +3 -1
- package/src/api/schemas/taxonomies.ts +4 -2
- package/src/astro/integration/index.ts +38 -0
- package/src/astro/integration/routes.ts +35 -0
- package/src/astro/integration/runtime.ts +6 -0
- package/src/astro/integration/virtual-modules.ts +41 -7
- package/src/astro/integration/vite-config.ts +17 -1
- package/src/astro/middleware/auth.ts +70 -78
- package/src/astro/middleware/csp.ts +5 -2
- package/src/astro/middleware.ts +86 -31
- package/src/astro/public-plugin-api-routes.ts +2 -1
- package/src/astro/routes/PluginRegistry.tsx +5 -2
- package/src/astro/routes/admin.astro +56 -16
- package/src/astro/routes/api/admin/api-tokens/index.ts +2 -2
- package/src/astro/routes/api/admin/bylines/[id]/translations.ts +2 -5
- package/src/astro/routes/api/admin/bylines/index.ts +5 -8
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +6 -0
- package/src/astro/routes/api/admin/plugins/[id]/mcp.ts +42 -0
- package/src/astro/routes/api/admin/plugins/[id]/settings.ts +80 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +2 -0
- package/src/astro/routes/api/admin/plugins/index.ts +9 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +2 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +2 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +2 -0
- package/src/astro/routes/api/admin/plugins/updates.ts +2 -4
- package/src/astro/routes/api/auth/mode.ts +6 -14
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +21 -4
- package/src/astro/routes/api/auth/oauth/[provider].ts +24 -6
- package/src/astro/routes/api/content/[collection]/[id]/compare.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +2 -3
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +2 -3
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +4 -6
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/parents.ts +2 -3
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +4 -6
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id].ts +3 -4
- package/src/astro/routes/api/content/[collection]/authors.ts +2 -3
- package/src/astro/routes/api/content/[collection]/index.ts +6 -8
- package/src/astro/routes/api/content/[collection]/trash.ts +2 -3
- package/src/astro/routes/api/manifest.ts +2 -9
- package/src/astro/routes/api/mcp.ts +2 -1
- package/src/astro/routes/api/media/[id]/usage.ts +30 -0
- package/src/astro/routes/api/media/[id].ts +17 -6
- package/src/astro/routes/api/media/file/[...key].ts +8 -0
- package/src/astro/routes/api/media.ts +21 -2
- package/src/astro/routes/api/oauth/authorize.ts +43 -15
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +17 -3
- package/src/astro/routes/api/settings/backups/archives/[name].ts +78 -0
- package/src/astro/routes/api/settings/backups/archives/index.ts +33 -0
- package/src/astro/routes/api/settings/backups/export.ts +43 -0
- package/src/astro/routes/api/settings/backups/index.ts +76 -0
- package/src/astro/routes/api/setup/admin-verify.ts +8 -4
- package/src/astro/routes/api/setup/admin.ts +11 -4
- package/src/astro/routes/api/well-known/oauth-authorization-server.ts +4 -1
- package/src/astro/routes/api/well-known/oauth-protected-resource.ts +5 -1
- package/src/astro/types.ts +48 -2
- package/src/auth/api-tokens.ts +1 -0
- package/src/auth/oauth-state-store.ts +3 -0
- package/src/auth/providers/github-admin.tsx +5 -6
- package/src/auth/providers/google-admin.tsx +5 -6
- package/src/auth/scopes.ts +3 -9
- package/src/cli/client-factory.ts +0 -1
- package/src/cli/commands/bundle-utils.ts +50 -1
- package/src/cli/commands/bundle.ts +9 -2
- package/src/cli/commands/media.ts +127 -0
- package/src/client/index.ts +84 -2
- package/src/client/transport.ts +1 -1
- package/src/components/EmDashHead.astro +4 -8
- package/src/components/Gallery.astro +141 -26
- package/src/components/InlinePortableTextEditor.tsx +56 -35
- package/src/components/marks/Link.astro +5 -1
- package/src/config/secrets.ts +25 -19
- package/src/content/converters/gallery.ts +61 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +19 -0
- package/src/content/converters/prosemirror-to-portable-text.ts +18 -0
- package/src/content/converters/types.ts +36 -0
- package/src/database/dialect-helpers.ts +80 -7
- package/src/database/migrations/051_content_taxonomies_denorm.ts +120 -0
- package/src/database/migrations/052_media_usage_read_index.ts +26 -0
- package/src/database/migrations/053_plugin_mcp_tools.ts +21 -0
- package/src/database/migrations/runner.ts +6 -0
- package/src/database/pg-migration-lock.ts +1 -4
- package/src/database/repositories/audit.ts +2 -1
- package/src/database/repositories/content.ts +98 -16
- package/src/database/repositories/media-usage.ts +250 -1
- package/src/database/repositories/plugin-storage.ts +29 -32
- package/src/database/repositories/redirect.ts +14 -2
- package/src/database/repositories/taxonomy.ts +57 -8
- package/src/database/types.ts +23 -0
- package/src/db/adapters.ts +9 -0
- package/src/emdash-runtime.ts +365 -83
- package/src/i18n/config.ts +8 -0
- package/src/i18n/repair-locale-casing.ts +51 -0
- package/src/loader.ts +292 -1
- package/src/mcp/server.ts +222 -5
- package/src/media/image-endpoint.ts +38 -2
- package/src/page/metadata.ts +27 -0
- package/src/plugin-types.ts +19 -0
- package/src/plugin-utils.ts +8 -6
- package/src/plugins/adapt-sandbox-entry.ts +30 -1
- package/src/plugins/context.ts +7 -0
- package/src/plugins/define-plugin.ts +16 -0
- package/src/plugins/manifest-schema.ts +28 -1
- package/src/plugins/routes.ts +27 -1
- package/src/plugins/sandbox/runner-options.ts +16 -0
- package/src/plugins/sandbox/types.ts +6 -1
- package/src/plugins/state.ts +17 -1
- package/src/plugins/storage-query.ts +67 -33
- package/src/plugins/types.ts +41 -0
- package/src/schema/registry.ts +141 -5
- package/src/search/query.ts +3 -2
- package/src/seed/apply.ts +37 -36
- package/src/seed/validate.ts +15 -4
- package/src/seo/index.ts +19 -4
- package/src/storage/types.ts +6 -0
- package/src/utils/base64.ts +7 -2
- package/src/utils/db-errors.ts +3 -1
- package/src/virtual-modules.d.ts +13 -0
- package/src/visual-editing/toolbar.ts +1 -1
- package/dist/adapters-DPAkL6QF.d.mts.map +0 -1
- package/dist/api-DVbHNApo.mjs.map +0 -1
- package/dist/api-tokens-Dk2GrJMY.mjs +0 -3
- package/dist/apply-D23iUV4q.mjs.map +0 -1
- package/dist/authorize-BmCwQCib.mjs.map +0 -1
- package/dist/base64-C74Msx8h.mjs.map +0 -1
- package/dist/bylines-BGuKFaBy.mjs.map +0 -1
- package/dist/config-CVssduLe.mjs.map +0 -1
- package/dist/content-BO61Sx4j.mjs.map +0 -1
- package/dist/content-refresh-BkkApzeS.mjs.map +0 -1
- package/dist/context-DtSFYFuS.mjs.map +0 -1
- package/dist/db-errors-BKuXh_fi.mjs.map +0 -1
- package/dist/device-flow-CPXQ_QfW.mjs.map +0 -1
- package/dist/dialect-helpers-Cue7QQOR.mjs.map +0 -1
- package/dist/error-CfJMLSkd.mjs.map +0 -1
- package/dist/index-BXOCyLj0.d.mts.map +0 -1
- package/dist/loader-Rb8QlGZp.mjs.map +0 -1
- package/dist/manifest-schema-DeGNma2O.mjs.map +0 -1
- package/dist/menus-BpfevlJD.mjs.map +0 -1
- package/dist/menus-BtvH7Z7t.mjs.map +0 -1
- package/dist/oauth-authorization-BWqWTHBK.mjs.map +0 -1
- package/dist/public-url-C0cEvrRu.mjs.map +0 -1
- package/dist/redirect-Ch3E98qZ.mjs.map +0 -1
- package/dist/redirects-CeD7K7EX.mjs.map +0 -1
- package/dist/registry-CyIXPi4E.mjs.map +0 -1
- package/dist/relations-C8hVyEy0.mjs.map +0 -1
- package/dist/relations-CbBpoOys.d.mts.map +0 -1
- package/dist/runner-jt65bF7F.mjs.map +0 -1
- package/dist/scheduled-publish-DlJHGcuL.d.mts +0 -11
- package/dist/scheduled-publish-DlJHGcuL.d.mts.map +0 -1
- package/dist/search-Cl875CVE.mjs.map +0 -1
- package/dist/secrets-CO_bEmII.mjs.map +0 -1
- package/dist/taxonomies-ClS4RKaZ.mjs.map +0 -1
- package/dist/taxonomy-BkxbUMSw.mjs.map +0 -1
- package/dist/types-CtDVagM4.d.mts.map +0 -1
- package/dist/types-momGysZk.d.mts.map +0 -1
- package/dist/validate-C3CpWlNt.mjs.map +0 -1
- package/dist/version-BlIJvNAZ.mjs +0 -7
- /package/dist/{ssrf-B5DOv5E5.mjs → ssrf-BB__xfNM.mjs} +0 -0
- /package/dist/{types-DeCZBZxn.mjs → types-CK0LxPUQ.mjs} +0 -0
|
@@ -1,84 +1,90 @@
|
|
|
1
|
-
import { a as runMigrations, n as MIGRATION_RACE_WAIT_MS, t as ConcurrentMigrationTimeoutError } from "../runner-
|
|
1
|
+
import { a as runMigrations, n as MIGRATION_RACE_WAIT_MS, t as ConcurrentMigrationTimeoutError } from "../runner-BdeLEgad.mjs";
|
|
2
2
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
3
|
-
import { s as isSqlite } from "../dialect-helpers-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { c as listTablesLike, s as isSqlite } from "../dialect-helpers-BtOwo2us.mjs";
|
|
4
|
+
import { a as setI18nConfig, n as getI18nConfig } from "../config-B6b_BobR.mjs";
|
|
5
|
+
import { E as AuditRepository, _ as createHookPipeline, h as EmailPipeline, m as buildRouteMeta, p as PluginRouteRegistry, t as getMenu, v as resolveExclusiveHooks, y as definePlugin } from "../menus-CPf_SW7u.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-Bok5j2ae.mjs";
|
|
9
|
-
import { r as RevisionRepository, t as ContentRepository } from "../content-
|
|
10
|
-
import { n as isMissingTableError } from "../db-errors-
|
|
11
|
-
import "../base64-
|
|
12
|
-
import "../types-
|
|
13
|
-
import { t as MediaRepository } from "../media-
|
|
14
|
-
import "../user-
|
|
15
|
-
import "../taxonomy-
|
|
16
|
-
import "../comment-
|
|
9
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-BC43pICM.mjs";
|
|
10
|
+
import { n as isMissingTableError } from "../db-errors-CcWLaRiR.mjs";
|
|
11
|
+
import "../base64-B-PsqheR.mjs";
|
|
12
|
+
import "../types-CrRUFdej.mjs";
|
|
13
|
+
import { t as MediaRepository } from "../media-its1WLYv.mjs";
|
|
14
|
+
import "../user-aTXqmXBz.mjs";
|
|
15
|
+
import "../taxonomy-0mCI25HN.mjs";
|
|
16
|
+
import "../comment-B9cUud8H.mjs";
|
|
17
17
|
import { t as OptionsRepository } from "../options-BlmBHTvX.mjs";
|
|
18
|
-
import "../context-
|
|
19
|
-
import "../menus-
|
|
20
|
-
import "../redirect-
|
|
18
|
+
import { r as createSiteInfo } from "../context-DOurRIrb.mjs";
|
|
19
|
+
import "../menus-BMGzWyWH.mjs";
|
|
20
|
+
import "../redirect-BoUac4NT.mjs";
|
|
21
21
|
import { i as setRequestCacheEntry, r as requestCached } from "../request-cache-BSUptuJR.mjs";
|
|
22
22
|
import "../byline-registry-BCuOp4UF.mjs";
|
|
23
23
|
import { n as initWithLock, t as createInitLock } from "../init-lock-DJkX6Hto.mjs";
|
|
24
|
-
import "../field-defs-cache-
|
|
25
|
-
import "../byline-
|
|
26
|
-
import "../relation-
|
|
24
|
+
import "../field-defs-cache-KfNJ_qLQ.mjs";
|
|
25
|
+
import "../byline-BTOxUlFF.mjs";
|
|
26
|
+
import "../relation-Du0r04E0.mjs";
|
|
27
27
|
import { n as normalizeMediaValue } from "../normalize-C-SHXmra.mjs";
|
|
28
28
|
import "../enrich-CFJJgxs_.mjs";
|
|
29
|
-
import "../seo-
|
|
30
|
-
import { t as FTSManager } from "../fts-manager-
|
|
31
|
-
import "../resolve-
|
|
29
|
+
import "../seo-kJzVAmmu.mjs";
|
|
30
|
+
import { t as FTSManager } from "../fts-manager-hyCU9OOp.mjs";
|
|
31
|
+
import "../resolve-DFr4kq72.mjs";
|
|
32
32
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
33
|
-
import { a as getDb } from "../loader-
|
|
34
|
-
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-
|
|
35
|
-
import { $ as
|
|
36
|
-
import "../dashboard-
|
|
33
|
+
import { a as getDb } from "../loader-D4rigvjR.mjs";
|
|
34
|
+
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-HI9fnTdp.mjs";
|
|
35
|
+
import { $ as handleContentDiscardDraft, B as handleMediaGet, G as handleRevisionRestore, H as handleMediaUpdate, J as handleContentCompare, Q as handleContentDelete, R as handleMediaCreate, U as handleRevisionGet, V as handleMediaList, W as handleRevisionList, X as handleContentCountTrashed, Y as handleContentCountScheduled, Z as handleContentCreate, _ as loadBundleFromR2, at as handleContentPermanentDelete, ct as handleContentSchedule, dt as handleContentUnschedule, et as handleContentDuplicate, ft as handleContentUpdate, it as handleContentListTrashed, lt as handleContentTranslations, nt as handleContentGetIncludingTrashed, ot as handleContentPublish, pt as validateRev, q as handleContentAuthors, rt as handleContentList, s as normalizeRegistryConfig, st as handleContentRestore, tt as handleContentGet, ut as handleContentUnpublish, z as handleMediaDelete } from "../api-EibxGP-V.mjs";
|
|
36
|
+
import "../dashboard-CBm4zhc3.mjs";
|
|
37
37
|
import { n as hashString } from "../hash-DFFrkivP.mjs";
|
|
38
|
-
import { a as findNonTranslatableSiblingContentIds, c as refreshContentMediaUsageAfterWrite, o as markContentMediaUsageCollectionStale, r as deleteContentMediaUsage } from "../content-refresh-
|
|
39
|
-
import "../media-usage-
|
|
40
|
-
import "../
|
|
41
|
-
import
|
|
42
|
-
import "../
|
|
43
|
-
import "../
|
|
44
|
-
import "../
|
|
45
|
-
import "../
|
|
46
|
-
import "../sections-
|
|
47
|
-
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-
|
|
48
|
-
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-
|
|
49
|
-
import "../settings-
|
|
50
|
-
import "../taxonomies-
|
|
51
|
-
import { r as normalizeManifestRoute } from "../manifest-schema-
|
|
52
|
-
import "../types-
|
|
53
|
-
import "../ssrf-
|
|
54
|
-
import "../
|
|
55
|
-
import "../
|
|
56
|
-
import "../
|
|
57
|
-
import "../
|
|
58
|
-
import
|
|
59
|
-
import "../
|
|
60
|
-
import {
|
|
61
|
-
import
|
|
62
|
-
import "../
|
|
63
|
-
import { n as
|
|
64
|
-
import
|
|
65
|
-
import "../
|
|
66
|
-
import "../
|
|
67
|
-
import "../
|
|
68
|
-
import "../
|
|
69
|
-
import "../
|
|
70
|
-
import "../
|
|
71
|
-
import
|
|
72
|
-
import "../
|
|
73
|
-
import "../
|
|
74
|
-
import "../
|
|
38
|
+
import { a as findNonTranslatableSiblingContentIds, c as refreshContentMediaUsageAfterWrite, o as markContentMediaUsageCollectionStale, r as deleteContentMediaUsage } from "../content-refresh-CPMSauD3.mjs";
|
|
39
|
+
import "../media-usage-DPQ3K4xB.mjs";
|
|
40
|
+
import { n as SchemaRegistry } from "../registry-y21kjhfG.mjs";
|
|
41
|
+
import "../query-DdFGHzQF.mjs";
|
|
42
|
+
import "../zod-generator-CwkHWz4f.mjs";
|
|
43
|
+
import "../schema-BH8P8vaC.mjs";
|
|
44
|
+
import "../seo-C3GDfT0V.mjs";
|
|
45
|
+
import { t as PluginStateRepository } from "../state-xxv6ZTMv.mjs";
|
|
46
|
+
import "../sections-CzVBAKjw.mjs";
|
|
47
|
+
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-C2exrGAi.mjs";
|
|
48
|
+
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-C2PaBS49.mjs";
|
|
49
|
+
import "../settings-Dtc0DU31.mjs";
|
|
50
|
+
import "../taxonomies-rMeBzOjX.mjs";
|
|
51
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-bCq54i7F.mjs";
|
|
52
|
+
import "../types-CK0LxPUQ.mjs";
|
|
53
|
+
import "../ssrf-CviKqWmq.mjs";
|
|
54
|
+
import "../error-DJ98TRbQ.mjs";
|
|
55
|
+
import "../parse-53zyxlpv.mjs";
|
|
56
|
+
import "../media-BJ6SRY3g.mjs";
|
|
57
|
+
import "../redirects-D457qwt0.mjs";
|
|
58
|
+
import "../relations-CZMpBqEd.mjs";
|
|
59
|
+
import "../status-COfycGIU.mjs";
|
|
60
|
+
import { a as invalidateUrlPatternCache } from "../query-BbJQ-dGg.mjs";
|
|
61
|
+
import "../import-oDYCgNYQ.mjs";
|
|
62
|
+
import { t as getTrustedProxyHeaders } from "../trusted-proxy-CwjQj0YG.mjs";
|
|
63
|
+
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-DzXYYI-n.mjs";
|
|
64
|
+
import "../ssrf-BB__xfNM.mjs";
|
|
65
|
+
import { n as CronExecutor } from "../cron-BlKIMD_e.mjs";
|
|
66
|
+
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-C-9Ng8DM.mjs";
|
|
67
|
+
import "../utils-BbUgmeZG.mjs";
|
|
68
|
+
import "../tokens-DVltpO2D.mjs";
|
|
69
|
+
import "../preview-D4Jnbfx7.mjs";
|
|
70
|
+
import "../hreflang-CbYeCzl9.mjs";
|
|
71
|
+
import "../comment-reaction-VUXO981F.mjs";
|
|
72
|
+
import "../bylines-FyZu6TbJ.mjs";
|
|
73
|
+
import { n as getWidgetAreas } from "../widgets-5fipNkMT.mjs";
|
|
74
|
+
import "../apply-fGHCAwWN.mjs";
|
|
75
|
+
import "../load-Dg5gtWma.mjs";
|
|
76
|
+
import "../search-D-Yhpmvs.mjs";
|
|
75
77
|
import "../index.mjs";
|
|
76
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
77
|
-
import { t as getAuthMode } from "../mode-
|
|
78
|
-
import
|
|
79
|
-
import {
|
|
80
|
-
import { t as
|
|
78
|
+
import { n as VERSION, t as COMMIT } from "../version-Ci6bw6YK.mjs";
|
|
79
|
+
import { t as getAuthMode } from "../mode-fiXRMfeA.mjs";
|
|
80
|
+
import "../snapshot-BdpUJKD-.mjs";
|
|
81
|
+
import { u as maybeRunScheduledBackup } from "../backup-Qr9PaGUo.mjs";
|
|
82
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-BFzgFRog.mjs";
|
|
83
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-CQ-69kF9.mjs";
|
|
84
|
+
import { t as resolveSessionUser } from "../session-user-DbHqKDKe.mjs";
|
|
81
85
|
import { Kysely, sql } from "kysely";
|
|
86
|
+
import { z } from "zod";
|
|
87
|
+
import { Permissions } from "@emdash-cms/auth";
|
|
82
88
|
import { defineMiddleware } from "astro:middleware";
|
|
83
89
|
import virtualConfig from "virtual:emdash/config";
|
|
84
90
|
import { createCoalescingDialect, createDialect, createRequestScopedDb } from "virtual:emdash/dialect";
|
|
@@ -90,6 +96,62 @@ import { createScheduler } from "virtual:emdash/scheduler";
|
|
|
90
96
|
import { createStorage } from "virtual:emdash/storage";
|
|
91
97
|
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
|
|
92
98
|
|
|
99
|
+
//#region src/i18n/repair-locale-casing.ts
|
|
100
|
+
/** Rewrite stored locales to the exact casing used by the site configuration. */
|
|
101
|
+
async function repairLocaleCasing(db, configuredLocales) {
|
|
102
|
+
const tableNames = await listTablesLike(db, "ec_%");
|
|
103
|
+
for (const tableName of tableNames) {
|
|
104
|
+
const table = sql.ref(tableName);
|
|
105
|
+
const slug = tableName.slice(3);
|
|
106
|
+
for (const locale of configuredLocales) {
|
|
107
|
+
await sql`
|
|
108
|
+
UPDATE ${table} AS target
|
|
109
|
+
SET locale = ${locale}
|
|
110
|
+
WHERE lower(target.locale) = lower(${locale})
|
|
111
|
+
AND target.locale != ${locale}
|
|
112
|
+
AND NOT EXISTS (
|
|
113
|
+
SELECT 1
|
|
114
|
+
FROM ${table} AS existing
|
|
115
|
+
WHERE existing.slug = target.slug AND existing.locale = ${locale}
|
|
116
|
+
)
|
|
117
|
+
AND target.id = (
|
|
118
|
+
SELECT MIN(candidate.id)
|
|
119
|
+
FROM ${table} AS candidate
|
|
120
|
+
WHERE candidate.slug = target.slug
|
|
121
|
+
AND lower(candidate.locale) = lower(${locale})
|
|
122
|
+
AND candidate.locale != ${locale}
|
|
123
|
+
)
|
|
124
|
+
`.execute(db);
|
|
125
|
+
await sql`
|
|
126
|
+
UPDATE content_taxonomies AS pivot
|
|
127
|
+
SET locale = ${locale}
|
|
128
|
+
WHERE pivot.collection = ${slug}
|
|
129
|
+
AND lower(pivot.locale) = lower(${locale})
|
|
130
|
+
AND pivot.locale != ${locale}
|
|
131
|
+
AND EXISTS (
|
|
132
|
+
SELECT 1
|
|
133
|
+
FROM ${table} AS content
|
|
134
|
+
WHERE content.id = pivot.entry_id AND content.locale = ${locale}
|
|
135
|
+
)
|
|
136
|
+
`.execute(db);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/plugins/sandbox/runner-options.ts
|
|
143
|
+
/**
|
|
144
|
+
* Build platform sandbox options with the same normalized site context used
|
|
145
|
+
* by trusted plugin hooks and routes.
|
|
146
|
+
*/
|
|
147
|
+
function createSandboxRunnerOptions(options, siteInfo) {
|
|
148
|
+
return {
|
|
149
|
+
...options,
|
|
150
|
+
siteInfo: createSiteInfo(siteInfo ?? {})
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
93
155
|
//#region src/cleanup.ts
|
|
94
156
|
/**
|
|
95
157
|
* System cleanup
|
|
@@ -276,7 +338,20 @@ async function publishDueContent(db, options = {}) {
|
|
|
276
338
|
|
|
277
339
|
//#endregion
|
|
278
340
|
//#region src/emdash-runtime.ts
|
|
341
|
+
/**
|
|
342
|
+
* EmDashRuntime - Core runtime for EmDash CMS
|
|
343
|
+
*
|
|
344
|
+
* Manages database, storage, plugins (trusted + sandboxed), hooks, and
|
|
345
|
+
* provides handlers for content/media operations.
|
|
346
|
+
*
|
|
347
|
+
* Created once per worker lifetime, cached and reused across requests.
|
|
348
|
+
*/
|
|
279
349
|
const LEADING_SLASH_PATTERN = /^\//;
|
|
350
|
+
const LOCALE_CASING_REPAIR_OPTION = "emdash:repair_locale_casing";
|
|
351
|
+
function getLocaleCasingRepairVersion(locales) {
|
|
352
|
+
if (locales.length === 0) return null;
|
|
353
|
+
return `1:${locales.toSorted().join(",")}`;
|
|
354
|
+
}
|
|
280
355
|
/**
|
|
281
356
|
* Parse a JSON column expected to contain an array of strings.
|
|
282
357
|
*
|
|
@@ -578,6 +653,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
578
653
|
} catch (error) {
|
|
579
654
|
console.error("[cleanup] System cleanup failed:", error);
|
|
580
655
|
}
|
|
656
|
+
await maybeRunScheduledBackup(this.db, this.storage ?? void 0);
|
|
581
657
|
return { published };
|
|
582
658
|
}
|
|
583
659
|
/**
|
|
@@ -618,10 +694,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
618
694
|
const newPipeline = createHookPipeline(this.allPipelinePlugins.filter((p) => this.enabledPlugins.has(p.id)), this.pipelineFactoryOptions);
|
|
619
695
|
await EmDashRuntime.resolveExclusiveHooks(newPipeline, this.db, this.runtimeDeps);
|
|
620
696
|
if (this.email) newPipeline.setContextFactory({ emailPipeline: this.email });
|
|
621
|
-
|
|
622
|
-
const scheduler = this.cronScheduler;
|
|
623
|
-
newPipeline.setContextFactory({ cronReschedule: () => scheduler.reschedule() });
|
|
624
|
-
}
|
|
697
|
+
newPipeline.setContextFactory({ cronReschedule: () => this.cronScheduler?.reschedule() });
|
|
625
698
|
if (this.email) this.email.setPipeline(newPipeline);
|
|
626
699
|
this.pipelineRef.current = newPipeline;
|
|
627
700
|
this._hooks = newPipeline;
|
|
@@ -723,13 +796,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
723
796
|
marketplaceManifestCache.set(pluginId, {
|
|
724
797
|
id: bundle.manifest.id,
|
|
725
798
|
version: bundle.manifest.version,
|
|
726
|
-
admin: bundle.manifest.admin
|
|
799
|
+
admin: bundle.manifest.admin,
|
|
800
|
+
mcp: bundle.manifest.mcp
|
|
727
801
|
});
|
|
728
802
|
if (bundle.manifest.routes.length > 0) {
|
|
729
803
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
730
804
|
for (const entry of bundle.manifest.routes) {
|
|
731
805
|
const normalized = normalizeManifestRoute(entry);
|
|
732
|
-
routeMetaMap.set(normalized.name,
|
|
806
|
+
routeMetaMap.set(normalized.name, buildRouteMeta(normalized));
|
|
733
807
|
}
|
|
734
808
|
sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
|
|
735
809
|
} else sandboxedRouteMetaCache.delete(pluginId);
|
|
@@ -807,13 +881,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
807
881
|
marketplaceManifestCache.set(pluginId, {
|
|
808
882
|
id: bundle.manifest.id,
|
|
809
883
|
version: bundle.manifest.version,
|
|
810
|
-
admin: bundle.manifest.admin
|
|
884
|
+
admin: bundle.manifest.admin,
|
|
885
|
+
mcp: bundle.manifest.mcp
|
|
811
886
|
});
|
|
812
887
|
if (bundle.manifest.routes.length > 0) {
|
|
813
888
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
814
889
|
for (const entry of bundle.manifest.routes) {
|
|
815
890
|
const normalized = normalizeManifestRoute(entry);
|
|
816
|
-
routeMetaMap.set(normalized.name,
|
|
891
|
+
routeMetaMap.set(normalized.name, buildRouteMeta(normalized));
|
|
817
892
|
}
|
|
818
893
|
sandboxedRouteMetaCache.set(pluginId, routeMetaMap);
|
|
819
894
|
} else sandboxedRouteMetaCache.delete(pluginId);
|
|
@@ -834,7 +909,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
834
909
|
id: w.id,
|
|
835
910
|
title: w.title,
|
|
836
911
|
size: w.size === "full" || w.size === "half" || w.size === "third" ? w.size : void 0
|
|
837
|
-
}))
|
|
912
|
+
})),
|
|
913
|
+
settingsSchema: bundle.manifest.admin?.settingsSchema
|
|
838
914
|
});
|
|
839
915
|
newPlugins.push(adapted);
|
|
840
916
|
this.allPipelinePlugins.push(adapted);
|
|
@@ -873,6 +949,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
873
949
|
await phase("rt.secrets", "Validate encryption key", () => validateEncryptionKeyAtStartup());
|
|
874
950
|
const storage = EmDashRuntime.getStorage(deps);
|
|
875
951
|
let pluginStates = /* @__PURE__ */ new Map();
|
|
952
|
+
const configuredLocales = virtualConfig?.i18n?.locales ?? getI18nConfig()?.locales ?? [];
|
|
953
|
+
const localeCasingRepairVersion = getLocaleCasingRepairVersion(configuredLocales);
|
|
954
|
+
let storedLocaleCasingRepairVersion;
|
|
876
955
|
let siteInfo;
|
|
877
956
|
let seedGate = {
|
|
878
957
|
collectionCount: 1,
|
|
@@ -899,12 +978,15 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
899
978
|
const siteOpts = await optionsRepo.getMany([
|
|
900
979
|
"emdash:site_title",
|
|
901
980
|
"emdash:site_url",
|
|
902
|
-
"emdash:locale"
|
|
981
|
+
"emdash:locale",
|
|
982
|
+
LOCALE_CASING_REPAIR_OPTION
|
|
903
983
|
]);
|
|
984
|
+
storedLocaleCasingRepairVersion = siteOpts.get(LOCALE_CASING_REPAIR_OPTION);
|
|
904
985
|
return {
|
|
905
986
|
siteName: siteOpts.get("emdash:site_title") ?? void 0,
|
|
906
987
|
siteUrl: siteOpts.get("emdash:site_url") ?? void 0,
|
|
907
|
-
locale: siteOpts.get("emdash:locale") ?? void 0
|
|
988
|
+
locale: siteOpts.get("emdash:locale") ?? void 0,
|
|
989
|
+
trailingSlash: virtualConfig?.trailingSlash
|
|
908
990
|
};
|
|
909
991
|
};
|
|
910
992
|
const coldStartReads = [phase("rt.plugins", "Plugin states", async () => {
|
|
@@ -934,14 +1016,18 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
934
1016
|
} catch {}
|
|
935
1017
|
}));
|
|
936
1018
|
await Promise.all(coldStartReads);
|
|
1019
|
+
if (localeCasingRepairVersion && (configuredLocales.some((locale) => locale.includes("-") || locale !== locale.toLowerCase()) || storedLocaleCasingRepairVersion !== void 0) && storedLocaleCasingRepairVersion !== localeCasingRepairVersion) await phase("rt.locale", "Repair locale casing", async () => {
|
|
1020
|
+
await repairLocaleCasing(db, configuredLocales);
|
|
1021
|
+
await new OptionsRepository(db).set(LOCALE_CASING_REPAIR_OPTION, localeCasingRepairVersion);
|
|
1022
|
+
});
|
|
937
1023
|
if (seedGate.collectionCount === 0 && !seedGate.setupDone) {
|
|
938
1024
|
const seedKey = deps.config.database?.entrypoint ?? "default";
|
|
939
1025
|
const seedHolder = getSeedHolder();
|
|
940
1026
|
try {
|
|
941
1027
|
await initWithLock(seedHolder.lock, () => seedHolder.done.has(seedKey) ? true : void 0, async () => {
|
|
942
|
-
const { applySeed } = await import("../apply-
|
|
943
|
-
const { loadSeed } = await import("../load-
|
|
944
|
-
const { validateSeed } = await import("../validate-
|
|
1028
|
+
const { applySeed } = await import("../apply-fGHCAwWN.mjs").then((n) => n.n);
|
|
1029
|
+
const { loadSeed } = await import("../load-Dg5gtWma.mjs").then((n) => n.r);
|
|
1030
|
+
const { validateSeed } = await import("../validate-CDT1jl6_.mjs").then((n) => n.n);
|
|
945
1031
|
const seed = await loadSeed();
|
|
946
1032
|
if (validateSeed(seed).valid) {
|
|
947
1033
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -1026,10 +1112,10 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1026
1112
|
siteInfo
|
|
1027
1113
|
};
|
|
1028
1114
|
const pipeline = createHookPipeline(enabledPluginList, pipelineFactoryOptions);
|
|
1029
|
-
const sandboxedPlugins = await phase("rt.sandbox", "Sandboxed plugins", () => EmDashRuntime.loadSandboxedPlugins(deps, db, storage));
|
|
1115
|
+
const sandboxedPlugins = await phase("rt.sandbox", "Sandboxed plugins", () => EmDashRuntime.loadSandboxedPlugins(deps, db, storage, siteInfo));
|
|
1030
1116
|
const installedTierPhases = [];
|
|
1031
|
-
if (deps.config.marketplace && storage && !deps.sandboxBypassed) installedTierPhases.push(phase("rt.market", "Marketplace plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("marketplace", db, storage, deps, sandboxedPlugins)));
|
|
1032
|
-
if (deps.config.experimental?.registry && storage) installedTierPhases.push(phase("rt.registry", "Registry plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("registry", db, storage, deps, sandboxedPlugins)));
|
|
1117
|
+
if (deps.config.marketplace && storage && !deps.sandboxBypassed) installedTierPhases.push(phase("rt.market", "Marketplace plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("marketplace", db, storage, deps, sandboxedPlugins, siteInfo)));
|
|
1118
|
+
if (deps.config.experimental?.registry && storage) installedTierPhases.push(phase("rt.registry", "Registry plugins", () => EmDashRuntime.loadInstalledSandboxedPlugins("registry", db, storage, deps, sandboxedPlugins, siteInfo)));
|
|
1033
1119
|
if (installedTierPhases.length > 0) await Promise.all(installedTierPhases);
|
|
1034
1120
|
const mediaProviders = /* @__PURE__ */ new Map();
|
|
1035
1121
|
const mediaProviderEntries = deps.mediaProviderEntries ?? [];
|
|
@@ -1059,6 +1145,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1059
1145
|
await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
|
|
1060
1146
|
try {
|
|
1061
1147
|
cronExecutor = new CronExecutor(resolveDb, invokeCronHook);
|
|
1148
|
+
pipeline.setContextFactory({ cronReschedule: () => cronScheduler?.reschedule() });
|
|
1062
1149
|
const executorForRecovery = cronExecutor;
|
|
1063
1150
|
after(async () => {
|
|
1064
1151
|
try {
|
|
@@ -1083,8 +1170,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1083
1170
|
} catch (error) {
|
|
1084
1171
|
console.error("[cleanup] System cleanup failed:", error);
|
|
1085
1172
|
}
|
|
1173
|
+
await maybeRunScheduledBackup(db, storage ?? void 0);
|
|
1086
1174
|
});
|
|
1087
|
-
pipeline.setContextFactory({ cronReschedule: () => cronScheduler?.reschedule() });
|
|
1088
1175
|
scheduler.start();
|
|
1089
1176
|
}
|
|
1090
1177
|
} catch (error) {
|
|
@@ -1225,6 +1312,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1225
1312
|
storage: entry.storage,
|
|
1226
1313
|
adminPages,
|
|
1227
1314
|
adminWidgets,
|
|
1315
|
+
settingsSchema: entry.settingsSchema,
|
|
1228
1316
|
portableTextBlocks: entry.portableTextBlocks,
|
|
1229
1317
|
fieldWidgets: entry.fieldWidgets
|
|
1230
1318
|
});
|
|
@@ -1238,10 +1326,10 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1238
1326
|
/**
|
|
1239
1327
|
* Load sandboxed plugins using SandboxRunner
|
|
1240
1328
|
*/
|
|
1241
|
-
static async loadSandboxedPlugins(deps, db, mediaStorage) {
|
|
1329
|
+
static async loadSandboxedPlugins(deps, db, mediaStorage, siteInfo) {
|
|
1242
1330
|
if (sandboxedPluginCache.size > 0) return sandboxedPluginCache;
|
|
1243
1331
|
if (!deps.sandboxEnabled) return sandboxedPluginCache;
|
|
1244
|
-
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner({
|
|
1332
|
+
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner(createSandboxRunnerOptions({
|
|
1245
1333
|
db,
|
|
1246
1334
|
mediaStorage: mediaStorage ? {
|
|
1247
1335
|
upload: (opts) => mediaStorage.upload({
|
|
@@ -1251,7 +1339,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1251
1339
|
}),
|
|
1252
1340
|
delete: (key) => mediaStorage.delete(key)
|
|
1253
1341
|
} : void 0
|
|
1254
|
-
});
|
|
1342
|
+
}, siteInfo));
|
|
1255
1343
|
if (!sandboxRunner) return sandboxedPluginCache;
|
|
1256
1344
|
if (!sandboxRunner.isAvailable()) {
|
|
1257
1345
|
console.warn("EmDash: Plugin sandbox is configured but not available on this platform. Sandboxed plugins will not be loaded. If using @emdash-cms/sandbox-workerd/sandbox, ensure workerd is installed.");
|
|
@@ -1271,7 +1359,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1271
1359
|
storage: entry.storage ?? {},
|
|
1272
1360
|
hooks: [],
|
|
1273
1361
|
routes: [],
|
|
1274
|
-
admin: {}
|
|
1362
|
+
admin: {},
|
|
1363
|
+
mcp: entry.mcp
|
|
1275
1364
|
};
|
|
1276
1365
|
const plugin = await sandboxRunner.load(manifest, entry.code);
|
|
1277
1366
|
sandboxedPluginCache.set(pluginKey, plugin);
|
|
@@ -1296,8 +1385,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1296
1385
|
* creation, before request traffic arrives; the sync method runs on
|
|
1297
1386
|
* demand after install / update / uninstall handlers.
|
|
1298
1387
|
*/
|
|
1299
|
-
static async loadInstalledSandboxedPlugins(source, db, storage, deps, cache) {
|
|
1300
|
-
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner({
|
|
1388
|
+
static async loadInstalledSandboxedPlugins(source, db, storage, deps, cache, siteInfo) {
|
|
1389
|
+
if (!sandboxRunner && deps.createSandboxRunner) sandboxRunner = deps.createSandboxRunner(createSandboxRunnerOptions({
|
|
1301
1390
|
db,
|
|
1302
1391
|
mediaStorage: {
|
|
1303
1392
|
upload: (opts) => storage.upload({
|
|
@@ -1307,7 +1396,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1307
1396
|
}),
|
|
1308
1397
|
delete: (key) => storage.delete(key)
|
|
1309
1398
|
}
|
|
1310
|
-
});
|
|
1399
|
+
}, siteInfo));
|
|
1311
1400
|
if (deps.sandboxBypassed) return;
|
|
1312
1401
|
if (!sandboxRunner || !sandboxRunner.isAvailable()) return;
|
|
1313
1402
|
const keySet = source === "marketplace" ? marketplacePluginKeys : registryPluginKeys;
|
|
@@ -1331,13 +1420,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1331
1420
|
marketplaceManifestCache.set(plugin.pluginId, {
|
|
1332
1421
|
id: bundle.manifest.id,
|
|
1333
1422
|
version: bundle.manifest.version,
|
|
1334
|
-
admin: bundle.manifest.admin
|
|
1423
|
+
admin: bundle.manifest.admin,
|
|
1424
|
+
mcp: bundle.manifest.mcp
|
|
1335
1425
|
});
|
|
1336
1426
|
if (bundle.manifest.routes.length > 0) {
|
|
1337
1427
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
1338
1428
|
for (const entry of bundle.manifest.routes) {
|
|
1339
1429
|
const normalized = normalizeManifestRoute(entry);
|
|
1340
|
-
routeMeta.set(normalized.name,
|
|
1430
|
+
routeMeta.set(normalized.name, buildRouteMeta(normalized));
|
|
1341
1431
|
}
|
|
1342
1432
|
sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
|
|
1343
1433
|
}
|
|
@@ -1380,13 +1470,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1380
1470
|
marketplaceManifestCache.set(plugin.pluginId, {
|
|
1381
1471
|
id: bundle.manifest.id,
|
|
1382
1472
|
version: bundle.manifest.version,
|
|
1383
|
-
admin: bundle.manifest.admin
|
|
1473
|
+
admin: bundle.manifest.admin,
|
|
1474
|
+
mcp: bundle.manifest.mcp
|
|
1384
1475
|
});
|
|
1385
1476
|
if (bundle.manifest.routes.length > 0) {
|
|
1386
1477
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
1387
1478
|
for (const entry of bundle.manifest.routes) {
|
|
1388
1479
|
const normalized = normalizeManifestRoute(entry);
|
|
1389
|
-
routeMeta.set(normalized.name,
|
|
1480
|
+
routeMeta.set(normalized.name, buildRouteMeta(normalized));
|
|
1390
1481
|
}
|
|
1391
1482
|
sandboxedRouteMetaCache.set(plugin.pluginId, routeMeta);
|
|
1392
1483
|
}
|
|
@@ -1403,7 +1494,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1403
1494
|
id: w.id,
|
|
1404
1495
|
title: w.title,
|
|
1405
1496
|
size: w.size === "full" || w.size === "half" || w.size === "third" ? w.size : void 0
|
|
1406
|
-
}))
|
|
1497
|
+
})),
|
|
1498
|
+
settingsSchema: bundle.manifest.admin?.settingsSchema
|
|
1407
1499
|
});
|
|
1408
1500
|
resolved.push(adapted);
|
|
1409
1501
|
console.log(`EmDash: Loaded marketplace plugin ${plugin.pluginId}@${version} in-process (sandbox bypassed)`);
|
|
@@ -1695,7 +1787,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1695
1787
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1696
1788
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1697
1789
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1698
|
-
const { validateContentData } = await import("../validation-
|
|
1790
|
+
const { validateContentData } = await import("../validation-DlD0E35W.mjs");
|
|
1699
1791
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1700
1792
|
if (!validation.ok) return {
|
|
1701
1793
|
success: false,
|
|
@@ -1712,7 +1804,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1712
1804
|
return result;
|
|
1713
1805
|
}
|
|
1714
1806
|
async handleContentUpdate(collection, id, body) {
|
|
1715
|
-
const { ContentRepository } = await import("../content-
|
|
1807
|
+
const { ContentRepository } = await import("../content-BC43pICM.mjs").then((n) => n.n);
|
|
1716
1808
|
const repo = new ContentRepository(this.db);
|
|
1717
1809
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1718
1810
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1739,7 +1831,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1739
1831
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1740
1832
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1741
1833
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1742
|
-
const { validateContentData } = await import("../validation-
|
|
1834
|
+
const { validateContentData } = await import("../validation-DlD0E35W.mjs");
|
|
1743
1835
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1744
1836
|
if (!validation.ok) return {
|
|
1745
1837
|
success: false,
|
|
@@ -1776,8 +1868,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1776
1868
|
const tableName = `ec_${collection}`;
|
|
1777
1869
|
await sql`
|
|
1778
1870
|
UPDATE ${sql.ref(tableName)}
|
|
1779
|
-
SET draft_revision_id = ${revision.id}
|
|
1780
|
-
updated_at = ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
1871
|
+
SET draft_revision_id = ${revision.id}
|
|
1781
1872
|
WHERE id = ${resolvedId}
|
|
1782
1873
|
`.execute(this.db);
|
|
1783
1874
|
draftStorageChanged = true;
|
|
@@ -1977,8 +2068,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1977
2068
|
const tableName = `ec_${revision.collection}`;
|
|
1978
2069
|
await sql`
|
|
1979
2070
|
UPDATE ${sql.ref(tableName)}
|
|
1980
|
-
SET draft_revision_id = ${newDraft.id}
|
|
1981
|
-
updated_at = ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
2071
|
+
SET draft_revision_id = ${newDraft.id}
|
|
1982
2072
|
WHERE id = ${revision.entryId}
|
|
1983
2073
|
`.execute(this.db);
|
|
1984
2074
|
revisionRepo.pruneOldRevisions(revision.collection, revision.entryId, 50).catch(() => {});
|
|
@@ -2024,7 +2114,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2024
2114
|
if (trustedPlugin) {
|
|
2025
2115
|
const route = trustedPlugin.routes[routeKey];
|
|
2026
2116
|
if (!route) return null;
|
|
2027
|
-
return
|
|
2117
|
+
return buildRouteMeta(route);
|
|
2028
2118
|
}
|
|
2029
2119
|
const meta = sandboxedRouteMetaCache.get(pluginId);
|
|
2030
2120
|
if (meta) {
|
|
@@ -2040,6 +2130,17 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2040
2130
|
if (this.findSandboxedPlugin(pluginId)) return { public: false };
|
|
2041
2131
|
return null;
|
|
2042
2132
|
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Resolve the settings schema for a runtime-installed (marketplace or
|
|
2135
|
+
* registry) plugin from its cached manifest. Returns `{}` for a known
|
|
2136
|
+
* plugin without a schema and `null` for unknown plugins, matching the
|
|
2137
|
+
* contract of `getPluginSettingsSchema` for build-time plugins.
|
|
2138
|
+
*/
|
|
2139
|
+
getRuntimePluginSettingsSchema(pluginId) {
|
|
2140
|
+
const meta = marketplaceManifestCache.get(pluginId);
|
|
2141
|
+
if (!meta) return null;
|
|
2142
|
+
return meta.admin?.settingsSchema ?? {};
|
|
2143
|
+
}
|
|
2043
2144
|
async handlePluginApiRoute(pluginId, _method, path, request) {
|
|
2044
2145
|
if (!this.isPluginEnabled(pluginId)) return {
|
|
2045
2146
|
success: false,
|
|
@@ -2051,9 +2152,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2051
2152
|
const trustedPlugin = this.configuredPlugins.find((p) => p.id === pluginId);
|
|
2052
2153
|
if (trustedPlugin && this.enabledPlugins.has(trustedPlugin.id)) {
|
|
2053
2154
|
const routeRegistry = new PluginRouteRegistry({
|
|
2054
|
-
|
|
2055
|
-
storage: this.storage ?? void 0,
|
|
2155
|
+
...this.pipelineFactoryOptions,
|
|
2056
2156
|
emailPipeline: this.email ?? void 0,
|
|
2157
|
+
cronReschedule: () => this.cronScheduler?.reschedule(),
|
|
2057
2158
|
trustedProxyHeaders: getTrustedProxyHeaders(this.config)
|
|
2058
2159
|
});
|
|
2059
2160
|
routeRegistry.register(trustedPlugin);
|
|
@@ -2077,6 +2178,116 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2077
2178
|
}
|
|
2078
2179
|
};
|
|
2079
2180
|
}
|
|
2181
|
+
async getPluginMcpTools(pluginId) {
|
|
2182
|
+
const tools = [];
|
|
2183
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2184
|
+
for (const plugin of this.configuredPlugins) {
|
|
2185
|
+
if (pluginId && plugin.id !== pluginId) continue;
|
|
2186
|
+
for (const [name, tool] of Object.entries(plugin.mcp?.tools ?? {})) {
|
|
2187
|
+
const route = plugin.routes[tool.route];
|
|
2188
|
+
if (!route || route.public || !route.permission || !(route.permission in Permissions)) continue;
|
|
2189
|
+
const key = `${plugin.id}__${name}`;
|
|
2190
|
+
if (seen.has(key)) continue;
|
|
2191
|
+
seen.add(key);
|
|
2192
|
+
tools.push({
|
|
2193
|
+
pluginId: plugin.id,
|
|
2194
|
+
name,
|
|
2195
|
+
description: tool.description,
|
|
2196
|
+
route: tool.route,
|
|
2197
|
+
permission: route.permission,
|
|
2198
|
+
destructive: tool.destructive ?? false,
|
|
2199
|
+
inputSchema: tool.input,
|
|
2200
|
+
outputSchema: tool.output
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
const addManifestTools = (id, mcp) => {
|
|
2205
|
+
if (pluginId && id !== pluginId) return;
|
|
2206
|
+
for (const tool of mcp?.tools ?? []) {
|
|
2207
|
+
const key = `${id}__${tool.name}`;
|
|
2208
|
+
const routeMeta = this.getPluginRouteMeta(id, tool.route);
|
|
2209
|
+
if (seen.has(key) || !routeMeta || routeMeta.public || routeMeta.permission !== tool.permission || !(tool.permission in Permissions)) continue;
|
|
2210
|
+
seen.add(key);
|
|
2211
|
+
tools.push({
|
|
2212
|
+
pluginId: id,
|
|
2213
|
+
name: tool.name,
|
|
2214
|
+
description: tool.description,
|
|
2215
|
+
route: tool.route,
|
|
2216
|
+
permission: tool.permission,
|
|
2217
|
+
destructive: tool.destructive,
|
|
2218
|
+
inputSchema: z.fromJSONSchema({ ...tool.inputSchema }),
|
|
2219
|
+
outputSchema: tool.outputSchema ? z.fromJSONSchema({ ...tool.outputSchema }) : void 0
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
for (const entry of this.sandboxedPluginEntries) addManifestTools(entry.id, entry.mcp);
|
|
2224
|
+
for (const [id, manifest] of marketplaceManifestCache) addManifestTools(id, manifest.mcp);
|
|
2225
|
+
return tools;
|
|
2226
|
+
}
|
|
2227
|
+
async getEnabledPluginMcpTools() {
|
|
2228
|
+
const [tools, states] = await Promise.all([this.getPluginMcpTools(), new PluginStateRepository(this.db).getAll()]);
|
|
2229
|
+
const stateByPlugin = new Map(states.map((state) => [state.pluginId, state]));
|
|
2230
|
+
return tools.filter((tool) => {
|
|
2231
|
+
const state = stateByPlugin.get(tool.pluginId);
|
|
2232
|
+
if (!state?.mcpToolsEnabled || state.status !== "active" || !this.isPluginEnabled(tool.pluginId)) return false;
|
|
2233
|
+
return state.mcpToolsConsent === this.serializePluginMcpConsent(tools, tool.pluginId);
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
serializePluginMcpConsent(tools, pluginId) {
|
|
2237
|
+
return JSON.stringify(tools.filter((tool) => tool.pluginId === pluginId).map((tool) => ({
|
|
2238
|
+
name: tool.name,
|
|
2239
|
+
description: tool.description,
|
|
2240
|
+
route: tool.route,
|
|
2241
|
+
permission: tool.permission,
|
|
2242
|
+
destructive: tool.destructive,
|
|
2243
|
+
inputSchema: z.toJSONSchema(tool.inputSchema, { target: "draft-7" }),
|
|
2244
|
+
...tool.outputSchema ? { outputSchema: z.toJSONSchema(tool.outputSchema, { target: "draft-7" }) } : {}
|
|
2245
|
+
})).toSorted((a, b) => a.name.localeCompare(b.name)));
|
|
2246
|
+
}
|
|
2247
|
+
async handlePluginMcpTool(pluginId, toolName, route, input, actorId, request) {
|
|
2248
|
+
const requestMeta = extractRequestMeta(request, getTrustedProxyHeaders(this.config));
|
|
2249
|
+
const audit = new AuditRepository(this.db);
|
|
2250
|
+
const headers = new Headers(request.headers);
|
|
2251
|
+
headers.delete("content-length");
|
|
2252
|
+
headers.delete("content-encoding");
|
|
2253
|
+
const internalRequest = new Request(request.url, {
|
|
2254
|
+
method: "POST",
|
|
2255
|
+
headers,
|
|
2256
|
+
body: JSON.stringify(input)
|
|
2257
|
+
});
|
|
2258
|
+
const result = await this.handlePluginApiRoute(pluginId, "POST", route, internalRequest);
|
|
2259
|
+
await audit.log({
|
|
2260
|
+
actorId,
|
|
2261
|
+
actorIp: requestMeta.ip ?? void 0,
|
|
2262
|
+
action: "plugin_tool_invoke",
|
|
2263
|
+
resourceType: "plugin_mcp_tool",
|
|
2264
|
+
resourceId: `${pluginId}__${toolName}`,
|
|
2265
|
+
details: {
|
|
2266
|
+
pluginId,
|
|
2267
|
+
tool: toolName,
|
|
2268
|
+
route
|
|
2269
|
+
},
|
|
2270
|
+
status: result.success ? "success" : "failure"
|
|
2271
|
+
});
|
|
2272
|
+
return result;
|
|
2273
|
+
}
|
|
2274
|
+
async handlePluginMcpDenied(pluginId, toolName, route, actorId, request, reason) {
|
|
2275
|
+
const requestMeta = extractRequestMeta(request, getTrustedProxyHeaders(this.config));
|
|
2276
|
+
await new AuditRepository(this.db).log({
|
|
2277
|
+
actorId,
|
|
2278
|
+
actorIp: requestMeta.ip ?? void 0,
|
|
2279
|
+
action: "plugin_tool_invoke",
|
|
2280
|
+
resourceType: "plugin_mcp_tool",
|
|
2281
|
+
resourceId: `${pluginId}__${toolName}`,
|
|
2282
|
+
details: {
|
|
2283
|
+
pluginId,
|
|
2284
|
+
tool: toolName,
|
|
2285
|
+
route,
|
|
2286
|
+
reason
|
|
2287
|
+
},
|
|
2288
|
+
status: "denied"
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2080
2291
|
findSandboxedPlugin(pluginId) {
|
|
2081
2292
|
for (const [key, plugin] of this.sandboxedPlugins) if (key.startsWith(pluginId + ":")) return plugin;
|
|
2082
2293
|
}
|
|
@@ -2170,16 +2381,30 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2170
2381
|
});
|
|
2171
2382
|
}
|
|
2172
2383
|
runAfterDeleteHooks(id, collection, permanent) {
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2384
|
+
after(async () => {
|
|
2385
|
+
if (this.hooks.hasHooks("content:afterDelete")) try {
|
|
2386
|
+
await this.hooks.runContentAfterDelete(id, collection, permanent);
|
|
2387
|
+
} catch (err) {
|
|
2388
|
+
console.error("EmDash afterDelete hook error:", err);
|
|
2389
|
+
}
|
|
2390
|
+
const tasks = [];
|
|
2391
|
+
for (const [pluginKey, plugin] of this.sandboxedPlugins) {
|
|
2392
|
+
const [pluginId] = pluginKey.split(":");
|
|
2393
|
+
if (!pluginId || !this.isPluginEnabled(pluginId)) continue;
|
|
2394
|
+
tasks.push((async () => {
|
|
2395
|
+
try {
|
|
2396
|
+
await plugin.invokeHook("content:afterDelete", {
|
|
2397
|
+
id,
|
|
2398
|
+
collection,
|
|
2399
|
+
permanent
|
|
2400
|
+
});
|
|
2401
|
+
} catch (err) {
|
|
2402
|
+
console.error(`EmDash: Sandboxed plugin ${pluginId} afterDelete error:`, err);
|
|
2403
|
+
}
|
|
2404
|
+
})());
|
|
2405
|
+
}
|
|
2406
|
+
await Promise.allSettled(tasks);
|
|
2407
|
+
});
|
|
2183
2408
|
}
|
|
2184
2409
|
runDeferredContentHook(name, content, collection) {
|
|
2185
2410
|
const label = name.slice(8);
|
|
@@ -2759,6 +2984,63 @@ async function getRuntime(config, initTimings) {
|
|
|
2759
2984
|
async function runScheduledTasks(options = {}) {
|
|
2760
2985
|
const config = getConfig();
|
|
2761
2986
|
if (!config) return { published: [] };
|
|
2987
|
+
return runOutsideRequest(config, (runtime) => runtime.runScheduledTasks(options));
|
|
2988
|
+
}
|
|
2989
|
+
/**
|
|
2990
|
+
* Run a callback against the EmDash runtime outside any HTTP request — from a
|
|
2991
|
+
* Cloudflare Queue consumer, a `scheduled()` handler, or any other
|
|
2992
|
+
* platform-event handler that has no request and therefore no `locals.emdash`.
|
|
2993
|
+
*
|
|
2994
|
+
* Resolves the same cached runtime singleton request handlers use, so hooks,
|
|
2995
|
+
* plugin state, and storage all behave exactly as they do during a request.
|
|
2996
|
+
* A typical queue consumer finishes a job by calling back into a plugin route:
|
|
2997
|
+
*
|
|
2998
|
+
* ```ts
|
|
2999
|
+
* import { withEmDashRuntime } from "emdash/middleware";
|
|
3000
|
+
*
|
|
3001
|
+
* async function queue(batch: MessageBatch) {
|
|
3002
|
+
* await withEmDashRuntime(async (runtime) => {
|
|
3003
|
+
* for (const message of batch.messages) {
|
|
3004
|
+
* await runtime.handlePluginApiRoute(
|
|
3005
|
+
* "my-plugin",
|
|
3006
|
+
* "POST",
|
|
3007
|
+
* "/finishJob",
|
|
3008
|
+
* new Request("https://internal/", {
|
|
3009
|
+
* method: "POST",
|
|
3010
|
+
* body: JSON.stringify(message.body),
|
|
3011
|
+
* }),
|
|
3012
|
+
* );
|
|
3013
|
+
* }
|
|
3014
|
+
* });
|
|
3015
|
+
* }
|
|
3016
|
+
* ```
|
|
3017
|
+
*
|
|
3018
|
+
* Server-only and fully trusted: the callback gets the raw runtime with no
|
|
3019
|
+
* auth or CSRF checks, same trust level as plugin cron. Never expose it to
|
|
3020
|
+
* user input without validating that input yourself.
|
|
3021
|
+
*
|
|
3022
|
+
* Throws when EmDash is not configured (no `emdash()` Astro integration).
|
|
3023
|
+
*/
|
|
3024
|
+
async function withEmDashRuntime(run) {
|
|
3025
|
+
const config = getConfig();
|
|
3026
|
+
if (!config) throw new Error("EmDash is not configured — withEmDashRuntime() requires the emdash() Astro integration.");
|
|
3027
|
+
return runOutsideRequest(config, async (runtime) => run(runtime));
|
|
3028
|
+
}
|
|
3029
|
+
/**
|
|
3030
|
+
* Shared plumbing for request-free entry points (`runScheduledTasks`,
|
|
3031
|
+
* `withEmDashRuntime`): resolve the runtime singleton, then run the callback
|
|
3032
|
+
* under an event-scoped db connection when the adapter needs one.
|
|
3033
|
+
*
|
|
3034
|
+
* Connection-backed adapters (e.g. Postgres over Hyperdrive) cannot reuse
|
|
3035
|
+
* the per-isolate singleton from a platform event: its socket belongs to the
|
|
3036
|
+
* request that opened it, and workerd rejects cross-event I/O. Open an
|
|
3037
|
+
* event-scoped connection and run the callback under it in ALS — the
|
|
3038
|
+
* runtime's db getter, the cron executor, and plugin contexts all resolve
|
|
3039
|
+
* the connection from ALS — then close it. Gated on the adapter being
|
|
3040
|
+
* connection-backed (it exposes `close()`); stateless adapters (D1, Node
|
|
3041
|
+
* SQLite) return null or a close-less scope and keep using the singleton.
|
|
3042
|
+
*/
|
|
3043
|
+
async function runOutsideRequest(config, fn) {
|
|
2762
3044
|
const runtime = await getRuntime(config);
|
|
2763
3045
|
const scoped = createRequestScopedDb$1({
|
|
2764
3046
|
config: config.database?.config,
|
|
@@ -2767,7 +3049,7 @@ async function runScheduledTasks(options = {}) {
|
|
|
2767
3049
|
cookies: NOOP_COOKIE_JAR,
|
|
2768
3050
|
url: CRON_EVENT_URL
|
|
2769
3051
|
});
|
|
2770
|
-
if (!scoped?.close) return runtime
|
|
3052
|
+
if (!scoped?.close) return fn(runtime);
|
|
2771
3053
|
const parent = getRequestContext();
|
|
2772
3054
|
const ctx = parent ? {
|
|
2773
3055
|
...parent,
|
|
@@ -2778,17 +3060,17 @@ async function runScheduledTasks(options = {}) {
|
|
|
2778
3060
|
metrics: createRequestMetrics(performance.now())
|
|
2779
3061
|
};
|
|
2780
3062
|
try {
|
|
2781
|
-
return await runWithContext(ctx, () => runtime
|
|
3063
|
+
return await runWithContext(ctx, () => fn(runtime));
|
|
2782
3064
|
} finally {
|
|
2783
3065
|
try {
|
|
2784
3066
|
scoped.commit();
|
|
2785
3067
|
} catch (error) {
|
|
2786
|
-
console.error("[
|
|
3068
|
+
console.error("[emdash] event-scoped db commit failed:", error);
|
|
2787
3069
|
}
|
|
2788
3070
|
try {
|
|
2789
3071
|
scoped.close();
|
|
2790
3072
|
} catch (error) {
|
|
2791
|
-
console.error("[
|
|
3073
|
+
console.error("[emdash] event-scoped db close failed:", error);
|
|
2792
3074
|
}
|
|
2793
3075
|
}
|
|
2794
3076
|
}
|
|
@@ -2912,7 +3194,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2912
3194
|
if (!isSetupVerified() && !context.isPrerendered) {
|
|
2913
3195
|
const t0 = performance.now();
|
|
2914
3196
|
try {
|
|
2915
|
-
const { getDb } = await import("../loader-
|
|
3197
|
+
const { getDb } = await import("../loader-D4rigvjR.mjs").then((n) => n.o);
|
|
2916
3198
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
2917
3199
|
markSetupVerified();
|
|
2918
3200
|
} catch (error) {
|
|
@@ -3045,6 +3327,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3045
3327
|
handlePluginApiRoute: runtime.handlePluginApiRoute.bind(runtime),
|
|
3046
3328
|
handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
|
|
3047
3329
|
getPluginRouteMeta: runtime.getPluginRouteMeta.bind(runtime),
|
|
3330
|
+
getPluginMcpTools: runtime.getPluginMcpTools.bind(runtime),
|
|
3331
|
+
getEnabledPluginMcpTools: runtime.getEnabledPluginMcpTools.bind(runtime),
|
|
3332
|
+
serializePluginMcpConsent: runtime.serializePluginMcpConsent.bind(runtime),
|
|
3333
|
+
handlePluginMcpTool: runtime.handlePluginMcpTool.bind(runtime),
|
|
3334
|
+
handlePluginMcpDenied: runtime.handlePluginMcpDenied.bind(runtime),
|
|
3048
3335
|
getMediaProvider: runtime.getMediaProvider.bind(runtime),
|
|
3049
3336
|
getMediaProviderList: runtime.getMediaProviderList.bind(runtime),
|
|
3050
3337
|
collectPageMetadata: runtime.collectPageMetadata.bind(runtime),
|
|
@@ -3136,5 +3423,5 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3136
3423
|
});
|
|
3137
3424
|
|
|
3138
3425
|
//#endregion
|
|
3139
|
-
export { onRequest as default, onRequest, runScheduledTasks };
|
|
3426
|
+
export { onRequest as default, onRequest, runScheduledTasks, withEmDashRuntime };
|
|
3140
3427
|
//# sourceMappingURL=middleware.mjs.map
|