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
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { sql, type Kysely, type RawBuilder } from "kysely";
|
|
2
|
+
|
|
3
|
+
import { columnExists, isPostgres, tableExists } from "../dialect-helpers.js";
|
|
4
|
+
|
|
5
|
+
const ACTIVATION_KEY = "incremental_capture";
|
|
6
|
+
const CONTENT_ADAPTER_ID = "content-media";
|
|
7
|
+
const COLLECTION_SCOPE = "collection";
|
|
8
|
+
const DUPLICATE_COLUMN_RE = /(?:duplicate column|column .* already exists|already exists.*column)/i;
|
|
9
|
+
|
|
10
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
11
|
+
await db.schema
|
|
12
|
+
.createTable("_emdash_media_usage_activation")
|
|
13
|
+
.ifNotExists()
|
|
14
|
+
.addColumn("task_key", "text", (column) => column.primaryKey())
|
|
15
|
+
.addColumn("state", "text", (column) => column.notNull().defaultTo("expanded"))
|
|
16
|
+
.addColumn("runtime_generation", "integer", (column) => column.notNull().defaultTo(1))
|
|
17
|
+
.addColumn("collection_cursor", "text")
|
|
18
|
+
.addColumn("drain_confirmed_at", "text")
|
|
19
|
+
.addColumn("lease_token", "text")
|
|
20
|
+
.addColumn("lease_expires_at", "text")
|
|
21
|
+
.addColumn("attempt_count", "integer", (column) => column.notNull().defaultTo(0))
|
|
22
|
+
.addColumn("last_attempted_at", "text")
|
|
23
|
+
.addColumn("last_error_code", "text")
|
|
24
|
+
.addColumn("activated_at", "text")
|
|
25
|
+
.addColumn("created_at", "text", (column) =>
|
|
26
|
+
column.notNull().defaultTo(sortableUtcTimestamp(db)),
|
|
27
|
+
)
|
|
28
|
+
.addColumn("updated_at", "text", (column) =>
|
|
29
|
+
column.notNull().defaultTo(sortableUtcTimestamp(db)),
|
|
30
|
+
)
|
|
31
|
+
.execute();
|
|
32
|
+
|
|
33
|
+
await sql`
|
|
34
|
+
INSERT INTO _emdash_media_usage_activation (task_key, state)
|
|
35
|
+
VALUES (${ACTIVATION_KEY}, 'expanded')
|
|
36
|
+
ON CONFLICT (task_key) DO NOTHING
|
|
37
|
+
`.execute(db);
|
|
38
|
+
|
|
39
|
+
await db.schema
|
|
40
|
+
.createTable("_emdash_media_usage_work")
|
|
41
|
+
.ifNotExists()
|
|
42
|
+
.addColumn("collection_id", "text", (column) => column.notNull())
|
|
43
|
+
.addColumn("collection_slug", "text", (column) => column.notNull())
|
|
44
|
+
.addColumn("content_id", "text", (column) => column.notNull())
|
|
45
|
+
.addColumn("change_epoch", "bigint", (column) => column.notNull())
|
|
46
|
+
.addColumn("work_version", "bigint", (column) => column.notNull().defaultTo(1))
|
|
47
|
+
.addColumn("state", "text", (column) => column.notNull().defaultTo("pending"))
|
|
48
|
+
.addColumn("attempt_count", "integer", (column) => column.notNull().defaultTo(0))
|
|
49
|
+
.addColumn("next_attempt_at", "text", (column) => column.notNull())
|
|
50
|
+
.addColumn("lease_token", "text")
|
|
51
|
+
.addColumn("lease_expires_at", "text")
|
|
52
|
+
.addColumn("last_attempted_at", "text")
|
|
53
|
+
.addColumn("last_error_code", "text")
|
|
54
|
+
.addColumn("created_at", "text", (column) =>
|
|
55
|
+
column.notNull().defaultTo(sortableUtcTimestamp(db)),
|
|
56
|
+
)
|
|
57
|
+
.addColumn("updated_at", "text", (column) =>
|
|
58
|
+
column.notNull().defaultTo(sortableUtcTimestamp(db)),
|
|
59
|
+
)
|
|
60
|
+
.addPrimaryKeyConstraint("_emdash_media_usage_work_pk", ["collection_id", "content_id"])
|
|
61
|
+
.execute();
|
|
62
|
+
|
|
63
|
+
await addStatusColumns(db);
|
|
64
|
+
await addSourceColumns(db);
|
|
65
|
+
|
|
66
|
+
await db.schema
|
|
67
|
+
.createIndex("idx__emdash_media_usage_work_due")
|
|
68
|
+
.ifNotExists()
|
|
69
|
+
.on("_emdash_media_usage_work")
|
|
70
|
+
.columns(["state", "next_attempt_at", "updated_at", "collection_id", "content_id"])
|
|
71
|
+
.execute();
|
|
72
|
+
await db.schema
|
|
73
|
+
.createIndex("idx__emdash_media_usage_work_lease")
|
|
74
|
+
.ifNotExists()
|
|
75
|
+
.on("_emdash_media_usage_work")
|
|
76
|
+
.columns(["state", "lease_expires_at", "collection_id", "content_id"])
|
|
77
|
+
.execute();
|
|
78
|
+
await db.schema
|
|
79
|
+
.createIndex("idx__emdash_media_usage_work_operator")
|
|
80
|
+
.ifNotExists()
|
|
81
|
+
.on("_emdash_media_usage_work")
|
|
82
|
+
.columns(["collection_id", "state", "updated_at", "content_id"])
|
|
83
|
+
.execute();
|
|
84
|
+
await db.schema
|
|
85
|
+
.createIndex("idx__emdash_media_usage_status_collection")
|
|
86
|
+
.ifNotExists()
|
|
87
|
+
.unique()
|
|
88
|
+
.on("_emdash_media_usage_index_status")
|
|
89
|
+
.columns(["adapter_id", "scope_type", "collection_id"])
|
|
90
|
+
.execute();
|
|
91
|
+
await db.schema
|
|
92
|
+
.createIndex("idx__emdash_media_usage_sources_identity")
|
|
93
|
+
.ifNotExists()
|
|
94
|
+
.on("_emdash_media_usage_sources")
|
|
95
|
+
.columns(["source_type", "collection_id", "content_id", "source_variant"])
|
|
96
|
+
.execute();
|
|
97
|
+
|
|
98
|
+
await sql`
|
|
99
|
+
DELETE FROM _emdash_media_usage_index_status
|
|
100
|
+
WHERE adapter_id = ${CONTENT_ADAPTER_ID}
|
|
101
|
+
AND scope_type = ${COLLECTION_SCOPE}
|
|
102
|
+
AND (
|
|
103
|
+
(
|
|
104
|
+
collection_id IS NULL
|
|
105
|
+
AND NOT EXISTS (
|
|
106
|
+
SELECT 1
|
|
107
|
+
FROM _emdash_collections AS collection
|
|
108
|
+
WHERE collection.slug = _emdash_media_usage_index_status.scope_key
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
OR (
|
|
112
|
+
collection_id IS NOT NULL
|
|
113
|
+
AND capture_state = 'installing'
|
|
114
|
+
AND EXISTS (
|
|
115
|
+
SELECT 1
|
|
116
|
+
FROM _emdash_media_usage_activation AS activation
|
|
117
|
+
WHERE activation.task_key = ${ACTIVATION_KEY}
|
|
118
|
+
AND activation.state = 'expanded'
|
|
119
|
+
)
|
|
120
|
+
AND NOT EXISTS (
|
|
121
|
+
SELECT 1
|
|
122
|
+
FROM _emdash_collections AS collection
|
|
123
|
+
WHERE collection.id = _emdash_media_usage_index_status.collection_id
|
|
124
|
+
AND collection.slug = _emdash_media_usage_index_status.scope_key
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
`.execute(db);
|
|
129
|
+
|
|
130
|
+
await sql`
|
|
131
|
+
UPDATE _emdash_media_usage_index_status
|
|
132
|
+
SET collection_id = (
|
|
133
|
+
SELECT collection.id
|
|
134
|
+
FROM _emdash_collections AS collection
|
|
135
|
+
WHERE collection.slug = _emdash_media_usage_index_status.scope_key
|
|
136
|
+
),
|
|
137
|
+
reconciliation_required = 1,
|
|
138
|
+
capture_state = COALESCE(capture_state, 'installing')
|
|
139
|
+
WHERE adapter_id = ${CONTENT_ADAPTER_ID}
|
|
140
|
+
AND scope_type = ${COLLECTION_SCOPE}
|
|
141
|
+
AND (
|
|
142
|
+
collection_id IS NULL
|
|
143
|
+
OR capture_state IS NULL
|
|
144
|
+
)
|
|
145
|
+
AND EXISTS (
|
|
146
|
+
SELECT 1
|
|
147
|
+
FROM _emdash_collections AS collection
|
|
148
|
+
WHERE collection.id = COALESCE(
|
|
149
|
+
_emdash_media_usage_index_status.collection_id,
|
|
150
|
+
collection.id
|
|
151
|
+
)
|
|
152
|
+
AND collection.slug = _emdash_media_usage_index_status.scope_key
|
|
153
|
+
)
|
|
154
|
+
`.execute(db);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
158
|
+
await assertRollbackIsEmptyAndInactive(db);
|
|
159
|
+
|
|
160
|
+
await db.schema.dropIndex("idx__emdash_media_usage_sources_identity").ifExists().execute();
|
|
161
|
+
await db.schema.dropIndex("idx__emdash_media_usage_status_collection").ifExists().execute();
|
|
162
|
+
await db.schema.dropIndex("idx__emdash_media_usage_work_operator").ifExists().execute();
|
|
163
|
+
await db.schema.dropIndex("idx__emdash_media_usage_work_lease").ifExists().execute();
|
|
164
|
+
await db.schema.dropIndex("idx__emdash_media_usage_work_due").ifExists().execute();
|
|
165
|
+
await db.schema.dropTable("_emdash_media_usage_work").ifExists().execute();
|
|
166
|
+
await db.schema.dropTable("_emdash_media_usage_activation").ifExists().execute();
|
|
167
|
+
if (isPostgres(db)) {
|
|
168
|
+
await sql`DROP FUNCTION IF EXISTS emdash_media_usage_capture_work()`.execute(db);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
for (const columnName of ["identity_version", "collection_id"] as const) {
|
|
172
|
+
if (await columnExists(db, "_emdash_media_usage_sources", columnName)) {
|
|
173
|
+
await db.schema.alterTable("_emdash_media_usage_sources").dropColumn(columnName).execute();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
for (const columnName of [
|
|
178
|
+
"capture_state",
|
|
179
|
+
"last_incremental_success_at",
|
|
180
|
+
"reconciliation_required",
|
|
181
|
+
"change_epoch",
|
|
182
|
+
"collection_id",
|
|
183
|
+
] as const) {
|
|
184
|
+
if (await columnExists(db, "_emdash_media_usage_index_status", columnName)) {
|
|
185
|
+
await db.schema
|
|
186
|
+
.alterTable("_emdash_media_usage_index_status")
|
|
187
|
+
.dropColumn(columnName)
|
|
188
|
+
.execute();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async function addStatusColumns(db: Kysely<unknown>): Promise<void> {
|
|
194
|
+
await addColumnIfMissing(db, "_emdash_media_usage_index_status", "collection_id", () =>
|
|
195
|
+
db.schema
|
|
196
|
+
.alterTable("_emdash_media_usage_index_status")
|
|
197
|
+
.addColumn("collection_id", "text")
|
|
198
|
+
.execute(),
|
|
199
|
+
);
|
|
200
|
+
await addColumnIfMissing(db, "_emdash_media_usage_index_status", "change_epoch", () =>
|
|
201
|
+
db.schema
|
|
202
|
+
.alterTable("_emdash_media_usage_index_status")
|
|
203
|
+
.addColumn("change_epoch", "bigint", (column) => column.notNull().defaultTo(0))
|
|
204
|
+
.execute(),
|
|
205
|
+
);
|
|
206
|
+
await addColumnIfMissing(db, "_emdash_media_usage_index_status", "reconciliation_required", () =>
|
|
207
|
+
db.schema
|
|
208
|
+
.alterTable("_emdash_media_usage_index_status")
|
|
209
|
+
.addColumn("reconciliation_required", "integer", (column) => column.notNull().defaultTo(0))
|
|
210
|
+
.execute(),
|
|
211
|
+
);
|
|
212
|
+
await addStatusTextColumn(db, "last_incremental_success_at");
|
|
213
|
+
await addStatusTextColumn(db, "capture_state");
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async function assertRollbackIsEmptyAndInactive(db: Kysely<unknown>): Promise<void> {
|
|
217
|
+
if (await hasCaptureTriggers(db)) {
|
|
218
|
+
throw new Error("Cannot roll back media usage capture while capture triggers are installed");
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (await tableExists(db, "_emdash_media_usage_activation")) {
|
|
222
|
+
const activation = await sql<{ state: string }>`
|
|
223
|
+
SELECT state
|
|
224
|
+
FROM _emdash_media_usage_activation
|
|
225
|
+
WHERE task_key = ${ACTIVATION_KEY}
|
|
226
|
+
`.execute(db);
|
|
227
|
+
if (activation.rows[0] && activation.rows[0].state !== "expanded") {
|
|
228
|
+
throw new Error("Cannot roll back media usage capture after activation has started");
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (await tableExists(db, "_emdash_media_usage_work")) {
|
|
233
|
+
const work = await sql<{ present: number }>`
|
|
234
|
+
SELECT 1 AS present FROM _emdash_media_usage_work LIMIT 1
|
|
235
|
+
`.execute(db);
|
|
236
|
+
if (work.rows.length > 0) {
|
|
237
|
+
throw new Error("Cannot roll back media usage capture while durable work exists");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const sourceHasCollectionId = await columnExists(
|
|
242
|
+
db,
|
|
243
|
+
"_emdash_media_usage_sources",
|
|
244
|
+
"collection_id",
|
|
245
|
+
);
|
|
246
|
+
const sourceHasIdentityVersion = await columnExists(
|
|
247
|
+
db,
|
|
248
|
+
"_emdash_media_usage_sources",
|
|
249
|
+
"identity_version",
|
|
250
|
+
);
|
|
251
|
+
if (sourceHasCollectionId || sourceHasIdentityVersion) {
|
|
252
|
+
const canonicalSources = sourceHasCollectionId
|
|
253
|
+
? await sql<{ present: number }>`
|
|
254
|
+
SELECT 1 AS present
|
|
255
|
+
FROM _emdash_media_usage_sources
|
|
256
|
+
WHERE collection_id IS NOT NULL
|
|
257
|
+
LIMIT 1
|
|
258
|
+
`.execute(db)
|
|
259
|
+
: await sql<{ present: number }>`
|
|
260
|
+
SELECT 1 AS present
|
|
261
|
+
FROM _emdash_media_usage_sources
|
|
262
|
+
WHERE identity_version IS NOT NULL
|
|
263
|
+
LIMIT 1
|
|
264
|
+
`.execute(db);
|
|
265
|
+
if (canonicalSources.rows.length > 0) {
|
|
266
|
+
throw new Error("Cannot roll back media usage capture after canonical sources exist");
|
|
267
|
+
}
|
|
268
|
+
if (sourceHasCollectionId && sourceHasIdentityVersion) {
|
|
269
|
+
const versionedSources = await sql<{ present: number }>`
|
|
270
|
+
SELECT 1 AS present
|
|
271
|
+
FROM _emdash_media_usage_sources
|
|
272
|
+
WHERE identity_version IS NOT NULL
|
|
273
|
+
LIMIT 1
|
|
274
|
+
`.execute(db);
|
|
275
|
+
if (versionedSources.rows.length > 0) {
|
|
276
|
+
throw new Error("Cannot roll back media usage capture after canonical sources exist");
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (await columnExists(db, "_emdash_media_usage_index_status", "capture_state")) {
|
|
282
|
+
const lifecycle = await sql<{ present: number }>`
|
|
283
|
+
SELECT 1 AS present FROM _emdash_media_usage_index_status
|
|
284
|
+
WHERE capture_state IN ('active', 'deleting') LIMIT 1
|
|
285
|
+
`.execute(db);
|
|
286
|
+
if (lifecycle.rows.length > 0) throwRollbackLifecycleError();
|
|
287
|
+
}
|
|
288
|
+
if (await columnExists(db, "_emdash_media_usage_index_status", "change_epoch")) {
|
|
289
|
+
const epoch = await sql<{ present: number }>`
|
|
290
|
+
SELECT 1 AS present FROM _emdash_media_usage_index_status
|
|
291
|
+
WHERE change_epoch <> 0 LIMIT 1
|
|
292
|
+
`.execute(db);
|
|
293
|
+
if (epoch.rows.length > 0) throwRollbackLifecycleError();
|
|
294
|
+
}
|
|
295
|
+
if (await columnExists(db, "_emdash_media_usage_index_status", "last_incremental_success_at")) {
|
|
296
|
+
const success = await sql<{ present: number }>`
|
|
297
|
+
SELECT 1 AS present FROM _emdash_media_usage_index_status
|
|
298
|
+
WHERE last_incremental_success_at IS NOT NULL LIMIT 1
|
|
299
|
+
`.execute(db);
|
|
300
|
+
if (success.rows.length > 0) throwRollbackLifecycleError();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function throwRollbackLifecycleError(): never {
|
|
305
|
+
throw new Error("Cannot roll back media usage capture while capture lifecycle state exists");
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
async function hasCaptureTriggers(db: Kysely<unknown>): Promise<boolean> {
|
|
309
|
+
if (isPostgres(db)) {
|
|
310
|
+
const result = await sql<{ present: boolean }>`
|
|
311
|
+
SELECT EXISTS (
|
|
312
|
+
SELECT 1
|
|
313
|
+
FROM pg_trigger AS trigger
|
|
314
|
+
INNER JOIN pg_class AS relation ON relation.oid = trigger.tgrelid
|
|
315
|
+
INNER JOIN pg_namespace AS namespace ON namespace.oid = relation.relnamespace
|
|
316
|
+
WHERE namespace.nspname = current_schema()
|
|
317
|
+
AND NOT trigger.tgisinternal
|
|
318
|
+
AND left(trigger.tgname, 10) = 'emdash_mu_'
|
|
319
|
+
) AS present
|
|
320
|
+
`.execute(db);
|
|
321
|
+
return result.rows[0]?.present === true;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const result = await sql<{ present: number }>`
|
|
325
|
+
SELECT 1 AS present
|
|
326
|
+
FROM sqlite_master
|
|
327
|
+
WHERE type = 'trigger' AND substr(name, 1, 10) = 'emdash_mu_'
|
|
328
|
+
LIMIT 1
|
|
329
|
+
`.execute(db);
|
|
330
|
+
return result.rows.length > 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
async function addStatusTextColumn(db: Kysely<unknown>, columnName: string): Promise<void> {
|
|
334
|
+
await addColumnIfMissing(db, "_emdash_media_usage_index_status", columnName, () =>
|
|
335
|
+
db.schema
|
|
336
|
+
.alterTable("_emdash_media_usage_index_status")
|
|
337
|
+
.addColumn(columnName, "text")
|
|
338
|
+
.execute(),
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
async function addSourceColumns(db: Kysely<unknown>): Promise<void> {
|
|
343
|
+
await addColumnIfMissing(db, "_emdash_media_usage_sources", "collection_id", () =>
|
|
344
|
+
db.schema
|
|
345
|
+
.alterTable("_emdash_media_usage_sources")
|
|
346
|
+
.addColumn("collection_id", "text")
|
|
347
|
+
.execute(),
|
|
348
|
+
);
|
|
349
|
+
await addColumnIfMissing(db, "_emdash_media_usage_sources", "identity_version", () =>
|
|
350
|
+
db.schema
|
|
351
|
+
.alterTable("_emdash_media_usage_sources")
|
|
352
|
+
.addColumn("identity_version", "integer")
|
|
353
|
+
.execute(),
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
async function addColumnIfMissing(
|
|
358
|
+
db: Kysely<unknown>,
|
|
359
|
+
tableName: string,
|
|
360
|
+
columnName: string,
|
|
361
|
+
addColumn: () => Promise<void>,
|
|
362
|
+
): Promise<void> {
|
|
363
|
+
if (await columnExists(db, tableName, columnName)) return;
|
|
364
|
+
|
|
365
|
+
try {
|
|
366
|
+
await addColumn();
|
|
367
|
+
} catch (error) {
|
|
368
|
+
if (DUPLICATE_COLUMN_RE.test(deepErrorMessage(error))) {
|
|
369
|
+
if (await columnExists(db, tableName, columnName)) return;
|
|
370
|
+
}
|
|
371
|
+
throw error;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function sortableUtcTimestamp(db: Kysely<unknown>): RawBuilder<string> {
|
|
376
|
+
if (isPostgres(db)) {
|
|
377
|
+
return sql`to_char(clock_timestamp() AT TIME ZONE 'UTC', 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')`;
|
|
378
|
+
}
|
|
379
|
+
return sql`(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))`;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function deepErrorMessage(error: unknown): string {
|
|
383
|
+
if (error instanceof Error) {
|
|
384
|
+
const own = error.message ?? "";
|
|
385
|
+
if (error.cause) {
|
|
386
|
+
const causeMessage = deepErrorMessage(error.cause);
|
|
387
|
+
return own ? `${own}: ${causeMessage}` : causeMessage;
|
|
388
|
+
}
|
|
389
|
+
return own;
|
|
390
|
+
}
|
|
391
|
+
if (typeof error === "string") return error;
|
|
392
|
+
try {
|
|
393
|
+
return JSON.stringify(error);
|
|
394
|
+
} catch {
|
|
395
|
+
return String(error);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
import { isSqlite } from "../dialect-helpers.js";
|
|
5
|
+
import { validateIdentifier } from "../validate.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Migration: Rebuild FTS5 indexes as self-contained tables indexing
|
|
9
|
+
* extracted Portable Text prose
|
|
10
|
+
*
|
|
11
|
+
* Background: FTS tables were external-content (`content='ec_<slug>'`),
|
|
12
|
+
* which forces the index to mirror the raw column values — and Portable
|
|
13
|
+
* Text fields store JSON, so the index was polluted with structural tokens
|
|
14
|
+
* (`_type`, `span`, style values like `normal`, `_key` ULIDs). Searches for
|
|
15
|
+
* those tokens matched nearly every document and snippets showed JSON
|
|
16
|
+
* fragments.
|
|
17
|
+
*
|
|
18
|
+
* The fix rebuilds each search-enabled collection's FTS table as a
|
|
19
|
+
* self-contained FTS5 table (no `content=` option) whose Portable Text
|
|
20
|
+
* columns hold extracted prose — every JSON string under a `text`, `alt`,
|
|
21
|
+
* `caption`, or `code` key — with sync triggers computing the same
|
|
22
|
+
* extraction in SQL. The update trigger carries a WHEN guard so only real
|
|
23
|
+
* value changes re-tokenize; shipping the guard inside this rebuild spares
|
|
24
|
+
* existing sites a second full re-tokenization from a follow-up migration.
|
|
25
|
+
* Self-contained tables also retire the external-content
|
|
26
|
+
* `'delete'` choreography and its corruption modes (see migration 039).
|
|
27
|
+
* The rebuilt table keeps the collection's configured `tokenize` from
|
|
28
|
+
* search_config rather than resetting it to the default.
|
|
29
|
+
*
|
|
30
|
+
* The SQL emitted here MUST stay in lock-step with
|
|
31
|
+
* `FTSManager.createTriggers` / `createFtsTable` / `populateFromContent` in
|
|
32
|
+
* `src/search/fts-manager.ts`. If those change again, add a new migration
|
|
33
|
+
* rather than editing this one — migrations are forward-only.
|
|
34
|
+
*
|
|
35
|
+
* Postgres: no-op. FTS5 is SQLite-only.
|
|
36
|
+
*
|
|
37
|
+
* D1: idempotent at the granularity we care about (drop-then-create +
|
|
38
|
+
* repopulate with `INSERT OR REPLACE`, so concurrent migrators converge).
|
|
39
|
+
* A partial apply that drops the FTS table without recreating it is healed
|
|
40
|
+
* by the next `verifyAndRepairIndex` call at runtime.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
interface CollectionRow {
|
|
44
|
+
slug: string;
|
|
45
|
+
search_config: string | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface FieldRow {
|
|
49
|
+
slug: string;
|
|
50
|
+
type: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
54
|
+
if (!isSqlite(db)) return;
|
|
55
|
+
|
|
56
|
+
const collections = await sql<CollectionRow>`
|
|
57
|
+
SELECT slug, search_config FROM _emdash_collections
|
|
58
|
+
WHERE search_config IS NOT NULL
|
|
59
|
+
`.execute(db);
|
|
60
|
+
|
|
61
|
+
for (const collection of collections.rows) {
|
|
62
|
+
if (!isSearchEnabled(collection.search_config)) continue;
|
|
63
|
+
|
|
64
|
+
// Defensive re-validation before raw SQL interpolation, mirroring 039.
|
|
65
|
+
try {
|
|
66
|
+
validateIdentifier(collection.slug, "collection slug");
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.warn(
|
|
69
|
+
`[migration 064] skipping FTS rebuild for collection "${collection.slug}": ${
|
|
70
|
+
error instanceof Error ? error.message : String(error)
|
|
71
|
+
}`,
|
|
72
|
+
);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const fields = await getSearchableFields(db, collection.slug);
|
|
77
|
+
if (fields.length === 0) continue;
|
|
78
|
+
|
|
79
|
+
await rebuildIndex(db, collection.slug, fields, searchTokenizer(collection.search_config));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Forward-only. Down is a no-op: the FTS tables are managed by FTSManager
|
|
85
|
+
* at runtime and the self-contained shape remains fully functional for
|
|
86
|
+
* older code paths that only MATCH and join on id.
|
|
87
|
+
*/
|
|
88
|
+
export async function down(_db: Kysely<unknown>): Promise<void> {
|
|
89
|
+
// no-op
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function isSearchEnabled(searchConfig: string | null): boolean {
|
|
93
|
+
if (!searchConfig) return false;
|
|
94
|
+
try {
|
|
95
|
+
const parsed: unknown = JSON.parse(searchConfig);
|
|
96
|
+
return (
|
|
97
|
+
typeof parsed === "object" &&
|
|
98
|
+
parsed !== null &&
|
|
99
|
+
"enabled" in parsed &&
|
|
100
|
+
parsed.enabled === true
|
|
101
|
+
);
|
|
102
|
+
} catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Tokenizers this migration knows how to carry across the rebuild — a frozen
|
|
109
|
+
* copy of SEARCH_TOKENIZERS as of this migration, not an import: a replay
|
|
110
|
+
* after the live allowlist changes must not reinterpret configs this
|
|
111
|
+
* migration never shipped with.
|
|
112
|
+
*/
|
|
113
|
+
const KNOWN_TOKENIZERS = ["porter unicode61", "unicode61", "trigram"];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Tokenizer for the rebuilt table, from the collection's search_config.
|
|
117
|
+
* Values outside the allowlist (or unparsable config) fall back to the
|
|
118
|
+
* default rather than reaching the raw CREATE VIRTUAL TABLE statement.
|
|
119
|
+
*/
|
|
120
|
+
function searchTokenizer(searchConfig: string | null): string {
|
|
121
|
+
if (!searchConfig) return "porter unicode61";
|
|
122
|
+
try {
|
|
123
|
+
const parsed: unknown = JSON.parse(searchConfig);
|
|
124
|
+
if (typeof parsed === "object" && parsed !== null && "tokenize" in parsed) {
|
|
125
|
+
const configured = KNOWN_TOKENIZERS.find((tokenizer) => tokenizer === parsed.tokenize);
|
|
126
|
+
if (configured !== undefined) return configured;
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
return "porter unicode61";
|
|
130
|
+
}
|
|
131
|
+
return "porter unicode61";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function getSearchableFields(
|
|
135
|
+
db: Kysely<unknown>,
|
|
136
|
+
collectionSlug: string,
|
|
137
|
+
): Promise<FieldRow[]> {
|
|
138
|
+
const rows = await sql<FieldRow>`
|
|
139
|
+
SELECT f.slug, f.type FROM _emdash_fields f
|
|
140
|
+
INNER JOIN _emdash_collections c ON c.id = f.collection_id
|
|
141
|
+
WHERE c.slug = ${collectionSlug} AND f.searchable = 1
|
|
142
|
+
`.execute(db);
|
|
143
|
+
|
|
144
|
+
const out: FieldRow[] = [];
|
|
145
|
+
for (const row of rows.rows) {
|
|
146
|
+
try {
|
|
147
|
+
validateIdentifier(row.slug, "searchable field name");
|
|
148
|
+
out.push(row);
|
|
149
|
+
} catch {
|
|
150
|
+
console.warn(
|
|
151
|
+
`[migration 064] skipping invalid searchable field "${row.slug}" on collection "${collectionSlug}"`,
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Indexed-value expression for one field; lock-step with FTSManager.searchValueExpr. */
|
|
159
|
+
function searchValueExpr(ref: string, fieldType: string): string {
|
|
160
|
+
if (fieldType !== "portableText") return ref;
|
|
161
|
+
return (
|
|
162
|
+
`CASE WHEN ${ref} IS NULL THEN NULL ` +
|
|
163
|
+
`WHEN json_valid(${ref}) AND json_type(${ref}) IN ('array', 'object') THEN (` +
|
|
164
|
+
`SELECT group_concat(j.value, ' ') FROM json_tree(${ref}) AS j ` +
|
|
165
|
+
`WHERE j.key IN ('text', 'alt', 'caption', 'code') AND j.type = 'text') ` +
|
|
166
|
+
`ELSE ${ref} END`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
async function rebuildIndex(
|
|
171
|
+
db: Kysely<unknown>,
|
|
172
|
+
collectionSlug: string,
|
|
173
|
+
fields: FieldRow[],
|
|
174
|
+
tokenizer: string,
|
|
175
|
+
): Promise<void> {
|
|
176
|
+
const ftsTable = `_emdash_fts_${collectionSlug}`;
|
|
177
|
+
const contentTable = `ec_${collectionSlug}`;
|
|
178
|
+
const slugs = fields.map((f) => f.slug);
|
|
179
|
+
const columnList = ["id UNINDEXED", "locale UNINDEXED", ...slugs].join(", ");
|
|
180
|
+
const fieldList = slugs.join(", ");
|
|
181
|
+
const newValueList = fields.map((f) => searchValueExpr(`NEW.${f.slug}`, f.type)).join(", ");
|
|
182
|
+
// The WHEN guard compares raw column values (null-safe IS NOT) so the
|
|
183
|
+
// update trigger fires only when an indexed value, the row's locale, or
|
|
184
|
+
// its trash state actually changed; without it every UPDATE re-tokenizes
|
|
185
|
+
// the whole document. deleted_at must stay in the guard or trash and
|
|
186
|
+
// restore stop syncing the index.
|
|
187
|
+
const changedCondition = ["deleted_at", "locale", ...slugs]
|
|
188
|
+
.map((f) => `OLD.${f} IS NOT NEW.${f}`)
|
|
189
|
+
.join(" OR ");
|
|
190
|
+
// Table-qualified: a bare column reference inside the json_tree extraction
|
|
191
|
+
// subquery binds to json_tree's own key/value/type/... columns.
|
|
192
|
+
const selectValueList = fields
|
|
193
|
+
.map((f) => searchValueExpr(`"${contentTable}"."${f.slug}"`, f.type))
|
|
194
|
+
.join(", ");
|
|
195
|
+
|
|
196
|
+
await sql.raw(`DROP TRIGGER IF EXISTS "${ftsTable}_insert"`).execute(db);
|
|
197
|
+
await sql.raw(`DROP TRIGGER IF EXISTS "${ftsTable}_update"`).execute(db);
|
|
198
|
+
await sql.raw(`DROP TRIGGER IF EXISTS "${ftsTable}_delete"`).execute(db);
|
|
199
|
+
await sql.raw(`DROP TABLE IF EXISTS "${ftsTable}"`).execute(db);
|
|
200
|
+
|
|
201
|
+
await sql
|
|
202
|
+
.raw(`
|
|
203
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS "${ftsTable}" USING fts5(
|
|
204
|
+
${columnList},
|
|
205
|
+
tokenize='${tokenizer}'
|
|
206
|
+
)
|
|
207
|
+
`)
|
|
208
|
+
.execute(db);
|
|
209
|
+
|
|
210
|
+
await sql
|
|
211
|
+
.raw(`
|
|
212
|
+
CREATE TRIGGER IF NOT EXISTS "${ftsTable}_insert"
|
|
213
|
+
AFTER INSERT ON "${contentTable}"
|
|
214
|
+
WHEN NEW.deleted_at IS NULL
|
|
215
|
+
BEGIN
|
|
216
|
+
INSERT OR REPLACE INTO "${ftsTable}"(rowid, id, locale, ${fieldList})
|
|
217
|
+
VALUES (NEW.rowid, NEW.id, NEW.locale, ${newValueList});
|
|
218
|
+
END
|
|
219
|
+
`)
|
|
220
|
+
.execute(db);
|
|
221
|
+
|
|
222
|
+
await sql
|
|
223
|
+
.raw(`
|
|
224
|
+
CREATE TRIGGER IF NOT EXISTS "${ftsTable}_update"
|
|
225
|
+
AFTER UPDATE ON "${contentTable}"
|
|
226
|
+
WHEN ${changedCondition}
|
|
227
|
+
BEGIN
|
|
228
|
+
DELETE FROM "${ftsTable}" WHERE rowid = OLD.rowid;
|
|
229
|
+
INSERT INTO "${ftsTable}"(rowid, id, locale, ${fieldList})
|
|
230
|
+
SELECT NEW.rowid, NEW.id, NEW.locale, ${newValueList}
|
|
231
|
+
WHERE NEW.deleted_at IS NULL;
|
|
232
|
+
END
|
|
233
|
+
`)
|
|
234
|
+
.execute(db);
|
|
235
|
+
|
|
236
|
+
await sql
|
|
237
|
+
.raw(`
|
|
238
|
+
CREATE TRIGGER IF NOT EXISTS "${ftsTable}_delete"
|
|
239
|
+
AFTER DELETE ON "${contentTable}"
|
|
240
|
+
BEGIN
|
|
241
|
+
DELETE FROM "${ftsTable}" WHERE rowid = OLD.rowid;
|
|
242
|
+
END
|
|
243
|
+
`)
|
|
244
|
+
.execute(db);
|
|
245
|
+
|
|
246
|
+
await sql
|
|
247
|
+
.raw(`
|
|
248
|
+
INSERT OR REPLACE INTO "${ftsTable}"(rowid, id, locale, ${fieldList})
|
|
249
|
+
SELECT rowid, id, locale, ${selectValueList} FROM "${contentTable}"
|
|
250
|
+
WHERE deleted_at IS NULL
|
|
251
|
+
`)
|
|
252
|
+
.execute(db);
|
|
253
|
+
}
|