emdash 0.33.0 → 0.34.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-BMyNSSZi.d.mts → adapters-34EN2eXO.d.mts} +26 -2
- package/dist/adapters-34EN2eXO.d.mts.map +1 -0
- package/dist/{allowed-origins-CG1pACtS.mjs → allowed-origins-DW7sYyqg.mjs} +2 -2
- package/dist/{allowed-origins-CG1pACtS.mjs.map → allowed-origins-DW7sYyqg.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +22 -21
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +6 -5
- package/dist/{api-D2hunekQ.mjs → api-DdAsirBe.mjs} +98 -407
- package/dist/api-DdAsirBe.mjs.map +1 -0
- package/dist/{api-tokens-CSND0i1z.mjs → api-tokens-CFXu8F_2.mjs} +2 -2
- package/dist/{api-tokens-CSND0i1z.mjs.map → api-tokens-CFXu8F_2.mjs.map} +1 -1
- package/dist/{apply-kwNEJW2l.mjs → apply-D5zfeD09.mjs} +131 -107
- package/dist/apply-D5zfeD09.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +93 -35
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +8 -8
- package/dist/astro/middleware/media-usage-write-fence.d.mts +7 -0
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs +35 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +10 -7
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +3 -3
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -11
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +1677 -156
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -17
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -17
- package/dist/astro/routes/api/admin/bylines/index.mjs +17 -17
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -11
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -11
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +15 -14
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -42
- 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.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +50 -42
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +51 -43
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -42
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -42
- 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 +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -42
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +13 -12
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +10 -9
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -11
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +10 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -4
- 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 +9 -8
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +13 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -14
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +14 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +18 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +18 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +44 -31
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +10 -8
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +18 -16
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +14 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +13 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +14 -14
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +18 -16
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +28 -27
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +174 -72
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +13 -11
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
- package/dist/astro/routes/api/media/_id_/usage.mjs +17 -16
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +16 -15
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +18 -15
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/items.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_.mjs +11 -11
- package/dist/astro/routes/api/menus/index.mjs +11 -11
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +152 -6
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +8 -7
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +13 -12
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +13 -12
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +18 -17
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +13 -12
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +18 -17
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -42
- 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 +47 -42
- 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 +47 -42
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -42
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +47 -42
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +47 -42
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +10 -9
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -42
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +47 -42
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +13 -13
- package/dist/astro/routes/api/search/index.mjs +12 -12
- package/dist/astro/routes/api/search/rebuild.mjs +13 -13
- package/dist/astro/routes/api/search/stats.mjs +8 -8
- package/dist/astro/routes/api/search/suggest.mjs +12 -12
- package/dist/astro/routes/api/sections/_slug_.mjs +12 -11
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +12 -11
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings.mjs +14 -13
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +13 -12
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +30 -28
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
- package/dist/astro/routes/api/setup/index.mjs +32 -30
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.mjs +8 -8
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +18 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +46 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs +88 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -15
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +6 -6
- package/dist/astro/routes/api/typegen.mjs +6 -6
- 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 +10 -9
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -6
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +12 -11
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +7 -6
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +10 -10
- package/dist/astro/routes/sitemap.xml.mjs +8 -7
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +35 -17
- 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-qRhWQnel.mjs → authorize-1iFJzPaZ.mjs} +2 -2
- package/dist/{authorize-qRhWQnel.mjs.map → authorize-1iFJzPaZ.mjs.map} +1 -1
- package/dist/{backup-CtA6LDNw.mjs → backup-LHjIAVNP.mjs} +4 -4
- package/dist/{backup-CtA6LDNw.mjs.map → backup-LHjIAVNP.mjs.map} +1 -1
- package/dist/{base64-B-PsqheR.mjs → base64-CvLhUKQv.mjs} +1 -1
- package/dist/{base64-B-PsqheR.mjs.map → base64-CvLhUKQv.mjs.map} +1 -1
- package/dist/bundle-CBEXrBnb.mjs +663 -0
- package/dist/bundle-CBEXrBnb.mjs.map +1 -0
- package/dist/{byline-fields-CNc0Yq5i.mjs → byline-fields-C5S8wygO.mjs} +2 -2
- package/dist/{byline-fields-CNc0Yq5i.mjs.map → byline-fields-C5S8wygO.mjs.map} +1 -1
- package/dist/{byline-Cp6csL84.mjs → byline-pEcoDps8.mjs} +5 -5
- package/dist/{byline-Cp6csL84.mjs.map → byline-pEcoDps8.mjs.map} +1 -1
- package/dist/{byline-registry-ZkPKqEwC.mjs → byline-registry-DDun8sxh.mjs} +2 -2
- package/dist/{byline-registry-ZkPKqEwC.mjs.map → byline-registry-DDun8sxh.mjs.map} +1 -1
- package/dist/{bylines-CEj5CdT4.mjs → bylines-BWemdX2k.mjs} +7 -7
- package/dist/{bylines-CEj5CdT4.mjs.map → bylines-BWemdX2k.mjs.map} +1 -1
- package/dist/{bylines-cf-C9lmF.mjs → bylines-DJfSfXCL.mjs} +5 -5
- package/dist/{bylines-cf-C9lmF.mjs.map → bylines-DJfSfXCL.mjs.map} +1 -1
- package/dist/{cache-C9FptTFR.mjs → cache-CBJaDy_E.mjs} +3 -3
- package/dist/{cache-C9FptTFR.mjs.map → cache-CBJaDy_E.mjs.map} +1 -1
- package/dist/{challenge-store-D9VNKELo.mjs → challenge-store-CZyFVaad.mjs} +1 -1
- package/dist/{challenge-store-D9VNKELo.mjs.map → challenge-store-CZyFVaad.mjs.map} +1 -1
- package/dist/{chunks-DbYzib_k.mjs → chunks-DfPax1I0.mjs} +2 -2
- package/dist/{chunks-DbYzib_k.mjs.map → chunks-DfPax1I0.mjs.map} +1 -1
- package/dist/cli/index.mjs +176 -698
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +74 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +25 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-C8BugSGz.mjs +779 -0
- package/dist/collection-deletion-C8BugSGz.mjs.map +1 -0
- package/dist/{comment-BIkJ6Fil.mjs → comment-Dxlep6cE.mjs} +2 -2
- package/dist/{comment-BIkJ6Fil.mjs.map → comment-Dxlep6cE.mjs.map} +1 -1
- package/dist/{comment-reaction-D-laEceb.mjs → comment-reaction-D6qfHKBc.mjs} +2 -2
- package/dist/{comment-reaction-D-laEceb.mjs.map → comment-reaction-D6qfHKBc.mjs.map} +1 -1
- package/dist/{comments-0_w6KChA.mjs → comments-CTOuhTSX.mjs} +3 -3
- package/dist/{comments-0_w6KChA.mjs.map → comments-CTOuhTSX.mjs.map} +1 -1
- package/dist/{components-BPxrRjpE.mjs → components-CQy3lh9x.mjs} +1 -1
- package/dist/{components-BPxrRjpE.mjs.map → components-CQy3lh9x.mjs.map} +1 -1
- package/dist/{config-DyF3OKg_.mjs → config-C3EBstHi.mjs} +18 -2
- package/dist/config-C3EBstHi.mjs.map +1 -0
- package/dist/{content-CJ94NEx5.mjs → content-BNfwh7xX.mjs} +509 -78
- package/dist/content-BNfwh7xX.mjs.map +1 -0
- package/dist/content-list-query-DhQ84eVV.d.mts +26 -0
- package/dist/content-list-query-DhQ84eVV.d.mts.map +1 -0
- package/dist/content-refresh-DNERP4-f.mjs +2560 -0
- package/dist/content-refresh-DNERP4-f.mjs.map +1 -0
- package/dist/{context-C_1nrqnW.mjs → context-DRgOvSnW.mjs} +25 -17
- package/dist/context-DRgOvSnW.mjs.map +1 -0
- package/dist/{cron-DRV-UC4K.mjs → cron-Y9aLtgrA.mjs} +1 -1
- package/dist/{cron-DRV-UC4K.mjs.map → cron-Y9aLtgrA.mjs.map} +1 -1
- package/dist/{dashboard-DINnNVVU.mjs → dashboard-CB8J89rJ.mjs} +44 -10
- package/dist/dashboard-CB8J89rJ.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +2 -2
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{db-errors-CcWLaRiR.mjs → db-errors-Cl-sKYTm.mjs} +1 -1
- package/dist/{db-errors-CcWLaRiR.mjs.map → db-errors-Cl-sKYTm.mjs.map} +1 -1
- package/dist/{default-BD2FG0xV.mjs → default-DdDl3fxv.mjs} +1 -1
- package/dist/{default-BD2FG0xV.mjs.map → default-DdDl3fxv.mjs.map} +1 -1
- package/dist/{deferred-tasks-C-WRCcKo.d.mts → deferred-tasks-BMsa9F64.d.mts} +1 -1
- package/dist/{deferred-tasks-C-WRCcKo.d.mts.map → deferred-tasks-BMsa9F64.d.mts.map} +1 -1
- package/dist/{device-flow-CTqd8mud.mjs → device-flow-CaioYGK3.mjs} +4 -4
- package/dist/{device-flow-CTqd8mud.mjs.map → device-flow-CaioYGK3.mjs.map} +1 -1
- package/dist/dist-D_6CKR8z.mjs +810 -0
- package/dist/dist-D_6CKR8z.mjs.map +1 -0
- package/dist/{email-console-C6WdcWbL.mjs → email-console-BHNjIwiB.mjs} +1 -1
- package/dist/{email-console-C6WdcWbL.mjs.map → email-console-BHNjIwiB.mjs.map} +1 -1
- package/dist/{enrich-CFJJgxs_.mjs → enrich-_ySMEvEE.mjs} +2 -2
- package/dist/{enrich-CFJJgxs_.mjs.map → enrich-_ySMEvEE.mjs.map} +1 -1
- package/dist/{error-oh_9i6bR.mjs → error-DupyJZE2.mjs} +3 -3
- package/dist/{error-oh_9i6bR.mjs.map → error-DupyJZE2.mjs.map} +1 -1
- package/dist/{errors-BucQ8VYz.mjs → errors-CLUPm7aD.mjs} +14 -2
- package/dist/errors-CLUPm7aD.mjs.map +1 -0
- package/dist/{escape-CXps5F_v.mjs → escape-C_aLKP3H.mjs} +1 -1
- package/dist/{escape-CXps5F_v.mjs.map → escape-C_aLKP3H.mjs.map} +1 -1
- package/dist/{field-defs-cache-WD82dMQq.mjs → field-defs-cache-hg6QkjV9.mjs} +4 -4
- package/dist/{field-defs-cache-WD82dMQq.mjs.map → field-defs-cache-hg6QkjV9.mjs.map} +1 -1
- package/dist/{fts-manager-BITakW_R.mjs → fts-manager-CZ-5dVwJ.mjs} +76 -50
- package/dist/fts-manager-CZ-5dVwJ.mjs.map +1 -0
- package/dist/{hreflang-BaLCNcDx.d.mts → hreflang-D3Uehfv2.d.mts} +2 -2
- package/dist/{hreflang-BaLCNcDx.d.mts.map → hreflang-D3Uehfv2.d.mts.map} +1 -1
- package/dist/{hreflang-BdZuVBhL.mjs → hreflang-DNswoYsi.mjs} +7 -7
- package/dist/{hreflang-BdZuVBhL.mjs.map → hreflang-DNswoYsi.mjs.map} +1 -1
- package/dist/{import-C-9uqyT3.mjs → import-B41u8Rot.mjs} +5 -5
- package/dist/{import-C-9uqyT3.mjs.map → import-B41u8Rot.mjs.map} +1 -1
- package/dist/{index-M37iz29I.d.mts → index-C3Y-rsyN.d.mts} +226 -73
- package/dist/index-C3Y-rsyN.d.mts.map +1 -0
- package/dist/{index-MGw47uWq.d.mts → index-Cof4-Fab.d.mts} +5 -10
- package/dist/index-Cof4-Fab.d.mts.map +1 -0
- package/dist/index.d.mts +20 -19
- package/dist/index.mjs +73 -67
- package/dist/{init-lock-DJkX6Hto.mjs → init-lock-6b309ZrF.mjs} +1 -1
- package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-6b309ZrF.mjs.map} +1 -1
- package/dist/{load-DV1DZuUJ.mjs → load-DmvJrtxS.mjs} +2 -2
- package/dist/{load-DV1DZuUJ.mjs.map → load-DmvJrtxS.mjs.map} +1 -1
- package/dist/{loader-CGugY7Zl.mjs → loader-DLBqRiGP.mjs} +95 -53
- package/dist/loader-DLBqRiGP.mjs.map +1 -0
- package/dist/{manifest-schema-Da7kj23y.mjs → manifest-schema-BXbUAHod.mjs} +1 -1
- package/dist/{manifest-schema-Da7kj23y.mjs.map → manifest-schema-BXbUAHod.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +3 -2
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +6 -5
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-OhYL-7Io.mjs → media-BWWWb8kg.mjs} +92 -3
- package/dist/media-BWWWb8kg.mjs.map +1 -0
- package/dist/{media-BP7S-nHT.mjs → media-CzhAn2--.mjs} +2 -2
- package/dist/{media-BP7S-nHT.mjs.map → media-CzhAn2--.mjs.map} +1 -1
- package/dist/{media-allowlist-D-peH1H5.mjs → media-allowlist-BD6HhgXA.mjs} +14 -3
- package/dist/media-allowlist-BD6HhgXA.mjs.map +1 -0
- package/dist/{media-upload-DtrwU2B0.mjs → media-upload-9yas9zGH.mjs} +10 -8
- package/dist/{media-upload-DtrwU2B0.mjs.map → media-upload-9yas9zGH.mjs.map} +1 -1
- package/dist/{media-url-DYs_YLOx.mjs → media-url-BvoX88FA.mjs} +1 -1
- package/dist/{media-url-DYs_YLOx.mjs.map → media-url-BvoX88FA.mjs.map} +1 -1
- package/dist/{media-usage-BlxfTkN0.mjs → media-usage-De3qvwjc.mjs} +137 -60
- package/dist/media-usage-De3qvwjc.mjs.map +1 -0
- package/dist/media-usage-work-B9Bksh_b.mjs +152 -0
- package/dist/media-usage-work-B9Bksh_b.mjs.map +1 -0
- package/dist/media-usage-work-DrCbqBcl.mjs +424 -0
- package/dist/media-usage-work-DrCbqBcl.mjs.map +1 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs +42 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs.map +1 -0
- package/dist/{menus-Y54RDPIN.mjs → menus-CC-yn1F9.mjs} +351 -95
- package/dist/menus-CC-yn1F9.mjs.map +1 -0
- package/dist/{menus-BcQWxeXu.mjs → menus-fxvEDYE6.mjs} +3 -3
- package/dist/{menus-BcQWxeXu.mjs.map → menus-fxvEDYE6.mjs.map} +1 -1
- package/dist/{mode-BWyTBe3I.mjs → mode-Bpe-tNNy.mjs} +1 -1
- package/dist/{mode-BWyTBe3I.mjs.map → mode-Bpe-tNNy.mjs.map} +1 -1
- package/dist/{normalize-C-SHXmra.mjs → normalize-Bc-s_r-a.mjs} +1 -1
- package/dist/{normalize-C-SHXmra.mjs.map → normalize-Bc-s_r-a.mjs.map} +1 -1
- package/dist/{oauth-authorization-ClvktmrL.mjs → oauth-authorization-BXO1MKej.mjs} +4 -4
- package/dist/{oauth-authorization-ClvktmrL.mjs.map → oauth-authorization-BXO1MKej.mjs.map} +1 -1
- package/dist/{oauth-clients-8ao-U66l.mjs → oauth-clients-C_DNqtRu.mjs} +1 -1
- package/dist/{oauth-clients-8ao-U66l.mjs.map → oauth-clients-C_DNqtRu.mjs.map} +1 -1
- package/dist/{oauth-state-store-B1ofdTiQ.mjs → oauth-state-store-DwAxMtk4.mjs} +1 -1
- package/dist/{oauth-state-store-B1ofdTiQ.mjs.map → oauth-state-store-DwAxMtk4.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-CscEuIiR.mjs → oauth-user-lookup-BxfZizdk.mjs} +1 -1
- package/dist/{oauth-user-lookup-CscEuIiR.mjs.map → oauth-user-lookup-BxfZizdk.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-CA4eVX6P.d.mts → options-DRe1pIBL.d.mts} +4 -3
- package/dist/options-DRe1pIBL.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-CJKNuewM.mjs → parse-DFbuc-Fh.mjs} +2 -2
- package/dist/{parse-CJKNuewM.mjs.map → parse-DFbuc-Fh.mjs.map} +1 -1
- package/dist/{passkey-config-D-zrzMJI.mjs → passkey-config-_2GOwwK8.mjs} +1 -1
- package/dist/{passkey-config-D-zrzMJI.mjs.map → passkey-config-_2GOwwK8.mjs.map} +1 -1
- package/dist/{placeholder-DaeNS-VG.d.mts → placeholder-CzW7Lshs.d.mts} +1 -1
- package/dist/{placeholder-DaeNS-VG.d.mts.map → placeholder-CzW7Lshs.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +8 -1
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +7 -4
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{portable-text-B_kqBmXB.mjs → portable-text-DhKbDAGr.mjs} +1 -1
- package/dist/{portable-text-B_kqBmXB.mjs.map → portable-text-DhKbDAGr.mjs.map} +1 -1
- package/dist/{preview-BU6PaLpM.mjs → preview-PW-nOnq4.mjs} +2 -2
- package/dist/{preview-BU6PaLpM.mjs.map → preview-PW-nOnq4.mjs.map} +1 -1
- package/dist/{public-url-Ox9oOlgp.mjs → public-url-CWoFhQT8.mjs} +1 -1
- package/dist/{public-url-Ox9oOlgp.mjs.map → public-url-CWoFhQT8.mjs.map} +1 -1
- package/dist/{query-C5w7PsRQ.mjs → query-BgjfiLUQ.mjs} +31 -49
- package/dist/query-BgjfiLUQ.mjs.map +1 -0
- package/dist/{query-rC9HKv1N.mjs → query-vgZNwIhh.mjs} +3 -3
- package/dist/{query-rC9HKv1N.mjs.map → query-vgZNwIhh.mjs.map} +1 -1
- package/dist/{rate-limit-kug6q99V.mjs → rate-limit-L5anykgo.mjs} +2 -2
- package/dist/{rate-limit-kug6q99V.mjs.map → rate-limit-L5anykgo.mjs.map} +1 -1
- package/dist/{redirect-DIJxXKOG.mjs → redirect-COsS6SWJ.mjs} +2 -2
- package/dist/{redirect-DIJxXKOG.mjs.map → redirect-COsS6SWJ.mjs.map} +1 -1
- package/dist/{redirect-Egf2R9yP.mjs → redirect-KBNE3UEs.mjs} +1 -1
- package/dist/{redirect-Egf2R9yP.mjs.map → redirect-KBNE3UEs.mjs.map} +1 -1
- package/dist/{redirects-Bzm812bY.mjs → redirects-CufRQt0Q.mjs} +4 -4
- package/dist/{redirects-Bzm812bY.mjs.map → redirects-CufRQt0Q.mjs.map} +1 -1
- package/dist/{redirects-G8wAhWAf.mjs → redirects-cV9g7V-0.mjs} +133 -14
- package/dist/redirects-cV9g7V-0.mjs.map +1 -0
- package/dist/registry-C581V4TP.mjs +1275 -0
- package/dist/registry-C581V4TP.mjs.map +1 -0
- package/dist/{relation-Cbe3Sd3m.mjs → relation-DtmAQH7s.mjs} +3 -3
- package/dist/{relation-Cbe3Sd3m.mjs.map → relation-DtmAQH7s.mjs.map} +1 -1
- package/dist/{relations-Bw_E1TXo.mjs → relations-BBApI4e2.mjs} +3 -3
- package/dist/{relations-Bw_E1TXo.mjs.map → relations-BBApI4e2.mjs.map} +1 -1
- package/dist/{relations-qHwpUe66.mjs → relations-DICSyfsh.mjs} +6 -6
- package/dist/{relations-qHwpUe66.mjs.map → relations-DICSyfsh.mjs.map} +1 -1
- package/dist/{relations-G2ta7GIl.d.mts → relations-DItI3MN9.d.mts} +369 -35
- package/dist/relations-DItI3MN9.d.mts.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-Df-jFbAd.mjs → request-meta-DgZJh3zG.mjs} +2 -2
- package/dist/{request-meta-Df-jFbAd.mjs.map → request-meta-DgZJh3zG.mjs.map} +1 -1
- package/dist/{resolve-DZzG4HqM.mjs → resolve-DOhVEvty.mjs} +2 -2
- package/dist/{resolve-DZzG4HqM.mjs.map → resolve-DOhVEvty.mjs.map} +1 -1
- package/dist/{runner-BFTrkYhu.mjs → runner-BiDvq5dv.mjs} +1157 -254
- package/dist/runner-BiDvq5dv.mjs.map +1 -0
- package/dist/{runner-BaADli8l.d.mts → runner-CgQbELYC.d.mts} +2 -2
- package/dist/{runner-BaADli8l.d.mts.map → runner-CgQbELYC.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +4 -3
- package/dist/runtime.mjs.map +1 -1
- package/dist/{schema-CiQXr6_F.mjs → schema-BFyTg38T.mjs} +3 -3
- package/dist/{schema-CiQXr6_F.mjs.map → schema-BFyTg38T.mjs.map} +1 -1
- package/dist/schema-CeQSNwB3.mjs +390 -0
- package/dist/schema-CeQSNwB3.mjs.map +1 -0
- package/dist/{scopes-CNJVT5i5.mjs → scopes-BVeuhGBE.mjs} +3 -3
- package/dist/{scopes-CNJVT5i5.mjs.map → scopes-BVeuhGBE.mjs.map} +1 -1
- package/dist/{search-FZhx5dDU.mjs → search-BpuPKZb0.mjs} +25 -15
- package/dist/search-BpuPKZb0.mjs.map +1 -0
- package/dist/{secrets-DLd8RXee.mjs → secrets-dtYs2hDo.mjs} +3 -3
- package/dist/{secrets-DLd8RXee.mjs.map → secrets-dtYs2hDo.mjs.map} +1 -1
- package/dist/{sections-BrIrMUCn.mjs → sections-COctk6hf.mjs} +3 -3
- package/dist/{sections-BrIrMUCn.mjs.map → sections-COctk6hf.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +24 -22
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +16 -15
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-CobNfOvb.mjs → seo-AFpVvTqr.mjs} +5 -3
- package/dist/seo-AFpVvTqr.mjs.map +1 -0
- package/dist/{seo-DTHRntNC.mjs → seo-CvDxfvFb.mjs} +2 -2
- package/dist/{seo-DTHRntNC.mjs.map → seo-CvDxfvFb.mjs.map} +1 -1
- package/dist/{service-B-pYGPgR.mjs → service-xMiMSTsR.mjs} +3 -3
- package/dist/{service-B-pYGPgR.mjs.map → service-xMiMSTsR.mjs.map} +1 -1
- package/dist/{session-user-BvM9-zNl.mjs → session-user-BzVemLkw.mjs} +1 -1
- package/dist/{session-user-BvM9-zNl.mjs.map → session-user-BzVemLkw.mjs.map} +1 -1
- package/dist/{settings-kJhGiQ4z.mjs → settings-B372MV0p.mjs} +4 -4
- package/dist/{settings-kJhGiQ4z.mjs.map → settings-B372MV0p.mjs.map} +1 -1
- package/dist/{settings-DPHau-WH.mjs → settings-BE9aqn_9.mjs} +3 -3
- package/dist/{settings-DPHau-WH.mjs.map → settings-BE9aqn_9.mjs.map} +1 -1
- package/dist/{setup-complete-u50Qm8rY.mjs → setup-complete-DF7TAfD5.mjs} +1 -1
- package/dist/{setup-complete-u50Qm8rY.mjs.map → setup-complete-DF7TAfD5.mjs.map} +1 -1
- package/dist/{setup-nonce-DCjiiOD2.mjs → setup-nonce-Do-U_cg9.mjs} +1 -1
- package/dist/{setup-nonce-DCjiiOD2.mjs.map → setup-nonce-Do-U_cg9.mjs.map} +1 -1
- package/dist/{single-flight-cache-DW3w11Pu.mjs → single-flight-cache-B0eLKS6K.mjs} +2 -2
- package/dist/{single-flight-cache-DW3w11Pu.mjs.map → single-flight-cache-B0eLKS6K.mjs.map} +1 -1
- package/dist/{site-url-I-lJ5kma.mjs → site-url-Bowsi9T-.mjs} +2 -2
- package/dist/{site-url-I-lJ5kma.mjs.map → site-url-Bowsi9T-.mjs.map} +1 -1
- package/dist/slugify-B994zkXC.mjs +17 -0
- package/dist/slugify-B994zkXC.mjs.map +1 -0
- package/dist/{snapshot-I_fjLDaD.mjs → snapshot-B5h6aPMh.mjs} +1 -1
- package/dist/{snapshot-I_fjLDaD.mjs.map → snapshot-B5h6aPMh.mjs.map} +1 -1
- package/dist/{ssrf-CTa6v21i.mjs → ssrf-Cpvg_n3A.mjs} +1 -1
- package/dist/{ssrf-CTa6v21i.mjs.map → ssrf-Cpvg_n3A.mjs.map} +1 -1
- package/dist/{state-CQvoefYP.mjs → state-DYwPue40.mjs} +1 -1
- package/dist/{state-CQvoefYP.mjs.map → state-DYwPue40.mjs.map} +1 -1
- package/dist/{status-CIsmlC1E.mjs → status-CWVYpbD8.mjs} +1 -1
- package/dist/{status-CIsmlC1E.mjs.map → status-CWVYpbD8.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-CLN1N92E.mjs → taxonomies-B0o9ExNV.mjs} +75 -64
- package/dist/taxonomies-B0o9ExNV.mjs.map +1 -0
- package/dist/{taxonomies-CKuaZER5.mjs → taxonomies-Dk3MAklL.mjs} +280 -56
- package/dist/taxonomies-Dk3MAklL.mjs.map +1 -0
- package/dist/{taxonomy-pOrB2kZe.mjs → taxonomy-CPeM8d2o.mjs} +131 -78
- package/dist/taxonomy-CPeM8d2o.mjs.map +1 -0
- package/dist/{tokens-DagaJGK8.mjs → tokens-C39klX8R.mjs} +2 -2
- package/dist/{tokens-DagaJGK8.mjs.map → tokens-C39klX8R.mjs.map} +1 -1
- package/dist/{transport-DVsa5YYo.mjs → transport--CfOflrp.mjs} +1 -1
- package/dist/{transport-DVsa5YYo.mjs.map → transport--CfOflrp.mjs.map} +1 -1
- package/dist/{transport-CAwTaTp_.d.mts → transport-B_rfeU-a.d.mts} +1 -1
- package/dist/{transport-CAwTaTp_.d.mts.map → transport-B_rfeU-a.d.mts.map} +1 -1
- package/dist/{trusted-proxy-D20_7fyX.mjs → trusted-proxy-CEVekpby.mjs} +1 -1
- package/dist/{trusted-proxy-D20_7fyX.mjs.map → trusted-proxy-CEVekpby.mjs.map} +1 -1
- package/dist/{types-NBI3rF-_.mjs → types-75KIqzL9.mjs} +18 -2
- package/dist/types-75KIqzL9.mjs.map +1 -0
- package/dist/{types-CbUcuxxc.d.mts → types-BPuloofb.d.mts} +1 -1
- package/dist/{types-CbUcuxxc.d.mts.map → types-BPuloofb.d.mts.map} +1 -1
- package/dist/{types-BjxTKxrZ.mjs → types-BW1syrlw.mjs} +1 -1
- package/dist/{types-BjxTKxrZ.mjs.map → types-BW1syrlw.mjs.map} +1 -1
- package/dist/{types-BnFP1M3J.d.mts → types-C3_AbkDP.d.mts} +32 -10
- package/dist/types-C3_AbkDP.d.mts.map +1 -0
- package/dist/{types-Dc4ntQjQ.d.mts → types-CAGdePf3.d.mts} +124 -1
- package/dist/types-CAGdePf3.d.mts.map +1 -0
- package/dist/{types-DLG4IFEQ.d.mts → types-CFUfyt1s.d.mts} +1 -1
- package/dist/{types-DLG4IFEQ.d.mts.map → types-CFUfyt1s.d.mts.map} +1 -1
- package/dist/{types-LoagAGzH.d.mts → types-CPx2lIGo.d.mts} +1 -1
- package/dist/{types-LoagAGzH.d.mts.map → types-CPx2lIGo.d.mts.map} +1 -1
- package/dist/{types-Cd8iuS1J.mjs → types-CQPWhPxE.mjs} +9 -12
- package/dist/types-CQPWhPxE.mjs.map +1 -0
- package/dist/{types-Cz8hNch2.d.mts → types-Cs-TFLNf.d.mts} +25 -5
- package/dist/types-Cs-TFLNf.d.mts.map +1 -0
- package/dist/types-CtzytVXn.mjs.map +1 -1
- package/dist/{types-BGWPMiBO.d.mts → types-D4_1Ga4L.d.mts} +44 -5
- package/dist/types-D4_1Ga4L.d.mts.map +1 -0
- package/dist/{types-C8oz_ayJ.d.mts → types-DefV3OiO.d.mts} +1 -1
- package/dist/{types-C8oz_ayJ.d.mts.map → types-DefV3OiO.d.mts.map} +1 -1
- package/dist/{types-BK6U01Ro.d.mts → types-X0MThr7x.d.mts} +1 -1
- package/dist/{types-BK6U01Ro.d.mts.map → types-X0MThr7x.d.mts.map} +1 -1
- package/dist/{upload-attempts-D8QAFLUJ.mjs → upload-attempts-hlne3iA1.mjs} +1 -1
- package/dist/{upload-attempts-D8QAFLUJ.mjs.map → upload-attempts-hlne3iA1.mjs.map} +1 -1
- package/dist/url-pattern-BHS0V5Ng.mjs +33 -0
- package/dist/url-pattern-BHS0V5Ng.mjs.map +1 -0
- package/dist/{user-DBrq4UVq.mjs → user-sHgJ62SP.mjs} +3 -3
- package/dist/{user-DBrq4UVq.mjs.map → user-sHgJ62SP.mjs.map} +1 -1
- package/dist/{utils-hLzi_2Fn.mjs → utils-D4vD_Y98.mjs} +3 -3
- package/dist/{utils-hLzi_2Fn.mjs.map → utils-D4vD_Y98.mjs.map} +1 -1
- package/dist/{validate-mKo3RxBM.mjs → validate-BkqIG_Uj.mjs} +24 -5
- package/dist/validate-BkqIG_Uj.mjs.map +1 -0
- package/dist/{validate-C3oSmA7F.d.mts → validate-DeGtBN84.d.mts} +15 -7
- package/dist/validate-DeGtBN84.d.mts.map +1 -0
- package/dist/{validation-BgpucsvF.mjs → validation-CiJb_X5o.mjs} +11 -10
- package/dist/{validation-BgpucsvF.mjs.map → validation-CiJb_X5o.mjs.map} +1 -1
- package/dist/version-x0NjTScG.mjs +7 -0
- package/dist/{version-C4PnpmoV.mjs.map → version-x0NjTScG.mjs.map} +1 -1
- package/dist/{widgets-CJJtkiKh.mjs → widgets-Cwzvww0W.mjs} +3 -3
- package/dist/{widgets-CJJtkiKh.mjs.map → widgets-Cwzvww0W.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-Bkpp_2tK.d.mts → wxr-taxonomies-CmC0ZsDr.d.mts} +1 -1
- package/dist/{wxr-taxonomies-Bkpp_2tK.d.mts.map → wxr-taxonomies-CmC0ZsDr.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-9PPSy8X6.mjs → wxr-taxonomies-QZjWxjyk.mjs} +13 -32
- package/dist/{wxr-taxonomies-9PPSy8X6.mjs.map → wxr-taxonomies-QZjWxjyk.mjs.map} +1 -1
- package/dist/{zod-generator-CG64Hnbh.mjs → zod-generator-D11MhxG4.mjs} +52 -5
- package/dist/zod-generator-D11MhxG4.mjs.map +1 -0
- package/package.json +16 -8
- package/src/api/errors.ts +12 -0
- package/src/api/handlers/content.ts +127 -29
- package/src/api/handlers/dashboard.ts +12 -2
- package/src/api/handlers/index.ts +16 -0
- package/src/api/handlers/manifest.ts +2 -0
- package/src/api/handlers/media-allowlist.ts +13 -2
- package/src/api/handlers/media-usage-work.ts +188 -0
- package/src/api/handlers/media-usage.ts +5 -3
- package/src/api/handlers/schema.ts +9 -3
- package/src/api/handlers/seo.ts +5 -2
- package/src/api/handlers/taxonomies.ts +345 -82
- package/src/api/media-usage-write-fence.ts +64 -0
- package/src/api/openapi/document.ts +199 -0
- package/src/api/schemas/common.ts +3 -1
- package/src/api/schemas/content.ts +122 -1
- package/src/api/schemas/media-usage.ts +133 -0
- package/src/api/schemas/schema.ts +78 -3
- package/src/api/schemas/taxonomies.ts +40 -8
- package/src/api/types.ts +1 -0
- package/src/astro/integration/index.ts +55 -42
- package/src/astro/integration/routes.ts +34 -4
- package/src/astro/integration/runtime.ts +15 -0
- package/src/astro/integration/virtual-modules.ts +25 -1
- package/src/astro/integration/vite-config.ts +16 -1
- package/src/astro/middleware/media-usage-write-fence.ts +30 -0
- package/src/astro/middleware/redirect.ts +12 -2
- package/src/astro/middleware.ts +75 -8
- package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
- package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +67 -31
- package/src/astro/routes/api/import/wordpress/execute.ts +3 -10
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +7 -1
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +1 -7
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +1 -0
- package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
- package/src/astro/routes/api/taxonomies/[name].ts +102 -0
- package/src/astro/types.ts +25 -4
- package/src/cleanup.ts +6 -12
- package/src/cli/commands/doctor.ts +193 -6
- package/src/cli/commands/export-seed.ts +4 -1
- package/src/client/index.ts +119 -0
- package/src/components/Block.astro +12 -0
- package/src/components/InlinePortableTextEditor.tsx +89 -1
- package/src/content/converters/mark-safety.ts +120 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +25 -16
- package/src/content/converters/prosemirror-to-portable-text.ts +12 -2
- package/src/content-list-query.ts +29 -0
- package/src/database/migrations/060_collection_admin_config.ts +16 -0
- package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
- package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
- package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
- package/src/database/migrations/064_fts_plain_text.ts +253 -0
- package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
- package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
- package/src/database/migrations/067_indexed_content_fields.ts +39 -0
- package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
- package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
- package/src/database/migrations/070_collection_routable.ts +18 -0
- package/src/database/migrations/runner.ts +22 -0
- package/src/database/repositories/content.ts +861 -96
- package/src/database/repositories/media-usage-work.ts +848 -0
- package/src/database/repositories/media-usage.ts +1502 -138
- package/src/database/repositories/revision.ts +17 -6
- package/src/database/repositories/taxonomy.ts +234 -103
- package/src/database/repositories/types.ts +51 -2
- package/src/database/types.ts +134 -16
- package/src/db/adapters.ts +28 -0
- package/src/db/index.ts +3 -0
- package/src/emdash-runtime.ts +227 -20
- package/src/fields/file.ts +7 -4
- package/src/fields/image.ts +8 -1
- package/src/fields/types.ts +18 -5
- package/src/i18n/config.ts +32 -0
- package/src/i18n/repair-locale-casing.ts +0 -14
- package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
- package/src/import/wxr-taxonomies.ts +7 -47
- package/src/index.ts +25 -2
- package/src/loader.ts +119 -65
- package/src/mcp/server.ts +242 -34
- package/src/media/usage/activation.ts +626 -0
- package/src/media/usage/capture-triggers.ts +543 -0
- package/src/media/usage/cleanup.ts +305 -0
- package/src/media/usage/collection-deletion-processor.ts +356 -0
- package/src/media/usage/collection-deletion.ts +836 -0
- package/src/media/usage/content-fields.ts +40 -3
- package/src/media/usage/content-refresh.ts +356 -47
- package/src/media/usage/content-repair.ts +180 -61
- package/src/media/usage/content-snapshots.ts +85 -105
- package/src/media/usage/projection-fingerprint.ts +129 -0
- package/src/media/usage/reconciliation-processor.ts +372 -0
- package/src/media/usage/reconciliation.ts +1117 -0
- package/src/media/usage/source-key.ts +4 -0
- package/src/media/usage/types.ts +2 -0
- package/src/media/usage/work-processor.ts +248 -0
- package/src/menus/index.ts +246 -141
- package/src/plugin-types.ts +8 -0
- package/src/plugins/adapt-sandbox-entry.ts +24 -5
- package/src/plugins/context.ts +24 -7
- package/src/plugins/index.ts +9 -0
- package/src/plugins/routes.ts +43 -1
- package/src/plugins/sandbox/index.ts +10 -1
- package/src/plugins/sandbox/types.ts +78 -1
- package/src/plugins/scheduler/node.ts +13 -1
- package/src/plugins/scheduler/types.ts +2 -0
- package/src/plugins/types.ts +39 -2
- package/src/query.ts +29 -37
- package/src/scheduler-health.ts +46 -0
- package/src/schema/registry.ts +777 -255
- package/src/schema/types.ts +50 -8
- package/src/schema/url-pattern.ts +33 -0
- package/src/schema/zod-generator.ts +77 -5
- package/src/search/fts-manager.ts +117 -76
- package/src/search/query.ts +32 -11
- package/src/search/types.ts +2 -0
- package/src/seed/apply.ts +68 -15
- package/src/seed/types.ts +11 -3
- package/src/seed/validate.ts +52 -2
- package/src/taxonomies/index.ts +77 -75
- package/src/taxonomies/term-counts.ts +21 -8
- package/src/utils/slugify.ts +1 -29
- package/src/virtual-modules.d.ts +16 -0
- package/dist/adapters-BMyNSSZi.d.mts.map +0 -1
- package/dist/api-D2hunekQ.mjs.map +0 -1
- package/dist/apply-kwNEJW2l.mjs.map +0 -1
- package/dist/config-DyF3OKg_.mjs.map +0 -1
- package/dist/content-CJ94NEx5.mjs.map +0 -1
- package/dist/content-refresh-Xw7aKmou.mjs +0 -1629
- package/dist/content-refresh-Xw7aKmou.mjs.map +0 -1
- package/dist/context-C_1nrqnW.mjs.map +0 -1
- package/dist/dashboard-DINnNVVU.mjs.map +0 -1
- package/dist/errors-BucQ8VYz.mjs.map +0 -1
- package/dist/fts-manager-BITakW_R.mjs.map +0 -1
- package/dist/index-M37iz29I.d.mts.map +0 -1
- package/dist/index-MGw47uWq.d.mts.map +0 -1
- package/dist/loader-CGugY7Zl.mjs.map +0 -1
- package/dist/media-OhYL-7Io.mjs.map +0 -1
- package/dist/media-allowlist-D-peH1H5.mjs.map +0 -1
- package/dist/media-usage-BlxfTkN0.mjs.map +0 -1
- package/dist/menus-Y54RDPIN.mjs.map +0 -1
- package/dist/options-CA4eVX6P.d.mts.map +0 -1
- package/dist/query-C5w7PsRQ.mjs.map +0 -1
- package/dist/redirects-G8wAhWAf.mjs.map +0 -1
- package/dist/registry-Dbodb4Uo.mjs +0 -840
- package/dist/registry-Dbodb4Uo.mjs.map +0 -1
- package/dist/relations-G2ta7GIl.d.mts.map +0 -1
- package/dist/runner-BFTrkYhu.mjs.map +0 -1
- package/dist/search-FZhx5dDU.mjs.map +0 -1
- package/dist/seo-CobNfOvb.mjs.map +0 -1
- package/dist/slugify-C_tqlU4G.mjs +0 -30
- package/dist/slugify-C_tqlU4G.mjs.map +0 -1
- package/dist/taxonomies-CKuaZER5.mjs.map +0 -1
- package/dist/taxonomies-CLN1N92E.mjs.map +0 -1
- package/dist/taxonomy-pOrB2kZe.mjs.map +0 -1
- package/dist/types-BGWPMiBO.d.mts.map +0 -1
- package/dist/types-BnFP1M3J.d.mts.map +0 -1
- package/dist/types-Cd8iuS1J.mjs.map +0 -1
- package/dist/types-Cz8hNch2.d.mts.map +0 -1
- package/dist/types-Dc4ntQjQ.d.mts.map +0 -1
- package/dist/types-NBI3rF-_.mjs.map +0 -1
- package/dist/validate-C3oSmA7F.d.mts.map +0 -1
- package/dist/validate-mKo3RxBM.mjs.map +0 -1
- package/dist/version-C4PnpmoV.mjs +0 -7
- package/dist/zod-generator-CG64Hnbh.mjs.map +0 -1
- /package/dist/{api-tokens-Dai9dND0.mjs → api-tokens-CyTsLszZ.mjs} +0 -0
- /package/dist/{ssrf-Cj568Dgs.mjs → ssrf-DpXgKsna.mjs} +0 -0
- /package/dist/{types-DKuWPYV5.mjs → types-CP1CflWf.mjs} +0 -0
package/src/astro/middleware.ts
CHANGED
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
* All heavy lifting happens in EmDashRuntime.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import type { APIContext } from "astro";
|
|
8
9
|
import { defineMiddleware } from "astro:middleware";
|
|
9
10
|
import type { Kysely } from "kysely";
|
|
10
11
|
// Import from virtual modules (populated by integration at build time)
|
|
11
12
|
// @ts-ignore - virtual module
|
|
13
|
+
import { buildTime as virtualBuildTime } from "virtual:emdash/build";
|
|
14
|
+
// @ts-ignore - virtual module
|
|
12
15
|
import virtualConfig from "virtual:emdash/config";
|
|
13
16
|
// @ts-ignore - virtual module
|
|
14
17
|
import {
|
|
@@ -36,9 +39,11 @@ import {
|
|
|
36
39
|
flushRecorder,
|
|
37
40
|
isInstrumentationEnabled,
|
|
38
41
|
} from "../database/instrumentation.js";
|
|
42
|
+
import { createDeferredTaskTracker } from "../deferred-tasks.js";
|
|
39
43
|
import {
|
|
40
44
|
DB_INIT_DEADLINE_MS,
|
|
41
45
|
EmDashRuntime,
|
|
46
|
+
type MediaUsageMaintenanceResult,
|
|
42
47
|
type RuntimeDependencies,
|
|
43
48
|
type SandboxedPluginEntry,
|
|
44
49
|
type MediaProviderEntry,
|
|
@@ -284,6 +289,12 @@ export async function runScheduledTasks(
|
|
|
284
289
|
return runOutsideRequest(config, (runtime) => runtime.runScheduledTasks(options));
|
|
285
290
|
}
|
|
286
291
|
|
|
292
|
+
export async function runScheduledMediaUsageTasks(): Promise<MediaUsageMaintenanceResult> {
|
|
293
|
+
const config = getConfig();
|
|
294
|
+
if (!config) return { outcome: "inactive", taskClass: null, turn: null };
|
|
295
|
+
return runOutsideRequest(config, (runtime) => runtime.runScheduledMediaUsageTasks());
|
|
296
|
+
}
|
|
297
|
+
|
|
287
298
|
/**
|
|
288
299
|
* Run a callback against the EmDash runtime outside any HTTP request — from a
|
|
289
300
|
* Cloudflare Queue consumer, a `scheduled()` handler, or any other
|
|
@@ -334,23 +345,50 @@ export async function withEmDashRuntime<T>(
|
|
|
334
345
|
/**
|
|
335
346
|
* Shared plumbing for request-free entry points (`runScheduledTasks`,
|
|
336
347
|
* `withEmDashRuntime`): resolve the runtime singleton, then run the callback
|
|
337
|
-
* under an event-scoped db
|
|
348
|
+
* under an event-scoped db when the adapter needs one.
|
|
338
349
|
*
|
|
339
350
|
* Connection-backed adapters (e.g. Postgres over Hyperdrive) cannot reuse
|
|
340
351
|
* the per-isolate singleton from a platform event: its socket belongs to the
|
|
341
352
|
* request that opened it, and workerd rejects cross-event I/O. Open an
|
|
342
353
|
* event-scoped connection and run the callback under it in ALS — the
|
|
343
354
|
* runtime's db getter, the cron executor, and plugin contexts all resolve
|
|
344
|
-
* the connection from ALS — then close it
|
|
345
|
-
*
|
|
346
|
-
*
|
|
355
|
+
* the connection from ALS — then close it when required. Stateless adapters
|
|
356
|
+
* that need primary routing can return a close-less scope; adapters with no
|
|
357
|
+
* event scoping return null and keep using the singleton.
|
|
347
358
|
*/
|
|
348
359
|
async function runOutsideRequest<T>(
|
|
349
360
|
config: EmDashConfig,
|
|
350
361
|
fn: (runtime: EmDashRuntime) => Promise<T>,
|
|
351
362
|
): Promise<T> {
|
|
352
|
-
|
|
363
|
+
if (getRequestContext()) {
|
|
364
|
+
const runtime = await getRuntime(config);
|
|
365
|
+
return runOutsideRequestWithRuntime(config, runtime, fn);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
const deferredTasks = createDeferredTaskTracker(() => {});
|
|
369
|
+
const context = {
|
|
370
|
+
editMode: false,
|
|
371
|
+
metrics: createRequestMetrics(performance.now()),
|
|
372
|
+
deferredTasks,
|
|
373
|
+
};
|
|
374
|
+
return runWithContext(context, async () => {
|
|
375
|
+
const runtime = await (async () => {
|
|
376
|
+
try {
|
|
377
|
+
return await getRuntime(config);
|
|
378
|
+
} finally {
|
|
379
|
+
deferredTasks.settle();
|
|
380
|
+
await deferredTasks.settled;
|
|
381
|
+
}
|
|
382
|
+
})();
|
|
383
|
+
return runOutsideRequestWithRuntime(config, runtime, fn);
|
|
384
|
+
});
|
|
385
|
+
}
|
|
353
386
|
|
|
387
|
+
async function runOutsideRequestWithRuntime<T>(
|
|
388
|
+
config: EmDashConfig,
|
|
389
|
+
runtime: EmDashRuntime,
|
|
390
|
+
fn: (runtime: EmDashRuntime) => Promise<T>,
|
|
391
|
+
): Promise<T> {
|
|
354
392
|
const scoped = createRequestScopedDb({
|
|
355
393
|
config: config.database?.config,
|
|
356
394
|
isAuthenticated: false,
|
|
@@ -361,9 +399,8 @@ async function runOutsideRequest<T>(
|
|
|
361
399
|
cookies: NOOP_COOKIE_JAR,
|
|
362
400
|
url: CRON_EVENT_URL,
|
|
363
401
|
});
|
|
364
|
-
if (!scoped
|
|
365
|
-
//
|
|
366
|
-
// outside a request. Any close-less scope created above is discarded.
|
|
402
|
+
if (!scoped) {
|
|
403
|
+
// This adapter needs no event-specific routing or connection.
|
|
367
404
|
return fn(runtime);
|
|
368
405
|
}
|
|
369
406
|
const { closed, deferredTasks, lifecycle } = coordinateScopedDbLifecycle(scoped);
|
|
@@ -509,6 +546,34 @@ function createRequestScopedDb(
|
|
|
509
546
|
return fn(opts);
|
|
510
547
|
}
|
|
511
548
|
|
|
549
|
+
const buildDate = virtualBuildTime ? new Date(virtualBuildTime) : null;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Fold the build timestamp into the route cache validator.
|
|
553
|
+
*
|
|
554
|
+
* `CacheHint.lastModified` describes the content, but the response also depends
|
|
555
|
+
* on the build: `/_astro/*` names are content-hashed, and a deployment only
|
|
556
|
+
* serves its own. Without the build dimension a code-only deploy answers a
|
|
557
|
+
* returning visitor's conditional request with 304, leaving them on HTML whose
|
|
558
|
+
* assets 404.
|
|
559
|
+
*
|
|
560
|
+
* Prerendered pages are served by the host's static layer, which manages its
|
|
561
|
+
* own validators — only on-demand responses need the build dimension.
|
|
562
|
+
*
|
|
563
|
+
* Only forward moves are covered. `Last-Modified` expresses newer, not
|
|
564
|
+
* different, so after a rollback the earlier build still answers a conditional
|
|
565
|
+
* request with 304 and the browser stays on the newer build's HTML.
|
|
566
|
+
*
|
|
567
|
+
* Must run before next(): Astro keeps the later of two dates, so a route's own
|
|
568
|
+
* hint still wins when content is newer, and a route that opts out with
|
|
569
|
+
* `Astro.cache.set(false)` stays opted out — calling set() afterwards would
|
|
570
|
+
* clear that opt-out.
|
|
571
|
+
*/
|
|
572
|
+
function applyBuildValidator(context: APIContext): void {
|
|
573
|
+
if (context.isPrerendered || !buildDate || !context.cache?.enabled) return;
|
|
574
|
+
context.cache.set({ lastModified: buildDate });
|
|
575
|
+
}
|
|
576
|
+
|
|
512
577
|
export const onRequest = defineMiddleware(async (context, next) => {
|
|
513
578
|
const { request, locals, cookies } = context;
|
|
514
579
|
const url = context.url;
|
|
@@ -527,6 +592,8 @@ export const onRequest = defineMiddleware(async (context, next) => {
|
|
|
527
592
|
}
|
|
528
593
|
}
|
|
529
594
|
|
|
595
|
+
applyBuildValidator(context);
|
|
596
|
+
|
|
530
597
|
const queryRecorder = isInstrumentationEnabled()
|
|
531
598
|
? createRecorder(url.pathname, request.method, request.headers.get("x-perf-phase") ?? "default")
|
|
532
599
|
: undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
|
|
3
|
+
import { requirePerm } from "#api/authorize.js";
|
|
4
|
+
import { requireDb, unwrapResult } from "#api/error.js";
|
|
5
|
+
import { handleMediaUsageCollectionDeletionList } from "#api/handlers/media-usage-work.js";
|
|
6
|
+
import { isParseError, parseQuery } from "#api/parse.js";
|
|
7
|
+
import { mediaUsageCollectionDeletionListQuery } from "#api/schemas.js";
|
|
8
|
+
import { requireScope } from "#auth/scopes.js";
|
|
9
|
+
|
|
10
|
+
export const prerender = false;
|
|
11
|
+
|
|
12
|
+
export const GET: APIRoute = async ({ request, locals }) => {
|
|
13
|
+
const dbErr = requireDb(locals.emdash?.db);
|
|
14
|
+
if (dbErr) return dbErr;
|
|
15
|
+
const denied = requirePerm(locals.user, "schema:manage");
|
|
16
|
+
if (denied) return denied;
|
|
17
|
+
const scopeDenied = requireScope(locals, "admin");
|
|
18
|
+
if (scopeDenied) return scopeDenied;
|
|
19
|
+
const query = parseQuery(new URL(request.url), mediaUsageCollectionDeletionListQuery);
|
|
20
|
+
if (isParseError(query)) return query;
|
|
21
|
+
return unwrapResult(await handleMediaUsageCollectionDeletionList(locals.emdash.db, query));
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
|
|
3
|
+
import { requirePerm } from "#api/authorize.js";
|
|
4
|
+
import { requireDb, unwrapResult } from "#api/error.js";
|
|
5
|
+
import { handleMediaUsageCollectionDeletionRetry } from "#api/handlers/media-usage-work.js";
|
|
6
|
+
import { isParseError, parseBody } from "#api/parse.js";
|
|
7
|
+
import { mediaUsageCollectionDeletionRetryBody } from "#api/schemas.js";
|
|
8
|
+
import { requireScope } from "#auth/scopes.js";
|
|
9
|
+
|
|
10
|
+
export const prerender = false;
|
|
11
|
+
|
|
12
|
+
export const POST: APIRoute = async ({ request, locals }) => {
|
|
13
|
+
const dbErr = requireDb(locals.emdash?.db);
|
|
14
|
+
if (dbErr) return dbErr;
|
|
15
|
+
const denied = requirePerm(locals.user, "schema:manage");
|
|
16
|
+
if (denied) return denied;
|
|
17
|
+
const scopeDenied = requireScope(locals, "admin");
|
|
18
|
+
if (scopeDenied) return scopeDenied;
|
|
19
|
+
const body = await parseBody(request, mediaUsageCollectionDeletionRetryBody);
|
|
20
|
+
if (isParseError(body)) return body;
|
|
21
|
+
return unwrapResult(await handleMediaUsageCollectionDeletionRetry(locals.emdash.db, body));
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
|
|
3
|
+
import { requirePerm } from "#api/authorize.js";
|
|
4
|
+
import { requireDb, unwrapResult } from "#api/error.js";
|
|
5
|
+
import { handleMediaUsageWorkList } from "#api/handlers/media-usage-work.js";
|
|
6
|
+
import { isParseError, parseQuery } from "#api/parse.js";
|
|
7
|
+
import { mediaUsageWorkListQuery } from "#api/schemas.js";
|
|
8
|
+
import { requireScope } from "#auth/scopes.js";
|
|
9
|
+
|
|
10
|
+
export const prerender = false;
|
|
11
|
+
|
|
12
|
+
export const GET: APIRoute = async ({ request, locals }) => {
|
|
13
|
+
const { emdash, user } = locals;
|
|
14
|
+
const dbErr = requireDb(emdash?.db);
|
|
15
|
+
if (dbErr) return dbErr;
|
|
16
|
+
|
|
17
|
+
const denied = requirePerm(user, "schema:manage");
|
|
18
|
+
if (denied) return denied;
|
|
19
|
+
const scopeDenied = requireScope(locals, "admin");
|
|
20
|
+
if (scopeDenied) return scopeDenied;
|
|
21
|
+
|
|
22
|
+
const query = parseQuery(new URL(request.url), mediaUsageWorkListQuery);
|
|
23
|
+
if (isParseError(query)) return query;
|
|
24
|
+
|
|
25
|
+
return unwrapResult(await handleMediaUsageWorkList(emdash.db, query));
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { APIRoute } from "astro";
|
|
2
|
+
|
|
3
|
+
import { requirePerm } from "#api/authorize.js";
|
|
4
|
+
import { requireDb, unwrapResult } from "#api/error.js";
|
|
5
|
+
import { handleMediaUsageWorkRetry } from "#api/handlers/media-usage-work.js";
|
|
6
|
+
import { isParseError, parseBody } from "#api/parse.js";
|
|
7
|
+
import { mediaUsageWorkRetryBody } from "#api/schemas.js";
|
|
8
|
+
import { requireScope } from "#auth/scopes.js";
|
|
9
|
+
|
|
10
|
+
export const prerender = false;
|
|
11
|
+
|
|
12
|
+
export const POST: APIRoute = async ({ request, locals }) => {
|
|
13
|
+
const { emdash, user } = locals;
|
|
14
|
+
const dbErr = requireDb(emdash?.db);
|
|
15
|
+
if (dbErr) return dbErr;
|
|
16
|
+
|
|
17
|
+
const denied = requirePerm(user, "schema:manage");
|
|
18
|
+
if (denied) return denied;
|
|
19
|
+
const scopeDenied = requireScope(locals, "admin");
|
|
20
|
+
if (scopeDenied) return scopeDenied;
|
|
21
|
+
|
|
22
|
+
const body = await parseBody(request, mediaUsageWorkRetryBody);
|
|
23
|
+
if (isParseError(body)) return body;
|
|
24
|
+
|
|
25
|
+
return unwrapResult(await handleMediaUsageWorkRetry(emdash.db, body));
|
|
26
|
+
};
|
|
@@ -9,6 +9,7 @@ import type { APIRoute } from "astro";
|
|
|
9
9
|
import { requirePerm } from "#api/authorize.js";
|
|
10
10
|
import { apiError, unwrapResult } from "#api/error.js";
|
|
11
11
|
import { handlePluginDisable } from "#api/index.js";
|
|
12
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
12
13
|
import { setCronTasksEnabled } from "#plugins/cron.js";
|
|
13
14
|
|
|
14
15
|
export const prerender = false;
|
|
@@ -24,6 +25,9 @@ export const POST: APIRoute = async ({ params, locals }) => {
|
|
|
24
25
|
const denied = requirePerm(user, "plugins:manage");
|
|
25
26
|
if (denied) return denied;
|
|
26
27
|
|
|
28
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
29
|
+
if (activationFence) return activationFence;
|
|
30
|
+
|
|
27
31
|
if (!id) {
|
|
28
32
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
29
33
|
}
|
|
@@ -9,6 +9,7 @@ import type { APIRoute } from "astro";
|
|
|
9
9
|
import { requirePerm } from "#api/authorize.js";
|
|
10
10
|
import { apiError, unwrapResult } from "#api/error.js";
|
|
11
11
|
import { handlePluginEnable } from "#api/index.js";
|
|
12
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
12
13
|
import { setCronTasksEnabled } from "#plugins/cron.js";
|
|
13
14
|
|
|
14
15
|
export const prerender = false;
|
|
@@ -24,6 +25,9 @@ export const POST: APIRoute = async ({ params, locals }) => {
|
|
|
24
25
|
const denied = requirePerm(user, "plugins:manage");
|
|
25
26
|
if (denied) return denied;
|
|
26
27
|
|
|
28
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
29
|
+
if (activationFence) return activationFence;
|
|
30
|
+
|
|
27
31
|
if (!id) {
|
|
28
32
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
29
33
|
}
|
|
@@ -10,6 +10,7 @@ import { z } from "zod";
|
|
|
10
10
|
import { requirePerm } from "#api/authorize.js";
|
|
11
11
|
import { apiError, unwrapResult } from "#api/error.js";
|
|
12
12
|
import { handleMarketplaceUninstall } from "#api/index.js";
|
|
13
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
13
14
|
import { isParseError, parseOptionalBody } from "#api/parse.js";
|
|
14
15
|
|
|
15
16
|
export const prerender = false;
|
|
@@ -29,6 +30,9 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
29
30
|
const denied = requirePerm(user, "plugins:manage");
|
|
30
31
|
if (denied) return denied;
|
|
31
32
|
|
|
33
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
34
|
+
if (activationFence) return activationFence;
|
|
35
|
+
|
|
32
36
|
if (!id) {
|
|
33
37
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
34
38
|
}
|
|
@@ -10,6 +10,7 @@ import { z } from "zod";
|
|
|
10
10
|
import { requirePerm } from "#api/authorize.js";
|
|
11
11
|
import { apiError, unwrapResult } from "#api/error.js";
|
|
12
12
|
import { handleMarketplaceUpdate } from "#api/index.js";
|
|
13
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
13
14
|
import { isParseError, parseOptionalBody } from "#api/parse.js";
|
|
14
15
|
|
|
15
16
|
export const prerender = false;
|
|
@@ -32,6 +33,9 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
32
33
|
const denied = requirePerm(user, "plugins:manage");
|
|
33
34
|
if (denied) return denied;
|
|
34
35
|
|
|
36
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
37
|
+
if (activationFence) return activationFence;
|
|
38
|
+
|
|
35
39
|
if (!id) {
|
|
36
40
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
37
41
|
}
|
|
@@ -10,6 +10,7 @@ import { z } from "zod";
|
|
|
10
10
|
import { requirePerm } from "#api/authorize.js";
|
|
11
11
|
import { apiError, handleError, unwrapResult } from "#api/error.js";
|
|
12
12
|
import { handleMarketplaceInstall } from "#api/index.js";
|
|
13
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
13
14
|
import { isParseError, parseOptionalBody } from "#api/parse.js";
|
|
14
15
|
|
|
15
16
|
export const prerender = false;
|
|
@@ -31,6 +32,9 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
31
32
|
const denied = requirePerm(user, "plugins:manage");
|
|
32
33
|
if (denied) return denied;
|
|
33
34
|
|
|
35
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
36
|
+
if (activationFence) return activationFence;
|
|
37
|
+
|
|
34
38
|
if (!id) {
|
|
35
39
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
36
40
|
}
|
|
@@ -13,6 +13,7 @@ import { z } from "zod";
|
|
|
13
13
|
import { requirePerm } from "#api/authorize.js";
|
|
14
14
|
import { apiError, unwrapResult } from "#api/error.js";
|
|
15
15
|
import { handleRegistryUninstall } from "#api/index.js";
|
|
16
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
16
17
|
import { isParseError, parseOptionalBody } from "#api/parse.js";
|
|
17
18
|
|
|
18
19
|
export const prerender = false;
|
|
@@ -32,6 +33,9 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
32
33
|
const denied = requirePerm(user, "plugins:manage");
|
|
33
34
|
if (denied) return denied;
|
|
34
35
|
|
|
36
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
37
|
+
if (activationFence) return activationFence;
|
|
38
|
+
|
|
35
39
|
if (!id) {
|
|
36
40
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
37
41
|
}
|
|
@@ -16,6 +16,7 @@ import { z } from "zod";
|
|
|
16
16
|
import { requirePerm } from "#api/authorize.js";
|
|
17
17
|
import { apiError, handleError, unwrapResult } from "#api/error.js";
|
|
18
18
|
import { handleRegistryUpdate } from "#api/index.js";
|
|
19
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
19
20
|
import { isParseError, parseOptionalBody } from "#api/parse.js";
|
|
20
21
|
|
|
21
22
|
import { VERSION } from "../../../../../../../version.js";
|
|
@@ -51,6 +52,9 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
51
52
|
const denied = requirePerm(user, "plugins:manage");
|
|
52
53
|
if (denied) return denied;
|
|
53
54
|
|
|
55
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
56
|
+
if (activationFence) return activationFence;
|
|
57
|
+
|
|
54
58
|
if (!id) {
|
|
55
59
|
return apiError("INVALID_REQUEST", "Plugin ID required", 400);
|
|
56
60
|
}
|
|
@@ -19,6 +19,7 @@ import { z } from "zod";
|
|
|
19
19
|
import { requirePerm } from "#api/authorize.js";
|
|
20
20
|
import { apiError, handleError, unwrapResult } from "#api/error.js";
|
|
21
21
|
import { handleRegistryInstall } from "#api/index.js";
|
|
22
|
+
import { checkMediaUsageActivationWriteFence } from "#api/media-usage-write-fence.js";
|
|
22
23
|
import { isParseError, parseBody } from "#api/parse.js";
|
|
23
24
|
|
|
24
25
|
import { VERSION } from "../../../../../../version.js";
|
|
@@ -71,6 +72,9 @@ export const POST: APIRoute = async ({ request, locals }) => {
|
|
|
71
72
|
const denied = requirePerm(user, "plugins:manage");
|
|
72
73
|
if (denied) return denied;
|
|
73
74
|
|
|
75
|
+
const activationFence = await checkMediaUsageActivationWriteFence(emdash.db);
|
|
76
|
+
if (activationFence) return activationFence;
|
|
77
|
+
|
|
74
78
|
const body = await parseBody(request, installBodySchema);
|
|
75
79
|
if (isParseError(body)) return body;
|
|
76
80
|
|
|
@@ -12,11 +12,48 @@ import { apiError, apiSuccess, handleError, requireDb } from "#api/error.js";
|
|
|
12
12
|
import { parseBody, isParseError } from "#api/parse.js";
|
|
13
13
|
import { contentTermsBody } from "#api/schemas.js";
|
|
14
14
|
import { ContentRepository } from "#db/repositories/content.js";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
TaxonomyRepository,
|
|
17
|
+
type TaxonomyAssignmentResolution,
|
|
18
|
+
} from "#db/repositories/taxonomy.js";
|
|
16
19
|
import { invalidateTermCache } from "#taxonomies/index.js";
|
|
17
20
|
|
|
21
|
+
import { getI18nConfig } from "../../../../../../../i18n/config.js";
|
|
22
|
+
|
|
18
23
|
export const prerender = false;
|
|
19
24
|
|
|
25
|
+
function assignmentResponse(assignments: TaxonomyAssignmentResolution[], entryLocale: string) {
|
|
26
|
+
const config = getI18nConfig();
|
|
27
|
+
const defaultLocale = config?.defaultLocale ?? "en";
|
|
28
|
+
return {
|
|
29
|
+
terms: assignments.flatMap(({ term }) =>
|
|
30
|
+
term
|
|
31
|
+
? [
|
|
32
|
+
{
|
|
33
|
+
id: term.id,
|
|
34
|
+
name: term.name,
|
|
35
|
+
slug: term.slug,
|
|
36
|
+
label: term.label,
|
|
37
|
+
parentId: term.parentId,
|
|
38
|
+
locale: term.locale,
|
|
39
|
+
translationGroup: term.translationGroup,
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
: [],
|
|
43
|
+
),
|
|
44
|
+
unresolved: assignments
|
|
45
|
+
.filter(({ term }) => term === null)
|
|
46
|
+
.map(({ translationGroup, availableLocales, translations }) => ({
|
|
47
|
+
translationGroup,
|
|
48
|
+
availableLocales,
|
|
49
|
+
translations,
|
|
50
|
+
})),
|
|
51
|
+
entryLocale,
|
|
52
|
+
defaultLocale,
|
|
53
|
+
implicitDefaultLocale: config === null,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
20
57
|
/**
|
|
21
58
|
* Get terms assigned to an entry
|
|
22
59
|
*/
|
|
@@ -34,26 +71,24 @@ export const GET: APIRoute = async ({ params, locals }) => {
|
|
|
34
71
|
}
|
|
35
72
|
|
|
36
73
|
try {
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
// term variant is returned — see issue #1218.
|
|
74
|
+
// Assignments store content and term translation groups. Resolve the
|
|
75
|
+
// entry's locale server-side so the response includes only that locale's
|
|
76
|
+
// term variant.
|
|
41
77
|
const entry = await new ContentRepository(emdash.db).findByIdOrSlug(collection, id);
|
|
42
78
|
if (!entry) return apiError("NOT_FOUND", "Content not found", 404);
|
|
43
|
-
const locale = entry.locale
|
|
79
|
+
const locale = entry.locale || getI18nConfig()?.defaultLocale || "en";
|
|
80
|
+
const defaultLocale = getI18nConfig()?.defaultLocale ?? "en";
|
|
44
81
|
|
|
45
82
|
const repo = new TaxonomyRepository(emdash.db);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})),
|
|
56
|
-
});
|
|
83
|
+
const assignments = await repo.getTermAssignmentsForEntry(
|
|
84
|
+
collection,
|
|
85
|
+
entry.id,
|
|
86
|
+
taxonomy,
|
|
87
|
+
locale,
|
|
88
|
+
defaultLocale,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return apiSuccess(assignmentResponse(assignments, locale));
|
|
57
92
|
} catch (error) {
|
|
58
93
|
return handleError(error, "Failed to get entry terms", "TERMS_GET_ERROR");
|
|
59
94
|
}
|
|
@@ -108,9 +143,12 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
108
143
|
// Resolve the canonical content ID from the handler result.
|
|
109
144
|
// The URL `id` param may be a slug; we must use the real ID for term storage.
|
|
110
145
|
const canonicalId = typeof existingItem?.id === "string" ? existingItem.id : id;
|
|
111
|
-
// The
|
|
112
|
-
//
|
|
113
|
-
const entryLocale =
|
|
146
|
+
// The assignment spans the content translation group, while the response
|
|
147
|
+
// includes only the term variant matching this entry's locale.
|
|
148
|
+
const entryLocale =
|
|
149
|
+
typeof existingItem?.locale === "string"
|
|
150
|
+
? existingItem.locale
|
|
151
|
+
: (getI18nConfig()?.defaultLocale ?? "en");
|
|
114
152
|
|
|
115
153
|
try {
|
|
116
154
|
const body = await parseBody(request, contentTermsBody);
|
|
@@ -142,17 +180,15 @@ export const POST: APIRoute = async ({ params, request, locals }) => {
|
|
|
142
180
|
invalidateTermCache();
|
|
143
181
|
|
|
144
182
|
// Get the updated terms using the canonical ID, scoped to the entry locale
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
})),
|
|
155
|
-
});
|
|
183
|
+
const assignments = await repo.getTermAssignmentsForEntry(
|
|
184
|
+
collection,
|
|
185
|
+
canonicalId,
|
|
186
|
+
taxonomy,
|
|
187
|
+
entryLocale,
|
|
188
|
+
getI18nConfig()?.defaultLocale ?? "en",
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
return apiSuccess(assignmentResponse(assignments, entryLocale));
|
|
156
192
|
} catch (error) {
|
|
157
193
|
return handleError(error, "Failed to set entry terms", "TERMS_SET_ERROR");
|
|
158
194
|
}
|
|
@@ -395,16 +395,9 @@ export async function importContent(
|
|
|
395
395
|
// Anchors (no `translationOf`) get an additive attach -- the
|
|
396
396
|
// row is fresh, no inherited pivots to consider.
|
|
397
397
|
//
|
|
398
|
-
// Translations
|
|
399
|
-
//
|
|
400
|
-
//
|
|
401
|
-
// lose its inherited `tag` or `genre`. The replace path
|
|
402
|
-
// only touches taxonomies the translation actually carries
|
|
403
|
-
// AND that resolve to at least one term that survives the
|
|
404
|
-
// def's `collections` filter; taxonomies with no resolved
|
|
405
|
-
// terms (missing-def, dropped by filter, or just absent
|
|
406
|
-
// from the WXR) fall through with the inherited set intact
|
|
407
|
-
// from `copyEntryTerms`.
|
|
398
|
+
// Translations replace only taxonomies they explicitly carry.
|
|
399
|
+
// Since assignments belong to the content translation_group,
|
|
400
|
+
// that replacement is reflected in every sibling locale.
|
|
408
401
|
if (createdItem) {
|
|
409
402
|
try {
|
|
410
403
|
const written = translationOf
|
|
@@ -73,7 +73,13 @@ const handleRequest: APIRoute = async ({ params, request, locals }) => {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
// Forward the caller only for private routes: it was validated by the
|
|
77
|
+
// requirePerm/requireScope checks above, so plugins can trust ctx.user.
|
|
78
|
+
// Public routes skip auth, so no caller is bound even when an ambient
|
|
79
|
+
// session happens to exist.
|
|
80
|
+
const caller = routeMeta.public ? undefined : user;
|
|
81
|
+
|
|
82
|
+
const result = await emdash.handlePluginApiRoute(pluginId, method, `/${path}`, request, caller);
|
|
77
83
|
|
|
78
84
|
if (!result.success) {
|
|
79
85
|
const code = result.error?.code ?? "PLUGIN_ERROR";
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
} from "#api/index.js";
|
|
18
18
|
import { parseBody, parseQuery, isParseError } from "#api/parse.js";
|
|
19
19
|
import { collectionGetQuery, updateCollectionBody } from "#api/schemas.js";
|
|
20
|
-
import type { UpdateCollectionInput } from "#schema/types.js";
|
|
21
20
|
|
|
22
21
|
export const prerender = false;
|
|
23
22
|
|
|
@@ -53,12 +52,7 @@ export const PUT: APIRoute = async ({ params, request, locals }) => {
|
|
|
53
52
|
const body = await parseBody(request, updateCollectionBody);
|
|
54
53
|
if (isParseError(body)) return body;
|
|
55
54
|
|
|
56
|
-
const result = await handleSchemaCollectionUpdate(
|
|
57
|
-
emdash.db,
|
|
58
|
-
slug,
|
|
59
|
-
// eslint-disable-next-line typescript/no-unsafe-type-assertion -- parseBody validates via Zod
|
|
60
|
-
body as UpdateCollectionInput,
|
|
61
|
-
);
|
|
55
|
+
const result = await handleSchemaCollectionUpdate(emdash.db, slug, body);
|
|
62
56
|
emdash.invalidateUrlPatternCache();
|
|
63
57
|
return unwrapResult(result);
|
|
64
58
|
};
|
|
@@ -36,6 +36,7 @@ export const GET: APIRoute = async ({ params, request, locals }) => {
|
|
|
36
36
|
const result = await handleTermList(emdash.db, name, {
|
|
37
37
|
locale: query.locale,
|
|
38
38
|
includeCounts: query.includeCounts,
|
|
39
|
+
resolveFallback: query.resolveFallback,
|
|
39
40
|
});
|
|
40
41
|
return unwrapResult(result);
|
|
41
42
|
} catch (error) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Taxonomy definition translation endpoints
|
|
3
|
+
*
|
|
4
|
+
* GET /_emdash/api/taxonomies/:name/translations[?locale=xx]
|
|
5
|
+
*
|
|
6
|
+
* Creating a translation goes through `POST /_emdash/api/taxonomies` with
|
|
7
|
+
* `translationOf`, so there is no POST here.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { APIRoute } from "astro";
|
|
11
|
+
|
|
12
|
+
import { requirePerm } from "#api/authorize.js";
|
|
13
|
+
import { apiError, handleError, requireDb, unwrapResult } from "#api/error.js";
|
|
14
|
+
import { handleTaxonomyDefTranslations, handleTaxonomyGet } from "#api/handlers/taxonomies.js";
|
|
15
|
+
import { isParseError, parseQuery } from "#api/parse.js";
|
|
16
|
+
import { localeFilterQuery } from "#api/schemas.js";
|
|
17
|
+
|
|
18
|
+
export const prerender = false;
|
|
19
|
+
|
|
20
|
+
export const GET: APIRoute = async ({ params, request, locals }) => {
|
|
21
|
+
const { emdash, user } = locals;
|
|
22
|
+
const { name } = params;
|
|
23
|
+
if (!name) return apiError("VALIDATION_ERROR", "Taxonomy name required", 400);
|
|
24
|
+
|
|
25
|
+
const dbErr = requireDb(emdash?.db);
|
|
26
|
+
if (dbErr) return dbErr;
|
|
27
|
+
|
|
28
|
+
const denied = requirePerm(user, "taxonomies:read");
|
|
29
|
+
if (denied) return denied;
|
|
30
|
+
|
|
31
|
+
const query = parseQuery(new URL(request.url), localeFilterQuery);
|
|
32
|
+
if (isParseError(query)) return query;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
// Any locale's row will do — they share the translation_group the list is
|
|
36
|
+
// built from.
|
|
37
|
+
const anchor = await handleTaxonomyGet(emdash.db, name, { locale: query.locale });
|
|
38
|
+
if (!anchor.success) return unwrapResult(anchor);
|
|
39
|
+
const result = await handleTaxonomyDefTranslations(emdash.db, anchor.data.taxonomy.id);
|
|
40
|
+
return unwrapResult(result);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
return handleError(
|
|
43
|
+
error,
|
|
44
|
+
"Failed to list taxonomy translations",
|
|
45
|
+
"TAXONOMY_TRANSLATIONS_ERROR",
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
};
|