emdash 0.14.0 → 0.15.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-9DybjTO6.d.mts → adapters-C4yd_UJR.d.mts} +1 -1
- package/dist/{adapters-9DybjTO6.d.mts.map → adapters-C4yd_UJR.d.mts.map} +1 -1
- package/dist/{allowed-origins-CDdG-4Gd.mjs → allowed-origins-D0fFk9a6.mjs} +2 -2
- package/dist/{allowed-origins-CDdG-4Gd.mjs.map → allowed-origins-D0fFk9a6.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +15 -15
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +3 -3
- package/dist/{api-BMLZuwM4.mjs → api-CLwG_3dh.mjs} +519 -55
- package/dist/api-CLwG_3dh.mjs.map +1 -0
- package/dist/{api-tokens-eYymBhIT.mjs → api-tokens-ucpcNXDt.mjs} +2 -2
- package/dist/{api-tokens-eYymBhIT.mjs.map → api-tokens-ucpcNXDt.mjs.map} +1 -1
- package/dist/{apply-v4DBgjPw.mjs → apply-wJhM_bwU.mjs} +17 -17
- package/dist/{apply-v4DBgjPw.mjs.map → apply-wJhM_bwU.mjs.map} +1 -1
- package/dist/astro/index.d.mts +10 -10
- package/dist/astro/index.mjs +21 -5
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.mjs +6 -6
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs +2 -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.map +1 -1
- package/dist/astro/middleware.mjs +353 -71
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +14 -17
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +9 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +70 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +25 -16
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +8 -8
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +32 -31
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +32 -31
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +31 -30
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +31 -30
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +33 -31
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +31 -30
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +31 -30
- 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 +33 -31
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +31 -30
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +59 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +72 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +31 -30
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +44 -31
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +31 -30
- 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 +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +31 -30
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +5 -5
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +9 -9
- package/dist/astro/routes/api/auth/invite/index.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/register-options.mjs +8 -8
- package/dist/astro/routes/api/auth/logout.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -8
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +5 -5
- 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_/callback.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +8 -8
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/verify.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/complete.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/request.mjs +8 -8
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +6 -6
- 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 +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +3 -3
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +10 -10
- 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 +9 -8
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +7 -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 -10
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +29 -29
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +6 -6
- package/dist/astro/routes/api/media/_id_.mjs +6 -6
- package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
- package/dist/astro/routes/api/media/providers/index.mjs +3 -3
- package/dist/astro/routes/api/media/upload-url.mjs +7 -7
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_/items.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_.mjs +7 -7
- package/dist/astro/routes/api/menus/index.mjs +7 -7
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +3 -3
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +8 -8
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +8 -8
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +9 -9
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +9 -9
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +31 -30
- 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 +31 -30
- 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 +31 -30
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +31 -30
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +31 -30
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +6 -6
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +31 -30
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +31 -30
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +9 -9
- package/dist/astro/routes/api/search/index.mjs +8 -8
- package/dist/astro/routes/api/search/rebuild.mjs +9 -9
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +8 -8
- package/dist/astro/routes/api/sections/_slug_.mjs +8 -8
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +8 -8
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +10 -10
- package/dist/astro/routes/api/setup/admin-verify.mjs +10 -10
- package/dist/astro/routes/api/setup/admin.mjs +9 -9
- package/dist/astro/routes/api/setup/dev-bypass.mjs +22 -22
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +22 -22
- package/dist/astro/routes/api/setup/status.mjs +4 -4
- package/dist/astro/routes/api/snapshot.mjs +5 -5
- 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 -5
- package/dist/astro/routes/api/typegen.mjs +5 -5
- 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 -6
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +8 -8
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +5 -5
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +4 -4
- package/dist/astro/routes/sitemap.xml.mjs +5 -5
- package/dist/astro/types.d.mts +13 -12
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-BlyCH-96.mjs → authorize-Bkwe8kuL.mjs} +2 -2
- package/dist/{authorize-BlyCH-96.mjs.map → authorize-Bkwe8kuL.mjs.map} +1 -1
- package/dist/byline-CTaWkMh5.mjs +404 -0
- package/dist/byline-CTaWkMh5.mjs.map +1 -0
- package/dist/bylines-BYHWU3T7.mjs +174 -0
- package/dist/bylines-BYHWU3T7.mjs.map +1 -0
- package/dist/{bylines-BdUP8NuI.d.mts → bylines-DtDRNF1n.d.mts} +59 -14
- package/dist/bylines-DtDRNF1n.d.mts.map +1 -0
- package/dist/bylines-H0Xh5TMy.mjs +118 -0
- package/dist/bylines-H0Xh5TMy.mjs.map +1 -0
- package/dist/{cache-CXCpjWiL.mjs → cache-CNk1jIxp.mjs} +2 -2
- package/dist/{cache-CXCpjWiL.mjs.map → cache-CNk1jIxp.mjs.map} +1 -1
- package/dist/{challenge-store-CJ0OOHOr.mjs → challenge-store-Dng1SxKT.mjs} +1 -1
- package/dist/{challenge-store-CJ0OOHOr.mjs.map → challenge-store-Dng1SxKT.mjs.map} +1 -1
- package/dist/{chunks-DyGtu1Bv.mjs → chunks-BkfVdD-3.mjs} +2 -2
- package/dist/{chunks-DyGtu1Bv.mjs.map → chunks-BkfVdD-3.mjs.map} +1 -1
- package/dist/cli/index.mjs +21 -29
- 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/client/index.mjs.map +1 -1
- package/dist/{comment-Dd9MI82-.mjs → comment-_yzlBYPx.mjs} +2 -2
- package/dist/{comment-Dd9MI82-.mjs.map → comment-_yzlBYPx.mjs.map} +1 -1
- package/dist/{comments-koGI0FrK.mjs → comments-DxID-rsd.mjs} +3 -3
- package/dist/{comments-koGI0FrK.mjs.map → comments-DxID-rsd.mjs.map} +1 -1
- package/dist/{components-mZem7pbe.mjs → components-Dx3DM0gg.mjs} +1 -1
- package/dist/{components-mZem7pbe.mjs.map → components-Dx3DM0gg.mjs.map} +1 -1
- package/dist/config-CVssduLe.mjs.map +1 -1
- package/dist/{content-D6YG26WG.mjs → content-C0ooIs-f.mjs} +3 -3
- package/dist/{content-D6YG26WG.mjs.map → content-C0ooIs-f.mjs.map} +1 -1
- package/dist/{context-qF8d3IPR.mjs → context-sAnCaUIR.mjs} +10 -10
- package/dist/context-sAnCaUIR.mjs.map +1 -0
- package/dist/{cron-H8eJ46dv.mjs → cron-Bd3b3iuj.mjs} +1 -1
- package/dist/{cron-H8eJ46dv.mjs.map → cron-Bd3b3iuj.mjs.map} +1 -1
- package/dist/{dashboard-BmWSIUwY.mjs → dashboard-Cqw3ay2X.mjs} +4 -4
- package/dist/{dashboard-BmWSIUwY.mjs.map → dashboard-Cqw3ay2X.mjs.map} +1 -1
- 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/{default-Dbs22Gg4.mjs → default-BvTAYCzx.mjs} +1 -1
- package/dist/{default-Dbs22Gg4.mjs.map → default-BvTAYCzx.mjs.map} +1 -1
- package/dist/{device-flow-BqJRxa0Q.mjs → device-flow-B9oG8PwP.mjs} +4 -4
- package/dist/{device-flow-BqJRxa0Q.mjs.map → device-flow-B9oG8PwP.mjs.map} +1 -1
- package/dist/{email-console-Dmp5Q-P2.mjs → email-console-CubRll9q.mjs} +1 -1
- package/dist/email-console-CubRll9q.mjs.map +1 -0
- package/dist/{error-tSQWIl5U.mjs → error-CPh_8eLq.mjs} +16 -8
- package/dist/error-CPh_8eLq.mjs.map +1 -0
- package/dist/{escape-B8bdIryO.mjs → escape-Cg6kMELH.mjs} +1 -1
- package/dist/{escape-B8bdIryO.mjs.map → escape-Cg6kMELH.mjs.map} +1 -1
- package/dist/{fts-manager-B633C-kQ.mjs → fts-manager-Mnrtn-r2.mjs} +2 -2
- package/dist/{fts-manager-B633C-kQ.mjs.map → fts-manager-Mnrtn-r2.mjs.map} +1 -1
- package/dist/{import-CNfLOgDE.mjs → import-DG80rC_I.mjs} +3 -3
- package/dist/{import-CNfLOgDE.mjs.map → import-DG80rC_I.mjs.map} +1 -1
- package/dist/{index-BV8iJ-6s.d.mts → index-Bv1Wf1zB.d.mts} +235 -18
- package/dist/index-Bv1Wf1zB.d.mts.map +1 -0
- package/dist/{index-D2gvztOP.d.mts → index-CC42STEm.d.mts} +3 -3
- package/dist/{index-D2gvztOP.d.mts.map → index-CC42STEm.d.mts.map} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.mjs +50 -49
- package/dist/{load-QzYRpVN3.mjs → load-DmXNVhst.mjs} +2 -2
- package/dist/{load-QzYRpVN3.mjs.map → load-DmXNVhst.mjs.map} +1 -1
- package/dist/{loader-Cs6-Bqe6.mjs → loader-Chm5h7Gr.mjs} +3 -3
- package/dist/loader-Chm5h7Gr.mjs.map +1 -0
- package/dist/{manifest-schema-HCtSh4Jq.mjs → manifest-schema-Czqf0TLu.mjs} +1 -1
- package/dist/{manifest-schema-HCtSh4Jq.mjs.map → manifest-schema-Czqf0TLu.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +11 -11
- package/dist/media/local-runtime.mjs +4 -4
- package/dist/{media-allowlist-B8EX01DH.mjs → media-allowlist-BNloC69x.mjs} +1 -1
- package/dist/{media-allowlist-B8EX01DH.mjs.map → media-allowlist-BNloC69x.mjs.map} +1 -1
- package/dist/{media-Dg7he9uK.mjs → media-oqRcNiQf.mjs} +2 -2
- package/dist/media-oqRcNiQf.mjs.map +1 -0
- package/dist/{menus-DOzIecHi.mjs → menus-Bjf5R1Qq.mjs} +2 -2
- package/dist/menus-Bjf5R1Qq.mjs.map +1 -0
- package/dist/{menus-X4Z-eBA1.mjs → menus-C75SSmRy.mjs} +30 -11
- package/dist/menus-C75SSmRy.mjs.map +1 -0
- package/dist/mime-KV5TqkMN.mjs.map +1 -1
- package/dist/{mode-DPRPvJYm.mjs → mode-CaaiebZI.mjs} +1 -1
- package/dist/{mode-DPRPvJYm.mjs.map → mode-CaaiebZI.mjs.map} +1 -1
- package/dist/{oauth-authorization-62GmpGIH.mjs → oauth-authorization-CTMeVfvj.mjs} +4 -4
- package/dist/{oauth-authorization-62GmpGIH.mjs.map → oauth-authorization-CTMeVfvj.mjs.map} +1 -1
- package/dist/{oauth-clients-D_B0_-Bz.mjs → oauth-clients-eJCbkVSG.mjs} +1 -1
- package/dist/oauth-clients-eJCbkVSG.mjs.map +1 -0
- package/dist/{oauth-state-store-DpsZViTu.mjs → oauth-state-store-vOSdOeGe.mjs} +1 -1
- package/dist/{oauth-state-store-DpsZViTu.mjs.map → oauth-state-store-vOSdOeGe.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-meyS2oB1.mjs → oauth-user-lookup-3JwsVw6N.mjs} +1 -1
- package/dist/{oauth-user-lookup-meyS2oB1.mjs.map → oauth-user-lookup-3JwsVw6N.mjs.map} +1 -1
- package/dist/options-BL4X94qY.mjs.map +1 -1
- package/dist/{options-Cq64Wx0O.d.mts → options-DhV-gwJb.d.mts} +4 -4
- package/dist/options-DhV-gwJb.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BFTPon-J.mjs → parse-3-caTKgt.mjs} +2 -2
- package/dist/{parse-BFTPon-J.mjs.map → parse-3-caTKgt.mjs.map} +1 -1
- package/dist/{passkey-config-Cg86_ISa.mjs → passkey-config-BloQOT3y.mjs} +1 -1
- package/dist/{passkey-config-Cg86_ISa.mjs.map → passkey-config-BloQOT3y.mjs.map} +1 -1
- package/dist/{placeholder-D3cFCU9y.d.mts → placeholder-KCkkCtgQ.d.mts} +1 -1
- package/dist/{placeholder-D3cFCU9y.d.mts.map → placeholder-KCkkCtgQ.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +26 -15
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{preview-C1LOEbWZ.mjs → preview-D4z0WONU.mjs} +2 -2
- package/dist/{preview-C1LOEbWZ.mjs.map → preview-D4z0WONU.mjs.map} +1 -1
- package/dist/{public-url-CseXl9Fv.mjs → public-url-CUWWFME2.mjs} +1 -1
- package/dist/{public-url-CseXl9Fv.mjs.map → public-url-CUWWFME2.mjs.map} +1 -1
- package/dist/{query-axZmO6Tn.mjs → query-BJn8TOPk.mjs} +16 -13
- package/dist/{query-axZmO6Tn.mjs.map → query-BJn8TOPk.mjs.map} +1 -1
- package/dist/{rate-limit-t5CVjCO6.mjs → rate-limit-D_-gAeJ0.mjs} +2 -2
- package/dist/{rate-limit-t5CVjCO6.mjs.map → rate-limit-D_-gAeJ0.mjs.map} +1 -1
- package/dist/{redirect-DGRsLO2I.mjs → redirect-BINiRYq4.mjs} +1 -1
- package/dist/{redirect-DGRsLO2I.mjs.map → redirect-BINiRYq4.mjs.map} +1 -1
- package/dist/{redirect-DkaDxq8e.mjs → redirect-CNv4mHX2.mjs} +2 -2
- package/dist/{redirect-DkaDxq8e.mjs.map → redirect-CNv4mHX2.mjs.map} +1 -1
- package/dist/{redirects-D1fdd68T.mjs → redirects-B-CUZ1Xh.mjs} +3 -3
- package/dist/{redirects-D1fdd68T.mjs.map → redirects-B-CUZ1Xh.mjs.map} +1 -1
- package/dist/{redirects-Dmj6KRU3.mjs → redirects-COMLwsV5.mjs} +19 -5
- package/dist/redirects-COMLwsV5.mjs.map +1 -0
- package/dist/{registry-BnCeHYsf.mjs → registry-DqrAQDXH.mjs} +4 -4
- package/dist/{registry-BnCeHYsf.mjs.map → registry-DqrAQDXH.mjs.map} +1 -1
- package/dist/request-cache-dzCt8TZB.mjs.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{request-meta-CLCwSQOS.mjs → request-meta-C_Cjii-T.mjs} +2 -2
- package/dist/{request-meta-CLCwSQOS.mjs.map → request-meta-C_Cjii-T.mjs.map} +1 -1
- package/dist/resolve-Cj98DuqN.mjs +39 -0
- package/dist/resolve-Cj98DuqN.mjs.map +1 -0
- package/dist/{runner-DdnQIwz_.mjs → runner-CGlojznK.mjs} +472 -165
- package/dist/runner-CGlojznK.mjs.map +1 -0
- package/dist/{runner-DcfZewkO.d.mts → runner-CNHRo1mT.d.mts} +2 -2
- package/dist/{runner-DcfZewkO.d.mts.map → runner-CNHRo1mT.d.mts.map} +1 -1
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +2 -2
- package/dist/{schema-BmqagCwG.mjs → schema-Djdlfi5G.mjs} +4 -4
- package/dist/{schema-BmqagCwG.mjs.map → schema-Djdlfi5G.mjs.map} +1 -1
- package/dist/{search-CPrvO5u8.mjs → search-By-NN3da.mjs} +4 -4
- package/dist/{search-CPrvO5u8.mjs.map → search-By-NN3da.mjs.map} +1 -1
- package/dist/{secrets-6pgZyq0K.mjs → secrets-rPdhEBkD.mjs} +1 -1
- package/dist/{secrets-6pgZyq0K.mjs.map → secrets-rPdhEBkD.mjs.map} +1 -1
- package/dist/{sections-Cm-zb-gZ.mjs → sections-DcBIlOq1.mjs} +3 -3
- package/dist/{sections-Cm-zb-gZ.mjs.map → sections-DcBIlOq1.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +16 -16
- package/dist/seo/index.d.mts +1 -1
- package/dist/{seo-DRq9-EPP.mjs → seo-bjDoq9Eg.mjs} +2 -2
- package/dist/{seo-DRq9-EPP.mjs.map → seo-bjDoq9Eg.mjs.map} +1 -1
- package/dist/{service-vByySp-2.mjs → service-BuuTdGAT.mjs} +3 -3
- package/dist/{service-vByySp-2.mjs.map → service-BuuTdGAT.mjs.map} +1 -1
- package/dist/{settings-CBBj7HUd.mjs → settings-CJnKiWuR.mjs} +3 -3
- package/dist/{settings-CBBj7HUd.mjs.map → settings-CJnKiWuR.mjs.map} +1 -1
- package/dist/{settings-xQKsWnzQ.mjs → settings-hcubRfkr.mjs} +3 -3
- package/dist/settings-hcubRfkr.mjs.map +1 -0
- package/dist/{setup-BGAJ2uXs.mjs → setup-Cf_TyOv5.mjs} +2 -2
- package/dist/{setup-BGAJ2uXs.mjs.map → setup-Cf_TyOv5.mjs.map} +1 -1
- package/dist/{setup-complete-C6ZCLhKo.mjs → setup-complete-MzzN9u0b.mjs} +1 -1
- package/dist/{setup-complete-C6ZCLhKo.mjs.map → setup-complete-MzzN9u0b.mjs.map} +1 -1
- package/dist/{setup-nonce-CY1gQiAU.mjs → setup-nonce-DXuriHsg.mjs} +1 -1
- package/dist/{setup-nonce-CY1gQiAU.mjs.map → setup-nonce-DXuriHsg.mjs.map} +1 -1
- package/dist/{site-url-D-M4Fd8O.mjs → site-url-xkhw1tcz.mjs} +1 -1
- package/dist/{site-url-D-M4Fd8O.mjs.map → site-url-xkhw1tcz.mjs.map} +1 -1
- package/dist/{ssrf-DzFN_qV-.mjs → ssrf-MZ-zrG6-.mjs} +1 -1
- package/dist/{ssrf-DzFN_qV-.mjs.map → ssrf-MZ-zrG6-.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/local.mjs.map +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/{taxonomies-Dc0mzlms.mjs → taxonomies-CLs9HPE2.mjs} +4 -4
- package/dist/{taxonomies-Dc0mzlms.mjs.map → taxonomies-CLs9HPE2.mjs.map} +1 -1
- package/dist/{taxonomies-Cn9UpaR2.mjs → taxonomies-WamPVA2x.mjs} +7 -42
- package/dist/taxonomies-WamPVA2x.mjs.map +1 -0
- package/dist/{taxonomy-wPfusMK9.mjs → taxonomy-D4Uc2LsZ.mjs} +3 -3
- package/dist/{taxonomy-wPfusMK9.mjs.map → taxonomy-D4Uc2LsZ.mjs.map} +1 -1
- package/dist/{tokens-DILYNZMi.mjs → tokens-N8otWMmj.mjs} +1 -1
- package/dist/{tokens-DILYNZMi.mjs.map → tokens-N8otWMmj.mjs.map} +1 -1
- package/dist/{transport-fw-mKJzT.mjs → transport-B6CHddbu.mjs} +1 -1
- package/dist/{transport-fw-mKJzT.mjs.map → transport-B6CHddbu.mjs.map} +1 -1
- package/dist/{transport-GeXlLscf.d.mts → transport-DOxLfUir.d.mts} +1 -1
- package/dist/{transport-GeXlLscf.d.mts.map → transport-DOxLfUir.d.mts.map} +1 -1
- package/dist/{trusted-proxy-CJhQIk65.mjs → trusted-proxy-97pajC2f.mjs} +1 -1
- package/dist/{trusted-proxy-CJhQIk65.mjs.map → trusted-proxy-97pajC2f.mjs.map} +1 -1
- package/dist/{types-CwXMEPRr.mjs → types-ByV5sgsv.mjs} +2 -2
- package/dist/types-ByV5sgsv.mjs.map +1 -0
- package/dist/{types-Dz9CGX_d.mjs → types-Cd9UCu3t.mjs} +1 -1
- package/dist/{types-Dz9CGX_d.mjs.map → types-Cd9UCu3t.mjs.map} +1 -1
- package/dist/{types-DmxPPXGf.d.mts → types-CkDSF81F.d.mts} +1 -1
- package/dist/{types-DmxPPXGf.d.mts.map → types-CkDSF81F.d.mts.map} +1 -1
- package/dist/{types-BWhaSS7U.d.mts → types-CpUuGcd5.d.mts} +1 -1
- package/dist/{types-BWhaSS7U.d.mts.map → types-CpUuGcd5.d.mts.map} +1 -1
- package/dist/{types-DFowNO60.d.mts → types-D599-ruj.d.mts} +1 -1
- package/dist/{types-DFowNO60.d.mts.map → types-D599-ruj.d.mts.map} +1 -1
- package/dist/{types-B05e2naf.d.mts → types-DGHWRQgr.d.mts} +3 -3
- package/dist/{types-B05e2naf.d.mts.map → types-DGHWRQgr.d.mts.map} +1 -1
- package/dist/{types-CzvJd1ND.d.mts → types-DaYDYW6g.d.mts} +14 -1
- package/dist/types-DaYDYW6g.d.mts.map +1 -0
- package/dist/{types-C1KKK4VP.d.mts → types-DaqNzqVt.d.mts} +16 -1
- package/dist/{types-C1KKK4VP.d.mts.map → types-DaqNzqVt.d.mts.map} +1 -1
- package/dist/{types-DW1l0gCv.d.mts → types-Dgo6y-Ut.d.mts} +1 -1
- package/dist/{types-DW1l0gCv.d.mts.map → types-Dgo6y-Ut.d.mts.map} +1 -1
- package/dist/{types-Cb2UCDJg.d.mts → types-bYmRn_Uy.d.mts} +1 -1
- package/dist/{types-Cb2UCDJg.d.mts.map → types-bYmRn_Uy.d.mts.map} +1 -1
- package/dist/{user-Dr1bOCqS.mjs → user-D3BD5zdT.mjs} +2 -2
- package/dist/{user-Dr1bOCqS.mjs.map → user-D3BD5zdT.mjs.map} +1 -1
- package/dist/{utils-_F-rWBTN.mjs → utils-C3wTAP-P.mjs} +1 -1
- package/dist/{utils-_F-rWBTN.mjs.map → utils-C3wTAP-P.mjs.map} +1 -1
- package/dist/{validate-BpQGsmd7.d.mts → validate-DQtHw9NT.d.mts} +5 -5
- package/dist/{validate-BpQGsmd7.d.mts.map → validate-DQtHw9NT.d.mts.map} +1 -1
- package/dist/{validate-DlFxcVVK.mjs → validate-mz87i8_1.mjs} +2 -2
- package/dist/{validate-DlFxcVVK.mjs.map → validate-mz87i8_1.mjs.map} +1 -1
- package/dist/{validation-BiFJqUp5.mjs → validation-DKHhXjPr.mjs} +5 -5
- package/dist/{validation-BiFJqUp5.mjs.map → validation-DKHhXjPr.mjs.map} +1 -1
- package/dist/version-Ct7C6RSo.mjs +7 -0
- package/dist/{version-DNmQakZO.mjs.map → version-Ct7C6RSo.mjs.map} +1 -1
- package/dist/{widgets-B9j_yzlk.mjs → widgets-lShIQXU5.mjs} +3 -3
- package/dist/widgets-lShIQXU5.mjs.map +1 -0
- package/dist/{zod-generator-DSyz01KE.mjs → zod-generator-dvxgmd1M.mjs} +2 -2
- package/dist/{zod-generator-DSyz01KE.mjs.map → zod-generator-dvxgmd1M.mjs.map} +1 -1
- package/package.json +11 -9
- package/src/api/error.ts +18 -3
- package/src/api/errors.ts +6 -0
- package/src/api/handlers/bylines.ts +161 -0
- package/src/api/handlers/content.ts +125 -43
- package/src/api/handlers/index.ts +6 -0
- package/src/api/handlers/marketplace.ts +27 -5
- package/src/api/handlers/oauth-clients.ts +1 -1
- package/src/api/handlers/registry.ts +553 -4
- package/src/api/openapi/document.ts +1 -1
- package/src/api/schemas/bylines.ts +46 -0
- package/src/astro/integration/index.ts +1 -1
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/runtime.ts +12 -1
- package/src/astro/integration/virtual-modules.ts +19 -2
- package/src/astro/integration/vite-config.ts +2 -2
- package/src/astro/middleware/auth.ts +7 -7
- package/src/astro/middleware/request-context.ts +1 -1
- package/src/astro/middleware.ts +31 -20
- package/src/astro/routes/api/admin/bylines/[id]/index.ts +3 -12
- package/src/astro/routes/api/admin/bylines/[id]/translations.ts +99 -0
- package/src/astro/routes/api/admin/bylines/index.ts +22 -11
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +1 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +6 -1
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +51 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +79 -0
- package/src/astro/routes/api/admin/plugins/updates.ts +43 -6
- package/src/astro/routes/api/admin/themes/marketplace/index.ts +1 -1
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +2 -2
- package/src/astro/routes/api/auth/oauth/[provider].ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/restore.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +6 -6
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id].ts +6 -6
- package/src/astro/routes/api/import/wordpress/execute.ts +1 -1
- package/src/astro/routes/api/import/wordpress/prepare.ts +2 -2
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +3 -3
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +2 -2
- package/src/astro/routes/api/media/upload-url.ts +1 -1
- package/src/astro/routes/api/redirects/404s/index.ts +3 -3
- package/src/astro/routes/api/redirects/404s/summary.ts +1 -1
- package/src/astro/routes/api/redirects/[id].ts +3 -3
- package/src/astro/routes/api/redirects/index.ts +2 -2
- package/src/astro/routes/api/schema/collections/[slug]/fields/[fieldSlug].ts +4 -4
- package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +2 -6
- package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +1 -1
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +6 -6
- package/src/astro/routes/api/schema/collections/index.ts +4 -4
- package/src/astro/routes/api/schema/index.ts +1 -1
- package/src/astro/routes/api/schema/orphans/[slug].ts +1 -1
- package/src/astro/routes/api/schema/orphans/index.ts +1 -1
- package/src/astro/routes/api/sections/[slug].ts +3 -3
- package/src/astro/routes/api/sections/index.ts +2 -2
- package/src/astro/types.ts +4 -0
- package/src/auth/rate-limit.ts +1 -1
- package/src/auth/trusted-proxy.ts +1 -1
- package/src/bylines/index.ts +154 -55
- package/src/cli/commands/init.ts +4 -8
- package/src/client/index.ts +1 -1
- package/src/components/InlinePortableTextEditor.tsx +5 -1
- package/src/components/inline-code-block.tsx +343 -0
- package/src/config/secrets.ts +3 -3
- package/src/database/migrations/006_taxonomy_defs.ts +1 -1
- package/src/database/migrations/014_draft_revisions.ts +6 -6
- package/src/database/migrations/040_byline_i18n.ts +497 -0
- package/src/database/migrations/runner.ts +4 -1
- package/src/database/repositories/audit.ts +2 -2
- package/src/database/repositories/byline.ts +320 -50
- package/src/database/repositories/media.ts +2 -2
- package/src/database/repositories/menu.ts +1 -1
- package/src/database/repositories/options.ts +3 -3
- package/src/database/repositories/plugin-storage.ts +3 -3
- package/src/database/repositories/types.ts +13 -0
- package/src/database/types.ts +15 -0
- package/src/emdash-runtime.ts +492 -20
- package/src/i18n/config.ts +1 -1
- package/src/index.ts +7 -0
- package/src/loader.ts +1 -1
- package/src/mcp/server.ts +3 -3
- package/src/media/mime.ts +1 -1
- package/src/page/absolute-url.ts +1 -1
- package/src/plugins/adapt-sandbox-entry.ts +45 -40
- package/src/plugins/email-console.ts +1 -1
- package/src/plugins/index.ts +1 -0
- package/src/plugins/marketplace.ts +1 -1
- package/src/plugins/sandbox/index.ts +1 -0
- package/src/plugins/sandbox/noop.ts +11 -3
- package/src/plugins/sandbox/types.ts +28 -0
- package/src/query.ts +17 -2
- package/src/registry/config.ts +1 -1
- package/src/request-cache.ts +3 -3
- package/src/request-context.ts +1 -1
- package/src/settings/index.ts +4 -4
- package/src/storage/local.ts +1 -1
- package/src/storage/s3.ts +3 -3
- package/src/widgets/index.ts +1 -1
- package/dist/api-BMLZuwM4.mjs.map +0 -1
- package/dist/byline-D09BaS4j.mjs +0 -220
- package/dist/byline-D09BaS4j.mjs.map +0 -1
- package/dist/bylines-BTM2xtP8.mjs +0 -113
- package/dist/bylines-BTM2xtP8.mjs.map +0 -1
- package/dist/bylines-BdUP8NuI.d.mts.map +0 -1
- package/dist/context-qF8d3IPR.mjs.map +0 -1
- package/dist/email-console-Dmp5Q-P2.mjs.map +0 -1
- package/dist/error-tSQWIl5U.mjs.map +0 -1
- package/dist/index-BV8iJ-6s.d.mts.map +0 -1
- package/dist/loader-Cs6-Bqe6.mjs.map +0 -1
- package/dist/media-Dg7he9uK.mjs.map +0 -1
- package/dist/menus-DOzIecHi.mjs.map +0 -1
- package/dist/menus-X4Z-eBA1.mjs.map +0 -1
- package/dist/oauth-clients-D_B0_-Bz.mjs.map +0 -1
- package/dist/options-Cq64Wx0O.d.mts.map +0 -1
- package/dist/redirects-Dmj6KRU3.mjs.map +0 -1
- package/dist/runner-DdnQIwz_.mjs.map +0 -1
- package/dist/settings-xQKsWnzQ.mjs.map +0 -1
- package/dist/taxonomies-Cn9UpaR2.mjs.map +0 -1
- package/dist/types-CwXMEPRr.mjs.map +0 -1
- package/dist/types-CzvJd1ND.d.mts.map +0 -1
- package/dist/version-DNmQakZO.mjs +0 -7
- package/dist/widgets-B9j_yzlk.mjs.map +0 -1
- /package/dist/{api-tokens-D3C9v02m.mjs → api-tokens-iPIHAY8N.mjs} +0 -0
- /package/dist/{ssrf-CTul4uQi.mjs → ssrf-BIcd-aXW.mjs} +0 -0
- /package/dist/{types-Db67HHlU.mjs → types-1NNkmTIn.mjs} +0 -0
|
@@ -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-eslint(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-eslint(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,yCAAyC,IAAI;EAIhF,MAAM,YAAY,OAAO,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7D,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,MAAI,aAAa,KAAK,CAAE,QAAO;AAI/B,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3E,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
|
-
import "../../../types-
|
|
3
|
-
import { r as handleError } from "../../../error-
|
|
4
|
-
import { n as VERSION, t as COMMIT } from "../../../version-
|
|
5
|
-
import { t as getAuthMode } from "../../../mode-
|
|
2
|
+
import "../../../types-ByV5sgsv.mjs";
|
|
3
|
+
import { r as handleError } from "../../../error-CPh_8eLq.mjs";
|
|
4
|
+
import { n as VERSION, t as COMMIT } from "../../../version-Ct7C6RSo.mjs";
|
|
5
|
+
import { t as getAuthMode } from "../../../mode-CaaiebZI.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/astro/routes/api/manifest.ts
|
|
8
8
|
const prerender = false;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../../../base64-CqR-7kqF.mjs";
|
|
2
|
-
import "../../../types-
|
|
3
|
-
import { t as apiError } from "../../../error-
|
|
4
|
-
import {
|
|
5
|
-
import "../../../setup-
|
|
2
|
+
import "../../../types-ByV5sgsv.mjs";
|
|
3
|
+
import { t as apiError } from "../../../error-CPh_8eLq.mjs";
|
|
4
|
+
import { sn as contentSeoInput, wn as contentBylineInputSchema } from "../../../redirects-COMLwsV5.mjs";
|
|
5
|
+
import "../../../setup-Cf_TyOv5.mjs";
|
|
6
6
|
import "../../../api/schemas/index.mjs";
|
|
7
|
-
import { i as hasScope } from "../../../api-tokens-
|
|
7
|
+
import { i as hasScope } from "../../../api-tokens-iPIHAY8N.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { Role, canActOnOwn, hasPermission } from "@emdash-cms/auth";
|
|
10
10
|
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
@@ -641,7 +641,7 @@ function createMcpServer() {
|
|
|
641
641
|
requireRole(extra, Role.EDITOR);
|
|
642
642
|
const ec = getEmDash(extra);
|
|
643
643
|
try {
|
|
644
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
644
|
+
const { SchemaRegistry } = await import("../../../schema-Djdlfi5G.mjs").then((n) => n.t);
|
|
645
645
|
return jsonResult({ items: await new SchemaRegistry(ec.db).listCollections() });
|
|
646
646
|
} catch (error) {
|
|
647
647
|
return respondHandlerError(error, "SCHEMA_LIST_ERROR");
|
|
@@ -657,7 +657,7 @@ function createMcpServer() {
|
|
|
657
657
|
requireRole(extra, Role.EDITOR);
|
|
658
658
|
const ec = getEmDash(extra);
|
|
659
659
|
try {
|
|
660
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
660
|
+
const { SchemaRegistry } = await import("../../../schema-Djdlfi5G.mjs").then((n) => n.t);
|
|
661
661
|
const collection = await new SchemaRegistry(ec.db).getCollectionWithFields(args.slug);
|
|
662
662
|
if (!collection) return respondError("NOT_FOUND", `Collection '${args.slug}' not found`);
|
|
663
663
|
return jsonResult(collection);
|
|
@@ -687,7 +687,7 @@ function createMcpServer() {
|
|
|
687
687
|
requireRole(extra, Role.ADMIN);
|
|
688
688
|
const ec = getEmDash(extra);
|
|
689
689
|
try {
|
|
690
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
690
|
+
const { SchemaRegistry } = await import("../../../schema-Djdlfi5G.mjs").then((n) => n.t);
|
|
691
691
|
const collection = await new SchemaRegistry(ec.db).createCollection({
|
|
692
692
|
slug: args.slug,
|
|
693
693
|
label: args.label,
|
|
@@ -715,7 +715,7 @@ function createMcpServer() {
|
|
|
715
715
|
requireRole(extra, Role.ADMIN);
|
|
716
716
|
const ec = getEmDash(extra);
|
|
717
717
|
try {
|
|
718
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
718
|
+
const { SchemaRegistry } = await import("../../../schema-Djdlfi5G.mjs").then((n) => n.t);
|
|
719
719
|
await new SchemaRegistry(ec.db).deleteCollection(args.slug, { force: args.force });
|
|
720
720
|
ec.invalidateUrlPatternCache();
|
|
721
721
|
return jsonResult({ deleted: args.slug });
|
|
@@ -769,7 +769,7 @@ function createMcpServer() {
|
|
|
769
769
|
requireRole(extra, Role.ADMIN);
|
|
770
770
|
const ec = getEmDash(extra);
|
|
771
771
|
try {
|
|
772
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
772
|
+
const { SchemaRegistry } = await import("../../../schema-Djdlfi5G.mjs").then((n) => n.t);
|
|
773
773
|
return jsonResult(await new SchemaRegistry(ec.db).createField(args.collection, {
|
|
774
774
|
slug: args.slug,
|
|
775
775
|
label: args.label,
|
|
@@ -799,7 +799,7 @@ function createMcpServer() {
|
|
|
799
799
|
requireRole(extra, Role.ADMIN);
|
|
800
800
|
const ec = getEmDash(extra);
|
|
801
801
|
try {
|
|
802
|
-
const { SchemaRegistry } = await import("../../../schema-
|
|
802
|
+
const { SchemaRegistry } = await import("../../../schema-Djdlfi5G.mjs").then((n) => n.t);
|
|
803
803
|
await new SchemaRegistry(ec.db).deleteField(args.collection, args.fieldSlug);
|
|
804
804
|
return jsonResult({
|
|
805
805
|
deleted: args.fieldSlug,
|
|
@@ -920,7 +920,7 @@ function createMcpServer() {
|
|
|
920
920
|
requireScope(extra, "content:read");
|
|
921
921
|
const ec = getEmDash(extra);
|
|
922
922
|
try {
|
|
923
|
-
const { searchWithDb } = await import("../../../search-
|
|
923
|
+
const { searchWithDb } = await import("../../../search-By-NN3da.mjs").then((n) => n.t);
|
|
924
924
|
return jsonResult(await searchWithDb(ec.db, args.query, {
|
|
925
925
|
collections: args.collections,
|
|
926
926
|
locale: args.locale,
|
|
@@ -939,7 +939,7 @@ function createMcpServer() {
|
|
|
939
939
|
requireScope(extra, "content:read");
|
|
940
940
|
const ec = getEmDash(extra);
|
|
941
941
|
try {
|
|
942
|
-
const { handleTaxonomyList } = await import("../../../taxonomies-
|
|
942
|
+
const { handleTaxonomyList } = await import("../../../taxonomies-CLs9HPE2.mjs").then((n) => n.l);
|
|
943
943
|
return unwrap(await handleTaxonomyList(ec.db, { locale: args.locale }));
|
|
944
944
|
} catch (error) {
|
|
945
945
|
return respondHandlerError(error, "TAXONOMY_LIST_ERROR");
|
|
@@ -959,12 +959,12 @@ function createMcpServer() {
|
|
|
959
959
|
requireScope(extra, "content:read");
|
|
960
960
|
const ec = getEmDash(extra);
|
|
961
961
|
try {
|
|
962
|
-
const { handleTaxonomyList } = await import("../../../taxonomies-
|
|
962
|
+
const { handleTaxonomyList } = await import("../../../taxonomies-CLs9HPE2.mjs").then((n) => n.l);
|
|
963
963
|
const listResult = await handleTaxonomyList(ec.db, { locale: args.locale });
|
|
964
964
|
if (!listResult.success) return unwrap(listResult);
|
|
965
965
|
if (!listResult.data.taxonomies.find((t) => t.name === args.taxonomy)) return respondError("NOT_FOUND", `Taxonomy '${args.taxonomy}' not found`);
|
|
966
|
-
const { TaxonomyRepository } = await import("../../../taxonomy-
|
|
967
|
-
const { decodeCursor, encodeCursor, InvalidCursorError } = await import("../../../types-
|
|
966
|
+
const { TaxonomyRepository } = await import("../../../taxonomy-D4Uc2LsZ.mjs").then((n) => n.n);
|
|
967
|
+
const { decodeCursor, encodeCursor, InvalidCursorError } = await import("../../../types-ByV5sgsv.mjs").then((n) => n.a);
|
|
968
968
|
const repo = new TaxonomyRepository(ec.db);
|
|
969
969
|
const limit = Math.min(args.limit ?? 50, 100);
|
|
970
970
|
const terms = await repo.findByName(args.taxonomy, { locale: args.locale });
|
|
@@ -1018,7 +1018,7 @@ function createMcpServer() {
|
|
|
1018
1018
|
requireRole(extra, Role.EDITOR);
|
|
1019
1019
|
const ec = getEmDash(extra);
|
|
1020
1020
|
try {
|
|
1021
|
-
const { handleTermCreate } = await import("../../../taxonomies-
|
|
1021
|
+
const { handleTermCreate } = await import("../../../taxonomies-CLs9HPE2.mjs").then((n) => n.l);
|
|
1022
1022
|
return unwrap(await handleTermCreate(ec.db, args.taxonomy, {
|
|
1023
1023
|
slug: args.slug,
|
|
1024
1024
|
label: args.label,
|
|
@@ -1047,7 +1047,7 @@ function createMcpServer() {
|
|
|
1047
1047
|
requireRole(extra, Role.EDITOR);
|
|
1048
1048
|
const ec = getEmDash(extra);
|
|
1049
1049
|
try {
|
|
1050
|
-
const { handleTermUpdate } = await import("../../../taxonomies-
|
|
1050
|
+
const { handleTermUpdate } = await import("../../../taxonomies-CLs9HPE2.mjs").then((n) => n.l);
|
|
1051
1051
|
return unwrap(await handleTermUpdate(ec.db, args.taxonomy, args.termSlug, {
|
|
1052
1052
|
slug: args.slug,
|
|
1053
1053
|
label: args.label,
|
|
@@ -1071,7 +1071,7 @@ function createMcpServer() {
|
|
|
1071
1071
|
requireRole(extra, Role.EDITOR);
|
|
1072
1072
|
const ec = getEmDash(extra);
|
|
1073
1073
|
try {
|
|
1074
|
-
const { handleTermDelete } = await import("../../../taxonomies-
|
|
1074
|
+
const { handleTermDelete } = await import("../../../taxonomies-CLs9HPE2.mjs").then((n) => n.l);
|
|
1075
1075
|
return unwrap(await handleTermDelete(ec.db, args.taxonomy, args.termSlug));
|
|
1076
1076
|
} catch (error) {
|
|
1077
1077
|
return respondHandlerError(error, "TAXONOMY_TERM_DELETE_ERROR");
|
|
@@ -1086,7 +1086,7 @@ function createMcpServer() {
|
|
|
1086
1086
|
requireScope(extra, "content:read");
|
|
1087
1087
|
const ec = getEmDash(extra);
|
|
1088
1088
|
try {
|
|
1089
|
-
const { handleTermTranslations } = await import("../../../taxonomies-
|
|
1089
|
+
const { handleTermTranslations } = await import("../../../taxonomies-CLs9HPE2.mjs").then((n) => n.l);
|
|
1090
1090
|
return unwrap(await handleTermTranslations(ec.db, args.id));
|
|
1091
1091
|
} catch (error) {
|
|
1092
1092
|
return respondHandlerError(error, "TERM_TRANSLATIONS_ERROR");
|
|
@@ -1101,7 +1101,7 @@ function createMcpServer() {
|
|
|
1101
1101
|
requireScope(extra, "content:read");
|
|
1102
1102
|
const ec = getEmDash(extra);
|
|
1103
1103
|
try {
|
|
1104
|
-
const { handleMenuList } = await import("../../../menus-
|
|
1104
|
+
const { handleMenuList } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1105
1105
|
return unwrap(await handleMenuList(ec.db, { locale: args.locale }));
|
|
1106
1106
|
} catch (error) {
|
|
1107
1107
|
return respondHandlerError(error, "MENU_LIST_ERROR");
|
|
@@ -1119,7 +1119,7 @@ function createMcpServer() {
|
|
|
1119
1119
|
requireScope(extra, "content:read");
|
|
1120
1120
|
const ec = getEmDash(extra);
|
|
1121
1121
|
try {
|
|
1122
|
-
const { handleMenuGet } = await import("../../../menus-
|
|
1122
|
+
const { handleMenuGet } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1123
1123
|
return unwrap(await handleMenuGet(ec.db, args.name, { locale: args.locale }));
|
|
1124
1124
|
} catch (error) {
|
|
1125
1125
|
return respondHandlerError(error, "MENU_GET_ERROR");
|
|
@@ -1134,7 +1134,7 @@ function createMcpServer() {
|
|
|
1134
1134
|
requireScope(extra, "content:read");
|
|
1135
1135
|
const ec = getEmDash(extra);
|
|
1136
1136
|
try {
|
|
1137
|
-
const { handleMenuTranslations } = await import("../../../menus-
|
|
1137
|
+
const { handleMenuTranslations } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1138
1138
|
return unwrap(await handleMenuTranslations(ec.db, args.id));
|
|
1139
1139
|
} catch (error) {
|
|
1140
1140
|
return respondHandlerError(error, "MENU_TRANSLATIONS_ERROR");
|
|
@@ -1154,7 +1154,7 @@ function createMcpServer() {
|
|
|
1154
1154
|
requireRole(extra, Role.EDITOR);
|
|
1155
1155
|
const ec = getEmDash(extra);
|
|
1156
1156
|
try {
|
|
1157
|
-
const { handleMenuCreate } = await import("../../../menus-
|
|
1157
|
+
const { handleMenuCreate } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1158
1158
|
return unwrap(await handleMenuCreate(ec.db, {
|
|
1159
1159
|
name: args.name,
|
|
1160
1160
|
label: args.label,
|
|
@@ -1178,7 +1178,7 @@ function createMcpServer() {
|
|
|
1178
1178
|
requireRole(extra, Role.EDITOR);
|
|
1179
1179
|
const ec = getEmDash(extra);
|
|
1180
1180
|
try {
|
|
1181
|
-
const { handleMenuUpdate } = await import("../../../menus-
|
|
1181
|
+
const { handleMenuUpdate } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1182
1182
|
return unwrap(await handleMenuUpdate(ec.db, args.name, {
|
|
1183
1183
|
label: args.label,
|
|
1184
1184
|
locale: args.locale
|
|
@@ -1200,7 +1200,7 @@ function createMcpServer() {
|
|
|
1200
1200
|
requireRole(extra, Role.EDITOR);
|
|
1201
1201
|
const ec = getEmDash(extra);
|
|
1202
1202
|
try {
|
|
1203
|
-
const { handleMenuDelete } = await import("../../../menus-
|
|
1203
|
+
const { handleMenuDelete } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1204
1204
|
return unwrap(await handleMenuDelete(ec.db, args.name, { locale: args.locale }));
|
|
1205
1205
|
} catch (error) {
|
|
1206
1206
|
return respondHandlerError(error, "MENU_DELETE_ERROR");
|
|
@@ -1235,7 +1235,7 @@ function createMcpServer() {
|
|
|
1235
1235
|
requireRole(extra, Role.EDITOR);
|
|
1236
1236
|
const ec = getEmDash(extra);
|
|
1237
1237
|
try {
|
|
1238
|
-
const { handleMenuSetItems } = await import("../../../menus-
|
|
1238
|
+
const { handleMenuSetItems } = await import("../../../menus-Bjf5R1Qq.mjs").then((n) => n.d);
|
|
1239
1239
|
return unwrap(await handleMenuSetItems(ec.db, args.name, args.items, { locale: args.locale }));
|
|
1240
1240
|
} catch (error) {
|
|
1241
1241
|
return respondHandlerError(error, "MENU_SET_ITEMS_ERROR");
|
|
@@ -1282,7 +1282,7 @@ function createMcpServer() {
|
|
|
1282
1282
|
requireRole(extra, Role.EDITOR);
|
|
1283
1283
|
const ec = getEmDash(extra);
|
|
1284
1284
|
try {
|
|
1285
|
-
const { handleSettingsGet } = await import("../../../settings-
|
|
1285
|
+
const { handleSettingsGet } = await import("../../../settings-CJnKiWuR.mjs").then((n) => n.r);
|
|
1286
1286
|
return unwrap(await handleSettingsGet(ec.db, ec.storage));
|
|
1287
1287
|
} catch (error) {
|
|
1288
1288
|
return respondHandlerError(error, "SETTINGS_READ_ERROR");
|
|
@@ -1308,7 +1308,7 @@ function createMcpServer() {
|
|
|
1308
1308
|
requireRole(extra, Role.ADMIN);
|
|
1309
1309
|
const ec = getEmDash(extra);
|
|
1310
1310
|
try {
|
|
1311
|
-
const { handleSettingsUpdate } = await import("../../../settings-
|
|
1311
|
+
const { handleSettingsUpdate } = await import("../../../settings-CJnKiWuR.mjs").then((n) => n.r);
|
|
1312
1312
|
return unwrap(await handleSettingsUpdate(ec.db, ec.storage, args));
|
|
1313
1313
|
} catch (error) {
|
|
1314
1314
|
return respondHandlerError(error, "SETTINGS_UPDATE_ERROR");
|