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
|
@@ -2,32 +2,63 @@ import { sql, type Kysely, type Selectable } from "kysely";
|
|
|
2
2
|
import { ulid } from "ulidx";
|
|
3
3
|
|
|
4
4
|
import { invalidateTaxonomyObjectCache } from "../../object-cache/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { slugify } from "../../utils/slugify.js";
|
|
6
|
+
import { withTransaction } from "../transaction.js";
|
|
6
7
|
import type { Database, TaxonomyTable } from "../types.js";
|
|
7
8
|
import { validateIdentifier } from "../validate.js";
|
|
8
9
|
|
|
10
|
+
/** A member of one sibling group and the position it currently holds. */
|
|
11
|
+
export interface SiblingPosition {
|
|
12
|
+
group: string;
|
|
13
|
+
position: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
17
|
+
* Translation groups per reorder `UPDATE`. Each costs three bound parameters —
|
|
18
|
+
* a CASE `WHEN`/`THEN` pair plus one slot in the `IN` list — which keeps a
|
|
19
|
+
* statement inside D1's 100-parameter ceiling.
|
|
13
20
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
const GROUPS_PER_UPDATE = 32;
|
|
22
|
+
const NUMERIC_SUFFIX_PATTERN = /^\d+$/;
|
|
23
|
+
|
|
24
|
+
/** Deal the listed groups back out over the slots they hold, in the order given. */
|
|
25
|
+
function permuteWithinSlots(
|
|
26
|
+
listed: readonly string[],
|
|
27
|
+
occupied: readonly number[],
|
|
28
|
+
): Map<string, number> {
|
|
29
|
+
const slots = occupied.toSorted((a, b) => a - b);
|
|
30
|
+
const target = new Map<string, number>();
|
|
31
|
+
listed.forEach((group, index) => {
|
|
32
|
+
const position = slots[index];
|
|
33
|
+
if (position !== undefined) target.set(group, position);
|
|
34
|
+
});
|
|
35
|
+
return target;
|
|
21
36
|
}
|
|
22
37
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Renumber a whole sibling group 0..n-1, with the listed groups in the order
|
|
40
|
+
* given and every other member left in the place it already held.
|
|
41
|
+
*
|
|
42
|
+
* Works off each member's index in the sequence rather than its stored value,
|
|
43
|
+
* which is what lets it resolve positions that tie. The sort is stable, so
|
|
44
|
+
* tied members keep the order `siblings` arrives in — deterministic, but a
|
|
45
|
+
* listing that mixes locales breaks a tie on whichever locale's label sorts
|
|
46
|
+
* first, not on the order any one caller rendered.
|
|
47
|
+
*/
|
|
48
|
+
function renumberSiblings(
|
|
49
|
+
listed: readonly string[],
|
|
50
|
+
siblings: readonly SiblingPosition[],
|
|
51
|
+
): Map<string, number> {
|
|
52
|
+
const sequence = siblings.toSorted((a, b) => a.position - b.position);
|
|
53
|
+
const wanted = new Set(listed);
|
|
54
|
+
const target = new Map<string, number>();
|
|
55
|
+
let next = 0;
|
|
56
|
+
sequence.forEach(({ group }, index) => {
|
|
57
|
+
const replacement = wanted.has(group) ? listed[next++] : undefined;
|
|
58
|
+
target.set(replacement ?? group, index);
|
|
59
|
+
});
|
|
60
|
+
return target;
|
|
61
|
+
}
|
|
31
62
|
|
|
32
63
|
export interface Taxonomy {
|
|
33
64
|
id: string;
|
|
@@ -38,6 +69,11 @@ export interface Taxonomy {
|
|
|
38
69
|
data: Record<string, unknown> | null;
|
|
39
70
|
locale: string;
|
|
40
71
|
translationGroup: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Position among siblings. Shared by every row of a `translation_group` —
|
|
74
|
+
* a term sits in the same place in every locale it is translated into.
|
|
75
|
+
*/
|
|
76
|
+
sortOrder: number;
|
|
41
77
|
}
|
|
42
78
|
|
|
43
79
|
export interface CreateTaxonomyInput {
|
|
@@ -65,16 +101,51 @@ export interface FindOptions {
|
|
|
65
101
|
locale?: string;
|
|
66
102
|
}
|
|
67
103
|
|
|
104
|
+
export interface TaxonomyManualPageCursor {
|
|
105
|
+
sortOrder: number;
|
|
106
|
+
label: string;
|
|
107
|
+
id: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface TaxonomyPageOptions extends FindOptions {
|
|
111
|
+
cursor?: TaxonomyManualPageCursor;
|
|
112
|
+
limit?: number;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface TaxonomyPage {
|
|
116
|
+
items: Taxonomy[];
|
|
117
|
+
hasMore: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface TaxonomyAssignmentTranslation {
|
|
121
|
+
id: string;
|
|
122
|
+
slug: string;
|
|
123
|
+
locale: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface TaxonomyAssignmentResolution {
|
|
127
|
+
translationGroup: string;
|
|
128
|
+
term: Taxonomy | null;
|
|
129
|
+
availableLocales: string[];
|
|
130
|
+
translations: TaxonomyAssignmentTranslation[];
|
|
131
|
+
}
|
|
132
|
+
|
|
68
133
|
/**
|
|
69
134
|
* Taxonomy repository for categories, tags, and other classification.
|
|
70
135
|
*
|
|
71
136
|
* Terms are per-locale. Translations of the same term share a `translation_group`
|
|
72
|
-
* ULID. `content_taxonomies
|
|
73
|
-
* association spans every locale of a post.
|
|
137
|
+
* ULID. `content_taxonomies` stores translation_groups on both sides so a single
|
|
138
|
+
* association spans every locale of a post and term.
|
|
74
139
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
140
|
+
* Strict lookup methods use only the locale callers supply. The explicitly
|
|
141
|
+
* resolved methods accept both the preferred and default locales so their
|
|
142
|
+
* fallback policy stays visible at the call site.
|
|
143
|
+
*
|
|
144
|
+
* `sort_order` is per translation_group, not per row: every row sharing a
|
|
145
|
+
* translation_group carries the same value, so a term holds one position across
|
|
146
|
+
* all its locales. Sibling groups are keyed on the raw `parent_id` column, which
|
|
147
|
+
* is locale-agnostic for the same reason (it stores the parent's
|
|
148
|
+
* translation_group). Writes must preserve both invariants.
|
|
78
149
|
*/
|
|
79
150
|
export class TaxonomyRepository {
|
|
80
151
|
constructor(private db: Kysely<Database>) {}
|
|
@@ -98,10 +169,17 @@ export class TaxonomyRepository {
|
|
|
98
169
|
const parentId = parentInput ? await this.resolveParentRef(parentInput) : null;
|
|
99
170
|
|
|
100
171
|
let translationGroup = id;
|
|
172
|
+
let sortOrder: number | null = null;
|
|
101
173
|
if (input.translationOf) {
|
|
102
174
|
const source = await this.findById(input.translationOf);
|
|
103
175
|
if (source?.translationGroup) translationGroup = source.translationGroup;
|
|
176
|
+
// A translation is the same term in another locale, so it takes the
|
|
177
|
+
// group's position — but only while it stays in the group that position
|
|
178
|
+
// belongs to. Landing under a different parent makes it a new member of
|
|
179
|
+
// that sibling group, and the source's position means nothing there.
|
|
180
|
+
if (source && source.parentId === parentId) sortOrder = source.sortOrder;
|
|
104
181
|
}
|
|
182
|
+
sortOrder ??= await this.nextSortOrder(input.name, parentId);
|
|
105
183
|
|
|
106
184
|
await this.db
|
|
107
185
|
.insertInto("taxonomies")
|
|
@@ -112,6 +190,7 @@ export class TaxonomyRepository {
|
|
|
112
190
|
label: input.label,
|
|
113
191
|
parent_id: parentId,
|
|
114
192
|
data: input.data ? JSON.stringify(input.data) : null,
|
|
193
|
+
sort_order: sortOrder,
|
|
115
194
|
// When omitted, the DB DEFAULT 'en' is used — keeps behaviour
|
|
116
195
|
// consistent with ContentRepository and lets higher layers
|
|
117
196
|
// supply an explicit locale from request context.
|
|
@@ -152,18 +231,43 @@ export class TaxonomyRepository {
|
|
|
152
231
|
return row ? this.rowToTaxonomy(row) : null;
|
|
153
232
|
}
|
|
154
233
|
|
|
234
|
+
/** Generate a locale-scoped term slug, adding a numeric suffix when needed. */
|
|
235
|
+
async generateUniqueSlug(name: string, text: string, locale?: string): Promise<string> {
|
|
236
|
+
const baseSlug = slugify(text);
|
|
237
|
+
let query = this.db
|
|
238
|
+
.selectFrom("taxonomies")
|
|
239
|
+
.select("slug")
|
|
240
|
+
.where("name", "=", name)
|
|
241
|
+
.where((eb) => eb.or([eb("slug", "=", baseSlug), eb("slug", "like", `${baseSlug}-%`)]));
|
|
242
|
+
if (locale !== undefined) query = query.where("locale", "=", locale);
|
|
243
|
+
const candidates = await query.execute();
|
|
244
|
+
if (!candidates.some((candidate) => candidate.slug === baseSlug)) return baseSlug;
|
|
245
|
+
|
|
246
|
+
let maxSuffix = 0;
|
|
247
|
+
const prefix = `${baseSlug}-`;
|
|
248
|
+
for (const candidate of candidates) {
|
|
249
|
+
if (!candidate.slug.startsWith(prefix)) continue;
|
|
250
|
+
const suffix = candidate.slug.slice(prefix.length);
|
|
251
|
+
if (!NUMERIC_SUFFIX_PATTERN.test(suffix)) continue;
|
|
252
|
+
maxSuffix = Math.max(maxSuffix, Number.parseInt(suffix, 10));
|
|
253
|
+
}
|
|
254
|
+
return `${baseSlug}-${maxSuffix + 1}`;
|
|
255
|
+
}
|
|
256
|
+
|
|
155
257
|
/**
|
|
156
258
|
* Get all terms for a taxonomy (e.g., all categories).
|
|
157
259
|
*
|
|
158
|
-
* `
|
|
159
|
-
*
|
|
160
|
-
*
|
|
260
|
+
* `sort_order` carries the manual order set from the admin; it is 0 for
|
|
261
|
+
* terms nobody has reordered, so an untouched taxonomy still comes back
|
|
262
|
+
* alphabetically. `id asc` is a stable tiebreaker for terms that share both
|
|
263
|
+
* values. Without it the SQL ordering is implementation-defined when they match.
|
|
161
264
|
*/
|
|
162
265
|
async findByName(name: string, options: FindOptions = {}): Promise<Taxonomy[]> {
|
|
163
266
|
let query = this.db
|
|
164
267
|
.selectFrom("taxonomies")
|
|
165
268
|
.selectAll()
|
|
166
269
|
.where("name", "=", name)
|
|
270
|
+
.orderBy("sort_order", "asc")
|
|
167
271
|
.orderBy("label", "asc")
|
|
168
272
|
.orderBy("id", "asc");
|
|
169
273
|
|
|
@@ -181,6 +285,71 @@ export class TaxonomyRepository {
|
|
|
181
285
|
return rows.map((row) => this.rowToTaxonomy(row));
|
|
182
286
|
}
|
|
183
287
|
|
|
288
|
+
async findByNameResolved(
|
|
289
|
+
name: string,
|
|
290
|
+
locale: string,
|
|
291
|
+
defaultLocale: string,
|
|
292
|
+
): Promise<Taxonomy[]> {
|
|
293
|
+
const locales = [...new Set([locale, defaultLocale])];
|
|
294
|
+
const rows = await this.db
|
|
295
|
+
.selectFrom("taxonomies")
|
|
296
|
+
.selectAll()
|
|
297
|
+
.where("name", "=", name)
|
|
298
|
+
.where("locale", "in", locales)
|
|
299
|
+
.orderBy("sort_order", "asc")
|
|
300
|
+
.orderBy("label", "asc")
|
|
301
|
+
.orderBy("id", "asc")
|
|
302
|
+
.execute();
|
|
303
|
+
|
|
304
|
+
const selected = new Map<string, Taxonomy>();
|
|
305
|
+
for (const row of rows) {
|
|
306
|
+
const term = this.rowToTaxonomy(row);
|
|
307
|
+
const group = term.translationGroup ?? term.id;
|
|
308
|
+
const current = selected.get(group);
|
|
309
|
+
if (!current || term.locale === locale) selected.set(group, term);
|
|
310
|
+
}
|
|
311
|
+
return [...selected.values()].toSorted(
|
|
312
|
+
(a, b) =>
|
|
313
|
+
a.sortOrder - b.sortOrder || a.label.localeCompare(b.label) || a.id.localeCompare(b.id),
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
async findPageByName(name: string, options: TaxonomyPageOptions = {}): Promise<TaxonomyPage> {
|
|
318
|
+
const limit = Math.max(1, Math.min(options.limit ?? 50, 100));
|
|
319
|
+
let query = this.db.selectFrom("taxonomies").selectAll().where("name", "=", name);
|
|
320
|
+
|
|
321
|
+
if (options.locale !== undefined) query = query.where("locale", "=", options.locale);
|
|
322
|
+
|
|
323
|
+
if (options.parentId !== undefined) {
|
|
324
|
+
query =
|
|
325
|
+
options.parentId === null
|
|
326
|
+
? query.where("parent_id", "is", null)
|
|
327
|
+
: query.where("parent_id", "=", options.parentId);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (options.cursor) {
|
|
331
|
+
const cursor = options.cursor;
|
|
332
|
+
query = query.where((eb) =>
|
|
333
|
+
eb.or([
|
|
334
|
+
eb("sort_order", ">", cursor.sortOrder),
|
|
335
|
+
eb.and([eb("sort_order", "=", cursor.sortOrder), eb("label", ">", cursor.label)]),
|
|
336
|
+
eb.and([
|
|
337
|
+
eb("sort_order", "=", cursor.sortOrder),
|
|
338
|
+
eb("label", "=", cursor.label),
|
|
339
|
+
eb("id", ">", cursor.id),
|
|
340
|
+
]),
|
|
341
|
+
]),
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
query = query.orderBy("sort_order", "asc").orderBy("label", "asc").orderBy("id", "asc");
|
|
345
|
+
|
|
346
|
+
const rows = await query.limit(limit + 1).execute();
|
|
347
|
+
return {
|
|
348
|
+
items: rows.slice(0, limit).map((row) => this.rowToTaxonomy(row)),
|
|
349
|
+
hasMore: rows.length > limit,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
184
353
|
/**
|
|
185
354
|
* Children of a term. Accepts a term id OR a translation_group and resolves
|
|
186
355
|
* to the group, since `parent_id` stores the parent's translation_group.
|
|
@@ -196,6 +365,7 @@ export class TaxonomyRepository {
|
|
|
196
365
|
.selectFrom("taxonomies")
|
|
197
366
|
.selectAll()
|
|
198
367
|
.where("parent_id", "=", group)
|
|
368
|
+
.orderBy("sort_order", "asc")
|
|
199
369
|
.orderBy("label", "asc")
|
|
200
370
|
.orderBy("id", "asc");
|
|
201
371
|
if (locale !== undefined) query = query.where("locale", "=", locale);
|
|
@@ -222,28 +392,146 @@ export class TaxonomyRepository {
|
|
|
222
392
|
const existing = await this.findById(id);
|
|
223
393
|
if (!existing) return null;
|
|
224
394
|
|
|
395
|
+
// Per-row display fields. `parent_id` and `sort_order` are not here: both
|
|
396
|
+
// belong to the translation_group and are written across it below.
|
|
225
397
|
const updates: Record<string, unknown> = {};
|
|
226
398
|
if (input.slug !== undefined) updates.slug = input.slug;
|
|
227
399
|
if (input.label !== undefined) updates.label = input.label;
|
|
400
|
+
if (input.data !== undefined) updates.data = JSON.stringify(input.data);
|
|
401
|
+
|
|
402
|
+
const group: { parent_id?: string | null; sort_order?: number } = {};
|
|
228
403
|
if (input.parentId !== undefined) {
|
|
229
404
|
// Defense in depth: empty-string parentId means null (no parent).
|
|
230
405
|
// Otherwise persist the parent's translation_group (locale-agnostic),
|
|
231
406
|
// matching create() — see the note there.
|
|
232
|
-
|
|
407
|
+
const parentId =
|
|
233
408
|
input.parentId === "" || input.parentId === null
|
|
234
409
|
? null
|
|
235
410
|
: await this.resolveParentRef(input.parentId);
|
|
411
|
+
|
|
412
|
+
if (parentId !== existing.parentId) {
|
|
413
|
+
group.parent_id = parentId;
|
|
414
|
+
// A position only means anything within one sibling group, so a term
|
|
415
|
+
// that changes parent is appended to the group it lands in.
|
|
416
|
+
group.sort_order = await this.nextSortOrder(existing.name, parentId);
|
|
417
|
+
}
|
|
236
418
|
}
|
|
237
|
-
if (input.data !== undefined) updates.data = JSON.stringify(input.data);
|
|
238
419
|
|
|
239
|
-
|
|
240
|
-
|
|
420
|
+
const hasRowUpdates = Object.keys(updates).length > 0;
|
|
421
|
+
const hasGroupUpdates = Object.keys(group).length > 0;
|
|
422
|
+
if (hasRowUpdates || hasGroupUpdates) {
|
|
423
|
+
await withTransaction(this.db, async (trx) => {
|
|
424
|
+
if (hasRowUpdates) {
|
|
425
|
+
await trx.updateTable("taxonomies").set(updates).where("id", "=", id).execute();
|
|
426
|
+
}
|
|
427
|
+
if (hasGroupUpdates) {
|
|
428
|
+
await trx
|
|
429
|
+
.updateTable("taxonomies")
|
|
430
|
+
.set(group)
|
|
431
|
+
.where("translation_group", "=", existing.translationGroup ?? existing.id)
|
|
432
|
+
.execute();
|
|
433
|
+
}
|
|
434
|
+
});
|
|
241
435
|
invalidateTaxonomyObjectCache();
|
|
242
436
|
}
|
|
243
437
|
|
|
244
438
|
return this.findById(id);
|
|
245
439
|
}
|
|
246
440
|
|
|
441
|
+
/**
|
|
442
|
+
* Move `groups` (translation_groups, in the desired order) into the positions
|
|
443
|
+
* those same groups already occupy, leaving every other member of the sibling
|
|
444
|
+
* group where it is.
|
|
445
|
+
*
|
|
446
|
+
* `groups` may be a subset: a locale renders only the terms translated into
|
|
447
|
+
* it, so an admin in `fr` often cannot name every member. A group left out
|
|
448
|
+
* keeps its place, which is also what makes a stale list harmless.
|
|
449
|
+
*
|
|
450
|
+
* `siblings` is every member of the group with the position it holds, in a
|
|
451
|
+
* listing's order — tied positions are resolved by that order, so pass it as
|
|
452
|
+
* read. Groups already at their target are skipped, so one swap rewrites two
|
|
453
|
+
* groups rather than the whole list.
|
|
454
|
+
*/
|
|
455
|
+
async reorder(groups: string[], siblings: readonly SiblingPosition[]): Promise<void> {
|
|
456
|
+
const current = new Map(siblings.map(({ group, position }) => [group, position]));
|
|
457
|
+
|
|
458
|
+
const listed: string[] = [];
|
|
459
|
+
const occupied: number[] = [];
|
|
460
|
+
for (const group of groups) {
|
|
461
|
+
const position = current.get(group);
|
|
462
|
+
if (position === undefined) continue;
|
|
463
|
+
listed.push(group);
|
|
464
|
+
occupied.push(position);
|
|
465
|
+
}
|
|
466
|
+
if (listed.length === 0) return;
|
|
467
|
+
|
|
468
|
+
// Tied positions have no distinct order to permute into, so the requested
|
|
469
|
+
// one would be dropped without a word. Renumbering is the only way to
|
|
470
|
+
// honour it, and it repairs the tie on the way through.
|
|
471
|
+
const target =
|
|
472
|
+
new Set(occupied).size === occupied.length
|
|
473
|
+
? permuteWithinSlots(listed, occupied)
|
|
474
|
+
: renumberSiblings(listed, siblings);
|
|
475
|
+
|
|
476
|
+
const changed = [...target].filter(([group, position]) => current.get(group) !== position);
|
|
477
|
+
if (changed.length === 0) return;
|
|
478
|
+
|
|
479
|
+
await this.applyPositions(changed);
|
|
480
|
+
|
|
481
|
+
invalidateTaxonomyObjectCache();
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Write one position per translation_group, GROUPS_PER_UPDATE at a time so
|
|
486
|
+
* each statement stays inside D1's parameter ceiling.
|
|
487
|
+
*
|
|
488
|
+
* D1 has no transactions — `withTransaction` runs its callback bare there —
|
|
489
|
+
* so a chunk is the unit that can't tear. A reorder spanning several chunks
|
|
490
|
+
* can, and leaves ties, which the next reorder renumbers away.
|
|
491
|
+
*/
|
|
492
|
+
private async applyPositions(positions: readonly (readonly [string, number])[]): Promise<void> {
|
|
493
|
+
for (let index = 0; index < positions.length; index += GROUPS_PER_UPDATE) {
|
|
494
|
+
const chunk = positions.slice(index, index + GROUPS_PER_UPDATE);
|
|
495
|
+
// The CAST types the bound position. Postgres resolves a CASE whose THEN
|
|
496
|
+
// arms are all untyped parameters to text, then refuses to assign text to
|
|
497
|
+
// an integer column.
|
|
498
|
+
const arms = sql.join(
|
|
499
|
+
chunk.map(([group, position]) => sql`WHEN ${group} THEN CAST(${position} AS INTEGER)`),
|
|
500
|
+
sql` `,
|
|
501
|
+
);
|
|
502
|
+
const keys = sql.join(chunk.map(([group]) => sql`${group}`));
|
|
503
|
+
await sql`
|
|
504
|
+
UPDATE taxonomies
|
|
505
|
+
SET sort_order = CASE translation_group ${arms} END
|
|
506
|
+
WHERE translation_group IN (${keys})
|
|
507
|
+
`.execute(this.db);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Position for a term joining a sibling group: one past the last member, or
|
|
513
|
+
* 0 when the group is empty.
|
|
514
|
+
*
|
|
515
|
+
* Bounds are taken across every locale because a position belongs to the
|
|
516
|
+
* translation_group, not to a row — a term translated into only one locale
|
|
517
|
+
* still occupies its slot for all of them.
|
|
518
|
+
*/
|
|
519
|
+
private async nextSortOrder(name: string, parentId: string | null): Promise<number> {
|
|
520
|
+
let query = this.db
|
|
521
|
+
.selectFrom("taxonomies")
|
|
522
|
+
.select((eb) => eb.fn.max("sort_order").as("max"))
|
|
523
|
+
.where("name", "=", name);
|
|
524
|
+
query =
|
|
525
|
+
parentId === null
|
|
526
|
+
? query.where("parent_id", "is", null)
|
|
527
|
+
: query.where("parent_id", "=", parentId);
|
|
528
|
+
|
|
529
|
+
const bounds = await query.executeTakeFirst();
|
|
530
|
+
// Null only when the group is empty.
|
|
531
|
+
if (!bounds || bounds.max === null) return 0;
|
|
532
|
+
return bounds.max + 1;
|
|
533
|
+
}
|
|
534
|
+
|
|
247
535
|
async delete(id: string): Promise<boolean> {
|
|
248
536
|
const term = await this.findById(id);
|
|
249
537
|
if (!term) return false;
|
|
@@ -270,30 +558,56 @@ export class TaxonomyRepository {
|
|
|
270
558
|
return (result.numDeletedRows ?? 0n) > 0n;
|
|
271
559
|
}
|
|
272
560
|
|
|
273
|
-
// --- Content-Taxonomy Junction (
|
|
561
|
+
// --- Content-Taxonomy Junction (both ids store translation_groups) ---
|
|
274
562
|
|
|
275
563
|
async attachToEntry(collection: string, entryId: string, taxonomyId: string): Promise<void> {
|
|
276
|
-
const
|
|
277
|
-
if (!
|
|
564
|
+
const taxonomyGroup = await this.resolveTranslationGroup(taxonomyId);
|
|
565
|
+
if (!taxonomyGroup) return;
|
|
566
|
+
await this.attachGroupsToEntry(collection, entryId, [taxonomyGroup]);
|
|
567
|
+
}
|
|
278
568
|
|
|
279
|
-
|
|
280
|
-
|
|
569
|
+
/**
|
|
570
|
+
* Attach already-resolved term translation groups in one insert and return
|
|
571
|
+
* the number of assignments that did not already exist.
|
|
572
|
+
*/
|
|
573
|
+
async attachGroupsToEntry(
|
|
574
|
+
collection: string,
|
|
575
|
+
entryId: string,
|
|
576
|
+
taxonomyGroups: string[],
|
|
577
|
+
): Promise<number> {
|
|
578
|
+
const uniqueGroups = [...new Set(taxonomyGroups)];
|
|
579
|
+
if (uniqueGroups.length === 0) return 0;
|
|
580
|
+
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
581
|
+
if (!entryGroup) return 0;
|
|
582
|
+
|
|
583
|
+
const result = await this.db
|
|
281
584
|
.insertInto("content_taxonomies")
|
|
282
|
-
.values(
|
|
585
|
+
.values(
|
|
586
|
+
uniqueGroups.map((taxonomy_id) => ({
|
|
587
|
+
collection,
|
|
588
|
+
entry_id: entryGroup,
|
|
589
|
+
taxonomy_id,
|
|
590
|
+
})),
|
|
591
|
+
)
|
|
283
592
|
.onConflict((oc) => oc.doNothing())
|
|
284
|
-
.
|
|
285
|
-
|
|
593
|
+
.executeTakeFirst();
|
|
594
|
+
const inserted = Number(result.numInsertedOrUpdatedRows ?? 0n);
|
|
595
|
+
if (inserted > 0) invalidateTaxonomyObjectCache();
|
|
596
|
+
return inserted;
|
|
286
597
|
}
|
|
287
598
|
|
|
288
599
|
async detachFromEntry(collection: string, entryId: string, taxonomyId: string): Promise<void> {
|
|
289
|
-
const
|
|
290
|
-
|
|
600
|
+
const [entryGroup, taxonomyGroup] = await Promise.all([
|
|
601
|
+
this.resolveEntryTranslationGroup(collection, entryId),
|
|
602
|
+
this.resolveTranslationGroup(taxonomyId),
|
|
603
|
+
]);
|
|
604
|
+
if (!entryGroup || !taxonomyGroup) return;
|
|
291
605
|
|
|
292
606
|
await this.db
|
|
293
607
|
.deleteFrom("content_taxonomies")
|
|
294
608
|
.where("collection", "=", collection)
|
|
295
|
-
.where("entry_id", "=",
|
|
296
|
-
.where("taxonomy_id", "=",
|
|
609
|
+
.where("entry_id", "=", entryGroup)
|
|
610
|
+
.where("taxonomy_id", "=", taxonomyGroup)
|
|
297
611
|
.execute();
|
|
298
612
|
invalidateTaxonomyObjectCache();
|
|
299
613
|
}
|
|
@@ -309,12 +623,15 @@ export class TaxonomyRepository {
|
|
|
309
623
|
taxonomyName?: string,
|
|
310
624
|
locale?: string,
|
|
311
625
|
): Promise<Taxonomy[]> {
|
|
626
|
+
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
627
|
+
if (!entryGroup) return [];
|
|
628
|
+
|
|
312
629
|
let query = this.db
|
|
313
630
|
.selectFrom("content_taxonomies")
|
|
314
631
|
.innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id")
|
|
315
632
|
.selectAll("taxonomies")
|
|
316
633
|
.where("content_taxonomies.collection", "=", collection)
|
|
317
|
-
.where("content_taxonomies.entry_id", "=",
|
|
634
|
+
.where("content_taxonomies.entry_id", "=", entryGroup);
|
|
318
635
|
|
|
319
636
|
if (taxonomyName) query = query.where("taxonomies.name", "=", taxonomyName);
|
|
320
637
|
if (locale !== undefined) query = query.where("taxonomies.locale", "=", locale);
|
|
@@ -323,6 +640,53 @@ export class TaxonomyRepository {
|
|
|
323
640
|
return rows.map((row) => this.rowToTaxonomy(row));
|
|
324
641
|
}
|
|
325
642
|
|
|
643
|
+
async getTermAssignmentsForEntry(
|
|
644
|
+
collection: string,
|
|
645
|
+
entryId: string,
|
|
646
|
+
taxonomyName: string,
|
|
647
|
+
locale: string,
|
|
648
|
+
defaultLocale: string,
|
|
649
|
+
): Promise<TaxonomyAssignmentResolution[]> {
|
|
650
|
+
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
651
|
+
if (!entryGroup) return [];
|
|
652
|
+
|
|
653
|
+
const rows = await this.db
|
|
654
|
+
.selectFrom("content_taxonomies")
|
|
655
|
+
.innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id")
|
|
656
|
+
.selectAll("taxonomies")
|
|
657
|
+
.select("content_taxonomies.taxonomy_id as assignment_group")
|
|
658
|
+
.where("content_taxonomies.collection", "=", collection)
|
|
659
|
+
.where("content_taxonomies.entry_id", "=", entryGroup)
|
|
660
|
+
.where("taxonomies.name", "=", taxonomyName)
|
|
661
|
+
.orderBy("content_taxonomies.taxonomy_id", "asc")
|
|
662
|
+
.orderBy("taxonomies.locale", "asc")
|
|
663
|
+
.execute();
|
|
664
|
+
|
|
665
|
+
const byGroup = new Map<string, Taxonomy[]>();
|
|
666
|
+
for (const row of rows) {
|
|
667
|
+
const variants = byGroup.get(row.assignment_group) ?? [];
|
|
668
|
+
variants.push(this.rowToTaxonomy(row));
|
|
669
|
+
byGroup.set(row.assignment_group, variants);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
return Array.from(byGroup, ([translationGroup, variants]) => {
|
|
673
|
+
const term =
|
|
674
|
+
variants.find((variant) => variant.locale === locale) ??
|
|
675
|
+
variants.find((variant) => variant.locale === defaultLocale) ??
|
|
676
|
+
null;
|
|
677
|
+
return {
|
|
678
|
+
translationGroup,
|
|
679
|
+
term,
|
|
680
|
+
availableLocales: variants.map((variant) => variant.locale),
|
|
681
|
+
translations: variants.map((variant) => ({
|
|
682
|
+
id: variant.id,
|
|
683
|
+
slug: variant.slug,
|
|
684
|
+
locale: variant.locale,
|
|
685
|
+
})),
|
|
686
|
+
};
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
326
690
|
/**
|
|
327
691
|
* Replace all assignments of a given taxonomy for one content entry.
|
|
328
692
|
* Term ids OR translation_groups are accepted and normalised to groups.
|
|
@@ -333,6 +697,9 @@ export class TaxonomyRepository {
|
|
|
333
697
|
taxonomyName: string,
|
|
334
698
|
termIds: string[],
|
|
335
699
|
): Promise<void> {
|
|
700
|
+
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
701
|
+
if (!entryGroup) return;
|
|
702
|
+
|
|
336
703
|
const groups: string[] = [];
|
|
337
704
|
for (const id of termIds) {
|
|
338
705
|
const group = await this.resolveTranslationGroup(id);
|
|
@@ -346,7 +713,7 @@ export class TaxonomyRepository {
|
|
|
346
713
|
.select(["content_taxonomies.taxonomy_id as group"])
|
|
347
714
|
.distinct()
|
|
348
715
|
.where("content_taxonomies.collection", "=", collection)
|
|
349
|
-
.where("content_taxonomies.entry_id", "=",
|
|
716
|
+
.where("content_taxonomies.entry_id", "=", entryGroup)
|
|
350
717
|
.where("taxonomies.name", "=", taxonomyName)
|
|
351
718
|
.execute();
|
|
352
719
|
const currentGroups = new Set(current.map((r) => r.group));
|
|
@@ -356,22 +723,20 @@ export class TaxonomyRepository {
|
|
|
356
723
|
await this.db
|
|
357
724
|
.deleteFrom("content_taxonomies")
|
|
358
725
|
.where("collection", "=", collection)
|
|
359
|
-
.where("entry_id", "=",
|
|
726
|
+
.where("entry_id", "=", entryGroup)
|
|
360
727
|
.where("taxonomy_id", "in", toRemove)
|
|
361
728
|
.execute();
|
|
362
729
|
}
|
|
363
730
|
|
|
364
731
|
const toAdd = [...newGroups].filter((g) => !currentGroups.has(g));
|
|
365
732
|
if (toAdd.length > 0) {
|
|
366
|
-
const denorm = await this.fetchEntryDenorm(collection, entryId);
|
|
367
733
|
await this.db
|
|
368
734
|
.insertInto("content_taxonomies")
|
|
369
735
|
.values(
|
|
370
736
|
toAdd.map((taxonomy_id) => ({
|
|
371
737
|
collection,
|
|
372
|
-
entry_id:
|
|
738
|
+
entry_id: entryGroup,
|
|
373
739
|
taxonomy_id,
|
|
374
|
-
...denorm,
|
|
375
740
|
})),
|
|
376
741
|
)
|
|
377
742
|
.onConflict((oc) => oc.doNothing())
|
|
@@ -382,72 +747,32 @@ export class TaxonomyRepository {
|
|
|
382
747
|
}
|
|
383
748
|
|
|
384
749
|
async clearEntryTerms(collection: string, entryId: string): Promise<number> {
|
|
750
|
+
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
751
|
+
if (!entryGroup) return 0;
|
|
752
|
+
|
|
385
753
|
const result = await this.db
|
|
386
754
|
.deleteFrom("content_taxonomies")
|
|
387
755
|
.where("collection", "=", collection)
|
|
388
|
-
.where("entry_id", "=",
|
|
756
|
+
.where("entry_id", "=", entryGroup)
|
|
389
757
|
.executeTakeFirst();
|
|
390
758
|
const removed = Number(result.numDeletedRows ?? 0);
|
|
391
759
|
if (removed > 0) invalidateTaxonomyObjectCache();
|
|
392
760
|
return removed;
|
|
393
761
|
}
|
|
394
762
|
|
|
395
|
-
|
|
396
|
-
* Copy every term assignment from one content entry to another. Used when
|
|
397
|
-
* creating a translation of a post so the new translation inherits the
|
|
398
|
-
* source's term assignments. Safe to call when the source has no terms.
|
|
399
|
-
*/
|
|
400
|
-
async copyEntryTerms(
|
|
763
|
+
private async resolveEntryTranslationGroup(
|
|
401
764
|
collection: string,
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
): Promise<void> {
|
|
405
|
-
const rows = await this.db
|
|
406
|
-
.selectFrom("content_taxonomies")
|
|
407
|
-
.select(["taxonomy_id"])
|
|
408
|
-
.where("collection", "=", collection)
|
|
409
|
-
.where("entry_id", "=", sourceEntryId)
|
|
410
|
-
.execute();
|
|
411
|
-
if (rows.length === 0) return;
|
|
412
|
-
|
|
413
|
-
// Stamp the TARGET entry's current values — the copy inherits the source's
|
|
414
|
-
// term memberships but the target's own status/dates/locale.
|
|
415
|
-
const denorm = await this.fetchEntryDenorm(collection, targetEntryId);
|
|
416
|
-
await this.db
|
|
417
|
-
.insertInto("content_taxonomies")
|
|
418
|
-
.values(
|
|
419
|
-
rows.map((r) => ({
|
|
420
|
-
collection,
|
|
421
|
-
entry_id: targetEntryId,
|
|
422
|
-
taxonomy_id: r.taxonomy_id,
|
|
423
|
-
...denorm,
|
|
424
|
-
})),
|
|
425
|
-
)
|
|
426
|
-
.onConflict((oc) => oc.doNothing())
|
|
427
|
-
.execute();
|
|
428
|
-
invalidateTaxonomyObjectCache();
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Read the denormalized filter + sort columns from an entry's `ec_*` row so
|
|
433
|
-
* they can be stamped onto new pivot rows (migration 051). A missing table or
|
|
434
|
-
* missing row yields all-nulls: the pivot columns are advisory, and the
|
|
435
|
-
* listing read path re-checks the authoritative `ec_*` row regardless.
|
|
436
|
-
*/
|
|
437
|
-
private async fetchEntryDenorm(collection: string, entryId: string): Promise<PivotDenorm> {
|
|
765
|
+
entryIdOrGroup: string,
|
|
766
|
+
): Promise<string | null> {
|
|
438
767
|
validateIdentifier(collection, "collection type");
|
|
439
768
|
const tableName = `ec_${collection}`;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
} catch (error) {
|
|
448
|
-
if (isMissingTableError(error)) return EMPTY_DENORM;
|
|
449
|
-
throw error;
|
|
450
|
-
}
|
|
769
|
+
const result = await sql<{ translation_group: string }>`
|
|
770
|
+
SELECT translation_group
|
|
771
|
+
FROM ${sql.ref(tableName)}
|
|
772
|
+
WHERE id = ${entryIdOrGroup} OR translation_group = ${entryIdOrGroup}
|
|
773
|
+
LIMIT 1
|
|
774
|
+
`.execute(this.db);
|
|
775
|
+
return result.rows[0]?.translation_group ?? null;
|
|
451
776
|
}
|
|
452
777
|
|
|
453
778
|
/**
|
|
@@ -543,6 +868,7 @@ export class TaxonomyRepository {
|
|
|
543
868
|
data: row.data ? JSON.parse(row.data) : null,
|
|
544
869
|
locale: row.locale,
|
|
545
870
|
translationGroup: row.translation_group,
|
|
871
|
+
sortOrder: row.sort_order,
|
|
546
872
|
};
|
|
547
873
|
}
|
|
548
874
|
}
|