emdash 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapters-C0ONzkUP.d.mts → adapters-34EN2eXO.d.mts} +34 -2
- package/dist/adapters-34EN2eXO.d.mts.map +1 -0
- package/dist/after-CBU2vkoO.mjs +96 -0
- package/dist/after-CBU2vkoO.mjs.map +1 -0
- package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-DW7sYyqg.mjs} +2 -2
- package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-DW7sYyqg.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +26 -25
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +6 -5
- package/dist/{api-DgPbMlng.mjs → api-DdAsirBe.mjs} +321 -428
- package/dist/api-DdAsirBe.mjs.map +1 -0
- package/dist/{api-tokens-p-iMzvXR.mjs → api-tokens-CFXu8F_2.mjs} +2 -2
- package/dist/{api-tokens-p-iMzvXR.mjs.map → api-tokens-CFXu8F_2.mjs.map} +1 -1
- package/dist/{apply-1_6ra7NP.mjs → apply-D5zfeD09.mjs} +139 -102
- package/dist/apply-D5zfeD09.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +103 -35
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +9 -9
- package/dist/astro/middleware/media-usage-write-fence.d.mts +7 -0
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs +35 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +13 -10
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +5 -5
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -11
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +1915 -223
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +9 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +12 -11
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +20 -20
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +20 -20
- package/dist/astro/routes/api/admin/bylines/index.mjs +20 -20
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +18 -17
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/bulk.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/index.mjs +14 -13
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +36 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +15 -14
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +37 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +55 -46
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +56 -47
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +10 -9
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +9 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +8 -8
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +13 -12
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +14 -13
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +10 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +9 -8
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +15 -14
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +13 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +20 -19
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +17 -16
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +21 -20
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +21 -20
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +47 -34
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +10 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +12 -10
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +22 -20
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +18 -18
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +14 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +13 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -20
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +32 -31
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +6 -6
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +174 -72
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +14 -12
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +7 -7
- package/dist/astro/routes/api/media/_id_/usage.mjs +17 -16
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +16 -15
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +11 -10
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +19 -16
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/items.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_.mjs +13 -13
- package/dist/astro/routes/api/menus/index.mjs +13 -13
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +183 -6
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +8 -7
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +14 -13
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +14 -13
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +16 -14
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +16 -14
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +21 -20
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +16 -15
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +21 -20
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +14 -11
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.d.mts +1 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +19 -15
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +13 -13
- package/dist/astro/routes/api/search/rebuild.mjs +15 -15
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +9 -9
- package/dist/astro/routes/api/search/suggest.mjs +13 -13
- package/dist/astro/routes/api/sections/_slug_.mjs +13 -12
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +13 -12
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
- package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +18 -17
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +15 -14
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +34 -32
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +36 -34
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.mjs +10 -10
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +44 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +21 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +46 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs +88 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +19 -18
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -9
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +8 -7
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +13 -12
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +11 -10
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +14 -14
- package/dist/astro/routes/sitemap.xml.mjs +12 -11
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +41 -17
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-R5iYYrpa.mjs → authorize-1iFJzPaZ.mjs} +2 -2
- package/dist/{authorize-R5iYYrpa.mjs.map → authorize-1iFJzPaZ.mjs.map} +1 -1
- package/dist/{backup-LpQ1V_sR.mjs → backup-LHjIAVNP.mjs} +5 -5
- package/dist/{backup-LpQ1V_sR.mjs.map → backup-LHjIAVNP.mjs.map} +1 -1
- package/dist/{base64-B-PsqheR.mjs → base64-CvLhUKQv.mjs} +1 -1
- package/dist/{base64-B-PsqheR.mjs.map → base64-CvLhUKQv.mjs.map} +1 -1
- package/dist/bundle-CBEXrBnb.mjs +663 -0
- package/dist/bundle-CBEXrBnb.mjs.map +1 -0
- package/dist/{byline-fields-T9ZLZMxJ.mjs → byline-fields-C5S8wygO.mjs} +2 -2
- package/dist/{byline-fields-T9ZLZMxJ.mjs.map → byline-fields-C5S8wygO.mjs.map} +1 -1
- package/dist/{byline-C5TAqs8N.mjs → byline-pEcoDps8.mjs} +9 -9
- package/dist/{byline-C5TAqs8N.mjs.map → byline-pEcoDps8.mjs.map} +1 -1
- package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-DDun8sxh.mjs} +4 -4
- package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-DDun8sxh.mjs.map} +1 -1
- package/dist/{bylines-B8-WGdja.mjs → bylines-BWemdX2k.mjs} +8 -8
- package/dist/{bylines-B8-WGdja.mjs.map → bylines-BWemdX2k.mjs.map} +1 -1
- package/dist/{bylines-DGuqBLjV.mjs → bylines-DJfSfXCL.mjs} +5 -5
- package/dist/{bylines-DGuqBLjV.mjs.map → bylines-DJfSfXCL.mjs.map} +1 -1
- package/dist/cache-CBJaDy_E.mjs +108 -0
- package/dist/cache-CBJaDy_E.mjs.map +1 -0
- package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-CZyFVaad.mjs} +1 -1
- package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-CZyFVaad.mjs.map} +1 -1
- package/dist/{chunks-D5dlPeRb.mjs → chunks-DfPax1I0.mjs} +2 -2
- package/dist/{chunks-D5dlPeRb.mjs.map → chunks-DfPax1I0.mjs.map} +1 -1
- package/dist/cli/index.mjs +193 -707
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +74 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +25 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-C8BugSGz.mjs +779 -0
- package/dist/collection-deletion-C8BugSGz.mjs.map +1 -0
- package/dist/{comment-DnTxxVHv.mjs → comment-Dxlep6cE.mjs} +3 -3
- package/dist/{comment-DnTxxVHv.mjs.map → comment-Dxlep6cE.mjs.map} +1 -1
- package/dist/{comment-reaction-BUlUz2bh.mjs → comment-reaction-D6qfHKBc.mjs} +2 -2
- package/dist/{comment-reaction-BUlUz2bh.mjs.map → comment-reaction-D6qfHKBc.mjs.map} +1 -1
- package/dist/{comments-QPKgK3nk.mjs → comments-CTOuhTSX.mjs} +3 -3
- package/dist/{comments-QPKgK3nk.mjs.map → comments-CTOuhTSX.mjs.map} +1 -1
- package/dist/{components-DZkL4Fx0.mjs → components-CQy3lh9x.mjs} +1 -1
- package/dist/{components-DZkL4Fx0.mjs.map → components-CQy3lh9x.mjs.map} +1 -1
- package/dist/{config-DyF3OKg_.mjs → config-C3EBstHi.mjs} +18 -2
- package/dist/config-C3EBstHi.mjs.map +1 -0
- package/dist/{content-CpfKV9QE.mjs → content-BNfwh7xX.mjs} +667 -183
- package/dist/content-BNfwh7xX.mjs.map +1 -0
- package/dist/content-list-query-DhQ84eVV.d.mts +26 -0
- package/dist/content-list-query-DhQ84eVV.d.mts.map +1 -0
- package/dist/content-refresh-DNERP4-f.mjs +2560 -0
- package/dist/content-refresh-DNERP4-f.mjs.map +1 -0
- package/dist/{context-kO4YZB03.mjs → context-DRgOvSnW.mjs} +28 -20
- package/dist/context-DRgOvSnW.mjs.map +1 -0
- package/dist/{cron-BlKIMD_e.mjs → cron-Y9aLtgrA.mjs} +1 -1
- package/dist/{cron-BlKIMD_e.mjs.map → cron-Y9aLtgrA.mjs.map} +1 -1
- package/dist/{dashboard-DoBwPnON.mjs → dashboard-CB8J89rJ.mjs} +45 -11
- package/dist/dashboard-CB8J89rJ.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +3 -3
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{db-errors-CcWLaRiR.mjs → db-errors-Cl-sKYTm.mjs} +1 -1
- package/dist/{db-errors-CcWLaRiR.mjs.map → db-errors-Cl-sKYTm.mjs.map} +1 -1
- package/dist/{default-C4v9KP56.mjs → default-DdDl3fxv.mjs} +1 -1
- package/dist/{default-C4v9KP56.mjs.map → default-DdDl3fxv.mjs.map} +1 -1
- package/dist/deferred-tasks-BMsa9F64.d.mts +9 -0
- package/dist/deferred-tasks-BMsa9F64.d.mts.map +1 -0
- package/dist/{device-flow-DhUsyJU6.mjs → device-flow-CaioYGK3.mjs} +5 -5
- package/dist/{device-flow-DhUsyJU6.mjs.map → device-flow-CaioYGK3.mjs.map} +1 -1
- package/dist/{dialect-helpers-DFwyWjTM.mjs → dialect-helpers-BSbfaO3F.mjs} +24 -16
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
- package/dist/dist-D_6CKR8z.mjs +810 -0
- package/dist/dist-D_6CKR8z.mjs.map +1 -0
- package/dist/{email-console-C-9Ng8DM.mjs → email-console-BHNjIwiB.mjs} +1 -1
- package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-BHNjIwiB.mjs.map} +1 -1
- package/dist/{enrich-CFJJgxs_.mjs → enrich-_ySMEvEE.mjs} +2 -2
- package/dist/{enrich-CFJJgxs_.mjs.map → enrich-_ySMEvEE.mjs.map} +1 -1
- package/dist/{error-DmmN74gW.mjs → error-DupyJZE2.mjs} +3 -3
- package/dist/{error-DmmN74gW.mjs.map → error-DupyJZE2.mjs.map} +1 -1
- package/dist/{errors-DtEXIQQV.mjs → errors-CLUPm7aD.mjs} +15 -2
- package/dist/errors-CLUPm7aD.mjs.map +1 -0
- package/dist/{escape-CdW31WsG.mjs → escape-C_aLKP3H.mjs} +1 -1
- package/dist/{escape-CdW31WsG.mjs.map → escape-C_aLKP3H.mjs.map} +1 -1
- package/dist/{field-defs-cache-QMVnzTH6.mjs → field-defs-cache-hg6QkjV9.mjs} +5 -5
- package/dist/{field-defs-cache-QMVnzTH6.mjs.map → field-defs-cache-hg6QkjV9.mjs.map} +1 -1
- package/dist/{fts-manager-vncsZIJm.mjs → fts-manager-CZ-5dVwJ.mjs} +111 -61
- package/dist/fts-manager-CZ-5dVwJ.mjs.map +1 -0
- package/dist/{hash-Cb7U1b5M.mjs → hash-Cg0TXJPV.mjs} +1 -1
- package/dist/{hash-Cb7U1b5M.mjs.map → hash-Cg0TXJPV.mjs.map} +1 -1
- package/dist/{hreflang-CZbSx6Bg.d.mts → hreflang-D3Uehfv2.d.mts} +2 -2
- package/dist/{hreflang-CZbSx6Bg.d.mts.map → hreflang-D3Uehfv2.d.mts.map} +1 -1
- package/dist/{hreflang-Bg-zMpkr.mjs → hreflang-DNswoYsi.mjs} +7 -7
- package/dist/{hreflang-Bg-zMpkr.mjs.map → hreflang-DNswoYsi.mjs.map} +1 -1
- package/dist/{import-PKhLeXvn.mjs → import-B41u8Rot.mjs} +7 -7
- package/dist/{import-PKhLeXvn.mjs.map → import-B41u8Rot.mjs.map} +1 -1
- package/dist/{index-j9rTh3cp.d.mts → index-C3Y-rsyN.d.mts} +286 -93
- package/dist/index-C3Y-rsyN.d.mts.map +1 -0
- package/dist/{index-BeNto_Vs.d.mts → index-Cof4-Fab.d.mts} +5 -10
- package/dist/index-Cof4-Fab.d.mts.map +1 -0
- package/dist/index.d.mts +20 -19
- package/dist/index.mjs +79 -71
- package/dist/{init-lock-DJkX6Hto.mjs → init-lock-6b309ZrF.mjs} +1 -1
- package/dist/{init-lock-DJkX6Hto.mjs.map → init-lock-6b309ZrF.mjs.map} +1 -1
- package/dist/{load-BwTdWE8B.mjs → load-DmvJrtxS.mjs} +2 -2
- package/dist/{load-BwTdWE8B.mjs.map → load-DmvJrtxS.mjs.map} +1 -1
- package/dist/{loader-C1XOLV5b.mjs → loader-DLBqRiGP.mjs} +120 -64
- package/dist/loader-DLBqRiGP.mjs.map +1 -0
- package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-BXbUAHod.mjs} +1 -1
- package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-BXbUAHod.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +3 -2
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +10 -9
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-DWIzoVFL.mjs → media-BWWWb8kg.mjs} +92 -3
- package/dist/media-BWWWb8kg.mjs.map +1 -0
- package/dist/{media-tQDZEdu7.mjs → media-CzhAn2--.mjs} +2 -2
- package/dist/{media-tQDZEdu7.mjs.map → media-CzhAn2--.mjs.map} +1 -1
- package/dist/{media-allowlist-B7TPD6aq.mjs → media-allowlist-BD6HhgXA.mjs} +14 -3
- package/dist/media-allowlist-BD6HhgXA.mjs.map +1 -0
- package/dist/{media-upload-Bc9Nc5Zf.mjs → media-upload-9yas9zGH.mjs} +11 -9
- package/dist/{media-upload-Bc9Nc5Zf.mjs.map → media-upload-9yas9zGH.mjs.map} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs → media-url-BvoX88FA.mjs} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs.map → media-url-BvoX88FA.mjs.map} +1 -1
- package/dist/{media-usage-DPJcNaAq.mjs → media-usage-De3qvwjc.mjs} +138 -61
- package/dist/media-usage-De3qvwjc.mjs.map +1 -0
- package/dist/media-usage-work-B9Bksh_b.mjs +152 -0
- package/dist/media-usage-work-B9Bksh_b.mjs.map +1 -0
- package/dist/media-usage-work-DrCbqBcl.mjs +424 -0
- package/dist/media-usage-work-DrCbqBcl.mjs.map +1 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs +42 -0
- package/dist/media-usage-write-fence-aHEgN1zB.mjs.map +1 -0
- package/dist/{menus-C6qhqP4X.mjs → menus-CC-yn1F9.mjs} +554 -121
- package/dist/menus-CC-yn1F9.mjs.map +1 -0
- package/dist/{menus-BxPLFfIc.mjs → menus-fxvEDYE6.mjs} +5 -5
- package/dist/{menus-BxPLFfIc.mjs.map → menus-fxvEDYE6.mjs.map} +1 -1
- package/dist/{mode-fiXRMfeA.mjs → mode-Bpe-tNNy.mjs} +1 -1
- package/dist/{mode-fiXRMfeA.mjs.map → mode-Bpe-tNNy.mjs.map} +1 -1
- package/dist/{normalize-C-SHXmra.mjs → normalize-Bc-s_r-a.mjs} +1 -1
- package/dist/{normalize-C-SHXmra.mjs.map → normalize-Bc-s_r-a.mjs.map} +1 -1
- package/dist/{oauth-authorization-C9tFinly.mjs → oauth-authorization-BXO1MKej.mjs} +5 -5
- package/dist/{oauth-authorization-C9tFinly.mjs.map → oauth-authorization-BXO1MKej.mjs.map} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs → oauth-clients-C_DNqtRu.mjs} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs.map → oauth-clients-C_DNqtRu.mjs.map} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs → oauth-state-store-DwAxMtk4.mjs} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs.map → oauth-state-store-DwAxMtk4.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs → oauth-user-lookup-BxfZizdk.mjs} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs.map → oauth-user-lookup-BxfZizdk.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
- package/dist/object-cache-71tPfV4A.mjs.map +1 -0
- package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
- package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
- package/dist/{options-aeIs8WFu.d.mts → options-DRe1pIBL.d.mts} +4 -3
- package/dist/options-DRe1pIBL.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BL49yb9D.mjs → parse-DFbuc-Fh.mjs} +2 -2
- package/dist/{parse-BL49yb9D.mjs.map → parse-DFbuc-Fh.mjs.map} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs → passkey-config-_2GOwwK8.mjs} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs.map → passkey-config-_2GOwwK8.mjs.map} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts → placeholder-CzW7Lshs.d.mts} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts.map → placeholder-CzW7Lshs.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +8 -1
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +7 -4
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/{portable-text-CNahFfj6.mjs → portable-text-DhKbDAGr.mjs} +1 -1
- package/dist/{portable-text-CNahFfj6.mjs.map → portable-text-DhKbDAGr.mjs.map} +1 -1
- package/dist/{preview-D4Jnbfx7.mjs → preview-PW-nOnq4.mjs} +2 -2
- package/dist/{preview-D4Jnbfx7.mjs.map → preview-PW-nOnq4.mjs.map} +1 -1
- package/dist/{public-url-DSGTnJFw.mjs → public-url-CWoFhQT8.mjs} +14 -3
- package/dist/public-url-CWoFhQT8.mjs.map +1 -0
- package/dist/{query-DCiXI7OZ.mjs → query-BgjfiLUQ.mjs} +38 -77
- package/dist/query-BgjfiLUQ.mjs.map +1 -0
- package/dist/{query-1xOcEy18.mjs → query-vgZNwIhh.mjs} +4 -4
- package/dist/{query-1xOcEy18.mjs.map → query-vgZNwIhh.mjs.map} +1 -1
- package/dist/{rate-limit-Vkp9gQ1Y.mjs → rate-limit-L5anykgo.mjs} +2 -2
- package/dist/{rate-limit-Vkp9gQ1Y.mjs.map → rate-limit-L5anykgo.mjs.map} +1 -1
- package/dist/{redirect-BJ6d1yHh.mjs → redirect-COsS6SWJ.mjs} +3 -3
- package/dist/{redirect-BJ6d1yHh.mjs.map → redirect-COsS6SWJ.mjs.map} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs → redirect-KBNE3UEs.mjs} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs.map → redirect-KBNE3UEs.mjs.map} +1 -1
- package/dist/{redirects-Cwkq2H-G.mjs → redirects-CufRQt0Q.mjs} +5 -5
- package/dist/{redirects-Cwkq2H-G.mjs.map → redirects-CufRQt0Q.mjs.map} +1 -1
- package/dist/{redirects-BOn2DIUs.mjs → redirects-cV9g7V-0.mjs} +149 -16
- package/dist/redirects-cV9g7V-0.mjs.map +1 -0
- package/dist/registry-C581V4TP.mjs +1275 -0
- package/dist/registry-C581V4TP.mjs.map +1 -0
- package/dist/{relation-DJ5DZh7B.mjs → relation-DtmAQH7s.mjs} +3 -3
- package/dist/{relation-DJ5DZh7B.mjs.map → relation-DtmAQH7s.mjs.map} +1 -1
- package/dist/{relations-C4duJnwI.mjs → relations-BBApI4e2.mjs} +3 -3
- package/dist/{relations-C4duJnwI.mjs.map → relations-BBApI4e2.mjs.map} +1 -1
- package/dist/{relations-DpTjftCl.mjs → relations-DICSyfsh.mjs} +6 -6
- package/dist/{relations-DpTjftCl.mjs.map → relations-DICSyfsh.mjs.map} +1 -1
- package/dist/{relations-DHFQGX0h.d.mts → relations-DItI3MN9.d.mts} +401 -40
- package/dist/relations-DItI3MN9.d.mts.map +1 -0
- package/dist/request-context.d.mts +3 -0
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{request-meta-DzXYYI-n.mjs → request-meta-DgZJh3zG.mjs} +2 -2
- package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-DgZJh3zG.mjs.map} +1 -1
- package/dist/{resolve-BUvFE0Lr.mjs → resolve-DOhVEvty.mjs} +2 -2
- package/dist/{resolve-BUvFE0Lr.mjs.map → resolve-DOhVEvty.mjs.map} +1 -1
- package/dist/{runner-BsI18UgP.mjs → runner-BiDvq5dv.mjs} +1404 -235
- package/dist/runner-BiDvq5dv.mjs.map +1 -0
- package/dist/{runner-CHdkERbt.d.mts → runner-CgQbELYC.d.mts} +2 -2
- package/dist/{runner-CHdkERbt.d.mts.map → runner-CgQbELYC.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +5 -4
- package/dist/runtime.mjs.map +1 -1
- package/dist/{schema-eqZhkR0S.mjs → schema-BFyTg38T.mjs} +3 -3
- package/dist/{schema-eqZhkR0S.mjs.map → schema-BFyTg38T.mjs.map} +1 -1
- package/dist/schema-CeQSNwB3.mjs +390 -0
- package/dist/schema-CeQSNwB3.mjs.map +1 -0
- package/dist/{scopes-Be2d8bSb.mjs → scopes-BVeuhGBE.mjs} +3 -3
- package/dist/{scopes-Be2d8bSb.mjs.map → scopes-BVeuhGBE.mjs.map} +1 -1
- package/dist/{search-CeO678cp.mjs → search-BpuPKZb0.mjs} +26 -16
- package/dist/search-BpuPKZb0.mjs.map +1 -0
- package/dist/{secrets-870d-7yA.mjs → secrets-dtYs2hDo.mjs} +5 -5
- package/dist/{secrets-870d-7yA.mjs.map → secrets-dtYs2hDo.mjs.map} +1 -1
- package/dist/{sections-DSuEfirn.mjs → sections-COctk6hf.mjs} +3 -3
- package/dist/{sections-DSuEfirn.mjs.map → sections-COctk6hf.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +28 -26
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +20 -19
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-C3GDfT0V.mjs → seo-AFpVvTqr.mjs} +6 -4
- package/dist/seo-AFpVvTqr.mjs.map +1 -0
- package/dist/{seo-BAPKiED8.mjs → seo-CvDxfvFb.mjs} +3 -3
- package/dist/{seo-BAPKiED8.mjs.map → seo-CvDxfvFb.mjs.map} +1 -1
- package/dist/{service-DyFT-k-R.mjs → service-xMiMSTsR.mjs} +4 -4
- package/dist/{service-DyFT-k-R.mjs.map → service-xMiMSTsR.mjs.map} +1 -1
- package/dist/{session-user-BrK2zz7S.mjs → session-user-BzVemLkw.mjs} +2 -2
- package/dist/{session-user-BrK2zz7S.mjs.map → session-user-BzVemLkw.mjs.map} +1 -1
- package/dist/{settings-DgKouY2S.mjs → settings-B372MV0p.mjs} +7 -7
- package/dist/{settings-DgKouY2S.mjs.map → settings-B372MV0p.mjs.map} +1 -1
- package/dist/{settings-CREKyj8I.mjs → settings-BE9aqn_9.mjs} +3 -3
- package/dist/{settings-CREKyj8I.mjs.map → settings-BE9aqn_9.mjs.map} +1 -1
- package/dist/{setup-complete-L7bMK2VI.mjs → setup-complete-DF7TAfD5.mjs} +2 -2
- package/dist/{setup-complete-L7bMK2VI.mjs.map → setup-complete-DF7TAfD5.mjs.map} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs → setup-nonce-Do-U_cg9.mjs} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs.map → setup-nonce-Do-U_cg9.mjs.map} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-B0eLKS6K.mjs} +2 -2
- package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-B0eLKS6K.mjs.map} +1 -1
- package/dist/site-url-Bowsi9T-.mjs +16 -0
- package/dist/site-url-Bowsi9T-.mjs.map +1 -0
- package/dist/slugify-B994zkXC.mjs +17 -0
- package/dist/slugify-B994zkXC.mjs.map +1 -0
- package/dist/{snapshot-BdpUJKD-.mjs → snapshot-B5h6aPMh.mjs} +2 -2
- package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-B5h6aPMh.mjs.map} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs → ssrf-Cpvg_n3A.mjs} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-Cpvg_n3A.mjs.map} +1 -1
- package/dist/{state-xxv6ZTMv.mjs → state-DYwPue40.mjs} +1 -1
- package/dist/{state-xxv6ZTMv.mjs.map → state-DYwPue40.mjs.map} +1 -1
- package/dist/{status-COfycGIU.mjs → status-CWVYpbD8.mjs} +1 -1
- package/dist/{status-COfycGIU.mjs.map → status-CWVYpbD8.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-B61CRSha.mjs → taxonomies-B0o9ExNV.mjs} +85 -75
- package/dist/taxonomies-B0o9ExNV.mjs.map +1 -0
- package/dist/{taxonomies-Dbdki3Un.mjs → taxonomies-Dk3MAklL.mjs} +360 -56
- package/dist/taxonomies-Dk3MAklL.mjs.map +1 -0
- package/dist/taxonomy-CPeM8d2o.mjs +484 -0
- package/dist/taxonomy-CPeM8d2o.mjs.map +1 -0
- package/dist/{tokens-DVltpO2D.mjs → tokens-C39klX8R.mjs} +2 -2
- package/dist/{tokens-DVltpO2D.mjs.map → tokens-C39klX8R.mjs.map} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
- package/dist/{transport-BWQo0Foy.mjs → transport--CfOflrp.mjs} +1 -1
- package/dist/{transport-BWQo0Foy.mjs.map → transport--CfOflrp.mjs.map} +1 -1
- package/dist/{transport-DokJOScS.d.mts → transport-B_rfeU-a.d.mts} +1 -1
- package/dist/{transport-DokJOScS.d.mts.map → transport-B_rfeU-a.d.mts.map} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-CEVekpby.mjs} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-CEVekpby.mjs.map} +1 -1
- package/dist/{types-o7xo7VgH.mjs → types-75KIqzL9.mjs} +20 -3
- package/dist/types-75KIqzL9.mjs.map +1 -0
- package/dist/{types-C9P3ysxq.d.mts → types-BPuloofb.d.mts} +1 -1
- package/dist/{types-C9P3ysxq.d.mts.map → types-BPuloofb.d.mts.map} +1 -1
- package/dist/{types-BD40g7zz.mjs → types-BW1syrlw.mjs} +1 -1
- package/dist/{types-BD40g7zz.mjs.map → types-BW1syrlw.mjs.map} +1 -1
- package/dist/{types-jISEalTX.d.mts → types-C3_AbkDP.d.mts} +53 -10
- package/dist/types-C3_AbkDP.d.mts.map +1 -0
- package/dist/{types-84Bque3-.d.mts → types-CAGdePf3.d.mts} +133 -1
- package/dist/types-CAGdePf3.d.mts.map +1 -0
- package/dist/{types-CcSZCcF1.d.mts → types-CFUfyt1s.d.mts} +1 -1
- package/dist/{types-CcSZCcF1.d.mts.map → types-CFUfyt1s.d.mts.map} +1 -1
- package/dist/{types-DQLZ58GV.d.mts → types-CPx2lIGo.d.mts} +1 -1
- package/dist/{types-DQLZ58GV.d.mts.map → types-CPx2lIGo.d.mts.map} +1 -1
- package/dist/{types-XrQQ-Aex.mjs → types-CQPWhPxE.mjs} +15 -11
- package/dist/types-CQPWhPxE.mjs.map +1 -0
- package/dist/{types-BQY7VYw6.d.mts → types-Cs-TFLNf.d.mts} +28 -8
- package/dist/types-Cs-TFLNf.d.mts.map +1 -0
- package/dist/types-CtzytVXn.mjs +18 -0
- package/dist/types-CtzytVXn.mjs.map +1 -0
- package/dist/{types-DqZVPILm.d.mts → types-D4_1Ga4L.d.mts} +44 -5
- package/dist/types-D4_1Ga4L.d.mts.map +1 -0
- package/dist/{types-Dr2GLlwu.d.mts → types-DefV3OiO.d.mts} +1 -1
- package/dist/{types-Dr2GLlwu.d.mts.map → types-DefV3OiO.d.mts.map} +1 -1
- package/dist/{types-DsAMyD_o.d.mts → types-X0MThr7x.d.mts} +1 -1
- package/dist/{types-DsAMyD_o.d.mts.map → types-X0MThr7x.d.mts.map} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.mjs → upload-attempts-hlne3iA1.mjs} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.mjs.map → upload-attempts-hlne3iA1.mjs.map} +1 -1
- package/dist/url-pattern-BHS0V5Ng.mjs +33 -0
- package/dist/url-pattern-BHS0V5Ng.mjs.map +1 -0
- package/dist/{user-BAumEmpA.mjs → user-sHgJ62SP.mjs} +3 -3
- package/dist/{user-BAumEmpA.mjs.map → user-sHgJ62SP.mjs.map} +1 -1
- package/dist/{utils-BbUgmeZG.mjs → utils-D4vD_Y98.mjs} +3 -3
- package/dist/{utils-BbUgmeZG.mjs.map → utils-D4vD_Y98.mjs.map} +1 -1
- package/dist/{validate-Bs_wT2ul.mjs → validate-BkqIG_Uj.mjs} +24 -5
- package/dist/validate-BkqIG_Uj.mjs.map +1 -0
- package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
- package/dist/validate-BpwoDOgt.mjs.map +1 -0
- package/dist/{validate-CdYcY-Ln.d.mts → validate-DeGtBN84.d.mts} +25 -7
- package/dist/validate-DeGtBN84.d.mts.map +1 -0
- package/dist/{validation-BngR0nit.mjs → validation-CiJb_X5o.mjs} +14 -13
- package/dist/{validation-BngR0nit.mjs.map → validation-CiJb_X5o.mjs.map} +1 -1
- package/dist/version-x0NjTScG.mjs +7 -0
- package/dist/{version-Bdfb34kk.mjs.map → version-x0NjTScG.mjs.map} +1 -1
- package/dist/{widgets-L-VndTKD.mjs → widgets-Cwzvww0W.mjs} +3 -3
- package/dist/{widgets-L-VndTKD.mjs.map → widgets-Cwzvww0W.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts → wxr-taxonomies-CmC0ZsDr.d.mts} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts.map → wxr-taxonomies-CmC0ZsDr.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-BexjtNid.mjs → wxr-taxonomies-QZjWxjyk.mjs} +13 -32
- package/dist/{wxr-taxonomies-BexjtNid.mjs.map → wxr-taxonomies-QZjWxjyk.mjs.map} +1 -1
- package/dist/{zod-generator-DMzfga3g.mjs → zod-generator-D11MhxG4.mjs} +53 -6
- package/dist/zod-generator-D11MhxG4.mjs.map +1 -0
- package/package.json +18 -7
- package/src/after.ts +6 -1
- package/src/api/errors.ts +13 -0
- package/src/api/handlers/content.ts +172 -33
- package/src/api/handlers/dashboard.ts +12 -2
- package/src/api/handlers/index.ts +16 -0
- package/src/api/handlers/manifest.ts +2 -0
- package/src/api/handlers/marketplace.ts +14 -0
- package/src/api/handlers/media-allowlist.ts +13 -2
- package/src/api/handlers/media-usage-work.ts +188 -0
- package/src/api/handlers/media-usage.ts +5 -3
- package/src/api/handlers/registry.ts +14 -0
- package/src/api/handlers/revision.ts +19 -5
- package/src/api/handlers/schema.ts +46 -3
- package/src/api/handlers/seo.ts +5 -2
- package/src/api/handlers/snapshot.ts +1 -1
- package/src/api/handlers/taxonomies.ts +446 -83
- package/src/api/media-usage-write-fence.ts +64 -0
- package/src/api/openapi/document.ts +247 -0
- package/src/api/public-url.ts +14 -2
- package/src/api/schemas/common.ts +3 -1
- package/src/api/schemas/content.ts +122 -1
- package/src/api/schemas/media-usage.ts +133 -0
- package/src/api/schemas/schema.ts +91 -3
- package/src/api/schemas/search.ts +2 -0
- package/src/api/schemas/taxonomies.ts +58 -8
- package/src/api/site-url.ts +16 -6
- package/src/api/types.ts +1 -0
- package/src/astro/integration/index.ts +55 -42
- package/src/astro/integration/routes.ts +48 -4
- package/src/astro/integration/runtime.ts +28 -0
- package/src/astro/integration/virtual-modules.ts +27 -1
- package/src/astro/integration/vite-config.ts +16 -1
- package/src/astro/middleware/media-usage-write-fence.ts +30 -0
- package/src/astro/middleware/redirect.ts +14 -12
- package/src/astro/middleware/scoped-db.ts +35 -4
- package/src/astro/middleware.ts +131 -30
- package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
- package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
- package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
- package/src/astro/routes/api/auth/invite/index.ts +2 -2
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +67 -31
- package/src/astro/routes/api/import/wordpress/execute.ts +3 -10
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +7 -1
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +1 -7
- package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +2 -0
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +1 -0
- package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
- package/src/astro/routes/api/taxonomies/[name].ts +102 -0
- package/src/astro/types.ts +31 -4
- package/src/cleanup.ts +25 -26
- package/src/cli/commands/dev.ts +13 -3
- package/src/cli/commands/doctor.ts +193 -6
- package/src/cli/commands/export-seed.ts +6 -1
- package/src/cli/index.ts +1 -1
- package/src/client/index.ts +119 -0
- package/src/components/Block.astro +12 -0
- package/src/components/CommentForm.astro +1 -1
- package/src/components/Comments.astro +1 -1
- package/src/components/InlinePortableTextEditor.tsx +260 -32
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +26 -4
- package/src/components/index.ts +12 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/content/converters/mark-safety.ts +120 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +84 -25
- package/src/content/converters/prosemirror-to-portable-text.ts +35 -14
- package/src/content/converters/types.ts +2 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/content-list-query.ts +29 -0
- package/src/database/dialect-helpers.ts +3 -22
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -0
- package/src/database/migrations/060_collection_admin_config.ts +16 -0
- package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
- package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
- package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
- package/src/database/migrations/064_fts_plain_text.ts +253 -0
- package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
- package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
- package/src/database/migrations/067_indexed_content_fields.ts +39 -0
- package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
- package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
- package/src/database/migrations/070_collection_routable.ts +18 -0
- package/src/database/migrations/runner.ts +32 -0
- package/src/database/repositories/content.ts +1051 -273
- package/src/database/repositories/media-usage-work.ts +848 -0
- package/src/database/repositories/media-usage.ts +1502 -138
- package/src/database/repositories/revision.ts +98 -22
- package/src/database/repositories/taxonomy.ts +429 -103
- package/src/database/repositories/types.ts +58 -2
- package/src/database/types.ts +147 -17
- package/src/database/validate.ts +39 -0
- package/src/db/adapters.ts +36 -0
- package/src/db/index.ts +3 -0
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +493 -110
- package/src/fields/file.ts +7 -4
- package/src/fields/image.ts +8 -1
- package/src/fields/types.ts +18 -5
- package/src/i18n/config.ts +32 -0
- package/src/i18n/repair-locale-casing.ts +0 -14
- package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
- package/src/import/wxr-taxonomies.ts +7 -47
- package/src/index.ts +27 -2
- package/src/loader.ts +165 -89
- package/src/mcp/server.ts +242 -34
- package/src/media/usage/activation.ts +626 -0
- package/src/media/usage/capture-triggers.ts +543 -0
- package/src/media/usage/cleanup.ts +305 -0
- package/src/media/usage/collection-deletion-processor.ts +356 -0
- package/src/media/usage/collection-deletion.ts +836 -0
- package/src/media/usage/content-fields.ts +40 -3
- package/src/media/usage/content-refresh.ts +356 -47
- package/src/media/usage/content-repair.ts +180 -61
- package/src/media/usage/content-snapshots.ts +85 -105
- package/src/media/usage/gc.ts +50 -0
- package/src/media/usage/projection-fingerprint.ts +129 -0
- package/src/media/usage/reconciliation-processor.ts +372 -0
- package/src/media/usage/reconciliation.ts +1117 -0
- package/src/media/usage/source-key.ts +4 -0
- package/src/media/usage/types.ts +2 -0
- package/src/media/usage/work-processor.ts +248 -0
- package/src/menus/index.ts +246 -141
- package/src/object-cache/index.ts +160 -3
- package/src/plugin-types.ts +8 -0
- package/src/plugins/adapt-sandbox-entry.ts +24 -5
- package/src/plugins/context.ts +24 -7
- package/src/plugins/index.ts +9 -0
- package/src/plugins/routes.ts +77 -1
- package/src/plugins/sandbox/index.ts +10 -1
- package/src/plugins/sandbox/types.ts +78 -1
- package/src/plugins/scheduler/node.ts +13 -1
- package/src/plugins/scheduler/types.ts +2 -0
- package/src/plugins/storage-indexes.ts +50 -11
- package/src/plugins/types.ts +39 -2
- package/src/query.ts +50 -79
- package/src/redirects/cache.ts +79 -19
- package/src/request-context.ts +3 -0
- package/src/scheduled-publish.ts +6 -1
- package/src/scheduler-health.ts +46 -0
- package/src/schema/registry.ts +863 -249
- package/src/schema/types.ts +74 -8
- package/src/schema/url-pattern.ts +33 -0
- package/src/schema/zod-generator.ts +77 -5
- package/src/search/fts-manager.ts +167 -86
- package/src/search/index.ts +2 -0
- package/src/search/query.ts +32 -11
- package/src/search/types.ts +8 -0
- package/src/seed/apply.ts +89 -16
- package/src/seed/types.ts +21 -3
- package/src/seed/validate.ts +52 -2
- package/src/taxonomies/index.ts +88 -82
- package/src/taxonomies/term-counts.ts +23 -12
- package/src/ui-comments.ts +19 -0
- package/src/ui.ts +11 -3
- package/src/utils/slugify.ts +1 -29
- package/src/virtual-modules.d.ts +24 -0
- package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
- package/dist/after-B1IIdH3Y.mjs +0 -29
- package/dist/after-B1IIdH3Y.mjs.map +0 -1
- package/dist/api-DgPbMlng.mjs.map +0 -1
- package/dist/apply-1_6ra7NP.mjs.map +0 -1
- package/dist/cache-B26cufFd.mjs +0 -65
- package/dist/cache-B26cufFd.mjs.map +0 -1
- package/dist/config-DyF3OKg_.mjs.map +0 -1
- package/dist/content-CpfKV9QE.mjs.map +0 -1
- package/dist/content-refresh-DgqUBeTv.mjs +0 -1629
- package/dist/content-refresh-DgqUBeTv.mjs.map +0 -1
- package/dist/context-kO4YZB03.mjs.map +0 -1
- package/dist/dashboard-DoBwPnON.mjs.map +0 -1
- package/dist/dialect-helpers-DFwyWjTM.mjs.map +0 -1
- package/dist/errors-DtEXIQQV.mjs.map +0 -1
- package/dist/fts-manager-vncsZIJm.mjs.map +0 -1
- package/dist/index-BeNto_Vs.d.mts.map +0 -1
- package/dist/index-j9rTh3cp.d.mts.map +0 -1
- package/dist/loader-C1XOLV5b.mjs.map +0 -1
- package/dist/media-DWIzoVFL.mjs.map +0 -1
- package/dist/media-allowlist-B7TPD6aq.mjs.map +0 -1
- package/dist/media-usage-DPJcNaAq.mjs.map +0 -1
- package/dist/menus-C6qhqP4X.mjs.map +0 -1
- package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
- package/dist/options-aeIs8WFu.d.mts.map +0 -1
- package/dist/public-url-DSGTnJFw.mjs.map +0 -1
- package/dist/query-DCiXI7OZ.mjs.map +0 -1
- package/dist/redirects-BOn2DIUs.mjs.map +0 -1
- package/dist/registry-BP1JK2xh.mjs +0 -795
- package/dist/registry-BP1JK2xh.mjs.map +0 -1
- package/dist/relations-DHFQGX0h.d.mts.map +0 -1
- package/dist/runner-BsI18UgP.mjs.map +0 -1
- package/dist/search-CeO678cp.mjs.map +0 -1
- package/dist/seo-C3GDfT0V.mjs.map +0 -1
- package/dist/site-url-8N3kSyVZ.mjs +0 -13
- package/dist/site-url-8N3kSyVZ.mjs.map +0 -1
- package/dist/slugify-C_tqlU4G.mjs +0 -30
- package/dist/slugify-C_tqlU4G.mjs.map +0 -1
- package/dist/taxonomies-B61CRSha.mjs.map +0 -1
- package/dist/taxonomies-Dbdki3Un.mjs.map +0 -1
- package/dist/taxonomy-DvwWAPvA.mjs +0 -304
- package/dist/taxonomy-DvwWAPvA.mjs.map +0 -1
- package/dist/types-84Bque3-.d.mts.map +0 -1
- package/dist/types-BQY7VYw6.d.mts.map +0 -1
- package/dist/types-DqZVPILm.d.mts.map +0 -1
- package/dist/types-XrQQ-Aex.mjs.map +0 -1
- package/dist/types-jISEalTX.d.mts.map +0 -1
- package/dist/types-o7xo7VgH.mjs.map +0 -1
- package/dist/validate-Bs_wT2ul.mjs.map +0 -1
- package/dist/validate-CdYcY-Ln.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/version-Bdfb34kk.mjs +0 -7
- package/dist/zod-generator-DMzfga3g.mjs.map +0 -1
- /package/dist/{api-tokens-CEsW_jCg.mjs → api-tokens-CyTsLszZ.mjs} +0 -0
- /package/dist/{ssrf-BB__xfNM.mjs → ssrf-DpXgKsna.mjs} +0 -0
- /package/dist/{types-CK0LxPUQ.mjs → types-CP1CflWf.mjs} +0 -0
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { r as validatePluginIdentifier, t as validateIdentifier } from "./validate-
|
|
2
|
-
import { c as isSqlite } from "./dialect-helpers-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-
|
|
7
|
-
import { n as isMissingTableError, t as isMissingColumnError } from "./db-errors-
|
|
8
|
-
import { i as encodeBase64, t as decodeBase64 } from "./base64-
|
|
9
|
-
import {
|
|
10
|
-
import { t as MediaRepository } from "./media-
|
|
11
|
-
import { t as UserRepository } from "./user-
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as RedirectRepository } from "./redirect-
|
|
1
|
+
import { i as validateStorageCollectionName, n as validateJsonFieldName, r as validatePluginIdentifier, t as validateIdentifier } from "./validate-BpwoDOgt.mjs";
|
|
2
|
+
import { c as isSqlite, l as jsonExtractExpr, s as isPostgres } from "./dialect-helpers-BSbfaO3F.mjs";
|
|
3
|
+
import { a as resolveConfiguredLocale, i as isI18nEnabled, r as getI18nConfig } from "./config-C3EBstHi.mjs";
|
|
4
|
+
import { t as after } from "./after-CBU2vkoO.mjs";
|
|
5
|
+
import { i as RevisionRepository, r as isSystemOrderField, t as ContentRepository } from "./content-BNfwh7xX.mjs";
|
|
6
|
+
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DfPax1I0.mjs";
|
|
7
|
+
import { n as isMissingTableError, t as isMissingColumnError } from "./db-errors-Cl-sKYTm.mjs";
|
|
8
|
+
import { i as encodeBase64, t as decodeBase64 } from "./base64-CvLhUKQv.mjs";
|
|
9
|
+
import { a as ScheduledNotDueError, i as InvalidCursorError, n as ContentMutationConflictError, r as EmDashValidationError, t as ContentCollectionNotFoundError } from "./types-CQPWhPxE.mjs";
|
|
10
|
+
import { t as MediaRepository } from "./media-CzhAn2--.mjs";
|
|
11
|
+
import { t as UserRepository } from "./user-sHgJ62SP.mjs";
|
|
12
|
+
import { t as withTransaction } from "./transaction-NQj4VJ7Z.mjs";
|
|
13
|
+
import { t as TaxonomyRepository } from "./taxonomy-CPeM8d2o.mjs";
|
|
14
|
+
import { t as CommentRepository } from "./comment-Dxlep6cE.mjs";
|
|
15
|
+
import { t as OptionsRepository } from "./options-CBXIHUoT.mjs";
|
|
16
|
+
import { t as RedirectRepository } from "./redirect-COsS6SWJ.mjs";
|
|
17
17
|
import { r as requestCached } from "./request-cache-BSUptuJR.mjs";
|
|
18
|
-
import { t as BylineRepository } from "./byline-
|
|
18
|
+
import { t as BylineRepository } from "./byline-pEcoDps8.mjs";
|
|
19
19
|
import { r as parseAllowedMimeTypes, t as matchesMimeAllowlist } from "./mime-DfIVjNkr.mjs";
|
|
20
|
-
import { t as SeoRepository } from "./seo-
|
|
21
|
-
import {
|
|
22
|
-
import { t as FTSManager } from "./fts-manager-
|
|
23
|
-
import { u as invalidateTermCache } from "./taxonomies-
|
|
24
|
-
import { r as hashString } from "./hash-
|
|
25
|
-
import { t as ErrorCode } from "./errors-
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { a as
|
|
29
|
-
import {
|
|
30
|
-
import { t as
|
|
31
|
-
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "./ssrf-CviKqWmq.mjs";
|
|
20
|
+
import { t as SeoRepository } from "./seo-CvDxfvFb.mjs";
|
|
21
|
+
import { n as invalidateRedirectCache } from "./cache-CBJaDy_E.mjs";
|
|
22
|
+
import { t as FTSManager } from "./fts-manager-CZ-5dVwJ.mjs";
|
|
23
|
+
import { u as invalidateTermCache } from "./taxonomies-B0o9ExNV.mjs";
|
|
24
|
+
import { r as hashString } from "./hash-Cg0TXJPV.mjs";
|
|
25
|
+
import { t as ErrorCode } from "./errors-CLUPm7aD.mjs";
|
|
26
|
+
import { t as PluginStateRepository } from "./state-DYwPue40.mjs";
|
|
27
|
+
import { a as reconcileManifestAccess, i as pluginManifestSchema, r as normalizeManifestRoute } from "./manifest-schema-BXbUAHod.mjs";
|
|
28
|
+
import { a as normalizeCapabilities, r as declaredAccessToCapabilities } from "./types-CP1CflWf.mjs";
|
|
29
|
+
import { t as EmDashStorageError } from "./types-BW1syrlw.mjs";
|
|
30
|
+
import { n as resolveAndValidateExternalUrl, t as SsrfError } from "./ssrf-Cpvg_n3A.mjs";
|
|
32
31
|
import { sql } from "kysely";
|
|
33
32
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
34
33
|
import { ClientResponseError, ClientValidationError } from "@atcute/client";
|
|
@@ -189,6 +188,17 @@ const SEO_DEFAULTS = {
|
|
|
189
188
|
async function collectionHasSeo(db, collection) {
|
|
190
189
|
return (await db.selectFrom("_emdash_collections").select("has_seo").where("slug", "=", collection).executeTakeFirst())?.has_seo === 1;
|
|
191
190
|
}
|
|
191
|
+
async function getCollectionPublishConfig(db, collection) {
|
|
192
|
+
const row = await db.selectFrom("_emdash_collections").select(["supports", "routable"]).where("slug", "=", collection).executeTakeFirst();
|
|
193
|
+
const supports = row?.supports ? JSON.parse(row.supports) : [];
|
|
194
|
+
return {
|
|
195
|
+
supportsRevisions: Array.isArray(supports) && supports.includes("revisions"),
|
|
196
|
+
routable: row?.routable !== 0
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function requireRoutablePublishSlug(routable, slug) {
|
|
200
|
+
if (routable && !slug?.trim()) throw new EmDashValidationError("Cannot publish routable content without a slug");
|
|
201
|
+
}
|
|
192
202
|
/**
|
|
193
203
|
* Hydrate SEO data on a single content item if the collection has SEO enabled.
|
|
194
204
|
*/
|
|
@@ -332,19 +342,22 @@ async function resolveIdIncludingTrashed(repo, collection, identifier, locale) {
|
|
|
332
342
|
}
|
|
333
343
|
/**
|
|
334
344
|
* Resolve the columns a content-list search should match against. Always
|
|
335
|
-
* includes `slug` (a standard column)
|
|
336
|
-
* fields when the collection actually defines them,
|
|
337
|
-
* item-title resolution (title -> name ->
|
|
338
|
-
*
|
|
345
|
+
* includes `slug` (a standard column), adds the configured `titleField` plus
|
|
346
|
+
* the `title`/`name` display fields when the collection actually defines them,
|
|
347
|
+
* mirroring the admin's item-title resolution (titleField -> title -> name ->
|
|
348
|
+
* slug), and includes every field explicitly marked searchable. Returning only
|
|
349
|
+
* schema-backed columns avoids "no such column" errors.
|
|
339
350
|
*/
|
|
340
351
|
async function resolveSearchColumns(db, collection) {
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const
|
|
352
|
+
const row = await db.selectFrom("_emdash_collections").select(["id", "title_field"]).where("slug", "=", collection).executeTakeFirst();
|
|
353
|
+
if (!row) return ["slug"];
|
|
354
|
+
const fields = await db.selectFrom("_emdash_fields").select(["slug", "searchable"]).where("collection_id", "=", row.id).orderBy("sort_order", "asc").execute();
|
|
355
|
+
const columns = new Set(["slug"]);
|
|
345
356
|
const fieldSlugs = new Set(fields.map((f) => f.slug));
|
|
346
|
-
|
|
347
|
-
|
|
357
|
+
if (row.title_field && fieldSlugs.has(row.title_field)) columns.add(row.title_field);
|
|
358
|
+
for (const candidate of ["title", "name"]) if (fieldSlugs.has(candidate)) columns.add(candidate);
|
|
359
|
+
for (const field of fields) if (field.searchable === 1) columns.add(field.slug);
|
|
360
|
+
return [...columns];
|
|
348
361
|
}
|
|
349
362
|
/**
|
|
350
363
|
* Decide whether the content-list `q` filter can be served from the
|
|
@@ -370,10 +383,22 @@ async function canUseFtsForListFilter(db, collection, searchColumns) {
|
|
|
370
383
|
* staged as `_slug` in a draft revision, which only land on publish).
|
|
371
384
|
*/
|
|
372
385
|
async function createSlugChangeRedirect(db, collection, oldSlug, newSlug, contentId) {
|
|
386
|
+
if (await slugStillTaken(db, collection, oldSlug, contentId)) return;
|
|
373
387
|
const collectionRow = await db.selectFrom("_emdash_collections").select("url_pattern").where("slug", "=", collection).executeTakeFirst();
|
|
374
388
|
await new RedirectRepository(db).createAutoRedirect(collection, oldSlug, newSlug, contentId, collectionRow?.url_pattern ?? null);
|
|
375
389
|
invalidateRedirectCache();
|
|
376
390
|
}
|
|
391
|
+
/** Whether a row other than `contentId` still holds `slug` in this collection. */
|
|
392
|
+
async function slugStillTaken(db, collection, slug, contentId) {
|
|
393
|
+
validateIdentifier(collection, "collection slug");
|
|
394
|
+
return (await sql`
|
|
395
|
+
SELECT id FROM ${sql.ref(`ec_${collection}`)}
|
|
396
|
+
WHERE slug = ${slug}
|
|
397
|
+
AND id != ${contentId}
|
|
398
|
+
AND deleted_at IS NULL
|
|
399
|
+
LIMIT 1
|
|
400
|
+
`.execute(db)).rows.length > 0;
|
|
401
|
+
}
|
|
377
402
|
/** Matches a date-only `YYYY-MM-DD` bound (no time component). */
|
|
378
403
|
const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
379
404
|
/**
|
|
@@ -391,6 +416,29 @@ function normalizeDateBound(value, edge) {
|
|
|
391
416
|
return edge === "start" ? `${value}T00:00:00.000Z` : `${value}T23:59:59.999Z`;
|
|
392
417
|
}
|
|
393
418
|
/**
|
|
419
|
+
* Build the repository's byline filter from the wire params.
|
|
420
|
+
*
|
|
421
|
+
* `locale` is the locale the list is scoped to, which is the locale an
|
|
422
|
+
* inferred credit has to resolve at — the admin list is always scoped to the
|
|
423
|
+
* locale picked in its switcher.
|
|
424
|
+
*/
|
|
425
|
+
function resolveBylineFilter(params, locale) {
|
|
426
|
+
const includeInferred = params.includeInferredBylines === true;
|
|
427
|
+
if (params.bylinesNone) return {
|
|
428
|
+
mode: "none",
|
|
429
|
+
includeInferred,
|
|
430
|
+
locale
|
|
431
|
+
};
|
|
432
|
+
const bylineIds = params.bylines ?? [];
|
|
433
|
+
if (bylineIds.length === 0) return void 0;
|
|
434
|
+
return {
|
|
435
|
+
mode: "any",
|
|
436
|
+
bylineIds,
|
|
437
|
+
includeInferred,
|
|
438
|
+
locale
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
394
442
|
* Create content list handler
|
|
395
443
|
*/
|
|
396
444
|
async function handleContentList(db, collection, params) {
|
|
@@ -398,8 +446,12 @@ async function handleContentList(db, collection, params) {
|
|
|
398
446
|
const repo = new ContentRepository(db);
|
|
399
447
|
const where = {};
|
|
400
448
|
if (params.status) where.status = params.status;
|
|
401
|
-
|
|
449
|
+
const locale = params.locale ? resolveConfiguredLocale(params.locale) : void 0;
|
|
450
|
+
if (locale) where.locale = locale;
|
|
402
451
|
if (params.authorId) where.authorId = params.authorId;
|
|
452
|
+
if (params.fieldFilters && Object.keys(params.fieldFilters).length > 0) where.fieldFilters = params.fieldFilters;
|
|
453
|
+
const bylineFilter = resolveBylineFilter(params, locale);
|
|
454
|
+
if (bylineFilter) where.bylineFilter = bylineFilter;
|
|
403
455
|
if (params.dateField && (params.dateFrom || params.dateTo)) where.dateFilter = {
|
|
404
456
|
field: params.dateField,
|
|
405
457
|
from: normalizeDateBound(params.dateFrom, "start"),
|
|
@@ -411,6 +463,11 @@ async function handleContentList(db, collection, params) {
|
|
|
411
463
|
where.searchColumns = await resolveSearchColumns(db, collection);
|
|
412
464
|
where.useFts = await canUseFtsForListFilter(db, collection, where.searchColumns);
|
|
413
465
|
}
|
|
466
|
+
let sortableExtras;
|
|
467
|
+
if (params.orderBy && !isSystemOrderField(params.orderBy)) {
|
|
468
|
+
const coll = await db.selectFrom("_emdash_collections").select(["title_field", "date_field"]).where("slug", "=", collection).executeTakeFirst();
|
|
469
|
+
sortableExtras = [coll?.title_field, coll?.date_field].filter((slug) => !!slug);
|
|
470
|
+
}
|
|
414
471
|
const result = await repo.findMany(collection, {
|
|
415
472
|
cursor: params.cursor,
|
|
416
473
|
limit: params.limit || 50,
|
|
@@ -418,7 +475,8 @@ async function handleContentList(db, collection, params) {
|
|
|
418
475
|
orderBy: params.orderBy ? {
|
|
419
476
|
field: params.orderBy,
|
|
420
477
|
direction: params.order || "desc"
|
|
421
|
-
} : void 0
|
|
478
|
+
} : void 0,
|
|
479
|
+
sortableExtras
|
|
422
480
|
});
|
|
423
481
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
424
482
|
await hydrateSeoMany(db, collection, result.items, hasSeo);
|
|
@@ -439,7 +497,7 @@ async function handleContentList(db, collection, params) {
|
|
|
439
497
|
message: error.message
|
|
440
498
|
}
|
|
441
499
|
};
|
|
442
|
-
if (isMissingTableError(error)) return {
|
|
500
|
+
if (error instanceof ContentCollectionNotFoundError || isMissingTableError(error)) return {
|
|
443
501
|
success: false,
|
|
444
502
|
error: {
|
|
445
503
|
code: "COLLECTION_NOT_FOUND",
|
|
@@ -607,6 +665,7 @@ async function handleContentCreate(db, collection, body) {
|
|
|
607
665
|
const slugSource = getSlugSource(body.data);
|
|
608
666
|
if (slugSource) slug = await repo.generateUniqueSlug(collection, slugSource, effectiveLocale);
|
|
609
667
|
}
|
|
668
|
+
if (body.status === "published") requireRoutablePublishSlug((await getCollectionPublishConfig(trx, collection)).routable, slug);
|
|
610
669
|
const created = await repo.create({
|
|
611
670
|
type: collection,
|
|
612
671
|
slug,
|
|
@@ -620,7 +679,6 @@ async function handleContentCreate(db, collection, body) {
|
|
|
620
679
|
});
|
|
621
680
|
if (body.bylines !== void 0) created.primaryBylineId = (await bylineRepo.setContentBylines(collection, created.id, body.bylines))[0]?.byline.translationGroup ?? null;
|
|
622
681
|
if (body.translationOf) {
|
|
623
|
-
await new TaxonomyRepository(trx).copyEntryTerms(collection, body.translationOf, created.id);
|
|
624
682
|
if (body.bylines === void 0) {
|
|
625
683
|
await bylineRepo.copyContentBylines(collection, body.translationOf, created.id);
|
|
626
684
|
const source = await repo.findById(collection, body.translationOf);
|
|
@@ -707,7 +765,7 @@ async function handleContentUpdate(db, collection, id, body) {
|
|
|
707
765
|
const item = await withTransaction(db, async (trx) => {
|
|
708
766
|
const trxRepo = new ContentRepository(trx);
|
|
709
767
|
const bylineRepo = new BylineRepository(trx);
|
|
710
|
-
const existing = body._rev || body.slug ? await trxRepo.findById(collection, resolvedId) : null;
|
|
768
|
+
const existing = body._rev || body.slug !== void 0 || body.status === "published" ? await trxRepo.findById(collection, resolvedId) : null;
|
|
711
769
|
if (body._rev) {
|
|
712
770
|
if (!existing) throw Object.assign(/* @__PURE__ */ new Error(`Content item not found: ${id}`), { apiError: { code: "NOT_FOUND" } });
|
|
713
771
|
const revCheck = validateRev(body._rev, existing);
|
|
@@ -715,6 +773,12 @@ async function handleContentUpdate(db, collection, id, body) {
|
|
|
715
773
|
}
|
|
716
774
|
let oldSlug;
|
|
717
775
|
if (body.slug && existing?.slug && existing.slug !== body.slug) oldSlug = existing.slug;
|
|
776
|
+
if ((body.status ?? existing?.status) === "published") {
|
|
777
|
+
if (!existing) throw Object.assign(/* @__PURE__ */ new Error(`Content item not found: ${id}`), { apiError: { code: "NOT_FOUND" } });
|
|
778
|
+
const publishConfig = await getCollectionPublishConfig(trx, collection);
|
|
779
|
+
const intendedSlug = body.slug !== void 0 ? body.slug : existing.slug;
|
|
780
|
+
requireRoutablePublishSlug(publishConfig.routable, intendedSlug);
|
|
781
|
+
}
|
|
718
782
|
const updated = await trxRepo.update(collection, resolvedId, {
|
|
719
783
|
data: body.data,
|
|
720
784
|
slug: body.slug,
|
|
@@ -1020,7 +1084,9 @@ async function handleContentSchedule(db, collection, id, scheduledAt) {
|
|
|
1020
1084
|
try {
|
|
1021
1085
|
const item = await withTransaction(db, async (trx) => {
|
|
1022
1086
|
const repo = new ContentRepository(trx);
|
|
1023
|
-
const
|
|
1087
|
+
const existing = await repo.findByIdOrSlug(collection, id);
|
|
1088
|
+
const resolvedId = existing?.id ?? id;
|
|
1089
|
+
if (existing) requireRoutablePublishSlug((await getCollectionPublishConfig(trx, collection)).routable, existing.slug);
|
|
1024
1090
|
return repo.schedule(collection, resolvedId, scheduledAt);
|
|
1025
1091
|
});
|
|
1026
1092
|
await hydrateSeo(db, collection, item, await collectionHasSeo(db, collection));
|
|
@@ -1082,17 +1148,17 @@ async function handleContentUnschedule(db, collection, id) {
|
|
|
1082
1148
|
/**
|
|
1083
1149
|
* Publish content immediately.
|
|
1084
1150
|
*
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
1087
|
-
* be atomic to prevent FTS shadow table corruption on crash.
|
|
1151
|
+
* Publication is one atomic content-row statement. On databases that support
|
|
1152
|
+
* transactions, the existing slug-redirect side write remains grouped with it.
|
|
1088
1153
|
*/
|
|
1089
1154
|
async function handleContentPublish(db, collection, id, options = {}) {
|
|
1090
1155
|
try {
|
|
1091
1156
|
const item = await withTransaction(db, async (trx) => {
|
|
1092
1157
|
const repo = new ContentRepository(trx);
|
|
1093
1158
|
const resolvedId = await resolveId(repo, collection, id) ?? id;
|
|
1159
|
+
const publishConfig = await getCollectionPublishConfig(trx, collection);
|
|
1094
1160
|
const existing = await repo.findById(collection, resolvedId);
|
|
1095
|
-
const published = await repo.publish(collection, resolvedId, options.publishedAt, options.requireScheduledDue);
|
|
1161
|
+
const published = await repo.publish(collection, resolvedId, options.publishedAt, options.requireScheduledDue, options.expectedScheduledAt, publishConfig.supportsRevisions, publishConfig.routable);
|
|
1096
1162
|
if (existing?.status === "published" && existing.slug && published.slug && existing.slug !== published.slug) await createSlugChangeRedirect(trx, collection, existing.slug, published.slug, resolvedId);
|
|
1097
1163
|
return published;
|
|
1098
1164
|
});
|
|
@@ -1102,6 +1168,13 @@ async function handleContentPublish(db, collection, id, options = {}) {
|
|
|
1102
1168
|
data: { item }
|
|
1103
1169
|
};
|
|
1104
1170
|
} catch (error) {
|
|
1171
|
+
if (error instanceof ContentMutationConflictError) return {
|
|
1172
|
+
success: false,
|
|
1173
|
+
error: {
|
|
1174
|
+
code: "CONFLICT",
|
|
1175
|
+
message: error.message
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1105
1178
|
if (error instanceof ScheduledNotDueError) return {
|
|
1106
1179
|
success: false,
|
|
1107
1180
|
error: {
|
|
@@ -1395,6 +1468,7 @@ async function generateManifest(collections, plugins = {}) {
|
|
|
1395
1468
|
label: definition.admin.label,
|
|
1396
1469
|
labelSingular: definition.admin.labelSingular || definition.admin.label,
|
|
1397
1470
|
supports: definition.admin.supports || [],
|
|
1471
|
+
routable: definition.admin.routable ?? true,
|
|
1398
1472
|
fields
|
|
1399
1473
|
};
|
|
1400
1474
|
}
|
|
@@ -1563,22 +1637,30 @@ async function handleRevisionRestore(db, revisionId, callerUserId) {
|
|
|
1563
1637
|
}
|
|
1564
1638
|
};
|
|
1565
1639
|
const { _slug, ...fieldData } = revision.data;
|
|
1566
|
-
const item = await withTransaction(db, async (trx) => {
|
|
1640
|
+
const { item, queuedRevisionId } = await withTransaction(db, async (trx) => {
|
|
1567
1641
|
const trxContentRepo = new ContentRepository(trx);
|
|
1568
1642
|
const trxRevisionRepo = new RevisionRepository(trx);
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1643
|
+
return {
|
|
1644
|
+
item: await trxContentRepo.update(revision.collection, revision.entryId, {
|
|
1645
|
+
data: fieldData,
|
|
1646
|
+
slug: typeof _slug === "string" ? _slug : void 0
|
|
1647
|
+
}),
|
|
1648
|
+
queuedRevisionId: (await trxRevisionRepo.create({
|
|
1649
|
+
collection: revision.collection,
|
|
1650
|
+
entryId: revision.entryId,
|
|
1651
|
+
data: revision.data,
|
|
1652
|
+
authorId: callerUserId
|
|
1653
|
+
})).id
|
|
1654
|
+
};
|
|
1655
|
+
});
|
|
1656
|
+
const pruneRepo = new RevisionRepository(db);
|
|
1657
|
+
after(async () => {
|
|
1658
|
+
try {
|
|
1659
|
+
await pruneRepo.pruneQueuedEntry(revision.collection, revision.entryId, queuedRevisionId, 50);
|
|
1660
|
+
} catch (error) {
|
|
1661
|
+
console.error(`[revisions] Failed to prune revisions for ${revision.collection}/${revision.entryId}:`, error);
|
|
1662
|
+
}
|
|
1580
1663
|
});
|
|
1581
|
-
new RevisionRepository(db).pruneOldRevisions(revision.collection, revision.entryId, 50).catch(() => {});
|
|
1582
1664
|
return {
|
|
1583
1665
|
success: true,
|
|
1584
1666
|
data: { item }
|
|
@@ -1735,370 +1817,6 @@ async function handleMediaDelete(db, id) {
|
|
|
1735
1817
|
}
|
|
1736
1818
|
}
|
|
1737
1819
|
|
|
1738
|
-
//#endregion
|
|
1739
|
-
//#region src/api/handlers/schema.ts
|
|
1740
|
-
/**
|
|
1741
|
-
* List all collections
|
|
1742
|
-
*/
|
|
1743
|
-
async function handleSchemaCollectionList(db) {
|
|
1744
|
-
try {
|
|
1745
|
-
return {
|
|
1746
|
-
success: true,
|
|
1747
|
-
data: { items: await new SchemaRegistry(db).listCollections() }
|
|
1748
|
-
};
|
|
1749
|
-
} catch {
|
|
1750
|
-
return {
|
|
1751
|
-
success: false,
|
|
1752
|
-
error: {
|
|
1753
|
-
code: "SCHEMA_LIST_ERROR",
|
|
1754
|
-
message: "Failed to list collections"
|
|
1755
|
-
}
|
|
1756
|
-
};
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
/**
|
|
1760
|
-
* Get a collection by slug
|
|
1761
|
-
*/
|
|
1762
|
-
async function handleSchemaCollectionGet(db, slug, options) {
|
|
1763
|
-
try {
|
|
1764
|
-
const registry = new SchemaRegistry(db);
|
|
1765
|
-
if (options?.includeFields) {
|
|
1766
|
-
const item = await registry.getCollectionWithFields(slug);
|
|
1767
|
-
if (!item) return {
|
|
1768
|
-
success: false,
|
|
1769
|
-
error: {
|
|
1770
|
-
code: "NOT_FOUND",
|
|
1771
|
-
message: `Collection not found: ${slug}`
|
|
1772
|
-
}
|
|
1773
|
-
};
|
|
1774
|
-
return {
|
|
1775
|
-
success: true,
|
|
1776
|
-
data: { item }
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
const item = await registry.getCollection(slug);
|
|
1780
|
-
if (!item) return {
|
|
1781
|
-
success: false,
|
|
1782
|
-
error: {
|
|
1783
|
-
code: "NOT_FOUND",
|
|
1784
|
-
message: `Collection not found: ${slug}`
|
|
1785
|
-
}
|
|
1786
|
-
};
|
|
1787
|
-
return {
|
|
1788
|
-
success: true,
|
|
1789
|
-
data: { item }
|
|
1790
|
-
};
|
|
1791
|
-
} catch {
|
|
1792
|
-
return {
|
|
1793
|
-
success: false,
|
|
1794
|
-
error: {
|
|
1795
|
-
code: "SCHEMA_GET_ERROR",
|
|
1796
|
-
message: "Failed to get collection"
|
|
1797
|
-
}
|
|
1798
|
-
};
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
/**
|
|
1802
|
-
* Create a collection
|
|
1803
|
-
*/
|
|
1804
|
-
async function handleSchemaCollectionCreate(db, input) {
|
|
1805
|
-
try {
|
|
1806
|
-
return {
|
|
1807
|
-
success: true,
|
|
1808
|
-
data: { item: await new SchemaRegistry(db).createCollection(input) }
|
|
1809
|
-
};
|
|
1810
|
-
} catch (error) {
|
|
1811
|
-
if (error instanceof SchemaError) return {
|
|
1812
|
-
success: false,
|
|
1813
|
-
error: {
|
|
1814
|
-
code: error.code,
|
|
1815
|
-
message: error.message,
|
|
1816
|
-
details: error.details
|
|
1817
|
-
}
|
|
1818
|
-
};
|
|
1819
|
-
console.error("[emdash] Failed to create collection:", error);
|
|
1820
|
-
return {
|
|
1821
|
-
success: false,
|
|
1822
|
-
error: {
|
|
1823
|
-
code: "SCHEMA_CREATE_ERROR",
|
|
1824
|
-
message: "Failed to create collection"
|
|
1825
|
-
}
|
|
1826
|
-
};
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
/**
|
|
1830
|
-
* Update a collection
|
|
1831
|
-
*/
|
|
1832
|
-
async function handleSchemaCollectionUpdate(db, slug, input) {
|
|
1833
|
-
try {
|
|
1834
|
-
return {
|
|
1835
|
-
success: true,
|
|
1836
|
-
data: { item: await new SchemaRegistry(db).updateCollection(slug, input) }
|
|
1837
|
-
};
|
|
1838
|
-
} catch (error) {
|
|
1839
|
-
if (error instanceof SchemaError) return {
|
|
1840
|
-
success: false,
|
|
1841
|
-
error: {
|
|
1842
|
-
code: error.code,
|
|
1843
|
-
message: error.message,
|
|
1844
|
-
details: error.details
|
|
1845
|
-
}
|
|
1846
|
-
};
|
|
1847
|
-
return {
|
|
1848
|
-
success: false,
|
|
1849
|
-
error: {
|
|
1850
|
-
code: "SCHEMA_UPDATE_ERROR",
|
|
1851
|
-
message: "Failed to update collection"
|
|
1852
|
-
}
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
/**
|
|
1857
|
-
* Delete a collection
|
|
1858
|
-
*/
|
|
1859
|
-
async function handleSchemaCollectionDelete(db, slug, options) {
|
|
1860
|
-
try {
|
|
1861
|
-
await new SchemaRegistry(db).deleteCollection(slug, options);
|
|
1862
|
-
return {
|
|
1863
|
-
success: true,
|
|
1864
|
-
data: { success: true }
|
|
1865
|
-
};
|
|
1866
|
-
} catch (error) {
|
|
1867
|
-
if (error instanceof SchemaError) return {
|
|
1868
|
-
success: false,
|
|
1869
|
-
error: {
|
|
1870
|
-
code: error.code,
|
|
1871
|
-
message: error.message,
|
|
1872
|
-
details: error.details
|
|
1873
|
-
}
|
|
1874
|
-
};
|
|
1875
|
-
return {
|
|
1876
|
-
success: false,
|
|
1877
|
-
error: {
|
|
1878
|
-
code: "SCHEMA_DELETE_ERROR",
|
|
1879
|
-
message: "Failed to delete collection"
|
|
1880
|
-
}
|
|
1881
|
-
};
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
/**
|
|
1885
|
-
* List fields for a collection
|
|
1886
|
-
*/
|
|
1887
|
-
async function handleSchemaFieldList(db, collectionSlug) {
|
|
1888
|
-
try {
|
|
1889
|
-
const registry = new SchemaRegistry(db);
|
|
1890
|
-
const collection = await registry.getCollection(collectionSlug);
|
|
1891
|
-
if (!collection) return {
|
|
1892
|
-
success: false,
|
|
1893
|
-
error: {
|
|
1894
|
-
code: "NOT_FOUND",
|
|
1895
|
-
message: `Collection not found: ${collectionSlug}`
|
|
1896
|
-
}
|
|
1897
|
-
};
|
|
1898
|
-
return {
|
|
1899
|
-
success: true,
|
|
1900
|
-
data: { items: await registry.listFields(collection.id) }
|
|
1901
|
-
};
|
|
1902
|
-
} catch {
|
|
1903
|
-
return {
|
|
1904
|
-
success: false,
|
|
1905
|
-
error: {
|
|
1906
|
-
code: "SCHEMA_FIELD_LIST_ERROR",
|
|
1907
|
-
message: "Failed to list fields"
|
|
1908
|
-
}
|
|
1909
|
-
};
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
/**
|
|
1913
|
-
* Get a field
|
|
1914
|
-
*/
|
|
1915
|
-
async function handleSchemaFieldGet(db, collectionSlug, fieldSlug) {
|
|
1916
|
-
try {
|
|
1917
|
-
const item = await new SchemaRegistry(db).getField(collectionSlug, fieldSlug);
|
|
1918
|
-
if (!item) return {
|
|
1919
|
-
success: false,
|
|
1920
|
-
error: {
|
|
1921
|
-
code: "NOT_FOUND",
|
|
1922
|
-
message: `Field not found: ${fieldSlug} in collection ${collectionSlug}`
|
|
1923
|
-
}
|
|
1924
|
-
};
|
|
1925
|
-
return {
|
|
1926
|
-
success: true,
|
|
1927
|
-
data: { item }
|
|
1928
|
-
};
|
|
1929
|
-
} catch {
|
|
1930
|
-
return {
|
|
1931
|
-
success: false,
|
|
1932
|
-
error: {
|
|
1933
|
-
code: "SCHEMA_FIELD_GET_ERROR",
|
|
1934
|
-
message: "Failed to get field"
|
|
1935
|
-
}
|
|
1936
|
-
};
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
/**
|
|
1940
|
-
* Create a field
|
|
1941
|
-
*/
|
|
1942
|
-
async function handleSchemaFieldCreate(db, collectionSlug, input) {
|
|
1943
|
-
try {
|
|
1944
|
-
const item = await new SchemaRegistry(db).createField(collectionSlug, input);
|
|
1945
|
-
invalidateCollectionCache(collectionSlug);
|
|
1946
|
-
return {
|
|
1947
|
-
success: true,
|
|
1948
|
-
data: { item }
|
|
1949
|
-
};
|
|
1950
|
-
} catch (error) {
|
|
1951
|
-
if (error instanceof SchemaError) return {
|
|
1952
|
-
success: false,
|
|
1953
|
-
error: {
|
|
1954
|
-
code: error.code,
|
|
1955
|
-
message: error.message,
|
|
1956
|
-
details: error.details
|
|
1957
|
-
}
|
|
1958
|
-
};
|
|
1959
|
-
return {
|
|
1960
|
-
success: false,
|
|
1961
|
-
error: {
|
|
1962
|
-
code: "SCHEMA_FIELD_CREATE_ERROR",
|
|
1963
|
-
message: "Failed to create field"
|
|
1964
|
-
}
|
|
1965
|
-
};
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
/**
|
|
1969
|
-
* Update a field
|
|
1970
|
-
*/
|
|
1971
|
-
async function handleSchemaFieldUpdate(db, collectionSlug, fieldSlug, input) {
|
|
1972
|
-
try {
|
|
1973
|
-
const item = await new SchemaRegistry(db).updateField(collectionSlug, fieldSlug, input);
|
|
1974
|
-
invalidateCollectionCache(collectionSlug);
|
|
1975
|
-
return {
|
|
1976
|
-
success: true,
|
|
1977
|
-
data: { item }
|
|
1978
|
-
};
|
|
1979
|
-
} catch (error) {
|
|
1980
|
-
if (error instanceof SchemaError) return {
|
|
1981
|
-
success: false,
|
|
1982
|
-
error: {
|
|
1983
|
-
code: error.code,
|
|
1984
|
-
message: error.message,
|
|
1985
|
-
details: error.details
|
|
1986
|
-
}
|
|
1987
|
-
};
|
|
1988
|
-
return {
|
|
1989
|
-
success: false,
|
|
1990
|
-
error: {
|
|
1991
|
-
code: "SCHEMA_FIELD_UPDATE_ERROR",
|
|
1992
|
-
message: "Failed to update field"
|
|
1993
|
-
}
|
|
1994
|
-
};
|
|
1995
|
-
}
|
|
1996
|
-
}
|
|
1997
|
-
/**
|
|
1998
|
-
* Delete a field
|
|
1999
|
-
*/
|
|
2000
|
-
async function handleSchemaFieldDelete(db, collectionSlug, fieldSlug) {
|
|
2001
|
-
try {
|
|
2002
|
-
await new SchemaRegistry(db).deleteField(collectionSlug, fieldSlug);
|
|
2003
|
-
invalidateCollectionCache(collectionSlug);
|
|
2004
|
-
return {
|
|
2005
|
-
success: true,
|
|
2006
|
-
data: { success: true }
|
|
2007
|
-
};
|
|
2008
|
-
} catch (error) {
|
|
2009
|
-
if (error instanceof SchemaError) return {
|
|
2010
|
-
success: false,
|
|
2011
|
-
error: {
|
|
2012
|
-
code: error.code,
|
|
2013
|
-
message: error.message,
|
|
2014
|
-
details: error.details
|
|
2015
|
-
}
|
|
2016
|
-
};
|
|
2017
|
-
return {
|
|
2018
|
-
success: false,
|
|
2019
|
-
error: {
|
|
2020
|
-
code: "SCHEMA_FIELD_DELETE_ERROR",
|
|
2021
|
-
message: "Failed to delete field"
|
|
2022
|
-
}
|
|
2023
|
-
};
|
|
2024
|
-
}
|
|
2025
|
-
}
|
|
2026
|
-
/**
|
|
2027
|
-
* Reorder fields
|
|
2028
|
-
*/
|
|
2029
|
-
async function handleSchemaFieldReorder(db, collectionSlug, fieldSlugs) {
|
|
2030
|
-
try {
|
|
2031
|
-
await new SchemaRegistry(db).reorderFields(collectionSlug, fieldSlugs);
|
|
2032
|
-
return {
|
|
2033
|
-
success: true,
|
|
2034
|
-
data: { success: true }
|
|
2035
|
-
};
|
|
2036
|
-
} catch (error) {
|
|
2037
|
-
if (error instanceof SchemaError) return {
|
|
2038
|
-
success: false,
|
|
2039
|
-
error: {
|
|
2040
|
-
code: error.code,
|
|
2041
|
-
message: error.message,
|
|
2042
|
-
details: error.details
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
|
-
return {
|
|
2046
|
-
success: false,
|
|
2047
|
-
error: {
|
|
2048
|
-
code: "SCHEMA_FIELD_REORDER_ERROR",
|
|
2049
|
-
message: "Failed to reorder fields"
|
|
2050
|
-
}
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
}
|
|
2054
|
-
/**
|
|
2055
|
-
* List orphaned content tables
|
|
2056
|
-
*/
|
|
2057
|
-
async function handleOrphanedTableList(db) {
|
|
2058
|
-
try {
|
|
2059
|
-
return {
|
|
2060
|
-
success: true,
|
|
2061
|
-
data: { items: await new SchemaRegistry(db).discoverOrphanedTables() }
|
|
2062
|
-
};
|
|
2063
|
-
} catch (error) {
|
|
2064
|
-
console.error("[emdash] Failed to list orphaned tables:", error);
|
|
2065
|
-
return {
|
|
2066
|
-
success: false,
|
|
2067
|
-
error: {
|
|
2068
|
-
code: "ORPHAN_LIST_ERROR",
|
|
2069
|
-
message: "Failed to list orphaned tables"
|
|
2070
|
-
}
|
|
2071
|
-
};
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
/**
|
|
2075
|
-
* Register an orphaned table as a collection
|
|
2076
|
-
*/
|
|
2077
|
-
async function handleOrphanedTableRegister(db, slug, options) {
|
|
2078
|
-
try {
|
|
2079
|
-
return {
|
|
2080
|
-
success: true,
|
|
2081
|
-
data: { item: await new SchemaRegistry(db).registerOrphanedTable(slug, options) }
|
|
2082
|
-
};
|
|
2083
|
-
} catch (error) {
|
|
2084
|
-
if (error instanceof SchemaError) return {
|
|
2085
|
-
success: false,
|
|
2086
|
-
error: {
|
|
2087
|
-
code: error.code,
|
|
2088
|
-
message: error.message,
|
|
2089
|
-
details: error.details
|
|
2090
|
-
}
|
|
2091
|
-
};
|
|
2092
|
-
return {
|
|
2093
|
-
success: false,
|
|
2094
|
-
error: {
|
|
2095
|
-
code: "ORPHAN_REGISTER_ERROR",
|
|
2096
|
-
message: "Failed to register orphaned table"
|
|
2097
|
-
}
|
|
2098
|
-
};
|
|
2099
|
-
}
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
1820
|
//#endregion
|
|
2103
1821
|
//#region src/api/handlers/plugins.ts
|
|
2104
1822
|
function marketplaceIconUrl(marketplaceUrl, pluginId) {
|
|
@@ -2750,6 +2468,171 @@ function createMarketplaceClient(baseUrl, siteOrigin) {
|
|
|
2750
2468
|
return new MarketplaceClientImpl(baseUrl, siteOrigin);
|
|
2751
2469
|
}
|
|
2752
2470
|
|
|
2471
|
+
//#endregion
|
|
2472
|
+
//#region src/plugins/storage-indexes.ts
|
|
2473
|
+
/**
|
|
2474
|
+
* Generate a deterministic index name.
|
|
2475
|
+
* Unique indexes use a `uidx_` prefix to avoid collisions with regular indexes on the same fields.
|
|
2476
|
+
*/
|
|
2477
|
+
function generateIndexName(pluginId, collection, fields, options) {
|
|
2478
|
+
return `${options?.unique ? "uidx" : "idx"}_plugin_${pluginId}_${collection}_${fields.join("_")}`.substring(0, 128);
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Generate a Kysely sql expression for creating an expression index.
|
|
2482
|
+
*
|
|
2483
|
+
* Validates all inputs before interpolation. The collection uses the
|
|
2484
|
+
* permissive manifest-key rules rather than SQL-identifier rules — it is
|
|
2485
|
+
* stored as opaque text and only reaches SQL inside the generated index
|
|
2486
|
+
* name — so kebab-case collections index like any other.
|
|
2487
|
+
*/
|
|
2488
|
+
function generateCreateIndexSql(db, pluginId, collection, fields, options) {
|
|
2489
|
+
validatePluginIdentifier(pluginId, "plugin ID");
|
|
2490
|
+
validateStorageCollectionName(collection, "collection name");
|
|
2491
|
+
for (const field of fields) validateJsonFieldName(field, "index field name");
|
|
2492
|
+
const indexName = generateIndexName(pluginId, collection, fields, options);
|
|
2493
|
+
const expressions = fields.map((field) => {
|
|
2494
|
+
if (isPostgres(db)) return `(${jsonExtractExpr(db, "data", field)})`;
|
|
2495
|
+
return jsonExtractExpr(db, "data", field);
|
|
2496
|
+
}).join(", ");
|
|
2497
|
+
const createKeyword = options?.unique ? "CREATE UNIQUE INDEX" : "CREATE INDEX";
|
|
2498
|
+
return sql`${sql.raw(createKeyword)} IF NOT EXISTS ${sql.ref(indexName)}
|
|
2499
|
+
ON _plugin_storage(plugin_id, collection, ${sql.raw(expressions)})
|
|
2500
|
+
`;
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Generate a Kysely sql expression for dropping an index.
|
|
2504
|
+
*
|
|
2505
|
+
* Uses sql.ref() for safe identifier quoting.
|
|
2506
|
+
*/
|
|
2507
|
+
function generateDropIndexSql(indexName) {
|
|
2508
|
+
return sql`DROP INDEX IF EXISTS ${sql.ref(indexName)}`;
|
|
2509
|
+
}
|
|
2510
|
+
/**
|
|
2511
|
+
* Normalize index declarations to arrays of field arrays
|
|
2512
|
+
*/
|
|
2513
|
+
function normalizeIndexes(indexes) {
|
|
2514
|
+
return indexes.map((index) => Array.isArray(index) ? index : [index]);
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* Create all declared indexes for a plugin collection
|
|
2518
|
+
*/
|
|
2519
|
+
async function createStorageIndexes(db, pluginId, collection, indexes, options) {
|
|
2520
|
+
const normalized = normalizeIndexes(indexes);
|
|
2521
|
+
const uniqueNormalized = options?.uniqueIndexes ? normalizeIndexes(options.uniqueIndexes) : [];
|
|
2522
|
+
const uniqueSet = new Set(uniqueNormalized.map((f) => f.join(",")));
|
|
2523
|
+
const allEntries = [...normalized.filter((f) => !uniqueSet.has(f.join(","))).map((fields) => ({
|
|
2524
|
+
fields,
|
|
2525
|
+
unique: false
|
|
2526
|
+
})), ...uniqueNormalized.map((fields) => ({
|
|
2527
|
+
fields,
|
|
2528
|
+
unique: true
|
|
2529
|
+
}))];
|
|
2530
|
+
const created = [];
|
|
2531
|
+
const errors = [];
|
|
2532
|
+
for (const entry of allEntries) {
|
|
2533
|
+
const { fields } = entry;
|
|
2534
|
+
const indexName = generateIndexName(pluginId, collection, fields, { unique: entry.unique });
|
|
2535
|
+
try {
|
|
2536
|
+
await generateCreateIndexSql(db, pluginId, collection, fields, { unique: entry.unique }).execute(db);
|
|
2537
|
+
await db.insertInto("_plugin_indexes").values({
|
|
2538
|
+
plugin_id: pluginId,
|
|
2539
|
+
collection,
|
|
2540
|
+
index_name: indexName,
|
|
2541
|
+
fields: JSON.stringify(fields)
|
|
2542
|
+
}).onConflict((oc) => oc.columns([
|
|
2543
|
+
"plugin_id",
|
|
2544
|
+
"collection",
|
|
2545
|
+
"index_name"
|
|
2546
|
+
]).doUpdateSet({ fields: JSON.stringify(fields) })).execute();
|
|
2547
|
+
created.push(indexName);
|
|
2548
|
+
} catch (error) {
|
|
2549
|
+
errors.push({
|
|
2550
|
+
index: indexName,
|
|
2551
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2552
|
+
});
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
return {
|
|
2556
|
+
created,
|
|
2557
|
+
errors
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
/**
|
|
2561
|
+
* Remove indexes that are no longer declared
|
|
2562
|
+
*/
|
|
2563
|
+
async function removeOrphanedIndexes(db, pluginId, collection, currentIndexes, options) {
|
|
2564
|
+
const normalized = normalizeIndexes(currentIndexes);
|
|
2565
|
+
const uniqueNormalized = options?.uniqueIndexes ? normalizeIndexes(options.uniqueIndexes) : [];
|
|
2566
|
+
const uniqueSet = new Set(uniqueNormalized.map((f) => f.join(",")));
|
|
2567
|
+
const currentIndexNames = /* @__PURE__ */ new Set();
|
|
2568
|
+
for (const fields of normalized) if (!uniqueSet.has(fields.join(","))) currentIndexNames.add(generateIndexName(pluginId, collection, fields));
|
|
2569
|
+
for (const fields of uniqueNormalized) currentIndexNames.add(generateIndexName(pluginId, collection, fields, { unique: true }));
|
|
2570
|
+
const existingIndexes = await db.selectFrom("_plugin_indexes").select(["index_name"]).where("plugin_id", "=", pluginId).where("collection", "=", collection).execute();
|
|
2571
|
+
const removed = [];
|
|
2572
|
+
const errors = [];
|
|
2573
|
+
for (const { index_name } of existingIndexes) if (!currentIndexNames.has(index_name)) try {
|
|
2574
|
+
await generateDropIndexSql(index_name).execute(db);
|
|
2575
|
+
await db.deleteFrom("_plugin_indexes").where("plugin_id", "=", pluginId).where("collection", "=", collection).where("index_name", "=", index_name).execute();
|
|
2576
|
+
removed.push(index_name);
|
|
2577
|
+
} catch (error) {
|
|
2578
|
+
errors.push({
|
|
2579
|
+
index: index_name,
|
|
2580
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
return {
|
|
2584
|
+
removed,
|
|
2585
|
+
errors
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2588
|
+
/**
|
|
2589
|
+
* Sync indexes for a plugin collection (create new, remove old)
|
|
2590
|
+
*/
|
|
2591
|
+
async function syncStorageIndexes(db, pluginId, collection, indexes, options) {
|
|
2592
|
+
const [createResult, removeResult] = await Promise.all([createStorageIndexes(db, pluginId, collection, indexes, options), removeOrphanedIndexes(db, pluginId, collection, indexes, options)]);
|
|
2593
|
+
return {
|
|
2594
|
+
created: createResult.created,
|
|
2595
|
+
removed: removeResult.removed,
|
|
2596
|
+
errors: [...createResult.errors, ...removeResult.errors]
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
/**
|
|
2600
|
+
* Materialize the storage indexes a set of plugins declare in their
|
|
2601
|
+
* manifests. Failures are logged per collection and never thrown — a missing
|
|
2602
|
+
* index affects query performance, not correctness, so it must not fail an
|
|
2603
|
+
* install or a scheduler tick.
|
|
2604
|
+
*/
|
|
2605
|
+
async function syncDeclaredStorageIndexes(db, plugins) {
|
|
2606
|
+
for (const plugin of plugins) for (const [collection, config] of Object.entries(plugin.storage ?? {})) try {
|
|
2607
|
+
const result = await syncStorageIndexes(db, plugin.id, collection, config.indexes, { uniqueIndexes: config.uniqueIndexes });
|
|
2608
|
+
for (const failure of result.errors) console.error(`[plugins] Failed to sync storage index ${failure.index} for ${plugin.id}/${collection}: ${failure.error}`);
|
|
2609
|
+
} catch (error) {
|
|
2610
|
+
console.error(`[plugins] Failed to sync storage indexes for ${plugin.id}/${collection}:`, error);
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Remove all indexes for a plugin
|
|
2615
|
+
*/
|
|
2616
|
+
async function removeAllPluginIndexes(db, pluginId) {
|
|
2617
|
+
const existingIndexes = await db.selectFrom("_plugin_indexes").select(["index_name", "collection"]).where("plugin_id", "=", pluginId).execute();
|
|
2618
|
+
const removed = [];
|
|
2619
|
+
const errors = [];
|
|
2620
|
+
for (const { index_name } of existingIndexes) try {
|
|
2621
|
+
await generateDropIndexSql(index_name).execute(db);
|
|
2622
|
+
removed.push(index_name);
|
|
2623
|
+
} catch (error) {
|
|
2624
|
+
errors.push({
|
|
2625
|
+
index: index_name,
|
|
2626
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2627
|
+
});
|
|
2628
|
+
}
|
|
2629
|
+
await db.deleteFrom("_plugin_indexes").where("plugin_id", "=", pluginId).execute();
|
|
2630
|
+
return {
|
|
2631
|
+
removed,
|
|
2632
|
+
errors
|
|
2633
|
+
};
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2753
2636
|
//#endregion
|
|
2754
2637
|
//#region src/api/handlers/marketplace.ts
|
|
2755
2638
|
/** Semver-like pattern: digits, dots, hyphens, plus signs (e.g. 1.0.0, 1.0.0-beta.1) */
|
|
@@ -2984,6 +2867,7 @@ async function handleMarketplaceInstall(db, storage, sandboxRunner, marketplaceU
|
|
|
2984
2867
|
displayName: pluginDetail.name,
|
|
2985
2868
|
description: pluginDetail.description ?? void 0
|
|
2986
2869
|
});
|
|
2870
|
+
await syncDeclaredStorageIndexes(db, [bundle.manifest]);
|
|
2987
2871
|
client.reportInstall(pluginId, version).catch(() => {});
|
|
2988
2872
|
return {
|
|
2989
2873
|
success: true,
|
|
@@ -3145,6 +3029,7 @@ async function handleMarketplaceUpdate(db, storage, sandboxRunner, marketplaceUr
|
|
|
3145
3029
|
mcpToolsEnabled: false,
|
|
3146
3030
|
mcpToolsConsent: null
|
|
3147
3031
|
});
|
|
3032
|
+
await syncDeclaredStorageIndexes(db, [bundle.manifest]);
|
|
3148
3033
|
deleteBundleFromR2(storage, pluginId, oldVersion).catch(() => {});
|
|
3149
3034
|
return {
|
|
3150
3035
|
success: true,
|
|
@@ -3199,6 +3084,9 @@ async function handleMarketplaceUninstall(db, storage, pluginId, opts) {
|
|
|
3199
3084
|
await db.deleteFrom("_plugin_storage").where("plugin_id", "=", pluginId).execute();
|
|
3200
3085
|
dataDeleted = true;
|
|
3201
3086
|
} catch {}
|
|
3087
|
+
try {
|
|
3088
|
+
await removeAllPluginIndexes(db, pluginId);
|
|
3089
|
+
} catch {}
|
|
3202
3090
|
await stateRepo.delete(pluginId);
|
|
3203
3091
|
return {
|
|
3204
3092
|
success: true,
|
|
@@ -4360,6 +4248,7 @@ async function handleRegistryInstall(db, storage, sandboxRunner, registryConfigI
|
|
|
4360
4248
|
}
|
|
4361
4249
|
throw stateErr;
|
|
4362
4250
|
}
|
|
4251
|
+
await syncDeclaredStorageIndexes(db, [bundle.manifest]);
|
|
4363
4252
|
return {
|
|
4364
4253
|
success: true,
|
|
4365
4254
|
data: {
|
|
@@ -4431,6 +4320,9 @@ async function handleRegistryUninstall(db, storage, pluginId, opts) {
|
|
|
4431
4320
|
dataDeleted = true;
|
|
4432
4321
|
}
|
|
4433
4322
|
if (storage) await deleteBundleFromR2(storage, pluginId, version, "registry");
|
|
4323
|
+
try {
|
|
4324
|
+
await removeAllPluginIndexes(db, pluginId);
|
|
4325
|
+
} catch {}
|
|
4434
4326
|
await stateRepo.delete(pluginId);
|
|
4435
4327
|
return {
|
|
4436
4328
|
success: true,
|
|
@@ -4673,6 +4565,7 @@ async function handleRegistryUpdate(db, storage, sandboxRunner, registryConfigIn
|
|
|
4673
4565
|
mcpToolsEnabled: false,
|
|
4674
4566
|
mcpToolsConsent: null
|
|
4675
4567
|
});
|
|
4568
|
+
await syncDeclaredStorageIndexes(db, [bundle.manifest]);
|
|
4676
4569
|
deleteBundleFromR2(storage, pluginId, oldVersion, "registry").catch(() => {});
|
|
4677
4570
|
return {
|
|
4678
4571
|
success: true,
|
|
@@ -4798,5 +4691,5 @@ async function handleRegistryUpdateCheck(db, registryConfigInput) {
|
|
|
4798
4691
|
}
|
|
4799
4692
|
|
|
4800
4693
|
//#endregion
|
|
4801
|
-
export {
|
|
4802
|
-
//# sourceMappingURL=api-
|
|
4694
|
+
export { handleContentUnschedule as $, handleMediaUpdate as A, handleContentDelete as B, handlePluginEnable as C, handleMediaDelete as D, handleMediaCreate as E, handleContentAuthors as F, handleContentList as G, handleContentDuplicate as H, handleContentCompare as I, handleContentPublish as J, handleContentListTrashed as K, handleContentCountScheduled as L, handleRevisionList as M, handleRevisionRestore as N, handleMediaGet as O, generateManifest as P, handleContentUnpublish as Q, handleContentCountTrashed as R, handlePluginDisable as S, handlePluginList as T, handleContentGet as U, handleContentDiscardDraft as V, handleContentGetIncludingTrashed as W, handleContentSchedule as X, handleContentRestore as Y, handleContentTranslations as Z, loadBundleFromR2 as _, handleRegistryUpdateCheck as a, handlePluginSettingsGet as b, validateAggregatorUrl as c, handleMarketplaceSearch as d, handleContentUpdate as et, handleMarketplaceUninstall as f, handleThemeSearch as g, handleThemeGetDetail as h, handleRegistryUpdate as i, handleRevisionGet as j, handleMediaList as k, handleMarketplaceGetPlugin as l, handleMarketplaceUpdateCheck as m, handleRegistryInstall as n, coerceRegistryConfig as o, handleMarketplaceUpdate as p, handleContentPermanentDelete as q, handleRegistryUninstall as r, normalizeRegistryConfig as s, assertSafeArtifactUrl as t, validateRev as tt, handleMarketplaceInstall as u, syncDeclaredStorageIndexes as v, handlePluginGet as w, handlePluginSettingsUpdate as x, getPluginSettingsSchema as y, handleContentCreate as z };
|
|
4695
|
+
//# sourceMappingURL=api-DdAsirBe.mjs.map
|