emdash 0.20.0 → 0.21.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-BzIHV3sw.d.mts → adapters-BxSmgtbF.d.mts} +1 -1
- package/dist/{adapters-BzIHV3sw.d.mts.map → adapters-BxSmgtbF.d.mts.map} +1 -1
- package/dist/{allowed-origins-B1u7Qnvg.mjs → allowed-origins-BqC8cul8.mjs} +2 -2
- package/dist/{allowed-origins-B1u7Qnvg.mjs.map → allowed-origins-BqC8cul8.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +13 -12
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +3 -2
- package/dist/{api-DStv36ik.mjs → api-DxjIV2o8.mjs} +13 -13
- package/dist/{api-DStv36ik.mjs.map → api-DxjIV2o8.mjs.map} +1 -1
- package/dist/{api-tokens-DPfhPu5V.mjs → api-tokens-BFFkB0jB.mjs} +2 -2
- package/dist/{api-tokens-DPfhPu5V.mjs.map → api-tokens-BFFkB0jB.mjs.map} +1 -1
- package/dist/{apply-Dr7snAMT.mjs → apply-CLjxheyb.mjs} +12 -12
- package/dist/{apply-Dr7snAMT.mjs.map → apply-CLjxheyb.mjs.map} +1 -1
- package/dist/astro/index.d.mts +10 -10
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +50 -15
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.mjs +5 -5
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +11 -2
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +3 -2
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +1 -1
- package/dist/astro/middleware.mjs +63 -60
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -4
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -4
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +8 -7
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +8 -7
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +8 -7
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +14 -12
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +14 -12
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +14 -12
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +9 -8
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/comments/bulk.mjs +7 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +3 -3
- package/dist/astro/routes/api/admin/comments/index.mjs +7 -6
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +3 -3
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +29 -27
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +29 -27
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +29 -27
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +29 -27
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +28 -26
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +28 -26
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +28 -26
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -4
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +5 -4
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +9 -8
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +6 -5
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +8 -7
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -7
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +5 -4
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -4
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +10 -9
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +8 -7
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +9 -8
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +9 -8
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +9 -8
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +8 -7
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +11 -9
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +3 -3
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +10 -9
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +10 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +8 -7
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -8
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +8 -7
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +10 -9
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +14 -12
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +3 -3
- package/dist/astro/routes/api/mcp.mjs +20 -19
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +6 -5
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +6 -5
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +8 -7
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +10 -9
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +6 -5
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +6 -5
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +6 -5
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +6 -5
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +6 -5
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +6 -5
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
- package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
- package/dist/astro/routes/api/oauth/token.mjs +5 -5
- package/dist/astro/routes/api/openapi.json.mjs +3 -2
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +7 -6
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +7 -6
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +8 -7
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +8 -7
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +28 -26
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +28 -26
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +28 -26
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +28 -26
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +28 -26
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +5 -5
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +28 -26
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +28 -26
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +9 -8
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +8 -7
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +9 -8
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +5 -5
- package/dist/astro/routes/api/search/suggest.mjs +8 -7
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +8 -7
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +8 -7
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +3 -3
- package/dist/astro/routes/api/settings.mjs +11 -9
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +10 -9
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +9 -8
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +19 -18
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
- package/dist/astro/routes/api/setup/index.mjs +20 -18
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +5 -4
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +11 -10
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +11 -10
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +11 -10
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +11 -10
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +5 -4
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +6 -5
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +5 -4
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +8 -7
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +6 -5
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +12 -12
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-DsMSVSaY.mjs → authorize-D5gfBVU5.mjs} +2 -2
- package/dist/{authorize-DsMSVSaY.mjs.map → authorize-D5gfBVU5.mjs.map} +1 -1
- package/dist/{byline-DUx48sJp.mjs → byline-V_Qp1Ziw.mjs} +27 -14
- package/dist/byline-V_Qp1Ziw.mjs.map +1 -0
- package/dist/{byline-fields-8TMtkBnH.mjs → byline-fields-B0NO1yUB.mjs} +3 -3
- package/dist/{byline-fields-8TMtkBnH.mjs.map → byline-fields-B0NO1yUB.mjs.map} +1 -1
- package/dist/{byline-fields-DbibsvTl.d.mts → byline-fields-CQJRIQkn.d.mts} +32 -32
- package/dist/{byline-fields-DbibsvTl.d.mts.map → byline-fields-CQJRIQkn.d.mts.map} +1 -1
- package/dist/{byline-fields--WxSNS79.mjs → byline-fields-nBVqK_Ff.mjs} +2 -2
- package/dist/{byline-fields--WxSNS79.mjs.map → byline-fields-nBVqK_Ff.mjs.map} +1 -1
- package/dist/{byline-registry-CWP7I71B.mjs → byline-registry-DedidtqC.mjs} +2 -2
- package/dist/{byline-registry-CWP7I71B.mjs.map → byline-registry-DedidtqC.mjs.map} +1 -1
- package/dist/{bylines-BdxWCnPL.mjs → bylines-B2NWnIwS.mjs} +2 -2
- package/dist/{bylines-BdxWCnPL.mjs.map → bylines-B2NWnIwS.mjs.map} +1 -1
- package/dist/{bylines-s8c2DXbH.mjs → bylines-DfGDnred.mjs} +7 -7
- package/dist/{bylines-s8c2DXbH.mjs.map → bylines-DfGDnred.mjs.map} +1 -1
- package/dist/{cache-B_HzASVT.mjs → cache-DTTHWD8n.mjs} +1 -1
- package/dist/{cache-B_HzASVT.mjs.map → cache-DTTHWD8n.mjs.map} +1 -1
- package/dist/{challenge-store-DXX3rfdI.mjs → challenge-store-woE0bbCf.mjs} +1 -1
- package/dist/{challenge-store-DXX3rfdI.mjs.map → challenge-store-woE0bbCf.mjs.map} +1 -1
- package/dist/cli/index.mjs +19 -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.mjs +1 -1
- package/dist/{comments-Vkivawyl.mjs → comments-D2hNuxNa.mjs} +1 -1
- package/dist/{comments-Vkivawyl.mjs.map → comments-D2hNuxNa.mjs.map} +1 -1
- package/dist/{components-CK0cuUoH.mjs → components-DYKp2gmo.mjs} +1 -1
- package/dist/{components-CK0cuUoH.mjs.map → components-DYKp2gmo.mjs.map} +1 -1
- package/dist/{context-Y7BRkWes.mjs → context-Cm4pt1Ws.mjs} +5 -5
- package/dist/{context-Y7BRkWes.mjs.map → context-Cm4pt1Ws.mjs.map} +1 -1
- package/dist/{cron-BJ2ClIlj.mjs → cron-DdEVrQ2Y.mjs} +1 -1
- package/dist/{cron-BJ2ClIlj.mjs.map → cron-DdEVrQ2Y.mjs.map} +1 -1
- package/dist/{dashboard-2JgAMWxK.mjs → dashboard-C-UYpps0.mjs} +1 -1
- package/dist/{dashboard-2JgAMWxK.mjs.map → dashboard-C-UYpps0.mjs.map} +1 -1
- package/dist/db/index.d.mts +3 -3
- 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-CtzxKBxe.mjs → db-errors-BluWkwGI.mjs} +1 -1
- package/dist/{db-errors-CtzxKBxe.mjs.map → db-errors-BluWkwGI.mjs.map} +1 -1
- package/dist/{default-IlBaTFxM.mjs → default-NHGuJzQ3.mjs} +1 -1
- package/dist/{default-IlBaTFxM.mjs.map → default-NHGuJzQ3.mjs.map} +1 -1
- package/dist/{device-flow-R23SIbQ2.mjs → device-flow-BQApWgnW.mjs} +4 -4
- package/dist/{device-flow-R23SIbQ2.mjs.map → device-flow-BQApWgnW.mjs.map} +1 -1
- package/dist/{email-console-DHT2Fbpj.mjs → email-console-BbU3RbWv.mjs} +1 -1
- package/dist/{email-console-DHT2Fbpj.mjs.map → email-console-BbU3RbWv.mjs.map} +1 -1
- package/dist/{error-RwM4dD35.mjs → error-CNn_w7jf.mjs} +1 -1
- package/dist/{error-RwM4dD35.mjs.map → error-CNn_w7jf.mjs.map} +1 -1
- package/dist/{escape-Ds07EEyu.mjs → escape-DPgcxcpL.mjs} +1 -1
- package/dist/{escape-Ds07EEyu.mjs.map → escape-DPgcxcpL.mjs.map} +1 -1
- package/dist/{fts-manager-1RgHmopc.mjs → fts-manager-Cx5z8jdA.mjs} +1 -1
- package/dist/{fts-manager-1RgHmopc.mjs.map → fts-manager-Cx5z8jdA.mjs.map} +1 -1
- package/dist/{hash-9w3pd3-m.mjs → hash-DlvIFn0b.mjs} +1 -1
- package/dist/{hash-9w3pd3-m.mjs.map → hash-DlvIFn0b.mjs.map} +1 -1
- package/dist/{import-Dh8bWmyq.mjs → import-KyxT1Mbs.mjs} +3 -3
- package/dist/{import-Dh8bWmyq.mjs.map → import-KyxT1Mbs.mjs.map} +1 -1
- package/dist/{index-B1keaX5Y.d.mts → index-D2VAiumu.d.mts} +15 -15
- package/dist/{index-B1keaX5Y.d.mts.map → index-D2VAiumu.d.mts.map} +1 -1
- package/dist/{index-DR56od45.d.mts → index-uT2yR66F.d.mts} +3 -3
- package/dist/{index-DR56od45.d.mts.map → index-uT2yR66F.d.mts.map} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +48 -46
- package/dist/init-lock-DlBHjf9-.mjs +83 -0
- package/dist/init-lock-DlBHjf9-.mjs.map +1 -0
- package/dist/{load-BBetCvLC.mjs → load-Dq91b_DK.mjs} +1 -1
- package/dist/{load-BBetCvLC.mjs.map → load-Dq91b_DK.mjs.map} +1 -1
- package/dist/{loader-ZN1ll-d-.mjs → loader-BqWjcH3h.mjs} +2 -2
- package/dist/{loader-ZN1ll-d-.mjs.map → loader-BqWjcH3h.mjs.map} +1 -1
- package/dist/{manifest-schema-BtwbL_vj.mjs → manifest-schema-DFPeqMAn.mjs} +1 -1
- package/dist/{manifest-schema-BtwbL_vj.mjs.map → manifest-schema-DFPeqMAn.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +11 -11
- package/dist/media/local-runtime.mjs +4 -3
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-allowlist-Dknq-OFY.mjs → media-allowlist-_A0SuDn4.mjs} +2 -2
- package/dist/{media-allowlist-Dknq-OFY.mjs.map → media-allowlist-_A0SuDn4.mjs.map} +1 -1
- package/dist/{media-url-VClf8glU.mjs → media-url-CqLd69IO.mjs} +1 -1
- package/dist/{media-url-VClf8glU.mjs.map → media-url-CqLd69IO.mjs.map} +1 -1
- package/dist/{menus-DrQLusqj.mjs → menus-Ryk9L7fT.mjs} +9 -9
- package/dist/{menus-DrQLusqj.mjs.map → menus-Ryk9L7fT.mjs.map} +1 -1
- package/dist/{mime-CCEzze7W.mjs → mime-YbtlEtvS.mjs} +1 -1
- package/dist/{mime-CCEzze7W.mjs.map → mime-YbtlEtvS.mjs.map} +1 -1
- package/dist/{mode-CO2vQHfq.mjs → mode-CGXzIbD8.mjs} +1 -1
- package/dist/{mode-CO2vQHfq.mjs.map → mode-CGXzIbD8.mjs.map} +1 -1
- package/dist/{normalize-CK5o04zr.mjs → normalize-DKsg36ty.mjs} +1 -1
- package/dist/{normalize-CK5o04zr.mjs.map → normalize-DKsg36ty.mjs.map} +1 -1
- package/dist/{oauth-authorization-Bw4NdF_S.mjs → oauth-authorization-C2kVyjXI.mjs} +4 -4
- package/dist/{oauth-authorization-Bw4NdF_S.mjs.map → oauth-authorization-C2kVyjXI.mjs.map} +1 -1
- package/dist/{oauth-clients-BGGFp57s.mjs → oauth-clients-BC873NCV.mjs} +1 -1
- package/dist/{oauth-clients-BGGFp57s.mjs.map → oauth-clients-BC873NCV.mjs.map} +1 -1
- package/dist/{oauth-state-store-97x0xtN2.mjs → oauth-state-store-Cd--TUaq.mjs} +1 -1
- package/dist/{oauth-state-store-97x0xtN2.mjs.map → oauth-state-store-Cd--TUaq.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-B_vnZHKO.mjs → oauth-user-lookup-e4wOvDud.mjs} +1 -1
- package/dist/{oauth-user-lookup-B_vnZHKO.mjs.map → oauth-user-lookup-e4wOvDud.mjs.map} +1 -1
- package/dist/{options-DyYIYpPd.d.mts → options-9kLgkE8m.d.mts} +3 -3
- package/dist/{options-DyYIYpPd.d.mts.map → options-9kLgkE8m.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-CrGndy1A.mjs → parse-DzSrk1t8.mjs} +2 -2
- package/dist/{parse-CrGndy1A.mjs.map → parse-DzSrk1t8.mjs.map} +1 -1
- package/dist/{passkey-config-C3QgnQnU.mjs → passkey-config-BpjbE_Uv.mjs} +1 -1
- package/dist/{passkey-config-C3QgnQnU.mjs.map → passkey-config-BpjbE_Uv.mjs.map} +1 -1
- package/dist/{placeholder-BZxr8W1j.mjs → placeholder-2xumZh4g.mjs} +1 -1
- package/dist/{placeholder-BZxr8W1j.mjs.map → placeholder-2xumZh4g.mjs.map} +1 -1
- package/dist/{placeholder-CVBv5z8k.d.mts → placeholder-BevVKfay.d.mts} +1 -1
- package/dist/{placeholder-CVBv5z8k.d.mts.map → placeholder-BevVKfay.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{preview-BfuRkVKW.mjs → preview-Dqv2hwXr.mjs} +2 -2
- package/dist/{preview-BfuRkVKW.mjs.map → preview-Dqv2hwXr.mjs.map} +1 -1
- package/dist/{public-url-BFVC2OTJ.mjs → public-url-D_zARuvZ.mjs} +1 -1
- package/dist/{public-url-BFVC2OTJ.mjs.map → public-url-D_zARuvZ.mjs.map} +1 -1
- package/dist/{query-CbUcI4Xk.mjs → query-Crm038Mc.mjs} +9 -9
- package/dist/{query-CbUcI4Xk.mjs.map → query-Crm038Mc.mjs.map} +1 -1
- package/dist/{rate-limit-C7hjdkS5.mjs → rate-limit-hRTBqmw1.mjs} +2 -2
- package/dist/{rate-limit-C7hjdkS5.mjs.map → rate-limit-hRTBqmw1.mjs.map} +1 -1
- package/dist/{redirect-B_q19j4v.mjs → redirect-C-OOkyku.mjs} +1 -1
- package/dist/{redirect-B_q19j4v.mjs.map → redirect-C-OOkyku.mjs.map} +1 -1
- package/dist/{redirects-CCbCqCCd.mjs → redirects-6Zg2SoYo.mjs} +8 -9
- package/dist/{redirects-CCbCqCCd.mjs.map → redirects-6Zg2SoYo.mjs.map} +1 -1
- package/dist/{redirects-DxVoR7PI.mjs → redirects-CP3TnTLO.mjs} +20 -14
- package/dist/redirects-CP3TnTLO.mjs.map +1 -0
- package/dist/{registry-brYh-rAT.mjs → registry-diMzD1Wf.mjs} +3 -3
- package/dist/{registry-brYh-rAT.mjs.map → registry-diMzD1Wf.mjs.map} +1 -1
- package/dist/{request-cache-D32LpnmI.mjs → request-cache-UwmBAiUK.mjs} +1 -1
- package/dist/{request-cache-D32LpnmI.mjs.map → request-cache-UwmBAiUK.mjs.map} +1 -1
- package/dist/{request-meta-7ByVLxB-.mjs → request-meta-DPechd0W.mjs} +2 -2
- package/dist/{request-meta-7ByVLxB-.mjs.map → request-meta-DPechd0W.mjs.map} +1 -1
- package/dist/{resolve-BqYMVG0D.mjs → resolve-B3NUUtVY.mjs} +1 -1
- package/dist/{resolve-BqYMVG0D.mjs.map → resolve-B3NUUtVY.mjs.map} +1 -1
- package/dist/{runner-DTdhuI9i.d.mts → runner-C8vcbvCe.d.mts} +2 -2
- package/dist/{runner-DTdhuI9i.d.mts.map → runner-C8vcbvCe.d.mts.map} +1 -1
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-C1E70ug_.mjs → schema-BDOkd3OU.mjs} +4 -4
- package/dist/{schema-C1E70ug_.mjs.map → schema-BDOkd3OU.mjs.map} +1 -1
- package/dist/{search-B3SGZw91.mjs → search-Bs_J_EW-.mjs} +3 -3
- package/dist/{search-B3SGZw91.mjs.map → search-Bs_J_EW-.mjs.map} +1 -1
- package/dist/{secrets-ChPTmy9x.mjs → secrets-C8xmE6mR.mjs} +21 -11
- package/dist/secrets-C8xmE6mR.mjs.map +1 -0
- package/dist/{sections-D_lVzwRZ.mjs → sections-P0zuBlyz.mjs} +2 -2
- package/dist/{sections-D_lVzwRZ.mjs.map → sections-P0zuBlyz.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +14 -13
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-D_LPkOtu.mjs → seo-CLhm-Fmb.mjs} +1 -1
- package/dist/{seo-D_LPkOtu.mjs.map → seo-CLhm-Fmb.mjs.map} +1 -1
- package/dist/{seo-B5e6y9Wk.mjs → seo-DpNgGQjF.mjs} +1 -1
- package/dist/{seo-B5e6y9Wk.mjs.map → seo-DpNgGQjF.mjs.map} +1 -1
- package/dist/{service-ChDcsTBs.mjs → service-CDQQnT8W.mjs} +2 -2
- package/dist/{service-ChDcsTBs.mjs.map → service-CDQQnT8W.mjs.map} +1 -1
- package/dist/{settings-DfxiWY_s.mjs → settings-BjBsmVAo.mjs} +10 -184
- package/dist/settings-BjBsmVAo.mjs.map +1 -0
- package/dist/{settings-Cv47v9u8.mjs → settings-sO0Fif4p.mjs} +2 -2
- package/dist/{settings-Cv47v9u8.mjs.map → settings-sO0Fif4p.mjs.map} +1 -1
- package/dist/{setup-complete-yvPE4OsP.mjs → setup-complete-CMMr-oZU.mjs} +1 -1
- package/dist/{setup-complete-yvPE4OsP.mjs.map → setup-complete-CMMr-oZU.mjs.map} +1 -1
- package/dist/{setup-nonce-C9aFzb94.mjs → setup-nonce-169xl4fV.mjs} +1 -1
- package/dist/{setup-nonce-C9aFzb94.mjs.map → setup-nonce-169xl4fV.mjs.map} +1 -1
- package/dist/single-flight-cache-C0UV1Npg.mjs +104 -0
- package/dist/single-flight-cache-C0UV1Npg.mjs.map +1 -0
- package/dist/{site-url-CnHlmAs9.mjs → site-url-vtsuOvSD.mjs} +1 -1
- package/dist/{site-url-CnHlmAs9.mjs.map → site-url-vtsuOvSD.mjs.map} +1 -1
- package/dist/{ssrf-BsVGIE0Z.mjs → ssrf-XO05Voq6.mjs} +1 -1
- package/dist/{ssrf-BsVGIE0Z.mjs.map → ssrf-XO05Voq6.mjs.map} +1 -1
- package/dist/status-2gZklYuj.mjs +30 -0
- package/dist/status-2gZklYuj.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-BdAmbOwx.mjs → taxonomies-BBxYA38v.mjs} +6 -6
- package/dist/{taxonomies-BdAmbOwx.mjs.map → taxonomies-BBxYA38v.mjs.map} +1 -1
- package/dist/{taxonomies-BILwiyGk.mjs → taxonomies-DuESHWKI.mjs} +2 -2
- package/dist/{taxonomies-BILwiyGk.mjs.map → taxonomies-DuESHWKI.mjs.map} +1 -1
- package/dist/{tokens-Bx2afeT-.mjs → tokens-DMkVjxrx.mjs} +1 -1
- package/dist/{tokens-Bx2afeT-.mjs.map → tokens-DMkVjxrx.mjs.map} +1 -1
- package/dist/{transport-CmpLD7W3.mjs → transport-1cIrOb1Y.mjs} +1 -1
- package/dist/{transport-CmpLD7W3.mjs.map → transport-1cIrOb1Y.mjs.map} +1 -1
- package/dist/{transport-B7PPP2CC.d.mts → transport-jdvsZEIt.d.mts} +1 -1
- package/dist/{transport-B7PPP2CC.d.mts.map → transport-jdvsZEIt.d.mts.map} +1 -1
- package/dist/{trusted-proxy-B4AfnoAp.mjs → trusted-proxy-CHp41Fjj.mjs} +1 -1
- package/dist/{trusted-proxy-B4AfnoAp.mjs.map → trusted-proxy-CHp41Fjj.mjs.map} +1 -1
- package/dist/{types-BFgrqwSk.d.mts → types-BFgYtuKd.d.mts} +1 -1
- package/dist/{types-BFgrqwSk.d.mts.map → types-BFgYtuKd.d.mts.map} +1 -1
- package/dist/{types-DZk_y-MU.mjs → types-BIduXPJk.mjs} +1 -1
- package/dist/{types-DZk_y-MU.mjs.map → types-BIduXPJk.mjs.map} +1 -1
- package/dist/{types-DTniiNto.d.mts → types-BTnnBYVX.d.mts} +2 -2
- package/dist/{types-DTniiNto.d.mts.map → types-BTnnBYVX.d.mts.map} +1 -1
- package/dist/{types-BUUVn1zr.d.mts → types-Bzfk2yC8.d.mts} +1 -1
- package/dist/{types-BUUVn1zr.d.mts.map → types-Bzfk2yC8.d.mts.map} +1 -1
- package/dist/{types-BH8-30hc.d.mts → types-CkEuk-Zr.d.mts} +1 -1
- package/dist/{types-BH8-30hc.d.mts.map → types-CkEuk-Zr.d.mts.map} +1 -1
- package/dist/{types-CPAPl93j.d.mts → types-DO7whVYU.d.mts} +2 -2
- package/dist/{types-CPAPl93j.d.mts.map → types-DO7whVYU.d.mts.map} +1 -1
- package/dist/{types-S15DXXNi.d.mts → types-DdkL6fyv.d.mts} +1 -1
- package/dist/{types-S15DXXNi.d.mts.map → types-DdkL6fyv.d.mts.map} +1 -1
- package/dist/{types-DpFmlNyB.mjs → types-DejCHqWT.mjs} +1 -1
- package/dist/{types-DpFmlNyB.mjs.map → types-DejCHqWT.mjs.map} +1 -1
- package/dist/{types-BPzXTV9x.d.mts → types-Del0VMij.d.mts} +1 -1
- package/dist/{types-BPzXTV9x.d.mts.map → types-Del0VMij.d.mts.map} +1 -1
- package/dist/{types-D4kUqbHh.d.mts → types-u_XxjbS8.d.mts} +1 -1
- package/dist/{types-D4kUqbHh.d.mts.map → types-u_XxjbS8.d.mts.map} +1 -1
- package/dist/{utils-C4Ih4DML.mjs → utils-C4M981Br.mjs} +1 -1
- package/dist/{utils-C4Ih4DML.mjs.map → utils-C4M981Br.mjs.map} +1 -1
- package/dist/{validate-Bz4vqcX1.mjs → validate-DGhQPXzI.mjs} +2 -2
- package/dist/{validate-Bz4vqcX1.mjs.map → validate-DGhQPXzI.mjs.map} +1 -1
- package/dist/{validate-CNwkPWzz.d.mts → validate-cJOiOvT2.d.mts} +5 -5
- package/dist/{validate-CNwkPWzz.d.mts.map → validate-cJOiOvT2.d.mts.map} +1 -1
- package/dist/{validation-DgGTJm3u.mjs → validation-DVHjPM1M.mjs} +5 -5
- package/dist/{validation-DgGTJm3u.mjs.map → validation-DVHjPM1M.mjs.map} +1 -1
- package/dist/version-BOjj_cfz.mjs +7 -0
- package/dist/{version-D-5txk2m.mjs.map → version-BOjj_cfz.mjs.map} +1 -1
- package/dist/{widgets-DZfmAbE4.mjs → widgets-Ci6hLwfO.mjs} +4 -4
- package/dist/{widgets-DZfmAbE4.mjs.map → widgets-Ci6hLwfO.mjs.map} +1 -1
- package/dist/{zod-generator-Djo_VHCt.mjs → zod-generator-CarzgPAu.mjs} +2 -2
- package/dist/{zod-generator-Djo_VHCt.mjs.map → zod-generator-CarzgPAu.mjs.map} +1 -1
- package/package.json +5 -5
- package/src/api/handlers/redirects.ts +24 -13
- package/src/api/schemas/redirects.ts +11 -4
- package/src/astro/integration/index.ts +44 -8
- package/src/astro/integration/routes.ts +46 -9
- package/src/astro/middleware/redirect.ts +12 -0
- package/src/bylines/field-defs-cache.ts +70 -20
- package/src/cli/commands/doctor.ts +1 -1
- package/src/config/secrets.ts +28 -14
- package/src/emdash-runtime.ts +5 -5
- package/src/redirects/status.ts +27 -0
- package/src/settings/index.ts +13 -13
- package/src/utils/{isolate-cache.ts → single-flight-cache.ts} +26 -21
- package/dist/byline-DUx48sJp.mjs.map +0 -1
- package/dist/redirects-DxVoR7PI.mjs.map +0 -1
- package/dist/secrets-ChPTmy9x.mjs.map +0 -1
- package/dist/settings-DfxiWY_s.mjs.map +0 -1
- package/dist/version-D-5txk2m.mjs +0 -7
- /package/dist/{api-tokens-Oq39ba-Z.mjs → api-tokens-C7ywRx7l.mjs} +0 -0
- /package/dist/{ssrf-BvgVcfNQ.mjs → ssrf-CRZGzjdL.mjs} +0 -0
- /package/dist/{types-CZI4E3qG.mjs → types-BoRm8-pp.mjs} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import "../../../../../base64-CqR-7kqF.mjs";
|
|
2
2
|
import "../../../../../types-BXSUSAjt.mjs";
|
|
3
|
-
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-
|
|
4
|
-
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-
|
|
5
|
-
import { n as parseBody, t as isParseError } from "../../../../../parse-
|
|
6
|
-
import "../../../../../redirects-
|
|
7
|
-
import { m as wpPluginAnalyzeBody } from "../../../../../byline-fields-
|
|
3
|
+
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-XO05Voq6.mjs";
|
|
4
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-CNn_w7jf.mjs";
|
|
5
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-DzSrk1t8.mjs";
|
|
6
|
+
import "../../../../../redirects-6Zg2SoYo.mjs";
|
|
7
|
+
import { m as wpPluginAnalyzeBody } from "../../../../../byline-fields-B0NO1yUB.mjs";
|
|
8
|
+
import "../../../../../status-2gZklYuj.mjs";
|
|
8
9
|
import "../../../../../api/schemas/index.mjs";
|
|
9
|
-
import { s as getSource } from "../../../../../import-
|
|
10
|
-
import "../../../../../ssrf-
|
|
11
|
-
import "../../../../../utils-
|
|
12
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
10
|
+
import { s as getSource } from "../../../../../import-KyxT1Mbs.mjs";
|
|
11
|
+
import "../../../../../ssrf-CRZGzjdL.mjs";
|
|
12
|
+
import "../../../../../utils-C4M981Br.mjs";
|
|
13
|
+
import { n as requirePerm } from "../../../../../authorize-D5gfBVU5.mjs";
|
|
13
14
|
import { SchemaRegistry } from "emdash";
|
|
14
15
|
|
|
15
16
|
//#region src/astro/routes/api/import/wordpress-plugin/analyze.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/analyze.ts"],"sourcesContent":["/**\n * WordPress Plugin analyze endpoint\n *\n * POST /_emdash/api/import/wordpress-plugin/analyze\n *\n * Analyzes a WordPress site with EmDash Exporter plugin installed.\n * Returns content counts, schema compatibility, etc.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { SchemaRegistry } from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpPluginAnalyzeBody } from \"#api/schemas.js\";\nimport { getSource } from \"#import/index.js\";\nimport { resolveAndValidateExternalUrl, SsrfError } from \"#import/ssrf.js\";\nimport type { ImportAnalysis } from \"#import/types.js\";\nimport type { EmDashHandlers } from \"#types\";\n\nexport const prerender = false;\n\nexport interface WpPluginAnalyzeResponse {\n\tsuccess: boolean;\n\tanalysis?: ImportAnalysis;\n\terror?: { message: string };\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, wpPluginAnalyzeBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// SSRF: reject internal/private network targets. Uses DNS resolution\n\t\t// to catch hostnames that resolve to private addresses.\n\t\ttry {\n\t\t\tawait resolveAndValidateExternalUrl(body.url);\n\t\t} catch (e) {\n\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\treturn apiError(\"SSRF_BLOCKED\", msg, 400);\n\t\t}\n\n\t\t// Get the WordPress plugin source\n\t\tconst source = getSource(\"wordpress-plugin\");\n\t\tif (!source) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"WordPress plugin source not available\", 500);\n\t\t}\n\n\t\t// Build context with existing collections info\n\t\tconst existingCollections = await fetchExistingCollections(emdash?.db);\n\n\t\t// Analyze the site\n\t\tconst analysis = await source.analyze(\n\t\t\t{ type: \"url\", url: body.url, token: body.token },\n\t\t\t{\n\t\t\t\tdb: emdash?.db,\n\t\t\t\tgetExistingCollections: async () => existingCollections,\n\t\t\t},\n\t\t);\n\n\t\treturn apiSuccess({\n\t\t\tsuccess: true,\n\t\t\tanalysis,\n\t\t});\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to analyze WordPress site\", \"WP_PLUGIN_ANALYZE_ERROR\");\n\t}\n};\n\n/** Existing collection info from schema registry */\ninterface ExistingCollection {\n\tslug: string;\n\tfields: Map<string, { type: string }>;\n}\n\n/** Fetch collections and their fields from schema registry */\nasync function fetchExistingCollections(\n\tdb: EmDashHandlers[\"db\"] | undefined,\n): Promise<Map<string, ExistingCollection>> {\n\tconst result = new Map<string, ExistingCollection>();\n\n\tif (!db) return result;\n\n\ttry {\n\t\tconst registry = new SchemaRegistry(db);\n\t\tconst collections = await registry.listCollections();\n\n\t\tfor (const collection of collections) {\n\t\t\tconst fields = await registry.listFields(collection.id);\n\t\t\tconst fieldMap = new Map<string, { type: string }>();\n\n\t\t\tfor (const field of fields) {\n\t\t\t\tfieldMap.set(field.slug, { type: field.type });\n\t\t\t}\n\n\t\t\tresult.set(collection.slug, {\n\t\t\t\tslug: collection.slug,\n\t\t\t\tfields: fieldMap,\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tconsole.warn(\"Could not fetch schema registry:\", error);\n\t}\n\n\treturn result;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyze.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/analyze.ts"],"sourcesContent":["/**\n * WordPress Plugin analyze endpoint\n *\n * POST /_emdash/api/import/wordpress-plugin/analyze\n *\n * Analyzes a WordPress site with EmDash Exporter plugin installed.\n * Returns content counts, schema compatibility, etc.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { SchemaRegistry } from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpPluginAnalyzeBody } from \"#api/schemas.js\";\nimport { getSource } from \"#import/index.js\";\nimport { resolveAndValidateExternalUrl, SsrfError } from \"#import/ssrf.js\";\nimport type { ImportAnalysis } from \"#import/types.js\";\nimport type { EmDashHandlers } from \"#types\";\n\nexport const prerender = false;\n\nexport interface WpPluginAnalyzeResponse {\n\tsuccess: boolean;\n\tanalysis?: ImportAnalysis;\n\terror?: { message: string };\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\ttry {\n\t\tconst body = await parseBody(request, wpPluginAnalyzeBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// SSRF: reject internal/private network targets. Uses DNS resolution\n\t\t// to catch hostnames that resolve to private addresses.\n\t\ttry {\n\t\t\tawait resolveAndValidateExternalUrl(body.url);\n\t\t} catch (e) {\n\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\treturn apiError(\"SSRF_BLOCKED\", msg, 400);\n\t\t}\n\n\t\t// Get the WordPress plugin source\n\t\tconst source = getSource(\"wordpress-plugin\");\n\t\tif (!source) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"WordPress plugin source not available\", 500);\n\t\t}\n\n\t\t// Build context with existing collections info\n\t\tconst existingCollections = await fetchExistingCollections(emdash?.db);\n\n\t\t// Analyze the site\n\t\tconst analysis = await source.analyze(\n\t\t\t{ type: \"url\", url: body.url, token: body.token },\n\t\t\t{\n\t\t\t\tdb: emdash?.db,\n\t\t\t\tgetExistingCollections: async () => existingCollections,\n\t\t\t},\n\t\t);\n\n\t\treturn apiSuccess({\n\t\t\tsuccess: true,\n\t\t\tanalysis,\n\t\t});\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to analyze WordPress site\", \"WP_PLUGIN_ANALYZE_ERROR\");\n\t}\n};\n\n/** Existing collection info from schema registry */\ninterface ExistingCollection {\n\tslug: string;\n\tfields: Map<string, { type: string }>;\n}\n\n/** Fetch collections and their fields from schema registry */\nasync function fetchExistingCollections(\n\tdb: EmDashHandlers[\"db\"] | undefined,\n): Promise<Map<string, ExistingCollection>> {\n\tconst result = new Map<string, ExistingCollection>();\n\n\tif (!db) return result;\n\n\ttry {\n\t\tconst registry = new SchemaRegistry(db);\n\t\tconst collections = await registry.listCollections();\n\n\t\tfor (const collection of collections) {\n\t\t\tconst fields = await registry.listFields(collection.id);\n\t\t\tconst fieldMap = new Map<string, { type: string }>();\n\n\t\t\tfor (const field of fields) {\n\t\t\t\tfieldMap.set(field.slug, { type: field.type });\n\t\t\t}\n\n\t\t\tresult.set(collection.slug, {\n\t\t\t\tslug: collection.slug,\n\t\t\t\tfields: fieldMap,\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tconsole.warn(\"Could not fetch schema registry:\", error);\n\t}\n\n\treturn result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAa,YAAY;AAQzB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI;EACH,MAAM,OAAO,MAAM,UAAU,SAAS,oBAAoB;AAC1D,MAAI,aAAa,KAAK,CAAE,QAAO;AAI/B,MAAI;AACH,SAAM,8BAA8B,KAAK,IAAI;WACrC,GAAG;AAEX,UAAO,SAAS,gBADJ,aAAa,YAAY,EAAE,UAAU,eACZ,IAAI;;EAI1C,MAAM,SAAS,UAAU,mBAAmB;AAC5C,MAAI,CAAC,OACJ,QAAO,SAAS,kBAAkB,yCAAyC,IAAI;EAIhF,MAAM,sBAAsB,MAAM,yBAAyB,QAAQ,GAAG;AAWtE,SAAO,WAAW;GACjB,SAAS;GACT,UAVgB,MAAM,OAAO,QAC7B;IAAE,MAAM;IAAO,KAAK,KAAK;IAAK,OAAO,KAAK;IAAO,EACjD;IACC,IAAI,QAAQ;IACZ,wBAAwB,YAAY;IACpC,CACD;GAKA,CAAC;UACM,OAAO;AACf,SAAO,YAAY,OAAO,oCAAoC,0BAA0B;;;;AAW1F,eAAe,yBACd,IAC2C;CAC3C,MAAM,yBAAS,IAAI,KAAiC;AAEpD,KAAI,CAAC,GAAI,QAAO;AAEhB,KAAI;EACH,MAAM,WAAW,IAAI,eAAe,GAAG;EACvC,MAAM,cAAc,MAAM,SAAS,iBAAiB;AAEpD,OAAK,MAAM,cAAc,aAAa;GACrC,MAAM,SAAS,MAAM,SAAS,WAAW,WAAW,GAAG;GACvD,MAAM,2BAAW,IAAI,KAA+B;AAEpD,QAAK,MAAM,SAAS,OACnB,UAAS,IAAI,MAAM,MAAM,EAAE,MAAM,MAAM,MAAM,CAAC;AAG/C,UAAO,IAAI,WAAW,MAAM;IAC3B,MAAM,WAAW;IACjB,QAAQ;IACR,CAAC;;UAEK,OAAO;AACf,UAAQ,KAAK,oCAAoC,MAAM;;AAGxD,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as ImportConfig, u as ImportResult } from "../../../../../types-
|
|
1
|
+
import { s as ImportConfig, u as ImportResult } from "../../../../../types-BFgYtuKd.mjs";
|
|
2
2
|
import { APIRoute } from "astro";
|
|
3
3
|
|
|
4
4
|
//#region src/astro/routes/api/import/wordpress-plugin/execute.d.ts
|
|
@@ -2,19 +2,21 @@ import "../../../../../dialect-helpers-DRI5pyY3.mjs";
|
|
|
2
2
|
import { n as slugify } from "../../../../../slugify-Cjh1ssOZ.mjs";
|
|
3
3
|
import "../../../../../base64-CqR-7kqF.mjs";
|
|
4
4
|
import "../../../../../types-BXSUSAjt.mjs";
|
|
5
|
-
import "../../../../../
|
|
6
|
-
import "../../../../../
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import "../../../../../
|
|
12
|
-
import
|
|
5
|
+
import "../../../../../init-lock-DlBHjf9-.mjs";
|
|
6
|
+
import "../../../../../request-cache-UwmBAiUK.mjs";
|
|
7
|
+
import "../../../../../byline-registry-DedidtqC.mjs";
|
|
8
|
+
import { t as BylineRepository } from "../../../../../byline-V_Qp1Ziw.mjs";
|
|
9
|
+
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "../../../../../ssrf-XO05Voq6.mjs";
|
|
10
|
+
import { n as apiSuccess, r as handleError, t as apiError } from "../../../../../error-CNn_w7jf.mjs";
|
|
11
|
+
import { n as parseBody, t as isParseError } from "../../../../../parse-DzSrk1t8.mjs";
|
|
12
|
+
import "../../../../../redirects-6Zg2SoYo.mjs";
|
|
13
|
+
import { h as wpPluginExecuteBody } from "../../../../../byline-fields-B0NO1yUB.mjs";
|
|
14
|
+
import "../../../../../status-2gZklYuj.mjs";
|
|
13
15
|
import "../../../../../api/schemas/index.mjs";
|
|
14
|
-
import { s as getSource } from "../../../../../import-
|
|
15
|
-
import "../../../../../ssrf-
|
|
16
|
-
import { m as resolveImportByline } from "../../../../../utils-
|
|
17
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
16
|
+
import { s as getSource } from "../../../../../import-KyxT1Mbs.mjs";
|
|
17
|
+
import "../../../../../ssrf-CRZGzjdL.mjs";
|
|
18
|
+
import { m as resolveImportByline } from "../../../../../utils-C4M981Br.mjs";
|
|
19
|
+
import { n as requirePerm } from "../../../../../authorize-D5gfBVU5.mjs";
|
|
18
20
|
import { ContentRepository, SchemaRegistry } from "emdash";
|
|
19
21
|
|
|
20
22
|
//#region src/astro/routes/api/import/wordpress-plugin/execute.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/execute.ts"],"sourcesContent":["/**\n * WordPress Plugin execute import endpoint\n *\n * POST /_emdash/api/import/wordpress-plugin/execute\n *\n * Imports content from WordPress via EmDash Exporter plugin API.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { ContentRepository, SchemaRegistry } from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpPluginExecuteBody } from \"#api/schemas.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\nimport { getSource } from \"#import/index.js\";\nimport { resolveAndValidateExternalUrl, SsrfError } from \"#import/ssrf.js\";\nimport type { ImportConfig, ImportResult, NormalizedItem } from \"#import/types.js\";\nimport { resolveImportByline } from \"#import/utils.js\";\nimport type { FieldType } from \"#schema/types.js\";\nimport type { EmDashHandlers, EmDashManifest } from \"#types\";\nimport { slugify } from \"#utils/slugify.js\";\n\nexport const prerender = false;\n\nexport interface WpPluginImportConfig extends ImportConfig {\n\t/** Author mappings (WP author login -> EmDash user ID) */\n\tauthorMappings?: Record<string, string | null>;\n}\n\nexport interface WpPluginImportResponse {\n\tsuccess: boolean;\n\tresult?: ImportResult;\n\terror?: { message: string };\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\tif (!emdash?.handleContentCreate) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash not configured\", 500);\n\t}\n\n\ttry {\n\t\tconst emdashManifest = await emdash.getManifest();\n\n\t\tconst body = await parseBody(request, wpPluginExecuteBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// SSRF: reject internal/private network targets. Uses DNS resolution\n\t\t// to catch hostnames that resolve to private addresses.\n\t\ttry {\n\t\t\tawait resolveAndValidateExternalUrl(body.url);\n\t\t} catch (e) {\n\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\treturn apiError(\"SSRF_BLOCKED\", msg, 400);\n\t\t}\n\n\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- Zod schema output narrowed to WpPluginImportConfig\n\t\tconst config = body.config as unknown as WpPluginImportConfig;\n\n\t\t// Get the WordPress plugin source\n\t\tconst source = getSource(\"wordpress-plugin\");\n\t\tif (!source) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"WordPress plugin source not available\", 500);\n\t\t}\n\n\t\t// Build the list of post types to fetch\n\t\tconst postTypes = Object.entries(config.postTypeMappings)\n\t\t\t.filter(([_, mapping]) => mapping.enabled)\n\t\t\t.map(([postType]) => postType);\n\n\t\tif (postTypes.length === 0) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"No post types selected for import\", 400);\n\t\t}\n\n\t\tconsole.log(\"[WP Plugin Import] Starting import for:\", body.url);\n\t\tconsole.log(\"[WP Plugin Import] Post types:\", postTypes);\n\n\t\t// Import content (including drafts since we have auth)\n\t\tconst result = await importContent(\n\t\t\tsource.fetchContent(\n\t\t\t\t{ type: \"url\", url: body.url, token: body.token },\n\t\t\t\t{ postTypes, includeDrafts: true },\n\t\t\t),\n\t\t\tconfig,\n\t\t\temdash,\n\t\t\temdashManifest,\n\t\t);\n\n\t\tconsole.log(\"[WP Plugin Import] Import result:\", JSON.stringify(result, null, 2));\n\n\t\treturn apiSuccess({\n\t\t\tsuccess: true,\n\t\t\tresult,\n\t\t});\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to import from WordPress\", \"WP_PLUGIN_IMPORT_ERROR\");\n\t}\n};\n\n/** Fields that should be auto-created if they don't exist */\nconst IMPORT_FIELDS: Array<{\n\tslug: string;\n\tlabel: string;\n\ttype: FieldType;\n\tcheck: (item: NormalizedItem) => boolean;\n}> = [\n\t{\n\t\tslug: \"title\",\n\t\tlabel: \"Title\",\n\t\ttype: \"string\",\n\t\tcheck: () => true,\n\t},\n\t{\n\t\tslug: \"content\",\n\t\tlabel: \"Content\",\n\t\ttype: \"portableText\",\n\t\tcheck: () => true,\n\t},\n\t{\n\t\tslug: \"excerpt\",\n\t\tlabel: \"Excerpt\",\n\t\ttype: \"text\",\n\t\tcheck: (item) => !!item.excerpt,\n\t},\n\t{\n\t\tslug: \"featured_image\",\n\t\tlabel: \"Featured Image\",\n\t\ttype: \"image\",\n\t\tcheck: (item) => !!item.featuredImage,\n\t},\n];\n\nasync function importContent(\n\titems: AsyncGenerator<NormalizedItem>,\n\tconfig: WpPluginImportConfig,\n\temdash: EmDashHandlers,\n\tmanifest: EmDashManifest,\n): Promise<ImportResult> {\n\tconst result: ImportResult = {\n\t\tsuccess: true,\n\t\timported: 0,\n\t\tskipped: 0,\n\t\terrors: [],\n\t\tbyCollection: {},\n\t};\n\n\t// Create content repository for checking existing items\n\tconst contentRepo = new ContentRepository(emdash.db);\n\tconst bylineRepo = new BylineRepository(emdash.db);\n\tconst bylineCache = new Map<string, string>();\n\tconst schemaRegistry = new SchemaRegistry(emdash.db);\n\n\t// Track which collections have had fields ensured\n\tconst ensuredCollections = new Set<string>();\n\n\t// Track source translationGroup -> EmDash item ID for translation linking.\n\t// Maps source-side translation group ID to the EmDash ID of the first item\n\t// imported for that group (the default-locale item).\n\tconst translationGroupMap = new Map<string, string>();\n\n\tfor await (const item of items) {\n\t\tconsole.log(\"[WP Plugin Import] Processing item:\", {\n\t\t\tsourceId: item.sourceId,\n\t\t\ttitle: item.title,\n\t\t\tpostType: item.postType,\n\t\t\tstatus: item.status,\n\t\t\tcontentBlocks: Array.isArray(item.content) ? item.content.length : 0,\n\t\t\tfeaturedImage: item.featuredImage,\n\t\t\tlocale: item.locale,\n\t\t\ttranslationGroup: item.translationGroup,\n\t\t});\n\n\t\tconst mapping = config.postTypeMappings[item.postType];\n\n\t\t// Skip if not mapped or disabled\n\t\tif (!mapping || !mapping.enabled) {\n\t\t\tresult.skipped++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst collection = mapping.collection;\n\n\t\t// Check if collection exists in manifest\n\t\tif (!manifest?.collections[collection]) {\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: item.title || \"Untitled\",\n\t\t\t\terror: `Collection \"${collection}\" does not exist`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// Ensure required fields exist in the collection schema (once per collection)\n\t\t\tif (!ensuredCollections.has(collection)) {\n\t\t\t\tfor (const field of IMPORT_FIELDS) {\n\t\t\t\t\tif (field.check(item)) {\n\t\t\t\t\t\tconst existingField = await schemaRegistry.getField(collection, field.slug);\n\t\t\t\t\t\tif (!existingField) {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t`[WP Plugin Import] Creating missing field \"${field.slug}\" in collection \"${collection}\"`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait schemaRegistry.createField(collection, {\n\t\t\t\t\t\t\t\t\tslug: field.slug,\n\t\t\t\t\t\t\t\t\tlabel: field.label,\n\t\t\t\t\t\t\t\t\ttype: field.type,\n\t\t\t\t\t\t\t\t\trequired: false,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t// Field might already exist from concurrent creation\n\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t`[WP Plugin Import] Field \"${field.slug}\" creation skipped:`,\n\t\t\t\t\t\t\t\t\te instanceof Error ? e.message : e,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tensuredCollections.add(collection);\n\t\t\t}\n\n\t\t\t// Generate slug from item slug or title\n\t\t\tconst slug = item.slug || slugify(item.title || `post-${item.sourceId}`);\n\n\t\t\t// Check if already exists (idempotency) — locale-aware lookup\n\t\t\tif (config.skipExisting) {\n\t\t\t\tconst existing = await contentRepo.findBySlug(collection, slug, item.locale);\n\t\t\t\tif (existing) {\n\t\t\t\t\t// Still track the translation group mapping for later items\n\t\t\t\t\tif (item.translationGroup) {\n\t\t\t\t\t\ttranslationGroupMap.set(item.translationGroup, existing.id);\n\t\t\t\t\t}\n\t\t\t\t\tresult.skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Map WordPress status to EmDash status\n\t\t\tconst status = mapStatus(item.status);\n\n\t\t\t// Build data object - add all applicable fields\n\t\t\tconst data: Record<string, unknown> = {};\n\n\t\t\t// Add standard fields\n\t\t\tdata.title = item.title || \"Untitled\";\n\t\t\tdata.content = item.content;\n\n\t\t\tif (item.excerpt) {\n\t\t\t\tdata.excerpt = item.excerpt;\n\t\t\t}\n\t\t\tif (item.featuredImage) {\n\t\t\t\tdata.featured_image = item.featuredImage;\n\t\t\t\tconsole.log(\"[WP Plugin Import] Adding featured_image:\", item.featuredImage);\n\t\t\t}\n\n\t\t\t// Note: ACF/Yoast/RankMath fields are not added automatically\n\t\t\t// They would need matching fields in the EmDash schema\n\n\t\t\t// Resolve author ID from mappings\n\t\t\tlet authorId: string | undefined;\n\t\t\tif (config.authorMappings && item.author) {\n\t\t\t\tconst mappedUserId = config.authorMappings[item.author];\n\t\t\t\tif (mappedUserId !== undefined && mappedUserId !== null) {\n\t\t\t\t\tauthorId = mappedUserId;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bylineId = await resolveImportByline(\n\t\t\t\titem.author,\n\t\t\t\titem.author, // display name fallback is the login\n\t\t\t\tauthorId,\n\t\t\t\tbylineRepo,\n\t\t\t\tbylineCache,\n\t\t\t);\n\n\t\t\t// Resolve translation link: if this item has a translationGroup and\n\t\t\t// we've already imported another item in the same group, link them.\n\t\t\tlet translationOf: string | undefined;\n\t\t\tif (item.translationGroup) {\n\t\t\t\tconst existingGroupItem = translationGroupMap.get(item.translationGroup);\n\t\t\t\tif (existingGroupItem) {\n\t\t\t\t\ttranslationOf = existingGroupItem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Preserve original dates from the source\n\t\t\tconst itemDateTime = item.date?.getTime();\n\t\t\tconst createdAt =\n\t\t\t\titemDateTime !== undefined && !Number.isNaN(itemDateTime)\n\t\t\t\t\t? item.date.toISOString()\n\t\t\t\t\t: undefined;\n\t\t\tconst publishedAt = status === \"published\" && createdAt ? createdAt : undefined;\n\n\t\t\t// Create the content item\n\t\t\tconst createResult = await emdash.handleContentCreate(collection, {\n\t\t\t\tdata,\n\t\t\t\tslug,\n\t\t\t\tstatus,\n\t\t\t\tauthorId,\n\t\t\t\tbylines: bylineId ? [{ bylineId }] : undefined,\n\t\t\t\tlocale: item.locale,\n\t\t\t\ttranslationOf,\n\t\t\t\tcreatedAt,\n\t\t\t\tpublishedAt,\n\t\t\t});\n\n\t\t\tif (createResult.success) {\n\t\t\t\tresult.imported++;\n\t\t\t\tresult.byCollection[collection] = (result.byCollection[collection] || 0) + 1;\n\n\t\t\t\t// Track translation group: first item in a group establishes the mapping\n\t\t\t\tif (item.translationGroup && !translationGroupMap.has(item.translationGroup)) {\n\t\t\t\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- handler success data includes id\n\t\t\t\t\tconst createdData = createResult.data as { id?: string } | undefined;\n\t\t\t\t\tif (createdData?.id) {\n\t\t\t\t\t\ttranslationGroupMap.set(item.translationGroup, createdData.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult.errors.push({\n\t\t\t\t\ttitle: item.title || \"Untitled\",\n\t\t\t\t\terror:\n\t\t\t\t\t\ttypeof createResult.error === \"object\" && createResult.error !== null\n\t\t\t\t\t\t\t? (createResult.error as { message?: string }).message || \"Unknown error\"\n\t\t\t\t\t\t\t: String(createResult.error),\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(`Import error for \"${item.title || \"Untitled\"}\":`, error);\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: item.title || \"Untitled\",\n\t\t\t\terror: error instanceof Error && error.message ? error.message : \"Failed to import item\",\n\t\t\t});\n\t\t}\n\t}\n\n\tresult.success = result.errors.length === 0;\n\treturn result;\n}\n\nfunction mapStatus(wpStatus: string | undefined): string {\n\tswitch (wpStatus) {\n\t\tcase \"publish\":\n\t\t\treturn \"published\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"draft\";\n\t\tcase \"private\":\n\t\t\treturn \"draft\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,YAAY;AAazB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,QAAQ,oBACZ,QAAO,SAAS,kBAAkB,yBAAyB,IAAI;AAGhE,KAAI;EACH,MAAM,iBAAiB,MAAM,OAAO,aAAa;EAEjD,MAAM,OAAO,MAAM,UAAU,SAAS,oBAAoB;AAC1D,MAAI,aAAa,KAAK,CAAE,QAAO;AAI/B,MAAI;AACH,SAAM,8BAA8B,KAAK,IAAI;WACrC,GAAG;AAEX,UAAO,SAAS,gBADJ,aAAa,YAAY,EAAE,UAAU,eACZ,IAAI;;EAI1C,MAAM,SAAS,KAAK;EAGpB,MAAM,SAAS,UAAU,mBAAmB;AAC5C,MAAI,CAAC,OACJ,QAAO,SAAS,kBAAkB,yCAAy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aAAa,UAAU,YAAY,aAAa,UAAU,OAC7D,aAAa,MAA+B,WAAW,kBACxD,OAAO,aAAa,MAAM;IAC9B,CAAC;WAEK,OAAO;AACf,WAAQ,MAAM,qBAAqB,KAAK,SAAS,WAAW,KAAK,MAAM;AACvE,UAAO,OAAO,KAAK;IAClB,OAAO,KAAK,SAAS;IACrB,OAAO,iBAAiB,SAAS,MAAM,UAAU,MAAM,UAAU;IACjE,CAAC;;;AAIJ,QAAO,UAAU,OAAO,OAAO,WAAW;AAC1C,QAAO;;AAGR,SAAS,UAAU,UAAsC;AACxD,SAAQ,UAAR;EACC,KAAK,UACJ,QAAO;EACR,KAAK,QACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,QACC,QAAO"}
|
|
1
|
+
{"version":3,"file":"execute.mjs","names":[],"sources":["../../../../../../src/astro/routes/api/import/wordpress-plugin/execute.ts"],"sourcesContent":["/**\n * WordPress Plugin execute import endpoint\n *\n * POST /_emdash/api/import/wordpress-plugin/execute\n *\n * Imports content from WordPress via EmDash Exporter plugin API.\n */\n\nimport type { APIRoute } from \"astro\";\nimport { ContentRepository, SchemaRegistry } from \"emdash\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, apiSuccess, handleError } from \"#api/error.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\nimport { wpPluginExecuteBody } from \"#api/schemas.js\";\nimport { BylineRepository } from \"#db/repositories/byline.js\";\nimport { getSource } from \"#import/index.js\";\nimport { resolveAndValidateExternalUrl, SsrfError } from \"#import/ssrf.js\";\nimport type { ImportConfig, ImportResult, NormalizedItem } from \"#import/types.js\";\nimport { resolveImportByline } from \"#import/utils.js\";\nimport type { FieldType } from \"#schema/types.js\";\nimport type { EmDashHandlers, EmDashManifest } from \"#types\";\nimport { slugify } from \"#utils/slugify.js\";\n\nexport const prerender = false;\n\nexport interface WpPluginImportConfig extends ImportConfig {\n\t/** Author mappings (WP author login -> EmDash user ID) */\n\tauthorMappings?: Record<string, string | null>;\n}\n\nexport interface WpPluginImportResponse {\n\tsuccess: boolean;\n\tresult?: ImportResult;\n\terror?: { message: string };\n}\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tconst denied = requirePerm(user, \"import:execute\");\n\tif (denied) return denied;\n\n\tif (!emdash?.handleContentCreate) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash not configured\", 500);\n\t}\n\n\ttry {\n\t\tconst emdashManifest = await emdash.getManifest();\n\n\t\tconst body = await parseBody(request, wpPluginExecuteBody);\n\t\tif (isParseError(body)) return body;\n\n\t\t// SSRF: reject internal/private network targets. Uses DNS resolution\n\t\t// to catch hostnames that resolve to private addresses.\n\t\ttry {\n\t\t\tawait resolveAndValidateExternalUrl(body.url);\n\t\t} catch (e) {\n\t\t\tconst msg = e instanceof SsrfError ? e.message : \"Invalid URL\";\n\t\t\treturn apiError(\"SSRF_BLOCKED\", msg, 400);\n\t\t}\n\n\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- Zod schema output narrowed to WpPluginImportConfig\n\t\tconst config = body.config as unknown as WpPluginImportConfig;\n\n\t\t// Get the WordPress plugin source\n\t\tconst source = getSource(\"wordpress-plugin\");\n\t\tif (!source) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"WordPress plugin source not available\", 500);\n\t\t}\n\n\t\t// Build the list of post types to fetch\n\t\tconst postTypes = Object.entries(config.postTypeMappings)\n\t\t\t.filter(([_, mapping]) => mapping.enabled)\n\t\t\t.map(([postType]) => postType);\n\n\t\tif (postTypes.length === 0) {\n\t\t\treturn apiError(\"VALIDATION_ERROR\", \"No post types selected for import\", 400);\n\t\t}\n\n\t\tconsole.log(\"[WP Plugin Import] Starting import for:\", body.url);\n\t\tconsole.log(\"[WP Plugin Import] Post types:\", postTypes);\n\n\t\t// Import content (including drafts since we have auth)\n\t\tconst result = await importContent(\n\t\t\tsource.fetchContent(\n\t\t\t\t{ type: \"url\", url: body.url, token: body.token },\n\t\t\t\t{ postTypes, includeDrafts: true },\n\t\t\t),\n\t\t\tconfig,\n\t\t\temdash,\n\t\t\temdashManifest,\n\t\t);\n\n\t\tconsole.log(\"[WP Plugin Import] Import result:\", JSON.stringify(result, null, 2));\n\n\t\treturn apiSuccess({\n\t\t\tsuccess: true,\n\t\t\tresult,\n\t\t});\n\t} catch (error) {\n\t\treturn handleError(error, \"Failed to import from WordPress\", \"WP_PLUGIN_IMPORT_ERROR\");\n\t}\n};\n\n/** Fields that should be auto-created if they don't exist */\nconst IMPORT_FIELDS: Array<{\n\tslug: string;\n\tlabel: string;\n\ttype: FieldType;\n\tcheck: (item: NormalizedItem) => boolean;\n}> = [\n\t{\n\t\tslug: \"title\",\n\t\tlabel: \"Title\",\n\t\ttype: \"string\",\n\t\tcheck: () => true,\n\t},\n\t{\n\t\tslug: \"content\",\n\t\tlabel: \"Content\",\n\t\ttype: \"portableText\",\n\t\tcheck: () => true,\n\t},\n\t{\n\t\tslug: \"excerpt\",\n\t\tlabel: \"Excerpt\",\n\t\ttype: \"text\",\n\t\tcheck: (item) => !!item.excerpt,\n\t},\n\t{\n\t\tslug: \"featured_image\",\n\t\tlabel: \"Featured Image\",\n\t\ttype: \"image\",\n\t\tcheck: (item) => !!item.featuredImage,\n\t},\n];\n\nasync function importContent(\n\titems: AsyncGenerator<NormalizedItem>,\n\tconfig: WpPluginImportConfig,\n\temdash: EmDashHandlers,\n\tmanifest: EmDashManifest,\n): Promise<ImportResult> {\n\tconst result: ImportResult = {\n\t\tsuccess: true,\n\t\timported: 0,\n\t\tskipped: 0,\n\t\terrors: [],\n\t\tbyCollection: {},\n\t};\n\n\t// Create content repository for checking existing items\n\tconst contentRepo = new ContentRepository(emdash.db);\n\tconst bylineRepo = new BylineRepository(emdash.db);\n\tconst bylineCache = new Map<string, string>();\n\tconst schemaRegistry = new SchemaRegistry(emdash.db);\n\n\t// Track which collections have had fields ensured\n\tconst ensuredCollections = new Set<string>();\n\n\t// Track source translationGroup -> EmDash item ID for translation linking.\n\t// Maps source-side translation group ID to the EmDash ID of the first item\n\t// imported for that group (the default-locale item).\n\tconst translationGroupMap = new Map<string, string>();\n\n\tfor await (const item of items) {\n\t\tconsole.log(\"[WP Plugin Import] Processing item:\", {\n\t\t\tsourceId: item.sourceId,\n\t\t\ttitle: item.title,\n\t\t\tpostType: item.postType,\n\t\t\tstatus: item.status,\n\t\t\tcontentBlocks: Array.isArray(item.content) ? item.content.length : 0,\n\t\t\tfeaturedImage: item.featuredImage,\n\t\t\tlocale: item.locale,\n\t\t\ttranslationGroup: item.translationGroup,\n\t\t});\n\n\t\tconst mapping = config.postTypeMappings[item.postType];\n\n\t\t// Skip if not mapped or disabled\n\t\tif (!mapping || !mapping.enabled) {\n\t\t\tresult.skipped++;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst collection = mapping.collection;\n\n\t\t// Check if collection exists in manifest\n\t\tif (!manifest?.collections[collection]) {\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: item.title || \"Untitled\",\n\t\t\t\terror: `Collection \"${collection}\" does not exist`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\t// Ensure required fields exist in the collection schema (once per collection)\n\t\t\tif (!ensuredCollections.has(collection)) {\n\t\t\t\tfor (const field of IMPORT_FIELDS) {\n\t\t\t\t\tif (field.check(item)) {\n\t\t\t\t\t\tconst existingField = await schemaRegistry.getField(collection, field.slug);\n\t\t\t\t\t\tif (!existingField) {\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t`[WP Plugin Import] Creating missing field \"${field.slug}\" in collection \"${collection}\"`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait schemaRegistry.createField(collection, {\n\t\t\t\t\t\t\t\t\tslug: field.slug,\n\t\t\t\t\t\t\t\t\tlabel: field.label,\n\t\t\t\t\t\t\t\t\ttype: field.type,\n\t\t\t\t\t\t\t\t\trequired: false,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t// Field might already exist from concurrent creation\n\t\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t\t`[WP Plugin Import] Field \"${field.slug}\" creation skipped:`,\n\t\t\t\t\t\t\t\t\te instanceof Error ? e.message : e,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tensuredCollections.add(collection);\n\t\t\t}\n\n\t\t\t// Generate slug from item slug or title\n\t\t\tconst slug = item.slug || slugify(item.title || `post-${item.sourceId}`);\n\n\t\t\t// Check if already exists (idempotency) — locale-aware lookup\n\t\t\tif (config.skipExisting) {\n\t\t\t\tconst existing = await contentRepo.findBySlug(collection, slug, item.locale);\n\t\t\t\tif (existing) {\n\t\t\t\t\t// Still track the translation group mapping for later items\n\t\t\t\t\tif (item.translationGroup) {\n\t\t\t\t\t\ttranslationGroupMap.set(item.translationGroup, existing.id);\n\t\t\t\t\t}\n\t\t\t\t\tresult.skipped++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Map WordPress status to EmDash status\n\t\t\tconst status = mapStatus(item.status);\n\n\t\t\t// Build data object - add all applicable fields\n\t\t\tconst data: Record<string, unknown> = {};\n\n\t\t\t// Add standard fields\n\t\t\tdata.title = item.title || \"Untitled\";\n\t\t\tdata.content = item.content;\n\n\t\t\tif (item.excerpt) {\n\t\t\t\tdata.excerpt = item.excerpt;\n\t\t\t}\n\t\t\tif (item.featuredImage) {\n\t\t\t\tdata.featured_image = item.featuredImage;\n\t\t\t\tconsole.log(\"[WP Plugin Import] Adding featured_image:\", item.featuredImage);\n\t\t\t}\n\n\t\t\t// Note: ACF/Yoast/RankMath fields are not added automatically\n\t\t\t// They would need matching fields in the EmDash schema\n\n\t\t\t// Resolve author ID from mappings\n\t\t\tlet authorId: string | undefined;\n\t\t\tif (config.authorMappings && item.author) {\n\t\t\t\tconst mappedUserId = config.authorMappings[item.author];\n\t\t\t\tif (mappedUserId !== undefined && mappedUserId !== null) {\n\t\t\t\t\tauthorId = mappedUserId;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bylineId = await resolveImportByline(\n\t\t\t\titem.author,\n\t\t\t\titem.author, // display name fallback is the login\n\t\t\t\tauthorId,\n\t\t\t\tbylineRepo,\n\t\t\t\tbylineCache,\n\t\t\t);\n\n\t\t\t// Resolve translation link: if this item has a translationGroup and\n\t\t\t// we've already imported another item in the same group, link them.\n\t\t\tlet translationOf: string | undefined;\n\t\t\tif (item.translationGroup) {\n\t\t\t\tconst existingGroupItem = translationGroupMap.get(item.translationGroup);\n\t\t\t\tif (existingGroupItem) {\n\t\t\t\t\ttranslationOf = existingGroupItem;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Preserve original dates from the source\n\t\t\tconst itemDateTime = item.date?.getTime();\n\t\t\tconst createdAt =\n\t\t\t\titemDateTime !== undefined && !Number.isNaN(itemDateTime)\n\t\t\t\t\t? item.date.toISOString()\n\t\t\t\t\t: undefined;\n\t\t\tconst publishedAt = status === \"published\" && createdAt ? createdAt : undefined;\n\n\t\t\t// Create the content item\n\t\t\tconst createResult = await emdash.handleContentCreate(collection, {\n\t\t\t\tdata,\n\t\t\t\tslug,\n\t\t\t\tstatus,\n\t\t\t\tauthorId,\n\t\t\t\tbylines: bylineId ? [{ bylineId }] : undefined,\n\t\t\t\tlocale: item.locale,\n\t\t\t\ttranslationOf,\n\t\t\t\tcreatedAt,\n\t\t\t\tpublishedAt,\n\t\t\t});\n\n\t\t\tif (createResult.success) {\n\t\t\t\tresult.imported++;\n\t\t\t\tresult.byCollection[collection] = (result.byCollection[collection] || 0) + 1;\n\n\t\t\t\t// Track translation group: first item in a group establishes the mapping\n\t\t\t\tif (item.translationGroup && !translationGroupMap.has(item.translationGroup)) {\n\t\t\t\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- handler success data includes id\n\t\t\t\t\tconst createdData = createResult.data as { id?: string } | undefined;\n\t\t\t\t\tif (createdData?.id) {\n\t\t\t\t\t\ttranslationGroupMap.set(item.translationGroup, createdData.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tresult.errors.push({\n\t\t\t\t\ttitle: item.title || \"Untitled\",\n\t\t\t\t\terror:\n\t\t\t\t\t\ttypeof createResult.error === \"object\" && createResult.error !== null\n\t\t\t\t\t\t\t? (createResult.error as { message?: string }).message || \"Unknown error\"\n\t\t\t\t\t\t\t: String(createResult.error),\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error(`Import error for \"${item.title || \"Untitled\"}\":`, error);\n\t\t\tresult.errors.push({\n\t\t\t\ttitle: item.title || \"Untitled\",\n\t\t\t\terror: error instanceof Error && error.message ? error.message : \"Failed to import item\",\n\t\t\t});\n\t\t}\n\t}\n\n\tresult.success = result.errors.length === 0;\n\treturn result;\n}\n\nfunction mapStatus(wpStatus: string | undefined): string {\n\tswitch (wpStatus) {\n\t\tcase \"publish\":\n\t\t\treturn \"published\";\n\t\tcase \"draft\":\n\t\t\treturn \"draft\";\n\t\tcase \"pending\":\n\t\t\treturn \"draft\";\n\t\tcase \"private\":\n\t\t\treturn \"draft\";\n\t\tdefault:\n\t\t\treturn \"draft\";\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,YAAY;AAazB,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;CAC5D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,KAAI,OAAQ,QAAO;AAEnB,KAAI,CAAC,QAAQ,oBACZ,QAAO,SAAS,kBAAkB,yBAAyB,IAAI;AAGhE,KAAI;EACH,MAAM,iBAAiB,MAAM,OAAO,aAAa;EAEjD,MAAM,OAAO,MAAM,UAAU,SAAS,oBAAoB;AAC1D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AAa,eAAe,OAAO,aAAa,eAAe,KAAK;AAG3E,QAAI,KAAK,oBAAoB,CAAC,oBAAoB,IAAI,KAAK,iBAAiB,EAAE;KAE7E,MAAM,cAAc,aAAa;AACjC,SAAI,aAAa,GAChB,qBAAoB,IAAI,KAAK,kBAAkB,YAAY,GAAG;;SAIhE,QAAO,OAAO,KAAK;IAClB,OAAO,KAAK,SAAS;IACrB,OACC,OAAO,aAAa,UAAU,YAAY,aAAa,UAAU,OAC7D,aAAa,MAA+B,WAAW,kBACxD,OAAO,aAAa,MAAM;IAC9B,CAAC;WAEK,OAAO;AACf,WAAQ,MAAM,qBAAqB,KAAK,SAAS,WAAW,KAAK,MAAM;AACvE,UAAO,OAAO,KAAK;IAClB,OAAO,KAAK,SAAS;IACrB,OAAO,iBAAiB,SAAS,MAAM,UAAU,MAAM,UAAU;IACjE,CAAC;;;AAIJ,QAAO,UAAU,OAAO,OAAO,WAAW;AAC1C,QAAO;;AAGR,SAAS,UAAU,UAAsC;AACxD,SAAQ,UAAR;EACC,KAAK,UACJ,QAAO;EACR,KAAK,QACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,KAAK,UACJ,QAAO;EACR,QACC,QAAO"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../../../base64-CqR-7kqF.mjs";
|
|
2
2
|
import "../../../types-BXSUSAjt.mjs";
|
|
3
|
-
import { r as handleError } from "../../../error-
|
|
4
|
-
import { n as VERSION, t as COMMIT } from "../../../version-
|
|
5
|
-
import { t as getAuthMode } from "../../../mode-
|
|
3
|
+
import { r as handleError } from "../../../error-CNn_w7jf.mjs";
|
|
4
|
+
import { n as VERSION, t as COMMIT } from "../../../version-BOjj_cfz.mjs";
|
|
5
|
+
import { t as getAuthMode } from "../../../mode-CGXzIbD8.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/astro/routes/api/manifest.ts
|
|
8
8
|
const prerender = false;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../../../base64-CqR-7kqF.mjs";
|
|
2
2
|
import "../../../types-BXSUSAjt.mjs";
|
|
3
|
-
import { t as apiError } from "../../../error-
|
|
4
|
-
import { En as contentBylineInputSchema, ln as contentSeoInput } from "../../../redirects-
|
|
5
|
-
import "../../../byline-fields-
|
|
3
|
+
import { t as apiError } from "../../../error-CNn_w7jf.mjs";
|
|
4
|
+
import { En as contentBylineInputSchema, ln as contentSeoInput } from "../../../redirects-6Zg2SoYo.mjs";
|
|
5
|
+
import "../../../byline-fields-B0NO1yUB.mjs";
|
|
6
|
+
import "../../../status-2gZklYuj.mjs";
|
|
6
7
|
import "../../../api/schemas/index.mjs";
|
|
7
|
-
import { i as hasScope } from "../../../api-tokens-
|
|
8
|
+
import { i as hasScope } from "../../../api-tokens-C7ywRx7l.mjs";
|
|
8
9
|
import { z } from "zod";
|
|
9
10
|
import { Role, canActOnOwn, hasPermission } from "@emdash-cms/auth";
|
|
10
11
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
@@ -645,7 +646,7 @@ function createMcpServer() {
|
|
|
645
646
|
requireRole(extra, Role.EDITOR);
|
|
646
647
|
const ec = getEmDash(extra);
|
|
647
648
|
try {
|
|
648
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
649
|
+
const { SchemaRegistry } = await import("../../../schema-BDOkd3OU.mjs").then((n) => n.t);
|
|
649
650
|
return jsonResult({ items: await new SchemaRegistry(ec.db).listCollections() });
|
|
650
651
|
} catch (error) {
|
|
651
652
|
return respondHandlerError(error, "SCHEMA_LIST_ERROR");
|
|
@@ -661,7 +662,7 @@ function createMcpServer() {
|
|
|
661
662
|
requireRole(extra, Role.EDITOR);
|
|
662
663
|
const ec = getEmDash(extra);
|
|
663
664
|
try {
|
|
664
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
665
|
+
const { SchemaRegistry } = await import("../../../schema-BDOkd3OU.mjs").then((n) => n.t);
|
|
665
666
|
const collection = await new SchemaRegistry(ec.db).getCollectionWithFields(args.slug);
|
|
666
667
|
if (!collection) return respondError("NOT_FOUND", `Collection '${args.slug}' not found`);
|
|
667
668
|
return jsonResult(collection);
|
|
@@ -691,7 +692,7 @@ function createMcpServer() {
|
|
|
691
692
|
requireRole(extra, Role.ADMIN);
|
|
692
693
|
const ec = getEmDash(extra);
|
|
693
694
|
try {
|
|
694
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
695
|
+
const { SchemaRegistry } = await import("../../../schema-BDOkd3OU.mjs").then((n) => n.t);
|
|
695
696
|
const collection = await new SchemaRegistry(ec.db).createCollection({
|
|
696
697
|
slug: args.slug,
|
|
697
698
|
label: args.label,
|
|
@@ -719,7 +720,7 @@ function createMcpServer() {
|
|
|
719
720
|
requireRole(extra, Role.ADMIN);
|
|
720
721
|
const ec = getEmDash(extra);
|
|
721
722
|
try {
|
|
722
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
723
|
+
const { SchemaRegistry } = await import("../../../schema-BDOkd3OU.mjs").then((n) => n.t);
|
|
723
724
|
await new SchemaRegistry(ec.db).deleteCollection(args.slug, { force: args.force });
|
|
724
725
|
ec.invalidateUrlPatternCache();
|
|
725
726
|
return jsonResult({ deleted: args.slug });
|
|
@@ -773,7 +774,7 @@ function createMcpServer() {
|
|
|
773
774
|
requireRole(extra, Role.ADMIN);
|
|
774
775
|
const ec = getEmDash(extra);
|
|
775
776
|
try {
|
|
776
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
777
|
+
const { SchemaRegistry } = await import("../../../schema-BDOkd3OU.mjs").then((n) => n.t);
|
|
777
778
|
return jsonResult(await new SchemaRegistry(ec.db).createField(args.collection, {
|
|
778
779
|
slug: args.slug,
|
|
779
780
|
label: args.label,
|
|
@@ -803,7 +804,7 @@ function createMcpServer() {
|
|
|
803
804
|
requireRole(extra, Role.ADMIN);
|
|
804
805
|
const ec = getEmDash(extra);
|
|
805
806
|
try {
|
|
806
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
807
|
+
const { SchemaRegistry } = await import("../../../schema-BDOkd3OU.mjs").then((n) => n.t);
|
|
807
808
|
await new SchemaRegistry(ec.db).deleteField(args.collection, args.fieldSlug);
|
|
808
809
|
return jsonResult({
|
|
809
810
|
deleted: args.fieldSlug,
|
|
@@ -924,7 +925,7 @@ function createMcpServer() {
|
|
|
924
925
|
requireScope(extra, "content:read");
|
|
925
926
|
const ec = getEmDash(extra);
|
|
926
927
|
try {
|
|
927
|
-
const { searchWithDb } = await import("../../../search-
|
|
928
|
+
const { searchWithDb } = await import("../../../search-Bs_J_EW-.mjs").then((n) => n.t);
|
|
928
929
|
return jsonResult(await searchWithDb(ec.db, args.query, {
|
|
929
930
|
collections: args.collections,
|
|
930
931
|
locale: args.locale,
|
|
@@ -943,7 +944,7 @@ function createMcpServer() {
|
|
|
943
944
|
requireScope(extra, "content:read");
|
|
944
945
|
const ec = getEmDash(extra);
|
|
945
946
|
try {
|
|
946
|
-
const { handleTaxonomyList } = await import("../../../taxonomies-
|
|
947
|
+
const { handleTaxonomyList } = await import("../../../taxonomies-DuESHWKI.mjs").then((n) => n.l);
|
|
947
948
|
return unwrap(await handleTaxonomyList(ec.db, { locale: args.locale }));
|
|
948
949
|
} catch (error) {
|
|
949
950
|
return respondHandlerError(error, "TAXONOMY_LIST_ERROR");
|
|
@@ -963,7 +964,7 @@ function createMcpServer() {
|
|
|
963
964
|
requireScope(extra, "content:read");
|
|
964
965
|
const ec = getEmDash(extra);
|
|
965
966
|
try {
|
|
966
|
-
const { handleTaxonomyList } = await import("../../../taxonomies-
|
|
967
|
+
const { handleTaxonomyList } = await import("../../../taxonomies-DuESHWKI.mjs").then((n) => n.l);
|
|
967
968
|
const listResult = await handleTaxonomyList(ec.db, { locale: args.locale });
|
|
968
969
|
if (!listResult.success) return unwrap(listResult);
|
|
969
970
|
if (!listResult.data.taxonomies.find((t) => t.name === args.taxonomy)) return respondError("NOT_FOUND", `Taxonomy '${args.taxonomy}' not found`);
|
|
@@ -1022,7 +1023,7 @@ function createMcpServer() {
|
|
|
1022
1023
|
requireRole(extra, Role.EDITOR);
|
|
1023
1024
|
const ec = getEmDash(extra);
|
|
1024
1025
|
try {
|
|
1025
|
-
const { handleTermCreate } = await import("../../../taxonomies-
|
|
1026
|
+
const { handleTermCreate } = await import("../../../taxonomies-DuESHWKI.mjs").then((n) => n.l);
|
|
1026
1027
|
return unwrap(await handleTermCreate(ec.db, args.taxonomy, {
|
|
1027
1028
|
slug: args.slug,
|
|
1028
1029
|
label: args.label,
|
|
@@ -1051,7 +1052,7 @@ function createMcpServer() {
|
|
|
1051
1052
|
requireRole(extra, Role.EDITOR);
|
|
1052
1053
|
const ec = getEmDash(extra);
|
|
1053
1054
|
try {
|
|
1054
|
-
const { handleTermUpdate } = await import("../../../taxonomies-
|
|
1055
|
+
const { handleTermUpdate } = await import("../../../taxonomies-DuESHWKI.mjs").then((n) => n.l);
|
|
1055
1056
|
return unwrap(await handleTermUpdate(ec.db, args.taxonomy, args.termSlug, {
|
|
1056
1057
|
slug: args.slug,
|
|
1057
1058
|
label: args.label,
|
|
@@ -1075,7 +1076,7 @@ function createMcpServer() {
|
|
|
1075
1076
|
requireRole(extra, Role.EDITOR);
|
|
1076
1077
|
const ec = getEmDash(extra);
|
|
1077
1078
|
try {
|
|
1078
|
-
const { handleTermDelete } = await import("../../../taxonomies-
|
|
1079
|
+
const { handleTermDelete } = await import("../../../taxonomies-DuESHWKI.mjs").then((n) => n.l);
|
|
1079
1080
|
return unwrap(await handleTermDelete(ec.db, args.taxonomy, args.termSlug));
|
|
1080
1081
|
} catch (error) {
|
|
1081
1082
|
return respondHandlerError(error, "TAXONOMY_TERM_DELETE_ERROR");
|
|
@@ -1090,7 +1091,7 @@ function createMcpServer() {
|
|
|
1090
1091
|
requireScope(extra, "content:read");
|
|
1091
1092
|
const ec = getEmDash(extra);
|
|
1092
1093
|
try {
|
|
1093
|
-
const { handleTermTranslations } = await import("../../../taxonomies-
|
|
1094
|
+
const { handleTermTranslations } = await import("../../../taxonomies-DuESHWKI.mjs").then((n) => n.l);
|
|
1094
1095
|
return unwrap(await handleTermTranslations(ec.db, args.id));
|
|
1095
1096
|
} catch (error) {
|
|
1096
1097
|
return respondHandlerError(error, "TERM_TRANSLATIONS_ERROR");
|
|
@@ -1286,7 +1287,7 @@ function createMcpServer() {
|
|
|
1286
1287
|
requireRole(extra, Role.EDITOR);
|
|
1287
1288
|
const ec = getEmDash(extra);
|
|
1288
1289
|
try {
|
|
1289
|
-
const { handleSettingsGet } = await import("../../../settings-
|
|
1290
|
+
const { handleSettingsGet } = await import("../../../settings-sO0Fif4p.mjs").then((n) => n.r);
|
|
1290
1291
|
return unwrap(await handleSettingsGet(ec.db, ec.storage));
|
|
1291
1292
|
} catch (error) {
|
|
1292
1293
|
return respondHandlerError(error, "SETTINGS_READ_ERROR");
|
|
@@ -1312,7 +1313,7 @@ function createMcpServer() {
|
|
|
1312
1313
|
requireRole(extra, Role.ADMIN);
|
|
1313
1314
|
const ec = getEmDash(extra);
|
|
1314
1315
|
try {
|
|
1315
|
-
const { handleSettingsUpdate } = await import("../../../settings-
|
|
1316
|
+
const { handleSettingsUpdate } = await import("../../../settings-sO0Fif4p.mjs").then((n) => n.r);
|
|
1316
1317
|
return unwrap(await handleSettingsUpdate(ec.db, ec.storage, args));
|
|
1317
1318
|
} catch (error) {
|
|
1318
1319
|
return respondHandlerError(error, "SETTINGS_UPDATE_ERROR");
|