emdash 0.11.1 → 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-Ded_1vng.mjs → apply-v4DBgjPw.mjs} +19 -566
- 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 +146 -71
- 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 -9
- 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-BogfvE-z.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-CXAbd1vH.mjs → manifest-schema-HCtSh4Jq.mjs} +1 -1
- package/dist/{manifest-schema-CXAbd1vH.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 +9 -3
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-1fFhub9c.mjs → media-Dg7he9uK.mjs} +2 -2
- package/dist/{media-1fFhub9c.mjs.map → media-Dg7he9uK.mjs.map} +1 -1
- 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 +15 -4
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +16 -5
- package/dist/page/index.mjs.map +1 -1
- 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-8c_meo_K.mjs → query-axZmO6Tn.mjs} +23 -12
- package/dist/query-axZmO6Tn.mjs.map +1 -0
- 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-Bw76xAxo.mjs → taxonomies-Cn9UpaR2.mjs} +7 -7
- package/dist/{taxonomies-Bw76xAxo.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-IjUrQMVe.d.mts → types-B05e2naf.d.mts} +151 -60
- package/dist/types-B05e2naf.d.mts.map +1 -0
- package/dist/{types-BTe41zL6.d.mts → types-BWhaSS7U.d.mts} +2 -71
- 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-K-EkEQCI.mjs → types-Dz9CGX_d.mjs} +1 -1
- package/dist/{types-K-EkEQCI.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-CcVQQpmH.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-JjSqv90m.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/schemas/settings.ts +41 -9
- 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/media/[id].ts +2 -1
- 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/components/EmDashHead.astro +26 -5
- 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 +143 -36
- 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/local-runtime.ts +7 -0
- package/src/media/normalize.ts +37 -4
- package/src/page/absolute-url.ts +146 -0
- package/src/page/jsonld.ts +10 -2
- package/src/page/seo-contributions.ts +17 -6
- package/src/plugin-types.ts +240 -0
- package/src/plugins/adapt-sandbox-entry.ts +115 -39
- package/src/plugins/context.ts +11 -1
- 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/query.ts +12 -0
- 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/src/settings/index.ts +20 -1
- package/src/settings/types.ts +12 -8
- package/dist/apply-Ded_1vng.mjs.map +0 -1
- package/dist/content-CERxPUN0.mjs.map +0 -1
- package/dist/error-DqnRMM5z.mjs +0 -27
- package/dist/error-DqnRMM5z.mjs.map +0 -1
- package/dist/index-BogfvE-z.d.mts.map +0 -1
- package/dist/placeholder-Ci0RLeCk.mjs +0 -268
- package/dist/placeholder-Ci0RLeCk.mjs.map +0 -1
- package/dist/query-8c_meo_K.mjs.map +0 -1
- package/dist/registry-Do34mz_P.mjs.map +0 -1
- package/dist/runner-DIcU2UCC.mjs.map +0 -1
- package/dist/search-DuWhx4NG.mjs +0 -9897
- package/dist/search-DuWhx4NG.mjs.map +0 -1
- package/dist/types-BIgulNsW.mjs.map +0 -1
- package/dist/types-BTe41zL6.d.mts.map +0 -1
- package/dist/types-DiI8NOG_.mjs +0 -16
- package/dist/types-DiI8NOG_.mjs.map +0 -1
- package/dist/types-IjUrQMVe.d.mts.map +0 -1
- package/dist/validate-CcVQQpmH.d.mts.map +0 -1
- package/dist/version-JjSqv90m.mjs +0 -7
- package/dist/zod-generator-CHnJUP2l.mjs +0 -137
- package/dist/zod-generator-CHnJUP2l.mjs.map +0 -1
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WXR taxonomy import helpers.
|
|
3
|
+
*
|
|
4
|
+
* Bridges parsed WordPress taxonomy data (`WxrCategory`, `WxrTag`, `WxrTerm`,
|
|
5
|
+
* and per-item `WxrPost.categories` / `WxrPost.tags` / `WxrPost.customTaxonomies`)
|
|
6
|
+
* onto EmDash's term + content_taxonomies tables.
|
|
7
|
+
*
|
|
8
|
+
* Why this isn't inline in `execute.ts`: pre-creating all terms before any
|
|
9
|
+
* post is created lets us (a) build a lookup once for every (taxonomy, slug)
|
|
10
|
+
* the import needs, and (b) keep the per-post attachment loop cheap. It also
|
|
11
|
+
* makes the logic testable without spinning up an Astro request.
|
|
12
|
+
*
|
|
13
|
+
* Behaviour:
|
|
14
|
+
* - `wp:category` -> EmDash `category` taxonomy (seeded by migration 006).
|
|
15
|
+
* - `wp:tag` -> EmDash `tag` taxonomy.
|
|
16
|
+
* - `wp:term` -> matching EmDash taxonomy by `name` (case-sensitive).
|
|
17
|
+
* If no matching def exists in the target locale, the
|
|
18
|
+
* term is skipped — we don't auto-create defs because
|
|
19
|
+
* the user controls their schema through the admin.
|
|
20
|
+
* - Terms are created idempotently by `(taxonomy, slug, locale)`. Existing
|
|
21
|
+
* terms are reused.
|
|
22
|
+
* - Assignments respect the def's `collections` array. If the post's target
|
|
23
|
+
* collection isn't listed on the taxonomy def, the assignment is skipped
|
|
24
|
+
* (matches admin UI behaviour: you can't tag a "products" post with a
|
|
25
|
+
* "category" if `category.collections` only includes "posts").
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import type { Kysely } from "kysely";
|
|
29
|
+
|
|
30
|
+
import type { WxrCategory, WxrPost, WxrTag, WxrTerm } from "../cli/wxr/parser.js";
|
|
31
|
+
import { TaxonomyRepository } from "../database/repositories/taxonomy.js";
|
|
32
|
+
import type { Database } from "../database/types.js";
|
|
33
|
+
import { resolveLocaleChain } from "../i18n/resolve.js";
|
|
34
|
+
import { invalidateTermCache } from "../taxonomies/index.js";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Thrown by `mirrorTermsToLocales` when a pre-existing locale row at the
|
|
38
|
+
* same `(taxonomy, slug)` belongs to a different `translation_group` than
|
|
39
|
+
* the canonical term. Callers in the route layer surface
|
|
40
|
+
* `publicMessage` to the operator (no internal data) while logging
|
|
41
|
+
* `cause` server-side.
|
|
42
|
+
*
|
|
43
|
+
* Marker class so the route layer can distinguish "operator-actionable
|
|
44
|
+
* taxonomy conflict" from any other DB / repository error that might
|
|
45
|
+
* escape the helper.
|
|
46
|
+
*/
|
|
47
|
+
export class WxrTaxonomyConflictError extends Error {
|
|
48
|
+
readonly publicMessage: string;
|
|
49
|
+
constructor(publicMessage: string, options?: { cause?: unknown }) {
|
|
50
|
+
super(publicMessage, options);
|
|
51
|
+
this.name = "WxrTaxonomyConflictError";
|
|
52
|
+
this.publicMessage = publicMessage;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function isWxrTaxonomyConflictError(error: unknown): error is WxrTaxonomyConflictError {
|
|
57
|
+
return error instanceof WxrTaxonomyConflictError;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Result of pre-importing taxonomy terms from a WXR file.
|
|
62
|
+
*/
|
|
63
|
+
export interface TaxonomyImportPlan {
|
|
64
|
+
/** terms created during this run (per taxonomy name) */
|
|
65
|
+
termsCreated: Record<string, number>;
|
|
66
|
+
/** terms that already existed and were reused (per taxonomy name) */
|
|
67
|
+
termsReused: Record<string, number>;
|
|
68
|
+
/** custom taxonomies (`wp:term`) skipped because no matching EmDash def exists */
|
|
69
|
+
missingTaxonomies: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Lookup table: `taxonomy name` -> `term slug` -> term id.
|
|
72
|
+
* Used by `attachPostTaxonomies` to translate WXR assignments into pivot rows.
|
|
73
|
+
*/
|
|
74
|
+
termIdByNameAndSlug: Map<string, Map<string, string>>;
|
|
75
|
+
/**
|
|
76
|
+
* Lookup table: `taxonomy name` -> set of collection slugs the def allows.
|
|
77
|
+
* Empty (or missing) means "any collection" — we only enforce the filter
|
|
78
|
+
* when the def explicitly lists collections.
|
|
79
|
+
*/
|
|
80
|
+
collectionsByTaxonomy: Map<string, Set<string>>;
|
|
81
|
+
/**
|
|
82
|
+
* Lookup table: `term id` -> the term's `translation_group` (or `null`
|
|
83
|
+
* if the term doesn't exist any more). Populated lazily by helpers that
|
|
84
|
+
* need to check pivot existence without repeating per-term DB reads.
|
|
85
|
+
*/
|
|
86
|
+
translationGroupByTermId: Map<string, string | null>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Track running counts plus the lookup maps.
|
|
91
|
+
*/
|
|
92
|
+
interface TaxonomyImportState {
|
|
93
|
+
plan: TaxonomyImportPlan;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function makeState(): TaxonomyImportState {
|
|
97
|
+
return {
|
|
98
|
+
plan: {
|
|
99
|
+
termsCreated: {},
|
|
100
|
+
termsReused: {},
|
|
101
|
+
missingTaxonomies: [],
|
|
102
|
+
termIdByNameAndSlug: new Map(),
|
|
103
|
+
collectionsByTaxonomy: new Map(),
|
|
104
|
+
translationGroupByTermId: new Map(),
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Record-keeping helpers — keep mutations centralised so the result object
|
|
111
|
+
* stays consistent.
|
|
112
|
+
*/
|
|
113
|
+
function bump(record: Record<string, number>, key: string): void {
|
|
114
|
+
record[key] = (record[key] ?? 0) + 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function rememberTerm(
|
|
118
|
+
state: TaxonomyImportState,
|
|
119
|
+
taxonomyName: string,
|
|
120
|
+
slug: string,
|
|
121
|
+
termId: string,
|
|
122
|
+
): void {
|
|
123
|
+
let bySlug = state.plan.termIdByNameAndSlug.get(taxonomyName);
|
|
124
|
+
if (!bySlug) {
|
|
125
|
+
bySlug = new Map();
|
|
126
|
+
state.plan.termIdByNameAndSlug.set(taxonomyName, bySlug);
|
|
127
|
+
}
|
|
128
|
+
bySlug.set(slug, termId);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Look up an EmDash taxonomy def by name. Definitions are per-locale but
|
|
133
|
+
* a def is conceptually site-wide -- the per-locale row carries only the
|
|
134
|
+
* label translations.
|
|
135
|
+
*
|
|
136
|
+
* Match the runtime helper `getTaxonomyDef` (in `src/taxonomies/index.ts`):
|
|
137
|
+
* walk `resolveLocaleChain(locale)` so the importer picks the same def the
|
|
138
|
+
* runtime would later resolve to. When the chain is empty (i18n disabled)
|
|
139
|
+
* or every locale in the chain misses, fall through to the lowest-locale
|
|
140
|
+
* row so single-locale installs still see seeded defs that were inserted
|
|
141
|
+
* at some non-empty locale value.
|
|
142
|
+
*
|
|
143
|
+
* Without this fallback, a user importing into a non-default locale would
|
|
144
|
+
* see every category dropped as `missingTaxonomies` even though the seeded
|
|
145
|
+
* defs exist (just at the site's default locale).
|
|
146
|
+
*/
|
|
147
|
+
function parseDefCollections(raw: string | null): string[] {
|
|
148
|
+
if (!raw) return [];
|
|
149
|
+
try {
|
|
150
|
+
const parsed: unknown = JSON.parse(raw);
|
|
151
|
+
if (Array.isArray(parsed)) {
|
|
152
|
+
return parsed.filter((c): c is string => typeof c === "string");
|
|
153
|
+
}
|
|
154
|
+
} catch {
|
|
155
|
+
// malformed JSON in the def -- treat as "no collection filter"
|
|
156
|
+
}
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async function findTaxonomyDef(
|
|
161
|
+
db: Kysely<Database>,
|
|
162
|
+
name: string,
|
|
163
|
+
locale: string | undefined,
|
|
164
|
+
): Promise<{ id: string; collections: string[] } | null> {
|
|
165
|
+
const chain = resolveLocaleChain(locale);
|
|
166
|
+
|
|
167
|
+
if (chain.length === 0) {
|
|
168
|
+
// i18n disabled and no explicit locale. The runtime treats this
|
|
169
|
+
// as "no locale filter" and picks the lowest-locale row. We do the
|
|
170
|
+
// same so the importer agrees with how the runtime later reads
|
|
171
|
+
// the def.
|
|
172
|
+
const row = await db
|
|
173
|
+
.selectFrom("_emdash_taxonomy_defs")
|
|
174
|
+
.selectAll()
|
|
175
|
+
.where("name", "=", name)
|
|
176
|
+
.orderBy("locale", "asc")
|
|
177
|
+
.executeTakeFirst();
|
|
178
|
+
return row ? { id: row.id, collections: parseDefCollections(row.collections) } : null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Non-empty chain: walk it in order, return null if every entry misses.
|
|
182
|
+
// This matches `getTaxonomyDef` exactly. We deliberately do NOT fall
|
|
183
|
+
// through to any-locale lookup: doing so would let the importer pick a
|
|
184
|
+
// def at a locale the runtime would never resolve to, producing
|
|
185
|
+
// content the user can't see in the admin or on the rendered site.
|
|
186
|
+
for (const tryLocale of chain) {
|
|
187
|
+
const row = await db
|
|
188
|
+
.selectFrom("_emdash_taxonomy_defs")
|
|
189
|
+
.selectAll()
|
|
190
|
+
.where("name", "=", name)
|
|
191
|
+
.where("locale", "=", tryLocale)
|
|
192
|
+
.executeTakeFirst();
|
|
193
|
+
if (row) {
|
|
194
|
+
return { id: row.id, collections: parseDefCollections(row.collections) };
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Find or create a term in the given taxonomy. Returns the term id. Callers
|
|
203
|
+
* must verify the taxonomy def exists before calling — this helper assumes
|
|
204
|
+
* the def is present.
|
|
205
|
+
*
|
|
206
|
+
* Note: we don't resolve WordPress parent slugs into EmDash parent ids in
|
|
207
|
+
* this pass. WXR exports list categories in arbitrary order, so a category's
|
|
208
|
+
* parent may not exist yet when we first see it. Hierarchy is preserved at
|
|
209
|
+
* the data level (the parent slug is on `WxrCategory.parent`) but flattens
|
|
210
|
+
* in EmDash for now; restoring the tree is a follow-up improvement.
|
|
211
|
+
*/
|
|
212
|
+
async function ensureTerm(
|
|
213
|
+
repo: TaxonomyRepository,
|
|
214
|
+
state: TaxonomyImportState,
|
|
215
|
+
taxonomyName: string,
|
|
216
|
+
slug: string,
|
|
217
|
+
label: string,
|
|
218
|
+
description: string | undefined,
|
|
219
|
+
locale: string | undefined,
|
|
220
|
+
): Promise<string> {
|
|
221
|
+
// Already resolved in this run (e.g. seen in `wp:category` AND in a per-
|
|
222
|
+
// item `<category>` element).
|
|
223
|
+
const cached = state.plan.termIdByNameAndSlug.get(taxonomyName)?.get(slug);
|
|
224
|
+
if (cached) return cached;
|
|
225
|
+
|
|
226
|
+
const existing = await repo.findBySlug(taxonomyName, slug, locale);
|
|
227
|
+
if (existing) {
|
|
228
|
+
bump(state.plan.termsReused, taxonomyName);
|
|
229
|
+
rememberTerm(state, taxonomyName, slug, existing.id);
|
|
230
|
+
return existing.id;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// No row at the requested locale. Before creating, check whether a
|
|
234
|
+
// `(name, slug)` row exists in some OTHER locale -- e.g. the admin
|
|
235
|
+
// pre-created an Arabic translation, and now an `en` import wants the
|
|
236
|
+
// canonical row. We need to mint the new row inside the existing row's
|
|
237
|
+
// `translation_group` so per-locale lookups across the family work.
|
|
238
|
+
// Without this, the mirror pass would later refuse to reconcile (it
|
|
239
|
+
// sees pre-existing rows in a different group as a no-op) and pivots
|
|
240
|
+
// would point at a group that has no row in the requested locale.
|
|
241
|
+
const anyLocale = await repo.findBySlug(taxonomyName, slug);
|
|
242
|
+
const translationOf = anyLocale?.id;
|
|
243
|
+
|
|
244
|
+
const created = await repo.create({
|
|
245
|
+
name: taxonomyName,
|
|
246
|
+
slug,
|
|
247
|
+
label,
|
|
248
|
+
data: description ? { description } : undefined,
|
|
249
|
+
locale,
|
|
250
|
+
translationOf,
|
|
251
|
+
});
|
|
252
|
+
bump(state.plan.termsCreated, taxonomyName);
|
|
253
|
+
rememberTerm(state, taxonomyName, slug, created.id);
|
|
254
|
+
return created.id;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Retrieve the human label captured by the parser for a per-item
|
|
259
|
+
* `<category>` text body, falling back to the slug when the parser didn't
|
|
260
|
+
* see a label (e.g. self-closing tags or whitespace-only bodies).
|
|
261
|
+
*/
|
|
262
|
+
function labelFor(post: WxrPost, taxonomy: string, slug: string): string {
|
|
263
|
+
const key = `${taxonomy}\u0000${slug}`;
|
|
264
|
+
return post.taxonomyLabels?.get(key) ?? slug;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Pre-import every term referenced by the WXR file.
|
|
269
|
+
*
|
|
270
|
+
* Pass 1: `wp:category` blocks. Each becomes a term in EmDash's seeded
|
|
271
|
+
* `category` taxonomy.
|
|
272
|
+
* Pass 2: `wp:tag` blocks. Each becomes a term in `tag`.
|
|
273
|
+
* Pass 3: `wp:term` blocks (custom taxonomies). Skipped when no matching
|
|
274
|
+
* EmDash def exists.
|
|
275
|
+
* Pass 4: per-item `<category domain="…" nicename="…">` assignments. WXR
|
|
276
|
+
* exports sometimes reference taxonomies/terms that weren't declared
|
|
277
|
+
* at the top level (older exports especially), so we backfill terms
|
|
278
|
+
* from per-item assignments. Categories and tags use the seeded defs
|
|
279
|
+
* and pick up the assignment text as the label; custom domains fall
|
|
280
|
+
* back to the same "def must exist" rule.
|
|
281
|
+
*/
|
|
282
|
+
export async function preImportWxrTaxonomies(
|
|
283
|
+
db: Kysely<Database>,
|
|
284
|
+
posts: WxrPost[],
|
|
285
|
+
categories: WxrCategory[],
|
|
286
|
+
tags: WxrTag[],
|
|
287
|
+
terms: WxrTerm[],
|
|
288
|
+
locale: string | undefined,
|
|
289
|
+
): Promise<TaxonomyImportPlan> {
|
|
290
|
+
const state = makeState();
|
|
291
|
+
const repo = new TaxonomyRepository(db);
|
|
292
|
+
|
|
293
|
+
// Cache def lookups for the duration of the import. Keyed by name; value
|
|
294
|
+
// is `null` when we've already determined the def is missing in this
|
|
295
|
+
// locale (so we only report the "missing" warning once per taxonomy).
|
|
296
|
+
const defCache = new Map<string, { id: string; collections: string[] } | null>();
|
|
297
|
+
const lookupDef = async (name: string): Promise<{ id: string; collections: string[] } | null> => {
|
|
298
|
+
if (defCache.has(name)) return defCache.get(name) ?? null;
|
|
299
|
+
const def = await findTaxonomyDef(db, name, locale);
|
|
300
|
+
defCache.set(name, def);
|
|
301
|
+
if (def) {
|
|
302
|
+
state.plan.collectionsByTaxonomy.set(name, new Set(def.collections));
|
|
303
|
+
}
|
|
304
|
+
return def;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
// Pass 1: top-level <wp:category> blocks -> EmDash `category` taxonomy.
|
|
308
|
+
const categoryDef = await lookupDef("category");
|
|
309
|
+
if (categoryDef) {
|
|
310
|
+
for (const cat of categories) {
|
|
311
|
+
const slug = cat.nicename;
|
|
312
|
+
const label = cat.name;
|
|
313
|
+
if (!slug || !label) continue;
|
|
314
|
+
await ensureTerm(repo, state, "category", slug, label, cat.description, locale);
|
|
315
|
+
}
|
|
316
|
+
} else if (categories.length > 0) {
|
|
317
|
+
// Seeded `category` def was deleted by the user — record so the
|
|
318
|
+
// import response can surface why none of the categories landed.
|
|
319
|
+
state.plan.missingTaxonomies.push("category");
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Pass 2: top-level <wp:tag> blocks -> EmDash `tag` taxonomy.
|
|
323
|
+
const tagDef = await lookupDef("tag");
|
|
324
|
+
if (tagDef) {
|
|
325
|
+
for (const tag of tags) {
|
|
326
|
+
const slug = tag.slug;
|
|
327
|
+
const label = tag.name;
|
|
328
|
+
if (!slug || !label) continue;
|
|
329
|
+
await ensureTerm(repo, state, "tag", slug, label, tag.description, locale);
|
|
330
|
+
}
|
|
331
|
+
} else if (tags.length > 0) {
|
|
332
|
+
state.plan.missingTaxonomies.push("tag");
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Pass 3: <wp:term> blocks for custom taxonomies (genre, etc.). Skipped:
|
|
336
|
+
// - `nav_menu`: menus are handled by `importMenusFromWxr`.
|
|
337
|
+
// - `language`: Polylang's locale signal; promoted to `WxrPost.locale`
|
|
338
|
+
// by the parser and not a content taxonomy in EmDash.
|
|
339
|
+
for (const term of terms) {
|
|
340
|
+
if (term.taxonomy === "nav_menu" || term.taxonomy === "language") continue;
|
|
341
|
+
// Normalize WordPress' `post_tag` synonym -> EmDash `tag`. WordPress
|
|
342
|
+
// emits `<wp:tag>` for some exports and `<wp:term wp:term_taxonomy="post_tag">`
|
|
343
|
+
// for others; both must land in the same EmDash taxonomy.
|
|
344
|
+
const taxonomyName = term.taxonomy === "post_tag" ? "tag" : term.taxonomy;
|
|
345
|
+
const def = await lookupDef(taxonomyName);
|
|
346
|
+
if (!def) {
|
|
347
|
+
if (!state.plan.missingTaxonomies.includes(taxonomyName)) {
|
|
348
|
+
state.plan.missingTaxonomies.push(taxonomyName);
|
|
349
|
+
}
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
await ensureTerm(repo, state, taxonomyName, term.slug, term.name, term.description, locale);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Pass 4: per-item assignments. Backfills terms missing from the top-
|
|
356
|
+
// level blocks (rare, but observed in hand-edited or partial exports).
|
|
357
|
+
// Labels come from the per-item `<category>` text body when the parser
|
|
358
|
+
// captured one; otherwise we fall back to the slug. This is the path
|
|
359
|
+
// for older exports that skip top-level `<wp:category>` definitions.
|
|
360
|
+
let recordedMissingCategoryFromPosts = false;
|
|
361
|
+
let recordedMissingTagFromPosts = false;
|
|
362
|
+
for (const post of posts) {
|
|
363
|
+
for (const slug of post.categories) {
|
|
364
|
+
if (!categoryDef) {
|
|
365
|
+
if (
|
|
366
|
+
!recordedMissingCategoryFromPosts &&
|
|
367
|
+
!state.plan.missingTaxonomies.includes("category")
|
|
368
|
+
) {
|
|
369
|
+
state.plan.missingTaxonomies.push("category");
|
|
370
|
+
recordedMissingCategoryFromPosts = true;
|
|
371
|
+
}
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
if (state.plan.termIdByNameAndSlug.get("category")?.has(slug)) continue;
|
|
375
|
+
await ensureTerm(
|
|
376
|
+
repo,
|
|
377
|
+
state,
|
|
378
|
+
"category",
|
|
379
|
+
slug,
|
|
380
|
+
labelFor(post, "category", slug),
|
|
381
|
+
undefined,
|
|
382
|
+
locale,
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
for (const slug of post.tags) {
|
|
386
|
+
if (!tagDef) {
|
|
387
|
+
if (!recordedMissingTagFromPosts && !state.plan.missingTaxonomies.includes("tag")) {
|
|
388
|
+
state.plan.missingTaxonomies.push("tag");
|
|
389
|
+
recordedMissingTagFromPosts = true;
|
|
390
|
+
}
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
if (state.plan.termIdByNameAndSlug.get("tag")?.has(slug)) continue;
|
|
394
|
+
await ensureTerm(repo, state, "tag", slug, labelFor(post, "tag", slug), undefined, locale);
|
|
395
|
+
}
|
|
396
|
+
if (post.customTaxonomies) {
|
|
397
|
+
for (const [rawName, slugs] of post.customTaxonomies) {
|
|
398
|
+
// `nav_menu` is handled by the menu importer; `language` is
|
|
399
|
+
// Polylang's per-post locale signal, already promoted by the
|
|
400
|
+
// parser.
|
|
401
|
+
if (rawName === "nav_menu" || rawName === "language") continue;
|
|
402
|
+
const taxonomyName = rawName === "post_tag" ? "tag" : rawName;
|
|
403
|
+
const def = await lookupDef(taxonomyName);
|
|
404
|
+
if (!def) {
|
|
405
|
+
if (!state.plan.missingTaxonomies.includes(taxonomyName)) {
|
|
406
|
+
state.plan.missingTaxonomies.push(taxonomyName);
|
|
407
|
+
}
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
for (const slug of slugs) {
|
|
411
|
+
if (state.plan.termIdByNameAndSlug.get(taxonomyName)?.has(slug)) continue;
|
|
412
|
+
await ensureTerm(
|
|
413
|
+
repo,
|
|
414
|
+
state,
|
|
415
|
+
taxonomyName,
|
|
416
|
+
slug,
|
|
417
|
+
labelFor(post, taxonomyName, slug),
|
|
418
|
+
undefined,
|
|
419
|
+
locale,
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// `content_taxonomies` writes happen later in `attachPostTaxonomies`, but
|
|
427
|
+
// term inserts above already invalidate the in-memory "has any terms" probe.
|
|
428
|
+
// We flush once at the end of the pre-import to keep the runtime cache hot.
|
|
429
|
+
invalidateTermCache();
|
|
430
|
+
|
|
431
|
+
return state.plan;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Walk a parsed WXR post's per-item taxonomy assignments and return only
|
|
436
|
+
* the ones that resolve to a real EmDash term AND aren't filtered out by
|
|
437
|
+
* the taxonomy def's `collections` allowlist. Grouped by EmDash taxonomy
|
|
438
|
+
* name (so `post_tag` is already folded into `tag`). Deduplicated.
|
|
439
|
+
*
|
|
440
|
+
* This is the single source of truth for "what will the importer try to
|
|
441
|
+
* write for this post". Both the anchor (additive `attachToEntry`) and
|
|
442
|
+
* translation (per-taxonomy `setTermsForEntry`) paths drive from this map
|
|
443
|
+
* so they agree on which taxonomies need touching. In particular, the
|
|
444
|
+
* translation path uses the keys here -- not `postAssignedTaxonomies` --
|
|
445
|
+
* to decide which inherited pivot rows to clear, so a translation whose
|
|
446
|
+
* only assignment is filtered out by `collections` doesn't lose its
|
|
447
|
+
* inherited terms (see #1087 review feedback).
|
|
448
|
+
*
|
|
449
|
+
* Skipped taxonomies: `nav_menu` (handled by the menu importer) and
|
|
450
|
+
* `language` (Polylang's locale signal, already promoted to `post.locale`
|
|
451
|
+
* by the parser).
|
|
452
|
+
*/
|
|
453
|
+
export function resolvePostTermAssignments(
|
|
454
|
+
collection: string,
|
|
455
|
+
post: WxrPost,
|
|
456
|
+
plan: TaxonomyImportPlan,
|
|
457
|
+
): Map<string, string[]> {
|
|
458
|
+
const result = new Map<string, string[]>();
|
|
459
|
+
const seen = new Set<string>();
|
|
460
|
+
|
|
461
|
+
const tryResolve = (taxonomyName: string, slug: string): void => {
|
|
462
|
+
const termId = plan.termIdByNameAndSlug.get(taxonomyName)?.get(slug);
|
|
463
|
+
if (!termId) return;
|
|
464
|
+
const collectionFilter = plan.collectionsByTaxonomy.get(taxonomyName);
|
|
465
|
+
// Empty set means "no filter" (def has no collections array). A
|
|
466
|
+
// non-empty set is enforced: skip assignments to collections the
|
|
467
|
+
// def doesn't list. Matches admin UI: a `category` term linked
|
|
468
|
+
// only to `posts` shouldn't end up on a `products` row just
|
|
469
|
+
// because the WXR happened to mention it.
|
|
470
|
+
if (collectionFilter && collectionFilter.size > 0 && !collectionFilter.has(collection)) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const dedupeKey = `${taxonomyName}\u0000${termId}`;
|
|
474
|
+
if (seen.has(dedupeKey)) return;
|
|
475
|
+
seen.add(dedupeKey);
|
|
476
|
+
const existing = result.get(taxonomyName);
|
|
477
|
+
if (existing) existing.push(termId);
|
|
478
|
+
else result.set(taxonomyName, [termId]);
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
for (const slug of post.categories) tryResolve("category", slug);
|
|
482
|
+
for (const slug of post.tags) tryResolve("tag", slug);
|
|
483
|
+
if (post.customTaxonomies) {
|
|
484
|
+
for (const [rawName, slugs] of post.customTaxonomies) {
|
|
485
|
+
if (rawName === "nav_menu" || rawName === "language") continue;
|
|
486
|
+
const taxonomyName = rawName === "post_tag" ? "tag" : rawName;
|
|
487
|
+
for (const slug of slugs) tryResolve(taxonomyName, slug);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
return result;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Attach the taxonomy assignments parsed for a single WXR post to a freshly-
|
|
496
|
+
* created EmDash content row. Additive (`attachToEntry` + `ON CONFLICT DO
|
|
497
|
+
* NOTHING`). Used for anchors -- translations need replace-semantics per
|
|
498
|
+
* taxonomy and should use `setPostTermAssignmentsReplacing` instead.
|
|
499
|
+
*
|
|
500
|
+
* Returns the number of pivot rows actually inserted (excludes rows that
|
|
501
|
+
* already existed via the `ON CONFLICT DO NOTHING` path), so the caller can
|
|
502
|
+
* roll them up into the import summary without over-counting on re-imports.
|
|
503
|
+
*/
|
|
504
|
+
export async function attachPostTaxonomies(
|
|
505
|
+
db: Kysely<Database>,
|
|
506
|
+
collection: string,
|
|
507
|
+
entryId: string,
|
|
508
|
+
post: WxrPost,
|
|
509
|
+
plan: TaxonomyImportPlan,
|
|
510
|
+
): Promise<number> {
|
|
511
|
+
const repo = new TaxonomyRepository(db);
|
|
512
|
+
const resolved = resolvePostTermAssignments(collection, post, plan);
|
|
513
|
+
|
|
514
|
+
let attached = 0;
|
|
515
|
+
for (const [, termIds] of resolved) {
|
|
516
|
+
for (const termId of termIds) {
|
|
517
|
+
const wrote = await attachToEntryCountingInserts(db, repo, plan, collection, entryId, termId);
|
|
518
|
+
if (wrote) attached++;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return attached;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Replace assignments per-taxonomy from a parsed WXR post. Used for
|
|
526
|
+
* translations: WPML's "Translate Independently" mode lets translators
|
|
527
|
+
* override term assignments per-taxonomy, not per-post. A translation that
|
|
528
|
+
* overrides `category` shouldn't lose its inherited `tag` or `genre`. We
|
|
529
|
+
* only call `setTermsForEntry(name, ids)` for taxonomies where the
|
|
530
|
+
* translation actually resolved at least one term -- taxonomies with no
|
|
531
|
+
* resolvable+permitted terms are left alone so inherited rows from
|
|
532
|
+
* `copyEntryTerms` stay intact.
|
|
533
|
+
*
|
|
534
|
+
* Returns the number of pivot rows after replacement (sum of `termIds`
|
|
535
|
+
* lists across taxonomies actually touched). Note this counts logical
|
|
536
|
+
* assignments, not the delta from the prior state; the import summary
|
|
537
|
+
* treats this as an additive count for compatibility with `attachPost-
|
|
538
|
+
* Taxonomies`.
|
|
539
|
+
*/
|
|
540
|
+
export async function setPostTermAssignmentsReplacing(
|
|
541
|
+
db: Kysely<Database>,
|
|
542
|
+
collection: string,
|
|
543
|
+
entryId: string,
|
|
544
|
+
post: WxrPost,
|
|
545
|
+
plan: TaxonomyImportPlan,
|
|
546
|
+
): Promise<number> {
|
|
547
|
+
const repo = new TaxonomyRepository(db);
|
|
548
|
+
const resolved = resolvePostTermAssignments(collection, post, plan);
|
|
549
|
+
|
|
550
|
+
let attached = 0;
|
|
551
|
+
for (const [taxonomyName, termIds] of resolved) {
|
|
552
|
+
await repo.setTermsForEntry(collection, entryId, taxonomyName, termIds);
|
|
553
|
+
attached += termIds.length;
|
|
554
|
+
}
|
|
555
|
+
return attached;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Resolve a term id to its `translation_group` (the value
|
|
560
|
+
* `content_taxonomies` stores). Caches the result on the plan so
|
|
561
|
+
* repeated attaches of the same term don't repeat the lookup.
|
|
562
|
+
*/
|
|
563
|
+
async function termTranslationGroup(
|
|
564
|
+
repo: TaxonomyRepository,
|
|
565
|
+
plan: TaxonomyImportPlan,
|
|
566
|
+
termId: string,
|
|
567
|
+
): Promise<string | null> {
|
|
568
|
+
const cached = plan.translationGroupByTermId.get(termId);
|
|
569
|
+
if (cached !== undefined) return cached;
|
|
570
|
+
const term = await repo.findById(termId);
|
|
571
|
+
const group = term?.translationGroup ?? null;
|
|
572
|
+
plan.translationGroupByTermId.set(termId, group);
|
|
573
|
+
return group;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Wrapper around `TaxonomyRepository.attachToEntry` that returns whether
|
|
578
|
+
* an actual row was inserted (vs. silently skipped by the `ON CONFLICT DO
|
|
579
|
+
* NOTHING` branch). Lets the importer's `assignments` counter reflect real
|
|
580
|
+
* writes rather than re-import no-ops.
|
|
581
|
+
*
|
|
582
|
+
* Best-effort: we check pivot existence first, then call `attachToEntry`.
|
|
583
|
+
* A concurrent insert between the check and the attach would make us
|
|
584
|
+
* report `false` while a row was in fact inserted -- the count is for
|
|
585
|
+
* summary display only, never correctness.
|
|
586
|
+
*/
|
|
587
|
+
async function attachToEntryCountingInserts(
|
|
588
|
+
db: Kysely<Database>,
|
|
589
|
+
repo: TaxonomyRepository,
|
|
590
|
+
plan: TaxonomyImportPlan,
|
|
591
|
+
collection: string,
|
|
592
|
+
entryId: string,
|
|
593
|
+
termId: string,
|
|
594
|
+
): Promise<boolean> {
|
|
595
|
+
const group = await termTranslationGroup(repo, plan, termId);
|
|
596
|
+
if (!group) return false;
|
|
597
|
+
|
|
598
|
+
const existing = await db
|
|
599
|
+
.selectFrom("content_taxonomies")
|
|
600
|
+
.select("collection")
|
|
601
|
+
.where("collection", "=", collection)
|
|
602
|
+
.where("entry_id", "=", entryId)
|
|
603
|
+
.where("taxonomy_id", "=", group)
|
|
604
|
+
.executeTakeFirst();
|
|
605
|
+
if (existing) return false;
|
|
606
|
+
|
|
607
|
+
await repo.attachToEntry(collection, entryId, termId);
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Mirror every term in the plan into each additional locale used by the
|
|
613
|
+
* incoming posts. New rows share the canonical term's `translation_group`
|
|
614
|
+
* so per-locale lookups (`getTermsForEntry(..., locale)`) resolve correctly
|
|
615
|
+
* for translations whose locale differs from the import-wide one.
|
|
616
|
+
*
|
|
617
|
+
* Without this pass, multilingual WXR imports (#1080) write all term rows
|
|
618
|
+
* at the upload-wide locale; the `content_taxonomies` pivot is correct (it
|
|
619
|
+
* stores `translation_group`, not `term id`), but
|
|
620
|
+
* `getTermsForEntry(collection, arabicPostId, "category", "ar")` filters on
|
|
621
|
+
* `taxonomies.locale = "ar"` and returns zero rows. Users see "no tags" on
|
|
622
|
+
* every non-canonical translation.
|
|
623
|
+
*
|
|
624
|
+
* Idempotent: skips a locale when a row already exists at `(name, slug,
|
|
625
|
+
* locale)`. Safe to call after `preImportWxrTaxonomies` on subsequent
|
|
626
|
+
* imports.
|
|
627
|
+
*/
|
|
628
|
+
export async function mirrorTermsToLocales(
|
|
629
|
+
db: Kysely<Database>,
|
|
630
|
+
plan: TaxonomyImportPlan,
|
|
631
|
+
postLocales: Iterable<string>,
|
|
632
|
+
canonicalLocale: string | undefined,
|
|
633
|
+
): Promise<void> {
|
|
634
|
+
const localeSet = new Set<string>();
|
|
635
|
+
for (const locale of postLocales) {
|
|
636
|
+
if (!locale || locale === canonicalLocale) continue;
|
|
637
|
+
localeSet.add(locale);
|
|
638
|
+
}
|
|
639
|
+
if (localeSet.size === 0) return;
|
|
640
|
+
|
|
641
|
+
const repo = new TaxonomyRepository(db);
|
|
642
|
+
|
|
643
|
+
for (const [taxonomyName, bySlug] of plan.termIdByNameAndSlug) {
|
|
644
|
+
for (const [slug, canonicalTermId] of bySlug) {
|
|
645
|
+
// Resolve the canonical's translation_group once; we'll compare
|
|
646
|
+
// against any pre-existing rows we find at the target locales.
|
|
647
|
+
// Cache on the plan so subsequent attaches (which also need
|
|
648
|
+
// this resolution) don't repeat the lookup.
|
|
649
|
+
const cachedGroup = await termTranslationGroup(repo, plan, canonicalTermId);
|
|
650
|
+
if (!cachedGroup) {
|
|
651
|
+
// The canonical term id is in the plan but the row is no
|
|
652
|
+
// longer in the DB. Shouldn't happen during a single
|
|
653
|
+
// import run; skip rather than crash so the rest of the
|
|
654
|
+
// import can complete.
|
|
655
|
+
continue;
|
|
656
|
+
}
|
|
657
|
+
const canonicalGroup = cachedGroup;
|
|
658
|
+
|
|
659
|
+
for (const locale of localeSet) {
|
|
660
|
+
const existing = await repo.findBySlug(taxonomyName, slug, locale);
|
|
661
|
+
if (existing) {
|
|
662
|
+
// `ensureTerm` resolves cross-locale grouping when it
|
|
663
|
+
// creates the canonical row, so a pre-existing sibling
|
|
664
|
+
// row at this locale should already share the
|
|
665
|
+
// canonical's `translation_group`. If it doesn't, the
|
|
666
|
+
// import would write pivots pointing at a group that
|
|
667
|
+
// has no row in this locale -- a silent data-integrity
|
|
668
|
+
// bug. Fail closed: throw so the operator reconciles
|
|
669
|
+
// the existing rows in the admin before retrying. This
|
|
670
|
+
// happens when the canonical row was created in an
|
|
671
|
+
// earlier import and a sibling-locale row was added
|
|
672
|
+
// manually afterwards (or vice versa) without linking
|
|
673
|
+
// them via translationOf.
|
|
674
|
+
if (existing.translationGroup !== canonicalGroup) {
|
|
675
|
+
throw new WxrTaxonomyConflictError(
|
|
676
|
+
`Cannot import: term "${taxonomyName}/${slug}" already exists at locale "${locale}" in a different translation group than the canonical row at this import's locale. Reconcile the rows in the admin (re-link via translationOf, or delete one) and retry.`,
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
try {
|
|
682
|
+
await repo.create({
|
|
683
|
+
name: taxonomyName,
|
|
684
|
+
slug,
|
|
685
|
+
label: slug, // we don't have a per-locale label from the WXR
|
|
686
|
+
locale,
|
|
687
|
+
translationOf: canonicalTermId,
|
|
688
|
+
});
|
|
689
|
+
} catch (error) {
|
|
690
|
+
// `findBySlug` + `create` is not atomic. A concurrent
|
|
691
|
+
// import racing us into the same `(name, slug, locale)`
|
|
692
|
+
// will trip the UNIQUE constraint. Re-read the row that
|
|
693
|
+
// won the race and verify its `translation_group`
|
|
694
|
+
// matches the canonical's; if not, the pivot will
|
|
695
|
+
// resolve to a group that has no row in this locale
|
|
696
|
+
// (silent data-integrity bug) so we surface that loudly
|
|
697
|
+
// rather than continue.
|
|
698
|
+
//
|
|
699
|
+
// Other errors (validation, connectivity) re-throw so
|
|
700
|
+
// the import fails closed rather than silently shipping
|
|
701
|
+
// translations that resolve to empty taxonomy queries.
|
|
702
|
+
const message = error instanceof Error ? error.message.toLowerCase() : "";
|
|
703
|
+
const isUniqueRace =
|
|
704
|
+
message.includes("unique constraint failed") || message.includes("duplicate key");
|
|
705
|
+
if (!isUniqueRace) throw error;
|
|
706
|
+
|
|
707
|
+
const winner = await repo.findBySlug(taxonomyName, slug, locale);
|
|
708
|
+
if (!winner) {
|
|
709
|
+
// UNIQUE conflict but no row visible? Shouldn't
|
|
710
|
+
// happen unless the racing transaction rolled back;
|
|
711
|
+
// fail loudly so the operator can investigate.
|
|
712
|
+
throw new WxrTaxonomyConflictError(
|
|
713
|
+
`Cannot import: term "${taxonomyName}/${slug}" raced UNIQUE at locale "${locale}" but no row is visible afterwards. The concurrent transaction may have rolled back; retry the import.`,
|
|
714
|
+
{ cause: error },
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
if (winner.translationGroup !== canonicalGroup) {
|
|
718
|
+
throw new WxrTaxonomyConflictError(
|
|
719
|
+
`Cannot import: term "${taxonomyName}/${slug}" raced UNIQUE at locale "${locale}" with a different translation group. Reconcile the rows in the admin and retry.`,
|
|
720
|
+
{ cause: error },
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
console.warn(
|
|
724
|
+
`[WXR import] concurrent writer beat us to term "${taxonomyName}/${slug}" at locale "${locale}"; using existing row (same group).`,
|
|
725
|
+
);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
}
|