emdash 0.12.0 → 0.13.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-BktHA7EO.d.mts → adapters-9DybjTO6.d.mts} +1 -1
- package/dist/{adapters-BktHA7EO.d.mts.map → adapters-9DybjTO6.d.mts.map} +1 -1
- package/dist/allowed-origins-CDdG-4Gd.mjs +116 -0
- package/dist/allowed-origins-CDdG-4Gd.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +68 -0
- package/dist/api/route-utils.d.mts.map +1 -0
- package/dist/api/route-utils.mjs +44 -0
- package/dist/api/route-utils.mjs.map +1 -0
- package/dist/api/schemas/index.d.mts +2 -0
- package/dist/api/schemas/index.mjs +4 -0
- package/dist/api-ayIQ7rIe.mjs +3941 -0
- package/dist/api-ayIQ7rIe.mjs.map +1 -0
- package/dist/api-tokens-D3C9v02m.mjs +3 -0
- package/dist/api-tokens-eYymBhIT.mjs +153 -0
- package/dist/api-tokens-eYymBhIT.mjs.map +1 -0
- package/dist/{apply-C1ZORgcy.mjs → apply-v4DBgjPw.mjs} +19 -346
- package/dist/apply-v4DBgjPw.mjs.map +1 -0
- package/dist/astro/index.d.mts +10 -6
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +42 -83
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -5
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +25 -65
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.mjs +4 -4
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +140 -69
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +15 -0
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -0
- package/dist/astro/routes/PluginRegistry.mjs +25 -0
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts +15 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +67 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.d.mts +15 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +67 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts +11 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +33 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts +17 -0
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +52 -0
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts +10 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +74 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs +61 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +80 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_.d.mts +15 -0
- package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_.mjs +47 -0
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/bulk.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/bulk.mjs +36 -0
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/counts.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/counts.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/counts.mjs +25 -0
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/index.d.mts +11 -0
- package/dist/astro/routes/api/admin/comments/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/index.mjs +40 -0
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts +8 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +48 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +36 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts +19 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +69 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.d.mts +15 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +50 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +59 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +51 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +58 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +66 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/index.mjs +49 -0
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +39 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +51 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +69 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +58 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +72 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs +49 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +51 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +39 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +67 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +43 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +32 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/users/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +106 -0
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +46 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/index.mjs +56 -0
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/dev-bypass.d.mts +9 -0
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/dev-bypass.mjs +84 -0
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/accept.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/accept.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/accept.mjs +34 -0
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/complete.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/complete.mjs +56 -0
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/index.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/index.mjs +53 -0
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/register-options.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/register-options.mjs +46 -0
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/logout.d.mts +8 -0
- package/dist/astro/routes/api/auth/logout.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/logout.mjs +27 -0
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/send.d.mts +8 -0
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/send.mjs +50 -0
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +35 -0
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/me.d.mts +14 -0
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/me.mjs +43 -0
- package/dist/astro/routes/api/auth/me.mjs.map +1 -0
- package/dist/astro/routes/api/auth/mode.d.mts +8 -0
- package/dist/astro/routes/api/auth/mode.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/mode.mjs +29 -0
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts +8 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +130 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts +8 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +60 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/_id_.d.mts +15 -0
- package/dist/astro/routes/api/auth/passkey/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +64 -0
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/index.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/index.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/index.mjs +28 -0
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/options.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/options.mjs +48 -0
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +46 -0
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +61 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/verify.mjs +49 -0
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/complete.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/complete.mjs +57 -0
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/request.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/request.mjs +46 -0
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/verify.mjs +35 -0
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +15 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +193 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +20 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +28 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +30 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +23 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +78 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +48 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +28 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +22 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +58 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts +15 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +85 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +43 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +28 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +88 -0
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs +61 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/trash.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/trash.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/trash.mjs +25 -0
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -0
- package/dist/astro/routes/api/dashboard.d.mts +8 -0
- package/dist/astro/routes/api/dashboard.d.mts.map +1 -0
- package/dist/astro/routes/api/dashboard.mjs +26 -0
- package/dist/astro/routes/api/dashboard.mjs.map +1 -0
- package/dist/astro/routes/api/dev/emails.d.mts +9 -0
- package/dist/astro/routes/api/dev/emails.d.mts.map +1 -0
- package/dist/astro/routes/api/dev/emails.mjs +20 -0
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -0
- package/dist/astro/routes/api/import/probe.d.mts +18 -0
- package/dist/astro/routes/api/import/probe.d.mts.map +1 -0
- package/dist/astro/routes/api/import/probe.mjs +35 -0
- package/dist/astro/routes/api/import/probe.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts +88 -0
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +313 -0
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +93 -0
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/execute.mjs +593 -0
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/media.d.mts +36 -0
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/media.mjs +225 -0
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/prepare.d.mts +20 -0
- package/dist/astro/routes/api/import/wordpress/prepare.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +120 -0
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +49 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +131 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +22 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +139 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +16 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +71 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts +8 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +29 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +20 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +219 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -0
- package/dist/astro/routes/api/manifest.d.mts +8 -0
- package/dist/astro/routes/api/manifest.d.mts.map +1 -0
- package/dist/astro/routes/api/manifest.mjs +47 -0
- package/dist/astro/routes/api/manifest.mjs.map +1 -0
- package/dist/astro/routes/api/mcp.d.mts +16 -0
- package/dist/astro/routes/api/mcp.d.mts.map +1 -0
- package/dist/astro/routes/api/mcp.mjs +1414 -0
- package/dist/astro/routes/api/mcp.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/confirm.d.mts +11 -0
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/confirm.mjs +61 -0
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_.d.mts +23 -0
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_.mjs +83 -0
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.d.mts +8 -0
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs +52 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts +15 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +52 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts +15 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +75 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/index.d.mts +11 -0
- package/dist/astro/routes/api/media/providers/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/index.mjs +21 -0
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/upload-url.d.mts +11 -0
- package/dist/astro/routes/api/media/upload-url.d.mts.map +1 -0
- package/dist/astro/routes/api/media/upload-url.mjs +82 -0
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -0
- package/dist/astro/routes/api/media.d.mts +17 -0
- package/dist/astro/routes/api/media.d.mts.map +1 -0
- package/dist/astro/routes/api/media.mjs +138 -0
- package/dist/astro/routes/api/media.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts +9 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +48 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items.mjs +31 -0
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +31 -0
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/translations.d.mts +9 -0
- package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs +62 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_.d.mts +10 -0
- package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_.mjs +60 -0
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/menus/index.d.mts +9 -0
- package/dist/astro/routes/api/menus/index.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/index.mjs +40 -0
- package/dist/astro/routes/api/menus/index.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/authorize.d.mts +9 -0
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/authorize.mjs +260 -0
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/authorize.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/authorize.mjs +32 -0
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/code.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/code.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/code.mjs +36 -0
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/token.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/token.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/token.mjs +47 -0
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/register.d.mts +9 -0
- package/dist/astro/routes/api/oauth/register.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/register.mjs +113 -0
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token/refresh.d.mts +8 -0
- package/dist/astro/routes/api/oauth/token/refresh.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token/refresh.mjs +30 -0
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token/revoke.d.mts +8 -0
- package/dist/astro/routes/api/oauth/token/revoke.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token/revoke.mjs +27 -0
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token.d.mts +9 -0
- package/dist/astro/routes/api/oauth/token.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token.mjs +141 -0
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -0
- package/dist/astro/routes/api/openapi.json.d.mts +8 -0
- package/dist/astro/routes/api/openapi.json.d.mts.map +1 -0
- package/dist/astro/routes/api/openapi.json.mjs +2642 -0
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts +12 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +78 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/404s/index.d.mts +10 -0
- package/dist/astro/routes/api/redirects/404s/index.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/404s/index.mjs +62 -0
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/404s/summary.d.mts +8 -0
- package/dist/astro/routes/api/redirects/404s/summary.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/404s/summary.mjs +34 -0
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/_id_.d.mts +10 -0
- package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/_id_.mjs +71 -0
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/index.d.mts +9 -0
- package/dist/astro/routes/api/redirects/index.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/index.mjs +52 -0
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts +8 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +19 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts +8 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +26 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts +10 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +75 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +63 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +54 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts +10 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +79 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/collections/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/index.mjs +63 -0
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.d.mts +8 -0
- package/dist/astro/routes/api/schema/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +82 -0
- package/dist/astro/routes/api/schema/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.d.mts +8 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +55 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/schema/orphans/index.d.mts +8 -0
- package/dist/astro/routes/api/schema/orphans/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/orphans/index.mjs +50 -0
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -0
- package/dist/astro/routes/api/search/enable.d.mts +16 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/search/enable.mjs +55 -0
- package/dist/astro/routes/api/search/enable.mjs.map +1 -0
- package/dist/astro/routes/api/search/index.d.mts +17 -0
- package/dist/astro/routes/api/search/index.d.mts.map +1 -0
- package/dist/astro/routes/api/search/index.mjs +52 -0
- package/dist/astro/routes/api/search/index.mjs.map +1 -0
- package/dist/astro/routes/api/search/rebuild.d.mts +14 -0
- package/dist/astro/routes/api/search/rebuild.d.mts.map +1 -0
- package/dist/astro/routes/api/search/rebuild.mjs +48 -0
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -0
- package/dist/astro/routes/api/search/stats.d.mts +11 -0
- package/dist/astro/routes/api/search/stats.d.mts.map +1 -0
- package/dist/astro/routes/api/search/stats.mjs +29 -0
- package/dist/astro/routes/api/search/stats.mjs.map +1 -0
- package/dist/astro/routes/api/search/suggest.d.mts +16 -0
- package/dist/astro/routes/api/search/suggest.d.mts.map +1 -0
- package/dist/astro/routes/api/search/suggest.mjs +43 -0
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -0
- package/dist/astro/routes/api/sections/_slug_.d.mts +10 -0
- package/dist/astro/routes/api/sections/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/sections/_slug_.mjs +65 -0
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/sections/index.d.mts +9 -0
- package/dist/astro/routes/api/sections/index.d.mts.map +1 -0
- package/dist/astro/routes/api/sections/index.mjs +48 -0
- package/dist/astro/routes/api/sections/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/email.d.mts +18 -0
- package/dist/astro/routes/api/settings/email.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/email.mjs +105 -0
- package/dist/astro/routes/api/settings/email.mjs.map +1 -0
- package/dist/astro/routes/api/settings.d.mts +21 -0
- package/dist/astro/routes/api/settings.d.mts.map +1 -0
- package/dist/astro/routes/api/settings.mjs +58 -0
- package/dist/astro/routes/api/settings.mjs.map +1 -0
- package/dist/astro/routes/api/setup/admin-verify.d.mts +8 -0
- package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/admin-verify.mjs +68 -0
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -0
- package/dist/astro/routes/api/setup/admin.d.mts +8 -0
- package/dist/astro/routes/api/setup/admin.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/admin.mjs +69 -0
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -0
- package/dist/astro/routes/api/setup/dev-bypass.d.mts +9 -0
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/dev-bypass.mjs +139 -0
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -0
- package/dist/astro/routes/api/setup/dev-reset.d.mts +8 -0
- package/dist/astro/routes/api/setup/dev-reset.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/dev-reset.mjs +25 -0
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -0
- package/dist/astro/routes/api/setup/index.d.mts +8 -0
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/index.mjs +93 -0
- package/dist/astro/routes/api/setup/index.mjs.map +1 -0
- package/dist/astro/routes/api/setup/status.d.mts +8 -0
- package/dist/astro/routes/api/setup/status.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/status.mjs +60 -0
- package/dist/astro/routes/api/setup/status.mjs.map +1 -0
- package/dist/astro/routes/api/snapshot.d.mts +8 -0
- package/dist/astro/routes/api/snapshot.d.mts.map +1 -0
- package/dist/astro/routes/api/snapshot.mjs +270 -0
- package/dist/astro/routes/api/snapshot.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts +9 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +72 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +80 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts +15 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +59 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.d.mts +15 -0
- package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +55 -0
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -0
- package/dist/astro/routes/api/themes/preview.d.mts +8 -0
- package/dist/astro/routes/api/themes/preview.d.mts.map +1 -0
- package/dist/astro/routes/api/themes/preview.mjs +49 -0
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -0
- package/dist/astro/routes/api/typegen.d.mts +18 -0
- package/dist/astro/routes/api/typegen.d.mts.map +1 -0
- package/dist/astro/routes/api/typegen.mjs +78 -0
- package/dist/astro/routes/api/typegen.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/auth.d.mts +8 -0
- package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/auth.mjs +42 -0
- package/dist/astro/routes/api/well-known/auth.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts +8 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +32 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts +8 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +21 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +36 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +62 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts +8 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +49 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_.mjs +49 -0
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/index.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/index.mjs +59 -0
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -0
- package/dist/astro/routes/api/widget-components.d.mts +8 -0
- package/dist/astro/routes/api/widget-components.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-components.mjs +18 -0
- package/dist/astro/routes/api/widget-components.mjs.map +1 -0
- package/dist/astro/routes/robots.txt.d.mts +8 -0
- package/dist/astro/routes/robots.txt.d.mts.map +1 -0
- package/dist/astro/routes/robots.txt.mjs +61 -0
- package/dist/astro/routes/robots.txt.mjs.map +1 -0
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts +8 -0
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -0
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +71 -0
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -0
- package/dist/astro/routes/sitemap.xml.d.mts +8 -0
- package/dist/astro/routes/sitemap.xml.d.mts.map +1 -0
- package/dist/astro/routes/sitemap.xml.mjs +64 -0
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -0
- package/dist/astro/types.d.mts +48 -8
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +13 -0
- package/dist/auth/providers/github.d.mts.map +1 -0
- package/dist/auth/providers/github.mjs +18 -0
- package/dist/auth/providers/github.mjs.map +1 -0
- package/dist/auth/providers/google.d.mts +13 -0
- package/dist/auth/providers/google.d.mts.map +1 -0
- package/dist/auth/providers/google.mjs +18 -0
- package/dist/auth/providers/google.mjs.map +1 -0
- package/dist/authorize-BlyCH-96.mjs +37 -0
- package/dist/authorize-BlyCH-96.mjs.map +1 -0
- package/dist/{base64-MBPo9ozB.mjs → base64-CqR-7kqF.mjs} +1 -1
- package/dist/{base64-MBPo9ozB.mjs.map → base64-CqR-7kqF.mjs.map} +1 -1
- package/dist/{byline-gFn1r0vA.mjs → byline-D09BaS4j.mjs} +4 -4
- package/dist/{byline-gFn1r0vA.mjs.map → byline-D09BaS4j.mjs.map} +1 -1
- package/dist/{bylines-DTFI8nDM.mjs → bylines-BTM2xtP8.mjs} +6 -6
- package/dist/{bylines-DTFI8nDM.mjs.map → bylines-BTM2xtP8.mjs.map} +1 -1
- package/dist/bylines-C6eYUWlZ.d.mts +1971 -0
- package/dist/bylines-C6eYUWlZ.d.mts.map +1 -0
- package/dist/{cache-BAJbeoZ8.mjs → cache-CXCpjWiL.mjs} +3 -3
- package/dist/{cache-BAJbeoZ8.mjs.map → cache-CXCpjWiL.mjs.map} +1 -1
- package/dist/challenge-store-CJ0OOHOr.mjs +49 -0
- package/dist/challenge-store-CJ0OOHOr.mjs.map +1 -0
- package/dist/{chunks-BK1oZS-l.mjs → chunks-DyGtu1Bv.mjs} +2 -2
- package/dist/{chunks-BK1oZS-l.mjs.map → chunks-DyGtu1Bv.mjs.map} +1 -1
- package/dist/cli/index.mjs +23 -18
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +2 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/comment-Dd9MI82-.mjs +247 -0
- package/dist/comment-Dd9MI82-.mjs.map +1 -0
- package/dist/comments-koGI0FrK.mjs +204 -0
- package/dist/comments-koGI0FrK.mjs.map +1 -0
- package/dist/components-mZem7pbe.mjs +108 -0
- package/dist/components-mZem7pbe.mjs.map +1 -0
- package/dist/{content-CERxPUN0.mjs → content-D6YG26WG.mjs} +10 -34
- package/dist/content-D6YG26WG.mjs.map +1 -0
- package/dist/context-qF8d3IPR.mjs +879 -0
- package/dist/context-qF8d3IPR.mjs.map +1 -0
- package/dist/cron-H8eJ46dv.mjs +264 -0
- package/dist/cron-H8eJ46dv.mjs.map +1 -0
- package/dist/dashboard-BmWSIUwY.mjs +105 -0
- package/dist/dashboard-BmWSIUwY.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{db-errors-B7P2pSCn.mjs → db-errors-CGN9kJfo.mjs} +1 -1
- package/dist/{db-errors-B7P2pSCn.mjs.map → db-errors-CGN9kJfo.mjs.map} +1 -1
- package/dist/{default-pHuz9WF6.mjs → default-Dbs22Gg4.mjs} +1 -1
- package/dist/{default-pHuz9WF6.mjs.map → default-Dbs22Gg4.mjs.map} +1 -1
- package/dist/device-flow-BqJRxa0Q.mjs +467 -0
- package/dist/device-flow-BqJRxa0Q.mjs.map +1 -0
- package/dist/email-console-Dmp5Q-P2.mjs +50 -0
- package/dist/email-console-Dmp5Q-P2.mjs.map +1 -0
- package/dist/error-tSQWIl5U.mjs +437 -0
- package/dist/error-tSQWIl5U.mjs.map +1 -0
- package/dist/escape-B8bdIryO.mjs +9 -0
- package/dist/escape-B8bdIryO.mjs.map +1 -0
- package/dist/fts-manager-B633C-kQ.mjs +339 -0
- package/dist/fts-manager-B633C-kQ.mjs.map +1 -0
- package/dist/hash-DlUxGhQS.mjs +33 -0
- package/dist/hash-DlUxGhQS.mjs.map +1 -0
- package/dist/import-CNfLOgDE.mjs +1531 -0
- package/dist/import-CNfLOgDE.mjs.map +1 -0
- package/dist/index-D2gvztOP.d.mts +262 -0
- package/dist/index-D2gvztOP.d.mts.map +1 -0
- package/dist/{index-Dlkzhb4C.d.mts → index-UmOMt9T-.d.mts} +310 -911
- package/dist/index-UmOMt9T-.d.mts.map +1 -0
- package/dist/index.d.mts +17 -11
- package/dist/index.mjs +57 -28
- package/dist/{load-DR1VwFXR.mjs → load-QzYRpVN3.mjs} +2 -2
- package/dist/{load-DR1VwFXR.mjs.map → load-QzYRpVN3.mjs.map} +1 -1
- package/dist/{loader-ou_PXAjg.mjs → loader-Cs6-Bqe6.mjs} +4 -4
- package/dist/{loader-ou_PXAjg.mjs.map → loader-Cs6-Bqe6.mjs.map} +1 -1
- package/dist/{manifest-schema-Bp6d4d4n.mjs → manifest-schema-HCtSh4Jq.mjs} +1 -1
- package/dist/{manifest-schema-Bp6d4d4n.mjs.map → manifest-schema-HCtSh4Jq.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -1
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +11 -7
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +7 -6
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-Dg7he9uK.mjs +209 -0
- package/dist/media-Dg7he9uK.mjs.map +1 -0
- package/dist/media-allowlist-B8EX01DH.mjs +32 -0
- package/dist/media-allowlist-B8EX01DH.mjs.map +1 -0
- package/dist/menus-DOzIecHi.mjs +723 -0
- package/dist/menus-DOzIecHi.mjs.map +1 -0
- package/dist/menus-X4Z-eBA1.mjs +2788 -0
- package/dist/menus-X4Z-eBA1.mjs.map +1 -0
- package/dist/mime-KV5TqkMN.mjs +36 -0
- package/dist/mime-KV5TqkMN.mjs.map +1 -0
- package/dist/{mode-YhqNVef_.mjs → mode-DPRPvJYm.mjs} +1 -1
- package/dist/{mode-YhqNVef_.mjs.map → mode-DPRPvJYm.mjs.map} +1 -1
- package/dist/normalize-CN5kRSMC.mjs +151 -0
- package/dist/normalize-CN5kRSMC.mjs.map +1 -0
- package/dist/oauth-authorization-62GmpGIH.mjs +275 -0
- package/dist/oauth-authorization-62GmpGIH.mjs.map +1 -0
- package/dist/oauth-clients-D_B0_-Bz.mjs +266 -0
- package/dist/oauth-clients-D_B0_-Bz.mjs.map +1 -0
- package/dist/oauth-state-store-DpsZViTu.mjs +49 -0
- package/dist/oauth-state-store-DpsZViTu.mjs.map +1 -0
- package/dist/oauth-user-lookup-meyS2oB1.mjs +26 -0
- package/dist/oauth-user-lookup-meyS2oB1.mjs.map +1 -0
- package/dist/{options-nPxWnrya.mjs → options-BL4X94qY.mjs} +1 -1
- package/dist/{options-nPxWnrya.mjs.map → options-BL4X94qY.mjs.map} +1 -1
- package/dist/options-Cq64Wx0O.d.mts +207 -0
- package/dist/options-Cq64Wx0O.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/parse-BFTPon-J.mjs +89 -0
- package/dist/parse-BFTPon-J.mjs.map +1 -0
- package/dist/passkey-config-Cg86_ISa.mjs +46 -0
- package/dist/passkey-config-Cg86_ISa.mjs.map +1 -0
- package/dist/{patterns-DsUZ4uxI.mjs → patterns-CqG5Ya3i.mjs} +54 -2
- package/dist/{patterns-DsUZ4uxI.mjs.map → patterns-CqG5Ya3i.mjs.map} +1 -1
- package/dist/{placeholder-CDPtkelt.d.mts → placeholder-D3cFCU9y.d.mts} +2 -1
- package/dist/{placeholder-CDPtkelt.d.mts.map → placeholder-D3cFCU9y.d.mts.map} +1 -1
- package/dist/placeholder-LqmHqvBw.mjs +143 -0
- package/dist/placeholder-LqmHqvBw.mjs.map +1 -0
- package/dist/plugin-types.d.mts +122 -0
- package/dist/plugin-types.d.mts.map +1 -0
- package/dist/plugin-types.mjs +1 -0
- package/dist/plugins/adapt-sandbox-entry.d.mts +20 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +46 -23
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/preview-C1LOEbWZ.mjs +107 -0
- package/dist/preview-C1LOEbWZ.mjs.map +1 -0
- package/dist/{public-url-B1AxbbbQ.mjs → public-url-CseXl9Fv.mjs} +39 -2
- package/dist/{public-url-B1AxbbbQ.mjs.map → public-url-CseXl9Fv.mjs.map} +1 -1
- package/dist/{query-yA3-rFji.mjs → query-axZmO6Tn.mjs} +12 -12
- package/dist/{query-yA3-rFji.mjs.map → query-axZmO6Tn.mjs.map} +1 -1
- package/dist/rate-limit-t5CVjCO6.mjs +120 -0
- package/dist/rate-limit-t5CVjCO6.mjs.map +1 -0
- package/dist/redirect-DGRsLO2I.mjs +17 -0
- package/dist/redirect-DGRsLO2I.mjs.map +1 -0
- package/dist/{redirect-C5H7VGIX.mjs → redirect-DkaDxq8e.mjs} +3 -3
- package/dist/{redirect-C5H7VGIX.mjs.map → redirect-DkaDxq8e.mjs.map} +1 -1
- package/dist/redirects-D1fdd68T.mjs +573 -0
- package/dist/redirects-D1fdd68T.mjs.map +1 -0
- package/dist/redirects-Dmj6KRU3.mjs +1141 -0
- package/dist/redirects-Dmj6KRU3.mjs.map +1 -0
- package/dist/{registry-Do34mz_P.mjs → registry-BnCeHYsf.mjs} +8 -300
- package/dist/registry-BnCeHYsf.mjs.map +1 -0
- package/dist/{request-cache-D4I69LeL.mjs → request-cache-dzCt8TZB.mjs} +1 -1
- package/dist/{request-cache-D4I69LeL.mjs.map → request-cache-dzCt8TZB.mjs.map} +1 -1
- package/dist/request-meta-CLCwSQOS.mjs +140 -0
- package/dist/request-meta-CLCwSQOS.mjs.map +1 -0
- package/dist/{runner-Iu3IZSDM.d.mts → runner-DcfZewkO.d.mts} +2 -2
- package/dist/{runner-Iu3IZSDM.d.mts.map → runner-DcfZewkO.d.mts.map} +1 -1
- package/dist/{runner-DIcU2UCC.mjs → runner-DdnQIwz_.mjs} +436 -187
- package/dist/runner-DdnQIwz_.mjs.map +1 -0
- package/dist/runtime.d.mts +10 -6
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +3 -3
- package/dist/schema-BmqagCwG.mjs +41 -0
- package/dist/schema-BmqagCwG.mjs.map +1 -0
- package/dist/search-CPrvO5u8.mjs +376 -0
- package/dist/search-CPrvO5u8.mjs.map +1 -0
- package/dist/{secrets-CZ8rxLX3.mjs → secrets-6pgZyq0K.mjs} +3 -3
- package/dist/{secrets-CZ8rxLX3.mjs.map → secrets-6pgZyq0K.mjs.map} +1 -1
- package/dist/sections-Cm-zb-gZ.mjs +346 -0
- package/dist/sections-Cm-zb-gZ.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +19 -15
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo-BoR4wCUh.mjs +86 -0
- package/dist/seo-BoR4wCUh.mjs.map +1 -0
- package/dist/seo-DRq9-EPP.mjs +130 -0
- package/dist/seo-DRq9-EPP.mjs.map +1 -0
- package/dist/service-vByySp-2.mjs +195 -0
- package/dist/service-vByySp-2.mjs.map +1 -0
- package/dist/settings-CBBj7HUd.mjs +51 -0
- package/dist/settings-CBBj7HUd.mjs.map +1 -0
- package/dist/settings-xQKsWnzQ.mjs +235 -0
- package/dist/settings-xQKsWnzQ.mjs.map +1 -0
- package/dist/setup-BGAJ2uXs.mjs +137 -0
- package/dist/setup-BGAJ2uXs.mjs.map +1 -0
- package/dist/setup-complete-C6ZCLhKo.mjs +26 -0
- package/dist/setup-complete-C6ZCLhKo.mjs.map +1 -0
- package/dist/setup-nonce-CY1gQiAU.mjs +25 -0
- package/dist/setup-nonce-CY1gQiAU.mjs.map +1 -0
- package/dist/site-url-D-M4Fd8O.mjs +13 -0
- package/dist/site-url-D-M4Fd8O.mjs.map +1 -0
- package/dist/slugify-Cjh1ssOZ.mjs +30 -0
- package/dist/slugify-Cjh1ssOZ.mjs.map +1 -0
- package/dist/ssrf-CTul4uQi.mjs +1 -0
- package/dist/ssrf-DzFN_qV-.mjs +332 -0
- package/dist/ssrf-DzFN_qV-.mjs.map +1 -0
- 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-JmQQZiG1.mjs → taxonomies-Cn9UpaR2.mjs} +7 -7
- package/dist/{taxonomies-JmQQZiG1.mjs.map → taxonomies-Cn9UpaR2.mjs.map} +1 -1
- package/dist/taxonomies-Dc0mzlms.mjs +508 -0
- package/dist/taxonomies-Dc0mzlms.mjs.map +1 -0
- package/dist/{taxonomy-D6NvlKo8.mjs → taxonomy-wPfusMK9.mjs} +3 -3
- package/dist/{taxonomy-D6NvlKo8.mjs.map → taxonomy-wPfusMK9.mjs.map} +1 -1
- package/dist/{tokens-CyRDPVW2.mjs → tokens-DILYNZMi.mjs} +2 -2
- package/dist/{tokens-CyRDPVW2.mjs.map → tokens-DILYNZMi.mjs.map} +1 -1
- package/dist/{transaction-D44LBXvU.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
- package/dist/{transaction-D44LBXvU.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
- package/dist/{transport-DX_5rpsq.d.mts → transport-GeXlLscf.d.mts} +1 -1
- package/dist/{transport-DX_5rpsq.d.mts.map → transport-GeXlLscf.d.mts.map} +1 -1
- package/dist/{transport-xpzIjCIB.mjs → transport-fw-mKJzT.mjs} +1 -1
- package/dist/{transport-xpzIjCIB.mjs.map → transport-fw-mKJzT.mjs.map} +1 -1
- package/dist/trusted-proxy-CJhQIk65.mjs +51 -0
- package/dist/trusted-proxy-CJhQIk65.mjs.map +1 -0
- package/dist/{types-DgSc9Rpc.d.mts → types-B05e2naf.d.mts} +5 -59
- package/dist/types-B05e2naf.d.mts.map +1 -0
- package/dist/{types-B1gLSAH2.d.mts → types-BWhaSS7U.d.mts} +2 -75
- package/dist/types-BWhaSS7U.d.mts.map +1 -0
- package/dist/{types-BQx6ZXpR.d.mts → types-C1KKK4VP.d.mts} +3 -1
- package/dist/{types-BQx6ZXpR.d.mts.map → types-C1KKK4VP.d.mts.map} +1 -1
- package/dist/types-Cb2UCDJg.d.mts +345 -0
- package/dist/types-Cb2UCDJg.d.mts.map +1 -0
- package/dist/{types-BIgulNsW.mjs → types-CwXMEPRr.mjs} +10 -3
- package/dist/types-CwXMEPRr.mjs.map +1 -0
- package/dist/{types-B_CXXnzh.d.mts → types-CzvJd1ND.d.mts} +7 -1
- package/dist/{types-B_CXXnzh.d.mts.map → types-CzvJd1ND.d.mts.map} +1 -1
- package/dist/types-DFowNO60.d.mts +198 -0
- package/dist/types-DFowNO60.d.mts.map +1 -0
- package/dist/{types-56BKbld_.mjs → types-DSZl1Dsv.mjs} +1 -1
- package/dist/{types-56BKbld_.mjs.map → types-DSZl1Dsv.mjs.map} +1 -1
- package/dist/types-DW1l0gCv.d.mts +75 -0
- package/dist/types-DW1l0gCv.d.mts.map +1 -0
- package/dist/types-Db67HHlU.mjs +3 -0
- package/dist/{types-C-aFbqmA.d.mts → types-DmxPPXGf.d.mts} +1 -1
- package/dist/{types-C-aFbqmA.d.mts.map → types-DmxPPXGf.d.mts.map} +1 -1
- package/dist/{types-PafqtQuM.mjs → types-Dz9CGX_d.mjs} +1 -1
- package/dist/{types-PafqtQuM.mjs.map → types-Dz9CGX_d.mjs.map} +1 -1
- package/dist/user-Dr1bOCqS.mjs +155 -0
- package/dist/user-Dr1bOCqS.mjs.map +1 -0
- package/dist/utils-_F-rWBTN.mjs +286 -0
- package/dist/utils-_F-rWBTN.mjs.map +1 -0
- package/dist/{validate-BcC3m2O7.d.mts → validate-BpQGsmd7.d.mts} +5 -4
- package/dist/validate-BpQGsmd7.d.mts.map +1 -0
- package/dist/{validate-UK4Ja1uo.mjs → validate-DlFxcVVK.mjs} +3 -3
- package/dist/{validate-UK4Ja1uo.mjs.map → validate-DlFxcVVK.mjs.map} +1 -1
- package/dist/{validation-Vc5DQkJa.mjs → validation-BiFJqUp5.mjs} +6 -5
- package/dist/{validation-Vc5DQkJa.mjs.map → validation-BiFJqUp5.mjs.map} +1 -1
- package/dist/version-Dw7Z5PVU.mjs +7 -0
- package/dist/{version-BdP--J1g.mjs.map → version-Dw7Z5PVU.mjs.map} +1 -1
- package/dist/widgets-B9j_yzlk.mjs +106 -0
- package/dist/widgets-B9j_yzlk.mjs.map +1 -0
- package/dist/zod-generator-DSyz01KE.mjs +234 -0
- package/dist/zod-generator-DSyz01KE.mjs.map +1 -0
- package/locals.d.ts +1 -1
- package/package.json +37 -14
- package/src/api/handlers/content.ts +1 -0
- package/src/api/handlers/index.ts +7 -0
- package/src/api/handlers/marketplace.ts +27 -6
- package/src/api/handlers/menus.ts +157 -580
- package/src/api/handlers/plugins.ts +77 -31
- package/src/api/handlers/registry.ts +1086 -0
- package/src/api/openapi/document.ts +10 -4
- package/src/api/schemas/content.ts +1 -0
- package/src/api/schemas/menus.ts +27 -23
- package/src/api/types.ts +6 -0
- package/src/astro/integration/index.ts +1 -0
- package/src/astro/integration/route-naming.ts +19 -0
- package/src/astro/integration/routes.ts +25 -3
- package/src/astro/integration/runtime.ts +35 -8
- package/src/astro/middleware/auth.ts +8 -2
- package/src/astro/middleware/csp.ts +25 -3
- package/src/astro/middleware.ts +3 -0
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +10 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +107 -0
- package/src/astro/routes/api/auth/invite/register-options.ts +8 -1
- package/src/astro/routes/api/import/wordpress/execute.ts +185 -6
- package/src/astro/routes/api/menus/[name]/items/[id].ts +69 -0
- package/src/astro/routes/api/menus/[name]/items.ts +4 -65
- package/src/astro/types.ts +38 -0
- package/src/cli/wxr/parser.ts +263 -0
- package/src/client/index.ts +2 -1
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +166 -49
- package/src/database/migrations/038_registry_plugin_state.ts +130 -0
- package/src/database/migrations/039_fix_fts5_triggers.ts +264 -0
- package/src/database/migrations/runner.ts +4 -0
- package/src/database/repositories/content.ts +5 -1
- package/src/database/repositories/index.ts +14 -0
- package/src/database/repositories/menu.ts +644 -0
- package/src/database/repositories/types.ts +6 -0
- package/src/database/types.ts +5 -1
- package/src/emdash-runtime.ts +122 -34
- package/src/import/sources/wordpress-plugin.ts +9 -2
- package/src/import/sources/wxr.ts +16 -2
- package/src/import/ssrf.ts +20 -500
- package/src/import/wxr-taxonomies.ts +730 -0
- package/src/index.ts +3 -10
- package/src/media/normalize.ts +37 -4
- package/src/plugin-types.ts +240 -0
- package/src/plugins/adapt-sandbox-entry.ts +115 -39
- package/src/plugins/define-plugin.ts +34 -56
- package/src/plugins/index.ts +1 -9
- package/src/plugins/marketplace.ts +63 -4
- package/src/plugins/sandbox/index.ts +1 -1
- package/src/plugins/sandbox/noop.ts +2 -2
- package/src/plugins/sandbox/types.ts +7 -4
- package/src/plugins/state.ts +84 -38
- package/src/plugins/types.ts +2 -79
- package/src/registry/config.ts +311 -0
- package/src/registry/plugin-id.ts +116 -0
- package/src/registry/types.ts +206 -0
- package/src/search/fts-manager.ts +77 -15
- package/src/security/ssrf.ts +501 -0
- package/dist/apply-C1ZORgcy.mjs.map +0 -1
- package/dist/content-CERxPUN0.mjs.map +0 -1
- package/dist/error-D6LuHLw9.mjs +0 -27
- package/dist/error-D6LuHLw9.mjs.map +0 -1
- package/dist/index-Dlkzhb4C.d.mts.map +0 -1
- package/dist/placeholder-Ci0RLeCk.mjs +0 -268
- package/dist/placeholder-Ci0RLeCk.mjs.map +0 -1
- package/dist/registry-Do34mz_P.mjs.map +0 -1
- package/dist/runner-DIcU2UCC.mjs.map +0 -1
- package/dist/search-n-ZCMfr3.mjs +0 -9914
- package/dist/search-n-ZCMfr3.mjs.map +0 -1
- package/dist/settings-nTXPRi3D.mjs +0 -440
- package/dist/settings-nTXPRi3D.mjs.map +0 -1
- package/dist/types-B1gLSAH2.d.mts.map +0 -1
- package/dist/types-BIgulNsW.mjs.map +0 -1
- package/dist/types-Cug_RO3W.mjs +0 -16
- package/dist/types-Cug_RO3W.mjs.map +0 -1
- package/dist/types-DgSc9Rpc.d.mts.map +0 -1
- package/dist/validate-BcC3m2O7.d.mts.map +0 -1
- package/dist/version-BdP--J1g.mjs +0 -7
- package/dist/zod-generator-CHnJUP2l.mjs +0 -137
- package/dist/zod-generator-CHnJUP2l.mjs.map +0 -1
|
@@ -0,0 +1,879 @@
|
|
|
1
|
+
import { n as validateJsonFieldName } from "./validate-VPnKoIzW.mjs";
|
|
2
|
+
import { s as jsonExtractExpr } from "./dialect-helpers-BKCvISIQ.mjs";
|
|
3
|
+
import { t as ContentRepository } from "./content-D6YG26WG.mjs";
|
|
4
|
+
import { i as encodeCursor, r as decodeCursor } from "./types-CwXMEPRr.mjs";
|
|
5
|
+
import { t as MediaRepository } from "./media-Dg7he9uK.mjs";
|
|
6
|
+
import { t as UserRepository } from "./user-Dr1bOCqS.mjs";
|
|
7
|
+
import { t as OptionsRepository } from "./options-BL4X94qY.mjs";
|
|
8
|
+
import { t as withTransaction } from "./transaction-NQj4VJ7Z.mjs";
|
|
9
|
+
import { t as SeoRepository } from "./seo-DRq9-EPP.mjs";
|
|
10
|
+
import { o as invalidateSiteSettingsCache } from "./settings-xQKsWnzQ.mjs";
|
|
11
|
+
import { i as stripCredentialHeaders, n as resolveAndValidateExternalUrl, t as SsrfError } from "./ssrf-DzFN_qV-.mjs";
|
|
12
|
+
import { t as CronAccessImpl } from "./cron-H8eJ46dv.mjs";
|
|
13
|
+
import { sql } from "kysely";
|
|
14
|
+
import { ulid } from "ulidx";
|
|
15
|
+
|
|
16
|
+
//#region src/plugins/storage-query.ts
|
|
17
|
+
/**
|
|
18
|
+
* Error thrown when querying non-indexed fields
|
|
19
|
+
*/
|
|
20
|
+
var StorageQueryError = class extends Error {
|
|
21
|
+
constructor(message, field, suggestion) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.field = field;
|
|
24
|
+
this.suggestion = suggestion;
|
|
25
|
+
this.name = "StorageQueryError";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Check if a value is a range filter
|
|
30
|
+
*/
|
|
31
|
+
function isRangeFilter(value) {
|
|
32
|
+
if (typeof value !== "object" || value === null) return false;
|
|
33
|
+
return "gt" in value || "gte" in value || "lt" in value || "lte" in value;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if a value is an IN filter
|
|
37
|
+
*/
|
|
38
|
+
function isInFilter(value) {
|
|
39
|
+
if (typeof value !== "object" || value === null) return false;
|
|
40
|
+
return "in" in value && Array.isArray(value.in);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Check if a value is a startsWith filter
|
|
44
|
+
*/
|
|
45
|
+
function isStartsWithFilter(value) {
|
|
46
|
+
if (typeof value !== "object" || value === null) return false;
|
|
47
|
+
return "startsWith" in value && typeof value.startsWith === "string";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the set of indexed fields from index declarations
|
|
51
|
+
*/
|
|
52
|
+
function getIndexedFields(indexes) {
|
|
53
|
+
const fields = /* @__PURE__ */ new Set();
|
|
54
|
+
for (const index of indexes) if (Array.isArray(index)) for (const field of index) fields.add(field);
|
|
55
|
+
else fields.add(index);
|
|
56
|
+
return fields;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Validate that all fields in a where clause are indexed
|
|
60
|
+
*/
|
|
61
|
+
function validateWhereClause(where, indexedFields, pluginId, collection) {
|
|
62
|
+
for (const field of Object.keys(where)) if (!indexedFields.has(field)) throw new StorageQueryError(`Cannot query on non-indexed field '${field}'.`, field, `Add '${field}' to storage.${collection}.indexes in plugin '${pluginId}' to enable this query.`);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Validate orderBy fields are indexed
|
|
66
|
+
*/
|
|
67
|
+
function validateOrderByClause(orderBy, indexedFields, pluginId, collection) {
|
|
68
|
+
for (const field of Object.keys(orderBy)) if (!indexedFields.has(field)) throw new StorageQueryError(`Cannot order by non-indexed field '${field}'.`, field, `Add '${field}' to storage.${collection}.indexes in plugin '${pluginId}' to enable ordering by this field.`);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* SQL expression for extracting JSON field.
|
|
72
|
+
*
|
|
73
|
+
* Validates the field name before interpolation to prevent SQL injection
|
|
74
|
+
* via crafted JSON path expressions.
|
|
75
|
+
*/
|
|
76
|
+
function jsonExtract(db, field) {
|
|
77
|
+
validateJsonFieldName(field, "query field name");
|
|
78
|
+
return jsonExtractExpr(db, "data", field);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Build a WHERE clause condition for a single field
|
|
82
|
+
*/
|
|
83
|
+
function buildCondition(db, field, value) {
|
|
84
|
+
const extract = jsonExtract(db, field);
|
|
85
|
+
if (value === null) return {
|
|
86
|
+
sql: `${extract} IS NULL`,
|
|
87
|
+
params: []
|
|
88
|
+
};
|
|
89
|
+
if (typeof value === "string" || typeof value === "number") return {
|
|
90
|
+
sql: `${extract} = ?`,
|
|
91
|
+
params: [value]
|
|
92
|
+
};
|
|
93
|
+
if (typeof value === "boolean") return {
|
|
94
|
+
sql: `${extract} = ?`,
|
|
95
|
+
params: [value]
|
|
96
|
+
};
|
|
97
|
+
if (isInFilter(value)) return {
|
|
98
|
+
sql: `${extract} IN (${value.in.map(() => "?").join(", ")})`,
|
|
99
|
+
params: value.in
|
|
100
|
+
};
|
|
101
|
+
if (isStartsWithFilter(value)) return {
|
|
102
|
+
sql: `${extract} LIKE ?`,
|
|
103
|
+
params: [`${value.startsWith}%`]
|
|
104
|
+
};
|
|
105
|
+
if (isRangeFilter(value)) {
|
|
106
|
+
const conditions = [];
|
|
107
|
+
const params = [];
|
|
108
|
+
if (value.gt !== void 0) {
|
|
109
|
+
conditions.push(`${extract} > ?`);
|
|
110
|
+
params.push(value.gt);
|
|
111
|
+
}
|
|
112
|
+
if (value.gte !== void 0) {
|
|
113
|
+
conditions.push(`${extract} >= ?`);
|
|
114
|
+
params.push(value.gte);
|
|
115
|
+
}
|
|
116
|
+
if (value.lt !== void 0) {
|
|
117
|
+
conditions.push(`${extract} < ?`);
|
|
118
|
+
params.push(value.lt);
|
|
119
|
+
}
|
|
120
|
+
if (value.lte !== void 0) {
|
|
121
|
+
conditions.push(`${extract} <= ?`);
|
|
122
|
+
params.push(value.lte);
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
sql: conditions.join(" AND "),
|
|
126
|
+
params
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
throw new StorageQueryError(`Unknown filter type for field '${field}'`);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Build a complete WHERE clause from a WhereClause object
|
|
133
|
+
*/
|
|
134
|
+
function buildWhereClause(db, where) {
|
|
135
|
+
const conditions = [];
|
|
136
|
+
const params = [];
|
|
137
|
+
for (const [field, value] of Object.entries(where)) {
|
|
138
|
+
const condition = buildCondition(db, field, value);
|
|
139
|
+
conditions.push(condition.sql);
|
|
140
|
+
params.push(...condition.params);
|
|
141
|
+
}
|
|
142
|
+
if (conditions.length === 0) return {
|
|
143
|
+
sql: "",
|
|
144
|
+
params: []
|
|
145
|
+
};
|
|
146
|
+
return {
|
|
147
|
+
sql: conditions.join(" AND "),
|
|
148
|
+
params
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/database/repositories/plugin-storage.ts
|
|
154
|
+
/**
|
|
155
|
+
* Plugin Storage Repository
|
|
156
|
+
*
|
|
157
|
+
* Implements the StorageCollection interface for a specific plugin and collection.
|
|
158
|
+
*/
|
|
159
|
+
var PluginStorageRepository = class {
|
|
160
|
+
indexedFields;
|
|
161
|
+
constructor(db, pluginId, collection, indexes) {
|
|
162
|
+
this.db = db;
|
|
163
|
+
this.pluginId = pluginId;
|
|
164
|
+
this.collection = collection;
|
|
165
|
+
this.indexedFields = getIndexedFields(indexes);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Get a document by ID
|
|
169
|
+
*/
|
|
170
|
+
async get(id) {
|
|
171
|
+
const row = await this.db.selectFrom("_plugin_storage").select("data").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst();
|
|
172
|
+
if (!row) return null;
|
|
173
|
+
return JSON.parse(row.data);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Store a document
|
|
177
|
+
*/
|
|
178
|
+
async put(id, data) {
|
|
179
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
180
|
+
const jsonData = JSON.stringify(data);
|
|
181
|
+
await this.db.insertInto("_plugin_storage").values({
|
|
182
|
+
plugin_id: this.pluginId,
|
|
183
|
+
collection: this.collection,
|
|
184
|
+
id,
|
|
185
|
+
data: jsonData,
|
|
186
|
+
created_at: now,
|
|
187
|
+
updated_at: now
|
|
188
|
+
}).onConflict((oc) => oc.columns([
|
|
189
|
+
"plugin_id",
|
|
190
|
+
"collection",
|
|
191
|
+
"id"
|
|
192
|
+
]).doUpdateSet({
|
|
193
|
+
data: jsonData,
|
|
194
|
+
updated_at: now
|
|
195
|
+
})).execute();
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Delete a document
|
|
199
|
+
*/
|
|
200
|
+
async delete(id) {
|
|
201
|
+
return ((await this.db.deleteFrom("_plugin_storage").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst()).numDeletedRows ?? 0) > 0;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Check if a document exists
|
|
205
|
+
*/
|
|
206
|
+
async exists(id) {
|
|
207
|
+
return !!await this.db.selectFrom("_plugin_storage").select("id").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "=", id).executeTakeFirst();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Get multiple documents by ID
|
|
211
|
+
*/
|
|
212
|
+
async getMany(ids) {
|
|
213
|
+
if (ids.length === 0) return /* @__PURE__ */ new Map();
|
|
214
|
+
const rows = await this.db.selectFrom("_plugin_storage").select(["id", "data"]).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "in", ids).execute();
|
|
215
|
+
const result = /* @__PURE__ */ new Map();
|
|
216
|
+
for (const row of rows) result.set(row.id, JSON.parse(row.data));
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Store multiple documents
|
|
221
|
+
*/
|
|
222
|
+
async putMany(items) {
|
|
223
|
+
if (items.length === 0) return;
|
|
224
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
225
|
+
await withTransaction(this.db, async (trx) => {
|
|
226
|
+
for (const item of items) {
|
|
227
|
+
const jsonData = JSON.stringify(item.data);
|
|
228
|
+
await trx.insertInto("_plugin_storage").values({
|
|
229
|
+
plugin_id: this.pluginId,
|
|
230
|
+
collection: this.collection,
|
|
231
|
+
id: item.id,
|
|
232
|
+
data: jsonData,
|
|
233
|
+
created_at: now,
|
|
234
|
+
updated_at: now
|
|
235
|
+
}).onConflict((oc) => oc.columns([
|
|
236
|
+
"plugin_id",
|
|
237
|
+
"collection",
|
|
238
|
+
"id"
|
|
239
|
+
]).doUpdateSet({
|
|
240
|
+
data: jsonData,
|
|
241
|
+
updated_at: now
|
|
242
|
+
})).execute();
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Delete multiple documents
|
|
248
|
+
*/
|
|
249
|
+
async deleteMany(ids) {
|
|
250
|
+
if (ids.length === 0) return 0;
|
|
251
|
+
const result = await this.db.deleteFrom("_plugin_storage").where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection).where("id", "in", ids).executeTakeFirst();
|
|
252
|
+
return Number(result.numDeletedRows ?? 0);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Query documents with filters
|
|
256
|
+
*/
|
|
257
|
+
async query(options = {}) {
|
|
258
|
+
const { where = {}, orderBy = {}, cursor } = options;
|
|
259
|
+
const limit = Math.min(options.limit ?? 50, 100);
|
|
260
|
+
validateWhereClause(where, this.indexedFields, this.pluginId, this.collection);
|
|
261
|
+
if (Object.keys(orderBy).length > 0) validateOrderByClause(orderBy, this.indexedFields, this.pluginId, this.collection);
|
|
262
|
+
let query = this.db.selectFrom("_plugin_storage").select([
|
|
263
|
+
"id",
|
|
264
|
+
"data",
|
|
265
|
+
"created_at"
|
|
266
|
+
]).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection);
|
|
267
|
+
const whereResult = buildWhereClause(this.db, where);
|
|
268
|
+
if (whereResult.sql) {
|
|
269
|
+
const whereSqlParts = [];
|
|
270
|
+
let paramIndex = 0;
|
|
271
|
+
const sqlParts = whereResult.sql.split("?");
|
|
272
|
+
for (let i = 0; i < sqlParts.length; i++) {
|
|
273
|
+
if (i > 0) whereSqlParts.push(sql`${whereResult.params[paramIndex++]}`);
|
|
274
|
+
if (sqlParts[i]) whereSqlParts.push(sql.raw(sqlParts[i]));
|
|
275
|
+
}
|
|
276
|
+
query = query.where(({ eb }) => eb(sql.join(whereSqlParts, sql.raw("")), "=", sql.raw("1")));
|
|
277
|
+
}
|
|
278
|
+
if (cursor) {
|
|
279
|
+
const decoded = decodeCursor(cursor);
|
|
280
|
+
query = query.where(({ eb }) => eb(sql`(created_at, id)`, ">", sql`(${decoded.orderValue}, ${decoded.id})`));
|
|
281
|
+
}
|
|
282
|
+
if (Object.keys(orderBy).length > 0) for (const [field, direction] of Object.entries(orderBy)) {
|
|
283
|
+
const extract = jsonExtract(this.db, field);
|
|
284
|
+
const orderExpr = direction === "desc" ? sql`${sql.raw(extract)} desc` : sql`${sql.raw(extract)} asc`;
|
|
285
|
+
query = query.orderBy(orderExpr);
|
|
286
|
+
}
|
|
287
|
+
else query = query.orderBy("created_at", "asc").orderBy("id", "asc");
|
|
288
|
+
query = query.limit(limit + 1);
|
|
289
|
+
const rows = await query.execute();
|
|
290
|
+
const hasMore = rows.length > limit;
|
|
291
|
+
const items = rows.slice(0, limit).map((row) => ({
|
|
292
|
+
id: row.id,
|
|
293
|
+
data: JSON.parse(row.data)
|
|
294
|
+
}));
|
|
295
|
+
let nextCursor;
|
|
296
|
+
if (hasMore) {
|
|
297
|
+
const lastItem = rows[limit - 1];
|
|
298
|
+
if (lastItem) nextCursor = encodeCursor(lastItem.created_at, lastItem.id);
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
items,
|
|
302
|
+
cursor: nextCursor,
|
|
303
|
+
hasMore
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Count documents matching a filter
|
|
308
|
+
*/
|
|
309
|
+
async count(where) {
|
|
310
|
+
if (where && Object.keys(where).length > 0) validateWhereClause(where, this.indexedFields, this.pluginId, this.collection);
|
|
311
|
+
let query = this.db.selectFrom("_plugin_storage").select(sql`COUNT(*)`.as("count")).where("plugin_id", "=", this.pluginId).where("collection", "=", this.collection);
|
|
312
|
+
if (where && Object.keys(where).length > 0) {
|
|
313
|
+
const whereResult = buildWhereClause(this.db, where);
|
|
314
|
+
if (whereResult.sql) {
|
|
315
|
+
const whereSqlParts = [];
|
|
316
|
+
let paramIndex = 0;
|
|
317
|
+
const sqlParts = whereResult.sql.split("?");
|
|
318
|
+
for (let i = 0; i < sqlParts.length; i++) {
|
|
319
|
+
if (i > 0) whereSqlParts.push(sql`${whereResult.params[paramIndex++]}`);
|
|
320
|
+
if (sqlParts[i]) whereSqlParts.push(sql.raw(sqlParts[i]));
|
|
321
|
+
}
|
|
322
|
+
query = query.where(({ eb }) => eb(sql.join(whereSqlParts, sql.raw("")), "=", sql.raw("1")));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return (await query.executeTakeFirst())?.count ?? 0;
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region src/plugins/context.ts
|
|
331
|
+
/**
|
|
332
|
+
* Create KV accessor for a plugin
|
|
333
|
+
* All keys are automatically prefixed with the plugin ID
|
|
334
|
+
*/
|
|
335
|
+
function createKVAccess(optionsRepo, pluginId) {
|
|
336
|
+
const prefix = `plugin:${pluginId}:`;
|
|
337
|
+
return {
|
|
338
|
+
async get(key) {
|
|
339
|
+
return optionsRepo.get(`${prefix}${key}`);
|
|
340
|
+
},
|
|
341
|
+
async set(key, value) {
|
|
342
|
+
await optionsRepo.set(`${prefix}${key}`, value);
|
|
343
|
+
},
|
|
344
|
+
async delete(key) {
|
|
345
|
+
return optionsRepo.delete(`${prefix}${key}`);
|
|
346
|
+
},
|
|
347
|
+
async list(keyPrefix) {
|
|
348
|
+
const fullPrefix = `${prefix}${keyPrefix ?? ""}`;
|
|
349
|
+
const entriesMap = await optionsRepo.getByPrefix(fullPrefix);
|
|
350
|
+
const result = [];
|
|
351
|
+
for (const [fullKey, value] of entriesMap) result.push({
|
|
352
|
+
key: fullKey.slice(prefix.length),
|
|
353
|
+
value
|
|
354
|
+
});
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Create storage collection accessor for a plugin
|
|
361
|
+
* Wraps PluginStorageRepository with the v2 interface (no async iterators)
|
|
362
|
+
*/
|
|
363
|
+
function createStorageCollection(db, pluginId, collectionName, indexes) {
|
|
364
|
+
const repo = new PluginStorageRepository(db, pluginId, collectionName, indexes);
|
|
365
|
+
return {
|
|
366
|
+
get: (id) => repo.get(id),
|
|
367
|
+
put: (id, data) => repo.put(id, data),
|
|
368
|
+
delete: (id) => repo.delete(id),
|
|
369
|
+
exists: (id) => repo.exists(id),
|
|
370
|
+
getMany: (ids) => repo.getMany(ids),
|
|
371
|
+
putMany: (items) => repo.putMany(items),
|
|
372
|
+
deleteMany: (ids) => repo.deleteMany(ids),
|
|
373
|
+
count: (where) => repo.count(where),
|
|
374
|
+
async query(options) {
|
|
375
|
+
const result = await repo.query({
|
|
376
|
+
where: options?.where,
|
|
377
|
+
orderBy: options?.orderBy,
|
|
378
|
+
limit: options?.limit,
|
|
379
|
+
cursor: options?.cursor
|
|
380
|
+
});
|
|
381
|
+
return {
|
|
382
|
+
items: result.items,
|
|
383
|
+
cursor: result.cursor,
|
|
384
|
+
hasMore: result.hasMore
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Create storage accessor with all declared collections
|
|
391
|
+
*/
|
|
392
|
+
function createStorageAccess(db, pluginId, storageConfig) {
|
|
393
|
+
const storage = {};
|
|
394
|
+
for (const [collectionName, config] of Object.entries(storageConfig)) storage[collectionName] = createStorageCollection(db, pluginId, collectionName, [...config.indexes, ...config.uniqueIndexes ?? []]);
|
|
395
|
+
return storage;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Extract `seo` from a plugin-supplied content write input and return both
|
|
399
|
+
* parts. Mutates nothing — returns a new field map without the `seo` key.
|
|
400
|
+
*/
|
|
401
|
+
function splitSeoFromInput(input) {
|
|
402
|
+
const { seo, ...fields } = input;
|
|
403
|
+
if (seo !== void 0 && (seo === null || typeof seo !== "object" || Array.isArray(seo))) throw new Error("content.seo must be an object");
|
|
404
|
+
return {
|
|
405
|
+
fields,
|
|
406
|
+
seo
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Reject writing SEO to a collection that does not have it enabled.
|
|
411
|
+
* Matches the REST API behavior (VALIDATION_ERROR).
|
|
412
|
+
*/
|
|
413
|
+
async function assertSeoEnabled(seoRepo, collection, seo) {
|
|
414
|
+
const hasSeo = await seoRepo.isEnabled(collection);
|
|
415
|
+
if (seo !== void 0 && !hasSeo) throw new Error(`Collection "${collection}" does not have SEO enabled. Remove the seo field or enable SEO on this collection.`);
|
|
416
|
+
return hasSeo;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Create read-only content access
|
|
420
|
+
*/
|
|
421
|
+
function createContentAccess(db) {
|
|
422
|
+
const contentRepo = new ContentRepository(db);
|
|
423
|
+
const seoRepo = new SeoRepository(db);
|
|
424
|
+
return {
|
|
425
|
+
async get(collection, id) {
|
|
426
|
+
const item = await contentRepo.findById(collection, id);
|
|
427
|
+
if (!item) return null;
|
|
428
|
+
const result = {
|
|
429
|
+
id: item.id,
|
|
430
|
+
type: item.type,
|
|
431
|
+
slug: item.slug,
|
|
432
|
+
status: item.status,
|
|
433
|
+
data: item.data,
|
|
434
|
+
createdAt: item.createdAt,
|
|
435
|
+
updatedAt: item.updatedAt,
|
|
436
|
+
locale: item.locale,
|
|
437
|
+
publishedAt: item.publishedAt
|
|
438
|
+
};
|
|
439
|
+
if (await seoRepo.isEnabled(collection)) result.seo = await seoRepo.get(collection, item.id);
|
|
440
|
+
return result;
|
|
441
|
+
},
|
|
442
|
+
async list(collection, options) {
|
|
443
|
+
let orderBy;
|
|
444
|
+
if (options?.orderBy) {
|
|
445
|
+
const first = Object.entries(options.orderBy)[0];
|
|
446
|
+
if (first) orderBy = {
|
|
447
|
+
field: first[0],
|
|
448
|
+
direction: first[1]
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
const result = await contentRepo.findMany(collection, {
|
|
452
|
+
limit: options?.limit ?? 50,
|
|
453
|
+
cursor: options?.cursor,
|
|
454
|
+
orderBy,
|
|
455
|
+
where: options?.where
|
|
456
|
+
});
|
|
457
|
+
const items = result.items.map((item) => ({
|
|
458
|
+
id: item.id,
|
|
459
|
+
type: item.type,
|
|
460
|
+
slug: item.slug,
|
|
461
|
+
status: item.status,
|
|
462
|
+
data: item.data,
|
|
463
|
+
createdAt: item.createdAt,
|
|
464
|
+
updatedAt: item.updatedAt,
|
|
465
|
+
locale: item.locale,
|
|
466
|
+
publishedAt: item.publishedAt
|
|
467
|
+
}));
|
|
468
|
+
if (items.length > 0 && await seoRepo.isEnabled(collection)) {
|
|
469
|
+
const seoMap = await seoRepo.getMany(collection, items.map((i) => i.id));
|
|
470
|
+
for (const item of items) {
|
|
471
|
+
const seo = seoMap.get(item.id);
|
|
472
|
+
if (seo) item.seo = seo;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return {
|
|
476
|
+
items,
|
|
477
|
+
cursor: result.nextCursor,
|
|
478
|
+
hasMore: !!result.nextCursor
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Create full content access with write operations.
|
|
485
|
+
*
|
|
486
|
+
* `create` and `update` accept a reserved `seo` key in their `data`
|
|
487
|
+
* argument. When present, it is routed to the core SEO panel
|
|
488
|
+
* (`_emdash_seo`) via `SeoRepository.upsert`, in the same transaction as
|
|
489
|
+
* the content write. The returned `ContentItem.seo` reflects the resulting
|
|
490
|
+
* SEO state for SEO-enabled collections.
|
|
491
|
+
*/
|
|
492
|
+
function createContentAccessWithWrite(db) {
|
|
493
|
+
return {
|
|
494
|
+
...createContentAccess(db),
|
|
495
|
+
async create(collection, data) {
|
|
496
|
+
const { fields, seo } = splitSeoFromInput(data);
|
|
497
|
+
return withTransaction(db, async (trx) => {
|
|
498
|
+
const trxContentRepo = new ContentRepository(trx);
|
|
499
|
+
const trxSeoRepo = new SeoRepository(trx);
|
|
500
|
+
const hasSeo = await assertSeoEnabled(trxSeoRepo, collection, seo);
|
|
501
|
+
const item = await trxContentRepo.create({
|
|
502
|
+
type: collection,
|
|
503
|
+
data: fields
|
|
504
|
+
});
|
|
505
|
+
const result = {
|
|
506
|
+
id: item.id,
|
|
507
|
+
type: item.type,
|
|
508
|
+
slug: item.slug,
|
|
509
|
+
status: item.status,
|
|
510
|
+
data: item.data,
|
|
511
|
+
createdAt: item.createdAt,
|
|
512
|
+
updatedAt: item.updatedAt,
|
|
513
|
+
locale: item.locale,
|
|
514
|
+
publishedAt: item.publishedAt
|
|
515
|
+
};
|
|
516
|
+
if (hasSeo) result.seo = seo !== void 0 ? await trxSeoRepo.upsert(collection, item.id, seo) : await trxSeoRepo.get(collection, item.id);
|
|
517
|
+
return result;
|
|
518
|
+
});
|
|
519
|
+
},
|
|
520
|
+
async update(collection, id, data) {
|
|
521
|
+
const { fields, seo } = splitSeoFromInput(data);
|
|
522
|
+
return withTransaction(db, async (trx) => {
|
|
523
|
+
const trxContentRepo = new ContentRepository(trx);
|
|
524
|
+
const trxSeoRepo = new SeoRepository(trx);
|
|
525
|
+
const hasSeo = await assertSeoEnabled(trxSeoRepo, collection, seo);
|
|
526
|
+
const item = Object.keys(fields).length > 0 ? await trxContentRepo.update(collection, id, { data: fields }) : await (async () => {
|
|
527
|
+
const existing = await trxContentRepo.findById(collection, id);
|
|
528
|
+
if (!existing) throw new Error("Content not found");
|
|
529
|
+
return existing;
|
|
530
|
+
})();
|
|
531
|
+
const result = {
|
|
532
|
+
id: item.id,
|
|
533
|
+
type: item.type,
|
|
534
|
+
slug: item.slug,
|
|
535
|
+
status: item.status,
|
|
536
|
+
data: item.data,
|
|
537
|
+
createdAt: item.createdAt,
|
|
538
|
+
updatedAt: item.updatedAt,
|
|
539
|
+
locale: item.locale,
|
|
540
|
+
publishedAt: item.publishedAt
|
|
541
|
+
};
|
|
542
|
+
if (hasSeo) result.seo = seo !== void 0 ? await trxSeoRepo.upsert(collection, item.id, seo) : await trxSeoRepo.get(collection, item.id);
|
|
543
|
+
return result;
|
|
544
|
+
});
|
|
545
|
+
},
|
|
546
|
+
async delete(collection, id) {
|
|
547
|
+
return new ContentRepository(db).delete(collection, id);
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Create read-only media access
|
|
553
|
+
*/
|
|
554
|
+
function createMediaAccess(db) {
|
|
555
|
+
const mediaRepo = new MediaRepository(db);
|
|
556
|
+
return {
|
|
557
|
+
async get(id) {
|
|
558
|
+
const item = await mediaRepo.findById(id);
|
|
559
|
+
if (!item) return null;
|
|
560
|
+
return {
|
|
561
|
+
id: item.id,
|
|
562
|
+
filename: item.filename,
|
|
563
|
+
mimeType: item.mimeType,
|
|
564
|
+
size: item.size,
|
|
565
|
+
url: `/media/${item.id}/${item.filename}`,
|
|
566
|
+
createdAt: item.createdAt
|
|
567
|
+
};
|
|
568
|
+
},
|
|
569
|
+
async list(options) {
|
|
570
|
+
const result = await mediaRepo.findMany({
|
|
571
|
+
limit: options?.limit ?? 50,
|
|
572
|
+
cursor: options?.cursor,
|
|
573
|
+
mimeType: options?.mimeType
|
|
574
|
+
});
|
|
575
|
+
return {
|
|
576
|
+
items: result.items.map((item) => ({
|
|
577
|
+
id: item.id,
|
|
578
|
+
filename: item.filename,
|
|
579
|
+
mimeType: item.mimeType,
|
|
580
|
+
size: item.size,
|
|
581
|
+
url: `/media/${item.id}/${item.filename}`,
|
|
582
|
+
createdAt: item.createdAt
|
|
583
|
+
})),
|
|
584
|
+
cursor: result.nextCursor,
|
|
585
|
+
hasMore: !!result.nextCursor
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Create full media access with write operations.
|
|
592
|
+
* If storage is not provided, upload() will throw at call time.
|
|
593
|
+
*/
|
|
594
|
+
function createMediaAccessWithWrite(db, getUploadUrlFn, storage) {
|
|
595
|
+
const mediaRepo = new MediaRepository(db);
|
|
596
|
+
return {
|
|
597
|
+
...createMediaAccess(db),
|
|
598
|
+
getUploadUrl: getUploadUrlFn,
|
|
599
|
+
async upload(filename, contentType, bytes) {
|
|
600
|
+
if (!storage) throw new Error("Media upload() requires a storage backend. Configure storage in PluginContextFactoryOptions.");
|
|
601
|
+
const keyPrefix = ulid();
|
|
602
|
+
const basename = filename.split("/").pop() ?? filename;
|
|
603
|
+
const dotIdx = basename.lastIndexOf(".");
|
|
604
|
+
const storageKey = `${keyPrefix}${dotIdx > 0 ? basename.slice(dotIdx).toLowerCase() : ""}`;
|
|
605
|
+
await storage.upload({
|
|
606
|
+
key: storageKey,
|
|
607
|
+
body: new Uint8Array(bytes),
|
|
608
|
+
contentType
|
|
609
|
+
});
|
|
610
|
+
let media;
|
|
611
|
+
try {
|
|
612
|
+
media = await mediaRepo.create({
|
|
613
|
+
filename: basename,
|
|
614
|
+
mimeType: contentType,
|
|
615
|
+
size: bytes.byteLength,
|
|
616
|
+
storageKey,
|
|
617
|
+
status: "ready"
|
|
618
|
+
});
|
|
619
|
+
} catch (error) {
|
|
620
|
+
try {
|
|
621
|
+
await storage.delete(storageKey);
|
|
622
|
+
} catch {}
|
|
623
|
+
throw error;
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
mediaId: media.id,
|
|
627
|
+
storageKey,
|
|
628
|
+
url: `/_emdash/api/media/file/${storageKey}`
|
|
629
|
+
};
|
|
630
|
+
},
|
|
631
|
+
async delete(id) {
|
|
632
|
+
const deleted = await mediaRepo.delete(id);
|
|
633
|
+
if (deleted) invalidateSiteSettingsCache();
|
|
634
|
+
return deleted;
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
/** Maximum number of redirects to follow in plugin HTTP access */
|
|
639
|
+
const MAX_PLUGIN_REDIRECTS = 5;
|
|
640
|
+
/**
|
|
641
|
+
* Check if a hostname matches any pattern in the allowed list.
|
|
642
|
+
* Patterns: "*" matches all, "*.example.com" matches subdomains AND bare "example.com",
|
|
643
|
+
* "api.example.com" matches exactly.
|
|
644
|
+
*/
|
|
645
|
+
function isHostAllowed(host, allowedHosts) {
|
|
646
|
+
return allowedHosts.some((pattern) => {
|
|
647
|
+
if (pattern === "*") return true;
|
|
648
|
+
if (pattern.startsWith("*.")) {
|
|
649
|
+
const suffix = pattern.slice(1);
|
|
650
|
+
return host.endsWith(suffix) || host === pattern.slice(2);
|
|
651
|
+
}
|
|
652
|
+
return host === pattern;
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Create HTTP access with host validation.
|
|
657
|
+
*
|
|
658
|
+
* Uses redirect: "manual" to re-validate each redirect target against
|
|
659
|
+
* the allowedHosts list, preventing redirects to unauthorized hosts.
|
|
660
|
+
*/
|
|
661
|
+
function createHttpAccess(pluginId, allowedHosts) {
|
|
662
|
+
return { async fetch(url, init) {
|
|
663
|
+
if (allowedHosts.length === 0) throw new Error(`Plugin "${pluginId}" has no allowed hosts configured. Add hosts to the plugin's allowedHosts array to enable HTTP requests.`);
|
|
664
|
+
let currentUrl = url;
|
|
665
|
+
let currentInit = init;
|
|
666
|
+
for (let i = 0; i <= MAX_PLUGIN_REDIRECTS; i++) {
|
|
667
|
+
const hostname = new URL(currentUrl).hostname;
|
|
668
|
+
if (!isHostAllowed(hostname, allowedHosts)) throw new Error(`Plugin "${pluginId}" is not allowed to fetch from host "${hostname}". Allowed hosts: ${allowedHosts.join(", ")}`);
|
|
669
|
+
const response = await globalThis.fetch(currentUrl, {
|
|
670
|
+
...currentInit,
|
|
671
|
+
redirect: "manual"
|
|
672
|
+
});
|
|
673
|
+
if (response.status < 300 || response.status >= 400) return response;
|
|
674
|
+
const location = response.headers.get("Location");
|
|
675
|
+
if (!location) return response;
|
|
676
|
+
const previousOrigin = new URL(currentUrl).origin;
|
|
677
|
+
currentUrl = new URL(location, currentUrl).href;
|
|
678
|
+
if (previousOrigin !== new URL(currentUrl).origin && currentInit) currentInit = stripCredentialHeaders(currentInit);
|
|
679
|
+
}
|
|
680
|
+
throw new Error(`Plugin "${pluginId}": too many redirects (max ${MAX_PLUGIN_REDIRECTS})`);
|
|
681
|
+
} };
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Create unrestricted HTTP access (for plugins with network:fetch:any capability).
|
|
685
|
+
* No host validation, but applies SSRF protection on redirect targets to
|
|
686
|
+
* prevent plugins from being tricked into reaching internal services.
|
|
687
|
+
*/
|
|
688
|
+
function createUnrestrictedHttpAccess(pluginId) {
|
|
689
|
+
return { async fetch(url, init) {
|
|
690
|
+
let currentUrl = url;
|
|
691
|
+
let currentInit = init;
|
|
692
|
+
for (let i = 0; i <= MAX_PLUGIN_REDIRECTS; i++) {
|
|
693
|
+
try {
|
|
694
|
+
await resolveAndValidateExternalUrl(currentUrl);
|
|
695
|
+
} catch (e) {
|
|
696
|
+
const msg = e instanceof SsrfError ? e.message : "SSRF validation failed";
|
|
697
|
+
throw new Error(`Plugin "${pluginId}": blocked fetch to "${new URL(currentUrl).hostname}": ${msg}`, { cause: e });
|
|
698
|
+
}
|
|
699
|
+
const response = await globalThis.fetch(currentUrl, {
|
|
700
|
+
...currentInit,
|
|
701
|
+
redirect: "manual"
|
|
702
|
+
});
|
|
703
|
+
if (response.status < 300 || response.status >= 400) return response;
|
|
704
|
+
const location = response.headers.get("Location");
|
|
705
|
+
if (!location) return response;
|
|
706
|
+
const previousOrigin = new URL(currentUrl).origin;
|
|
707
|
+
currentUrl = new URL(location, currentUrl).href;
|
|
708
|
+
if (previousOrigin !== new URL(currentUrl).origin && currentInit) currentInit = stripCredentialHeaders(currentInit);
|
|
709
|
+
}
|
|
710
|
+
throw new Error(`Plugin "${pluginId}": too many redirects (max ${MAX_PLUGIN_REDIRECTS})`);
|
|
711
|
+
} };
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Create logger for a plugin
|
|
715
|
+
*/
|
|
716
|
+
function createLogAccess(pluginId) {
|
|
717
|
+
const prefix = `[plugin:${pluginId}]`;
|
|
718
|
+
return {
|
|
719
|
+
debug(message, data) {
|
|
720
|
+
if (data !== void 0) console.debug(prefix, message, data);
|
|
721
|
+
else console.debug(prefix, message);
|
|
722
|
+
},
|
|
723
|
+
info(message, data) {
|
|
724
|
+
if (data !== void 0) console.info(prefix, message, data);
|
|
725
|
+
else console.info(prefix, message);
|
|
726
|
+
},
|
|
727
|
+
warn(message, data) {
|
|
728
|
+
if (data !== void 0) console.warn(prefix, message, data);
|
|
729
|
+
else console.warn(prefix, message);
|
|
730
|
+
},
|
|
731
|
+
error(message, data) {
|
|
732
|
+
if (data !== void 0) console.error(prefix, message, data);
|
|
733
|
+
else console.error(prefix, message);
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
const TRAILING_SLASH_RE = /\/$/;
|
|
738
|
+
/**
|
|
739
|
+
* Create site info from config and settings.
|
|
740
|
+
*
|
|
741
|
+
* Resolution order for URL:
|
|
742
|
+
* 1. options table (emdash:site_url)
|
|
743
|
+
* 2. Astro `site` config
|
|
744
|
+
* 3. fallback to empty string
|
|
745
|
+
*/
|
|
746
|
+
function createSiteInfo(options) {
|
|
747
|
+
return {
|
|
748
|
+
name: options.siteName ?? "",
|
|
749
|
+
url: (options.siteUrl ?? "").replace(TRAILING_SLASH_RE, ""),
|
|
750
|
+
locale: options.locale ?? "en"
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Create a URL helper that generates absolute URLs from relative paths.
|
|
755
|
+
* Validates that path starts with "/" and rejects protocol-relative paths ("//").
|
|
756
|
+
*/
|
|
757
|
+
function createUrlHelper(siteUrl) {
|
|
758
|
+
const base = siteUrl.replace(TRAILING_SLASH_RE, "");
|
|
759
|
+
return (path) => {
|
|
760
|
+
if (!path.startsWith("/")) throw new Error(`URL path must start with "/", got: "${path}"`);
|
|
761
|
+
if (path.startsWith("//")) throw new Error(`URL path must not be protocol-relative, got: "${path}"`);
|
|
762
|
+
return `${base}${path}`;
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Convert a UserRepository user to the plugin-facing UserInfo shape.
|
|
767
|
+
* Strips sensitive fields (avatarUrl, emailVerified, data).
|
|
768
|
+
*/
|
|
769
|
+
function toUserInfo(user) {
|
|
770
|
+
return {
|
|
771
|
+
id: user.id,
|
|
772
|
+
email: user.email,
|
|
773
|
+
name: user.name,
|
|
774
|
+
role: user.role,
|
|
775
|
+
createdAt: user.createdAt
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Create read-only user access for plugins.
|
|
780
|
+
* Excludes sensitive fields (password hashes, sessions, passkeys, avatar URL, data).
|
|
781
|
+
*/
|
|
782
|
+
function createUserAccess(db) {
|
|
783
|
+
const userRepo = new UserRepository(db);
|
|
784
|
+
return {
|
|
785
|
+
async get(id) {
|
|
786
|
+
const user = await userRepo.findById(id);
|
|
787
|
+
if (!user) return null;
|
|
788
|
+
return toUserInfo(user);
|
|
789
|
+
},
|
|
790
|
+
async getByEmail(email) {
|
|
791
|
+
const user = await userRepo.findByEmail(email);
|
|
792
|
+
if (!user) return null;
|
|
793
|
+
return toUserInfo(user);
|
|
794
|
+
},
|
|
795
|
+
async list(opts) {
|
|
796
|
+
const result = await userRepo.findMany({
|
|
797
|
+
role: opts?.role,
|
|
798
|
+
cursor: opts?.cursor,
|
|
799
|
+
limit: opts?.limit
|
|
800
|
+
});
|
|
801
|
+
return {
|
|
802
|
+
items: result.items.map(toUserInfo),
|
|
803
|
+
nextCursor: result.nextCursor
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Factory for creating plugin contexts
|
|
810
|
+
*/
|
|
811
|
+
var PluginContextFactory = class {
|
|
812
|
+
optionsRepo;
|
|
813
|
+
db;
|
|
814
|
+
storage;
|
|
815
|
+
getUploadUrl;
|
|
816
|
+
site;
|
|
817
|
+
urlHelper;
|
|
818
|
+
cronReschedule;
|
|
819
|
+
emailPipeline;
|
|
820
|
+
constructor(options) {
|
|
821
|
+
this.db = options.db;
|
|
822
|
+
this.optionsRepo = new OptionsRepository(options.db);
|
|
823
|
+
this.storage = options.storage;
|
|
824
|
+
this.getUploadUrl = options.getUploadUrl;
|
|
825
|
+
this.site = createSiteInfo(options.siteInfo ?? {});
|
|
826
|
+
this.urlHelper = createUrlHelper(this.site.url);
|
|
827
|
+
this.cronReschedule = options.cronReschedule;
|
|
828
|
+
this.emailPipeline = options.emailPipeline;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Create the unified plugin context
|
|
832
|
+
*/
|
|
833
|
+
createContext(plugin) {
|
|
834
|
+
const capabilities = new Set(plugin.capabilities);
|
|
835
|
+
const kv = createKVAccess(this.optionsRepo, plugin.id);
|
|
836
|
+
const log = createLogAccess(plugin.id);
|
|
837
|
+
const storage = createStorageAccess(this.db, plugin.id, plugin.storage);
|
|
838
|
+
let content;
|
|
839
|
+
if (capabilities.has("content:write")) content = createContentAccessWithWrite(this.db);
|
|
840
|
+
else if (capabilities.has("content:read")) content = createContentAccess(this.db);
|
|
841
|
+
let media;
|
|
842
|
+
if (capabilities.has("media:write") && this.getUploadUrl) media = createMediaAccessWithWrite(this.db, this.getUploadUrl, this.storage);
|
|
843
|
+
else if (capabilities.has("media:read")) media = createMediaAccess(this.db);
|
|
844
|
+
let http;
|
|
845
|
+
if (capabilities.has("network:request:unrestricted")) http = createUnrestrictedHttpAccess(plugin.id);
|
|
846
|
+
else if (capabilities.has("network:request")) http = createHttpAccess(plugin.id, plugin.allowedHosts);
|
|
847
|
+
let users;
|
|
848
|
+
if (capabilities.has("users:read")) users = createUserAccess(this.db);
|
|
849
|
+
let cron;
|
|
850
|
+
if (this.cronReschedule) cron = new CronAccessImpl(this.db, plugin.id, this.cronReschedule);
|
|
851
|
+
let email;
|
|
852
|
+
if (capabilities.has("email:send") && this.emailPipeline?.isAvailable()) {
|
|
853
|
+
const pipeline = this.emailPipeline;
|
|
854
|
+
const pluginId = plugin.id;
|
|
855
|
+
email = { send: (message) => pipeline.send(message, pluginId) };
|
|
856
|
+
}
|
|
857
|
+
return {
|
|
858
|
+
plugin: {
|
|
859
|
+
id: plugin.id,
|
|
860
|
+
version: plugin.version
|
|
861
|
+
},
|
|
862
|
+
storage,
|
|
863
|
+
kv,
|
|
864
|
+
content,
|
|
865
|
+
media,
|
|
866
|
+
http,
|
|
867
|
+
log,
|
|
868
|
+
site: this.site,
|
|
869
|
+
url: this.urlHelper,
|
|
870
|
+
users,
|
|
871
|
+
cron,
|
|
872
|
+
email
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
//#endregion
|
|
878
|
+
export { createStorageAccess as n, PluginContextFactory as t };
|
|
879
|
+
//# sourceMappingURL=context-qF8d3IPR.mjs.map
|