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,49 @@
|
|
|
1
|
+
//#region src/astro/routes/api/import/wordpress/rewrite-url-helpers.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Strip query parameters from a URL for base matching
|
|
4
|
+
*/
|
|
5
|
+
declare function getBaseUrl(url: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Build a map of base URLs to new URLs for flexible matching
|
|
8
|
+
*/
|
|
9
|
+
declare function buildBaseUrlMap(urlMap: Record<string, string>): Map<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Find matching new URL for a given URL, checking exact, base, and WordPress image-size matches
|
|
12
|
+
*/
|
|
13
|
+
declare function findMatchingUrl(url: string, exactMap: Record<string, string>, baseMap: Map<string, string>): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Portable Text block type (simplified for URL rewriting)
|
|
16
|
+
*/
|
|
17
|
+
interface PortableTextBlock {
|
|
18
|
+
_type: string;
|
|
19
|
+
_key?: string;
|
|
20
|
+
asset?: {
|
|
21
|
+
_type?: string;
|
|
22
|
+
_ref?: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
};
|
|
25
|
+
link?: string;
|
|
26
|
+
images?: PortableTextBlock[];
|
|
27
|
+
columns?: Array<{
|
|
28
|
+
content?: PortableTextBlock[];
|
|
29
|
+
}>;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Rewrite URLs in a Portable Text array, returning whether any changes were made
|
|
34
|
+
*/
|
|
35
|
+
declare function rewritePortableTextUrls(blocks: PortableTextBlock[], exactMap: Record<string, string>, baseMap: Map<string, string>): {
|
|
36
|
+
changed: boolean;
|
|
37
|
+
urlsRewritten: number;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Rewrite URLs in a string field using simple string replacement
|
|
41
|
+
*/
|
|
42
|
+
declare function rewriteStringUrls(value: string, exactMap: Record<string, string>, baseMap: Map<string, string>): {
|
|
43
|
+
newValue: string;
|
|
44
|
+
changed: boolean;
|
|
45
|
+
urlsRewritten: number;
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
export { PortableTextBlock, buildBaseUrlMap, findMatchingUrl, getBaseUrl, rewritePortableTextUrls, rewriteStringUrls };
|
|
49
|
+
//# sourceMappingURL=rewrite-url-helpers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewrite-url-helpers.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts"],"mappings":";;AAOA;;iBAAgB,UAAA,CAAW,GAAA;;;AAa3B;iBAAgB,eAAA,CAAgB,MAAA,EAAQ,MAAA,mBAAyB,GAAA;;;;iBAYjD,eAAA,CACf,GAAA,UACA,QAAA,EAAU,MAAA,kBACV,OAAA,EAAS,GAAA;;;;UAuBO,iBAAA;EAChB,KAAA;EACA,IAAA;EACA,KAAA;IACC,KAAA;IACA,IAAA;IACA,GAAA;EAAA;EAED,IAAA;EAEA,MAAA,GAAS,iBAAA;EACT,OAAA,GAAU,KAAA;IAAQ,OAAA,GAAU,iBAAA;EAAA;EAAA,CAC3B,GAAA;AAAA;;;;iBAMc,uBAAA,CACf,MAAA,EAAQ,iBAAA,IACR,QAAA,EAAU,MAAA,kBACV,OAAA,EAAS,GAAA;EACL,OAAA;EAAkB,aAAA;AAAA;;;;iBAuDP,iBAAA,CACf,KAAA,UACA,QAAA,EAAU,MAAA,kBACV,OAAA,EAAS,GAAA;EACL,QAAA;EAAkB,OAAA;EAAkB,aAAA;AAAA"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//#region src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts
|
|
2
|
+
const REGEX_SPECIAL_CHARS = /[.*+?^${}()|[\]\\]/g;
|
|
3
|
+
const WORDPRESS_IMAGE_SIZE_SUFFIX = /-\d+x\d+(?=\.[^./?#]+$)/;
|
|
4
|
+
const BASE_URL_EXTENSION = /^(.+)(\.[^./?#]+)$/;
|
|
5
|
+
/**
|
|
6
|
+
* Strip query parameters from a URL for base matching
|
|
7
|
+
*/
|
|
8
|
+
function getBaseUrl(url) {
|
|
9
|
+
try {
|
|
10
|
+
const parsed = new URL(url);
|
|
11
|
+
return `${parsed.origin}${parsed.pathname}`;
|
|
12
|
+
} catch {
|
|
13
|
+
return url.split("?")[0] || url;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build a map of base URLs to new URLs for flexible matching
|
|
18
|
+
*/
|
|
19
|
+
function buildBaseUrlMap(urlMap) {
|
|
20
|
+
const baseMap = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const [oldUrl, newUrl] of Object.entries(urlMap)) {
|
|
22
|
+
const baseUrl = getBaseUrl(oldUrl);
|
|
23
|
+
baseMap.set(baseUrl, newUrl);
|
|
24
|
+
}
|
|
25
|
+
return baseMap;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Find matching new URL for a given URL, checking exact, base, and WordPress image-size matches
|
|
29
|
+
*/
|
|
30
|
+
function findMatchingUrl(url, exactMap, baseMap) {
|
|
31
|
+
if (exactMap[url]) return exactMap[url];
|
|
32
|
+
const baseUrl = getBaseUrl(url);
|
|
33
|
+
const baseMatch = baseMap.get(baseUrl);
|
|
34
|
+
if (baseMatch) return baseMatch;
|
|
35
|
+
const wordPressImageMatch = baseMap.get(stripWordPressImageSizeSuffix(baseUrl));
|
|
36
|
+
if (wordPressImageMatch) return wordPressImageMatch;
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Rewrite URLs in a Portable Text array, returning whether any changes were made
|
|
41
|
+
*/
|
|
42
|
+
function rewritePortableTextUrls(blocks, exactMap, baseMap) {
|
|
43
|
+
let changed = false;
|
|
44
|
+
let urlsRewritten = 0;
|
|
45
|
+
for (const block of blocks) {
|
|
46
|
+
if (block._type === "image" && block.asset?.url) {
|
|
47
|
+
const newUrl = findMatchingUrl(block.asset.url, exactMap, baseMap);
|
|
48
|
+
if (newUrl) {
|
|
49
|
+
block.asset.url = newUrl;
|
|
50
|
+
block.asset._ref = newUrl;
|
|
51
|
+
changed = true;
|
|
52
|
+
urlsRewritten++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (block._type === "image" && block.link) {
|
|
56
|
+
const newUrl = findMatchingUrl(block.link, exactMap, baseMap);
|
|
57
|
+
if (newUrl) {
|
|
58
|
+
block.link = newUrl;
|
|
59
|
+
changed = true;
|
|
60
|
+
urlsRewritten++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (block._type === "gallery" && Array.isArray(block.images)) {
|
|
64
|
+
const result = rewritePortableTextUrls(block.images, exactMap, baseMap);
|
|
65
|
+
if (result.changed) {
|
|
66
|
+
changed = true;
|
|
67
|
+
urlsRewritten += result.urlsRewritten;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (block._type === "columns" && Array.isArray(block.columns)) {
|
|
71
|
+
for (const column of block.columns) if (Array.isArray(column.content)) {
|
|
72
|
+
const result = rewritePortableTextUrls(column.content, exactMap, baseMap);
|
|
73
|
+
if (result.changed) {
|
|
74
|
+
changed = true;
|
|
75
|
+
urlsRewritten += result.urlsRewritten;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
changed,
|
|
82
|
+
urlsRewritten
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Rewrite URLs in a string field using simple string replacement
|
|
87
|
+
*/
|
|
88
|
+
function rewriteStringUrls(value, exactMap, baseMap) {
|
|
89
|
+
let newValue = value;
|
|
90
|
+
let changed = false;
|
|
91
|
+
let urlsRewritten = 0;
|
|
92
|
+
for (const [oldUrl, newUrl] of Object.entries(exactMap)) if (newValue.includes(oldUrl)) {
|
|
93
|
+
newValue = newValue.split(oldUrl).join(newUrl);
|
|
94
|
+
changed = true;
|
|
95
|
+
urlsRewritten++;
|
|
96
|
+
}
|
|
97
|
+
for (const [baseUrl, newUrl] of baseMap.entries()) {
|
|
98
|
+
const regex = buildBaseUrlMatchRegex(baseUrl);
|
|
99
|
+
const matches = newValue.match(regex);
|
|
100
|
+
if (matches) {
|
|
101
|
+
for (const match of matches) if (!exactMap[match]) {
|
|
102
|
+
newValue = newValue.split(match).join(newUrl);
|
|
103
|
+
changed = true;
|
|
104
|
+
urlsRewritten++;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
newValue,
|
|
110
|
+
changed,
|
|
111
|
+
urlsRewritten
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Escape special regex characters in a string
|
|
116
|
+
*/
|
|
117
|
+
function escapeRegExp(string) {
|
|
118
|
+
return string.replace(REGEX_SPECIAL_CHARS, "\\$&");
|
|
119
|
+
}
|
|
120
|
+
function stripWordPressImageSizeSuffix(url) {
|
|
121
|
+
return url.replace(WORDPRESS_IMAGE_SIZE_SUFFIX, "");
|
|
122
|
+
}
|
|
123
|
+
function buildBaseUrlMatchRegex(baseUrl) {
|
|
124
|
+
const extensionMatch = BASE_URL_EXTENSION.exec(baseUrl);
|
|
125
|
+
const basePattern = extensionMatch ? `${escapeRegExp(extensionMatch[1])}(?:-\\d+x\\d+)?${escapeRegExp(extensionMatch[2])}` : escapeRegExp(baseUrl);
|
|
126
|
+
return new RegExp(`${basePattern}(\\?[^"'\\s]*)?(?=$|["'\\s<>)\\],;:!?]|\\.(?=$|["'\\s<>)\\]]))`, "g");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//#endregion
|
|
130
|
+
export { buildBaseUrlMap, findMatchingUrl, getBaseUrl, rewritePortableTextUrls, rewriteStringUrls };
|
|
131
|
+
//# sourceMappingURL=rewrite-url-helpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewrite-url-helpers.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts"],"sourcesContent":["const REGEX_SPECIAL_CHARS = /[.*+?^${}()|[\\]\\\\]/g;\nconst WORDPRESS_IMAGE_SIZE_SUFFIX = /-\\d+x\\d+(?=\\.[^./?#]+$)/;\nconst BASE_URL_EXTENSION = /^(.+)(\\.[^./?#]+)$/;\n\n/**\n * Strip query parameters from a URL for base matching\n */\nexport function getBaseUrl(url: string): string {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\treturn `${parsed.origin}${parsed.pathname}`;\n\t} catch {\n\t\t// If URL parsing fails, try simple string split\n\t\treturn url.split(\"?\")[0] || url;\n\t}\n}\n\n/**\n * Build a map of base URLs to new URLs for flexible matching\n */\nexport function buildBaseUrlMap(urlMap: Record<string, string>): Map<string, string> {\n\tconst baseMap = new Map<string, string>();\n\tfor (const [oldUrl, newUrl] of Object.entries(urlMap)) {\n\t\tconst baseUrl = getBaseUrl(oldUrl);\n\t\tbaseMap.set(baseUrl, newUrl);\n\t}\n\treturn baseMap;\n}\n\n/**\n * Find matching new URL for a given URL, checking exact, base, and WordPress image-size matches\n */\nexport function findMatchingUrl(\n\turl: string,\n\texactMap: Record<string, string>,\n\tbaseMap: Map<string, string>,\n): string | null {\n\tif (exactMap[url]) {\n\t\treturn exactMap[url];\n\t}\n\n\tconst baseUrl = getBaseUrl(url);\n\tconst baseMatch = baseMap.get(baseUrl);\n\tif (baseMatch) {\n\t\treturn baseMatch;\n\t}\n\n\tconst wordPressImageMatch = baseMap.get(stripWordPressImageSizeSuffix(baseUrl));\n\tif (wordPressImageMatch) {\n\t\treturn wordPressImageMatch;\n\t}\n\n\treturn null;\n}\n\n/**\n * Portable Text block type (simplified for URL rewriting)\n */\nexport interface PortableTextBlock {\n\t_type: string;\n\t_key?: string;\n\tasset?: {\n\t\t_type?: string;\n\t\t_ref?: string;\n\t\turl?: string;\n\t};\n\tlink?: string;\n\t// For nested content like galleries\n\timages?: PortableTextBlock[];\n\tcolumns?: Array<{ content?: PortableTextBlock[] }>;\n\t[key: string]: unknown;\n}\n\n/**\n * Rewrite URLs in a Portable Text array, returning whether any changes were made\n */\nexport function rewritePortableTextUrls(\n\tblocks: PortableTextBlock[],\n\texactMap: Record<string, string>,\n\tbaseMap: Map<string, string>,\n): { changed: boolean; urlsRewritten: number } {\n\tlet changed = false;\n\tlet urlsRewritten = 0;\n\n\tfor (const block of blocks) {\n\t\t// Handle image blocks\n\t\tif (block._type === \"image\" && block.asset?.url) {\n\t\t\tconst newUrl = findMatchingUrl(block.asset.url, exactMap, baseMap);\n\t\t\tif (newUrl) {\n\t\t\t\tblock.asset.url = newUrl;\n\t\t\t\tblock.asset._ref = newUrl; // Also update the reference\n\t\t\t\tchanged = true;\n\t\t\t\turlsRewritten++;\n\t\t\t}\n\t\t}\n\n\t\t// Handle image link URLs (for linked images)\n\t\tif (block._type === \"image\" && block.link) {\n\t\t\tconst newUrl = findMatchingUrl(block.link, exactMap, baseMap);\n\t\t\tif (newUrl) {\n\t\t\t\tblock.link = newUrl;\n\t\t\t\tchanged = true;\n\t\t\t\turlsRewritten++;\n\t\t\t}\n\t\t}\n\n\t\t// Handle gallery blocks with nested images\n\t\tif (block._type === \"gallery\" && Array.isArray(block.images)) {\n\t\t\tconst result = rewritePortableTextUrls(block.images, exactMap, baseMap);\n\t\t\tif (result.changed) {\n\t\t\t\tchanged = true;\n\t\t\t\turlsRewritten += result.urlsRewritten;\n\t\t\t}\n\t\t}\n\n\t\t// Handle columns blocks with nested content\n\t\tif (block._type === \"columns\" && Array.isArray(block.columns)) {\n\t\t\tfor (const column of block.columns) {\n\t\t\t\tif (Array.isArray(column.content)) {\n\t\t\t\t\tconst result = rewritePortableTextUrls(column.content, exactMap, baseMap);\n\t\t\t\t\tif (result.changed) {\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t\turlsRewritten += result.urlsRewritten;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { changed, urlsRewritten };\n}\n\n/**\n * Rewrite URLs in a string field using simple string replacement\n */\nexport function rewriteStringUrls(\n\tvalue: string,\n\texactMap: Record<string, string>,\n\tbaseMap: Map<string, string>,\n): { newValue: string; changed: boolean; urlsRewritten: number } {\n\tlet newValue = value;\n\tlet changed = false;\n\tlet urlsRewritten = 0;\n\n\t// Try exact matches first\n\tfor (const [oldUrl, newUrl] of Object.entries(exactMap)) {\n\t\tif (newValue.includes(oldUrl)) {\n\t\t\tnewValue = newValue.split(oldUrl).join(newUrl);\n\t\t\tchanged = true;\n\t\t\turlsRewritten++;\n\t\t}\n\t}\n\n\t// For base URL matching in strings, we need to be more careful\n\t// Only match if we find a URL that starts with the base\n\tfor (const [baseUrl, newUrl] of baseMap.entries()) {\n\t\t// Look for the base URL followed by optional query string or end\n\t\tconst regex = buildBaseUrlMatchRegex(baseUrl);\n\t\tconst matches = newValue.match(regex);\n\t\tif (matches) {\n\t\t\tfor (const match of matches) {\n\t\t\t\t// Don't replace if we already have an exact match in the map\n\t\t\t\tif (!exactMap[match]) {\n\t\t\t\t\tnewValue = newValue.split(match).join(newUrl);\n\t\t\t\t\tchanged = true;\n\t\t\t\t\turlsRewritten++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { newValue, changed, urlsRewritten };\n}\n\n/**\n * Escape special regex characters in a string\n */\nfunction escapeRegExp(string: string): string {\n\treturn string.replace(REGEX_SPECIAL_CHARS, \"\\\\$&\");\n}\n\nfunction stripWordPressImageSizeSuffix(url: string): string {\n\treturn url.replace(WORDPRESS_IMAGE_SIZE_SUFFIX, \"\");\n}\n\nfunction buildBaseUrlMatchRegex(baseUrl: string): RegExp {\n\tconst extensionMatch = BASE_URL_EXTENSION.exec(baseUrl);\n\tconst basePattern = extensionMatch\n\t\t? `${escapeRegExp(extensionMatch[1])}(?:-\\\\d+x\\\\d+)?${escapeRegExp(extensionMatch[2])}`\n\t\t: escapeRegExp(baseUrl);\n\n\treturn new RegExp(\n\t\t`${basePattern}(\\\\?[^\"'\\\\s]*)?(?=$|[\"'\\\\s<>)\\\\],;:!?]|\\\\.(?=$|[\"'\\\\s<>)\\\\]]))`,\n\t\t\"g\",\n\t);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { APIRoute } from "astro";
|
|
2
|
+
|
|
3
|
+
//#region src/astro/routes/api/import/wordpress/rewrite-urls.d.ts
|
|
4
|
+
interface RewriteUrlsResult {
|
|
5
|
+
/** Total items updated */
|
|
6
|
+
updated: number;
|
|
7
|
+
/** Updates by collection */
|
|
8
|
+
byCollection: Record<string, number>;
|
|
9
|
+
/** URLs that were rewritten */
|
|
10
|
+
urlsRewritten: number;
|
|
11
|
+
/** Any errors encountered */
|
|
12
|
+
errors: Array<{
|
|
13
|
+
collection: string;
|
|
14
|
+
id: string;
|
|
15
|
+
error: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
declare const prerender = false;
|
|
19
|
+
declare const POST: APIRoute;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { POST, RewriteUrlsResult, prerender };
|
|
22
|
+
//# sourceMappingURL=rewrite-urls.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewrite-urls.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/rewrite-urls.ts"],"mappings":";;;UAgCiB,iBAAA;EAQA;EANhB,OAAA;EAMgD;EAJhD,YAAA,EAAc,MAAA;EAIuC;EAFrD,aAAA;EAKqB;EAHrB,MAAA,EAAQ,KAAA;IAAQ,UAAA;IAAoB,EAAA;IAAY,KAAA;EAAA;AAAA;AAAA,cAGpC,SAAA;AAAA,cAEA,IAAA,EAAM,QAAA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { t as validateIdentifier } from "../../../../../validate-VPnKoIzW.mjs";
|
|
2
|
+
import "../../../../../base64-CqR-7kqF.mjs";
|
|
3
|
+
import "../../../../../types-CwXMEPRr.mjs";
|
|
4
|
+
import { t as normalizeMediaValue } from "../../../../../normalize-CN5kRSMC.mjs";
|
|
5
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-tSQWIl5U.mjs";
|
|
6
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-BFTPon-J.mjs";
|
|
7
|
+
import "../../../../../redirects-Dmj6KRU3.mjs";
|
|
8
|
+
import { d as wpRewriteUrlsBody } from "../../../../../setup-BGAJ2uXs.mjs";
|
|
9
|
+
import "../../../../../api/schemas/index.mjs";
|
|
10
|
+
import { n as requirePerm } from "../../../../../authorize-BlyCH-96.mjs";
|
|
11
|
+
import { buildBaseUrlMap, findMatchingUrl, rewritePortableTextUrls, rewriteStringUrls } from "./rewrite-url-helpers.mjs";
|
|
12
|
+
import { sql } from "kysely";
|
|
13
|
+
|
|
14
|
+
//#region src/astro/routes/api/import/wordpress/rewrite-urls.ts
|
|
15
|
+
const prerender = false;
|
|
16
|
+
const POST = async ({ request, locals }) => {
|
|
17
|
+
const { emdash, user } = locals;
|
|
18
|
+
if (!emdash?.db) return apiError("NO_DB", "Database not initialized", 500);
|
|
19
|
+
const denied = requirePerm(user, "import:execute");
|
|
20
|
+
if (denied) return denied;
|
|
21
|
+
try {
|
|
22
|
+
const body = await parseBody(request, wpRewriteUrlsBody);
|
|
23
|
+
if (isParseError(body)) return body;
|
|
24
|
+
if (Object.entries(body.urlMap).length === 0) return apiSuccess({
|
|
25
|
+
updated: 0,
|
|
26
|
+
byCollection: {},
|
|
27
|
+
urlsRewritten: 0,
|
|
28
|
+
errors: []
|
|
29
|
+
});
|
|
30
|
+
const getProvider = (id) => emdash.getMediaProvider(id);
|
|
31
|
+
return apiSuccess(await rewriteUrls(emdash.db, body.urlMap, getProvider, body.collections));
|
|
32
|
+
} catch (error) {
|
|
33
|
+
return handleError(error, "Failed to rewrite URLs", "REWRITE_ERROR");
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
async function rewriteUrls(db, urlMap, getProvider, collections) {
|
|
37
|
+
const { SchemaRegistry } = await import("../../../../../registry-BnCeHYsf.mjs").then((n) => n.r);
|
|
38
|
+
const registry = new SchemaRegistry(db);
|
|
39
|
+
const result = {
|
|
40
|
+
updated: 0,
|
|
41
|
+
byCollection: {},
|
|
42
|
+
urlsRewritten: 0,
|
|
43
|
+
errors: []
|
|
44
|
+
};
|
|
45
|
+
const baseMap = buildBaseUrlMap(urlMap);
|
|
46
|
+
const allCollections = await registry.listCollections();
|
|
47
|
+
const targetCollections = collections?.length ? allCollections.filter((c) => collections.includes(c.slug)) : allCollections;
|
|
48
|
+
for (const collection of targetCollections) {
|
|
49
|
+
const fields = await registry.listFields(collection.id);
|
|
50
|
+
const portableTextFields = fields.filter((f) => f.type === "portableText");
|
|
51
|
+
const stringFields = fields.filter((f) => ["text", "string"].includes(f.type));
|
|
52
|
+
const mediaFields = fields.filter((f) => ["image", "file"].includes(f.type));
|
|
53
|
+
if (portableTextFields.length === 0 && stringFields.length === 0 && mediaFields.length === 0) continue;
|
|
54
|
+
validateIdentifier(collection.slug, "collection slug");
|
|
55
|
+
const tableName = `ec_${collection.slug}`;
|
|
56
|
+
try {
|
|
57
|
+
const rows = await sql`
|
|
58
|
+
SELECT * FROM ${sql.ref(tableName)}
|
|
59
|
+
WHERE deleted_at IS NULL
|
|
60
|
+
`.execute(db);
|
|
61
|
+
for (const row of rows.rows) {
|
|
62
|
+
let rowUpdated = false;
|
|
63
|
+
const updates = {};
|
|
64
|
+
let rowUrlsRewritten = 0;
|
|
65
|
+
for (const field of portableTextFields) {
|
|
66
|
+
const value = row[field.slug];
|
|
67
|
+
if (!value || typeof value !== "string") continue;
|
|
68
|
+
try {
|
|
69
|
+
const blocks = JSON.parse(value);
|
|
70
|
+
if (!Array.isArray(blocks)) continue;
|
|
71
|
+
const rewriteResult = rewritePortableTextUrls(blocks, urlMap, baseMap);
|
|
72
|
+
if (rewriteResult.changed) {
|
|
73
|
+
updates[field.slug] = JSON.stringify(blocks);
|
|
74
|
+
rowUpdated = true;
|
|
75
|
+
rowUrlsRewritten += rewriteResult.urlsRewritten;
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
const stringResult = rewriteStringUrls(value, urlMap, baseMap);
|
|
79
|
+
if (stringResult.changed) {
|
|
80
|
+
updates[field.slug] = stringResult.newValue;
|
|
81
|
+
rowUpdated = true;
|
|
82
|
+
rowUrlsRewritten += stringResult.urlsRewritten;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const field of stringFields) {
|
|
87
|
+
const value = row[field.slug];
|
|
88
|
+
if (!value || typeof value !== "string") continue;
|
|
89
|
+
const stringResult = rewriteStringUrls(value, urlMap, baseMap);
|
|
90
|
+
if (stringResult.changed) {
|
|
91
|
+
updates[field.slug] = stringResult.newValue;
|
|
92
|
+
rowUpdated = true;
|
|
93
|
+
rowUrlsRewritten += stringResult.urlsRewritten;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
for (const field of mediaFields) {
|
|
97
|
+
const value = row[field.slug];
|
|
98
|
+
if (!value || typeof value !== "string") continue;
|
|
99
|
+
const newUrl = findMatchingUrl(value, urlMap, baseMap);
|
|
100
|
+
if (newUrl) {
|
|
101
|
+
try {
|
|
102
|
+
const normalized = await normalizeMediaValue(newUrl, getProvider);
|
|
103
|
+
updates[field.slug] = normalized ? JSON.stringify(normalized) : newUrl;
|
|
104
|
+
} catch {
|
|
105
|
+
updates[field.slug] = newUrl;
|
|
106
|
+
}
|
|
107
|
+
rowUpdated = true;
|
|
108
|
+
rowUrlsRewritten++;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (rowUpdated) try {
|
|
112
|
+
let query = db.updateTable(tableName).where("id", "=", row.id);
|
|
113
|
+
for (const [key, value] of Object.entries(updates)) query = query.set({ [key]: value });
|
|
114
|
+
await query.execute();
|
|
115
|
+
result.updated++;
|
|
116
|
+
result.urlsRewritten += rowUrlsRewritten;
|
|
117
|
+
result.byCollection[collection.slug] = (result.byCollection[collection.slug] || 0) + 1;
|
|
118
|
+
} catch (updateError) {
|
|
119
|
+
result.errors.push({
|
|
120
|
+
collection: collection.slug,
|
|
121
|
+
id: row.id,
|
|
122
|
+
error: updateError instanceof Error ? updateError.message : "Update failed"
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
} catch (queryError) {
|
|
127
|
+
result.errors.push({
|
|
128
|
+
collection: collection.slug,
|
|
129
|
+
id: "*",
|
|
130
|
+
error: queryError instanceof Error ? queryError.message : "Query failed for collection"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { POST, prerender };
|
|
139
|
+
//# sourceMappingURL=rewrite-urls.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewrite-urls.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress/rewrite-urls.ts"],"sourcesContent":["/**\n * WordPress URL rewrite endpoint\n *\n * POST /_emdash/api/import/wordpress/rewrite-urls\n *\n * Rewrites old WordPress media URLs in Portable Text content\n * to point to newly imported EmDash media URLs.\n *\n * Handles URL variants (e.g., image.jpg vs image.jpg?w=200) by matching\n * on the base URL path without query parameters.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { sql } from \"kysely\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpRewriteUrlsBody } from \"#api/schemas.js\";\nimport { validateIdentifier } from \"#db/validate.js\";\nimport { normalizeMediaValue } from \"#media/normalize.js\";\nimport type { MediaProvider } from \"#media/types.js\";\nimport type { EmDashHandlers } from \"#types\";\n\nimport {\n\tbuildBaseUrlMap,\n\tfindMatchingUrl,\n\trewritePortableTextUrls,\n\trewriteStringUrls,\n} from \"./rewrite-url-helpers.js\";\nimport type { PortableTextBlock } from \"./rewrite-url-helpers.js\";\n\nexport interface RewriteUrlsResult {\n\t/** Total items updated */\n\tupdated: number;\n\t/** Updates by collection */\n\tbyCollection: Record<string, number>;\n\t/** URLs that were rewritten */\n\turlsRewritten: number;\n\t/** Any errors encountered */\n\terrors: Array<{ collection: string; id: string; error: string }>;\n}\n\nexport const prerender = false;\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NO_DB\", \"Database not initialized\", 500);\n\t}\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, wpRewriteUrlsBody);\n\t\tif (isParseError(body)) return body;\n\n\t\tconst urlEntries = Object.entries(body.urlMap);\n\t\tif (urlEntries.length === 0) {\n\t\t\treturn apiSuccess({\n\t\t\t\tupdated: 0,\n\t\t\t\tbyCollection: {},\n\t\t\t\turlsRewritten: 0,\n\t\t\t\terrors: [],\n\t\t\t});\n\t\t}\n\n\t\tconst getProvider = (id: string) => emdash.getMediaProvider(id);\n\t\tconst result = await rewriteUrls(emdash.db, body.urlMap, getProvider, body.collections);\n\n\t\treturn apiSuccess(result);\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to rewrite URLs\", \"REWRITE_ERROR\");\n\t}\n};\n\nasync function rewriteUrls(\n\tdb: NonNullable<EmDashHandlers[\"db\"]>,\n\turlMap: Record<string, string>,\n\tgetProvider: (id: string) => MediaProvider | undefined,\n\tcollections?: string[],\n): Promise<RewriteUrlsResult> {\n\tconst { SchemaRegistry } = await import(\"#schema/registry.js\");\n\tconst registry = new SchemaRegistry(db);\n\n\tconst result: RewriteUrlsResult = {\n\t\tupdated: 0,\n\t\tbyCollection: {},\n\t\turlsRewritten: 0,\n\t\terrors: [],\n\t};\n\n\t// Build base URL map for flexible matching\n\tconst baseMap = buildBaseUrlMap(urlMap);\n\n\t// Get all collections or filter to specified ones\n\tconst allCollections = await registry.listCollections();\n\tconst targetCollections = collections?.length\n\t\t? allCollections.filter((c) => collections.includes(c.slug))\n\t\t: allCollections;\n\n\tfor (const collection of targetCollections) {\n\t\t// Get fields that might contain URLs\n\t\tconst fields = await registry.listFields(collection.id);\n\t\tconst portableTextFields = fields.filter((f) => f.type === \"portableText\");\n\t\tconst stringFields = fields.filter((f) => [\"text\", \"string\"].includes(f.type));\n\t\t// Image and file fields store URLs directly as TEXT\n\t\tconst mediaFields = fields.filter((f) => [\"image\", \"file\"].includes(f.type));\n\n\t\tif (portableTextFields.length === 0 && stringFields.length === 0 && mediaFields.length === 0)\n\t\t\tcontinue;\n\n\t\t// Get table name\n\t\tvalidateIdentifier(collection.slug, \"collection slug\");\n\t\tconst tableName = `ec_${collection.slug}`;\n\n\t\ttry {\n\t\t\t// Query all rows\n\t\t\tconst rows = await sql<{ id: string; [key: string]: unknown }>`\n\t\t\t\tSELECT * FROM ${sql.ref(tableName)}\n\t\t\t\tWHERE deleted_at IS NULL\n\t\t\t`.execute(db);\n\n\t\t\tfor (const row of rows.rows) {\n\t\t\t\tlet rowUpdated = false;\n\t\t\t\tconst updates: Record<string, unknown> = {};\n\t\t\t\tlet rowUrlsRewritten = 0;\n\n\t\t\t\t// Handle Portable Text fields - parse JSON and rewrite URLs in blocks\n\t\t\t\tfor (const field of portableTextFields) {\n\t\t\t\t\tconst value = row[field.slug];\n\t\t\t\t\tif (!value || typeof value !== \"string\") continue;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// eslint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- JSON.parse returns unknown; validated by Array.isArray below\n\t\t\t\t\t\tconst blocks = JSON.parse(value) as PortableTextBlock[];\n\t\t\t\t\t\tif (!Array.isArray(blocks)) continue;\n\n\t\t\t\t\t\tconst rewriteResult = rewritePortableTextUrls(blocks, urlMap, baseMap);\n\n\t\t\t\t\t\tif (rewriteResult.changed) {\n\t\t\t\t\t\t\tupdates[field.slug] = JSON.stringify(blocks);\n\t\t\t\t\t\t\trowUpdated = true;\n\t\t\t\t\t\t\trowUrlsRewritten += rewriteResult.urlsRewritten;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Not valid JSON, try string replacement as fallback\n\t\t\t\t\t\tconst stringResult = rewriteStringUrls(value, urlMap, baseMap);\n\t\t\t\t\t\tif (stringResult.changed) {\n\t\t\t\t\t\t\tupdates[field.slug] = stringResult.newValue;\n\t\t\t\t\t\t\trowUpdated = true;\n\t\t\t\t\t\t\trowUrlsRewritten += stringResult.urlsRewritten;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle string/text fields - simple string replacement\n\t\t\t\tfor (const field of stringFields) {\n\t\t\t\t\tconst value = row[field.slug];\n\t\t\t\t\tif (!value || typeof value !== \"string\") continue;\n\n\t\t\t\t\tconst stringResult = rewriteStringUrls(value, urlMap, baseMap);\n\t\t\t\t\tif (stringResult.changed) {\n\t\t\t\t\t\tupdates[field.slug] = stringResult.newValue;\n\t\t\t\t\t\trowUpdated = true;\n\t\t\t\t\t\trowUrlsRewritten += stringResult.urlsRewritten;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Handle image/file fields - normalize to MediaValue objects\n\t\t\t\tfor (const field of mediaFields) {\n\t\t\t\t\tconst value = row[field.slug];\n\t\t\t\t\tif (!value || typeof value !== \"string\") continue;\n\n\t\t\t\t\t// Try to find a matching rewritten URL\n\t\t\t\t\tconst newUrl = findMatchingUrl(value, urlMap, baseMap);\n\t\t\t\t\tif (newUrl) {\n\t\t\t\t\t\t// Normalize into a proper MediaValue instead of storing a bare URL\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst normalized = await normalizeMediaValue(newUrl, getProvider);\n\t\t\t\t\t\t\tupdates[field.slug] = normalized ? JSON.stringify(normalized) : newUrl;\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\tupdates[field.slug] = newUrl;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trowUpdated = true;\n\t\t\t\t\t\trowUrlsRewritten++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rowUpdated) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Build update query dynamically\n\t\t\t\t\t\t// eslint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Kysely dynamic table requires type assertion\n\t\t\t\t\t\tlet query = db.updateTable(tableName as any).where(\"id\", \"=\", row.id);\n\n\t\t\t\t\t\tfor (const [key, value] of Object.entries(updates)) {\n\t\t\t\t\t\t\t// eslint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Kysely dynamic column update requires type assertion\n\t\t\t\t\t\t\tquery = query.set({ [key]: value } as any);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait query.execute();\n\n\t\t\t\t\t\tresult.updated++;\n\t\t\t\t\t\tresult.urlsRewritten += rowUrlsRewritten;\n\t\t\t\t\t\tresult.byCollection[collection.slug] = (result.byCollection[collection.slug] || 0) + 1;\n\t\t\t\t\t} catch (updateError) {\n\t\t\t\t\t\tresult.errors.push({\n\t\t\t\t\t\t\tcollection: collection.slug,\n\t\t\t\t\t\t\tid: row.id,\n\t\t\t\t\t\t\terror: updateError instanceof Error ? updateError.message : \"Update failed\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (queryError) {\n\t\t\tresult.errors.push({\n\t\t\t\tcollection: collection.slug,\n\t\t\t\tid: \"*\",\n\t\t\t\terror: queryError instanceof Error ? queryError.message : \"Query failed for collection\",\n\t\t\t});\n\t\t}\n\t}\n\n\treturn result;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { o as ImportAnalysis } from "../../../../../types-Cb2UCDJg.mjs";
|
|
2
|
+
import { APIRoute } from "astro";
|
|
3
|
+
|
|
4
|
+
//#region src/astro/routes/api/import/wordpress-plugin/analyze.d.ts
|
|
5
|
+
declare const prerender = false;
|
|
6
|
+
interface WpPluginAnalyzeResponse {
|
|
7
|
+
success: boolean;
|
|
8
|
+
analysis?: ImportAnalysis;
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const POST: APIRoute;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { POST, WpPluginAnalyzeResponse, prerender };
|
|
16
|
+
//# sourceMappingURL=analyze.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/analyze.ts"],"mappings":";;;;cAqBa,SAAA;AAAA,UAEI,uBAAA;EAChB,OAAA;EACA,QAAA,GAAW,cAAA;EACX,KAAA;IAAU,OAAA;EAAA;AAAA;AAAA,cAGE,IAAA,EAAM,QAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import "../../../../../base64-CqR-7kqF.mjs";
|
|
2
|
+
import "../../../../../types-CwXMEPRr.mjs";
|
|
3
|
+
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-DzFN_qV-.mjs";
|
|
4
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-tSQWIl5U.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-BFTPon-J.mjs";
|
|
6
|
+
import "../../../../../redirects-Dmj6KRU3.mjs";
|
|
7
|
+
import { c as wpPluginAnalyzeBody } from "../../../../../setup-BGAJ2uXs.mjs";
|
|
8
|
+
import "../../../../../api/schemas/index.mjs";
|
|
9
|
+
import { s as getSource } from "../../../../../import-CNfLOgDE.mjs";
|
|
10
|
+
import "../../../../../ssrf-CTul4uQi.mjs";
|
|
11
|
+
import "../../../../../utils-_F-rWBTN.mjs";
|
|
12
|
+
import { n as requirePerm } from "../../../../../authorize-BlyCH-96.mjs";
|
|
13
|
+
import { SchemaRegistry } from "emdash";
|
|
14
|
+
|
|
15
|
+
//#region src/astro/routes/api/import/wordpress-plugin/analyze.ts
|
|
16
|
+
const prerender = false;
|
|
17
|
+
const POST = async ({ request, locals }) => {
|
|
18
|
+
const { emdash, user } = locals;
|
|
19
|
+
const denied = requirePerm(user, "import:execute");
|
|
20
|
+
if (denied) return denied;
|
|
21
|
+
try {
|
|
22
|
+
const body = await parseBody(request, wpPluginAnalyzeBody);
|
|
23
|
+
if (isParseError(body)) return body;
|
|
24
|
+
try {
|
|
25
|
+
await resolveAndValidateExternalUrl(body.url);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
return apiError("SSRF_BLOCKED", e instanceof SsrfError ? e.message : "Invalid URL", 400);
|
|
28
|
+
}
|
|
29
|
+
const source = getSource("wordpress-plugin");
|
|
30
|
+
if (!source) return apiError("NOT_CONFIGURED", "WordPress plugin source not available", 500);
|
|
31
|
+
const existingCollections = await fetchExistingCollections(emdash?.db);
|
|
32
|
+
return apiSuccess({
|
|
33
|
+
success: true,
|
|
34
|
+
analysis: await source.analyze({
|
|
35
|
+
type: "url",
|
|
36
|
+
url: body.url,
|
|
37
|
+
token: body.token
|
|
38
|
+
}, {
|
|
39
|
+
db: emdash?.db,
|
|
40
|
+
getExistingCollections: async () => existingCollections
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return handleError(error, "Failed to analyze WordPress site", "WP_PLUGIN_ANALYZE_ERROR");
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
/** Fetch collections and their fields from schema registry */
|
|
48
|
+
async function fetchExistingCollections(db) {
|
|
49
|
+
const result = /* @__PURE__ */ new Map();
|
|
50
|
+
if (!db) return result;
|
|
51
|
+
try {
|
|
52
|
+
const registry = new SchemaRegistry(db);
|
|
53
|
+
const collections = await registry.listCollections();
|
|
54
|
+
for (const collection of collections) {
|
|
55
|
+
const fields = await registry.listFields(collection.id);
|
|
56
|
+
const fieldMap = /* @__PURE__ */ new Map();
|
|
57
|
+
for (const field of fields) fieldMap.set(field.slug, { type: field.type });
|
|
58
|
+
result.set(collection.slug, {
|
|
59
|
+
slug: collection.slug,
|
|
60
|
+
fields: fieldMap
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.warn("Could not fetch schema registry:", error);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
export { POST, prerender };
|
|
71
|
+
//# sourceMappingURL=analyze.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/analyze.ts"],"sourcesContent":["/**\n * WordPress Plugin analyze endpoint\n *\n * POST /_emdash/api/import/wordpress-plugin/analyze\n *\n * Analyzes a WordPress site with EmDash Exporter plugin installed.\n * Returns content counts, schema compatibility, etc.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { SchemaRegistry } from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpPluginAnalyzeBody } from \"#api/schemas.js\";\nimport { getSource } from \"#import/index.js\";\nimport { resolveAndValidateExternalUrl, SsrfError } from \"#import/ssrf.js\";\nimport type { ImportAnalysis } from \"#import/types.js\";\nimport type { EmDashHandlers } from \"#types\";\n\nexport const prerender = false;\n\nexport interface WpPluginAnalyzeResponse {\n\tsuccess: boolean;\n\tanalysis?: ImportAnalysis;\n\terror?: { message: string };\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, wpPluginAnalyzeBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// SSRF: reject internal/private network targets. Uses DNS resolution\n\t\t// to catch hostnames that resolve to private addresses.\n\t\ttry {\n\t\t\tawait resolveAndValidateExternalUrl(body.url);\n\t\t} catch (e) {\n\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\treturn apiError(\"SSRF_BLOCKED\", msg, 400);\n\t\t}\n\n\t\t// Get the WordPress plugin source\n\t\tconst source = getSource(\"wordpress-plugin\");\n\t\tif (!source) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"WordPress plugin source not available\", 500);\n\t\t}\n\n\t\t// Build context with existing collections info\n\t\tconst existingCollections = await fetchExistingCollections(emdash?.db);\n\n\t\t// Analyze the site\n\t\tconst analysis = await source.analyze(\n\t\t\t{ type: \"url\", url: body.url, token: body.token },\n\t\t\t{\n\t\t\t\tdb: emdash?.db,\n\t\t\t\tgetExistingCollections: async () => existingCollections,\n\t\t\t},\n\t\t);\n\n\t\treturn apiSuccess({\n\t\t\tsuccess: true,\n\t\t\tanalysis,\n\t\t});\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to analyze WordPress site\", \"WP_PLUGIN_ANALYZE_ERROR\");\n\t}\n};\n\n/** Existing collection info from schema registry */\ninterface ExistingCollection {\n\tslug: string;\n\tfields: Map<string, { type: string }>;\n}\n\n/** Fetch collections and their fields from schema registry */\nasync function fetchExistingCollections(\n\tdb: EmDashHandlers[\"db\"] | undefined,\n): Promise<Map<string, ExistingCollection>> {\n\tconst result = new Map<string, ExistingCollection>();\n\n\tif (!db) return result;\n\n\ttry {\n\t\tconst registry = new SchemaRegistry(db);\n\t\tconst collections = await registry.listCollections();\n\n\t\tfor (const collection of collections) {\n\t\t\tconst fields = await registry.listFields(collection.id);\n\t\t\tconst fieldMap = new Map<string, { type: string }>();\n\n\t\t\tfor (const field of fields) {\n\t\t\t\tfieldMap.set(field.slug, { type: field.type });\n\t\t\t}\n\n\t\t\tresult.set(collection.slug, {\n\t\t\t\tslug: collection.slug,\n\t\t\t\tfields: fieldMap,\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tconsole.warn(\"Could not fetch schema registry:\", error);\n\t}\n\n\treturn result;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAa,YAAY;AAQzB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI;EACH,MAAM,OAAO,MAAM,UAAU,SAAS,oBAAoB;AAC1D,MAAI,aAAa,KAAK,CAAE,QAAO;AAI/B,MAAI;AACH,SAAM,8BAA8B,KAAK,IAAI;WACrC,GAAG;AAEX,UAAO,SAAS,gBADJ,aAAa,YAAY,EAAE,UAAU,eACZ,IAAI;;EAI1C,MAAM,SAAS,UAAU,mBAAmB;AAC5C,MAAI,CAAC,OACJ,QAAO,SAAS,kBAAkB,yCAAyC,IAAI;EAIhF,MAAM,sBAAsB,MAAM,yBAAyB,QAAQ,GAAG;AAWtE,SAAO,WAAW;GACjB,SAAS;GACT,UAVgB,MAAM,OAAO,QAC7B;IAAE,MAAM;IAAO,KAAK,KAAK;IAAK,OAAO,KAAK;IAAO,EACjD;IACC,IAAI,QAAQ;IACZ,wBAAwB,YAAY;IACpC,CACD;GAKA,CAAC;UACM,OAAO;AACf,SAAO,YAAY,OAAO,oCAAoC,0BAA0B;;;;AAW1F,eAAe,yBACd,IAC2C;CAC3C,MAAM,yBAAS,IAAI,KAAiC;AAEpD,KAAI,CAAC,GAAI,QAAO;AAEhB,KAAI;EACH,MAAM,WAAW,IAAI,eAAe,GAAG;EACvC,MAAM,cAAc,MAAM,SAAS,iBAAiB;AAEpD,OAAK,MAAM,cAAc,aAAa;GACrC,MAAM,SAAS,MAAM,SAAS,WAAW,WAAW,GAAG;GACvD,MAAM,2BAAW,IAAI,KAA+B;AAEpD,QAAK,MAAM,SAAS,OACnB,UAAS,IAAI,MAAM,MAAM,EAAE,MAAM,MAAM,MAAM,CAAC;AAG/C,UAAO,IAAI,WAAW,MAAM;IAC3B,MAAM,WAAW;IACjB,QAAQ;IACR,CAAC;;UAEK,OAAO;AACf,UAAQ,KAAK,oCAAoC,MAAM;;AAGxD,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callback.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/callback.ts"],"mappings":";;;cAaa,SAAA;AAAA,cAEA,GAAA,EAAK,QAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as encodeBase64 } from "../../../../../base64-CqR-7kqF.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/astro/routes/api/import/wordpress-plugin/callback.ts
|
|
4
|
+
const prerender = false;
|
|
5
|
+
const GET = async ({ url, cookies, redirect }) => {
|
|
6
|
+
const siteUrl = url.searchParams.get("site_url");
|
|
7
|
+
const userLogin = url.searchParams.get("user_login");
|
|
8
|
+
const password = url.searchParams.get("password");
|
|
9
|
+
if (!siteUrl || !userLogin || !password) return redirect("/_emdash/admin/import/wordpress?error=auth_rejected");
|
|
10
|
+
const token = encodeBase64(`${userLogin}:${password}`);
|
|
11
|
+
const encodedAuth = encodeBase64(JSON.stringify({
|
|
12
|
+
siteUrl,
|
|
13
|
+
userLogin,
|
|
14
|
+
token,
|
|
15
|
+
timestamp: Date.now()
|
|
16
|
+
}));
|
|
17
|
+
cookies.set("emdash_wp_auth", encodedAuth, {
|
|
18
|
+
path: "/_emdash/",
|
|
19
|
+
maxAge: 300,
|
|
20
|
+
httpOnly: false,
|
|
21
|
+
secure: url.protocol === "https:",
|
|
22
|
+
sameSite: "lax"
|
|
23
|
+
});
|
|
24
|
+
return redirect("/_emdash/admin/import/wordpress?auth=success");
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { GET, prerender };
|
|
29
|
+
//# sourceMappingURL=callback.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callback.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/callback.ts"],"sourcesContent":["/**\n * WordPress Application Password OAuth callback\n *\n * GET /_emdash/api/import/wordpress-plugin/callback\n *\n * WordPress redirects here after user approves the application password.\n * We receive the credentials and redirect to the admin import UI with a token.\n */\n\nimport type { APIRoute } from \"astro\";\n\nimport { encodeBase64 } from \"#utils/base64.js\";\n\nexport const prerender = false;\n\nexport const GET: APIRoute = async ({ url, cookies, redirect }) => {\n\t// WordPress sends these params on success:\n\t// - site_url: The WordPress site URL\n\t// - user_login: The username\n\t// - password: The newly created application password\n\t//\n\t// On rejection, it redirects to reject_url (if provided) or just doesn't include credentials\n\n\tconst siteUrl = url.searchParams.get(\"site_url\");\n\tconst userLogin = url.searchParams.get(\"user_login\");\n\tconst password = url.searchParams.get(\"password\");\n\n\t// Check if this is a rejection (no credentials)\n\tif (!siteUrl || !userLogin || !password) {\n\t\treturn redirect(\"/_emdash/admin/import/wordpress?error=auth_rejected\");\n\t}\n\n\t// Create the Basic Auth token\n\tconst token = encodeBase64(`${userLogin}:${password}`);\n\n\t// Store credentials in a short-lived cookie (5 minutes)\n\t// This allows the import UI to retrieve them\n\tconst authData = JSON.stringify({\n\t\tsiteUrl,\n\t\tuserLogin,\n\t\ttoken,\n\t\ttimestamp: Date.now(),\n\t});\n\n\t// Base64 encode the auth data for cookie storage\n\tconst encodedAuth = encodeBase64(authData);\n\n\tcookies.set(\"emdash_wp_auth\", encodedAuth, {\n\t\tpath: \"/_emdash/\",\n\t\tmaxAge: 300, // 5 minutes\n\t\thttpOnly: false, // Needs to be readable by JS\n\t\tsecure: url.protocol === \"https:\",\n\t\tsameSite: \"lax\",\n\t});\n\n\t// Redirect to import UI - it will pick up the cookie\n\treturn redirect(\"/_emdash/admin/import/wordpress?auth=success\");\n};\n"],"mappings":";;;AAaA,MAAa,YAAY;AAEzB,MAAa,MAAgB,OAAO,EAAE,KAAK,SAAS,eAAe;CAQlE,MAAM,UAAU,IAAI,aAAa,IAAI,WAAW;CAChD,MAAM,YAAY,IAAI,aAAa,IAAI,aAAa;CACpD,MAAM,WAAW,IAAI,aAAa,IAAI,WAAW;AAGjD,KAAI,CAAC,WAAW,CAAC,aAAa,CAAC,SAC9B,QAAO,SAAS,sDAAsD;CAIvE,MAAM,QAAQ,aAAa,GAAG,UAAU,GAAG,WAAW;CAYtD,MAAM,cAAc,aARH,KAAK,UAAU;EAC/B;EACA;EACA;EACA,WAAW,KAAK,KAAK;EACrB,CAAC,CAGwC;AAE1C,SAAQ,IAAI,kBAAkB,aAAa;EAC1C,MAAM;EACN,QAAQ;EACR,UAAU;EACV,QAAQ,IAAI,aAAa;EACzB,UAAU;EACV,CAAC;AAGF,QAAO,SAAS,+CAA+C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { s as ImportConfig, u as ImportResult } from "../../../../../types-Cb2UCDJg.mjs";
|
|
2
|
+
import { APIRoute } from "astro";
|
|
3
|
+
|
|
4
|
+
//#region src/astro/routes/api/import/wordpress-plugin/execute.d.ts
|
|
5
|
+
declare const prerender = false;
|
|
6
|
+
interface WpPluginImportConfig extends ImportConfig {
|
|
7
|
+
/** Author mappings (WP author login -> EmDash user ID) */
|
|
8
|
+
authorMappings?: Record<string, string | null>;
|
|
9
|
+
}
|
|
10
|
+
interface WpPluginImportResponse {
|
|
11
|
+
success: boolean;
|
|
12
|
+
result?: ImportResult;
|
|
13
|
+
error?: {
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare const POST: APIRoute;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { POST, WpPluginImportConfig, WpPluginImportResponse, prerender };
|
|
20
|
+
//# sourceMappingURL=execute.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.d.mts","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/execute.ts"],"mappings":";;;;cAwBa,SAAA;AAAA,UAEI,oBAAA,SAA6B,YAAA;;EAE7C,cAAA,GAAiB,MAAA;AAAA;AAAA,UAGD,sBAAA;EAChB,OAAA;EACA,MAAA,GAAS,YAAA;EACT,KAAA;IAAU,OAAA;EAAA;AAAA;AAAA,cAGE,IAAA,EAAM,QAAA"}
|