emdash 0.32.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-C0ONzkUP.d.mts → adapters-34EN2eXO.d.mts} +34 -2
- package/dist/adapters-34EN2eXO.d.mts.map +1 -0
- package/dist/after-CBU2vkoO.mjs +96 -0
- package/dist/after-CBU2vkoO.mjs.map +1 -0
- package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-DW7sYyqg.mjs} +2 -2
- package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-DW7sYyqg.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +26 -25
- 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-DgPbMlng.mjs → api-DdAsirBe.mjs} +321 -428
- package/dist/api-DdAsirBe.mjs.map +1 -0
- package/dist/{api-tokens-p-iMzvXR.mjs → api-tokens-CFXu8F_2.mjs} +2 -2
- package/dist/{api-tokens-p-iMzvXR.mjs.map → api-tokens-CFXu8F_2.mjs.map} +1 -1
- package/dist/{apply-1_6ra7NP.mjs → apply-D5zfeD09.mjs} +139 -102
- 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 +103 -35
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +9 -9
- 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 +13 -10
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +5 -5
- 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 +1915 -223
- 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 +20 -20
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +20 -20
- package/dist/astro/routes/api/admin/bylines/index.mjs +20 -20
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +18 -17
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- 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 +56 -47
- 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 +56 -47
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
- 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 +52 -46
- 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 +55 -46
- 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 +55 -46
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
- 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 +52 -46
- 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 +55 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
- 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 +55 -46
- 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 +56 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +52 -46
- 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 +56 -47
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
- 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 +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +10 -9
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- 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 +8 -8
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +13 -12
- 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 +14 -13
- 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 +4 -4
- 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 +15 -14
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +14 -13
- 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 +20 -19
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +17 -16
- 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 +15 -15
- 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 +21 -20
- 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 +21 -20
- 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 +47 -34
- 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 +12 -10
- 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 +22 -20
- 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 +18 -18
- 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 +15 -15
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -20
- 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 +32 -31
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +6 -6
- 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 +14 -12
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +7 -7
- 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 +19 -16
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/items.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_.mjs +13 -13
- package/dist/astro/routes/api/menus/index.mjs +13 -13
- 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 +183 -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 +14 -13
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +14 -13
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +16 -14
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +16 -14
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +21 -20
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +16 -15
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +21 -20
- 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 +52 -46
- 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 +52 -46
- 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 +52 -46
- 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 +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +14 -11
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.d.mts +1 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +19 -15
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +13 -13
- package/dist/astro/routes/api/search/rebuild.mjs +15 -15
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +9 -9
- package/dist/astro/routes/api/search/suggest.mjs +13 -13
- package/dist/astro/routes/api/sections/_slug_.mjs +13 -12
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +13 -12
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +18 -17
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +15 -14
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +34 -32
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +36 -34
- 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 +10 -10
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +44 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +19 -18
- 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 +21 -19
- 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 +19 -18
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- 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 +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +8 -7
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +13 -12
- 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 +11 -10
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +14 -14
- package/dist/astro/routes/sitemap.xml.mjs +12 -11
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +41 -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-R5iYYrpa.mjs → authorize-1iFJzPaZ.mjs} +2 -2
- package/dist/{authorize-R5iYYrpa.mjs.map → authorize-1iFJzPaZ.mjs.map} +1 -1
- package/dist/{backup-LpQ1V_sR.mjs → backup-LHjIAVNP.mjs} +5 -5
- package/dist/{backup-LpQ1V_sR.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-T9ZLZMxJ.mjs → byline-fields-C5S8wygO.mjs} +2 -2
- package/dist/{byline-fields-T9ZLZMxJ.mjs.map → byline-fields-C5S8wygO.mjs.map} +1 -1
- package/dist/{byline-C5TAqs8N.mjs → byline-pEcoDps8.mjs} +9 -9
- package/dist/{byline-C5TAqs8N.mjs.map → byline-pEcoDps8.mjs.map} +1 -1
- package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-DDun8sxh.mjs} +4 -4
- package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-DDun8sxh.mjs.map} +1 -1
- package/dist/{bylines-B8-WGdja.mjs → bylines-BWemdX2k.mjs} +8 -8
- package/dist/{bylines-B8-WGdja.mjs.map → bylines-BWemdX2k.mjs.map} +1 -1
- package/dist/{bylines-DGuqBLjV.mjs → bylines-DJfSfXCL.mjs} +5 -5
- package/dist/{bylines-DGuqBLjV.mjs.map → bylines-DJfSfXCL.mjs.map} +1 -1
- package/dist/cache-CBJaDy_E.mjs +108 -0
- package/dist/cache-CBJaDy_E.mjs.map +1 -0
- package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-CZyFVaad.mjs} +1 -1
- package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-CZyFVaad.mjs.map} +1 -1
- package/dist/{chunks-D5dlPeRb.mjs → chunks-DfPax1I0.mjs} +2 -2
- package/dist/{chunks-D5dlPeRb.mjs.map → chunks-DfPax1I0.mjs.map} +1 -1
- package/dist/cli/index.mjs +193 -707
- 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-DnTxxVHv.mjs → comment-Dxlep6cE.mjs} +3 -3
- package/dist/{comment-DnTxxVHv.mjs.map → comment-Dxlep6cE.mjs.map} +1 -1
- package/dist/{comment-reaction-BUlUz2bh.mjs → comment-reaction-D6qfHKBc.mjs} +2 -2
- package/dist/{comment-reaction-BUlUz2bh.mjs.map → comment-reaction-D6qfHKBc.mjs.map} +1 -1
- package/dist/{comments-QPKgK3nk.mjs → comments-CTOuhTSX.mjs} +3 -3
- package/dist/{comments-QPKgK3nk.mjs.map → comments-CTOuhTSX.mjs.map} +1 -1
- package/dist/{components-DZkL4Fx0.mjs → components-CQy3lh9x.mjs} +1 -1
- package/dist/{components-DZkL4Fx0.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-CpfKV9QE.mjs → content-BNfwh7xX.mjs} +667 -183
- 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-kO4YZB03.mjs → context-DRgOvSnW.mjs} +28 -20
- package/dist/context-DRgOvSnW.mjs.map +1 -0
- package/dist/{cron-BlKIMD_e.mjs → cron-Y9aLtgrA.mjs} +1 -1
- package/dist/{cron-BlKIMD_e.mjs.map → cron-Y9aLtgrA.mjs.map} +1 -1
- package/dist/{dashboard-DoBwPnON.mjs → dashboard-CB8J89rJ.mjs} +45 -11
- package/dist/dashboard-CB8J89rJ.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +3 -3
- 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-C4v9KP56.mjs → default-DdDl3fxv.mjs} +1 -1
- package/dist/{default-C4v9KP56.mjs.map → default-DdDl3fxv.mjs.map} +1 -1
- package/dist/deferred-tasks-BMsa9F64.d.mts +9 -0
- package/dist/deferred-tasks-BMsa9F64.d.mts.map +1 -0
- package/dist/{device-flow-DhUsyJU6.mjs → device-flow-CaioYGK3.mjs} +5 -5
- package/dist/{device-flow-DhUsyJU6.mjs.map → device-flow-CaioYGK3.mjs.map} +1 -1
- package/dist/{dialect-helpers-DFwyWjTM.mjs → dialect-helpers-BSbfaO3F.mjs} +24 -16
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
- package/dist/dist-D_6CKR8z.mjs +810 -0
- package/dist/dist-D_6CKR8z.mjs.map +1 -0
- package/dist/{email-console-C-9Ng8DM.mjs → email-console-BHNjIwiB.mjs} +1 -1
- package/dist/{email-console-C-9Ng8DM.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-DmmN74gW.mjs → error-DupyJZE2.mjs} +3 -3
- package/dist/{error-DmmN74gW.mjs.map → error-DupyJZE2.mjs.map} +1 -1
- package/dist/{errors-DtEXIQQV.mjs → errors-CLUPm7aD.mjs} +15 -2
- package/dist/errors-CLUPm7aD.mjs.map +1 -0
- package/dist/{escape-CdW31WsG.mjs → escape-C_aLKP3H.mjs} +1 -1
- package/dist/{escape-CdW31WsG.mjs.map → escape-C_aLKP3H.mjs.map} +1 -1
- package/dist/{field-defs-cache-QMVnzTH6.mjs → field-defs-cache-hg6QkjV9.mjs} +5 -5
- package/dist/{field-defs-cache-QMVnzTH6.mjs.map → field-defs-cache-hg6QkjV9.mjs.map} +1 -1
- package/dist/{fts-manager-vncsZIJm.mjs → fts-manager-CZ-5dVwJ.mjs} +111 -61
- package/dist/fts-manager-CZ-5dVwJ.mjs.map +1 -0
- package/dist/{hash-Cb7U1b5M.mjs → hash-Cg0TXJPV.mjs} +1 -1
- package/dist/{hash-Cb7U1b5M.mjs.map → hash-Cg0TXJPV.mjs.map} +1 -1
- package/dist/{hreflang-CZbSx6Bg.d.mts → hreflang-D3Uehfv2.d.mts} +2 -2
- package/dist/{hreflang-CZbSx6Bg.d.mts.map → hreflang-D3Uehfv2.d.mts.map} +1 -1
- package/dist/{hreflang-Bg-zMpkr.mjs → hreflang-DNswoYsi.mjs} +7 -7
- package/dist/{hreflang-Bg-zMpkr.mjs.map → hreflang-DNswoYsi.mjs.map} +1 -1
- package/dist/{import-PKhLeXvn.mjs → import-B41u8Rot.mjs} +7 -7
- package/dist/{import-PKhLeXvn.mjs.map → import-B41u8Rot.mjs.map} +1 -1
- package/dist/{index-j9rTh3cp.d.mts → index-C3Y-rsyN.d.mts} +286 -93
- package/dist/index-C3Y-rsyN.d.mts.map +1 -0
- package/dist/{index-BeNto_Vs.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 +79 -71
- 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-BwTdWE8B.mjs → load-DmvJrtxS.mjs} +2 -2
- package/dist/{load-BwTdWE8B.mjs.map → load-DmvJrtxS.mjs.map} +1 -1
- package/dist/{loader-C1XOLV5b.mjs → loader-DLBqRiGP.mjs} +120 -64
- package/dist/loader-DLBqRiGP.mjs.map +1 -0
- package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-BXbUAHod.mjs} +1 -1
- package/dist/{manifest-schema-bCq54i7F.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 +10 -9
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-DWIzoVFL.mjs → media-BWWWb8kg.mjs} +92 -3
- package/dist/media-BWWWb8kg.mjs.map +1 -0
- package/dist/{media-tQDZEdu7.mjs → media-CzhAn2--.mjs} +2 -2
- package/dist/{media-tQDZEdu7.mjs.map → media-CzhAn2--.mjs.map} +1 -1
- package/dist/{media-allowlist-B7TPD6aq.mjs → media-allowlist-BD6HhgXA.mjs} +14 -3
- package/dist/media-allowlist-BD6HhgXA.mjs.map +1 -0
- package/dist/{media-upload-Bc9Nc5Zf.mjs → media-upload-9yas9zGH.mjs} +11 -9
- package/dist/{media-upload-Bc9Nc5Zf.mjs.map → media-upload-9yas9zGH.mjs.map} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs → media-url-BvoX88FA.mjs} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs.map → media-url-BvoX88FA.mjs.map} +1 -1
- package/dist/{media-usage-DPJcNaAq.mjs → media-usage-De3qvwjc.mjs} +138 -61
- 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-C6qhqP4X.mjs → menus-CC-yn1F9.mjs} +554 -121
- package/dist/menus-CC-yn1F9.mjs.map +1 -0
- package/dist/{menus-BxPLFfIc.mjs → menus-fxvEDYE6.mjs} +5 -5
- package/dist/{menus-BxPLFfIc.mjs.map → menus-fxvEDYE6.mjs.map} +1 -1
- package/dist/{mode-fiXRMfeA.mjs → mode-Bpe-tNNy.mjs} +1 -1
- package/dist/{mode-fiXRMfeA.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-C9tFinly.mjs → oauth-authorization-BXO1MKej.mjs} +5 -5
- package/dist/{oauth-authorization-C9tFinly.mjs.map → oauth-authorization-BXO1MKej.mjs.map} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs → oauth-clients-C_DNqtRu.mjs} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs.map → oauth-clients-C_DNqtRu.mjs.map} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs → oauth-state-store-DwAxMtk4.mjs} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs.map → oauth-state-store-DwAxMtk4.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs → oauth-user-lookup-BxfZizdk.mjs} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs.map → oauth-user-lookup-BxfZizdk.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
- package/dist/object-cache-71tPfV4A.mjs.map +1 -0
- package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
- package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
- package/dist/{options-aeIs8WFu.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-BL49yb9D.mjs → parse-DFbuc-Fh.mjs} +2 -2
- package/dist/{parse-BL49yb9D.mjs.map → parse-DFbuc-Fh.mjs.map} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs → passkey-config-_2GOwwK8.mjs} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs.map → passkey-config-_2GOwwK8.mjs.map} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts → placeholder-CzW7Lshs.d.mts} +1 -1
- package/dist/{placeholder-Dxo5Zt58.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-CNahFfj6.mjs → portable-text-DhKbDAGr.mjs} +1 -1
- package/dist/{portable-text-CNahFfj6.mjs.map → portable-text-DhKbDAGr.mjs.map} +1 -1
- package/dist/{preview-D4Jnbfx7.mjs → preview-PW-nOnq4.mjs} +2 -2
- package/dist/{preview-D4Jnbfx7.mjs.map → preview-PW-nOnq4.mjs.map} +1 -1
- package/dist/{public-url-DSGTnJFw.mjs → public-url-CWoFhQT8.mjs} +14 -3
- package/dist/public-url-CWoFhQT8.mjs.map +1 -0
- package/dist/{query-DCiXI7OZ.mjs → query-BgjfiLUQ.mjs} +38 -77
- package/dist/query-BgjfiLUQ.mjs.map +1 -0
- package/dist/{query-1xOcEy18.mjs → query-vgZNwIhh.mjs} +4 -4
- package/dist/{query-1xOcEy18.mjs.map → query-vgZNwIhh.mjs.map} +1 -1
- package/dist/{rate-limit-Vkp9gQ1Y.mjs → rate-limit-L5anykgo.mjs} +2 -2
- package/dist/{rate-limit-Vkp9gQ1Y.mjs.map → rate-limit-L5anykgo.mjs.map} +1 -1
- package/dist/{redirect-BJ6d1yHh.mjs → redirect-COsS6SWJ.mjs} +3 -3
- package/dist/{redirect-BJ6d1yHh.mjs.map → redirect-COsS6SWJ.mjs.map} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs → redirect-KBNE3UEs.mjs} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs.map → redirect-KBNE3UEs.mjs.map} +1 -1
- package/dist/{redirects-Cwkq2H-G.mjs → redirects-CufRQt0Q.mjs} +5 -5
- package/dist/{redirects-Cwkq2H-G.mjs.map → redirects-CufRQt0Q.mjs.map} +1 -1
- package/dist/{redirects-BOn2DIUs.mjs → redirects-cV9g7V-0.mjs} +149 -16
- 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-DJ5DZh7B.mjs → relation-DtmAQH7s.mjs} +3 -3
- package/dist/{relation-DJ5DZh7B.mjs.map → relation-DtmAQH7s.mjs.map} +1 -1
- package/dist/{relations-C4duJnwI.mjs → relations-BBApI4e2.mjs} +3 -3
- package/dist/{relations-C4duJnwI.mjs.map → relations-BBApI4e2.mjs.map} +1 -1
- package/dist/{relations-DpTjftCl.mjs → relations-DICSyfsh.mjs} +6 -6
- package/dist/{relations-DpTjftCl.mjs.map → relations-DICSyfsh.mjs.map} +1 -1
- package/dist/{relations-DHFQGX0h.d.mts → relations-DItI3MN9.d.mts} +401 -40
- package/dist/relations-DItI3MN9.d.mts.map +1 -0
- package/dist/request-context.d.mts +3 -0
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{request-meta-DzXYYI-n.mjs → request-meta-DgZJh3zG.mjs} +2 -2
- package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-DgZJh3zG.mjs.map} +1 -1
- package/dist/{resolve-BUvFE0Lr.mjs → resolve-DOhVEvty.mjs} +2 -2
- package/dist/{resolve-BUvFE0Lr.mjs.map → resolve-DOhVEvty.mjs.map} +1 -1
- package/dist/{runner-BsI18UgP.mjs → runner-BiDvq5dv.mjs} +1404 -235
- package/dist/runner-BiDvq5dv.mjs.map +1 -0
- package/dist/{runner-CHdkERbt.d.mts → runner-CgQbELYC.d.mts} +2 -2
- package/dist/{runner-CHdkERbt.d.mts.map → runner-CgQbELYC.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +5 -4
- package/dist/runtime.mjs.map +1 -1
- package/dist/{schema-eqZhkR0S.mjs → schema-BFyTg38T.mjs} +3 -3
- package/dist/{schema-eqZhkR0S.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-Be2d8bSb.mjs → scopes-BVeuhGBE.mjs} +3 -3
- package/dist/{scopes-Be2d8bSb.mjs.map → scopes-BVeuhGBE.mjs.map} +1 -1
- package/dist/{search-CeO678cp.mjs → search-BpuPKZb0.mjs} +26 -16
- package/dist/search-BpuPKZb0.mjs.map +1 -0
- package/dist/{secrets-870d-7yA.mjs → secrets-dtYs2hDo.mjs} +5 -5
- package/dist/{secrets-870d-7yA.mjs.map → secrets-dtYs2hDo.mjs.map} +1 -1
- package/dist/{sections-DSuEfirn.mjs → sections-COctk6hf.mjs} +3 -3
- package/dist/{sections-DSuEfirn.mjs.map → sections-COctk6hf.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +28 -26
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +20 -19
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-C3GDfT0V.mjs → seo-AFpVvTqr.mjs} +6 -4
- package/dist/seo-AFpVvTqr.mjs.map +1 -0
- package/dist/{seo-BAPKiED8.mjs → seo-CvDxfvFb.mjs} +3 -3
- package/dist/{seo-BAPKiED8.mjs.map → seo-CvDxfvFb.mjs.map} +1 -1
- package/dist/{service-DyFT-k-R.mjs → service-xMiMSTsR.mjs} +4 -4
- package/dist/{service-DyFT-k-R.mjs.map → service-xMiMSTsR.mjs.map} +1 -1
- package/dist/{session-user-BrK2zz7S.mjs → session-user-BzVemLkw.mjs} +2 -2
- package/dist/{session-user-BrK2zz7S.mjs.map → session-user-BzVemLkw.mjs.map} +1 -1
- package/dist/{settings-DgKouY2S.mjs → settings-B372MV0p.mjs} +7 -7
- package/dist/{settings-DgKouY2S.mjs.map → settings-B372MV0p.mjs.map} +1 -1
- package/dist/{settings-CREKyj8I.mjs → settings-BE9aqn_9.mjs} +3 -3
- package/dist/{settings-CREKyj8I.mjs.map → settings-BE9aqn_9.mjs.map} +1 -1
- package/dist/{setup-complete-L7bMK2VI.mjs → setup-complete-DF7TAfD5.mjs} +2 -2
- package/dist/{setup-complete-L7bMK2VI.mjs.map → setup-complete-DF7TAfD5.mjs.map} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs → setup-nonce-Do-U_cg9.mjs} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs.map → setup-nonce-Do-U_cg9.mjs.map} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-B0eLKS6K.mjs} +2 -2
- package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-B0eLKS6K.mjs.map} +1 -1
- package/dist/site-url-Bowsi9T-.mjs +16 -0
- package/dist/site-url-Bowsi9T-.mjs.map +1 -0
- package/dist/slugify-B994zkXC.mjs +17 -0
- package/dist/slugify-B994zkXC.mjs.map +1 -0
- package/dist/{snapshot-BdpUJKD-.mjs → snapshot-B5h6aPMh.mjs} +2 -2
- package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-B5h6aPMh.mjs.map} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs → ssrf-Cpvg_n3A.mjs} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-Cpvg_n3A.mjs.map} +1 -1
- package/dist/{state-xxv6ZTMv.mjs → state-DYwPue40.mjs} +1 -1
- package/dist/{state-xxv6ZTMv.mjs.map → state-DYwPue40.mjs.map} +1 -1
- package/dist/{status-COfycGIU.mjs → status-CWVYpbD8.mjs} +1 -1
- package/dist/{status-COfycGIU.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-B61CRSha.mjs → taxonomies-B0o9ExNV.mjs} +85 -75
- package/dist/taxonomies-B0o9ExNV.mjs.map +1 -0
- package/dist/{taxonomies-Dbdki3Un.mjs → taxonomies-Dk3MAklL.mjs} +360 -56
- package/dist/taxonomies-Dk3MAklL.mjs.map +1 -0
- package/dist/taxonomy-CPeM8d2o.mjs +484 -0
- package/dist/taxonomy-CPeM8d2o.mjs.map +1 -0
- package/dist/{tokens-DVltpO2D.mjs → tokens-C39klX8R.mjs} +2 -2
- package/dist/{tokens-DVltpO2D.mjs.map → tokens-C39klX8R.mjs.map} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
- package/dist/{transport-BWQo0Foy.mjs → transport--CfOflrp.mjs} +1 -1
- package/dist/{transport-BWQo0Foy.mjs.map → transport--CfOflrp.mjs.map} +1 -1
- package/dist/{transport-DokJOScS.d.mts → transport-B_rfeU-a.d.mts} +1 -1
- package/dist/{transport-DokJOScS.d.mts.map → transport-B_rfeU-a.d.mts.map} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-CEVekpby.mjs} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-CEVekpby.mjs.map} +1 -1
- package/dist/{types-o7xo7VgH.mjs → types-75KIqzL9.mjs} +20 -3
- package/dist/types-75KIqzL9.mjs.map +1 -0
- package/dist/{types-C9P3ysxq.d.mts → types-BPuloofb.d.mts} +1 -1
- package/dist/{types-C9P3ysxq.d.mts.map → types-BPuloofb.d.mts.map} +1 -1
- package/dist/{types-BD40g7zz.mjs → types-BW1syrlw.mjs} +1 -1
- package/dist/{types-BD40g7zz.mjs.map → types-BW1syrlw.mjs.map} +1 -1
- package/dist/{types-jISEalTX.d.mts → types-C3_AbkDP.d.mts} +53 -10
- package/dist/types-C3_AbkDP.d.mts.map +1 -0
- package/dist/{types-84Bque3-.d.mts → types-CAGdePf3.d.mts} +133 -1
- package/dist/types-CAGdePf3.d.mts.map +1 -0
- package/dist/{types-CcSZCcF1.d.mts → types-CFUfyt1s.d.mts} +1 -1
- package/dist/{types-CcSZCcF1.d.mts.map → types-CFUfyt1s.d.mts.map} +1 -1
- package/dist/{types-DQLZ58GV.d.mts → types-CPx2lIGo.d.mts} +1 -1
- package/dist/{types-DQLZ58GV.d.mts.map → types-CPx2lIGo.d.mts.map} +1 -1
- package/dist/{types-XrQQ-Aex.mjs → types-CQPWhPxE.mjs} +15 -11
- package/dist/types-CQPWhPxE.mjs.map +1 -0
- package/dist/{types-BQY7VYw6.d.mts → types-Cs-TFLNf.d.mts} +28 -8
- package/dist/types-Cs-TFLNf.d.mts.map +1 -0
- package/dist/types-CtzytVXn.mjs +18 -0
- package/dist/types-CtzytVXn.mjs.map +1 -0
- package/dist/{types-DqZVPILm.d.mts → types-D4_1Ga4L.d.mts} +44 -5
- package/dist/types-D4_1Ga4L.d.mts.map +1 -0
- package/dist/{types-Dr2GLlwu.d.mts → types-DefV3OiO.d.mts} +1 -1
- package/dist/{types-Dr2GLlwu.d.mts.map → types-DefV3OiO.d.mts.map} +1 -1
- package/dist/{types-DsAMyD_o.d.mts → types-X0MThr7x.d.mts} +1 -1
- package/dist/{types-DsAMyD_o.d.mts.map → types-X0MThr7x.d.mts.map} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.mjs → upload-attempts-hlne3iA1.mjs} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.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-BAumEmpA.mjs → user-sHgJ62SP.mjs} +3 -3
- package/dist/{user-BAumEmpA.mjs.map → user-sHgJ62SP.mjs.map} +1 -1
- package/dist/{utils-BbUgmeZG.mjs → utils-D4vD_Y98.mjs} +3 -3
- package/dist/{utils-BbUgmeZG.mjs.map → utils-D4vD_Y98.mjs.map} +1 -1
- package/dist/{validate-Bs_wT2ul.mjs → validate-BkqIG_Uj.mjs} +24 -5
- package/dist/validate-BkqIG_Uj.mjs.map +1 -0
- package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
- package/dist/validate-BpwoDOgt.mjs.map +1 -0
- package/dist/{validate-CdYcY-Ln.d.mts → validate-DeGtBN84.d.mts} +25 -7
- package/dist/validate-DeGtBN84.d.mts.map +1 -0
- package/dist/{validation-BngR0nit.mjs → validation-CiJb_X5o.mjs} +14 -13
- package/dist/{validation-BngR0nit.mjs.map → validation-CiJb_X5o.mjs.map} +1 -1
- package/dist/version-x0NjTScG.mjs +7 -0
- package/dist/{version-Bdfb34kk.mjs.map → version-x0NjTScG.mjs.map} +1 -1
- package/dist/{widgets-L-VndTKD.mjs → widgets-Cwzvww0W.mjs} +3 -3
- package/dist/{widgets-L-VndTKD.mjs.map → widgets-Cwzvww0W.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts → wxr-taxonomies-CmC0ZsDr.d.mts} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts.map → wxr-taxonomies-CmC0ZsDr.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-BexjtNid.mjs → wxr-taxonomies-QZjWxjyk.mjs} +13 -32
- package/dist/{wxr-taxonomies-BexjtNid.mjs.map → wxr-taxonomies-QZjWxjyk.mjs.map} +1 -1
- package/dist/{zod-generator-DMzfga3g.mjs → zod-generator-D11MhxG4.mjs} +53 -6
- package/dist/zod-generator-D11MhxG4.mjs.map +1 -0
- package/package.json +18 -7
- package/src/after.ts +6 -1
- package/src/api/errors.ts +13 -0
- package/src/api/handlers/content.ts +172 -33
- 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/marketplace.ts +14 -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/registry.ts +14 -0
- package/src/api/handlers/revision.ts +19 -5
- package/src/api/handlers/schema.ts +46 -3
- package/src/api/handlers/seo.ts +5 -2
- package/src/api/handlers/snapshot.ts +1 -1
- package/src/api/handlers/taxonomies.ts +446 -83
- package/src/api/media-usage-write-fence.ts +64 -0
- package/src/api/openapi/document.ts +247 -0
- package/src/api/public-url.ts +14 -2
- 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 +91 -3
- package/src/api/schemas/search.ts +2 -0
- package/src/api/schemas/taxonomies.ts +58 -8
- package/src/api/site-url.ts +16 -6
- package/src/api/types.ts +1 -0
- package/src/astro/integration/index.ts +55 -42
- package/src/astro/integration/routes.ts +48 -4
- package/src/astro/integration/runtime.ts +28 -0
- package/src/astro/integration/virtual-modules.ts +27 -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 +14 -12
- package/src/astro/middleware/scoped-db.ts +35 -4
- package/src/astro/middleware.ts +131 -30
- package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
- 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/admin/users/[id]/send-recovery.ts +2 -2
- package/src/astro/routes/api/auth/invite/index.ts +2 -2
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
- 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/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +2 -0
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
- 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 +31 -4
- package/src/cleanup.ts +25 -26
- package/src/cli/commands/dev.ts +13 -3
- package/src/cli/commands/doctor.ts +193 -6
- package/src/cli/commands/export-seed.ts +6 -1
- package/src/cli/index.ts +1 -1
- package/src/client/index.ts +119 -0
- package/src/components/Block.astro +12 -0
- package/src/components/CommentForm.astro +1 -1
- package/src/components/Comments.astro +1 -1
- package/src/components/InlinePortableTextEditor.tsx +260 -32
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +26 -4
- package/src/components/index.ts +12 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/content/converters/mark-safety.ts +120 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +84 -25
- package/src/content/converters/prosemirror-to-portable-text.ts +35 -14
- package/src/content/converters/types.ts +2 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/content-list-query.ts +29 -0
- package/src/database/dialect-helpers.ts +3 -22
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -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 +32 -0
- package/src/database/repositories/content.ts +1051 -273
- 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 +98 -22
- package/src/database/repositories/taxonomy.ts +429 -103
- package/src/database/repositories/types.ts +58 -2
- package/src/database/types.ts +147 -17
- package/src/database/validate.ts +39 -0
- package/src/db/adapters.ts +36 -0
- package/src/db/index.ts +3 -0
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +493 -110
- 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 +27 -2
- package/src/loader.ts +165 -89
- 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/gc.ts +50 -0
- 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/object-cache/index.ts +160 -3
- 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 +77 -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/storage-indexes.ts +50 -11
- package/src/plugins/types.ts +39 -2
- package/src/query.ts +50 -79
- package/src/redirects/cache.ts +79 -19
- package/src/request-context.ts +3 -0
- package/src/scheduled-publish.ts +6 -1
- package/src/scheduler-health.ts +46 -0
- package/src/schema/registry.ts +863 -249
- package/src/schema/types.ts +74 -8
- package/src/schema/url-pattern.ts +33 -0
- package/src/schema/zod-generator.ts +77 -5
- package/src/search/fts-manager.ts +167 -86
- package/src/search/index.ts +2 -0
- package/src/search/query.ts +32 -11
- package/src/search/types.ts +8 -0
- package/src/seed/apply.ts +89 -16
- package/src/seed/types.ts +21 -3
- package/src/seed/validate.ts +52 -2
- package/src/taxonomies/index.ts +88 -82
- package/src/taxonomies/term-counts.ts +23 -12
- package/src/ui-comments.ts +19 -0
- package/src/ui.ts +11 -3
- package/src/utils/slugify.ts +1 -29
- package/src/virtual-modules.d.ts +24 -0
- package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
- package/dist/after-B1IIdH3Y.mjs +0 -29
- package/dist/after-B1IIdH3Y.mjs.map +0 -1
- package/dist/api-DgPbMlng.mjs.map +0 -1
- package/dist/apply-1_6ra7NP.mjs.map +0 -1
- package/dist/cache-B26cufFd.mjs +0 -65
- package/dist/cache-B26cufFd.mjs.map +0 -1
- package/dist/config-DyF3OKg_.mjs.map +0 -1
- package/dist/content-CpfKV9QE.mjs.map +0 -1
- package/dist/content-refresh-DgqUBeTv.mjs +0 -1629
- package/dist/content-refresh-DgqUBeTv.mjs.map +0 -1
- package/dist/context-kO4YZB03.mjs.map +0 -1
- package/dist/dashboard-DoBwPnON.mjs.map +0 -1
- package/dist/dialect-helpers-DFwyWjTM.mjs.map +0 -1
- package/dist/errors-DtEXIQQV.mjs.map +0 -1
- package/dist/fts-manager-vncsZIJm.mjs.map +0 -1
- package/dist/index-BeNto_Vs.d.mts.map +0 -1
- package/dist/index-j9rTh3cp.d.mts.map +0 -1
- package/dist/loader-C1XOLV5b.mjs.map +0 -1
- package/dist/media-DWIzoVFL.mjs.map +0 -1
- package/dist/media-allowlist-B7TPD6aq.mjs.map +0 -1
- package/dist/media-usage-DPJcNaAq.mjs.map +0 -1
- package/dist/menus-C6qhqP4X.mjs.map +0 -1
- package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
- package/dist/options-aeIs8WFu.d.mts.map +0 -1
- package/dist/public-url-DSGTnJFw.mjs.map +0 -1
- package/dist/query-DCiXI7OZ.mjs.map +0 -1
- package/dist/redirects-BOn2DIUs.mjs.map +0 -1
- package/dist/registry-BP1JK2xh.mjs +0 -795
- package/dist/registry-BP1JK2xh.mjs.map +0 -1
- package/dist/relations-DHFQGX0h.d.mts.map +0 -1
- package/dist/runner-BsI18UgP.mjs.map +0 -1
- package/dist/search-CeO678cp.mjs.map +0 -1
- package/dist/seo-C3GDfT0V.mjs.map +0 -1
- package/dist/site-url-8N3kSyVZ.mjs +0 -13
- package/dist/site-url-8N3kSyVZ.mjs.map +0 -1
- package/dist/slugify-C_tqlU4G.mjs +0 -30
- package/dist/slugify-C_tqlU4G.mjs.map +0 -1
- package/dist/taxonomies-B61CRSha.mjs.map +0 -1
- package/dist/taxonomies-Dbdki3Un.mjs.map +0 -1
- package/dist/taxonomy-DvwWAPvA.mjs +0 -304
- package/dist/taxonomy-DvwWAPvA.mjs.map +0 -1
- package/dist/types-84Bque3-.d.mts.map +0 -1
- package/dist/types-BQY7VYw6.d.mts.map +0 -1
- package/dist/types-DqZVPILm.d.mts.map +0 -1
- package/dist/types-XrQQ-Aex.mjs.map +0 -1
- package/dist/types-jISEalTX.d.mts.map +0 -1
- package/dist/types-o7xo7VgH.mjs.map +0 -1
- package/dist/validate-Bs_wT2ul.mjs.map +0 -1
- package/dist/validate-CdYcY-Ln.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/version-Bdfb34kk.mjs +0 -7
- package/dist/zod-generator-DMzfga3g.mjs.map +0 -1
- /package/dist/{api-tokens-CEsW_jCg.mjs → api-tokens-CyTsLszZ.mjs} +0 -0
- /package/dist/{ssrf-BB__xfNM.mjs → ssrf-DpXgKsna.mjs} +0 -0
- /package/dist/{types-CK0LxPUQ.mjs → types-CP1CflWf.mjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-cache-Bok5j2ae.mjs","names":[],"sources":["../src/object-cache/codec.ts","../src/object-cache/index.ts"],"sourcesContent":["/**\n * Object-cache serialization codec.\n *\n * Cached values are JSON, with one extension: `Date` instances are preserved\n * across the round-trip. EmDash content entries carry `Date` objects for the\n * system timestamp columns (`createdAt`, `updatedAt`, `publishedAt`,\n * `scheduledAt`) and on `cacheHint.lastModified`; plain `JSON.stringify` would\n * silently flatten those to ISO strings, so a value read from cache would no\n * longer be `=== instanceof Date` and downstream `value instanceof Date`\n * branches (cursor encoding, scheduled-visibility checks) would diverge from a\n * fresh database read.\n *\n * Functions and symbol-keyed properties are NOT preserved — callers that cache\n * values carrying either (e.g. content entries with their `.edit` proxy and\n * the non-enumerable `CURSOR_RAW_VALUES` symbol) must reduce to a serializable\n * snapshot before caching and rebuild the non-serializable parts on read. See\n * `query.ts` content snapshot helpers.\n */\n\n/** Tag used to mark a serialized `Date`. Deliberately unlikely to collide. */\nconst DATE_TAG = \"$$emdashDate\";\n\ninterface TaggedDate {\n\t[DATE_TAG]: string;\n}\n\nfunction isTaggedDate(value: unknown): value is TaggedDate {\n\tif (typeof value !== \"object\" || value === null) return false;\n\t// encode() always emits the tag as the object's *only* key, so requiring\n\t// exactly one key keeps a user object that merely happens to carry a\n\t// `$$emdashDate` string alongside other fields from being collapsed to a\n\t// Date (which would silently drop those other fields).\n\tconst keys = Object.keys(value);\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- narrowing a JSON-parsed value to read the date tag\n\treturn keys.length === 1 && typeof (value as Record<string, unknown>)[DATE_TAG] === \"string\";\n}\n\n/**\n * Serialize a value to a cache string, preserving `Date` instances.\n *\n * Uses the JSON replacer's `this` binding to inspect the *original* property\n * value: `JSON.stringify` invokes `Date.prototype.toJSON` before the replacer\n * sees it, so by the time `value` arrives it is already an ISO string. Reading\n * `this[key]` recovers the live `Date` so we can tag it.\n */\nexport function encode(value: unknown): string {\n\treturn JSON.stringify(value, function (this: Record<string, unknown>, key, val) {\n\t\tconst original = this[key];\n\t\tif (original instanceof Date) {\n\t\t\treturn { [DATE_TAG]: original.toISOString() } satisfies TaggedDate;\n\t\t}\n\t\treturn val;\n\t});\n}\n\n/**\n * Parse a cache string produced by {@link encode}, rehydrating tagged `Date`s.\n *\n * Returns `undefined` if the input is not valid JSON (treated as a cache miss\n * by the read-through layer rather than throwing).\n */\nexport function decode(raw: string): unknown {\n\ttry {\n\t\treturn JSON.parse(raw, (_key, value) => {\n\t\t\tif (isTaggedDate(value)) {\n\t\t\t\treturn new Date(value[DATE_TAG]);\n\t\t\t}\n\t\t\treturn value;\n\t\t});\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n","/**\n * Object cache — distributed read-through query cache.\n *\n * Layering (per query):\n *\n * requestCached → in-request dedupe (per render, WeakMap on ALS context)\n * cachedQuery → THIS layer: distributed L2 (KV / memory), epoch-keyed\n * database → source of truth\n *\n * Optional and off by default: when no `objectCache` descriptor is configured,\n * `virtual:emdash/object-cache` exports `createObjectCache = undefined`,\n * {@link getBackend} resolves to `null`, and {@link cachedQuery} is a\n * transparent passthrough to its `load` function. Configure with\n * `memoryCache()` (Node) or `kvCache()` from `@emdash-cms/cloudflare`.\n *\n * Invalidation is epoch-based: each cache key embeds a per-namespace epoch\n * (\"last changed\" marker) read from the backend. A write calls\n * {@link invalidateObjectCache}, which stamps the namespace epoch to\n * `Date.now()`; every previously-stored key for that namespace is instantly\n * orphaned and reclaimed by its TTL. This is O(1) and needs no key\n * enumeration (KV has no prefix delete).\n *\n * The singleton backend/config and the per-isolate epoch cache live on\n * `globalThis` behind `Symbol.for` keys so Vite SSR chunk duplication can't\n * fork them (same pattern as `request-context.ts`).\n */\n\nimport { after } from \"../after.js\";\nimport { getRequestContext } from \"../request-context.js\";\nimport { decode, encode } from \"./codec.js\";\nimport type {\n\tCreateObjectCacheBackendFn,\n\tObjectCacheBackend,\n\tObjectCacheRuntimeConfig,\n} from \"./types.js\";\n\nconst DEFAULT_KEY_PREFIX = \"em\";\nconst DEFAULT_TTL_SECONDS = 3600;\nconst DEFAULT_REVALIDATE_MS = 1000;\nconst DEFAULT_TIMEOUT_MS = 2000;\n\ninterface BackendHolder {\n\t/** Whether the virtual module has been loaded and the backend resolved. */\n\tinitialized: boolean;\n\t/** Resolved backend, or `null` when no object cache is configured. */\n\tbackend: ObjectCacheBackend | null;\n\t/** In-flight initialization promise (dedupes concurrent first calls). */\n\tinitPromise: Promise<ObjectCacheBackend | null> | null;\n\tconfig: Required<Pick<ObjectCacheRuntimeConfig, \"keyPrefix\">> & {\n\t\tdefaultTtl: number;\n\t\trevalidate: number;\n\t\ttimeout: number;\n\t};\n}\n\n/**\n * Race a backend operation against a timeout so a stalled call (e.g. a KV read\n * that never resolves *and* never rejects — a cold cross-region read, or one\n * queued behind the Workers simultaneous-connection limit) degrades to a\n * rejection instead of hanging the isolate. A rejection is benign: callers\n * already treat a failed read as a cache miss / last-known epoch.\n */\nfunction withTimeout<T>(promise: Promise<T>, ms: number, label: string): Promise<T> {\n\tif (!(ms > 0)) return promise;\n\tlet timer: ReturnType<typeof setTimeout>;\n\tconst timeout = new Promise<never>((_resolve, reject) => {\n\t\ttimer = setTimeout(() => {\n\t\t\treject(new Error(`object-cache ${label} timed out after ${ms}ms`));\n\t\t}, ms);\n\t});\n\treturn Promise.race([promise, timeout]).finally(() => clearTimeout(timer));\n}\n\ninterface EpochEntry {\n\tvalue: number;\n\t/** `Date.now()` at which this epoch was read from the backend. */\n\tat: number;\n\t/** In-flight read, so concurrent callers share one backend round-trip. */\n\tpromise?: Promise<number>;\n\t/**\n\t * `Date.now()` at which the in-flight read started. Callers use it to\n\t * decide whether the read's owner can still be alive (see\n\t * {@link epochReadDeadline}) — past the deadline the promise is presumed\n\t * dead and the next caller reclaims by starting a fresh read.\n\t */\n\tpromiseAt?: number;\n}\n\n/**\n * Extra time past the configured read timeout before an in-flight epoch read\n * is presumed dead. A live owner's read settles within `timeout` (enforced by\n * {@link withTimeout}), so the grace only needs to absorb scheduling jitter.\n */\nconst EPOCH_READ_GRACE_MS = 1_000;\n\n/**\n * How long an in-flight epoch read may be trusted. A read older than this can\n * only exist because its owning request was cancelled mid-await — on workerd\n * a cancelled request's continuations never run, *including the timeout's own\n * `setTimeout` callback*, so the shared promise never settles and is never\n * replaced. With the timeout disabled (`timeout: 0`) the default is used as\n * the deadline; the worst case of guessing too short is one duplicate\n * backend read.\n */\nfunction epochReadDeadline(): number {\n\tconst timeout = holder.config.timeout > 0 ? holder.config.timeout : DEFAULT_TIMEOUT_MS;\n\treturn timeout + EPOCH_READ_GRACE_MS;\n}\n\n/**\n * Await another request's in-flight epoch read, bounded by the waiter's own\n * timer. The bare promise must never be awaited across requests: if the\n * owning request is cancelled, the promise never settles (see\n * {@link epochReadDeadline}) and an unguarded waiter hangs until the isolate\n * is evicted. The race timer below belongs to the *waiter's* request context\n * and therefore always fires; on timeout the waiter degrades to `fallback`\n * (the last known epoch), the same contract as a failed backend read.\n */\nfunction raceInFlightEpochRead(\n\tpromise: Promise<number>,\n\tms: number,\n\tfallback: number,\n): Promise<number> {\n\tlet timer: ReturnType<typeof setTimeout>;\n\tconst timeout = new Promise<number>((resolve) => {\n\t\ttimer = setTimeout(resolve, Math.max(ms, 1), fallback);\n\t});\n\treturn Promise.race([promise, timeout]).finally(() => clearTimeout(timer));\n}\n\nconst BACKEND_KEY = Symbol.for(\"emdash:object-cache:backend\");\nconst EPOCH_KEY = Symbol.for(\"emdash:object-cache:epochs\");\nconst PENDING_KEY = Symbol.for(\"emdash:object-cache:pending-bumps\");\nconst g = globalThis as Record<symbol, unknown>;\n\nconst holder: BackendHolder =\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see request-context.ts)\n\t(g[BACKEND_KEY] as BackendHolder | undefined) ??\n\t(() => {\n\t\tconst h: BackendHolder = {\n\t\t\tinitialized: false,\n\t\t\tbackend: null,\n\t\t\tinitPromise: null,\n\t\t\tconfig: {\n\t\t\t\tkeyPrefix: DEFAULT_KEY_PREFIX,\n\t\t\t\tdefaultTtl: DEFAULT_TTL_SECONDS,\n\t\t\t\trevalidate: DEFAULT_REVALIDATE_MS,\n\t\t\t\ttimeout: DEFAULT_TIMEOUT_MS,\n\t\t\t},\n\t\t};\n\t\tg[BACKEND_KEY] = h;\n\t\treturn h;\n\t})();\n\nconst epochCache: Map<string, EpochEntry> =\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see request-context.ts)\n\t(g[EPOCH_KEY] as Map<string, EpochEntry> | undefined) ??\n\t(() => {\n\t\tconst m = new Map<string, EpochEntry>();\n\t\tg[EPOCH_KEY] = m;\n\t\treturn m;\n\t})();\n\n/** Namespaces with a backend epoch write already scheduled this tick. */\nconst pendingBumps: Set<string> =\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see request-context.ts)\n\t(g[PENDING_KEY] as Set<string> | undefined) ??\n\t(() => {\n\t\tconst s = new Set<string>();\n\t\tg[PENDING_KEY] = s;\n\t\treturn s;\n\t})();\n\n/**\n * Resolve (once per isolate) the configured object-cache backend.\n *\n * Loads `virtual:emdash/object-cache`, which exports `createObjectCache`\n * (`undefined` when no cache is configured) and the serialized\n * `objectCacheConfig`. Returns `null` when the cache is disabled.\n */\nasync function getBackend(): Promise<ObjectCacheBackend | null> {\n\tif (holder.initialized) return holder.backend;\n\tif (holder.initPromise) return holder.initPromise;\n\n\tholder.initPromise = (async () => {\n\t\ttry {\n\t\t\tconst mod: {\n\t\t\t\tcreateObjectCache?: CreateObjectCacheBackendFn;\n\t\t\t\tobjectCacheConfig?: ObjectCacheRuntimeConfig;\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// @ts-ignore - virtual module\n\t\t\t} = await import(\"virtual:emdash/object-cache\");\n\n\t\t\tconst config = mod.objectCacheConfig ?? {};\n\t\t\tholder.config = {\n\t\t\t\tkeyPrefix:\n\t\t\t\t\ttypeof config.keyPrefix === \"string\" && config.keyPrefix.length > 0\n\t\t\t\t\t\t? config.keyPrefix\n\t\t\t\t\t\t: DEFAULT_KEY_PREFIX,\n\t\t\t\tdefaultTtl:\n\t\t\t\t\ttypeof config.defaultTtl === \"number\" && config.defaultTtl > 0\n\t\t\t\t\t\t? config.defaultTtl\n\t\t\t\t\t\t: DEFAULT_TTL_SECONDS,\n\t\t\t\trevalidate:\n\t\t\t\t\ttypeof config.revalidate === \"number\" && config.revalidate >= 0\n\t\t\t\t\t\t? config.revalidate\n\t\t\t\t\t\t: DEFAULT_REVALIDATE_MS,\n\t\t\t\ttimeout:\n\t\t\t\t\ttypeof config.timeout === \"number\" && config.timeout >= 0\n\t\t\t\t\t\t? config.timeout\n\t\t\t\t\t\t: DEFAULT_TIMEOUT_MS,\n\t\t\t};\n\n\t\t\tholder.backend =\n\t\t\t\ttypeof mod.createObjectCache === \"function\" ? mod.createObjectCache(config) : null;\n\t\t} catch (error) {\n\t\t\t// Importing the virtual module fails outside an Astro/Vite context\n\t\t\t// (e.g. unit tests, CLI). Treat as \"no cache configured\".\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn(\"[object-cache] backend unavailable:\", error);\n\t\t\t}\n\t\t\tholder.backend = null;\n\t\t}\n\t\tholder.initialized = true;\n\t\tholder.initPromise = null;\n\t\treturn holder.backend;\n\t})();\n\n\treturn holder.initPromise;\n}\n\n/**\n * Test-only override of the backend, bypassing the virtual module.\n *\n * Lets unit tests inject an in-memory backend (and optional config) without a\n * full Astro/Vite build. Pass `null` to simulate \"no cache configured\".\n *\n * @internal\n */\nexport function __setObjectCacheBackendForTests(\n\tbackend: ObjectCacheBackend | null,\n\tconfig?: Partial<BackendHolder[\"config\"]>,\n): void {\n\tholder.initialized = true;\n\tholder.initPromise = null;\n\tholder.backend = backend;\n\tholder.config = { ...holder.config, ...config };\n\tepochCache.clear();\n}\n\n/** Build the backend key for a namespace's epoch anchor. */\nfunction epochKey(namespace: string): string {\n\treturn `${holder.config.keyPrefix}:epoch:${namespace}`;\n}\n\n/**\n * Build the (epoch-independent) backend key for a cached value.\n *\n * The key is stable across invalidations — the namespace epochs are stored\n * *inside* the value envelope and validated on read, not baked into the key.\n * This lets the value and the epochs be fetched in one parallel round-trip\n * (instead of \"read epoch, then read value\"), and means an invalidated value\n * is overwritten in place rather than orphaned under a dead epoch-keyed name.\n */\nfunction valueKey(namespaces: readonly string[], key: string): string {\n\treturn `${holder.config.keyPrefix}:${namespaces.join(\",\")}:${key}`;\n}\n\n/**\n * Stored cache envelope: the namespace epochs captured at write time alongside\n * the cached value. A read is a HIT only when every stored epoch still matches\n * the current epoch for its namespace.\n */\ninterface CacheEnvelope<T> {\n\t/** Epoch per namespace, in the query's namespace order. */\n\te: number[];\n\t/** The cached value. */\n\tv: T;\n}\n\nfunction epochsMatch(stored: readonly number[], current: readonly number[]): boolean {\n\tif (stored.length !== current.length) return false;\n\tfor (let i = 0; i < stored.length; i++) {\n\t\tif (stored[i] !== current[i]) return false;\n\t}\n\treturn true;\n}\n\n/**\n * Requests that must always read live data and never populate the cache:\n * visual edit mode, preview tokens, and isolated databases (playground / DO\n * preview, whose schema and content diverge from the configured site).\n */\nfunction shouldBypass(): boolean {\n\tconst ctx = getRequestContext();\n\tif (!ctx) return false;\n\treturn ctx.editMode === true || ctx.preview !== undefined || ctx.dbIsIsolated === true;\n}\n\n/**\n * Read the current epoch for `namespace`, reusing an isolate-cached value for\n * up to `revalidate` ms. A missing epoch (never bumped) is treated as `0`.\n *\n * Backend errors and stalls are non-fatal: the read is bounded by a timeout,\n * and on failure we fall back to the last known epoch (or `0`), so a flaky or\n * hung cache degrades to \"serve whatever's keyed\" rather than throwing or\n * hanging.\n */\nasync function getEpoch(namespace: string, backend: ObjectCacheBackend): Promise<number> {\n\tconst now = Date.now();\n\tconst cached = epochCache.get(namespace);\n\tif (cached && now - cached.at < holder.config.revalidate) {\n\t\treturn cached.value;\n\t}\n\tif (cached?.promise) {\n\t\t// Share the in-flight read only while its owner can still be alive,\n\t\t// and never await it bare (a cancelled owner's promise never settles;\n\t\t// see epochReadDeadline). Past the deadline, fall through and reclaim\n\t\t// with a fresh read — the dead entry is overwritten below.\n\t\tconst age = now - (cached.promiseAt ?? 0);\n\t\tconst deadline = epochReadDeadline();\n\t\tif (age < deadline) {\n\t\t\treturn raceInFlightEpochRead(cached.promise, deadline - age, cached.value);\n\t\t}\n\t}\n\n\tconst promise = (async () => {\n\t\tlet value: number;\n\t\ttry {\n\t\t\tconst raw = await withTimeout(\n\t\t\t\tbackend.get(epochKey(namespace)),\n\t\t\t\tholder.config.timeout,\n\t\t\t\t\"epoch read\",\n\t\t\t);\n\t\t\tconst parsed = raw === null ? 0 : Number(raw);\n\t\t\tvalue = Number.isFinite(parsed) ? parsed : 0;\n\t\t} catch {\n\t\t\tvalue = cached?.value ?? 0;\n\t\t}\n\t\t// A concurrent invalidateObjectCache may have bumped the epoch while this\n\t\t// read was in flight. Epochs are monotonic, so never let a stale backend\n\t\t// read lower a freshly-bumped local epoch — that would resurrect the very\n\t\t// values the bump just invalidated.\n\t\tconst merged = Math.max(value, epochCache.get(namespace)?.value ?? 0);\n\t\tepochCache.set(namespace, { value: merged, at: Date.now() });\n\t\treturn merged;\n\t})();\n\n\t// Anchor the read on the host's lifetime extender: if the owning request\n\t// is cancelled mid-await, the anchored copy keeps the read alive so it\n\t// still settles and its handler replaces this entry with a fresh,\n\t// promise-free one. Where no extender exists, the deadline reclaim above\n\t// recovers instead.\n\tafter(() =>\n\t\tpromise.then(\n\t\t\t() => undefined,\n\t\t\t() => undefined,\n\t\t),\n\t);\n\n\t// Concurrent callers share this in-flight read (dedup) — bounded by their\n\t// own timers via raceInFlightEpochRead, never awaited bare. The timeout\n\t// above makes a live owner's read settle; `promiseAt` lets callers detect\n\t// a dead one (cancelled owner) and reclaim.\n\tepochCache.set(namespace, {\n\t\tvalue: cached?.value ?? 0,\n\t\tat: cached?.at ?? 0,\n\t\tpromise,\n\t\tpromiseAt: now,\n\t});\n\treturn promise;\n}\n\n/** Options for {@link cachedQuery}. */\nexport interface CachedQueryOptions<T> {\n\t/**\n\t * Invalidation namespace(s). A single string for self-contained data\n\t * (`settings`, `menus`), or several when the cached value depends on data\n\t * owned by other namespaces — e.g. a content entry hydrates bylines and\n\t * taxonomy terms, so it caches under\n\t * `[content:posts, \"bylines\", \"taxonomies\"]` and is invalidated when *any*\n\t * of them is bumped. Every namespace's epoch is folded into the key.\n\t */\n\tnamespace: string | readonly string[];\n\t/** Stable, fully-qualifying cache key *within* the namespace. */\n\tkey: string;\n\t/** Loader run on a miss (or when caching is disabled/bypassed). */\n\tload: () => Promise<T>;\n\t/** TTL override in seconds. Falls back to the configured `defaultTtl`. */\n\tttl?: number;\n\t/**\n\t * Predicate gating whether a freshly-loaded value is stored. Defaults to\n\t * always-cache. Use it to skip caching error/empty sentinels.\n\t */\n\tcacheable?: (value: T) => boolean;\n}\n\n/**\n * Distributed read-through cache around `load`.\n *\n * `T` must be the value as it should be *stored* — i.e. JSON-serializable with\n * the codec's `Date` support, carrying no functions or symbol-keyed props.\n * Callers caching richer objects (content entries) reduce to a serializable\n * snapshot here and rebuild on the way out; see `query.ts`.\n *\n * On a miss or when the cache is disabled/bypassed, this is equivalent to\n * `await load()`. Backend errors never propagate: a failing `get` is a miss, a\n * failing `set` is dropped.\n */\nexport async function cachedQuery<T>(options: CachedQueryOptions<T>): Promise<T> {\n\tconst backend = await getBackend();\n\tif (!backend || shouldBypass()) {\n\t\treturn options.load();\n\t}\n\n\tconst namespaces =\n\t\ttypeof options.namespace === \"string\" ? [options.namespace] : options.namespace;\n\tconst fullKey = valueKey(namespaces, options.key);\n\n\t// Kick off the value read and every namespace epoch read concurrently — one\n\t// round-trip instead of \"read epochs, then read value\". getEpoch never\n\t// rejects, so awaiting the epochs separately from the value read guarantees\n\t// we hold the pre-load epochs even when the value read errors or times out.\n\t// Storing a value under an epoch read *after* load() would mask a write that\n\t// landed during load(): the stale value would match and be served as a HIT.\n\tconst epochsPromise = Promise.all(namespaces.map((ns) => getEpoch(ns, backend)));\n\tconst rawPromise = withTimeout(backend.get(fullKey), holder.config.timeout, \"read\").catch(\n\t\t() => null,\n\t);\n\tconst currentEpochs = await epochsPromise;\n\tconst raw = await rawPromise;\n\tif (raw !== null) {\n\t\tconst decoded = decode(raw);\n\t\tif (decoded !== undefined) {\n\t\t\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- value envelope written by this function\n\t\t\tconst envelope = decoded as CacheEnvelope<T>;\n\t\t\tif (epochsMatch(envelope.e, currentEpochs)) {\n\t\t\t\treturn envelope.v;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst value = await options.load();\n\n\tconst cacheable = options.cacheable ? options.cacheable(value) : true;\n\tif (cacheable) {\n\t\tconst ttl = options.ttl ?? holder.config.defaultTtl;\n\t\t// Defer the write so it never adds to TTFB. The epochs were captured\n\t\t// before load() ran, so a write that invalidated this namespace mid-load\n\t\t// correctly orphans the value stored here.\n\t\tafter(async () => {\n\t\t\ttry {\n\t\t\t\tconst encoded = encode({ e: currentEpochs, v: value } satisfies CacheEnvelope<T>);\n\t\t\t\tawait backend.set(fullKey, encoded, ttl);\n\t\t\t} catch (error) {\n\t\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\t\tconsole.warn(\"[object-cache] set failed:\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\treturn value;\n}\n\n/** Whether object-cache reads are active for the current request. */\nexport async function isObjectCacheActive(): Promise<boolean> {\n\tconst backend = await getBackend();\n\treturn backend !== null && !shouldBypass();\n}\n\n/**\n * Invalidate every cached value in `namespace` by bumping its epoch.\n *\n * Sync and non-blocking: the local epoch is stamped immediately (so the\n * writing isolate is instantly consistent) and the backend write is deferred\n * via `after`. Other isolates pick up the new epoch within their `revalidate`\n * window. No-ops when the cache is disabled.\n */\nexport function invalidateObjectCache(namespace: string): void {\n\t// Monotonic so two writes in the same millisecond still produce distinct\n\t// epochs — otherwise the second write reuses the first's stamp and its\n\t// stale entries survive.\n\tconst prev = epochCache.get(namespace)?.value ?? 0;\n\tconst stamp = Math.max(prev + 1, Date.now());\n\t// Optimistic local bump: keep this isolate consistent without a round-trip.\n\tepochCache.set(namespace, { value: stamp, at: stamp });\n\n\t// Coalesce repeated bumps of the same namespace within a tick (e.g. a bulk\n\t// publish loop) into a single backend write that persists the latest epoch.\n\tif (pendingBumps.has(namespace)) return;\n\tpendingBumps.add(namespace);\n\tafter(async () => {\n\t\tpendingBumps.delete(namespace);\n\t\ttry {\n\t\t\tconst backend = await getBackend();\n\t\t\tif (!backend) return;\n\t\t\tconst latest = epochCache.get(namespace)?.value ?? stamp;\n\t\t\t// Epoch anchors are persistent (no TTL) — they must outlive the\n\t\t\t// value keys they invalidate.\n\t\t\tawait backend.set(epochKey(namespace), String(latest));\n\t\t} catch (error) {\n\t\t\tconsole.error(\"[object-cache] epoch bump failed for\", namespace, error);\n\t\t}\n\t});\n}\n\n/**\n * Fixed namespaces for data shared across collections. Content reads fold the\n * `BYLINES` and `TAXONOMIES` epochs into their keys (via {@link cachedQuery})\n * because entries hydrate byline and taxonomy-term data — so renaming an\n * author or a category correctly invalidates every cached entry that displays\n * it, without tracking which collections reference it.\n */\nexport const CacheNamespace = {\n\tSETTINGS: \"settings\",\n\tMENUS: \"menus\",\n\tTAXONOMIES: \"taxonomies\",\n\tBYLINES: \"bylines\",\n\t/** Collection schema/metadata (label, supports, commentsEnabled, fields). */\n\tSCHEMA: \"schema\",\n\t/** Public (approved) comments. */\n\tCOMMENTS: \"comments\",\n} as const;\n\n/** Namespace for a content collection's cached queries. */\nexport function contentNamespace(collection: string): string {\n\treturn `content:${collection}`;\n}\n\n/**\n * Namespaces a content read depends on: the collection itself plus the shared\n * byline/taxonomy data folded into each entry.\n */\nexport function contentNamespaces(collection: string): readonly string[] {\n\treturn [contentNamespace(collection), CacheNamespace.BYLINES, CacheNamespace.TAXONOMIES];\n}\n\n/**\n * Invalidate all cached reads (list + entry) for a content collection.\n * Call from every write path that mutates rows in `ec_<collection>`.\n */\nexport function invalidateCollectionCache(collection: string): void {\n\tinvalidateObjectCache(contentNamespace(collection));\n}\n\n/** Invalidate cached taxonomy definitions/terms and all content that hydrates them. */\nexport function invalidateTaxonomyObjectCache(): void {\n\tinvalidateObjectCache(CacheNamespace.TAXONOMIES);\n}\n\n/** Invalidate cached bylines and all content that hydrates them. */\nexport function invalidateBylineObjectCache(): void {\n\tinvalidateObjectCache(CacheNamespace.BYLINES);\n}\n\n/** Invalidate cached navigation menus. */\nexport function invalidateMenuObjectCache(): void {\n\tinvalidateObjectCache(CacheNamespace.MENUS);\n}\n\n/** Invalidate cached collection schema/metadata reads (e.g. getCollectionInfo). */\nexport function invalidateSchemaObjectCache(): void {\n\tinvalidateObjectCache(CacheNamespace.SCHEMA);\n}\n\n/** Invalidate cached public comment reads. */\nexport function invalidateCommentObjectCache(): void {\n\tinvalidateObjectCache(CacheNamespace.COMMENTS);\n}\n\nexport type {\n\tObjectCacheBackend,\n\tObjectCacheDescriptor,\n\tObjectCacheRuntimeConfig,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,WAAW;AAMjB,SAAS,aAAa,OAAqC;AAC1D,KAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AAOxD,QAFa,OAAO,KAAK,MAAM,CAEnB,WAAW,KAAK,OAAQ,MAAkC,cAAc;;;;;;;;;;AAWrF,SAAgB,OAAO,OAAwB;AAC9C,QAAO,KAAK,UAAU,OAAO,SAAyC,KAAK,KAAK;EAC/E,MAAM,WAAW,KAAK;AACtB,MAAI,oBAAoB,KACvB,QAAO,GAAG,WAAW,SAAS,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AAO,GAAG,KAAK,KAAK,CAAC;AAE5C,YAAW,IAAI,WAAW;EAAE,OAAO;EAAO,IAAI;EAAO,CAAC;AAItD,KAAI,aAAa,IAAI,UAAU,CAAE;AACjC,cAAa,IAAI,UAAU;AAC3B,OAAM,YAAY;AACjB,eAAa,OAAO,UAAU;AAC9B,MAAI;GACH,MAAM,UAAU,MAAM,YAAY;AAClC,OAAI,CAAC,QAAS;GACd,MAAM,SAAS,WAAW,IAAI,UAAU,EAAE,SAAS;AAGnD,SAAM,QAAQ,IAAI,SAAS,UAAU,EAAE,OAAO,OAAO,CAAC;WAC9C,OAAO;AACf,WAAQ,MAAM,wCAAwC,WAAW,MAAM;;GAEvE;;;;;;;;;AAUH,MAAa,iBAAiB;CAC7B,UAAU;CACV,OAAO;CACP,YAAY;CACZ,SAAS;CAET,QAAQ;CAER,UAAU;CACV;;AAGD,SAAgB,iBAAiB,YAA4B;AAC5D,QAAO,WAAW;;;;;;AAOnB,SAAgB,kBAAkB,YAAuC;AACxE,QAAO;EAAC,iBAAiB,WAAW;EAAE,eAAe;EAAS,eAAe;EAAW;;;;;;AAOzF,SAAgB,0BAA0B,YAA0B;AACnE,uBAAsB,iBAAiB,WAAW,CAAC;;;AAIpD,SAAgB,gCAAsC;AACrD,uBAAsB,eAAe,WAAW;;;AAIjD,SAAgB,8BAAoC;AACnD,uBAAsB,eAAe,QAAQ;;;AAI9C,SAAgB,4BAAkC;AACjD,uBAAsB,eAAe,MAAM;;;AAI5C,SAAgB,8BAAoC;AACnD,uBAAsB,eAAe,OAAO;;;AAI7C,SAAgB,+BAAqC;AACpD,uBAAsB,eAAe,SAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"options-aeIs8WFu.d.mts","names":[],"sources":["../src/api/types.ts","../src/api/error.ts","../src/api/parse.ts","../src/database/repositories/options.ts"],"mappings":";;;;;;;;AASA;UAAiB,YAAA;EAChB,KAAA,EAAO,CAAA;EACP,UAAA;EAF6B;;;;;EA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ating proxy the internal request URL\n * (`http://localhost:4321`) differs from the browser-facing origin\n * (`https://mysite.example.com`). These pure helpers resolve the\n * correct public origin from config, falling back to the request URL.\n *\n * Workers-safe: no Node.js imports.\n */\n\n/** Minimal config shape — avoids importing the full EmDashConfig type tree. */\ninterface SiteUrlConfig {\n\tsiteUrl?: string;\n}\n\n/**\n * Resolve siteUrl from runtime environment variables.\n *\n * Uses process.env (not import.meta.env) because Vite statically replaces\n * import.meta.env at build time, baking out any env vars not present during\n * the build. Container deployments set env vars at runtime, so we must read\n * process.env which Vite leaves untouched.\n *\n * On Cloudflare Workers process.env is empty by default, so the fallback\n * chain continues to url.origin — unless the Worker enables the\n * `nodejs_compat_populate_process_env` compatibility flag, in which case\n * `vars`/secrets (e.g. EMDASH_SITE_URL) are readable here too.\n *\n * Caches after first call.\n */\nlet _envSiteUrl: string | undefined | null = null;\n\n/** @internal Reset cached env values — test-only. */\nexport function _resetEnvCache(): void {\n\t_envSiteUrl = null;\n\t_envAllowedOrigins = null;\n}\n\nfunction getEnvSiteUrl(): string | undefined {\n\tif (_envSiteUrl !== null) return _envSiteUrl || undefined;\n\ttry {\n\t\t// process.env is available on Node.js; undefined on Workers\n\t\tconst value =\n\t\t\t(typeof process !== \"undefined\" && process.env?.EMDASH_SITE_URL) ||\n\t\t\t(typeof process !== \"undefined\" && process.env?.SITE_URL) ||\n\t\t\t\"\";\n\t\tif (value) {\n\t\t\tconst parsed = new URL(value);\n\t\t\tif (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") {\n\t\t\t\t_envSiteUrl = \"\";\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\t_envSiteUrl = parsed.origin;\n\t\t} else {\n\t\t\t_envSiteUrl = \"\";\n\t\t}\n\t} catch {\n\t\t_envSiteUrl = \"\";\n\t}\n\treturn _envSiteUrl || undefined;\n}\n\n/**\n * Return the public-facing origin for the site.\n *\n * Resolution order:\n * 1. `config.siteUrl` (set in astro.config.mjs, origin-normalized at startup)\n * 2. `EMDASH_SITE_URL` or `SITE_URL` env var (resolved at runtime for containers)\n * 3. `url.origin` (internal request URL — correct when no proxy)\n *\n * @param url The request URL (`new URL(request.url)` or `Astro.url`)\n * @param config The EmDash config (from `locals.emdash?.config`)\n * @returns Origin string, e.g. `\"https://mysite.example.com\"`\n */\nexport function getPublicOrigin(url: URL, config?: SiteUrlConfig): string {\n\treturn config?.siteUrl || getEnvSiteUrl() || url.origin;\n}\n\n/**\n * Resolve additional accepted passkey origins from runtime environment.\n *\n * Reads `EMDASH_ALLOWED_ORIGINS` (comma-separated list of origins) for\n * multi-origin deployments where the same RP is reachable under several\n * hostnames sharing the registrable parent domain (e.g. apex + preview).\n *\n * Each entry is parsed via `new URL()` and reduced to its `origin`. Unlike\n * `getEnvSiteUrl` (which silently falls back to `url.origin` on bad input),\n * this throws on any unparseable or non-http(s) entry — `EMDASH_ALLOWED_ORIGINS`\n * is an allowlist for passkey verification, so silently dropping a typo would\n * surface as \"I can't authenticate on this origin\" with no diagnostic. Fail\n * loud at first read.\n *\n * Uses `process.env` (Vite leaves it untouched at runtime). Result is cached\n * on success.\n */\nlet _envAllowedOrigins: string[] | null = null;\n\nexport function getEnvAllowedOrigins(): string[] {\n\tif (_envAllowedOrigins !== null) return _envAllowedOrigins;\n\tconst raw = typeof process !== \"undefined\" ? process.env?.EMDASH_ALLOWED_ORIGINS || \"\" : \"\";\n\tconst parsed: string[] = [];\n\tfor (const entry of raw.split(\",\")) {\n\t\tconst trimmed = entry.trim();\n\t\tif (!trimmed) continue;\n\t\tlet u: URL;\n\t\ttry {\n\t\t\tu = new URL(trimmed);\n\t\t} catch (e) {\n\t\t\tthrow new Error(`EmDash config error in EMDASH_ALLOWED_ORIGINS: invalid URL: \"${trimmed}\"`, {\n\t\t\t\tcause: e,\n\t\t\t});\n\t\t}\n\t\tif (u.protocol !== \"http:\" && u.protocol !== \"https:\") {\n\t\t\tthrow new Error(\n\t\t\t\t`EmDash config error in EMDASH_ALLOWED_ORIGINS: origin must be http or https: \"${trimmed}\" (got ${u.protocol})`,\n\t\t\t);\n\t\t}\n\t\tparsed.push(u.origin);\n\t}\n\t_envAllowedOrigins = parsed;\n\treturn parsed;\n}\n\n/**\n * Build a full public URL by appending a path to the public origin.\n *\n * @param url The request URL\n * @param config The EmDash config\n * @param path Path to append (must start with `/`)\n * @returns Full URL string, e.g. `\"https://mysite.example.com/_emdash/admin/login\"`\n */\nexport function getPublicUrl(url: URL, config: SiteUrlConfig | undefined, path: string): string {\n\treturn `${getPublicOrigin(url, config)}${path}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,IAAI,cAAyC;AAQ7C,SAAS,gBAAoC;AAC5C,KAAI,gBAAgB,KAAM,QAAO,eAAe;AAChD,KAAI;EAEH,MAAM,QACJ,OAAO,YAAY,eAAe,QAAQ,KAAK,mBAC/C,OAAO,YAAY,eAAe,QAAQ,KAAK,YAChD;AACD,MAAI,OAAO;GACV,MAAM,SAAS,IAAI,IAAI,MAAM;AAC7B,OAAI,OAAO,aAAa,WAAW,OAAO,aAAa,UAAU;AAChE,kBAAc;AACd;;AAED,iBAAc,OAAO;QAErB,eAAc;SAER;AACP,gBAAc;;AAEf,QAAO,eAAe;;;;;;;;;;;;;;AAevB,SAAgB,gBAAgB,KAAU,QAAgC;AACzE,QAAO,QAAQ,WAAW,eAAe,IAAI,IAAI;;;;;;;;;;;;;;;;;;;AAoBlD,IAAI,qBAAsC;AAE1C,SAAgB,uBAAiC;AAChD,KAAI,uBAAuB,KAAM,QAAO;CACxC,MAAM,MAAM,OAAO,YAAY,cAAc,QAAQ,KAAK,0BAA0B,KAAK;CACzF,MAAM,SAAmB,EAAE;AAC3B,MAAK,MAAM,SAAS,IAAI,MAAM,IAAI,EAAE;EACnC,MAAM,UAAU,MAAM,MAAM;AAC5B,MAAI,CAAC,QAAS;EACd,IAAI;AACJ,MAAI;AACH,OAAI,IAAI,IAAI,QAAQ;WACZ,GAAG;AACX,SAAM,IAAI,MAAM,gEAAgE,QAAQ,IAAI,EAC3F,OAAO,GACP,CAAC;;AAEH,MAAI,EAAE,aAAa,WAAW,EAAE,aAAa,SAC5C,OAAM,IAAI,MACT,iFAAiF,QAAQ,SAAS,EAAE,SAAS,GAC7G;AAEF,SAAO,KAAK,EAAE,OAAO;;AAEtB,sBAAqB;AACrB,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-DCiXI7OZ.mjs","names":[],"sources":["../src/visual-editing/editable.ts","../src/query.ts"],"sourcesContent":["/**\n * Visual editing annotation system\n *\n * Creates Proxy objects that emit data-emdash-ref attributes when spread onto elements.\n */\n\nexport interface CMSAnnotation {\n\tcollection: string;\n\tid: string;\n\tfield?: string;\n\t/** Entry status — only present on entry-level annotations (not field-level) */\n\tstatus?: string;\n\t/** Whether the entry has unpublished draft changes */\n\thasDraft?: boolean;\n}\n\n/** The shape returned when spreading an edit annotation onto an element */\nexport interface FieldAnnotation {\n\t\"data-emdash-ref\": string;\n}\n\nexport interface EditableOptions {\n\t/** Entry status: \"draft\", \"published\", \"scheduled\" */\n\tstatus?: string;\n\t/** true when draftRevisionId exists and differs from liveRevisionId */\n\thasDraft?: boolean;\n}\n\n/**\n * Create an editable proxy for an entry.\n *\n * Usage:\n * - `{...entry.edit}` - entry-level annotation (includes status/hasDraft)\n * - `{...entry.edit.title}` - field-level annotation\n * - `{...entry.edit['nested.field']}` - nested field (bracket notation)\n */\nexport function createEditable(\n\tcollection: string,\n\tid: string,\n\toptions?: EditableOptions,\n): EditProxy {\n\tconst base: CMSAnnotation = {\n\t\tcollection,\n\t\tid,\n\t\t...(options?.status && { status: options.status }),\n\t\t...(options?.hasDraft && { hasDraft: true }),\n\t};\n\n\treturn new Proxy(\n\t\t{},\n\t\t{\n\t\t\tget(_, prop) {\n\t\t\t\tif (prop === \"toJSON\") return () => ({ \"data-emdash-ref\": JSON.stringify(base) });\n\t\t\t\tif (typeof prop === \"symbol\") return undefined;\n\n\t\t\t\t// data-emdash-ref access returns the entry-level string\n\t\t\t\tif (prop === \"data-emdash-ref\") return JSON.stringify(base);\n\n\t\t\t\t// Field-level: return a FieldAnnotation for the specific field\n\t\t\t\treturn {\n\t\t\t\t\t\"data-emdash-ref\": JSON.stringify({ ...base, field: String(prop) }),\n\t\t\t\t} satisfies FieldAnnotation;\n\t\t\t},\n\t\t\townKeys() {\n\t\t\t\treturn [\"data-emdash-ref\"];\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor(_, prop) {\n\t\t\t\tif (prop === \"data-emdash-ref\") {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tvalue: JSON.stringify(base),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t},\n\t);\n}\n\n/**\n * Create a noop proxy for production mode.\n * Spreading this produces no attributes.\n */\nexport function createNoop(): EditProxy {\n\treturn new Proxy(\n\t\t{},\n\t\t{\n\t\t\tget(_, prop) {\n\t\t\t\tif (typeof prop === \"symbol\") return undefined;\n\t\t\t\t// All property access returns undefined in noop mode\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\townKeys() {\n\t\t\t\treturn [];\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor() {\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t},\n\t);\n}\n\n/**\n * Visual editing proxy type.\n *\n * Spread directly onto elements for entry-level annotations: `{...entry.edit}`\n * Access a field for field-level annotations: `{...entry.edit.title}`\n *\n * In production, spreading produces no attributes (noop).\n */\nexport type EditProxy = {\n\treadonly [field: string]: Partial<FieldAnnotation>;\n};\n","/// <reference types=\"astro/client\" />\n/**\n * Query functions for EmDash content\n *\n * These wrap Astro's getLiveCollection/getLiveEntry with type filtering.\n * Use these instead of calling Astro's functions directly.\n *\n * Error handling follows Astro's pattern - returns { entries/entry, error }\n * so callers can gracefully handle errors (including 404s).\n *\n * Preview mode is handled implicitly via ALS request context —\n * no parameters needed. The middleware verifies the preview token\n * and sets the context; query functions read it automatically.\n *\n * The triple-slash directive above pulls in the ambient declaration for\n * `astro:content` (used by the dynamic imports below) so this source\n * file typechecks even when reached transitively by a sibling package\n * whose tsconfig doesn't list `astro/client` in `compilerOptions.types`.\n *\n * Note: the directive is stripped from the compiled output (`dist/*`)\n * by tsdown, so it does not propagate to downstream consumers of the\n * published package. Consumers are Astro sites and already provide their\n * own `astro/client` ambient surface anyway, so the runtime dynamic\n * import resolves there at typecheck time without our help.\n */\n\nimport { encodeCursor } from \"./database/repositories/types.js\";\nimport { getFallbackChain, getI18nConfig, isI18nEnabled } from \"./i18n/config.js\";\nimport {\n\tCURSOR_RAW_VALUES,\n\tFOLDED_BYLINES,\n\tFOLDED_TERMS,\n\ttype WhereRange,\n\ttype WhereValue,\n} from \"./loader.js\";\nimport {\n\tcachedQuery,\n\tcontentNamespaces,\n\tinvalidateSchemaObjectCache,\n} from \"./object-cache/index.js\";\nimport { requestCached } from \"./request-cache.js\";\nimport { getRequestContext } from \"./request-context.js\";\nimport type { TaxonomyTerm } from \"./taxonomies/types.js\";\nimport { isMissingTableError } from \"./utils/db-errors.js\";\nimport {\n\tcreateEditable,\n\tcreateNoop,\n\ttype EditProxy,\n\ttype EditableOptions,\n} from \"./visual-editing/editable.js\";\n\n/**\n * Collection type registry for type-safe queries.\n *\n * This interface is extended by the generated emdash-env.d.ts file\n * to provide type inference for collection names and their data shapes.\n *\n * @example\n * ```ts\n * // In emdash-env.d.ts (generated):\n * declare module \"emdash\" {\n * interface EmDashCollections {\n * posts: { title: string; content: PortableTextBlock[]; };\n * pages: { title: string; body: PortableTextBlock[]; };\n * }\n * }\n *\n * // Then in your code:\n * const { entries } = await getEmDashCollection(\"posts\");\n * // entries[0].data.title is typed as string\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface EmDashCollections {}\n\n/**\n * Helper type to infer the data type for a collection.\n * Returns the registered type if known, otherwise falls back to Record<string, unknown>.\n */\nexport type InferCollectionData<T extends string> = T extends keyof EmDashCollections\n\t? EmDashCollections[T]\n\t: Record<string, unknown>;\n\n/**\n * Sort direction\n */\nexport type SortDirection = \"asc\" | \"desc\";\n\n/**\n * Order by specification - field name to direction\n * @example { created_at: \"desc\" } - Sort by created_at descending\n * @example { title: \"asc\" } - Sort by title ascending\n * @example { published_at: \"desc\", title: \"asc\" } - Multi-field sort\n */\nexport type OrderBySpec = Record<string, SortDirection>;\n\nexport type { WhereRange, WhereValue };\n\n/**\n * Fields shared by every collection query, independent of pagination mode.\n *\n * Cursor and offset pagination are mutually exclusive, so they live on the\n * `CursorCollectionFilter` / `OffsetCollectionFilter` variants rather than\n * here. Use the {@link CollectionFilter} union for any value that may be\n * either.\n */\nexport interface CollectionFilterBase {\n\tstatus?: \"draft\" | \"published\" | \"archived\";\n\tlimit?: number;\n\t/**\n\t * Filter by field values, taxonomy terms, byline credits, or ranges.\n\t *\n\t * Taxonomy names are detected automatically and filtered via JOIN.\n\t * The reserved `byline` key filters by byline credit (any credit, not\n\t * just the primary one) via the `_emdash_content_bylines` junction\n\t * table; its value is one or more byline translation groups. This\n\t * matches co-authored entries, which `primary_byline_id` alone misses.\n\t * Other keys are treated as column filters on the content table.\n\t *\n\t * @example { category: 'news' } - Filter by taxonomy term\n\t * @example { category: ['news', 'featured'] } - Filter by multiple terms (OR)\n\t * @example { byline: '01HXYZ...' } - Entries credited to a byline (any position)\n\t * @example { byline: ['01HXYZ...', '01HABC...'] } - Credited to any of these bylines (OR)\n\t * @example { series: 'main' } - Exact match on a content field\n\t * @example { published_at: { gte: '2024-01-01', lt: '2025-01-01' } } - Date range\n\t */\n\twhere?: Record<string, WhereValue>;\n\t/**\n\t * Order results by field(s)\n\t * @default { created_at: \"desc\" }\n\t * @example { created_at: \"desc\" } - Sort by created_at descending (default)\n\t * @example { title: \"asc\" } - Sort by title ascending\n\t * @example { published_at: \"desc\", title: \"asc\" } - Multi-field sort\n\t */\n\torderBy?: OrderBySpec;\n\t/**\n\t * Filter by locale. When set, only returns entries in this locale.\n\t * Only relevant when i18n is configured.\n\t * @example \"en\" — English entries only\n\t * @example \"fr\" — French entries only\n\t */\n\tlocale?: string;\n}\n\n/** Keyset-paginated query filter. Cannot also carry an `offset`. */\nexport interface CursorCollectionFilter extends CollectionFilterBase {\n\t/**\n\t * Opaque cursor for keyset pagination.\n\t * Pass the `nextCursor` value from a previous result to fetch the next page.\n\t * @example\n\t * ```ts\n\t * const cursor = Astro.url.searchParams.get(\"cursor\") ?? undefined;\n\t * const { entries, nextCursor } = await getEmDashCollection(\"posts\", {\n\t * limit: 10,\n\t * cursor,\n\t * });\n\t * ```\n\t */\n\tcursor?: string;\n\toffset?: never;\n}\n\n/** Offset-paginated query filter. Cannot also carry a `cursor`. */\nexport interface OffsetCollectionFilter extends CollectionFilterBase {\n\t/**\n\t * Skip this many entries before returning results (offset pagination).\n\t *\n\t * Use with `limit` to render numbered archive routes like `/page/2`\n\t * without walking cursors or over-fetching from the start:\n\t *\n\t * ```ts\n\t * const perPage = 20;\n\t * const { entries, hasMore } = await getEmDashCollection(\"posts\", {\n\t * limit: perPage,\n\t * offset: (page - 1) * perPage,\n\t * orderBy: { published_at: \"desc\" },\n\t * });\n\t * ```\n\t *\n\t * Only a positive integer applies.\n\t */\n\toffset?: number;\n\tcursor?: never;\n}\n\n/**\n * Filter for `getEmDashCollection`.\n *\n * A union of the cursor and offset pagination variants: supplying both\n * `cursor` and `offset` is a compile-time error, since they are mutually\n * exclusive ways to express \"the next page\" (cursor wins at runtime).\n */\nexport type CollectionFilter = CursorCollectionFilter | OffsetCollectionFilter;\n\nexport interface ContentEntry<T = Record<string, unknown>> {\n\tid: string;\n\tdata: T;\n\t/** Visual editing annotations. Spread onto elements: {...entry.edit.title} */\n\tedit: EditProxy;\n}\n\n/** Cache hint returned by the content loader for route caching */\nexport interface CacheHint {\n\ttags?: string[];\n\tlastModified?: Date;\n}\n\n/**\n * Result from getEmDashCollection\n */\nexport interface CollectionResult<T> {\n\t/** The entries (empty array if error or none found) */\n\tentries: ContentEntry<T>[];\n\t/** Error if the query failed */\n\terror?: Error;\n\t/** Cache hint for route caching (pass to Astro.cache.set()) */\n\tcacheHint: CacheHint;\n\t/**\n\t * Opaque cursor for the next page.\n\t * Undefined when there are no more results.\n\t * Pass this as `cursor` in the next query to get the next page.\n\t */\n\tnextCursor?: string;\n\t/**\n\t * Whether more entries exist beyond this page. Set whenever `limit` is\n\t * provided (cursor or offset pagination), so numbered archive routes can\n\t * render a \"next page\" link without computing a total count.\n\t */\n\thasMore?: boolean;\n}\n\n/**\n * Result from getEmDashEntry\n */\nexport interface EntryResult<T> {\n\t/** The entry, or null if not found */\n\tentry: ContentEntry<T> | null;\n\t/** Error if the query failed (not set for \"not found\", only for actual errors) */\n\terror?: Error;\n\t/** Whether we're in preview mode (valid token was provided) */\n\tisPreview: boolean;\n\t/** Set when a fallback locale was used instead of the requested locale */\n\tfallbackLocale?: string;\n\t/** Cache hint for route caching (pass to Astro.cache.set()) */\n\tcacheHint: CacheHint;\n}\n\nconst COLLECTION_NAME = \"_emdash\";\n\n/** Symbol key for edit metadata on PT arrays — avoids collision with user data */\nconst EMDASH_EDIT = Symbol.for(\"__emdash\");\n\n/** Edit metadata attached to PT arrays in edit mode */\nexport interface EditFieldMeta {\n\tcollection: string;\n\tid: string;\n\tfield: string;\n}\n\n/** Type guard for EditFieldMeta */\nfunction isEditFieldMeta(value: unknown): value is EditFieldMeta {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(\"collection\" in value) || !(\"id\" in value) || !(\"field\" in value)) return false;\n\t// After `in` checks, TS narrows to Record<\"collection\" | \"id\" | \"field\", unknown>\n\tconst { collection, id, field } = value;\n\treturn typeof collection === \"string\" && typeof id === \"string\" && typeof field === \"string\";\n}\n\n/**\n * Read edit metadata from a value (returns undefined if not tagged).\n * Uses Object.getOwnPropertyDescriptor to access Symbol-keyed property\n * without an unsafe type assertion.\n */\nexport function getEditMeta(value: unknown): EditFieldMeta | undefined {\n\tif (value && typeof value === \"object\") {\n\t\tconst desc = Object.getOwnPropertyDescriptor(value, EMDASH_EDIT);\n\t\tconst meta: unknown = desc?.value;\n\t\tif (isEditFieldMeta(meta)) {\n\t\t\treturn meta;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Tag PT-like arrays in entry data with edit metadata (non-enumerable).\n * A PT array is identified by: is an array, first element has _type property.\n */\nfunction tagEditableFields(data: Record<string, unknown>, collection: string, id: string): void {\n\tfor (const [field, value] of Object.entries(data)) {\n\t\tif (\n\t\t\tArray.isArray(value) &&\n\t\t\tvalue.length > 0 &&\n\t\t\tvalue[0] &&\n\t\t\ttypeof value[0] === \"object\" &&\n\t\t\t\"_type\" in value[0]\n\t\t) {\n\t\t\tObject.defineProperty(value, EMDASH_EDIT, {\n\t\t\t\tvalue: { collection, id, field } satisfies EditFieldMeta,\n\t\t\t\tenumerable: false,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t}\n\t}\n}\n\n/** Safely read a string field from a Record, with optional fallback */\nfunction dataStr(data: Record<string, unknown>, key: string, fallback = \"\"): string {\n\tconst val = data[key];\n\treturn typeof val === \"string\" ? val : fallback;\n}\n\n/** Safely read a date-like field from a Record */\nfunction dataDate(data: Record<string, unknown>, key: string): Date | undefined {\n\tconst val = data[key];\n\tif (val instanceof Date) {\n\t\treturn Number.isNaN(val.getTime()) ? undefined : val;\n\t}\n\tif (typeof val !== \"string\" && typeof val !== \"number\") return undefined;\n\tconst date = new Date(val);\n\treturn Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/** Type guard for Record<string, unknown> */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** Extract data as Record from an Astro entry (which is any-typed) */\nfunction entryData(entry: { data?: unknown }): Record<string, unknown> {\n\treturn isRecord(entry.data) ? entry.data : {};\n}\n\n/** Extract the database ID from entry data (data.id is the ULID, entry.id is the slug) */\nfunction entryDatabaseId(entry: { id: string; data?: unknown }): string {\n\tconst d = entryData(entry);\n\treturn dataStr(d, \"id\") || entry.id;\n}\n\n/** Extract edit options from entry data for the proxy */\nfunction entryEditOptions(entry: { data?: unknown }): EditableOptions {\n\tconst data = entryData(entry);\n\tconst status = dataStr(data, \"status\", \"draft\");\n\tconst draftRevisionId = dataStr(data, \"draftRevisionId\") || undefined;\n\tconst liveRevisionId = dataStr(data, \"liveRevisionId\") || undefined;\n\tconst hasDraft = !!draftRevisionId && draftRevisionId !== liveRevisionId;\n\treturn { status, hasDraft };\n}\n\nfunction stripRevisionMetadata(entry: { data?: unknown }): void {\n\tconst data = entryData(entry);\n\tdelete data.draftRevisionId;\n\tdelete data.liveRevisionId;\n}\n\nfunction canExposeRevisionMetadata(\n\tentry: { id: string; data?: unknown },\n\tcollection: string,\n): boolean {\n\tconst ctx = getRequestContext();\n\tif (ctx?.editMode) return true;\n\tif (ctx?.preview?.collection !== collection) return false;\n\tconst dbId = entryDatabaseId(entry);\n\treturn ctx.preview.id === dbId || ctx.preview.id === entry.id;\n}\n\n/**\n * Get all entries of a content type\n *\n * Returns { entries, error } for graceful error handling.\n *\n * When emdash-env.d.ts is generated, the collection name will be\n * type-checked and the return type will be inferred automatically.\n *\n * @example\n * ```ts\n * import { getEmDashCollection } from \"emdash\";\n *\n * const { entries: posts, error } = await getEmDashCollection(\"posts\");\n * if (error) {\n * console.error(\"Failed to load posts:\", error);\n * return;\n * }\n * // posts[0].data.title is typed (if emdash-env.d.ts exists)\n *\n * // With filters\n * const { entries: drafts } = await getEmDashCollection(\"posts\", { status: \"draft\" });\n * ```\n */\nexport async function getEmDashCollection<T extends string, D = InferCollectionData<T>>(\n\ttype: T,\n\tfilter?: CollectionFilter,\n): Promise<CollectionResult<D>> {\n\t// Cache per (type, filter) within a single request. Edit mode and\n\t// preview are request-scoped and stable, so they don't need to be\n\t// part of the key. Widgets and layouts frequently request the same\n\t// collection shape as the page itself (e.g. a \"recent posts\" list\n\t// appears on the home page AND in the sidebar) — caching collapses\n\t// those duplicate queries, along with the bylines and taxonomy-term\n\t// hydration each call would otherwise re-do.\n\t//\n\t// Bucket small limits to a shared minimum so a page with several\n\t// \"recent N posts\" widgets at slightly different limits (e.g. a\n\t// post-detail page asking for 4 in the body and 5 in the sidebar)\n\t// shares one fetch + hydration round-trip rather than running two.\n\t// Cursor-paginated calls are exempt: their limit is part of the\n\t// pagination contract.\n\tconst bucketed = bucketFilter(filter);\n\tconst cached = await requestCached(collectionCacheKey(type, bucketed.fetchFilter), () =>\n\t\tloadCollectionCached<T, D>(type, bucketed.fetchFilter),\n\t);\n\treturn bucketed.requestedLimit === undefined\n\t\t? cached\n\t\t: sliceCollectionResult(cached, bucketed.requestedLimit, filter?.orderBy);\n}\n\n/** Shape of a cached collection snapshot (entries reduced to JSON-safe form). */\ninterface CachedCollectionValue {\n\tentries: unknown[];\n\tnextCursor?: string;\n\thasMore?: boolean;\n\tcacheHint: CacheHint;\n}\n\n/**\n * Distributed (L2) read-through around {@link getEmDashCollectionUncached}.\n *\n * Caches a JSON-safe snapshot keyed by collection + filter + effective locale,\n * folding the shared `bylines`/`taxonomies` epochs into the key so renaming an\n * author or term invalidates affected lists. Errors are never cached.\n */\nasync function loadCollectionCached<T extends string, D = InferCollectionData<T>>(\n\ttype: T,\n\tfilter?: CollectionFilter,\n): Promise<CollectionResult<D>> {\n\tconst snapshot = await cachedQuery<ContentSnapshot<CachedCollectionValue>>({\n\t\tnamespace: contentNamespaces(type),\n\t\tkey: `collection:${collectionCacheKey(type, filter)}|loc=${effectiveLocaleKey(filter)}`,\n\t\tload: async () => {\n\t\t\tconst result = await getEmDashCollectionUncached<T, D>(type, filter);\n\t\t\tif (result.error) {\n\t\t\t\treturn { ok: false, error: result.error, cacheHint: result.cacheHint };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tvalue: {\n\t\t\t\t\tentries: result.entries.map(entrySnapshot),\n\t\t\t\t\tnextCursor: result.nextCursor,\n\t\t\t\t\thasMore: result.hasMore,\n\t\t\t\t\tcacheHint: result.cacheHint,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tcacheable: (snap) => snap.ok,\n\t});\n\n\tif (!snapshot.ok) {\n\t\treturn { entries: [], error: snapshot.error, cacheHint: snapshot.cacheHint };\n\t}\n\treturn {\n\t\tentries: snapshot.value.entries.map((entry) => {\n\t\t\tconst revived = reviveEntry<D>(entry);\n\t\t\tif (!canExposeRevisionMetadata(revived, type)) stripRevisionMetadata(revived);\n\t\t\treturn revived;\n\t\t}),\n\t\tnextCursor: snapshot.value.nextCursor,\n\t\thasMore: snapshot.value.hasMore,\n\t\tcacheHint: snapshot.value.cacheHint,\n\t};\n}\n\n/**\n * Threshold for limit bucketing. Page templates routinely render small\n * \"recent posts\" widgets at limits 3-8; rounding those up to a single\n * shared bucket lets one fetch satisfy several widgets within a request.\n * Above this, the requested limit is honoured exactly — bucketing limit:50\n * to limit:64 would waste hydration work for callers fetching real pages.\n */\nconst BUCKET_LIMIT_THRESHOLD = 10;\n\ninterface BucketedFilter {\n\t/** Filter to pass to the loader (with limit possibly raised). */\n\tfetchFilter: CollectionFilter | undefined;\n\t/** Original limit; defined only when bucketing was applied. */\n\trequestedLimit: number | undefined;\n}\n\n/** @internal exported for unit tests; not part of the public API. */\nexport function bucketFilter(filter: CollectionFilter | undefined): BucketedFilter {\n\tconst limit = filter?.limit;\n\tif (\n\t\tlimit === undefined ||\n\t\tlimit >= BUCKET_LIMIT_THRESHOLD ||\n\t\tlimit <= 0 ||\n\t\tfilter?.cursor !== undefined ||\n\t\t// Offset paginates a deliberate page window; its limit is part of the\n\t\t// pagination contract, so don't round it up the way \"recent N\" widgets get.\n\t\tfilter?.offset !== undefined\n\t) {\n\t\treturn { fetchFilter: filter, requestedLimit: undefined };\n\t}\n\treturn {\n\t\tfetchFilter: { ...filter, limit: BUCKET_LIMIT_THRESHOLD },\n\t\trequestedLimit: limit,\n\t};\n}\n\n/**\n * Slice a cached bucketed result down to the originally-requested limit\n * and recompute `nextCursor` from the row that would have been the\n * over-fetch detector for that limit. When truncation is needed, returns\n * a shallow-copied result with a new `entries` array; otherwise returns\n * the cached result unchanged (including error results and results\n * already within the requested limit).\n */\n/** @internal exported for unit tests; not part of the public API. */\nexport function sliceCollectionResult<D>(\n\tcached: CollectionResult<D>,\n\tlimit: number,\n\torderBy: OrderBySpec | undefined,\n): CollectionResult<D> {\n\tif (cached.error) return cached;\n\tif (cached.entries.length <= limit) return cached;\n\tconst sliced = cached.entries.slice(0, limit);\n\t// Mirror the loader's encoding: cursor points at the last returned row,\n\t// so \"next page\" picks up at the row immediately after it. See\n\t// buildCursorCondition in loader.ts — it filters strictly past this row.\n\tconst lastEntry = sliced.at(-1);\n\tconst nextCursor = lastEntry ? encodeEntryCursor(lastEntry, orderBy) : undefined;\n\t// Truncating to the requested limit means at least one more entry existed.\n\treturn { ...cached, entries: sliced, nextCursor, hasMore: true };\n}\n\n/** Map of database column names to camelCase keys present on entry.data. */\nconst ENTRY_DATA_KEY_MAP: Record<string, string> = {\n\tcreated_at: \"createdAt\",\n\tupdated_at: \"updatedAt\",\n\tpublished_at: \"publishedAt\",\n\tscheduled_at: \"scheduledAt\",\n\tauthor_id: \"authorId\",\n\tprimary_byline_id: \"primaryBylineId\",\n};\n\n// Mirror loader.ts FIELD_NAME_PATTERN. Kept in sync intentionally — diverging\n// would let the encoder accept a field name the loader's getPrimarySort then\n// rejected, producing a cursor that paginates against a different column.\nconst FIELD_NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\n/**\n * Encode a `nextCursor` from a content entry, mirroring the loader's\n * encoding scheme: `(orderValue, id)` where `orderValue` is the primary\n * sort field's stringified value. For date columns, reads the raw DB\n * string the loader stashed via CURSOR_RAW_VALUES — round-tripping the\n * parsed Date through `toISOString()` would lose precision for stored\n * values that aren't already ISO-with-milliseconds.\n */\nfunction encodeEntryCursor<D>(\n\tentry: ContentEntry<D>,\n\torderBy: OrderBySpec | undefined,\n): string | undefined {\n\tconst data = entryData(entry);\n\tconst id = dataStr(data, \"id\");\n\tif (!id) return undefined;\n\n\t// Match loader.ts getPrimarySort: take the first valid field, default to created_at.\n\tlet dbField = \"created_at\";\n\tif (orderBy) {\n\t\tfor (const field of Object.keys(orderBy)) {\n\t\t\tif (FIELD_NAME_PATTERN.test(field)) {\n\t\t\t\tdbField = field;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Date columns: prefer the raw stored string captured by the loader so\n\t// the cursor matches what a direct loader fetch would emit, regardless\n\t// of how the DB stored the timestamp.\n\tconst rawDateValuesRaw = Reflect.get(data, CURSOR_RAW_VALUES);\n\tif (rawDateValuesRaw !== null && typeof rawDateValuesRaw === \"object\") {\n\t\tconst raw = Reflect.get(rawDateValuesRaw, dbField);\n\t\tif (typeof raw === \"string\") return encodeCursor(raw, id);\n\t}\n\n\tconst dataKey = ENTRY_DATA_KEY_MAP[dbField] ?? dbField;\n\tconst value = data[dataKey];\n\tlet orderValue: string;\n\tif (value instanceof Date) {\n\t\torderValue = value.toISOString();\n\t} else if (typeof value === \"string\" || typeof value === \"number\") {\n\t\torderValue = String(value);\n\t} else {\n\t\t// Match the loader's empty-string fallback for null/undefined order\n\t\t// values so cursor decoding stays valid even at the boundary.\n\t\torderValue = \"\";\n\t}\n\treturn encodeCursor(orderValue, id);\n}\n\n/**\n * Build a canonical cache key for `getEmDashCollection`.\n *\n * `JSON.stringify` is insertion-order-sensitive, so two callers passing\n * semantically identical filters with different key orders would miss\n * the cache. We fix the top-level field order and sort `where` keys\n * (order there is irrelevant), while preserving `orderBy` key order\n * because that's the sort priority.\n */\nfunction collectionCacheKey(type: string, filter?: CollectionFilter): string {\n\tif (!filter) return `collection:${type}:`;\n\tconst parts = [\n\t\tfilter.status ?? \"\",\n\t\tfilter.limit ?? \"\",\n\t\tfilter.cursor ?? \"\",\n\t\tfilter.offset ?? \"\",\n\t\tfilter.where ? stableStringify(filter.where) : \"\",\n\t\tfilter.orderBy ? JSON.stringify(filter.orderBy) : \"\",\n\t\tfilter.locale ?? \"\",\n\t];\n\treturn `collection:${type}:${parts.join(\"|\")}`;\n}\n\nfunction stableStringify(value: Record<string, unknown>): string {\n\treturn JSON.stringify(stableOrder(value));\n}\n\nfunction stableOrder(value: Record<string, unknown>): Record<string, unknown> {\n\tconst keys = Object.keys(value).toSorted();\n\tconst ordered: Record<string, unknown> = {};\n\tfor (const k of keys) {\n\t\tconst v = value[k];\n\t\tif (isRecord(v)) {\n\t\t\tordered[k] = stableOrder(v);\n\t\t} else {\n\t\t\tordered[k] = v;\n\t\t}\n\t}\n\treturn ordered;\n}\n\n// ── Object-cache (L2) serialization for content reads ───────────────────────\n//\n// Content entries can't be stored verbatim: each carries a non-serializable\n// `edit` proxy (a function) and a non-enumerable `CURSOR_RAW_VALUES` symbol on\n// `data` (raw date strings used to reproduce the loader's pagination cursor).\n// We reduce each entry to a JSON-safe snapshot before caching — copying the\n// cursor-raw values into an enumerable field and dropping `edit` — then rebuild\n// the symbol and re-attach a no-op `edit` on the way out. The object cache's\n// codec preserves `Date` instances, so timestamps survive the round-trip.\n//\n// L2 is only consulted for anonymous, non-preview, non-edit requests (see\n// `shouldBypass` in object-cache), where `edit` is always the no-op variant —\n// so dropping and recreating it is lossless.\n\n/** Enumerable field carrying the {@link CURSOR_RAW_VALUES} payload in snapshots. */\nconst CURSOR_RAW_FIELD = \"__emdashCursorRaw\";\n\n/** Result wrapper distinguishing a cached error from a cacheable success. */\ntype ContentSnapshot<S> =\n\t| { ok: true; value: S }\n\t| { ok: false; error?: Error; cacheHint: CacheHint };\n\nfunction entrySnapshot<D>(entry: ContentEntry<D>): Record<string, unknown> {\n\tconst data = entryData(entry);\n\tconst rawCursor = Reflect.get(data, CURSOR_RAW_VALUES);\n\t// Drop the `edit` function; copy enumerable data + the cursor-raw values.\n\tconst { edit: _edit, ...rest } = entry as ContentEntry<D> & { edit?: unknown };\n\treturn {\n\t\t...rest,\n\t\tdata: { ...data, [CURSOR_RAW_FIELD]: rawCursor ?? {} },\n\t};\n}\n\nfunction reviveEntry<D>(raw: unknown): ContentEntry<D> {\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- snapshot shape produced by entrySnapshot\n\tconst entry = raw as Record<string, unknown>;\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- snapshot `data` is always a record\n\tconst data: Record<string, unknown> = { ...(entry.data as Record<string, unknown>) };\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- snapshot field written by entrySnapshot\n\tconst rawCursor = (data[CURSOR_RAW_FIELD] as Record<string, string> | undefined) ?? {};\n\tdelete data[CURSOR_RAW_FIELD];\n\tObject.defineProperty(data, CURSOR_RAW_VALUES, {\n\t\tvalue: rawCursor,\n\t\tenumerable: false,\n\t\tconfigurable: false,\n\t\twritable: false,\n\t});\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- rebuilt to the ContentEntry shape with a no-op edit proxy\n\treturn { ...entry, data, edit: createNoop() } as ContentEntry<D>;\n}\n\n/** Resolve the effective locale used by content reads, for the L2 cache key. */\nfunction effectiveLocaleKey(filter?: { locale?: string }): string {\n\tconst ctx = getRequestContext();\n\tconst i18nConfig = getI18nConfig();\n\treturn (\n\t\tfilter?.locale ?? ctx?.locale ?? (isI18nEnabled() ? i18nConfig!.defaultLocale : undefined) ?? \"\"\n\t);\n}\n\nasync function getEmDashCollectionUncached<T extends string, D = InferCollectionData<T>>(\n\ttype: T,\n\tfilter?: CollectionFilter,\n): Promise<CollectionResult<D>> {\n\t// Dynamic import to avoid build-time issues\n\tconst { getLiveCollection } = await import(\"astro:content\");\n\n\t// Resolve locale: explicit filter > ALS context > defaultLocale (when i18n enabled)\n\t// Without this, queries return all locale rows, producing broken IDs\n\tconst ctx = getRequestContext();\n\tconst i18nConfig = getI18nConfig();\n\tconst resolvedLocale =\n\t\tfilter?.locale ?? ctx?.locale ?? (isI18nEnabled() ? i18nConfig!.defaultLocale : undefined);\n\n\tconst requestedLimit = filter?.limit;\n\t// cursor and offset are mutually exclusive on the loader filter union, so\n\t// spread only the one in play (cursor wins) rather than emitting both keys.\n\tconst pageParam =\n\t\tfilter?.cursor !== undefined\n\t\t\t? { cursor: filter.cursor }\n\t\t\t: filter?.offset !== undefined\n\t\t\t\t? { offset: filter.offset }\n\t\t\t\t: {};\n\tconst result = await getLiveCollection(COLLECTION_NAME, {\n\t\ttype,\n\t\tstatus: filter?.status,\n\t\tlimit: requestedLimit && requestedLimit > 0 ? requestedLimit + 1 : filter?.limit,\n\t\t...pageParam,\n\t\twhere: filter?.where,\n\t\torderBy: filter?.orderBy,\n\t\tlocale: resolvedLocale,\n\t});\n\n\tconst { entries, error, cacheHint } = result;\n\n\tif (error) {\n\t\treturn { entries: [], error, cacheHint: {} };\n\t}\n\n\tconst hasMore = requestedLimit != null && requestedLimit > 0 && entries.length > requestedLimit;\n\tconst pageEntries = hasMore ? entries.slice(0, requestedLimit) : entries;\n\tconst nextCursor = hasMore ? encodeEntryCursor(pageEntries.at(-1), filter?.orderBy) : undefined;\n\t// `hasMore` is only meaningful when a limit bounds the page; otherwise the\n\t// query returned everything and there is no \"next page\" to report.\n\tconst hasMoreResult = requestedLimit != null && requestedLimit > 0 ? hasMore : undefined;\n\n\tconst isEditMode = ctx?.editMode ?? false;\n\tconst entriesWithEdit = pageEntries.map((entry: ContentEntry<D>) => {\n\t\tconst dbId = entryDatabaseId(entry);\n\t\tif (isEditMode) {\n\t\t\ttagEditableFields(entryData(entry), type, dbId);\n\t\t}\n\t\tif (!canExposeRevisionMetadata(entry, type)) {\n\t\t\tstripRevisionMetadata(entry);\n\t\t}\n\t\treturn {\n\t\t\t...entry,\n\t\t\tedit: isEditMode ? createEditable(type, dbId, entryEditOptions(entry)) : createNoop(),\n\t\t};\n\t});\n\n\t// Eagerly hydrate bylines and taxonomy terms for all entries in parallel.\n\t// Both are independent queries, so running them concurrently halves the\n\t// round-trip cost on remote databases (D1 replicas, etc.).\n\tawait Promise.all([\n\t\thydrateEntryBylines(type, entriesWithEdit),\n\t\t// Hydrate terms in the same locale the content rows were resolved to,\n\t\t// otherwise localized entries get default-locale taxonomy terms (#1441).\n\t\thydrateEntryTerms(type, entriesWithEdit, resolvedLocale),\n\t]);\n\n\treturn {\n\t\tentries: entriesWithEdit,\n\t\tnextCursor,\n\t\thasMore: hasMoreResult,\n\t\tcacheHint: cacheHint ?? {},\n\t};\n}\n\n/**\n * Get a single entry by type and ID/slug\n *\n * Returns { entry, error, isPreview } for graceful error handling.\n * - entry is null if not found (not an error)\n * - error is set only for actual errors (db issues, etc.)\n *\n * Preview mode is detected automatically from request context (ALS).\n * When the URL has a valid `_preview` token, the middleware sets preview\n * context and this function serves draft revision data if available.\n *\n * @example\n * ```ts\n * import { getEmDashEntry } from \"emdash\";\n *\n * // Simple usage — preview just works via middleware\n * const { entry: post, isPreview, error } = await getEmDashEntry(\"posts\", \"my-slug\");\n * if (!post) return Astro.redirect(\"/404\");\n * ```\n */\nexport async function getEmDashEntry<T extends string, D = InferCollectionData<T>>(\n\ttype: T,\n\tid: string,\n\toptions?: { locale?: string },\n): Promise<EntryResult<D>> {\n\t// Dynamic import to avoid build-time issues\n\tconst { getLiveEntry } = await import(\"astro:content\");\n\n\t// Check ALS for preview and edit mode context\n\tconst ctx = getRequestContext();\n\tconst preview = ctx?.preview;\n\tconst isEditMode = ctx?.editMode ?? false;\n\tconst isPreviewMode = !!preview && preview.collection === type;\n\t// Edit mode implies preview — editors should see draft content\n\tconst serveDrafts = isPreviewMode || isEditMode;\n\n\t// Resolve locale: explicit option > ALS context > undefined (no filter)\n\tconst requestedLocale = options?.locale ?? ctx?.locale;\n\n\t/** Wrap a raw Astro entry with edit proxy, tagging editable fields if needed */\n\tfunction wrapEntry(raw: ContentEntry<D>): ContentEntry<D> {\n\t\tconst dbId = entryDatabaseId(raw);\n\t\tif (isEditMode) {\n\t\t\ttagEditableFields(entryData(raw), type, dbId);\n\t\t}\n\t\treturn {\n\t\t\t...raw,\n\t\t\tedit: isEditMode ? createEditable(type, dbId, entryEditOptions(raw)) : createNoop(),\n\t\t};\n\t}\n\n\t/** Check if an entry is publicly visible (published or scheduled past its time) */\n\tfunction isVisible(entry: ContentEntry<D>): boolean {\n\t\tconst data = entryData(entry);\n\t\tconst status = dataStr(data, \"status\");\n\t\tconst scheduledAt = dataDate(data, \"scheduledAt\");\n\t\tconst isPublished = status === \"published\";\n\t\tconst isScheduledAndReady =\n\t\t\tstatus === \"scheduled\" && scheduledAt !== undefined && scheduledAt.getTime() <= Date.now();\n\t\treturn isPublished || !!isScheduledAndReady;\n\t}\n\n\t/** True when an entry is scheduled to become visible at a future time. */\n\tfunction isPendingScheduled(entry: ContentEntry<D>): boolean {\n\t\tconst data = entryData(entry);\n\t\tif (dataStr(data, \"status\") !== \"scheduled\") return false;\n\t\tconst scheduledAt = dataDate(data, \"scheduledAt\");\n\t\treturn scheduledAt !== undefined && scheduledAt.getTime() > Date.now();\n\t}\n\n\t// Build the fallback chain: [requestedLocale, fallback1, ..., defaultLocale]\n\t// When i18n is disabled or no locale requested, just use a single-element chain\n\tconst localeChain =\n\t\trequestedLocale && isI18nEnabled() ? getFallbackChain(requestedLocale) : [requestedLocale];\n\n\t/** Return a successful EntryResult with bylines and taxonomy terms hydrated */\n\tasync function successResult(\n\t\twrapped: ContentEntry<D>,\n\t\topts: { isPreview: boolean; fallbackLocale?: string; cacheHint: CacheHint },\n\t): Promise<EntryResult<D>> {\n\t\tif (!opts.isPreview) stripRevisionMetadata(wrapped);\n\t\t// Hydrate terms in the entry's resolved locale (fallback-aware) so a\n\t\t// localized entry never picks up default-locale taxonomy terms (#1441).\n\t\t// When i18n is disabled we leave the locale unset to preserve the\n\t\t// legacy \"do not filter by locale\" behaviour.\n\t\tconst termLocale = isI18nEnabled()\n\t\t\t? dataStr(entryData(wrapped), \"locale\") || undefined\n\t\t\t: undefined;\n\t\tawait Promise.all([\n\t\t\thydrateEntryBylines(type, [wrapped]),\n\t\t\thydrateEntryTerms(type, [wrapped], termLocale),\n\t\t]);\n\t\treturn {\n\t\t\tentry: wrapped,\n\t\t\tisPreview: opts.isPreview,\n\t\t\tfallbackLocale: opts.fallbackLocale,\n\t\t\tcacheHint: opts.cacheHint,\n\t\t};\n\t}\n\n\tif (serveDrafts) {\n\t\t// Draft mode: try each locale in the fallback chain\n\t\tfor (let i = 0; i < localeChain.length; i++) {\n\t\t\tconst locale = localeChain[i];\n\t\t\tconst fallbackLocale = i > 0 ? locale : undefined;\n\n\t\t\tconst {\n\t\t\t\tentry: baseEntry,\n\t\t\t\terror: baseError,\n\t\t\t\tcacheHint,\n\t\t\t} = await getLiveEntry(COLLECTION_NAME, {\n\t\t\t\ttype,\n\t\t\t\tid,\n\t\t\t\tlocale,\n\t\t\t});\n\n\t\t\tif (baseError) {\n\t\t\t\treturn { entry: null, error: baseError, isPreview: serveDrafts, cacheHint: {} };\n\t\t\t}\n\n\t\t\tif (!baseEntry) continue; // Try next locale in chain\n\n\t\t\t// Preview tokens are item-scoped: verify the resolved entry matches.\n\t\t\t// Edit mode (authenticated editors) has collection-wide draft access.\n\t\t\tif (isPreviewMode && !isEditMode) {\n\t\t\t\tconst dbId = entryDatabaseId(baseEntry);\n\t\t\t\tif (preview.id !== dbId && preview.id !== id) {\n\t\t\t\t\t// Token doesn't match — serve only if publicly visible, without draft access\n\t\t\t\t\tif (isVisible(baseEntry)) {\n\t\t\t\t\t\treturn successResult(wrapEntry(baseEntry), {\n\t\t\t\t\t\t\tisPreview: false,\n\t\t\t\t\t\t\tfallbackLocale,\n\t\t\t\t\t\t\tcacheHint: cacheHint ?? {},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// Not visible — try next locale in fallback chain\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if entry has a draft revision — if so, re-fetch with revision data\n\t\t\tconst baseData = entryData(baseEntry);\n\t\t\tconst draftRevisionId = dataStr(baseData, \"draftRevisionId\") || undefined;\n\n\t\t\tif (draftRevisionId) {\n\t\t\t\tconst { entry: draftEntry, error: draftError } = await getLiveEntry(COLLECTION_NAME, {\n\t\t\t\t\ttype,\n\t\t\t\t\tid,\n\t\t\t\t\trevisionId: draftRevisionId,\n\t\t\t\t\tlocale,\n\t\t\t\t});\n\n\t\t\t\tif (!draftError && draftEntry) {\n\t\t\t\t\treturn successResult(wrapEntry(draftEntry), {\n\t\t\t\t\t\tisPreview: serveDrafts,\n\t\t\t\t\t\tfallbackLocale,\n\t\t\t\t\t\tcacheHint: cacheHint ?? {},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn successResult(wrapEntry(baseEntry), {\n\t\t\t\tisPreview: serveDrafts,\n\t\t\t\tfallbackLocale,\n\t\t\t\tcacheHint: cacheHint ?? {},\n\t\t\t});\n\t\t}\n\n\t\t// No entry found in any locale\n\t\treturn { entry: null, isPreview: serveDrafts, cacheHint: {} };\n\t}\n\n\t// Normal mode: try each locale in the fallback chain, only return published\n\t// content. The full resolution (fallback chain + visibility + byline/term\n\t// hydration) is wrapped in the distributed L2 cache, keyed by the requested\n\t// locale. Preview/edit requests took the `serveDrafts` branch above and\n\t// never reach here; the object cache additionally bypasses them.\n\t// A scheduled entry becomes visible on a future clock tick, not on a write,\n\t// so an L2 snapshot taken before its time would keep it hidden past go-live\n\t// (until the publish sweep bumps the epoch or the TTL lapses). Mark such a\n\t// resolution time-sensitive and skip caching it.\n\tlet timeSensitive = false;\n\n\tconst resolveNormal = async (): Promise<EntryResult<D>> => {\n\t\tfor (let i = 0; i < localeChain.length; i++) {\n\t\t\tconst locale = localeChain[i];\n\t\t\tconst fallbackLocale = i > 0 ? locale : undefined;\n\n\t\t\tconst { entry, error, cacheHint } = await getLiveEntry(COLLECTION_NAME, { type, id, locale });\n\t\t\tif (error) {\n\t\t\t\treturn { entry: null, error, isPreview: false, cacheHint: {} };\n\t\t\t}\n\n\t\t\tif (entry && isVisible(entry)) {\n\t\t\t\treturn successResult(wrapEntry(entry), {\n\t\t\t\t\tisPreview: false,\n\t\t\t\t\tfallbackLocale,\n\t\t\t\t\tcacheHint: cacheHint ?? {},\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (entry && isPendingScheduled(entry)) {\n\t\t\t\ttimeSensitive = true;\n\t\t\t}\n\t\t\t// Entry not found or not visible in this locale — try next\n\t\t}\n\t\treturn { entry: null, isPreview: false, cacheHint: {} };\n\t};\n\n\tconst snapshot = await cachedQuery<ContentSnapshot<CachedEntryValue>>({\n\t\tnamespace: contentNamespaces(type),\n\t\tkey: `entry:${id}|loc=${requestedLocale ?? \"\"}`,\n\t\tload: async () => {\n\t\t\tconst result = await resolveNormal();\n\t\t\tif (result.error) {\n\t\t\t\treturn { ok: false, error: result.error, cacheHint: result.cacheHint };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tok: true,\n\t\t\t\tvalue: {\n\t\t\t\t\tentry: result.entry ? entrySnapshot(result.entry) : null,\n\t\t\t\t\tisPreview: result.isPreview,\n\t\t\t\t\tfallbackLocale: result.fallbackLocale,\n\t\t\t\t\tcacheHint: result.cacheHint,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tcacheable: (snap) => snap.ok && !timeSensitive,\n\t});\n\n\tif (!snapshot.ok) {\n\t\treturn { entry: null, error: snapshot.error, isPreview: false, cacheHint: snapshot.cacheHint };\n\t}\n\tconst revived = snapshot.value.entry ? reviveEntry<D>(snapshot.value.entry) : null;\n\tif (revived && !canExposeRevisionMetadata(revived, type)) stripRevisionMetadata(revived);\n\treturn {\n\t\tentry: revived,\n\t\tisPreview: snapshot.value.isPreview,\n\t\tfallbackLocale: snapshot.value.fallbackLocale,\n\t\tcacheHint: snapshot.value.cacheHint,\n\t};\n}\n\n/** Shape of a cached single-entry snapshot. */\ninterface CachedEntryValue {\n\tentry: Record<string, unknown> | null;\n\tisPreview: boolean;\n\tfallbackLocale?: string;\n\tcacheHint: CacheHint;\n}\n\n/**\n * Eagerly hydrate byline data onto entry.data for one or more entries.\n *\n * Attaches `bylines` (array of ContentBylineCredit) and `byline`\n * (primary BylineSummary or null) to each entry's data object.\n * Uses batch queries to avoid N+1.\n *\n * Fails silently if the byline tables don't exist yet (pre-migration).\n */\nasync function hydrateEntryBylines<D>(type: string, entries: ContentEntry<D>[]): Promise<void> {\n\tif (entries.length === 0) return;\n\n\t// Fast path: bylines were folded into the content query. Parse the JSON\n\t// (no extra round trip) for the common case — explicit credits, no byline\n\t// custom fields, no author fallback. The query path below handles the rest:\n\t// - author fallback (entry has authorId but no explicit credit), and\n\t// - custom byline fields (can't be expressed in the folded subquery).\n\tif (entries.every((e) => FOLDED_BYLINES in entryData(e))) {\n\t\tconst parsed = entries.map((entry) => {\n\t\t\tconst data = entryData(entry);\n\t\t\tconst folded = Reflect.get(data, FOLDED_BYLINES);\n\t\t\tconst rows = Array.isArray(folded) ? folded : [];\n\t\t\tconst credits = rows\n\t\t\t\t.map((raw) => {\n\t\t\t\t\tconst b = raw?.byline ?? {};\n\t\t\t\t\treturn {\n\t\t\t\t\t\troleLabel: raw?.roleLabel ?? null,\n\t\t\t\t\t\tsortOrder: Number(raw?.sortOrder ?? 0),\n\t\t\t\t\t\tsource: \"explicit\" as const,\n\t\t\t\t\t\tbyline: { ...b, isGuest: Boolean(b.isGuest), customFields: {} },\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.toSorted((a, b) => a.sortOrder - b.sortOrder);\n\t\t\treturn { data, credits };\n\t\t});\n\n\t\t// Fall back to the full query path when the fold can't be trusted to be\n\t\t// complete: an entry with a byline reference (explicit primary, or an\n\t\t// author for the author-fallback) but no folded credits — e.g. a credit\n\t\t// in a different locale than the row, which the locale-correlated subquery\n\t\t// skips, or the author-fallback path which the fold doesn't express.\n\t\tlet needsQueryPath = parsed.some(\n\t\t\t(p) =>\n\t\t\t\tp.credits.length === 0 &&\n\t\t\t\t(dataStr(p.data, \"authorId\") !== \"\" || dataStr(p.data, \"primaryBylineId\") !== \"\"),\n\t\t);\n\t\tlet hasCustomFields = false;\n\t\tif (!needsQueryPath) {\n\t\t\ttry {\n\t\t\t\tconst { getDb } = await import(\"./loader.js\");\n\t\t\t\tconst db = await getDb();\n\t\t\t\tconst { getBylineFieldDefs } = await import(\"./bylines/field-defs-cache.js\");\n\t\t\t\thasCustomFields = (await getBylineFieldDefs(db)).length > 0;\n\t\t\t} catch (error) {\n\t\t\t\t// A missing table is expected pre-migration and means there are no\n\t\t\t\t// custom fields — the fold's values are complete. Any other error\n\t\t\t\t// (lock-init failure, dialect error) means the probe can't be\n\t\t\t\t// trusted, so fall back to the query path rather than risk serving\n\t\t\t\t// folded bylines with empty customFields.\n\t\t\t\tif (!isMissingTableError(error)) needsQueryPath = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!needsQueryPath && !hasCustomFields) {\n\t\t\tfor (const p of parsed) {\n\t\t\t\tp.data.bylines = p.credits;\n\t\t\t\tp.data.byline = p.credits[0]?.byline ?? null;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// Fall through to the full query path for fallback / custom-field cases.\n\t}\n\n\ttry {\n\t\tconst { getBylinesForEntries } = await import(\"./bylines/index.js\");\n\n\t\tconst refs = entries\n\t\t\t.map((e) => {\n\t\t\t\tconst data = entryData(e);\n\t\t\t\tconst id = dataStr(data, \"id\");\n\t\t\t\tif (!id) return null;\n\t\t\t\treturn {\n\t\t\t\t\tid,\n\t\t\t\t\tauthorId: dataStr(data, \"authorId\") || null,\n\t\t\t\t\tprimaryBylineId: dataStr(data, \"primaryBylineId\") || null,\n\t\t\t\t\tlocale: dataStr(data, \"locale\") || null,\n\t\t\t\t};\n\t\t\t})\n\t\t\t.filter(\n\t\t\t\t(\n\t\t\t\t\tr,\n\t\t\t\t): r is {\n\t\t\t\t\tid: string;\n\t\t\t\t\tauthorId: string | null;\n\t\t\t\t\tprimaryBylineId: string | null;\n\t\t\t\t\tlocale: string | null;\n\t\t\t\t} => r !== null,\n\t\t\t);\n\t\tif (refs.length === 0) return;\n\n\t\tconst bylinesMap = await getBylinesForEntries(type, refs);\n\n\t\tfor (const entry of entries) {\n\t\t\tconst data = entryData(entry);\n\t\t\tconst dbId = dataStr(data, \"id\");\n\t\t\tif (!dbId) continue;\n\n\t\t\tconst credits = bylinesMap.get(dbId) ?? [];\n\t\t\tdata.bylines = credits;\n\t\t\tdata.byline = credits[0]?.byline ?? null;\n\t\t}\n\t} catch (err) {\n\t\t// Only swallow \"table not found\" errors from pre-migration databases.\n\t\t// Matches SQLite/D1 (\"no such table\") and PostgreSQL (\"relation/table\n\t\t// ... does not exist\") via the shared helper.\n\t\tif (!isMissingTableError(err)) {\n\t\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\t\tconsole.warn(\"[emdash] Failed to hydrate bylines:\", msg);\n\t\t}\n\t}\n}\n\n/**\n * Eagerly hydrate taxonomy term data onto entry.data for one or more entries.\n *\n * Attaches `terms` (Record keyed by taxonomy name with an array of TaxonomyTerm\n * values) to each entry's data object. Uses a single batched JOIN query across\n * all taxonomies so the cost is O(1) regardless of the number of entries or\n * taxonomies on the site.\n *\n * This eliminates the common N+1 pattern where templates loop over list\n * results and call getEntryTerms() per entry. With hydration, the list page\n * stays at a single round-trip for term data.\n *\n * `locale` must be the locale the entries were resolved to. It is forwarded to\n * `getAllTermsForEntries` so terms are returned in the entry's locale rather\n * than falling back to the request-context / default locale (#1441). Pass\n * `undefined` to keep the legacy \"do not filter by locale\" behaviour.\n *\n * Fails silently if the taxonomy tables don't exist yet (pre-migration).\n */\nasync function hydrateEntryTerms<D>(\n\ttype: string,\n\tentries: ContentEntry<D>[],\n\tlocale?: string,\n): Promise<void> {\n\tif (entries.length === 0) return;\n\n\t// Fast path: terms were folded into the content query. Group the JSON and\n\t// skip the separate content_taxonomies query.\n\tif (entries.every((e) => FOLDED_TERMS in entryData(e))) {\n\t\tconst perEntry: Array<{ entryId: string; byTaxonomy: Record<string, TaxonomyTerm[]> }> = [];\n\t\tfor (const entry of entries) {\n\t\t\tconst data = entryData(entry);\n\t\t\tconst folded = Reflect.get(data, FOLDED_TERMS);\n\t\t\tconst rows = Array.isArray(folded) ? folded : [];\n\t\t\tconst grouped: Record<string, TaxonomyTerm[]> = {};\n\t\t\tfor (const r of rows) {\n\t\t\t\tconst name = String(r?.name);\n\t\t\t\t(grouped[name] ??= []).push({\n\t\t\t\t\tid: r?.id,\n\t\t\t\t\tname,\n\t\t\t\t\tslug: r?.slug,\n\t\t\t\t\tlabel: r?.label,\n\t\t\t\t\tparentId: r?.parent_id ?? undefined,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\tlocale: r?.locale,\n\t\t\t\t\ttranslationGroup: r?.translation_group,\n\t\t\t\t});\n\t\t\t}\n\t\t\t// Match getAllTermsForEntries' ORDER BY label (dropped from the\n\t\t\t// aggregate since SQLite and Postgres order it differently).\n\t\t\tfor (const [name, arr] of Object.entries(grouped)) {\n\t\t\t\tgrouped[name] = arr.toSorted((a, b) => String(a.label).localeCompare(String(b.label)));\n\t\t\t}\n\t\t\tdata.terms = grouped;\n\t\t\tconst entryId = dataStr(data, \"id\");\n\t\t\tif (entryId) perEntry.push({ entryId, byTaxonomy: grouped });\n\t\t}\n\t\t// Prime the per-entry request cache (wildcard + present taxonomies) so\n\t\t// subsequent getEntryTerms(...) calls in this render hit the cache instead\n\t\t// of issuing an N+1 query. No DB lookup — purely from the folded data.\n\t\tconst { primeFoldedEntryTerms } = await import(\"./taxonomies/index.js\");\n\t\tprimeFoldedEntryTerms(type, perEntry, { locale });\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst { getAllTermsForEntries } = await import(\"./taxonomies/index.js\");\n\n\t\tconst ids = entries.map((e) => dataStr(entryData(e), \"id\")).filter(Boolean);\n\t\tif (ids.length === 0) return;\n\n\t\tconst termsMap = await getAllTermsForEntries(type, ids, { locale });\n\n\t\tfor (const entry of entries) {\n\t\t\tconst data = entryData(entry);\n\t\t\tconst dbId = dataStr(data, \"id\");\n\t\t\tif (!dbId) continue;\n\n\t\t\tdata.terms = termsMap.get(dbId) ?? {};\n\t\t}\n\t} catch (err) {\n\t\t// Only swallow \"table not found\" errors from pre-migration databases.\n\t\t// Matches SQLite/D1 (\"no such table\") and PostgreSQL (\"relation/table\n\t\t// ... does not exist\") via the shared helper.\n\t\tif (!isMissingTableError(err)) {\n\t\t\tconst msg = err instanceof Error ? err.message : String(err);\n\t\t\tconsole.warn(\"[emdash] Failed to hydrate terms:\", msg);\n\t\t}\n\t}\n}\n\n/**\n * Translation summary for a single locale variant\n */\nexport interface TranslationSummary {\n\t/** Content item ID */\n\tid: string;\n\t/** Locale code (e.g. \"en\", \"fr\") */\n\tlocale: string;\n\t/** URL slug */\n\tslug: string | null;\n\t/** Current status */\n\tstatus: string;\n}\n\n/**\n * Result from getTranslations\n */\nexport interface TranslationsResult {\n\t/** The translation group ID (shared across locales) */\n\ttranslationGroup: string;\n\t/** All locale variants in this group */\n\ttranslations: TranslationSummary[];\n\t/** Error if the query failed */\n\terror?: Error;\n}\n\n/**\n * Get all translations of a content item.\n *\n * Given a content entry, returns all locale variants that share the same\n * translation group. This is useful for building language switcher UI.\n *\n * @example\n * ```ts\n * import { getEmDashEntry, getTranslations } from \"emdash\";\n *\n * const { entry: post } = await getEmDashEntry(\"posts\", \"hello-world\", { locale: \"en\" });\n * const { translations } = await getTranslations(\"posts\", post.data.id);\n * // translations = [{ id: \"...\", locale: \"en\", slug: \"hello-world\", status: \"published\" }, ...]\n * ```\n */\nexport async function getTranslations(type: string, id: string): Promise<TranslationsResult> {\n\ttry {\n\t\tconst db = (await import(\"./loader.js\")).getDb;\n\t\tconst dbInstance = await db();\n\t\tconst { ContentRepository } = await import(\"./database/repositories/content.js\");\n\t\tconst repo = new ContentRepository(dbInstance);\n\n\t\t// Find the item to get its translation group\n\t\tconst item = await repo.findByIdOrSlug(type, id);\n\t\tif (!item) {\n\t\t\treturn {\n\t\t\t\ttranslationGroup: \"\",\n\t\t\t\ttranslations: [],\n\t\t\t\terror: new Error(`Content item not found: ${id}`),\n\t\t\t};\n\t\t}\n\n\t\tconst group = item.translationGroup || item.id;\n\t\tconst translations = await repo.findTranslations(type, group);\n\n\t\treturn {\n\t\t\ttranslationGroup: group,\n\t\t\ttranslations: translations.map((t) => ({\n\t\t\t\tid: t.id,\n\t\t\t\tlocale: t.locale || \"en\",\n\t\t\t\tslug: t.slug,\n\t\t\t\tstatus: t.status,\n\t\t\t})),\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\ttranslationGroup: \"\",\n\t\t\ttranslations: [],\n\t\t\terror: error instanceof Error ? error : new Error(String(error)),\n\t\t};\n\t}\n}\n\n/**\n * Result from resolveEmDashPath\n */\nexport interface ResolvePathResult<T = Record<string, unknown>> {\n\t/** The matched entry */\n\tentry: ContentEntry<T>;\n\t/** The collection slug that matched */\n\tcollection: string;\n\t/** Extracted parameters from the URL pattern (e.g. { slug: \"my-post\" }) */\n\tparams: Record<string, string>;\n}\n\n/** Matches `{paramName}` placeholders in URL patterns */\nconst URL_PARAM_PATTERN = /\\{(\\w+)\\}/g;\n\n/** Convert a URL pattern like \"/blog/{slug}\" to a regex and param name list */\nfunction patternToRegex(pattern: string): { regex: RegExp; paramNames: string[] } {\n\tconst paramNames: string[] = [];\n\tconst regexStr = pattern.replace(URL_PARAM_PATTERN, (_match, name: string) => {\n\t\tparamNames.push(name);\n\t\treturn \"([^/]+)\";\n\t});\n\treturn { regex: new RegExp(`^${regexStr}$`), paramNames };\n}\n\n/** Cached compiled URL patterns for resolveEmDashPath */\ninterface CachedPattern {\n\tslug: string;\n\tregex: RegExp;\n\tparamNames: string[];\n}\nlet cachedUrlPatterns: CachedPattern[] | null = null;\n\n/**\n * Invalidate the cached URL patterns used by resolveEmDashPath.\n * Call when collection URL patterns change (schema updates).\n *\n * Also busts the distributed schema cache (collection metadata such as\n * `commentsEnabled`, `supports`, fields read by `getCollectionInfo`), since\n * every schema-mutation path already routes through here.\n */\nexport function invalidateUrlPatternCache(): void {\n\tcachedUrlPatterns = null;\n\tinvalidateSchemaObjectCache();\n}\n\n/**\n * Resolve a URL path to a content entry by matching against collection URL patterns.\n *\n * Loads all collections with a `urlPattern` set, converts each pattern to a regex,\n * and tests the given path. On match, extracts the slug and fetches the entry.\n *\n * @example\n * ```ts\n * import { resolveEmDashPath } from \"emdash\";\n *\n * // Given pages with urlPattern \"/{slug}\" and posts with \"/blog/{slug}\":\n * const result = await resolveEmDashPath(\"/blog/hello-world\");\n * if (result) {\n * console.log(result.collection); // \"posts\"\n * console.log(result.params.slug); // \"hello-world\"\n * console.log(result.entry.data); // post data\n * }\n * ```\n */\nexport async function resolveEmDashPath<T = Record<string, unknown>>(\n\tpath: string,\n): Promise<ResolvePathResult<T> | null> {\n\t// Build and cache compiled patterns on first call\n\tif (!cachedUrlPatterns) {\n\t\tconst { getDb } = await import(\"./loader.js\");\n\t\tconst { SchemaRegistry } = await import(\"./schema/registry.js\");\n\t\tconst db = await getDb();\n\t\tconst registry = new SchemaRegistry(db);\n\t\tconst collections = await registry.listCollections();\n\n\t\tcachedUrlPatterns = [];\n\t\tfor (const collection of collections) {\n\t\t\tif (!collection.urlPattern) continue;\n\t\t\tconst { regex, paramNames } = patternToRegex(collection.urlPattern);\n\t\t\tcachedUrlPatterns.push({ slug: collection.slug, regex, paramNames });\n\t\t}\n\t}\n\n\tfor (const pattern of cachedUrlPatterns) {\n\t\tconst match = path.match(pattern.regex);\n\t\tif (!match) continue;\n\n\t\t// Extract params\n\t\tconst params: Record<string, string> = {};\n\t\tfor (let i = 0; i < pattern.paramNames.length; i++) {\n\t\t\tparams[pattern.paramNames[i]] = match[i + 1];\n\t\t}\n\n\t\t// Look up entry by slug (most common pattern)\n\t\tconst slug = params.slug;\n\t\tif (!slug) continue;\n\n\t\tconst { entry } = await getEmDashEntry<string, T>(pattern.slug, slug);\n\t\tif (entry) {\n\t\t\treturn { entry, collection: pattern.slug, params };\n\t\t}\n\t}\n\n\treturn null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,SAAgB,eACf,YACA,IACA,SACY;CACZ,MAAM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AACrE,MAAI,MACH,QAAO;GAAE;GAAO,YAAY,QAAQ;GAAM;GAAQ;;AAIpD,QAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redirects-BOn2DIUs.mjs","names":[],"sources":["../src/api/schemas/bylines.ts","../src/api/schemas/content.ts","../src/api/schemas/schema.ts","../src/api/schemas/comments.ts","../src/utils/url.ts","../src/api/schemas/menus.ts","../src/api/schemas/taxonomies.ts","../src/api/schemas/sections.ts","../src/api/schemas/settings.ts","../src/api/schemas/search.ts","../src/api/schemas/users.ts","../src/api/schemas/widgets.ts","../src/api/schemas/redirects.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { cursorPaginationQuery, httpUrl, localeCode } from \"./common.js\";\n\n/** Slug pattern: lowercase letters, digits, and hyphens; must start with a letter */\nconst bylineSlugPattern = /^[a-z][a-z0-9-]*$/;\n\nexport const bylineSummarySchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tdisplayName: z.string(),\n\t\tbio: z.string().nullable(),\n\t\tavatarMediaId: z.string().nullable(),\n\t\t/**\n\t\t * Avatar media storage key + alt, folded in by the media join during\n\t\t * content byline hydration. Null on the plain byline finders, which\n\t\t * don't join media.\n\t\t */\n\t\tavatarStorageKey: z.string().nullish(),\n\t\tavatarAlt: z.string().nullish(),\n\t\t/**\n\t\t * Avatar media LQIP placeholder (blurhash + dominant colour, migration\n\t\t * 024), from the same media join. Lets clients render a placeholder\n\t\t * while the avatar loads. Null under the same conditions as\n\t\t * `avatarStorageKey`.\n\t\t */\n\t\tavatarBlurhash: z.string().nullish(),\n\t\tavatarDominantColor: z.string().nullish(),\n\t\twebsiteUrl: z.string().nullable(),\n\t\tuserId: z.string().nullable(),\n\t\tisGuest: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\t/** Locale this byline row is presented in (migration 040). */\n\t\tlocale: z.string(),\n\t\t/**\n\t\t * Shared across translations of the same byline (migration 040).\n\t\t * Equals `id` for the anchor row; siblings inherit it from their\n\t\t * source. Nullable in storage for backwards compatibility.\n\t\t */\n\t\ttranslationGroup: z.string().nullable(),\n\t\t/**\n\t\t * Byline custom-field values (Discussion #1174). Keys are slugs\n\t\t * registered via the byline-fields admin API; values follow\n\t\t * `CustomFieldValue` (`string | boolean | null`). Always present\n\t\t * on hydrated responses — empty `{}` when no fields are\n\t\t * registered (Phase 3 AC #6). Marked optional in the schema for\n\t\t * historic-payload compatibility with pre-Phase-3 clients that\n\t\t * may not send the key on writes; hydration always populates it.\n\t\t */\n\t\tcustomFields: z.record(z.string(), z.union([z.string(), z.boolean(), z.null()])).optional(),\n\t})\n\t.meta({ id: \"BylineSummary\" });\n\nexport const bylineCreditSchema = z\n\t.object({\n\t\tbyline: bylineSummarySchema,\n\t\tsortOrder: z.number().int(),\n\t\troleLabel: z.string().nullable(),\n\t\tsource: z.enum([\"explicit\", \"inferred\"]).optional().meta({\n\t\t\tdescription: \"Whether this credit was explicitly assigned or inferred from authorId\",\n\t\t}),\n\t})\n\t.meta({ id: \"BylineCredit\" });\n\nexport const contentBylineInputSchema = z\n\t.object({\n\t\tbylineId: z.string().min(1),\n\t\troleLabel: z.string().nullish(),\n\t})\n\t.meta({ id: \"ContentBylineInput\" });\n\nexport const bylinesListQuery = cursorPaginationQuery\n\t.extend({\n\t\tsearch: z.string().optional(),\n\t\tisGuest: z.coerce.boolean().optional(),\n\t\tuserId: z.string().optional(),\n\t\t/**\n\t\t * Filter by locale (strict per-locale matching, post-migration 040).\n\t\t * Rejects empty strings so the picker can't silently fetch the\n\t\t * unfiltered list when the admin URL has `?locale=` with no value.\n\t\t */\n\t\tlocale: localeCode.optional(),\n\t})\n\t.meta({ id: \"BylinesListQuery\" });\n\nexport const bylineCreateBody = z\n\t.object({\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.regex(bylineSlugPattern, \"Slug must contain only lowercase letters, digits, and hyphens\"),\n\t\tdisplayName: z.string().min(1),\n\t\tbio: z.string().nullish(),\n\t\tavatarMediaId: z.string().nullish(),\n\t\twebsiteUrl: httpUrl.nullish(),\n\t\tuserId: z.string().nullish(),\n\t\tisGuest: z.boolean().optional(),\n\t\t/**\n\t\t * Locale this byline row belongs to. When omitted, the DB DEFAULT (the\n\t\t * configured `defaultLocale`) is used. Rejects empty strings — an\n\t\t * empty locale would create rows no resolver requests.\n\t\t */\n\t\tlocale: localeCode.optional(),\n\t\t/**\n\t\t * When set, the new row joins the source byline's translation_group\n\t\t * rather than minting a fresh one. Requires `locale`.\n\t\t */\n\t\ttranslationOf: z.string().min(1).optional(),\n\t\t/**\n\t\t * Byline custom-field values (Discussion #1174, Phase 6 — create-flow\n\t\t * parity with update). Keys are field slugs; values are unknown at\n\t\t * the API layer because the per-field type contract lives in the\n\t\t * registry and would require an extra query to enforce here. The\n\t\t * repository's `coerceFieldValue` validates against the field's\n\t\t * type and throws `EmDashValidationError` on mismatch — the route\n\t\t * maps that to a 400 `VALIDATION_ERROR`. Reserved-slug write\n\t\t * attempts fall out as `EmDashValidationError(\"Unknown byline\n\t\t * custom field …\")` because no registered field claims a reserved\n\t\t * slug.\n\t\t */\n\t\tcustomFields: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"BylineCreateBody\" });\n\nexport const bylineTranslationCreateBody = z\n\t.object({\n\t\tlocale: localeCode,\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.regex(bylineSlugPattern, \"Slug must contain only lowercase letters, digits, and hyphens\")\n\t\t\t.optional(),\n\t\tdisplayName: z.string().min(1).optional(),\n\t\tbio: z.string().nullish(),\n\t\tavatarMediaId: z.string().nullish(),\n\t\twebsiteUrl: httpUrl.nullish(),\n\t})\n\t.meta({ id: \"BylineTranslationCreateBody\" });\n\nexport const bylineTranslationsResponseSchema = z\n\t.object({\n\t\titems: z.array(bylineSummarySchema),\n\t})\n\t.meta({ id: \"BylineTranslationsResponse\" });\n\nexport const bylineUpdateBody = z\n\t.object({\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.regex(bylineSlugPattern, \"Slug must contain only lowercase letters, digits, and hyphens\")\n\t\t\t.optional(),\n\t\tdisplayName: z.string().min(1).optional(),\n\t\tbio: z.string().nullish(),\n\t\tavatarMediaId: z.string().nullish(),\n\t\twebsiteUrl: httpUrl.nullish(),\n\t\tuserId: z.string().nullish(),\n\t\tisGuest: z.boolean().optional(),\n\t\t/**\n\t\t * Byline custom-field values (Discussion #1174, Phase 3+4). Keys\n\t\t * are field slugs; values are unknown at the API layer because\n\t\t * the per-field type contract lives in the registry and would\n\t\t * require an extra query to enforce here. The repository's\n\t\t * `coerceFieldValue` validates against the field's type and\n\t\t * throws `EmDashValidationError` on mismatch — the route maps\n\t\t * that to a 400 `VALIDATION_ERROR`. Reserved-slug write attempts\n\t\t * fall out as `EmDashValidationError(\"Unknown byline custom\n\t\t * field …\")` because no registered field claims a reserved slug.\n\t\t */\n\t\tcustomFields: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"BylineUpdateBody\" });\n\nexport const bylineListResponseSchema = z\n\t.object({\n\t\titems: z.array(bylineSummarySchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"BylineListResponse\" });\n","import { z } from \"zod\";\n\nimport { bylineSummarySchema, bylineCreditSchema, contentBylineInputSchema } from \"./bylines.js\";\nimport { cursorPaginationQuery, httpUrl, localeCode } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Content: Input schemas\n// ---------------------------------------------------------------------------\n\n/** SEO input — per-content meta fields */\nexport const contentSeoInput = z\n\t.object({\n\t\ttitle: z.string().max(200).nullish(),\n\t\tdescription: z.string().max(500).nullish(),\n\t\timage: z.string().nullish(),\n\t\tcanonical: httpUrl.nullish(),\n\t\tnoIndex: z.boolean().optional(),\n\t})\n\t.meta({ id: \"ContentSeoInput\" });\n\n/** ISO 8601 date or datetime bound for the content-list date range filter. */\nconst contentDateBound = z\n\t.union([\n\t\tz.iso.datetime({ offset: true, message: \"must be an ISO 8601 datetime\" }),\n\t\tz.iso.date({ message: \"must be an ISO 8601 date\" }),\n\t])\n\t.optional();\n\nexport const contentListQuery = cursorPaginationQuery\n\t.extend({\n\t\tstatus: z.string().optional(),\n\t\torderBy: z.string().optional(),\n\t\torder: z.enum([\"asc\", \"desc\"]).optional(),\n\t\tlocale: localeCode.optional(),\n\t\t/** Case-insensitive substring search across the collection's title/name/slug. */\n\t\tq: z.string().trim().min(1).max(200).optional(),\n\t\t/** Filter to entries authored by this user (the `author_id` column). */\n\t\tauthorId: z.string().min(1).max(64).optional(),\n\t\t/** Which timestamp column the `dateFrom`/`dateTo` range applies to. */\n\t\tdateField: z.enum([\"createdAt\", \"updatedAt\", \"publishedAt\"]).optional(),\n\t\t/** Inclusive lower bound for the date range. Requires `dateField`. */\n\t\tdateFrom: contentDateBound,\n\t\t/** Inclusive upper bound for the date range. Requires `dateField`. */\n\t\tdateTo: contentDateBound,\n\t})\n\t.meta({ id: \"ContentListQuery\" });\n\n/** ISO 8601 datetime for `publishedAt` / `createdAt`. Routes gate writes behind `content:publish_any`. */\nconst contentDateOverride = z.iso\n\t.datetime({ offset: true, message: \"must be an ISO 8601 datetime\" })\n\t.nullish();\n\nexport const contentCreateBody = z\n\t.object({\n\t\tdata: z.record(z.string(), z.unknown()),\n\t\tslug: z.string().nullish(),\n\t\tstatus: z.enum([\"draft\"]).optional(),\n\t\tbylines: z.array(contentBylineInputSchema).optional(),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().optional(),\n\t\tseo: contentSeoInput.optional(),\n\t\ttaxonomies: z.record(z.string(), z.array(z.string())).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Taxonomy term assignments as { taxonomyName: [termSlug, ...] }, resolved in the entry's locale.\",\n\t\t}),\n\t\tpublishedAt: contentDateOverride,\n\t\tcreatedAt: contentDateOverride,\n\t})\n\t.meta({ id: \"ContentCreateBody\" });\n\nexport const contentUpdateBody = z\n\t.object({\n\t\tdata: z.record(z.string(), z.unknown()).optional(),\n\t\tslug: z.string().nullish(),\n\t\tstatus: z.enum([\"draft\"]).optional(),\n\t\tauthorId: z.string().nullish(),\n\t\tbylines: z.array(contentBylineInputSchema).optional(),\n\t\t_rev: z\n\t\t\t.string()\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t\tskipRevision: z.boolean().optional(),\n\t\tseo: contentSeoInput.optional(),\n\t\ttaxonomies: z.record(z.string(), z.array(z.string())).optional().meta({\n\t\t\tdescription:\n\t\t\t\t\"Replace taxonomy assignments as { taxonomyName: [termSlug, ...] }. Only named taxonomies are touched; pass an empty array to clear a taxonomy.\",\n\t\t}),\n\t\tpublishedAt: contentDateOverride,\n\t})\n\t.meta({ id: \"ContentUpdateBody\" });\n\nexport const contentScheduleBody = z\n\t.object({\n\t\tscheduledAt: z.string().min(1, \"scheduledAt is required\").meta({\n\t\t\tdescription: \"ISO 8601 datetime for scheduled publishing\",\n\t\t\texample: \"2025-06-15T09:00:00Z\",\n\t\t}),\n\t})\n\t.meta({ id: \"ContentScheduleBody\" });\n\nexport const contentPublishBody = z\n\t.object({\n\t\t// .optional() rather than .nullish(): publishing has no semantic\n\t\t// meaning for `null` (you can't \"clear\" a publish timestamp by\n\t\t// publishing). Tightening the schema here means callers either\n\t\t// pass a valid datetime or omit the field, and the route doesn't\n\t\t// have to silently drop a null that snuck through.\n\t\tpublishedAt: z.iso\n\t\t\t.datetime({ offset: true, message: \"must be an ISO 8601 datetime\" })\n\t\t\t.optional()\n\t\t\t.meta({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Optional ISO 8601 datetime to backdate the publish (e.g. when migrating content). Requires content:publish_any permission. Without this, existing published_at is preserved on re-publish.\",\n\t\t\t}),\n\t})\n\t.meta({ id: \"ContentPublishBody\" });\n\nexport const contentPreviewUrlBody = z\n\t.object({\n\t\texpiresIn: z.union([z.string(), z.number()]).optional(),\n\t\tpathPattern: z.string().optional(),\n\t})\n\t.meta({ id: \"ContentPreviewUrlBody\" });\n\nexport const contentTermsBody = z\n\t.object({\n\t\ttermIds: z.array(z.string()),\n\t})\n\t.meta({ id: \"ContentTermsBody\" });\n\nexport const contentTrashQuery = cursorPaginationQuery;\n\n// ---------------------------------------------------------------------------\n// Content: Response schemas\n// ---------------------------------------------------------------------------\n\n/** SEO metadata on a content item */\nexport const contentSeoSchema = z\n\t.object({\n\t\ttitle: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\timage: z.string().nullable(),\n\t\tcanonical: z.string().nullable(),\n\t\tnoIndex: z.boolean(),\n\t})\n\t.meta({ id: \"ContentSeo\" });\n\n/** A single content item as returned by the API */\nexport const contentItemSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\ttype: z.string().meta({ description: \"Collection slug this item belongs to\" }),\n\t\tslug: z.string().nullable(),\n\t\tstatus: z.string().meta({ description: \"draft, published, or scheduled\" }),\n\t\tdata: z.record(z.string(), z.unknown()).meta({\n\t\t\tdescription: \"User-defined field values\",\n\t\t}),\n\t\tauthorId: z.string().nullable(),\n\t\tprimaryBylineId: z.string().nullable(),\n\t\tbyline: bylineSummarySchema.nullable().optional(),\n\t\tbylines: z.array(bylineCreditSchema).optional(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tpublishedAt: z.string().nullable(),\n\t\tscheduledAt: z.string().nullable(),\n\t\tliveRevisionId: z.string().nullable(),\n\t\tdraftRevisionId: z.string().nullable(),\n\t\tversion: z.number().int(),\n\t\tlocale: z.string().nullable(),\n\t\ttranslationGroup: z.string().nullable(),\n\t\tseo: contentSeoSchema.optional(),\n\t})\n\t.meta({ id: \"ContentItem\" });\n\n/** Response for single content item endpoints (get, create, update) */\nexport const contentResponseSchema = z\n\t.object({\n\t\titem: contentItemSchema,\n\t\t_rev: z\n\t\t\t.string()\n\t\t\t.optional()\n\t\t\t.meta({ description: \"Opaque revision token for optimistic concurrency\" }),\n\t})\n\t.meta({ id: \"ContentResponse\" });\n\n/** Response for content list endpoints */\nexport const contentListResponseSchema = z\n\t.object({\n\t\titems: z.array(contentItemSchema),\n\t\tnextCursor: z.string().optional(),\n\t\ttotal: z.number().int().nonnegative().optional(),\n\t})\n\t.meta({ id: \"ContentListResponse\" });\n\n/** A distinct content author for the admin author filter */\nexport const contentAuthorSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string().nullable(),\n\t\temail: z.string(),\n\t\tavatarUrl: z.string().nullable(),\n\t})\n\t.meta({ id: \"ContentAuthor\" });\n\n/** Response for the content authors endpoint */\nexport const contentAuthorsResponseSchema = z\n\t.object({\n\t\titems: z.array(contentAuthorSchema),\n\t})\n\t.meta({ id: \"ContentAuthorsResponse\" });\n\n/** Trashed content item */\nexport const trashedContentItemSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\ttype: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tstatus: z.string(),\n\t\tdata: z.record(z.string(), z.unknown()),\n\t\tauthorId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tpublishedAt: z.string().nullable(),\n\t\tdeletedAt: z.string(),\n\t})\n\t.meta({ id: \"TrashedContentItem\" });\n\n/** Response for trashed content list */\nexport const trashedContentListResponseSchema = z\n\t.object({\n\t\titems: z.array(trashedContentItemSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"TrashedContentListResponse\" });\n\n/** Response for content compare (live vs draft) */\nexport const contentCompareResponseSchema = z\n\t.object({\n\t\thasChanges: z.boolean(),\n\t\tlive: z.record(z.string(), z.unknown()).nullable(),\n\t\tdraft: z.record(z.string(), z.unknown()).nullable(),\n\t})\n\t.meta({ id: \"ContentCompareResponse\" });\n\n/** Translation summary for a content item */\nexport const contentTranslationSchema = z.object({\n\tid: z.string(),\n\tlocale: z.string().nullable(),\n\tslug: z.string().nullable(),\n\tstatus: z.string(),\n\tupdatedAt: z.string(),\n});\n\n/** Response for content translations endpoint */\nexport const contentTranslationsResponseSchema = z\n\t.object({\n\t\ttranslationGroup: z.string(),\n\t\ttranslations: z.array(contentTranslationSchema),\n\t})\n\t.meta({ id: \"ContentTranslationsResponse\" });\n","import { z } from \"zod\";\n\nimport { slugPattern } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Schema (collections & fields): Input schemas\n// ---------------------------------------------------------------------------\n\nconst collectionSupportValues = z.enum([\"drafts\", \"revisions\", \"preview\", \"scheduling\", \"search\"]);\n\nconst collectionSourcePattern = /^(template:.+|import:.+|manual|discovered|seed)$/;\n\nconst fieldTypeValues = z.enum([\n\t\"string\",\n\t\"text\",\n\t\"url\",\n\t\"number\",\n\t\"integer\",\n\t\"boolean\",\n\t\"datetime\",\n\t\"select\",\n\t\"multiSelect\",\n\t\"portableText\",\n\t\"image\",\n\t\"file\",\n\t\"reference\",\n\t\"json\",\n\t\"slug\",\n\t\"repeater\",\n]);\n\nconst repeaterSubFieldSchema = z.object({\n\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid slug format\"),\n\t// Keep in sync with REPEATER_SUB_FIELD_TYPES in schema/types.ts.\n\t// (\"url\" was already a documented sub-field type but missing here.)\n\ttype: z.enum([\n\t\t\"string\",\n\t\t\"text\",\n\t\t\"url\",\n\t\t\"number\",\n\t\t\"integer\",\n\t\t\"boolean\",\n\t\t\"datetime\",\n\t\t\"select\",\n\t\t\"image\",\n\t]),\n\tlabel: z.string().min(1),\n\trequired: z.boolean().optional(),\n\toptions: z.array(z.string()).optional(),\n});\n\nconst fieldValidation = z\n\t.object({\n\t\trequired: z.boolean().optional(),\n\t\tmin: z.number().optional(),\n\t\tmax: z.number().optional(),\n\t\tminLength: z.number().int().min(0).optional(),\n\t\tmaxLength: z.number().int().min(0).optional(),\n\t\tpattern: z.string().optional(),\n\t\toptions: z.array(z.string()).optional(),\n\t\tsubFields: z.array(repeaterSubFieldSchema).min(1).optional(),\n\t\tminItems: z.number().int().min(0).optional(),\n\t\tmaxItems: z.number().int().min(1).optional(),\n\t\tallowedMimeTypes: z\n\t\t\t.array(\n\t\t\t\tz\n\t\t\t\t\t.string()\n\t\t\t\t\t.regex(/^[a-z0-9][a-z0-9!#$&^_+\\-.]*\\/[a-z0-9!#$&^_+\\-.]*$/i, \"Invalid MIME type\"),\n\t\t\t)\n\t\t\t.min(1, \"allowedMimeTypes must not be empty — omit the field to allow all types\")\n\t\t\t.max(64, \"allowedMimeTypes may contain at most 64 entries\")\n\t\t\t.optional(),\n\t})\n\t.optional();\n\nconst fieldWidgetOptions = z.record(z.string(), z.unknown()).optional();\n\nexport const createCollectionBody = z\n\t.object({\n\t\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid slug format\"),\n\t\tlabel: z.string().min(1),\n\t\tlabelSingular: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\ticon: z.string().optional(),\n\t\tsupports: z.array(collectionSupportValues).optional(),\n\t\tsource: z.string().regex(collectionSourcePattern).optional(),\n\t\turlPattern: z.string().optional(),\n\t\thasSeo: z.boolean().optional(),\n\t})\n\t.meta({ id: \"CreateCollectionBody\" });\n\nexport const updateCollectionBody = z\n\t.object({\n\t\tlabel: z.string().min(1).optional(),\n\t\tlabelSingular: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\ticon: z.string().optional(),\n\t\tsupports: z.array(collectionSupportValues).optional(),\n\t\turlPattern: z.string().nullish(),\n\t\thasSeo: z.boolean().optional(),\n\t\tcommentsEnabled: z.boolean().optional(),\n\t\tcommentsModeration: z.enum([\"all\", \"first_time\", \"none\"]).optional(),\n\t\tcommentsClosedAfterDays: z.number().int().min(0).optional(),\n\t\tcommentsAutoApproveUsers: z.boolean().optional(),\n\t})\n\t.meta({ id: \"UpdateCollectionBody\" });\n\nexport const createFieldBody = z\n\t.object({\n\t\tslug: z.string().min(1).max(63).regex(slugPattern, \"Invalid slug format\"),\n\t\tlabel: z.string().min(1),\n\t\ttype: fieldTypeValues,\n\t\trequired: z.boolean().optional(),\n\t\tunique: z.boolean().optional(),\n\t\tdefaultValue: z.unknown().optional(),\n\t\tvalidation: fieldValidation.nullable(),\n\t\twidget: z.string().optional(),\n\t\toptions: fieldWidgetOptions,\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t\tsearchable: z.boolean().optional(),\n\t\ttranslatable: z.boolean().optional(),\n\t})\n\t.meta({ id: \"CreateFieldBody\" });\n\nexport const updateFieldBody = z\n\t.object({\n\t\tlabel: z.string().min(1).optional(),\n\t\ttype: fieldTypeValues.optional(),\n\t\trequired: z.boolean().optional(),\n\t\tunique: z.boolean().optional(),\n\t\tdefaultValue: z.unknown().optional(),\n\t\tvalidation: fieldValidation.nullable(),\n\t\twidget: z.string().optional(),\n\t\toptions: fieldWidgetOptions,\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t\tsearchable: z.boolean().optional(),\n\t\ttranslatable: z.boolean().optional(),\n\t})\n\t.meta({ id: \"UpdateFieldBody\" });\n\nexport const fieldReorderBody = z\n\t.object({\n\t\tfieldSlugs: z.array(z.string().min(1)),\n\t})\n\t.meta({ id: \"FieldReorderBody\" });\n\nexport const orphanRegisterBody = z\n\t.object({\n\t\tlabel: z.string().optional(),\n\t\tlabelSingular: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t})\n\t.meta({ id: \"OrphanRegisterBody\" });\n\nexport const schemaExportQuery = z.object({\n\tformat: z.string().optional(),\n});\n\nexport const collectionGetQuery = z.object({\n\tincludeFields: z\n\t\t.string()\n\t\t.transform((v) => v === \"true\")\n\t\t.optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Schema: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const collectionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tlabelSingular: z.string().nullable(),\n\t\tdescription: z.string().nullable(),\n\t\ticon: z.string().nullable(),\n\t\tsupports: z.array(z.string()),\n\t\tsource: z.string().nullable(),\n\t\turlPattern: z.string().nullable(),\n\t\thasSeo: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Collection\" });\n\nexport const fieldSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tcollectionId: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\ttype: fieldTypeValues,\n\t\trequired: z.boolean(),\n\t\tunique: z.boolean(),\n\t\tdefaultValue: z.unknown().nullable(),\n\t\tvalidation: z.record(z.string(), z.unknown()).nullable(),\n\t\twidget: z.string().nullable(),\n\t\toptions: z.record(z.string(), z.unknown()).nullable(),\n\t\tsortOrder: z.number().int(),\n\t\tsearchable: z.boolean(),\n\t\ttranslatable: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Field\" });\n\nexport const collectionResponseSchema = z\n\t.object({ item: collectionSchema })\n\t.meta({ id: \"CollectionResponse\" });\n\nexport const collectionWithFieldsResponseSchema = z\n\t.object({\n\t\titem: collectionSchema.extend({ fields: z.array(fieldSchema) }),\n\t})\n\t.meta({ id: \"CollectionWithFieldsResponse\" });\n\nexport const collectionListResponseSchema = z\n\t.object({ items: z.array(collectionSchema) })\n\t.meta({ id: \"CollectionListResponse\" });\n\nexport const fieldResponseSchema = z.object({ item: fieldSchema }).meta({ id: \"FieldResponse\" });\n\nexport const fieldListResponseSchema = z\n\t.object({ items: z.array(fieldSchema) })\n\t.meta({ id: \"FieldListResponse\" });\n\nexport const orphanedTableSchema = z\n\t.object({\n\t\tslug: z.string(),\n\t\ttableName: z.string(),\n\t\trowCount: z.number().int(),\n\t})\n\t.meta({ id: \"OrphanedTable\" });\n\nexport const orphanedTableListResponseSchema = z\n\t.object({ items: z.array(orphanedTableSchema) })\n\t.meta({ id: \"OrphanedTableListResponse\" });\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Comments: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const createCommentBody = z\n\t.object({\n\t\tauthorName: z.string().min(1).max(100),\n\t\tauthorEmail: z.string().email(),\n\t\tbody: z.string().min(1).max(5000),\n\t\tparentId: z.string().optional(),\n\t\t/** Honeypot field — hidden in the form, filled only by bots */\n\t\twebsite_url: z.string().optional(),\n\t\t/**\n\t\t * Turnstile response token from the form widget. Verified\n\t\t * server-side when a Turnstile secret key is configured.\n\t\t * Turnstile tokens can be up to 2048 characters.\n\t\t */\n\t\tturnstileToken: z.string().max(2048).optional(),\n\t})\n\t.meta({ id: \"CreateCommentBody\" });\n\nexport const createReactionBody = z\n\t.object({\n\t\tcommentId: z.string().min(1),\n\t\t/** Reaction name. Positive-only (\"like\") by default; extensible. */\n\t\treaction: z.string().min(1).max(20).default(\"like\"),\n\t\t/** Honeypot field — hidden in the form, filled only by bots */\n\t\twebsite_url: z.string().optional(),\n\t})\n\t.meta({ id: \"CreateReactionBody\" });\n\nexport const commentStatusBody = z\n\t.object({\n\t\tstatus: z.enum([\"approved\", \"pending\", \"spam\", \"trash\"]),\n\t})\n\t.meta({ id: \"CommentStatusBody\" });\n\nexport const commentBulkBody = z\n\t.object({\n\t\tids: z.array(z.string().min(1)).min(1).max(100),\n\t\taction: z.enum([\"approve\", \"spam\", \"trash\", \"delete\"]),\n\t})\n\t.meta({ id: \"CommentBulkBody\" });\n\nexport const commentListQuery = z\n\t.object({\n\t\tstatus: z.enum([\"pending\", \"approved\", \"spam\", \"trash\"]).optional(),\n\t\tcollection: z.string().optional(),\n\t\tsearch: z.string().optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional().default(50),\n\t\tcursor: z.string().max(2048).optional(),\n\t})\n\t.meta({ id: \"CommentListQuery\" });\n\n// ---------------------------------------------------------------------------\n// Comments: Response schemas\n// ---------------------------------------------------------------------------\n\nconst commentStatusValues = z.enum([\"pending\", \"approved\", \"spam\", \"trash\"]);\n\n/**\n * Public-facing comment (no email/IP).\n *\n * `replies` is recursive in practice (each reply can have replies), but we\n * model it as a single level here to avoid circular type inference issues\n * with tsgo. OpenAPI consumers should treat replies as the same shape.\n */\nexport const publicCommentSchema: z.ZodObject<{\n\tid: z.ZodString;\n\tauthorName: z.ZodString;\n\tisRegisteredUser: z.ZodBoolean;\n\tbody: z.ZodString;\n\tparentId: z.ZodNullable<z.ZodString>;\n\tcreatedAt: z.ZodString;\n\treplies: z.ZodOptional<z.ZodArray<z.ZodAny>>;\n}> = z\n\t.object({\n\t\tid: z.string(),\n\t\tauthorName: z.string(),\n\t\tisRegisteredUser: z.boolean(),\n\t\tbody: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\treplies: z.array(z.any()).optional(),\n\t})\n\t.meta({ id: \"PublicComment\" });\n\n/** Admin comment with full details */\nexport const commentSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tcollection: z.string(),\n\t\tcontentId: z.string(),\n\t\tauthorName: z.string(),\n\t\tauthorEmail: z.string(),\n\t\tbody: z.string(),\n\t\tstatus: commentStatusValues,\n\t\tparentId: z.string().nullable(),\n\t\tipHash: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Comment\" });\n\nexport const publicCommentListResponseSchema = z\n\t.object({\n\t\titems: z.array(publicCommentSchema),\n\t\tnextCursor: z.string().optional(),\n\t\ttotal: z.number().int(),\n\t})\n\t.meta({ id: \"PublicCommentListResponse\" });\n\nexport const adminCommentListResponseSchema = z\n\t.object({\n\t\titems: z.array(commentSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"AdminCommentListResponse\" });\n\nexport const commentCountsResponseSchema = z\n\t.object({\n\t\tpending: z.number().int(),\n\t\tapproved: z.number().int(),\n\t\tspam: z.number().int(),\n\t\ttrash: z.number().int(),\n\t})\n\t.meta({ id: \"CommentCountsResponse\" });\n\nexport const commentBulkResponseSchema = z\n\t.object({ affected: z.number().int() })\n\t.meta({ id: \"CommentBulkResponse\" });\n","/**\n * URL scheme validation utilities\n *\n * Prevents XSS via dangerous URL schemes (javascript:, data:, vbscript:, etc.)\n * by allowlisting known-safe schemes before rendering into href attributes.\n */\n\n/**\n * Matches URLs that are safe to render in href attributes.\n *\n * Allowed:\n * - http:// and https://\n * - mailto: and tel:\n * - Relative paths (starting with /)\n * - Fragment links (starting with #)\n * - Protocol-relative URLs are NOT allowed (starting with //) as they can\n * redirect to attacker-controlled hosts.\n */\nconst SAFE_URL_SCHEME_RE = /^(https?:|mailto:|tel:|\\/(?!\\/)|#)/i;\n\n/**\n * Returns the URL unchanged if it uses a safe scheme, otherwise returns \"#\".\n *\n * Use this at the render layer as the primary defense against XSS via\n * dangerous URL schemes like `javascript:`, `data:`, or `vbscript:`.\n *\n * @example\n * ```ts\n * sanitizeHref(\"https://example.com\") // \"https://example.com\"\n * sanitizeHref(\"/about\") // \"/about\"\n * sanitizeHref(\"#section\") // \"#section\"\n * sanitizeHref(\"mailto:a@b.com\") // \"mailto:a@b.com\"\n * sanitizeHref(\"javascript:alert(1)\") // \"#\"\n * sanitizeHref(\"data:text/html,<script>\") // \"#\"\n * sanitizeHref(\"\") // \"#\"\n * ```\n */\nexport function sanitizeHref(url: string | undefined | null): string {\n\tif (!url) return \"#\";\n\treturn SAFE_URL_SCHEME_RE.test(url) ? url : \"#\";\n}\n\n/**\n * Returns true if the URL uses a safe scheme for rendering in href attributes.\n */\nexport function isSafeHref(url: string): boolean {\n\treturn SAFE_URL_SCHEME_RE.test(url);\n}\n","import { z } from \"zod\";\n\nimport { isSafeHref } from \"../../utils/url.js\";\nimport { localeCode } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Menus: Input schemas\n// ---------------------------------------------------------------------------\n\n/**\n * Allowed menu item types. `custom` uses `customUrl`; the others resolve a URL\n * from `referenceCollection` + `referenceId` (a translation_group id).\n */\nexport const menuItemTypeEnum = z.enum([\"custom\", \"page\", \"post\", \"taxonomy\", \"collection\"]);\n\nconst safeHref = z\n\t.string()\n\t.trim()\n\t.refine(\n\t\tisSafeHref,\n\t\t\"URL must use http, https, mailto, tel, a relative path, or a fragment identifier\",\n\t);\n\nexport const createMenuBody = z\n\t.object({\n\t\tname: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tlocale: localeCode.optional(),\n\t\t/** When set, clones the items from the source menu. The new menu joins\n\t\t * the source's translation_group. */\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"CreateMenuBody\" });\n\nexport const updateMenuBody = z\n\t.object({\n\t\tlabel: z.string().min(1).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"UpdateMenuBody\" });\n\nexport const createMenuItemBody = z\n\t.object({\n\t\ttype: menuItemTypeEnum,\n\t\tlabel: z.string().min(1),\n\t\treferenceCollection: z.string().optional(),\n\t\treferenceId: z.string().optional(),\n\t\tcustomUrl: safeHref.optional(),\n\t\ttarget: z.string().optional(),\n\t\ttitleAttr: z.string().optional(),\n\t\tcssClasses: z.string().optional(),\n\t\tparentId: z.string().optional(),\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"CreateMenuItemBody\" });\n\nexport const updateMenuItemBody = z\n\t.object({\n\t\tlabel: z.string().min(1).optional(),\n\t\tcustomUrl: safeHref.optional(),\n\t\ttarget: z.string().optional(),\n\t\ttitleAttr: z.string().optional(),\n\t\tcssClasses: z.string().optional(),\n\t\tparentId: z.string().nullish(),\n\t\tsortOrder: z.number().int().min(0).optional(),\n\t})\n\t.strict()\n\t.meta({ id: \"UpdateMenuItemBody\" });\n\nexport const reorderMenuItemsBody = z\n\t.object({\n\t\titems: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string().min(1),\n\t\t\t\tparentId: z.string().nullable(),\n\t\t\t\tsortOrder: z.number().int().min(0),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"ReorderMenuItemsBody\" });\n\n// ---------------------------------------------------------------------------\n// Menus: Response schemas\n//\n// All responses are camelCase to align with the rest of the EmDash REST API\n// (content, taxonomies, redirects, etc.). The DB columns are snake_case;\n// handlers hydrate rows into the shapes below before returning.\n// ---------------------------------------------------------------------------\n\nexport const menuSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tlabel: z.string(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"Menu\" });\n\nexport const menuItemSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tmenuId: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tsortOrder: z.number().int(),\n\t\ttype: z.string(),\n\t\treferenceCollection: z.string().nullable(),\n\t\treferenceId: z.string().nullable(),\n\t\tcustomUrl: z.string().nullable(),\n\t\tlabel: z.string(),\n\t\ttitleAttr: z.string().nullable(),\n\t\ttarget: z.string().nullable(),\n\t\tcssClasses: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"MenuItem\" });\n\nexport const menuTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string().nullable(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tlabel: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t\tupdatedAt: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"MenuTranslations\" });\n\nexport const menuListItemSchema = menuSchema\n\t.extend({\n\t\titemCount: z.number().int(),\n\t})\n\t.meta({ id: \"MenuListItem\" });\n\nexport const menuWithItemsSchema = menuSchema\n\t.extend({\n\t\titems: z.array(menuItemSchema),\n\t})\n\t.meta({ id: \"MenuWithItems\" });\n","import { z } from \"zod\";\n\nimport { localeCode } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Taxonomy definitions: Input schemas\n// ---------------------------------------------------------------------------\n\n/** Collection slug format: lowercase alphanumeric + underscores, starts with letter */\nconst collectionSlugPattern = /^[a-z][a-z0-9_]*$/;\n\nexport const createTaxonomyDefBody = z\n\t.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1)\n\t\t\t.max(63)\n\t\t\t.regex(/^[a-z][a-z0-9_]*$/, \"Name must be lowercase alphanumeric with underscores\"),\n\t\tlabel: z.string().min(1).max(200),\n\t\tlabelSingular: z.string().min(1).max(200).optional(),\n\t\thierarchical: z.boolean().optional().default(false),\n\t\tcollections: z\n\t\t\t.array(\n\t\t\t\tz.string().min(1).max(63).regex(collectionSlugPattern, \"Invalid collection slug format\"),\n\t\t\t)\n\t\t\t.max(100)\n\t\t\t.optional()\n\t\t\t.default([]),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t.meta({ id: \"CreateTaxonomyDefBody\" });\n\n// ---------------------------------------------------------------------------\n// Taxonomy terms: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const createTermBody = z\n\t.object({\n\t\tslug: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tparentId: z.string().nullish(),\n\t\tdescription: z.string().optional(),\n\t\tlocale: localeCode.optional(),\n\t\ttranslationOf: z.string().min(1).optional(),\n\t})\n\t.meta({ id: \"CreateTermBody\" });\n\nexport const updateTermBody = z\n\t.object({\n\t\tslug: z.string().min(1).optional(),\n\t\tlabel: z.string().min(1).optional(),\n\t\tparentId: z.string().nullish(),\n\t\tdescription: z.string().optional(),\n\t})\n\t.meta({ id: \"UpdateTermBody\" });\n\nexport const termListQuery = z\n\t.object({\n\t\tlocale: localeCode.optional(),\n\t\tincludeCounts: z\n\t\t\t.enum([\"true\", \"false\"])\n\t\t\t.transform((v) => v === \"true\")\n\t\t\t.optional()\n\t\t\t.default(true)\n\t\t\t.meta({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Include each term's visible-usage count. Pass false to skip the aggregate; `count` is then absent from every term.\",\n\t\t\t}),\n\t})\n\t.meta({ id: \"TermListQuery\" });\n\n// ---------------------------------------------------------------------------\n// Taxonomies: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const taxonomyDefSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tlabel: z.string(),\n\t\tlabelSingular: z.string().optional(),\n\t\thierarchical: z.boolean(),\n\t\tcollections: z.array(z.string()),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"TaxonomyDef\" });\n\nexport const taxonomyDefTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string().nullable(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string(),\n\t\t\t\tlabel: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"TaxonomyDefTranslations\" });\n\nexport const taxonomyListResponseSchema = z\n\t.object({ taxonomies: z.array(taxonomyDefSchema) })\n\t.meta({ id: \"TaxonomyListResponse\" });\n\nexport const termSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tdescription: z.string().optional(),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"Term\" });\n\nexport const termTranslationsSchema = z\n\t.object({\n\t\ttranslationGroup: z.string().nullable(),\n\t\ttranslations: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tslug: z.string(),\n\t\t\t\tlabel: z.string(),\n\t\t\t\tlocale: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"TermTranslations\" });\n\nexport const termWithCountSchema: z.ZodType = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tslug: z.string(),\n\t\tlabel: z.string(),\n\t\tparentId: z.string().nullable(),\n\t\tdescription: z.string().optional(),\n\t\tcount: z.number().int().optional(),\n\t\tchildren: z.array(z.lazy(() => termWithCountSchema)),\n\t\tlocale: z.string(),\n\t\ttranslationGroup: z.string().nullable(),\n\t})\n\t.meta({ id: \"TermWithCount\" });\n\nexport const termListResponseSchema = z\n\t.object({ terms: z.array(termWithCountSchema) })\n\t.meta({ id: \"TermListResponse\" });\n\nexport const termResponseSchema = z.object({ term: termSchema }).meta({ id: \"TermResponse\" });\n\nexport const termGetResponseSchema = z\n\t.object({\n\t\tterm: termSchema.extend({\n\t\t\tcount: z.number().int(),\n\t\t\tchildren: z.array(\n\t\t\t\tz.object({\n\t\t\t\t\tid: z.string(),\n\t\t\t\t\tslug: z.string(),\n\t\t\t\t\tlabel: z.string(),\n\t\t\t\t}),\n\t\t\t),\n\t\t}),\n\t})\n\t.meta({ id: \"TermGetResponse\" });\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Sections: Input schemas\n// ---------------------------------------------------------------------------\n\nconst sectionSource = z.enum([\"theme\", \"user\", \"import\"]);\n\nexport const sectionsListQuery = z\n\t.object({\n\t\tsource: sectionSource.optional(),\n\t\tsearch: z.string().optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional().default(50),\n\t\tcursor: z.string().max(2048).optional(),\n\t})\n\t.meta({ id: \"SectionsListQuery\" });\n\nexport const createSectionBody = z\n\t.object({\n\t\tslug: z.string().min(1),\n\t\ttitle: z.string().min(1),\n\t\tdescription: z.string().optional(),\n\t\tkeywords: z.array(z.string()).optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())),\n\t\tpreviewMediaId: z.string().optional(),\n\t\tsource: z.enum([\"user\", \"import\"]).optional(),\n\t\tthemeId: z.string().optional(),\n\t})\n\t.meta({ id: \"CreateSectionBody\" });\n\nexport const updateSectionBody = z\n\t.object({\n\t\tslug: z.string().min(1).optional(),\n\t\ttitle: z.string().min(1).optional(),\n\t\tdescription: z.string().optional(),\n\t\tkeywords: z.array(z.string()).optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tpreviewMediaId: z.string().nullish(),\n\t})\n\t.meta({ id: \"UpdateSectionBody\" });\n\n// ---------------------------------------------------------------------------\n// Sections: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const sectionSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tslug: z.string(),\n\t\ttitle: z.string(),\n\t\tdescription: z.string().nullable(),\n\t\tkeywords: z.array(z.string()).nullable(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())),\n\t\tpreviewMediaId: z.string().nullable(),\n\t\tsource: z.string(),\n\t\tthemeId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Section\" });\n\nexport const sectionListResponseSchema = z\n\t.object({\n\t\titems: z.array(sectionSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"SectionListResponse\" });\n","import { z } from \"zod\";\n\nimport { httpUrl } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Settings: Input schemas\n//\n// Media references on write are just `{ mediaId, alt? }` -- the resolved\n// fields (`url`, `contentType`, `width`, `height`) are server-computed and\n// stripped from any submitted body via Zod's default strip mode. See\n// `packages/core/src/settings/types.ts` for the in-memory shape.\n// ---------------------------------------------------------------------------\n\nconst mediaReferenceInput = z.object({\n\tmediaId: z.string(),\n\talt: z.string().optional(),\n});\n\nconst socialSettings = z.object({\n\ttwitter: z.string().optional(),\n\tgithub: z.string().optional(),\n\tfacebook: z.string().optional(),\n\tinstagram: z.string().optional(),\n\tlinkedin: z.string().optional(),\n\tyoutube: z.string().optional(),\n});\n\nconst seoSettingsInput = z.object({\n\ttitleSeparator: z.string().max(10).optional(),\n\tdefaultOgImage: mediaReferenceInput.optional(),\n\trobotsTxt: z.string().max(5000).optional(),\n\tgoogleVerification: z.string().max(100).optional(),\n\tbingVerification: z.string().max(100).optional(),\n});\n\nexport const settingsUpdateBody = z\n\t.object({\n\t\ttitle: z.string().optional(),\n\t\ttagline: z.string().optional(),\n\t\tlogo: mediaReferenceInput.optional(),\n\t\tfavicon: mediaReferenceInput.optional(),\n\t\turl: z.union([httpUrl, z.literal(\"\")]).optional(),\n\t\tpostsPerPage: z.number().int().min(1).max(100).optional(),\n\t\tdateFormat: z.string().optional(),\n\t\ttimezone: z.string().optional(),\n\t\tsocial: socialSettings.optional(),\n\t\tseo: seoSettingsInput.optional(),\n\t})\n\t.meta({ id: \"SettingsUpdateBody\" });\n\n// ---------------------------------------------------------------------------\n// Settings: Response schemas\n//\n// Responses carry the resolved fields populated by `resolveMediaReference`\n// in `settings/index.ts`. Generated OpenAPI clients need to see them so\n// they don't have to re-resolve the URL on the client. Fields stay\n// optional because the resolver returns the bare ref if the underlying\n// media row was deleted (orphaned reference).\n// ---------------------------------------------------------------------------\n\nconst mediaReferenceResponse = z.object({\n\tmediaId: z.string(),\n\talt: z.string().optional(),\n\t/** Resolved media file URL; absent if the underlying row is missing. */\n\turl: z.string().optional(),\n\t/** Stored MIME type (e.g. `image/svg+xml`). Populated alongside `url`. */\n\tcontentType: z.string().optional(),\n\t/** Pixel width if known. Populated alongside `url`. */\n\twidth: z.number().int().optional(),\n\t/** Pixel height if known. Populated alongside `url`. */\n\theight: z.number().int().optional(),\n});\n\nconst seoSettingsResponse = z.object({\n\ttitleSeparator: z.string().max(10).optional(),\n\tdefaultOgImage: mediaReferenceResponse.optional(),\n\trobotsTxt: z.string().max(5000).optional(),\n\tgoogleVerification: z.string().max(100).optional(),\n\tbingVerification: z.string().max(100).optional(),\n});\n\nexport const siteSettingsSchema = z\n\t.object({\n\t\ttitle: z.string().optional(),\n\t\ttagline: z.string().optional(),\n\t\tlogo: mediaReferenceResponse.optional(),\n\t\tfavicon: mediaReferenceResponse.optional(),\n\t\turl: z.string().optional(),\n\t\tpostsPerPage: z.number().int().optional(),\n\t\tdateFormat: z.string().optional(),\n\t\ttimezone: z.string().optional(),\n\t\tsocial: socialSettings.optional(),\n\t\tseo: seoSettingsResponse.optional(),\n\t})\n\t.meta({ id: \"SiteSettings\" });\n","import { z } from \"zod\";\n\nimport { localeCode } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Search: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const searchQuery = z\n\t.object({\n\t\tq: z.string().min(1),\n\t\tcollections: z.string().optional(),\n\t\tstatus: z.string().optional(),\n\t\tlocale: localeCode.optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional(),\n\t\tcursor: z.string().optional(),\n\t})\n\t.meta({ id: \"SearchQuery\" });\n\nexport const searchSuggestQuery = z\n\t.object({\n\t\tq: z.string().min(1),\n\t\tcollections: z.string().optional(),\n\t\tlocale: localeCode.optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(20).optional(),\n\t})\n\t.meta({ id: \"SearchSuggestQuery\" });\n\nexport const searchRebuildBody = z\n\t.object({\n\t\tcollection: z.string().min(1),\n\t})\n\t.meta({ id: \"SearchRebuildBody\" });\n\nexport const searchEnableBody = z\n\t.object({\n\t\tcollection: z.string().min(1),\n\t\tenabled: z.boolean(),\n\t\tweights: z.record(z.string(), z.number()).optional(),\n\t})\n\t.meta({ id: \"SearchEnableBody\" });\n\n// ---------------------------------------------------------------------------\n// Search: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const searchResultSchema = z\n\t.object({\n\t\tcollection: z.string(),\n\t\tid: z.string(),\n\t\tslug: z.string().nullable(),\n\t\tlocale: z.string(),\n\t\ttitle: z.string().optional(),\n\t\tsnippet: z.string().optional(),\n\t\tscore: z.number(),\n\t})\n\t.meta({ id: \"SearchResult\" });\n\nexport const searchResponseSchema = z\n\t.object({\n\t\titems: z.array(searchResultSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"SearchResponse\" });\n","import { z } from \"zod\";\n\nimport { roleLevel } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Admin / Users: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const usersListQuery = z\n\t.object({\n\t\tsearch: z.string().optional(),\n\t\trole: z.string().optional(),\n\t\tcursor: z.string().max(2048).optional(),\n\t\tlimit: z.coerce.number().int().min(1).max(100).optional().default(50),\n\t})\n\t.meta({ id: \"UsersListQuery\" });\n\nexport const userUpdateBody = z\n\t.object({\n\t\tname: z.string().optional(),\n\t\temail: z.string().email().optional(),\n\t\trole: roleLevel.optional(),\n\t})\n\t.meta({ id: \"UserUpdateBody\" });\n\nexport const allowedDomainCreateBody = z\n\t.object({\n\t\tdomain: z.string().min(1),\n\t\tdefaultRole: roleLevel,\n\t})\n\t.meta({ id: \"AllowedDomainCreateBody\" });\n\nexport const allowedDomainUpdateBody = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t\tdefaultRole: roleLevel.optional(),\n\t})\n\t.meta({ id: \"AllowedDomainUpdateBody\" });\n\n// ---------------------------------------------------------------------------\n// Admin / Users: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const userSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\temail: z.string(),\n\t\tname: z.string().nullable(),\n\t\tavatarUrl: z.string().nullable(),\n\t\trole: z.number().int(),\n\t\temailVerified: z.boolean(),\n\t\tdisabled: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tlastLogin: z.string().nullable(),\n\t\tcredentialCount: z.number().int().optional(),\n\t\toauthProviders: z.array(z.string()).optional(),\n\t})\n\t.meta({ id: \"User\" });\n\nexport const userListResponseSchema = z\n\t.object({\n\t\titems: z.array(userSchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"UserListResponse\" });\n\nexport const userDetailSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\temail: z.string(),\n\t\tname: z.string().nullable(),\n\t\tavatarUrl: z.string().nullable(),\n\t\trole: z.number().int(),\n\t\temailVerified: z.boolean(),\n\t\tdisabled: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tlastLogin: z.string().nullable(),\n\t\tcredentials: z.array(\n\t\t\tz.object({\n\t\t\t\tid: z.string(),\n\t\t\t\tname: z.string().nullable(),\n\t\t\t\tdeviceType: z.string().nullable(),\n\t\t\t\tcreatedAt: z.string(),\n\t\t\t\tlastUsedAt: z.string(),\n\t\t\t}),\n\t\t),\n\t\toauthAccounts: z.array(\n\t\t\tz.object({\n\t\t\t\tprovider: z.string(),\n\t\t\t\tcreatedAt: z.string(),\n\t\t\t}),\n\t\t),\n\t})\n\t.meta({ id: \"UserDetail\" });\n","import { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Widgets: Input schemas\n// ---------------------------------------------------------------------------\n\nconst widgetType = z.enum([\"content\", \"menu\", \"component\"]);\n\nexport const createWidgetAreaBody = z\n\t.object({\n\t\tname: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tdescription: z.string().optional(),\n\t})\n\t.meta({ id: \"CreateWidgetAreaBody\" });\n\nexport const createWidgetBody = z\n\t.object({\n\t\ttype: widgetType,\n\t\ttitle: z.string().optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tmenuName: z.string().optional(),\n\t\tcomponentId: z.string().optional(),\n\t\tcomponentProps: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"CreateWidgetBody\" });\n\nexport const updateWidgetBody = z\n\t.object({\n\t\ttype: widgetType.optional(),\n\t\ttitle: z.string().optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tmenuName: z.string().optional(),\n\t\tcomponentId: z.string().optional(),\n\t\tcomponentProps: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"UpdateWidgetBody\" });\n\nexport const reorderWidgetsBody = z\n\t.object({\n\t\twidgetIds: z.array(z.string().min(1)),\n\t})\n\t.meta({ id: \"ReorderWidgetsBody\" });\n\n// ---------------------------------------------------------------------------\n// Widgets: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const widgetAreaSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tname: z.string(),\n\t\tlabel: z.string(),\n\t\tdescription: z.string().nullable(),\n\t\tcreated_at: z.string(),\n\t\tupdated_at: z.string(),\n\t})\n\t.meta({ id: \"WidgetArea\" });\n\nexport const widgetSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\ttype: widgetType,\n\t\ttitle: z.string().optional(),\n\t\tcontent: z.array(z.record(z.string(), z.unknown())).optional(),\n\t\tmenuName: z.string().optional(),\n\t\tcomponentId: z.string().optional(),\n\t\tcomponentProps: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.meta({ id: \"Widget\" });\n\nexport const widgetAreaWithWidgetsSchema = widgetAreaSchema\n\t.extend({\n\t\twidgets: z.array(widgetSchema),\n\t})\n\t.meta({ id: \"WidgetAreaWithWidgets\" });\n\nexport const widgetAreaWithWidgetsAndCountSchema = widgetAreaWithWidgetsSchema\n\t.extend({\n\t\twidgetCount: z.number().int(),\n\t})\n\t.meta({ id: \"WidgetAreaWithWidgetsAndCount\" });\n","import { z } from \"zod\";\n\nimport { isTerminalStatus, REDIRECT_RULE_STATUSES } from \"../../redirects/status.js\";\nimport { cursorPaginationQuery } from \"./common.js\";\n\n// ---------------------------------------------------------------------------\n// Redirects: Input schemas\n// ---------------------------------------------------------------------------\n\nconst redirectType = z.coerce\n\t.number()\n\t.int()\n\t.refine((n) => REDIRECT_RULE_STATUSES.includes(n), {\n\t\tmessage: \"Redirect type must be 301, 302, 307, 308, 410, or 451\",\n\t});\n\n/** Matches CR or LF characters */\nconst CRLF = /[\\r\\n]/;\n\n/** Path must start with / and not be protocol-relative, contain no CRLF, and no path traversal */\nconst urlPath = z\n\t.string()\n\t.min(1)\n\t.refine((s) => s.startsWith(\"/\") && !s.startsWith(\"//\"), {\n\t\tmessage: \"Must be a path starting with / (no protocol-relative URLs)\",\n\t})\n\t.refine((s) => !CRLF.test(s), {\n\t\tmessage: \"URL must not contain newline characters\",\n\t})\n\t.refine(\n\t\t(s) => {\n\t\t\ttry {\n\t\t\t\treturn !decodeURIComponent(s).split(\"/\").includes(\"..\");\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\t{ message: \"URL must not contain path traversal segments\" },\n\t);\n\nexport const createRedirectBody = z\n\t.object({\n\t\tsource: urlPath,\n\t\t// Optional: terminal statuses (410/451) have no destination. Redirect\n\t\t// statuses require one — enforced by the refine below.\n\t\tdestination: z.union([urlPath, z.literal(\"\")]).optional(),\n\t\ttype: redirectType.optional().default(301),\n\t\tenabled: z.boolean().optional().default(true),\n\t\tgroupName: z.string().nullish(),\n\t})\n\t.refine((o) => isTerminalStatus(o.type ?? 301) || !!o.destination, {\n\t\tmessage: \"destination is required for redirect types (301, 302, 307, 308)\",\n\t\tpath: [\"destination\"],\n\t})\n\t.meta({ id: \"CreateRedirectBody\" });\n\nexport const updateRedirectBody = z\n\t.object({\n\t\tsource: urlPath.optional(),\n\t\tdestination: z.union([urlPath, z.literal(\"\")]).optional(),\n\t\ttype: redirectType.optional(),\n\t\tenabled: z.boolean().optional(),\n\t\tgroupName: z.string().nullish(),\n\t})\n\t.refine((o) => Object.values(o).some((v) => v !== undefined), {\n\t\tmessage: \"At least one field must be provided\",\n\t})\n\t.meta({ id: \"UpdateRedirectBody\" });\n\nexport const redirectsListQuery = cursorPaginationQuery\n\t.extend({\n\t\tsearch: z.string().optional(),\n\t\tgroup: z.string().optional(),\n\t\tenabled: z\n\t\t\t.enum([\"true\", \"false\"])\n\t\t\t.transform((v) => v === \"true\")\n\t\t\t.optional(),\n\t\tauto: z\n\t\t\t.enum([\"true\", \"false\"])\n\t\t\t.transform((v) => v === \"true\")\n\t\t\t.optional(),\n\t})\n\t.meta({ id: \"RedirectsListQuery\" });\n\n// ---------------------------------------------------------------------------\n// 404 Log: Input schemas\n// ---------------------------------------------------------------------------\n\nexport const notFoundListQuery = cursorPaginationQuery\n\t.extend({\n\t\tsearch: z.string().optional(),\n\t})\n\t.meta({ id: \"NotFoundListQuery\" });\n\nexport const notFoundSummaryQuery = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(50),\n});\n\nexport const notFoundPruneBody = z\n\t.object({\n\t\tolderThan: z.string().datetime({ message: \"olderThan must be an ISO 8601 datetime\" }),\n\t})\n\t.meta({ id: \"NotFoundPruneBody\" });\n\n// ---------------------------------------------------------------------------\n// Redirects: Response schemas\n// ---------------------------------------------------------------------------\n\nexport const redirectSchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tsource: z.string(),\n\t\tdestination: z.string(),\n\t\ttype: z.number().int(),\n\t\tisPattern: z.boolean(),\n\t\tenabled: z.boolean(),\n\t\thits: z.number().int(),\n\t\tlastHitAt: z.string().nullable(),\n\t\tgroupName: z.string().nullable(),\n\t\tauto: z.boolean(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t})\n\t.meta({ id: \"Redirect\" });\n\nexport const redirectListResponseSchema = z\n\t.object({\n\t\titems: z.array(redirectSchema),\n\t\tnextCursor: z.string().optional(),\n\t\tloopRedirectIds: z.array(z.string()).optional(),\n\t})\n\t.meta({ id: \"RedirectListResponse\" });\n\nexport const notFoundEntrySchema = z\n\t.object({\n\t\tid: z.string(),\n\t\tpath: z.string(),\n\t\treferrer: z.string().nullable(),\n\t\tuserAgent: z.string().nullable(),\n\t\tip: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t})\n\t.meta({ id: \"NotFoundEntry\" });\n\nexport const notFoundListResponseSchema = z\n\t.object({\n\t\titems: z.array(notFoundEntrySchema),\n\t\tnextCursor: z.string().optional(),\n\t})\n\t.meta({ id: \"NotFoundListResponse\" });\n\nexport const notFoundSummarySchema = z\n\t.object({\n\t\tpath: z.string(),\n\t\tcount: z.number().int(),\n\t\tlastSeen: z.string(),\n\t\ttopReferrer: z.string().nullable(),\n\t})\n\t.meta({ id: \"NotFoundSummary\" });\n\nexport const notFoundSummaryResponseSchema = z\n\t.object({ items: z.array(notFoundSummarySchema) })\n\t.meta({ id: \"NotFoundSummaryResponse\" });\n"],"mappings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