emdash 0.39.1 → 0.40.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/action-token-DYwe4Pk0.mjs +26 -0
- package/dist/action-token-DYwe4Pk0.mjs.map +1 -0
- package/dist/activation-LOkDM5WT.mjs +382 -0
- package/dist/activation-LOkDM5WT.mjs.map +1 -0
- package/dist/adapters-B64LbYcB.d.mts +171 -0
- package/dist/adapters-B64LbYcB.d.mts.map +1 -0
- package/dist/allowed-origins-CHB8oZNM.mjs +116 -0
- package/dist/allowed-origins-CHB8oZNM.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -4
- package/dist/api/route-utils.mjs +49 -40
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +11 -7
- package/dist/api-cFFZpyS0.mjs +4718 -0
- package/dist/api-cFFZpyS0.mjs.map +1 -0
- package/dist/api-tokens-CE1ECIg0.mjs +3 -0
- package/dist/api-tokens-s4i4aUp_.mjs +166 -0
- package/dist/api-tokens-s4i4aUp_.mjs.map +1 -0
- package/dist/apply-CoT603H3.mjs +1163 -0
- package/dist/apply-CoT603H3.mjs.map +1 -0
- package/dist/approvals-CqMfNxak.mjs +460 -0
- package/dist/approvals-CqMfNxak.mjs.map +1 -0
- package/dist/artifact-fetch-DZMOGZ3-.mjs +818 -0
- package/dist/artifact-fetch-DZMOGZ3-.mjs.map +1 -0
- package/dist/astro/index.d.mts +14 -14
- package/dist/astro/index.mjs +62 -12
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +14 -12
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +26 -11
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts +9 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +95 -13
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +8 -8
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +145 -47
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +129 -123
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +14 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +14 -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 -3
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +17 -11
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +17 -11
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +17 -11
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +19 -13
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -5
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -12
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +7 -5
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +18 -12
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +21 -15
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +26 -15
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +32 -19
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +10 -8
- 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 +10 -8
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +72 -62
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -4
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +71 -61
- 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 +74 -64
- 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 +84 -74
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +72 -62
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +71 -61
- 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 +83 -73
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +71 -61
- 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 +74 -64
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +85 -75
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +8 -6
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +76 -66
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +221 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +72 -62
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +71 -61
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +6 -4
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +71 -61
- 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 -2
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +71 -61
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/_...path_.d.mts +12 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +144 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +69 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +69 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +91 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +78 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +77 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +77 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +99 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +14 -8
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +16 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +14 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -3
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +19 -13
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +24 -12
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +18 -12
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -2
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.mjs +29 -15
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts +2 -1
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +37 -17
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +15 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -2
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
- 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 +14 -8
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +21 -24
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +18 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +19 -13
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +19 -13
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +19 -13
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +18 -12
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -11
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +21 -15
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +68 -16
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +18 -13
- 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 +31 -22
- 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 +31 -22
- 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 +4 -3
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +18 -13
- 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 +38 -19
- 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 -2
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +15 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +15 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +11 -9
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -2
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -1
- package/dist/astro/routes/api/health.mjs +5 -3
- package/dist/astro/routes/api/health.mjs.map +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +27 -21
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -3
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress/execute.mjs +18 -16
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs +19 -13
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +18 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +5 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +4 -2
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +29 -15
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +27 -21
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +38 -32
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +6 -4
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +717 -67
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +19 -13
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/replace.mjs +16 -10
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +8 -6
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/usage.mjs +34 -21
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +37 -26
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +5 -3
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +31 -2
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/_id_.mjs +16 -10
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/index.mjs +16 -10
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/index.mjs +4 -2
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/upload-url.mjs +18 -12
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +36 -24
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +18 -12
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +9 -6
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -5
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -8
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -7
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/register.mjs +4 -2
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -5
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token.mjs +7 -5
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -1
- package/dist/astro/routes/api/openapi.json.mjs +497 -12
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +10 -8
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +21 -15
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +21 -15
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +21 -15
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +21 -15
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +31 -22
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +21 -16
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +31 -22
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -2
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +102 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts +8 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +96 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/block-types/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs +102 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +71 -61
- 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 +71 -61
- 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 +71 -61
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +71 -61
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +71 -61
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -61
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +17 -14
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +71 -61
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +71 -61
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +20 -14
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +19 -13
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +20 -14
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +10 -8
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +19 -13
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +19 -13
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +19 -13
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -7
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -6
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/export.mjs +8 -7
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/index.mjs +9 -8
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +6 -4
- package/dist/astro/routes/api/settings/email.mjs.map +1 -1
- package/dist/astro/routes/api/settings.mjs +25 -19
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +20 -14
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +19 -13
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +43 -37
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -2
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +48 -38
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -3
- package/dist/astro/routes/api/setup/status.mjs.map +1 -1
- package/dist/astro/routes/api/snapshot.mjs +10 -8
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +24 -18
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +295 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +7 -5
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
- package/dist/astro/routes/api/typegen.d.mts.map +1 -1
- package/dist/astro/routes/api/typegen.mjs +12 -9
- package/dist/astro/routes/api/typegen.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/action-token.mjs +7 -5
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +22 -16
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +3 -1
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -1
- 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 +16 -10
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +20 -14
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +20 -14
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +10 -8
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +20 -14
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -2
- package/dist/astro/routes/api/widget-components.mjs.map +1 -1
- package/dist/astro/routes/robots.txt.mjs +10 -10
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -13
- package/dist/astro/routes/sitemap.xml.mjs +11 -11
- package/dist/astro/types.d.mts +21 -17
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-RfCugiSB.mjs +127 -0
- package/dist/audit-RfCugiSB.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/authoritative-records-CoJvBXAD.mjs +5172 -0
- package/dist/authoritative-records-CoJvBXAD.mjs.map +1 -0
- package/dist/authorize-seCifOMJ.mjs +49 -0
- package/dist/authorize-seCifOMJ.mjs.map +1 -0
- package/dist/backup-CBu0LrXf.mjs +246 -0
- package/dist/backup-CBu0LrXf.mjs.map +1 -0
- package/dist/block-type-registry-DUI_3KxT.mjs +6709 -0
- package/dist/block-type-registry-DUI_3KxT.mjs.map +1 -0
- package/dist/block-types-BmZmLmAD.mjs +132 -0
- package/dist/block-types-BmZmLmAD.mjs.map +1 -0
- package/dist/block-values-C_VIPr5t.mjs +175 -0
- package/dist/block-values-C_VIPr5t.mjs.map +1 -0
- package/dist/byline-DYmkXqvo.mjs +909 -0
- package/dist/byline-DYmkXqvo.mjs.map +1 -0
- package/dist/byline-fields-D28AT-Fh.mjs +123 -0
- package/dist/byline-fields-D28AT-Fh.mjs.map +1 -0
- package/dist/byline-registry-gnKscbQX.mjs +406 -0
- package/dist/byline-registry-gnKscbQX.mjs.map +1 -0
- package/dist/bylines-BPwJqoYH.mjs +232 -0
- package/dist/bylines-BPwJqoYH.mjs.map +1 -0
- package/dist/bylines-ukLaYpVZ.mjs +214 -0
- package/dist/bylines-ukLaYpVZ.mjs.map +1 -0
- package/dist/cache-m7UEkRFV.mjs +108 -0
- package/dist/cache-m7UEkRFV.mjs.map +1 -0
- package/dist/canonical-YhEQezjg.mjs +174 -0
- package/dist/canonical-YhEQezjg.mjs.map +1 -0
- package/dist/capture-triggers-kJyl_yyM.mjs +362 -0
- package/dist/capture-triggers-kJyl_yyM.mjs.map +1 -0
- package/dist/challenge-store-ppU6Uv13.mjs +51 -0
- package/dist/challenge-store-ppU6Uv13.mjs.map +1 -0
- package/dist/checksum-B2IINIlN.mjs +162 -0
- package/dist/checksum-B2IINIlN.mjs.map +1 -0
- package/dist/chrome-tags-DApCQSIk.mjs +24 -0
- package/dist/chrome-tags-DApCQSIk.mjs.map +1 -0
- package/dist/chunks-Dms7Uxbt.mjs +25 -0
- package/dist/chunks-Dms7Uxbt.mjs.map +1 -0
- package/dist/cli/index.mjs +1471 -56
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1050 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +193 -11
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-BIm28mo3.mjs +436 -0
- package/dist/collection-deletion-BIm28mo3.mjs.map +1 -0
- package/dist/collection-deletion-processor-Br6rxs3u.mjs +217 -0
- package/dist/collection-deletion-processor-Br6rxs3u.mjs.map +1 -0
- package/dist/collection-slugs-cache-CjGk__zp.mjs +85 -0
- package/dist/collection-slugs-cache-CjGk__zp.mjs.map +1 -0
- package/dist/comment-CrBl22OF.mjs +313 -0
- package/dist/comment-CrBl22OF.mjs.map +1 -0
- package/dist/comment-reaction-JEQ2Fpd8.mjs +85 -0
- package/dist/comment-reaction-JEQ2Fpd8.mjs.map +1 -0
- package/dist/comments-2ah9du9y.mjs +195 -0
- package/dist/comments-2ah9du9y.mjs.map +1 -0
- package/dist/comments-fHZ8ON9O.mjs +99 -0
- package/dist/comments-fHZ8ON9O.mjs.map +1 -0
- package/dist/components-CXbq7CSM.mjs +108 -0
- package/dist/components-CXbq7CSM.mjs.map +1 -0
- package/dist/config-5ii2haYu.d.mts +6528 -0
- package/dist/config-5ii2haYu.d.mts.map +1 -0
- package/dist/config-CvmjJcVw.mjs +73 -0
- package/dist/config-CvmjJcVw.mjs.map +1 -0
- package/dist/config-IhybvkIQ.mjs +242 -0
- package/dist/config-IhybvkIQ.mjs.map +1 -0
- package/dist/config-Py43JK9r.d.mts +39 -0
- package/dist/config-Py43JK9r.d.mts.map +1 -0
- package/dist/content-DFaIEDj9.mjs +2281 -0
- package/dist/content-DFaIEDj9.mjs.map +1 -0
- package/dist/content-list-query-Dra4Dalc.d.mts +26 -0
- package/dist/content-list-query-Dra4Dalc.d.mts.map +1 -0
- package/dist/content-policy-DFNw91-d.mjs +46 -0
- package/dist/content-policy-DFNw91-d.mjs.map +1 -0
- package/dist/content-repair-Q8IUrpLL.mjs +442 -0
- package/dist/content-repair-Q8IUrpLL.mjs.map +1 -0
- package/dist/context-BeGccdUX.mjs +1921 -0
- package/dist/context-BeGccdUX.mjs.map +1 -0
- package/dist/cron-7DCJwPXq.mjs +284 -0
- package/dist/cron-7DCJwPXq.mjs.map +1 -0
- package/dist/dashboard-DjrB-xxZ.mjs +151 -0
- package/dist/dashboard-DjrB-xxZ.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +3 -3
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +6 -6
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +6 -6
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +6 -6
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +2 -2
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/default-DQ6vsviu.mjs +81 -0
- package/dist/default-DQ6vsviu.mjs.map +1 -0
- package/dist/deferred-tasks-BPxXUB4x.d.mts +9 -0
- package/dist/deferred-tasks-BPxXUB4x.d.mts.map +1 -0
- package/dist/device-flow-CRd6DXmW.mjs +466 -0
- package/dist/device-flow-CRd6DXmW.mjs.map +1 -0
- package/dist/dialect-helpers-7_IqPdh9.mjs +307 -0
- package/dist/dialect-helpers-7_IqPdh9.mjs.map +1 -0
- package/dist/digest-BarSh-pN.mjs +194 -0
- package/dist/digest-BarSh-pN.mjs.map +1 -0
- package/dist/direct-executor-BmuFJJZV.mjs +104 -0
- package/dist/direct-executor-BmuFJJZV.mjs.map +1 -0
- package/dist/dist-BNwANFJR.mjs +810 -0
- package/dist/dist-BNwANFJR.mjs.map +1 -0
- package/dist/email-console-bJn3ctqA.mjs +50 -0
- package/dist/email-console-bJn3ctqA.mjs.map +1 -0
- package/dist/email-locale-CN6WAMx0.mjs +25 -0
- package/dist/email-locale-CN6WAMx0.mjs.map +1 -0
- package/dist/emdash-runtime-DAjghyEG.mjs +4186 -0
- package/dist/emdash-runtime-DAjghyEG.mjs.map +1 -0
- package/dist/enrich-Dl3kZ-lP.mjs +194 -0
- package/dist/enrich-Dl3kZ-lP.mjs.map +1 -0
- package/dist/entry-lock-BJYdBfXb.mjs +1097 -0
- package/dist/entry-lock-BJYdBfXb.mjs.map +1 -0
- package/dist/entry-lock-DHQOxN7R.mjs +163 -0
- package/dist/entry-lock-DHQOxN7R.mjs.map +1 -0
- package/dist/entry-lock-DVhCt49A.d.mts +4368 -0
- package/dist/entry-lock-DVhCt49A.d.mts.map +1 -0
- package/dist/entry-locks-D0foLdjQ.mjs +167 -0
- package/dist/entry-locks-D0foLdjQ.mjs.map +1 -0
- package/dist/error-CfvOHP0M.mjs +90 -0
- package/dist/error-CfvOHP0M.mjs.map +1 -0
- package/dist/errors-BF0_LFhW.mjs +460 -0
- package/dist/errors-BF0_LFhW.mjs.map +1 -0
- package/dist/errors-DgE1zJGG.mjs +120 -0
- package/dist/errors-DgE1zJGG.mjs.map +1 -0
- package/dist/escape-CuaZhZvL.mjs +9 -0
- package/dist/escape-CuaZhZvL.mjs.map +1 -0
- package/dist/fence-CMDXJYc_.mjs +162 -0
- package/dist/fence-CMDXJYc_.mjs.map +1 -0
- package/dist/field-defs-cache-HIgBbqZZ.mjs +77 -0
- package/dist/field-defs-cache-HIgBbqZZ.mjs.map +1 -0
- package/dist/fts-manager-S-K0laoS.mjs +443 -0
- package/dist/fts-manager-S-K0laoS.mjs.map +1 -0
- package/dist/gc-DjKY0Ay1.mjs +75 -0
- package/dist/gc-DjKY0Ay1.mjs.map +1 -0
- package/dist/hash-SDAW6zC-.mjs +37 -0
- package/dist/hash-SDAW6zC-.mjs.map +1 -0
- package/dist/hook-result-B5bXDgS2.d.mts +31 -0
- package/dist/hook-result-B5bXDgS2.d.mts.map +1 -0
- package/dist/hreflang-D5uNnsGJ.d.mts +50 -0
- package/dist/hreflang-D5uNnsGJ.d.mts.map +1 -0
- package/dist/hreflang-DMFBL2eb.mjs +105 -0
- package/dist/hreflang-DMFBL2eb.mjs.map +1 -0
- package/dist/http-route-dispatch-BitqzwMy.mjs +339 -0
- package/dist/http-route-dispatch-BitqzwMy.mjs.map +1 -0
- package/dist/identity-IyNWwXr6.mjs +35 -0
- package/dist/identity-IyNWwXr6.mjs.map +1 -0
- package/dist/import-C3JZplWq.mjs +2020 -0
- package/dist/import-C3JZplWq.mjs.map +1 -0
- package/dist/index-D-hdtLe8.d.mts +623 -0
- package/dist/index-D-hdtLe8.d.mts.map +1 -0
- package/dist/index.d.mts +24 -24
- package/dist/index.mjs +105 -93
- package/dist/install-finalization-DfM1fj5x.mjs +58 -0
- package/dist/install-finalization-DfM1fj5x.mjs.map +1 -0
- package/dist/keys-yxLm5l35.mjs +61 -0
- package/dist/keys-yxLm5l35.mjs.map +1 -0
- package/dist/kinds-CRu_T5T5.mjs +961 -0
- package/dist/kinds-CRu_T5T5.mjs.map +1 -0
- package/dist/lifecycle-BzeGPeQ-.mjs +25 -0
- package/dist/lifecycle-BzeGPeQ-.mjs.map +1 -0
- package/dist/load-XgJiE6_3.mjs +28 -0
- package/dist/load-XgJiE6_3.mjs.map +1 -0
- package/dist/loader-BzqeR1ZN.mjs +1086 -0
- package/dist/loader-BzqeR1ZN.mjs.map +1 -0
- package/dist/loops-BQSzv5Zn.mjs +203 -0
- package/dist/loops-BQSzv5Zn.mjs.map +1 -0
- package/dist/manifest-builder-B8zR-73J.mjs +189 -0
- package/dist/manifest-builder-B8zR-73J.mjs.map +1 -0
- package/dist/manifest-schema-CY3zng_M.mjs +492 -0
- package/dist/manifest-schema-CY3zng_M.mjs.map +1 -0
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +3 -3
- package/dist/media/local-runtime.d.mts +14 -14
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +15 -16
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-Pu1L6xir.mjs +408 -0
- package/dist/media-Pu1L6xir.mjs.map +1 -0
- package/dist/media-Qp5S3eH3.mjs +355 -0
- package/dist/media-Qp5S3eH3.mjs.map +1 -0
- package/dist/media-allowlist-BSoa9Vvm.mjs +44 -0
- package/dist/media-allowlist-BSoa9Vvm.mjs.map +1 -0
- package/dist/media-folders-BE0oo2eX.mjs +210 -0
- package/dist/media-folders-BE0oo2eX.mjs.map +1 -0
- package/dist/media-h7tOiDLj.mjs +221 -0
- package/dist/media-h7tOiDLj.mjs.map +1 -0
- package/dist/media-url-jArBpzIG.mjs +43 -0
- package/dist/media-url-jArBpzIG.mjs.map +1 -0
- package/dist/media-usage-My-Vi-ex.mjs +1629 -0
- package/dist/media-usage-My-Vi-ex.mjs.map +1 -0
- package/dist/media-usage-activation-HKp7zk7W.mjs +78 -0
- package/dist/media-usage-activation-HKp7zk7W.mjs.map +1 -0
- package/dist/media-usage-work-C2OZLCAd.mjs +586 -0
- package/dist/media-usage-work-C2OZLCAd.mjs.map +1 -0
- package/dist/media-usage-work-DwUNbgvS.mjs +152 -0
- package/dist/media-usage-work-DwUNbgvS.mjs.map +1 -0
- package/dist/menus-BM7BPLOb.mjs +139 -0
- package/dist/menus-BM7BPLOb.mjs.map +1 -0
- package/dist/menus-ITeAbcIF.mjs +753 -0
- package/dist/menus-ITeAbcIF.mjs.map +1 -0
- package/dist/menus-TsSGmSR4.mjs +3608 -0
- package/dist/menus-TsSGmSR4.mjs.map +1 -0
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +5 -5
- package/dist/mime-ChLqYwDk.mjs +36 -0
- package/dist/mime-ChLqYwDk.mjs.map +1 -0
- package/dist/mode-CCuKXUci.mjs +23 -0
- package/dist/mode-CCuKXUci.mjs.map +1 -0
- package/dist/node-sqlite-compat-CONMsl-x.mjs +46 -0
- package/dist/node-sqlite-compat-CONMsl-x.mjs.map +1 -0
- package/dist/normalize-CO2P8-iE.mjs +191 -0
- package/dist/normalize-CO2P8-iE.mjs.map +1 -0
- package/dist/oauth-authorization-DlMIL5_h.mjs +274 -0
- package/dist/oauth-authorization-DlMIL5_h.mjs.map +1 -0
- package/dist/oauth-clients-Djq9r_KP.mjs +266 -0
- package/dist/oauth-clients-Djq9r_KP.mjs.map +1 -0
- package/dist/oauth-state-store-BbjnZXNC.mjs +50 -0
- package/dist/oauth-state-store-BbjnZXNC.mjs.map +1 -0
- package/dist/oauth-user-lookup-vue9a64A.mjs +26 -0
- package/dist/oauth-user-lookup-vue9a64A.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/object-cache-CqWNY5uP.mjs +582 -0
- package/dist/object-cache-CqWNY5uP.mjs.map +1 -0
- package/dist/options-DhrI7eMv.mjs +208 -0
- package/dist/options-DhrI7eMv.mjs.map +1 -0
- package/dist/options-SQCHQCPH.d.mts +81 -0
- package/dist/options-SQCHQCPH.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +9 -9
- package/dist/parse-CVgO-Qai.d.mts +168 -0
- package/dist/parse-CVgO-Qai.d.mts.map +1 -0
- package/dist/parse-DY6OD1j_.mjs +81 -0
- package/dist/parse-DY6OD1j_.mjs.map +1 -0
- package/dist/passkey-config-X_H8128a.mjs +46 -0
- package/dist/passkey-config-X_H8128a.mjs.map +1 -0
- package/dist/paths-JxokKIbr.mjs +77 -0
- package/dist/paths-JxokKIbr.mjs.map +1 -0
- package/dist/patterns-BhAvqO0S.mjs +145 -0
- package/dist/patterns-BhAvqO0S.mjs.map +1 -0
- package/dist/placeholder-MSEd8gty.d.mts +306 -0
- package/dist/placeholder-MSEd8gty.d.mts.map +1 -0
- package/dist/plan-xjcWrAah.mjs +135 -0
- package/dist/plan-xjcWrAah.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +38 -15
- package/dist/plugin-test-runtime.d.mts.map +1 -1
- package/dist/plugin-test-runtime.mjs +112 -100
- package/dist/plugin-types.d.mts +2 -2
- package/dist/plugin-utils.d.mts +12 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts +12 -12
- package/dist/plugins/adapt-sandbox-entry.mjs +3 -3
- package/dist/plugins/host.d.mts +5 -5
- package/dist/plugins/host.mjs +45 -37
- package/dist/plugins-DUXUt8B9.mjs +277 -0
- package/dist/plugins-DUXUt8B9.mjs.map +1 -0
- package/dist/policy-CUvwAARc.mjs +45 -0
- package/dist/policy-CUvwAARc.mjs.map +1 -0
- package/dist/portable-text-5O_ZGUjB.mjs +307 -0
- package/dist/portable-text-5O_ZGUjB.mjs.map +1 -0
- package/dist/preview-CIUcPYr6.mjs +107 -0
- package/dist/preview-CIUcPYr6.mjs.map +1 -0
- package/dist/protocol-B97DZaFr.d.mts +61 -0
- package/dist/protocol-B97DZaFr.d.mts.map +1 -0
- package/dist/public-submission-BFBUrqst.mjs +250 -0
- package/dist/public-submission-BFBUrqst.mjs.map +1 -0
- package/dist/public-url-Bn7U0D7-.mjs +101 -0
- package/dist/public-url-Bn7U0D7-.mjs.map +1 -0
- package/dist/query-B48peoRT.mjs +890 -0
- package/dist/query-B48peoRT.mjs.map +1 -0
- package/dist/query-C4IH0uhR.mjs +41 -0
- package/dist/query-C4IH0uhR.mjs.map +1 -0
- package/dist/rate-limit-BZ6nybgc.mjs +120 -0
- package/dist/rate-limit-BZ6nybgc.mjs.map +1 -0
- package/dist/receipt-B4wJj5Jq.mjs +43 -0
- package/dist/receipt-B4wJj5Jq.mjs.map +1 -0
- package/dist/redirect-Cd1E7VUt.mjs +17 -0
- package/dist/redirect-Cd1E7VUt.mjs.map +1 -0
- package/dist/redirect-iJf5fltD.mjs +415 -0
- package/dist/redirect-iJf5fltD.mjs.map +1 -0
- package/dist/redirects-CYu1u1aK.mjs +446 -0
- package/dist/redirects-CYu1u1aK.mjs.map +1 -0
- package/dist/redirects-Cv9apQKj.mjs +148 -0
- package/dist/redirects-Cv9apQKj.mjs.map +1 -0
- package/dist/registry/testing.mjs +3 -3
- package/dist/relation-M4NUCb0b.mjs +334 -0
- package/dist/relation-M4NUCb0b.mjs.map +1 -0
- package/dist/relations-CCif47Oq.mjs +403 -0
- package/dist/relations-CCif47Oq.mjs.map +1 -0
- package/dist/relations-CK9CYUyr.mjs +310 -0
- package/dist/relations-CK9CYUyr.mjs.map +1 -0
- package/dist/request-cache-DzLYKm_x.mjs +104 -0
- package/dist/request-cache-DzLYKm_x.mjs.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/request-meta-sZXt3sRo.mjs +141 -0
- package/dist/request-meta-sZXt3sRo.mjs.map +1 -0
- package/dist/resolve-2WbQsCvT.mjs +199 -0
- package/dist/resolve-2WbQsCvT.mjs.map +1 -0
- package/dist/route-wire--1hLuACz.mjs +197 -0
- package/dist/route-wire--1hLuACz.mjs.map +1 -0
- package/dist/routes-CUsM40Cc.mjs +272 -0
- package/dist/routes-CUsM40Cc.mjs.map +1 -0
- package/dist/runner-1y4J9fJB.mjs +5742 -0
- package/dist/runner-1y4J9fJB.mjs.map +1 -0
- package/dist/runner-D5_LzKXI.d.mts +68 -0
- package/dist/runner-D5_LzKXI.d.mts.map +1 -0
- package/dist/runtime.d.mts +13 -13
- package/dist/runtime.mjs +4 -4
- package/dist/schema-BABiRdsH.mjs +13 -0
- package/dist/schema-BABiRdsH.mjs.map +1 -0
- package/dist/schema-Du3MzCG0.mjs +446 -0
- package/dist/schema-Du3MzCG0.mjs.map +1 -0
- package/dist/scopes-Dbk-ElhT.mjs +34 -0
- package/dist/scopes-Dbk-ElhT.mjs.map +1 -0
- package/dist/search-Bt1PL1jf.mjs +448 -0
- package/dist/search-Bt1PL1jf.mjs.map +1 -0
- package/dist/secrets-CIi0nFiR.mjs +341 -0
- package/dist/secrets-CIi0nFiR.mjs.map +1 -0
- package/dist/sections-Ddptx_o9.mjs +346 -0
- package/dist/sections-Ddptx_o9.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +35 -30
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +25 -21
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-CZT2oLtT.mjs +114 -0
- package/dist/seo-CZT2oLtT.mjs.map +1 -0
- package/dist/seo-D5w3-Azy.mjs +133 -0
- package/dist/seo-D5w3-Azy.mjs.map +1 -0
- package/dist/service-DuykXPyW.mjs +150 -0
- package/dist/service-DuykXPyW.mjs.map +1 -0
- package/dist/session-user-BhaVp8w0.mjs +51 -0
- package/dist/session-user-BhaVp8w0.mjs.map +1 -0
- package/dist/settings-2xNYr90o.mjs +51 -0
- package/dist/settings-2xNYr90o.mjs.map +1 -0
- package/dist/settings-CgjRWGW9.mjs +439 -0
- package/dist/settings-CgjRWGW9.mjs.map +1 -0
- package/dist/settings-DYidIB26.mjs +61 -0
- package/dist/settings-DYidIB26.mjs.map +1 -0
- package/dist/setup-complete-bOogcHWG.mjs +26 -0
- package/dist/setup-complete-bOogcHWG.mjs.map +1 -0
- package/dist/setup-nonce-0EGuKM4s.mjs +25 -0
- package/dist/setup-nonce-0EGuKM4s.mjs.map +1 -0
- package/dist/site-settings-DOgRUoFX.mjs +50 -0
- package/dist/site-settings-DOgRUoFX.mjs.map +1 -0
- package/dist/site-url-BU_bbxwj.mjs +16 -0
- package/dist/site-url-BU_bbxwj.mjs.map +1 -0
- package/dist/snapshot-CugwUqKQ.mjs +237 -0
- package/dist/snapshot-CugwUqKQ.mjs.map +1 -0
- package/dist/ssrf-CJUnJymJ.mjs +406 -0
- package/dist/ssrf-CJUnJymJ.mjs.map +1 -0
- package/dist/stage-DgrBz_du.mjs +662 -0
- package/dist/stage-DgrBz_du.mjs.map +1 -0
- package/dist/state-DDiPySSG.mjs +153 -0
- package/dist/state-DDiPySSG.mjs.map +1 -0
- package/dist/status-DZKIG4a9.mjs +30 -0
- package/dist/status-DZKIG4a9.mjs.map +1 -0
- 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/storage-query-Bdv7A62k.d.mts +1576 -0
- package/dist/storage-query-Bdv7A62k.d.mts.map +1 -0
- package/dist/tar-_1AgTYFu.mjs +449 -0
- package/dist/tar-_1AgTYFu.mjs.map +1 -0
- package/dist/target-_7pn2Gbg.mjs +27 -0
- package/dist/target-_7pn2Gbg.mjs.map +1 -0
- package/dist/taxonomies-C1IwNe8Q.mjs +697 -0
- package/dist/taxonomies-C1IwNe8Q.mjs.map +1 -0
- package/dist/taxonomies-C_XMoRcX.mjs +939 -0
- package/dist/taxonomies-C_XMoRcX.mjs.map +1 -0
- package/dist/taxonomy-C3Fu1YeH.mjs +525 -0
- package/dist/taxonomy-C3Fu1YeH.mjs.map +1 -0
- package/dist/tokens-u78jETkX.mjs +171 -0
- package/dist/tokens-u78jETkX.mjs.map +1 -0
- package/dist/transfer-BhUCrgDc.mjs +8675 -0
- package/dist/transfer-BhUCrgDc.mjs.map +1 -0
- package/dist/transfer-DIGvR9Af.mjs +166 -0
- package/dist/transfer-DIGvR9Af.mjs.map +1 -0
- package/dist/transfer-download-Pml7RMio.mjs +33 -0
- package/dist/transfer-download-Pml7RMio.mjs.map +1 -0
- package/dist/transformations-9gfpwY65.mjs +196 -0
- package/dist/transformations-9gfpwY65.mjs.map +1 -0
- package/dist/transport-BIfH7_hx.d.mts +42 -0
- package/dist/transport-BIfH7_hx.d.mts.map +1 -0
- package/dist/transport-DKWIq53q.mjs +136 -0
- package/dist/transport-DKWIq53q.mjs.map +1 -0
- package/dist/trusted-proxy-tKiVtyTD.mjs +51 -0
- package/dist/trusted-proxy-tKiVtyTD.mjs.map +1 -0
- package/dist/turnstile-DpsoyOfg.mjs +53 -0
- package/dist/turnstile-DpsoyOfg.mjs.map +1 -0
- package/dist/types-B4sUC2p1.d.mts +198 -0
- package/dist/types-B4sUC2p1.d.mts.map +1 -0
- package/dist/types-B7Lmsh1E.d.mts +887 -0
- package/dist/types-B7Lmsh1E.d.mts.map +1 -0
- package/dist/types-BZakh7Ym.mjs +22 -0
- package/dist/types-BZakh7Ym.mjs.map +1 -0
- package/dist/types-B_CppEmv.d.mts +264 -0
- package/dist/types-B_CppEmv.d.mts.map +1 -0
- package/dist/types-BcrBrE6-.mjs +159 -0
- package/dist/types-BcrBrE6-.mjs.map +1 -0
- package/dist/types-CAZgq9fO.d.mts +124 -0
- package/dist/types-CAZgq9fO.d.mts.map +1 -0
- package/dist/types-Cd-O03VG.d.mts +363 -0
- package/dist/types-Cd-O03VG.d.mts.map +1 -0
- package/dist/types-Cr-Kg-3D.d.mts +1641 -0
- package/dist/types-Cr-Kg-3D.d.mts.map +1 -0
- package/dist/types-D2fvWd1i.d.mts +359 -0
- package/dist/types-D2fvWd1i.d.mts.map +1 -0
- package/dist/types-D7HUsguf.mjs +77 -0
- package/dist/types-D7HUsguf.mjs.map +1 -0
- package/dist/types-DA1Te3Oy.d.mts +198 -0
- package/dist/types-DA1Te3Oy.d.mts.map +1 -0
- package/dist/types-DhV6Q5bP.mjs +18 -0
- package/dist/types-DhV6Q5bP.mjs.map +1 -0
- package/dist/types-DnnVSl6Y.d.mts +85 -0
- package/dist/types-DnnVSl6Y.d.mts.map +1 -0
- package/dist/types-VT4-BugW.mjs +16 -0
- package/dist/types-VT4-BugW.mjs.map +1 -0
- package/dist/upload-attempts-B68ZGNu9.mjs +32 -0
- package/dist/upload-attempts-B68ZGNu9.mjs.map +1 -0
- package/dist/url-pattern-CCeZMGOh.mjs +33 -0
- package/dist/url-pattern-CCeZMGOh.mjs.map +1 -0
- package/dist/user-DDSL-sGw.mjs +171 -0
- package/dist/user-DDSL-sGw.mjs.map +1 -0
- package/dist/utils-DdhmO9w9.mjs +439 -0
- package/dist/utils-DdhmO9w9.mjs.map +1 -0
- package/dist/validate-CHosPEhs.mjs +453 -0
- package/dist/validate-CHosPEhs.mjs.map +1 -0
- package/dist/validate-CM79QXYE.d.mts +432 -0
- package/dist/validate-CM79QXYE.d.mts.map +1 -0
- package/dist/validation-BFecQczG.mjs +218 -0
- package/dist/validation-BFecQczG.mjs.map +1 -0
- package/dist/version-BRZXVifl.mjs +9 -0
- package/dist/version-BRZXVifl.mjs.map +1 -0
- package/dist/version-DUQDHgrf.mjs +7 -0
- package/dist/version-DUQDHgrf.mjs.map +1 -0
- package/dist/widgets-WdV72brA.mjs +126 -0
- package/dist/widgets-WdV72brA.mjs.map +1 -0
- package/dist/wxr-taxonomies-BHTdqkmZ.d.mts +34 -0
- package/dist/wxr-taxonomies-BHTdqkmZ.d.mts.map +1 -0
- package/dist/wxr-taxonomies-DP6ESgMN.mjs +372 -0
- package/dist/wxr-taxonomies-DP6ESgMN.mjs.map +1 -0
- package/dist/zod-generator-D6uE4WiS.mjs +389 -0
- package/dist/zod-generator-D6uE4WiS.mjs.map +1 -0
- package/package.json +6 -5
- package/src/api/authorize.ts +17 -0
- package/src/api/email-locale.ts +24 -0
- package/src/api/errors.ts +16 -0
- package/src/api/handlers/api-tokens.ts +18 -3
- package/src/api/handlers/block-types.ts +129 -0
- package/src/api/handlers/bulk-tag.ts +309 -0
- package/src/api/handlers/comments.ts +0 -28
- package/src/api/handlers/index.ts +10 -0
- package/src/api/handlers/manifest.ts +8 -1
- package/src/api/handlers/marketplace.ts +22 -16
- package/src/api/handlers/media-usage.ts +31 -12
- package/src/api/handlers/media.ts +19 -14
- package/src/api/handlers/schema.ts +33 -8
- package/src/api/handlers/settings.ts +2 -2
- package/src/api/handlers/snapshot.ts +4 -0
- package/src/api/handlers/taxonomies.ts +132 -83
- package/src/api/handlers/transfer.ts +1347 -0
- package/src/api/handlers/validate-media-fields.ts +124 -12
- package/src/api/media-usage-write-fence.ts +5 -26
- package/src/api/openapi/document.ts +614 -5
- package/src/api/schemas/auth.ts +7 -1
- package/src/api/schemas/common.ts +5 -0
- package/src/api/schemas/content.ts +20 -1
- package/src/api/schemas/media-usage.ts +11 -0
- package/src/api/schemas/menus.ts +1 -1
- package/src/api/schemas/schema.ts +117 -0
- package/src/api/schemas/settings.ts +3 -3
- package/src/api/schemas/taxonomies.ts +18 -0
- package/src/api/schemas/transfer.ts +249 -0
- package/src/api/transfer-download.ts +36 -0
- package/src/api/types.ts +3 -0
- package/src/astro/integration/routes.ts +31 -0
- package/src/astro/integration/vite-config.ts +26 -0
- package/src/astro/middleware/auth.ts +30 -7
- package/src/astro/middleware/media-usage-write-fence.ts +106 -11
- package/src/astro/middleware/request-context.ts +16 -2
- package/src/astro/middleware.ts +38 -18
- package/src/astro/routes/admin.astro +3 -1
- package/src/astro/routes/api/admin/hooks/exclusive/index.ts +1 -5
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -3
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -3
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -3
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -3
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -3
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -3
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +3 -3
- package/src/astro/routes/api/admin/plugins/registry/install.ts +3 -3
- package/src/astro/routes/api/admin/plugins/registry/publisher-handle.ts +59 -0
- package/src/astro/routes/api/admin/transfer/[...path].ts +143 -0
- package/src/astro/routes/api/admin/transfer/approvals/[id]/approve.ts +35 -0
- package/src/astro/routes/api/admin/transfer/approvals/[id]/deny.ts +35 -0
- package/src/astro/routes/api/admin/transfer/approvals/index.ts +33 -0
- package/src/astro/routes/api/admin/transfer/capabilities.ts +36 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/advance.ts +34 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/archive.ts +35 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/files/[...path].ts +40 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/index.ts +25 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/manifest.ts +38 -0
- package/src/astro/routes/api/admin/transfer/exports/index.ts +64 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/abandon.ts +28 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/advance.ts +37 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/analyze.ts +51 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/cancel.ts +27 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/execute.ts +48 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/files/[...path].ts +54 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/index.ts +25 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/missing.ts +34 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/plan.ts +29 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/receipt.ts +25 -0
- package/src/astro/routes/api/admin/transfer/imports/index.ts +85 -0
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +9 -1
- package/src/astro/routes/api/auth/invite/index.ts +15 -1
- package/src/astro/routes/api/auth/magic-link/send.ts +9 -1
- package/src/astro/routes/api/auth/magic-link/verify.ts +37 -39
- package/src/astro/routes/api/auth/passkey/options.ts +2 -21
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +64 -13
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +16 -1
- package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +11 -4
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/media/[id].ts +5 -15
- package/src/astro/routes/api/media/file/[...key].ts +30 -5
- package/src/astro/routes/api/oauth/authorize.ts +4 -0
- package/src/astro/routes/api/schema/block-types/[slug]/index.ts +29 -0
- package/src/astro/routes/api/schema/block-types/[slug]/versions/[version]/activate.ts +31 -0
- package/src/astro/routes/api/schema/block-types/index.ts +29 -0
- package/src/astro/routes/api/taxonomies/bulk-tag.ts +29 -0
- package/src/astro/routes/api/typegen.ts +8 -4
- package/src/astro/types.ts +4 -0
- package/src/auth/api-tokens.ts +1 -0
- package/src/auth/rate-limit.ts +2 -1
- package/src/auth/scopes.ts +11 -0
- package/src/cleanup.ts +14 -0
- package/src/cli/client-factory.ts +6 -1
- package/src/cli/commands/export-seed.ts +41 -15
- package/src/cli/commands/seed.ts +6 -2
- package/src/cli/commands/site.ts +556 -0
- package/src/cli/index.ts +2 -0
- package/src/cli/site/archive.ts +273 -0
- package/src/cli/site/export.ts +311 -0
- package/src/cli/site/import.ts +815 -0
- package/src/cli/site/shared.ts +241 -0
- package/src/client/index.ts +414 -11
- package/src/client/portable-text.ts +41 -0
- package/src/comments/public-submission.ts +19 -11
- package/src/components/Blocks.astro +46 -0
- package/src/components/Gallery.astro +2 -1
- package/src/components/Image.astro +51 -6
- package/src/components/InlinePortableTextEditor.tsx +28 -18
- package/src/components/blocks.ts +44 -0
- package/src/components/index.ts +14 -4
- package/src/content/converters/gallery.ts +54 -16
- package/src/content/converters/image-link.ts +27 -0
- package/src/content/converters/index.ts +1 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +10 -7
- package/src/content/converters/prosemirror-to-portable-text.ts +14 -0
- package/src/content/converters/types.ts +17 -0
- package/src/database/content-datetime.ts +19 -2
- package/src/database/migrations/035_bounded_404_log.ts +28 -39
- package/src/database/migrations/083_block_types.ts +58 -0
- package/src/database/migrations/084_site_transfer.ts +264 -0
- package/src/database/migrations/085_taxonomy_def_groups.ts +155 -0
- package/src/database/migrations/runner.ts +6 -0
- package/src/database/repositories/audit.ts +10 -1
- package/src/database/repositories/byline.ts +4 -1
- package/src/database/repositories/content.ts +83 -11
- package/src/database/repositories/media-usage.ts +43 -13
- package/src/database/repositories/media.ts +32 -1
- package/src/database/repositories/options.ts +12 -0
- package/src/database/repositories/revision.ts +6 -3
- package/src/database/repositories/taxonomy-def.ts +126 -0
- package/src/database/repositories/taxonomy.ts +65 -26
- package/src/database/types.ts +133 -1
- package/src/db/sqlite.ts +1 -1
- package/src/emdash-runtime.ts +287 -51
- package/src/import/utils.ts +8 -1
- package/src/import/wxr-taxonomies.ts +11 -67
- package/src/index.ts +26 -1
- package/src/loader.ts +9 -5
- package/src/mcp/server.ts +521 -29
- package/src/mcp/transfer.ts +569 -0
- package/src/media/local-runtime.ts +5 -18
- package/src/media/upload-attempts.ts +5 -0
- package/src/media/url.ts +15 -0
- package/src/media/usage/content-fields.ts +69 -5
- package/src/media/usage/content-refresh.ts +13 -66
- package/src/media/usage/content-repair.ts +10 -2
- package/src/media/usage/extractor.ts +74 -3
- package/src/media/usage/projection-fingerprint.ts +14 -0
- package/src/media/usage/schema-invalidation.ts +72 -0
- package/src/media/usage/site-settings.ts +52 -0
- package/src/media/usage/types.ts +2 -0
- package/src/object-cache/index.ts +69 -4
- package/src/plugin-test-runtime.ts +1 -0
- package/src/plugins/context.ts +104 -56
- package/src/plugins/cron.ts +6 -4
- package/src/plugins/define-plugin.ts +11 -1
- package/src/plugins/email-console.ts +2 -0
- package/src/plugins/email.ts +16 -0
- package/src/plugins/hooks.ts +33 -9
- package/src/plugins/manifest-schema.ts +1 -0
- package/src/plugins/route-error.ts +57 -0
- package/src/plugins/routes.ts +5 -60
- package/src/plugins/sandbox/types.ts +22 -2
- package/src/plugins/types.ts +4 -0
- package/src/registry/artifact-fetch.ts +17 -4
- package/src/registry/publisher-handle.ts +273 -0
- package/src/schema/block-type-contract.ts +478 -0
- package/src/schema/block-type-registry.ts +689 -0
- package/src/schema/block-types.ts +110 -0
- package/src/schema/block-values.ts +293 -0
- package/src/schema/byline-registry.ts +1 -1
- package/src/schema/index.ts +28 -0
- package/src/schema/registry.ts +462 -12
- package/src/schema/types.ts +12 -1
- package/src/schema/zod-generator.ts +92 -9
- package/src/search/fts-manager.ts +40 -0
- package/src/seed/apply.ts +173 -49
- package/src/seed/types.ts +23 -3
- package/src/seed/validate.ts +131 -7
- package/src/settings/index.ts +32 -9
- package/src/settings/types.ts +15 -0
- package/src/taxonomies/index.ts +72 -83
- package/src/transfer/analyze/index.ts +45 -0
- package/src/transfer/analyze/issues.ts +55 -0
- package/src/transfer/analyze/plan.ts +327 -0
- package/src/transfer/analyze/read.ts +134 -0
- package/src/transfer/analyze/step.ts +551 -0
- package/src/transfer/analyze/target.ts +269 -0
- package/src/transfer/analyze/unique-keys.ts +228 -0
- package/src/transfer/analyze/validate.ts +1412 -0
- package/src/transfer/analyze/values.ts +227 -0
- package/src/transfer/analyze/write-rules.ts +196 -0
- package/src/transfer/audit.ts +38 -0
- package/src/transfer/auth.ts +25 -0
- package/src/transfer/container/tar.ts +242 -0
- package/src/transfer/domain.ts +248 -0
- package/src/transfer/errors.ts +134 -0
- package/src/transfer/export/exporter.ts +1067 -0
- package/src/transfer/export/fence.ts +84 -0
- package/src/transfer/export/media.ts +165 -0
- package/src/transfer/export/readers.ts +1164 -0
- package/src/transfer/export/verify.ts +677 -0
- package/src/transfer/fence.ts +193 -0
- package/src/transfer/format/canonical.ts +151 -0
- package/src/transfer/format/column-codec.ts +275 -0
- package/src/transfer/format/columns.ts +707 -0
- package/src/transfer/format/digest.ts +287 -0
- package/src/transfer/format/features.ts +91 -0
- package/src/transfer/format/issues.ts +39 -0
- package/src/transfer/format/kinds.ts +936 -0
- package/src/transfer/format/limits.ts +87 -0
- package/src/transfer/format/manifest.ts +297 -0
- package/src/transfer/format/media-refs.ts +716 -0
- package/src/transfer/format/paths.ts +73 -0
- package/src/transfer/format/plan.ts +162 -0
- package/src/transfer/format/receipt.ts +43 -0
- package/src/transfer/format/records.ts +127 -0
- package/src/transfer/format/settings.ts +94 -0
- package/src/transfer/format/transformations.ts +260 -0
- package/src/transfer/format/version.ts +9 -0
- package/src/transfer/gc.ts +103 -0
- package/src/transfer/import/advance.ts +522 -0
- package/src/transfer/import/context.ts +281 -0
- package/src/transfer/import/entries.ts +186 -0
- package/src/transfer/import/ids.ts +40 -0
- package/src/transfer/import/index.ts +15 -0
- package/src/transfer/import/media.ts +141 -0
- package/src/transfer/import/rebuild.ts +300 -0
- package/src/transfer/import/rows.ts +114 -0
- package/src/transfer/import/scaffold.ts +221 -0
- package/src/transfer/import/sql.ts +134 -0
- package/src/transfer/import/stages.ts +329 -0
- package/src/transfer/import/writers.ts +370 -0
- package/src/transfer/index.ts +472 -0
- package/src/transfer/ops/approvals.ts +359 -0
- package/src/transfer/ops/budget.ts +82 -0
- package/src/transfer/ops/collation.ts +21 -0
- package/src/transfer/ops/identity-map.ts +142 -0
- package/src/transfer/ops/media-blobs.ts +135 -0
- package/src/transfer/ops/operations.ts +842 -0
- package/src/transfer/ops/package-index.ts +159 -0
- package/src/transfer/ops/staged-files.ts +231 -0
- package/src/transfer/ops/states.ts +265 -0
- package/src/transfer/ops/time.ts +54 -0
- package/src/transfer/schema-importer.ts +34 -0
- package/src/transfer/site-id.ts +30 -0
- package/src/transfer/staging/assembler.ts +217 -0
- package/src/transfer/staging/keys.ts +94 -0
- package/src/transfer/staging/package.ts +229 -0
- package/src/transfer/staging/stage.ts +231 -0
- package/src/ui.ts +19 -0
- package/src/visual-editing/toolbar.ts +125 -37
- package/dist/action-token-On1sot_c.mjs +0 -26
- package/dist/action-token-On1sot_c.mjs.map +0 -1
- package/dist/activation-CaMfdBt1.mjs +0 -382
- package/dist/activation-CaMfdBt1.mjs.map +0 -1
- package/dist/adapters-Cq10K4_c.d.mts +0 -171
- package/dist/adapters-Cq10K4_c.d.mts.map +0 -1
- package/dist/allowed-origins-1Sa-2wZK.mjs +0 -116
- package/dist/allowed-origins-1Sa-2wZK.mjs.map +0 -1
- package/dist/api-BB5BoQbN.mjs +0 -4831
- package/dist/api-BB5BoQbN.mjs.map +0 -1
- package/dist/api-tokens-BIXItFKV.mjs +0 -163
- package/dist/api-tokens-BIXItFKV.mjs.map +0 -1
- package/dist/api-tokens-DS1VzN7_.mjs +0 -3
- package/dist/apply-CsKm_5S5.mjs +0 -1005
- package/dist/apply-CsKm_5S5.mjs.map +0 -1
- package/dist/artifact-fetch-COiMhVgk.mjs +0 -813
- package/dist/artifact-fetch-COiMhVgk.mjs.map +0 -1
- package/dist/authoritative-records-DbqshfKD.mjs +0 -5172
- package/dist/authoritative-records-DbqshfKD.mjs.map +0 -1
- package/dist/authorize-BXpfMpp0.mjs +0 -40
- package/dist/authorize-BXpfMpp0.mjs.map +0 -1
- package/dist/backup-B4tByjBb.mjs +0 -246
- package/dist/backup-B4tByjBb.mjs.map +0 -1
- package/dist/byline-C8ndlnP0.mjs +0 -906
- package/dist/byline-C8ndlnP0.mjs.map +0 -1
- package/dist/byline-fields-CsrdvaLV.mjs +0 -123
- package/dist/byline-fields-CsrdvaLV.mjs.map +0 -1
- package/dist/byline-registry-D6lWzXk6.mjs +0 -406
- package/dist/byline-registry-D6lWzXk6.mjs.map +0 -1
- package/dist/bylines-CHP44GkL.mjs +0 -232
- package/dist/bylines-CHP44GkL.mjs.map +0 -1
- package/dist/bylines-DxjM4Usz.mjs +0 -214
- package/dist/bylines-DxjM4Usz.mjs.map +0 -1
- package/dist/cache-BByLKGPu.mjs +0 -108
- package/dist/cache-BByLKGPu.mjs.map +0 -1
- package/dist/capture-triggers-gxQxnxrJ.mjs +0 -362
- package/dist/capture-triggers-gxQxnxrJ.mjs.map +0 -1
- package/dist/challenge-store-CkRdSdd8.mjs +0 -51
- package/dist/challenge-store-CkRdSdd8.mjs.map +0 -1
- package/dist/checksum-Bsi2D9M1.mjs +0 -162
- package/dist/checksum-Bsi2D9M1.mjs.map +0 -1
- package/dist/chrome-tags-D7LGB91U.mjs +0 -24
- package/dist/chrome-tags-D7LGB91U.mjs.map +0 -1
- package/dist/chunks-DUK-cWXi.mjs +0 -25
- package/dist/chunks-DUK-cWXi.mjs.map +0 -1
- package/dist/collection-deletion-C-yQB9fq.mjs +0 -436
- package/dist/collection-deletion-C-yQB9fq.mjs.map +0 -1
- package/dist/collection-slugs-cache-D9auiKmI.mjs +0 -85
- package/dist/collection-slugs-cache-D9auiKmI.mjs.map +0 -1
- package/dist/comment-DcT8qdPK.mjs +0 -313
- package/dist/comment-DcT8qdPK.mjs.map +0 -1
- package/dist/comment-reaction-B6KHCLYK.mjs +0 -85
- package/dist/comment-reaction-B6KHCLYK.mjs.map +0 -1
- package/dist/comments-B67VRNGw.mjs +0 -204
- package/dist/comments-B67VRNGw.mjs.map +0 -1
- package/dist/comments-BVzzt6x5.mjs +0 -99
- package/dist/comments-BVzzt6x5.mjs.map +0 -1
- package/dist/components-DIl9Qzh6.mjs +0 -108
- package/dist/components-DIl9Qzh6.mjs.map +0 -1
- package/dist/config-B2acLeC5.mjs +0 -242
- package/dist/config-B2acLeC5.mjs.map +0 -1
- package/dist/config-CGVeT8Hc.mjs +0 -73
- package/dist/config-CGVeT8Hc.mjs.map +0 -1
- package/dist/config-Cw1Xz_Br.d.mts +0 -6387
- package/dist/config-Cw1Xz_Br.d.mts.map +0 -1
- package/dist/config-D3HhLON3.d.mts +0 -39
- package/dist/config-D3HhLON3.d.mts.map +0 -1
- package/dist/content-C0Hl3ktM.mjs +0 -2216
- package/dist/content-C0Hl3ktM.mjs.map +0 -1
- package/dist/content-list-query-CbPdzsna.d.mts +0 -26
- package/dist/content-list-query-CbPdzsna.d.mts.map +0 -1
- package/dist/content-policy-CM4skrNi.mjs +0 -46
- package/dist/content-policy-CM4skrNi.mjs.map +0 -1
- package/dist/content-refresh-iRBhQHr5.mjs +0 -3599
- package/dist/content-refresh-iRBhQHr5.mjs.map +0 -1
- package/dist/content-repair-8uHRIJkd.mjs +0 -440
- package/dist/content-repair-8uHRIJkd.mjs.map +0 -1
- package/dist/context-DJP3aNeR.mjs +0 -1835
- package/dist/context-DJP3aNeR.mjs.map +0 -1
- package/dist/cron-BcR3RN4K.mjs +0 -282
- package/dist/cron-BcR3RN4K.mjs.map +0 -1
- package/dist/dashboard-B0s6QKgi.mjs +0 -151
- package/dist/dashboard-B0s6QKgi.mjs.map +0 -1
- package/dist/default-BtlxWgh9.mjs +0 -81
- package/dist/default-BtlxWgh9.mjs.map +0 -1
- package/dist/deferred-tasks-Ba9fphlE.d.mts +0 -9
- package/dist/deferred-tasks-Ba9fphlE.d.mts.map +0 -1
- package/dist/device-flow-3E5l0fpH.mjs +0 -466
- package/dist/device-flow-3E5l0fpH.mjs.map +0 -1
- package/dist/dialect-helpers-CtYdsX4W.mjs +0 -307
- package/dist/dialect-helpers-CtYdsX4W.mjs.map +0 -1
- package/dist/direct-executor-CDr1quOq.mjs +0 -104
- package/dist/direct-executor-CDr1quOq.mjs.map +0 -1
- package/dist/dist-2hDLsLeq.mjs +0 -810
- package/dist/dist-2hDLsLeq.mjs.map +0 -1
- package/dist/email-console-gc-E3Eqj.mjs +0 -50
- package/dist/email-console-gc-E3Eqj.mjs.map +0 -1
- package/dist/emdash-runtime-CxxL05Z0.mjs +0 -4041
- package/dist/emdash-runtime-CxxL05Z0.mjs.map +0 -1
- package/dist/enrich-C2Mk0lwE.mjs +0 -194
- package/dist/enrich-C2Mk0lwE.mjs.map +0 -1
- package/dist/entry-lock-CwWdnFyR.mjs +0 -1520
- package/dist/entry-lock-CwWdnFyR.mjs.map +0 -1
- package/dist/entry-lock-D9rnj2Lu.mjs +0 -163
- package/dist/entry-lock-D9rnj2Lu.mjs.map +0 -1
- package/dist/entry-lock-DqkvBC6L.d.mts +0 -3503
- package/dist/entry-lock-DqkvBC6L.d.mts.map +0 -1
- package/dist/entry-locks-CO_KaoU5.mjs +0 -167
- package/dist/entry-locks-CO_KaoU5.mjs.map +0 -1
- package/dist/error-CCTCskie.mjs +0 -90
- package/dist/error-CCTCskie.mjs.map +0 -1
- package/dist/errors-W3PA8HqB.mjs +0 -447
- package/dist/errors-W3PA8HqB.mjs.map +0 -1
- package/dist/escape-DN4Qmjsl.mjs +0 -9
- package/dist/escape-DN4Qmjsl.mjs.map +0 -1
- package/dist/field-defs-cache-Db0pJgqn.mjs +0 -77
- package/dist/field-defs-cache-Db0pJgqn.mjs.map +0 -1
- package/dist/fts-manager-CjX0e5BR.mjs +0 -413
- package/dist/fts-manager-CjX0e5BR.mjs.map +0 -1
- package/dist/hash-CLVFzWvx.mjs +0 -37
- package/dist/hash-CLVFzWvx.mjs.map +0 -1
- package/dist/hook-result-KY1jq21o.d.mts +0 -31
- package/dist/hook-result-KY1jq21o.d.mts.map +0 -1
- package/dist/hreflang-BgS2FqhH.d.mts +0 -50
- package/dist/hreflang-BgS2FqhH.d.mts.map +0 -1
- package/dist/hreflang-DOQeTXpg.mjs +0 -105
- package/dist/hreflang-DOQeTXpg.mjs.map +0 -1
- package/dist/http-route-dispatch-MCVKiQCl.mjs +0 -339
- package/dist/http-route-dispatch-MCVKiQCl.mjs.map +0 -1
- package/dist/identity-vFbpuwfY.mjs +0 -35
- package/dist/identity-vFbpuwfY.mjs.map +0 -1
- package/dist/import-got6I69S.mjs +0 -2020
- package/dist/import-got6I69S.mjs.map +0 -1
- package/dist/index-CDwKDkTq.d.mts +0 -623
- package/dist/index-CDwKDkTq.d.mts.map +0 -1
- package/dist/install-finalization-5Os-QZ-2.mjs +0 -58
- package/dist/install-finalization-5Os-QZ-2.mjs.map +0 -1
- package/dist/lifecycle-7e-Lt_kX.mjs +0 -25
- package/dist/lifecycle-7e-Lt_kX.mjs.map +0 -1
- package/dist/load-C56XiwbV.mjs +0 -28
- package/dist/load-C56XiwbV.mjs.map +0 -1
- package/dist/loader-xhNQiT9T.mjs +0 -1004
- package/dist/loader-xhNQiT9T.mjs.map +0 -1
- package/dist/manifest-builder-Bz3nxVET.mjs +0 -189
- package/dist/manifest-builder-Bz3nxVET.mjs.map +0 -1
- package/dist/manifest-schema-Bkh8SeHd.mjs +0 -491
- package/dist/manifest-schema-Bkh8SeHd.mjs.map +0 -1
- package/dist/media-TBlKCwo7.mjs +0 -334
- package/dist/media-TBlKCwo7.mjs.map +0 -1
- package/dist/media-allowlist-s60eAIf6.mjs +0 -44
- package/dist/media-allowlist-s60eAIf6.mjs.map +0 -1
- package/dist/media-folders-ClIRLUQv.mjs +0 -210
- package/dist/media-folders-ClIRLUQv.mjs.map +0 -1
- package/dist/media-url-DY_ijO3B.mjs +0 -43
- package/dist/media-url-DY_ijO3B.mjs.map +0 -1
- package/dist/media-usage-Bd9rFPKN.mjs +0 -1833
- package/dist/media-usage-Bd9rFPKN.mjs.map +0 -1
- package/dist/media-usage-activation-CAhmb14O.mjs +0 -78
- package/dist/media-usage-activation-CAhmb14O.mjs.map +0 -1
- package/dist/media-usage-work-BPlRMOJv.mjs +0 -152
- package/dist/media-usage-work-BPlRMOJv.mjs.map +0 -1
- package/dist/media-usage-work-Cu5DqewW.mjs +0 -586
- package/dist/media-usage-work-Cu5DqewW.mjs.map +0 -1
- package/dist/media-usage-write-fence-DW5oHT7q.mjs +0 -42
- package/dist/media-usage-write-fence-DW5oHT7q.mjs.map +0 -1
- package/dist/menus-BUQdvXep.mjs +0 -3732
- package/dist/menus-BUQdvXep.mjs.map +0 -1
- package/dist/menus-DgSUodmF.mjs +0 -753
- package/dist/menus-DgSUodmF.mjs.map +0 -1
- package/dist/mime-CCYRC4r1.mjs +0 -36
- package/dist/mime-CCYRC4r1.mjs.map +0 -1
- package/dist/mode-CkmOhFqj.mjs +0 -23
- package/dist/mode-CkmOhFqj.mjs.map +0 -1
- package/dist/node-sqlite-compat-vpVaILnb.mjs +0 -46
- package/dist/node-sqlite-compat-vpVaILnb.mjs.map +0 -1
- package/dist/normalize-dChXQjwS.mjs +0 -191
- package/dist/normalize-dChXQjwS.mjs.map +0 -1
- package/dist/oauth-authorization-DZ-R-hmx.mjs +0 -274
- package/dist/oauth-authorization-DZ-R-hmx.mjs.map +0 -1
- package/dist/oauth-clients-BMPA8vjl.mjs +0 -266
- package/dist/oauth-clients-BMPA8vjl.mjs.map +0 -1
- package/dist/oauth-state-store-0gIdb48-.mjs +0 -50
- package/dist/oauth-state-store-0gIdb48-.mjs.map +0 -1
- package/dist/oauth-user-lookup-ChVW4UWu.mjs +0 -26
- package/dist/oauth-user-lookup-ChVW4UWu.mjs.map +0 -1
- package/dist/object-cache-DlSVbn5Y.mjs +0 -534
- package/dist/object-cache-DlSVbn5Y.mjs.map +0 -1
- package/dist/options-D5WcorD5.mjs +0 -200
- package/dist/options-D5WcorD5.mjs.map +0 -1
- package/dist/options-DAknChnw.d.mts +0 -77
- package/dist/options-DAknChnw.d.mts.map +0 -1
- package/dist/parse-Cr379Av9.mjs +0 -81
- package/dist/parse-Cr379Av9.mjs.map +0 -1
- package/dist/parse-tj9XLNO_.d.mts +0 -165
- package/dist/parse-tj9XLNO_.d.mts.map +0 -1
- package/dist/passkey-config-BD-wMaCf.mjs +0 -46
- package/dist/passkey-config-BD-wMaCf.mjs.map +0 -1
- package/dist/patterns-Do3iqi7N.mjs +0 -145
- package/dist/patterns-Do3iqi7N.mjs.map +0 -1
- package/dist/placeholder-CubPFn_L.d.mts +0 -306
- package/dist/placeholder-CubPFn_L.d.mts.map +0 -1
- package/dist/plugins-DHurtdXQ.mjs +0 -277
- package/dist/plugins-DHurtdXQ.mjs.map +0 -1
- package/dist/policy-pL9QLKZm.mjs +0 -45
- package/dist/policy-pL9QLKZm.mjs.map +0 -1
- package/dist/portable-text-oAwodbPS.mjs +0 -286
- package/dist/portable-text-oAwodbPS.mjs.map +0 -1
- package/dist/preview-Cup2bj8c.mjs +0 -107
- package/dist/preview-Cup2bj8c.mjs.map +0 -1
- package/dist/protocol-C1CNiKX4.d.mts +0 -61
- package/dist/protocol-C1CNiKX4.d.mts.map +0 -1
- package/dist/public-submission-Cs-pFMQK.mjs +0 -245
- package/dist/public-submission-Cs-pFMQK.mjs.map +0 -1
- package/dist/public-url-BWVHsfQv.mjs +0 -101
- package/dist/public-url-BWVHsfQv.mjs.map +0 -1
- package/dist/query-CxnFU6sz.mjs +0 -890
- package/dist/query-CxnFU6sz.mjs.map +0 -1
- package/dist/query-sgHYEgBW.mjs +0 -41
- package/dist/query-sgHYEgBW.mjs.map +0 -1
- package/dist/rate-limit-CqJn-w4h.mjs +0 -120
- package/dist/rate-limit-CqJn-w4h.mjs.map +0 -1
- package/dist/redirect-BrChFPIu.mjs +0 -17
- package/dist/redirect-BrChFPIu.mjs.map +0 -1
- package/dist/redirect-D2Yo-b6S.mjs +0 -415
- package/dist/redirect-D2Yo-b6S.mjs.map +0 -1
- package/dist/redirects-BCiTaIQ-.mjs +0 -146
- package/dist/redirects-BCiTaIQ-.mjs.map +0 -1
- package/dist/redirects-CAoL3r26.mjs +0 -644
- package/dist/redirects-CAoL3r26.mjs.map +0 -1
- package/dist/registry-xKzE-_m5.mjs +0 -1222
- package/dist/registry-xKzE-_m5.mjs.map +0 -1
- package/dist/relation-ClsWcYg2.mjs +0 -334
- package/dist/relation-ClsWcYg2.mjs.map +0 -1
- package/dist/relations-B4w-G5U9.mjs +0 -309
- package/dist/relations-B4w-G5U9.mjs.map +0 -1
- package/dist/relations-C3Td_mct.mjs +0 -403
- package/dist/relations-C3Td_mct.mjs.map +0 -1
- package/dist/request-cache-DaMhSQdx.mjs +0 -104
- package/dist/request-cache-DaMhSQdx.mjs.map +0 -1
- package/dist/request-meta-C8yl_sIs.mjs +0 -141
- package/dist/request-meta-C8yl_sIs.mjs.map +0 -1
- package/dist/resolve-BJIS8wKr.mjs +0 -199
- package/dist/resolve-BJIS8wKr.mjs.map +0 -1
- package/dist/route-wire-D66L2oaZ.mjs +0 -197
- package/dist/route-wire-D66L2oaZ.mjs.map +0 -1
- package/dist/routes-CWzxcZpn.mjs +0 -321
- package/dist/routes-CWzxcZpn.mjs.map +0 -1
- package/dist/runner-3gfxRsJG.d.mts +0 -68
- package/dist/runner-3gfxRsJG.d.mts.map +0 -1
- package/dist/runner-CIltKk4i.mjs +0 -5502
- package/dist/runner-CIltKk4i.mjs.map +0 -1
- package/dist/schema-DQIE9Htn.mjs +0 -420
- package/dist/schema-DQIE9Htn.mjs.map +0 -1
- package/dist/schema-ILPFMPW3.mjs +0 -9
- package/dist/schema-ILPFMPW3.mjs.map +0 -1
- package/dist/scopes-Bn8_rCSt.mjs +0 -27
- package/dist/scopes-Bn8_rCSt.mjs.map +0 -1
- package/dist/search-D6muneha.mjs +0 -448
- package/dist/search-D6muneha.mjs.map +0 -1
- package/dist/secrets-DNgVgz_e.mjs +0 -341
- package/dist/secrets-DNgVgz_e.mjs.map +0 -1
- package/dist/sections-BPCEGYWd.mjs +0 -346
- package/dist/sections-BPCEGYWd.mjs.map +0 -1
- package/dist/seo-BtU70b7l.mjs +0 -114
- package/dist/seo-BtU70b7l.mjs.map +0 -1
- package/dist/seo-rCk6pDwT.mjs +0 -133
- package/dist/seo-rCk6pDwT.mjs.map +0 -1
- package/dist/service-Bpy5iTX0.mjs +0 -150
- package/dist/service-Bpy5iTX0.mjs.map +0 -1
- package/dist/session-user-BQeS2Mrb.mjs +0 -51
- package/dist/session-user-BQeS2Mrb.mjs.map +0 -1
- package/dist/settings-CsoLiwpL.mjs +0 -420
- package/dist/settings-CsoLiwpL.mjs.map +0 -1
- package/dist/settings-DCnWtfSZ.mjs +0 -51
- package/dist/settings-DCnWtfSZ.mjs.map +0 -1
- package/dist/setup-complete-BrZaXpVV.mjs +0 -26
- package/dist/setup-complete-BrZaXpVV.mjs.map +0 -1
- package/dist/setup-nonce-Cb9-884O.mjs +0 -25
- package/dist/setup-nonce-Cb9-884O.mjs.map +0 -1
- package/dist/site-url-DjhYCaep.mjs +0 -16
- package/dist/site-url-DjhYCaep.mjs.map +0 -1
- package/dist/snapshot-C32Xuv3o.mjs +0 -233
- package/dist/snapshot-C32Xuv3o.mjs.map +0 -1
- package/dist/ssrf-Co1GGFZz.mjs +0 -406
- package/dist/ssrf-Co1GGFZz.mjs.map +0 -1
- package/dist/state-C7gCoiHr.mjs +0 -153
- package/dist/state-C7gCoiHr.mjs.map +0 -1
- package/dist/status-DLoBmcDz.mjs +0 -30
- package/dist/status-DLoBmcDz.mjs.map +0 -1
- package/dist/storage-query-CPctdMKX.d.mts +0 -1519
- package/dist/storage-query-CPctdMKX.d.mts.map +0 -1
- package/dist/target-CUKlGrXb.mjs +0 -27
- package/dist/target-CUKlGrXb.mjs.map +0 -1
- package/dist/taxonomies-Bs5dJVDJ.mjs +0 -899
- package/dist/taxonomies-Bs5dJVDJ.mjs.map +0 -1
- package/dist/taxonomies-DjGU22ur.mjs +0 -707
- package/dist/taxonomies-DjGU22ur.mjs.map +0 -1
- package/dist/taxonomy-c1Q8PMFF.mjs +0 -508
- package/dist/taxonomy-c1Q8PMFF.mjs.map +0 -1
- package/dist/tokens-Ns02GAma.mjs +0 -171
- package/dist/tokens-Ns02GAma.mjs.map +0 -1
- package/dist/transport-B8P1xsqk.mjs +0 -136
- package/dist/transport-B8P1xsqk.mjs.map +0 -1
- package/dist/transport-BLHZZcD_.d.mts +0 -42
- package/dist/transport-BLHZZcD_.d.mts.map +0 -1
- package/dist/trusted-proxy-Cg7SuD15.mjs +0 -51
- package/dist/trusted-proxy-Cg7SuD15.mjs.map +0 -1
- package/dist/turnstile-DWCSh_Qc.mjs +0 -53
- package/dist/turnstile-DWCSh_Qc.mjs.map +0 -1
- package/dist/types-B3RkqvDW.mjs +0 -156
- package/dist/types-B3RkqvDW.mjs.map +0 -1
- package/dist/types-BtuppOTV.mjs +0 -16
- package/dist/types-BtuppOTV.mjs.map +0 -1
- package/dist/types-CCR3ivXE.d.mts +0 -363
- package/dist/types-CCR3ivXE.d.mts.map +0 -1
- package/dist/types-CSHgU_-_.mjs +0 -18
- package/dist/types-CSHgU_-_.mjs.map +0 -1
- package/dist/types-CbwqGOXm.d.mts +0 -766
- package/dist/types-CbwqGOXm.d.mts.map +0 -1
- package/dist/types-D4RGIc2I.d.mts +0 -198
- package/dist/types-D4RGIc2I.d.mts.map +0 -1
- package/dist/types-DEHidMEk.d.mts +0 -1637
- package/dist/types-DEHidMEk.d.mts.map +0 -1
- package/dist/types-DQeU2SR7.d.mts +0 -279
- package/dist/types-DQeU2SR7.d.mts.map +0 -1
- package/dist/types-DxQWoQLA.d.mts +0 -264
- package/dist/types-DxQWoQLA.d.mts.map +0 -1
- package/dist/types-FBBnGZ2Y.d.mts +0 -198
- package/dist/types-FBBnGZ2Y.d.mts.map +0 -1
- package/dist/types-ZCnlropY.mjs +0 -69
- package/dist/types-ZCnlropY.mjs.map +0 -1
- package/dist/types-_Qtyawiy.d.mts +0 -124
- package/dist/types-_Qtyawiy.d.mts.map +0 -1
- package/dist/types-gC6FAoa_.d.mts +0 -75
- package/dist/types-gC6FAoa_.d.mts.map +0 -1
- package/dist/types-k--LneIF.mjs +0 -22
- package/dist/types-k--LneIF.mjs.map +0 -1
- package/dist/upload-attempts-2xdnoKGe.mjs +0 -27
- package/dist/upload-attempts-2xdnoKGe.mjs.map +0 -1
- package/dist/url-pattern-3m3reMzr.mjs +0 -33
- package/dist/url-pattern-3m3reMzr.mjs.map +0 -1
- package/dist/user-2R1gceFl.mjs +0 -171
- package/dist/user-2R1gceFl.mjs.map +0 -1
- package/dist/utils-CC2oNGV8.mjs +0 -435
- package/dist/utils-CC2oNGV8.mjs.map +0 -1
- package/dist/validate-CaFSi_Wa.mjs +0 -384
- package/dist/validate-CaFSi_Wa.mjs.map +0 -1
- package/dist/validate-CyQ7I3xF.d.mts +0 -410
- package/dist/validate-CyQ7I3xF.d.mts.map +0 -1
- package/dist/validation-nsX2uixg.mjs +0 -216
- package/dist/validation-nsX2uixg.mjs.map +0 -1
- package/dist/version-DGh4SL8e.mjs +0 -7
- package/dist/version-DGh4SL8e.mjs.map +0 -1
- package/dist/widgets-B7ued6f5.mjs +0 -126
- package/dist/widgets-B7ued6f5.mjs.map +0 -1
- package/dist/wxr-taxonomies-BtH3jYSg.mjs +0 -406
- package/dist/wxr-taxonomies-BtH3jYSg.mjs.map +0 -1
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts +0 -34
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts.map +0 -1
- package/dist/zod-generator-DuBjYyrI.mjs +0 -329
- package/dist/zod-generator-DuBjYyrI.mjs.map +0 -1
- /package/dist/{ssrf-BRpTDMV6.mjs → ssrf-DpBH7aOt.mjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taxonomies-DjGU22ur.mjs","names":[],"sources":["../src/taxonomies/term-counts.ts","../src/taxonomies/index.ts"],"sourcesContent":["/**\n * Shared visible-usage counts for taxonomy terms (issue #581).\n *\n * `content_taxonomies` rows are written for every entry regardless of status\n * and are never pruned on unpublish/trash, so counting the pivot directly\n * inflates counts with drafts and soft-deleted entries. Every user-facing\n * count (public widget, single-term page, admin term list) must instead count\n * only entries that have completed publication:\n * `status = 'published'` AND `deleted_at IS NULL`.\n *\n * The public render path is latency-sensitive on D1, so per-collection counts\n * are combined with UNION ALL — one query per taxonomy, never one per\n * collection, split only where the backend caps compound-SELECT terms.\n */\n\nimport type { Kysely } from \"kysely\";\nimport { sql } from \"kysely\";\n\nimport { buildStatusCondition, compoundSelectLimit } from \"../database/dialect-helpers.js\";\nimport type { Database } from \"../database/types.js\";\nimport { validateIdentifier } from \"../database/validate.js\";\nimport {\n\tfilterToRegisteredCollections,\n\tnoteStaleRegisteredCollections,\n} from \"../schema/collection-slugs-cache.js\";\nimport { chunks } from \"../utils/chunks.js\";\nimport { isMissingTableError } from \"../utils/db-errors.js\";\n\ninterface CountRow {\n\ttaxonomy_id: string;\n\tcount: number | string | bigint;\n}\n\n/**\n * Per-collection count branch. `taxonomy_id` stores the term's\n * translation_group, so results are keyed by group (locale-independent) and\n * each assignment is counted once per content translation group. When a\n * locale is provided, only that group's matching content row contributes.\n *\n * Scoping to the taxonomy uses `translation_group IN (...)` rather than a\n * join on `taxonomies.id` — the anchor row (id == group) can be deleted while\n * sibling translations survive, and a plain join on `translation_group` would\n * multiply counts by the number of locales.\n *\n * CROSS JOIN with the join predicate in WHERE keeps stats-blind SQLite/D1 from\n * reordering content_taxonomies out of the outer position; it touches ec_* only\n * through the translation-group index. Postgres treats this as an ordinary\n * inner join and plans freely.\n */\nfunction collectionBranch(\n\tdb: Kysely<Database>,\n\ttaxonomyName: string,\n\tcollection: string,\n\tlocale?: string,\n): ReturnType<typeof sql> {\n\treturn sql`\n\t\tSELECT ct.taxonomy_id AS taxonomy_id, COUNT(DISTINCT e.translation_group) AS count\n\t\tFROM content_taxonomies AS ct\n\t\tCROSS JOIN ${sql.ref(`ec_${collection}`)} AS e\n\t\tWHERE e.translation_group = ct.entry_id\n\t\t\tAND ct.collection = ${collection}\n\t\t\tAND ct.taxonomy_id IN (SELECT translation_group FROM taxonomies WHERE name = ${taxonomyName})\n\t\t\t${locale ? sql`AND e.locale = ${locale}` : sql``}\n\t\t\tAND ${buildStatusCondition(db, \"published\", \"e\")}\n\t\t\tAND e.deleted_at IS NULL\n\t\tGROUP BY ct.taxonomy_id`;\n}\n\nasync function runCounts(\n\tdb: Kysely<Database>,\n\ttaxonomyName: string,\n\tcollections: string[],\n\tlocale?: string,\n): Promise<Map<string, number>> {\n\tconst branches = collections.map((collection) =>\n\t\tcollectionBranch(db, taxonomyName, collection, locale),\n\t);\n\tconst union = sql.join(branches, sql` UNION ALL `);\n\tconst result = await sql<CountRow>`\n\t\tSELECT taxonomy_id, SUM(count) AS count\n\t\tFROM (${union}) AS per_collection\n\t\tGROUP BY taxonomy_id`.execute(db);\n\n\tconst counts = new Map<string, number>();\n\tfor (const row of result.rows) counts.set(row.taxonomy_id, Number(row.count));\n\treturn counts;\n}\n\nfunction addCounts(into: Map<string, number>, from: Map<string, number>): void {\n\tfor (const [group, count] of from) into.set(group, (into.get(group) ?? 0) + count);\n}\n\n/**\n * Counts for one batch of collections, degrading to a query per collection\n * when a declared collection has no ec_* table so the rest still contribute.\n */\nasync function runBatch(\n\tdb: Kysely<Database>,\n\ttaxonomyName: string,\n\tcollections: string[],\n\tlocale?: string,\n): Promise<Map<string, number>> {\n\ttry {\n\t\treturn await runCounts(db, taxonomyName, collections, locale);\n\t} catch (error) {\n\t\tif (!isMissingTableError(error)) throw error;\n\t\t// The slug filter let a missing table through: the collection was\n\t\t// deleted on another isolate (stale cache) or the registry drifted\n\t\t// from the physical schema. Window-gated, so the delete case stops\n\t\t// sending failing statements within one revalidation window.\n\t\tnoteStaleRegisteredCollections();\n\t}\n\n\tconst counts = new Map<string, number>();\n\tfor (const collection of collections) {\n\t\ttry {\n\t\t\taddCounts(counts, await runCounts(db, taxonomyName, [collection], locale));\n\t\t} catch (error) {\n\t\t\tif (!isMissingTableError(error)) throw error;\n\t\t}\n\t}\n\treturn counts;\n}\n\n/**\n * Count publicly-visible term assignments for one taxonomy, keyed by the\n * term's translation_group (what `content_taxonomies.taxonomy_id` stores).\n * When `locale` is provided, only entries in that locale contribute. Omitting\n * it preserves the locale-agnostic API used by legacy callers.\n *\n * Counts are scoped to the taxonomy's declared collections — pass\n * `TaxonomyDef.collections` (`_emdash_taxonomy_defs.collections`). Declared\n * collections without a `_emdash_collections` row (the migration-seeded\n * defaults declare `posts` unconditionally) are filtered out before any SQL\n * is built, so no statement referencing a missing `ec_*` table is sent — a\n * failed statement is logged by the database even when the caller recovers,\n * flooding D1 observability with phantom errors. The missing-table guards in\n * `runBatch` stay as the backstop for registry/table drift (e.g. a partially\n * applied D1 create) and for a table dropped mid-flight, yielding a\n * partial-but-correct count rather than a throw.\n *\n * One database round-trip for the whole taxonomy (UNION ALL across\n * collections). On a backend that caps compound-SELECT terms — D1 allows five\n * — the branches are split into one statement per batch, since a taxonomy\n * declaring more collections than that would otherwise take down every path\n * that shows counts. Per-collection sums are commutative, so batching cannot\n * change the total.\n *\n * Callers on the public render path should go through the request-cached\n * wrapper in `taxonomies/index.ts` so a page rendering both the widget and a\n * term detail shares one computation.\n */\nexport async function fetchVisibleTermCounts(\n\tdb: Kysely<Database>,\n\ttaxonomyName: string,\n\tcollections: string[],\n\tlocale?: string,\n): Promise<Map<string, number>> {\n\tconst unique = [...new Set(collections)];\n\tfor (const collection of unique) validateIdentifier(collection, \"collection slug\");\n\tif (unique.length === 0) return new Map();\n\n\tconst present = await filterToRegisteredCollections(db, unique);\n\tif (present.length === 0) return new Map();\n\n\tconst limit = compoundSelectLimit(db);\n\tconst batched = limit === null ? [present] : chunks(present, limit);\n\tconst batches = await Promise.all(\n\t\tbatched.map((batch) => runBatch(db, taxonomyName, batch, locale)),\n\t);\n\n\tconst counts = new Map<string, number>();\n\tfor (const batch of batches) addCounts(counts, batch);\n\treturn counts;\n}\n","/**\n * Runtime API for taxonomies.\n *\n * All helpers are locale-aware. When a locale is not passed explicitly we fall\n * back to the request context or the configured `defaultLocale` (see\n * `i18n/resolve.ts`).\n *\n * Because `content_taxonomies.taxonomy_id` stores the translation_group (not a\n * specific term id), and `entry_id` stores the content translation_group, one\n * assignment resolves to the requested locale on both sides.\n */\n\nimport { sql, type Kysely } from \"kysely\";\n\nimport { taxonomyTag } from \"../cache/chrome-tags.js\";\nimport type { Database } from \"../database/types.js\";\nimport { validateIdentifier } from \"../database/validate.js\";\nimport { getI18nConfig } from \"../i18n/config.js\";\nimport { resolveLocale, resolveLocaleChain } from \"../i18n/resolve.js\";\nimport { getDb, resetTaxonomyNamesCache } from \"../loader.js\";\nimport {\n\tcachedQuery,\n\tCacheNamespace,\n\tcontentCacheNamespaces,\n\tinvalidateTaxonomyObjectCache,\n\tisObjectCacheActive,\n} from \"../object-cache/index.js\";\nimport type { CacheHint } from \"../query.js\";\nimport { peekRequestCache, requestCached, setRequestCacheEntry } from \"../request-cache.js\";\nimport { getRequestContext } from \"../request-context.js\";\nimport { chunks, SQL_BATCH_SIZE } from \"../utils/chunks.js\";\nimport { isMissingTableError } from \"../utils/db-errors.js\";\nimport { fetchVisibleTermCounts } from \"./term-counts.js\";\nimport type { TaxonomyDef, TaxonomyTerm, TaxonomyTermRow } from \"./types.js\";\n\nexport interface TaxonomyQueryOptions {\n\tlocale?: string;\n}\n\nexport interface TaxonomyTermsOptions extends TaxonomyQueryOptions {\n\t/**\n\t * Populate each term's `count`. Counts aggregate the whole\n\t * `content_taxonomies` pivot against every declared collection, so callers\n\t * that don't render a count should opt out. Defaults to `true`.\n\t */\n\tincludeCounts?: boolean;\n}\n\ninterface EntryTermRow {\n\tentry_id: string;\n\tid: string;\n\tname: string;\n\tslug: string;\n\tlabel: string;\n\tparent_id: string | null;\n\tlocale: string;\n\ttranslation_group: string | null;\n}\n\nasync function selectEntryTermRows(\n\tdb: Kysely<Database>,\n\tcollection: string,\n\tentryIds: string[],\n\ttaxonomyName?: string,\n\tlocale?: string,\n): Promise<EntryTermRow[]> {\n\tvalidateIdentifier(collection, \"collection slug\");\n\tconst tableName = `ec_${collection}`;\n\tconst preferredLocale = locale ? sql`${locale}` : sql`content.locale`;\n\tconst defaultLocale = getI18nConfig()?.defaultLocale ?? \"en\";\n\tconst result = await sql<EntryTermRow>`\n\t\tSELECT content.id AS entry_id,\n\t\t\tcoalesce(exact_term.id, default_term.id) AS id,\n\t\t\tcoalesce(exact_term.name, default_term.name) AS name,\n\t\t\tcoalesce(exact_term.slug, default_term.slug) AS slug,\n\t\t\tcoalesce(exact_term.label, default_term.label) AS label,\n\t\t\tcoalesce(exact_term.parent_id, default_term.parent_id) AS parent_id,\n\t\t\tcoalesce(exact_term.locale, default_term.locale) AS locale,\n\t\t\tcoalesce(exact_term.translation_group, default_term.translation_group) AS translation_group\n\t\tFROM ${sql.ref(tableName)} AS content\n\t\tINNER JOIN content_taxonomies AS pivot\n\t\t\tON pivot.entry_id = content.translation_group\n\t\t\tAND pivot.collection = ${collection}\n\t\tLEFT JOIN taxonomies AS exact_term\n\t\t\tON exact_term.translation_group = pivot.taxonomy_id\n\t\t\tAND exact_term.locale = ${preferredLocale}\n\t\tLEFT JOIN taxonomies AS default_term\n\t\t\tON default_term.translation_group = pivot.taxonomy_id\n\t\t\tAND default_term.locale = ${defaultLocale}\n\t\tWHERE content.id IN (${sql.join(entryIds.map((id) => sql`${id}`))})\n\t\t\tAND coalesce(exact_term.id, default_term.id) IS NOT NULL\n\t\t\t${taxonomyName ? sql`AND coalesce(exact_term.name, default_term.name) = ${taxonomyName}` : sql``}\n\t\tORDER BY coalesce(exact_term.label, default_term.label) ASC\n\t`.execute(db);\n\treturn result.rows;\n}\n\n/** Invalidate cached taxonomy term data and any content that hydrates terms. */\nexport function invalidateTermCache(): void {\n\tinvalidateTaxonomyObjectCache();\n}\n\n/**\n * Worker-isolate cache for taxonomy definitions, keyed by resolved locale.\n *\n * Taxonomy *definitions* (the \"category\"/\"tag\" taxonomies themselves, not\n * their terms) are read on every public render that hydrates entry terms —\n * `getAllTermsForEntries` → `getCollectionTaxonomyNames` → `getTaxonomyDefs` —\n * but change extremely rarely: they're written only by the admin API and by\n * seed application. Caching them across the isolate lifetime drops the\n * per-render `SELECT * FROM _emdash_taxonomy_defs` to once-per-isolate.\n *\n * Stored on globalThis behind a Symbol key (same pattern as\n * `settings/index.ts`) so the bundler duplicating this module across SSR\n * chunks can't produce two independent caches.\n *\n * When the distributed object cache is configured, it is authoritative and this\n * fallback is bypassed so cross-isolate epoch invalidation cannot be undercut\n * by stale per-isolate data on an object-cache miss.\n *\n * **Isolated databases bypass the cache.** Playground / DO preview requests\n * set `requestContext.dbIsIsolated`; they point at a divergent schema, so we\n * skip both reading and writing the global holder and fall back to the\n * per-request cache (same precedent as `getTaxonomyNames` / byline field defs).\n */\ninterface TaxonomyDefsHolder {\n\tversion: number;\n\t/** locale key (\"*\" for \"all locales\") → { version it was fetched at, promise }. */\n\tcache: Map<string, { version: number; promise: Promise<TaxonomyDef[]> }>;\n}\n\nconst TAXONOMY_DEFS_CACHE_KEY = Symbol.for(\"emdash:taxonomy-defs\");\nconst taxonomyDefsStore = globalThis as Record<symbol, unknown>;\nconst defsHolder: TaxonomyDefsHolder =\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- globalThis singleton pattern (see settings/index.ts)\n\t(taxonomyDefsStore[TAXONOMY_DEFS_CACHE_KEY] as TaxonomyDefsHolder | undefined) ??\n\t(() => {\n\t\tconst h: TaxonomyDefsHolder = { version: 0, cache: new Map() };\n\t\ttaxonomyDefsStore[TAXONOMY_DEFS_CACHE_KEY] = h;\n\t\treturn h;\n\t})();\n\n/**\n * Invalidate the isolate-wide taxonomy-definitions cache (and the related\n * loader taxonomy-names cache). Called from every taxonomy-def write path\n * (`handleTaxonomyCreate`/`Update`/`Delete`, seed application). Other isolates\n * refresh on their next recycle — staleness bounded by isolate lifetime.\n */\nexport function invalidateTaxonomyDefsCache(): void {\n\tdefsHolder.version++;\n\tdefsHolder.cache.clear();\n\tresetTaxonomyNamesCache();\n\tinvalidateTaxonomyObjectCache();\n}\n\n/**\n * Test/internal helper: clear the per-isolate taxonomy-defs cache. Useful for\n * unit tests that insert defs directly and need to force a refetch without\n * going through a write path. Production code should rely on\n * `invalidateTaxonomyDefsCache()`.\n */\nexport function resetTaxonomyDefsCacheForTests(): void {\n\tdefsHolder.version++;\n\tdefsHolder.cache.clear();\n}\n\n/**\n * Fetch taxonomy definitions straight from the database (no caching).\n */\nasync function fetchTaxonomyDefs(locale: string | undefined): Promise<TaxonomyDef[]> {\n\tconst db = await getDb();\n\tlet query = db.selectFrom(\"_emdash_taxonomy_defs\").selectAll();\n\tif (locale !== undefined) query = query.where(\"locale\", \"=\", locale);\n\tconst rows = await query.execute();\n\treturn rows.map(rowToTaxonomyDef);\n}\n\n/**\n * Resolve taxonomy defs through the isolate fallback cache, bypassing it for\n * isolated databases. The returned promise is cached (not the resolved value)\n * so concurrent cold-isolate readers share one in-flight query; a rejection\n * evicts the entry so the next caller retries.\n */\nfunction loadTaxonomyDefs(localeKey: string, locale: string | undefined): Promise<TaxonomyDef[]> {\n\tif (getRequestContext()?.dbIsIsolated === true) {\n\t\treturn fetchTaxonomyDefs(locale);\n\t}\n\tconst existing = defsHolder.cache.get(localeKey);\n\tif (existing && existing.version === defsHolder.version) {\n\t\treturn existing.promise;\n\t}\n\tconst version = defsHolder.version;\n\tconst promise = fetchTaxonomyDefs(locale).catch((error: unknown) => {\n\t\tconst current = defsHolder.cache.get(localeKey);\n\t\tif (current && current.promise === promise) {\n\t\t\tdefsHolder.cache.delete(localeKey);\n\t\t}\n\t\tthrow error;\n\t});\n\tdefsHolder.cache.set(localeKey, { version, promise });\n\treturn promise;\n}\n\n/**\n * Get every taxonomy definition. Definitions are per-locale (one row per\n * locale inside the same translation_group) — by default we resolve to the\n * active locale.\n *\n * Two-tier cache: per-request via `requestCached` (so a single render that\n * hydrates terms for several collections pays at most one call), then\n * per-isolate via the global holder (so warm renders issue zero queries).\n * The `requestCached` key is unchanged so `getTaxonomyDef`'s peek still hits.\n */\nexport async function getTaxonomyDefs(options: TaxonomyQueryOptions = {}): Promise<TaxonomyDef[]> {\n\tconst locale = resolveLocale(options.locale);\n\tconst localeKey = locale ?? \"*\";\n\treturn requestCached(`taxonomy-defs:${localeKey}`, async () => {\n\t\tif (await isObjectCacheActive()) {\n\t\t\treturn cachedQuery({\n\t\t\t\tnamespace: CacheNamespace.TAXONOMIES,\n\t\t\t\tkey: `defs:${localeKey}`,\n\t\t\t\tload: () => fetchTaxonomyDefs(locale),\n\t\t\t});\n\t\t}\n\t\treturn loadTaxonomyDefs(localeKey, locale);\n\t});\n}\n\n/**\n * Get a single taxonomy definition by name. Uses the fallback chain so even\n * if there is no translation for the active locale we still return something.\n *\n * If `getTaxonomyDefs()` has already loaded the full list in this request\n * (which happens during entry-term hydration on every page that renders a\n * collection), search the matching def in memory rather than running a\n * second query against `_emdash_taxonomy_defs`.\n */\nexport async function getTaxonomyDef(\n\tname: string,\n\toptions: TaxonomyQueryOptions = {},\n): Promise<TaxonomyDef | null> {\n\tconst chain = resolveLocaleChain(options.locale);\n\tconst peekKey = `taxonomy-defs:${resolveLocale(options.locale) ?? \"*\"}`;\n\tconst allDefs = peekRequestCache<TaxonomyDef[]>(peekKey);\n\tif (allDefs) {\n\t\tconst defs = await allDefs;\n\t\tif (chain.length === 0) return defs.find((d) => d.name === name) ?? null;\n\t\tfor (const locale of chain) {\n\t\t\tconst found = defs.find((d) => d.name === name && d.locale === locale);\n\t\t\tif (found) return found;\n\t\t}\n\t\treturn null;\n\t}\n\n\treturn requestCached(`taxonomy-def:${name}:${chain.join(\",\")}`, async () => {\n\t\tconst db = await getDb();\n\n\t\tif (chain.length === 0) {\n\t\t\tconst row = await db\n\t\t\t\t.selectFrom(\"_emdash_taxonomy_defs\")\n\t\t\t\t.selectAll()\n\t\t\t\t.where(\"name\", \"=\", name)\n\t\t\t\t.orderBy(\"locale\", \"asc\")\n\t\t\t\t.executeTakeFirst();\n\t\t\treturn row ? rowToTaxonomyDef(row) : null;\n\t\t}\n\n\t\tfor (const locale of chain) {\n\t\t\tconst row = await db\n\t\t\t\t.selectFrom(\"_emdash_taxonomy_defs\")\n\t\t\t\t.selectAll()\n\t\t\t\t.where(\"name\", \"=\", name)\n\t\t\t\t.where(\"locale\", \"=\", locale)\n\t\t\t\t.executeTakeFirst();\n\t\t\tif (row) return rowToTaxonomyDef(row);\n\t\t}\n\t\treturn null;\n\t});\n}\n\n/**\n * Object-cache namespaces for values that embed visible term counts: the\n * taxonomy epoch (term/assignment writes) plus each counted collection's\n * content epoch, so publishing, unpublishing, or trashing an entry\n * invalidates the cached count promptly. Both content namespace generations\n * participate so rolling deployments preserve invalidation in either direction.\n */\nfunction termCountNamespaces(collections: string[]): string[] {\n\treturn [\n\t\t...[...new Set(collections)].flatMap((collection) => contentCacheNamespaces(collection)),\n\t\tCacheNamespace.TAXONOMIES,\n\t];\n}\n\n/**\n * All terms of a taxonomy in a specific locale (flat for non-hierarchical,\n * tree for hierarchical).\n *\n * The term list and the visible-entry counts are loaded and cached separately:\n * the list depends only on the taxonomy epoch, while the counts additionally\n * depend on every counted collection's content epoch and cost an aggregate over\n * the whole assignment pivot. Callers that don't render counts pass\n * `includeCounts: false` and skip that aggregate entirely, while still sharing\n * the term list with callers that do.\n */\nexport async function getTaxonomyTerms(\n\ttaxonomyName: string,\n\toptions: TaxonomyTermsOptions = {},\n): Promise<TaxonomyTerm[]> {\n\tconst locale = resolveLocale(options.locale);\n\tconst def = await getTaxonomyDef(taxonomyName, options);\n\tif (!def) return [];\n\tif (options.includeCounts === false) return getTermList(def, locale);\n\n\t// The two are independent, so run them concurrently to save a round trip.\n\tconst [terms, counts] = await Promise.all([\n\t\tgetTermList(def, locale),\n\t\tgetVisibleTermCounts(def.name, def.collections, locale),\n\t]);\n\treturn withCounts(terms, counts);\n}\n\n/**\n * Get all terms of a taxonomy with a Workers edge-cache hint.\n *\n * Use the returned `cacheHint` with `Astro.cache.set()` so pages that render\n * a taxonomy facet can be purged automatically when taxonomy terms change.\n */\nexport async function getTaxonomyTermsWithCacheHint(\n\ttaxonomyName: string,\n\toptions: TaxonomyTermsOptions = {},\n): Promise<{ data: TaxonomyTerm[]; cacheHint: CacheHint }> {\n\tconst data = await getTaxonomyTerms(taxonomyName, options);\n\treturn { data, cacheHint: { tags: [taxonomyTag(taxonomyName)] } };\n}\n\n/** Terms without counts, under the cache keys the layout prefetch warms. */\nfunction getTermList(def: TaxonomyDef, locale: string | undefined): Promise<TaxonomyTerm[]> {\n\tconst localeKey = locale ?? \"*\";\n\treturn requestCached(`taxonomy-terms:${def.name}:${localeKey}`, () =>\n\t\tcachedQuery({\n\t\t\tnamespace: CacheNamespace.TAXONOMIES,\n\t\t\tkey: `termList:${def.name}:${localeKey}`,\n\t\t\tload: () => loadTaxonomyTerms(def, locale),\n\t\t}),\n\t);\n}\n\n/**\n * Copy a term list with counts attached. Counts are keyed by translation_group\n * (what the pivot stores) and are locale-independent. Rebuilds every node so\n * the shared, cached count-free list is never mutated.\n */\nfunction withCounts(terms: TaxonomyTerm[], counts: Map<string, number>): TaxonomyTerm[] {\n\treturn terms.map((term) => ({\n\t\t...term,\n\t\tcount: counts.get(term.translationGroup ?? term.id) ?? 0,\n\t\tchildren: withCounts(term.children, counts),\n\t}));\n}\n\nasync function loadTaxonomyTerms(\n\tdef: TaxonomyDef,\n\tlocale: string | undefined,\n): Promise<TaxonomyTerm[]> {\n\tconst db = await getDb();\n\n\tlet termsQuery = db\n\t\t.selectFrom(\"taxonomies\")\n\t\t.selectAll()\n\t\t.where(\"name\", \"=\", def.name)\n\t\t.orderBy(\"sort_order\", \"asc\")\n\t\t.orderBy(\"label\", \"asc\");\n\tif (locale !== undefined) termsQuery = termsQuery.where(\"locale\", \"=\", locale);\n\n\tconst rows = await termsQuery.execute();\n\n\tconst flatTerms: TaxonomyTermRow[] = rows.map((row) => ({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tlabel: row.label,\n\t\tparent_id: row.parent_id,\n\t\tdata: row.data,\n\t\tlocale: row.locale,\n\t\ttranslation_group: row.translation_group,\n\t}));\n\n\tif (def.hierarchical) return buildTree(flatTerms);\n\n\treturn flatTerms.map((term) => ({\n\t\tid: term.id,\n\t\tname: term.name,\n\t\tslug: term.slug,\n\t\tlabel: term.label,\n\t\tdescription: term.data ? JSON.parse(term.data).description : undefined,\n\t\tchildren: [],\n\t\tlocale: term.locale,\n\t\ttranslationGroup: term.translation_group,\n\t}));\n}\n\n/**\n * Per-translation-group visible-usage counts for one taxonomy, in a single\n * round-trip (see `fetchVisibleTermCounts`). The pivot identity is the\n * translation group, while entry rows are scoped to the resolved locale.\n * Request and object cache keys include that locale so translated views never\n * reuse each other's visible counts.\n */\nfunction getVisibleTermCounts(\n\ttaxonomyName: string,\n\tcollections: string[],\n\tlocale?: string,\n): Promise<Map<string, number>> {\n\t// The collection scope is part of the key: per-locale rows of the same def\n\t// can drift in their declared collections, and a caller may pass a narrower\n\t// scope. Identical inputs (the widget + term-page hot path) still share one\n\t// entry.\n\tconst scope = [...new Set(collections)].toSorted().join(\",\");\n\tconst localeScope = locale ?? \"*\";\n\treturn requestCached(`taxonomy-term-counts:${taxonomyName}:${scope}:${localeScope}`, async () => {\n\t\t// A Map is not JSON-representable — cache the entries, rebuild on read.\n\t\tconst entries = await cachedQuery({\n\t\t\tnamespace: termCountNamespaces(collections),\n\t\t\tkey: `termCounts:${taxonomyName}:${scope}:${localeScope}`,\n\t\t\tload: async (): Promise<Array<[string, number]>> => {\n\t\t\t\tconst db = await getDb();\n\t\t\t\treturn [...(await fetchVisibleTermCounts(db, taxonomyName, collections, locale))];\n\t\t\t},\n\t\t});\n\t\treturn new Map(entries);\n\t});\n}\n\n/**\n * Get a single term by (taxonomy, slug). Honours the fallback chain — if the\n * slug exists in a fallback locale, we return that row (useful for deep-linking\n * to a term page when the translation is missing).\n *\n * The term row and its visible-entry count are loaded and cached separately: the\n * row depends only on the taxonomy epoch, while the count adds an aggregate over\n * the whole assignment pivot and every counted collection's content epoch. A\n * caller that renders no count passes `includeCounts: false` and skips it.\n */\nexport async function getTerm(\n\ttaxonomyName: string,\n\tslug: string,\n\toptions: TaxonomyTermsOptions = {},\n): Promise<TaxonomyTerm | null> {\n\tconst chain = resolveLocaleChain(options.locale);\n\tconst term = await getTermRow(taxonomyName, slug, chain);\n\tif (!term) return null;\n\tif (options.includeCounts === false) return term;\n\n\tconst collections = (await getTaxonomyDef(taxonomyName, options))?.collections ?? [];\n\tconst counts = await getVisibleTermCounts(taxonomyName, collections, chain[0] ?? term.locale);\n\treturn { ...term, count: counts.get(term.translationGroup ?? term.id) ?? 0 };\n}\n\n/** A single term with its children, without counts, under the taxonomy epoch. */\nfunction getTermRow(\n\ttaxonomyName: string,\n\tslug: string,\n\tchain: string[],\n): Promise<TaxonomyTerm | null> {\n\treturn cachedQuery({\n\t\tnamespace: CacheNamespace.TAXONOMIES,\n\t\tkey: `term:${taxonomyName}:${slug}:${chain.join(\",\")}`,\n\t\tload: () => loadTerm(taxonomyName, slug, chain),\n\t});\n}\n\nasync function loadTerm(\n\ttaxonomyName: string,\n\tslug: string,\n\tchain: string[],\n): Promise<TaxonomyTerm | null> {\n\tconst db = await getDb();\n\n\tlet row: Awaited<ReturnType<ReturnType<typeof selectTerm>[\"executeTakeFirst\"]>>;\n\tconst selectTerm = () =>\n\t\tdb\n\t\t\t.selectFrom(\"taxonomies\")\n\t\t\t.selectAll()\n\t\t\t.where(\"name\", \"=\", taxonomyName)\n\t\t\t.where(\"slug\", \"=\", slug);\n\n\tif (chain.length === 0) {\n\t\trow = await selectTerm().orderBy(\"locale\", \"asc\").executeTakeFirst();\n\t} else {\n\t\trow = undefined;\n\t\tfor (const locale of chain) {\n\t\t\trow = await selectTerm().where(\"locale\", \"=\", locale).executeTakeFirst();\n\t\t\tif (row) break;\n\t\t}\n\t}\n\n\tif (!row) return null;\n\n\tlet childrenQuery = db\n\t\t.selectFrom(\"taxonomies\")\n\t\t.selectAll()\n\t\t// Children store the parent's translation_group in parent_id (not a row\n\t\t// id), so a translated parent still owns its children in its own locale.\n\t\t.where(\"parent_id\", \"=\", row.translation_group ?? row.id)\n\t\t.orderBy(\"sort_order\", \"asc\")\n\t\t.orderBy(\"label\", \"asc\");\n\tconst termLocale = row.locale;\n\tif (termLocale) childrenQuery = childrenQuery.where(\"locale\", \"=\", termLocale);\n\n\tconst childRows = await childrenQuery.execute();\n\n\tconst children = childRows.map<TaxonomyTerm>((child) => ({\n\t\tid: child.id,\n\t\tname: child.name,\n\t\tslug: child.slug,\n\t\tlabel: child.label,\n\t\tparentId: child.parent_id ?? undefined,\n\t\tchildren: [],\n\t\tlocale: child.locale,\n\t\ttranslationGroup: child.translation_group,\n\t}));\n\n\treturn {\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tlabel: row.label,\n\t\tparentId: row.parent_id ?? undefined,\n\t\tdescription: row.data ? JSON.parse(row.data).description : undefined,\n\t\tchildren,\n\t\tlocale: row.locale,\n\t\ttranslationGroup: row.translation_group,\n\t};\n}\n\n/**\n * Terms assigned to a content entry, resolved into the active locale and then\n * the configured default locale.\n */\nexport function getEntryTerms(\n\tcollection: string,\n\tentryId: string,\n\ttaxonomyName?: string,\n\toptions: TaxonomyQueryOptions = {},\n): Promise<TaxonomyTerm[]> {\n\tconst locale = resolveLocale(options.locale);\n\t// requestCached short-circuits to values primed by getAllTermsForEntries\n\t// during entry hydration (same key shape). On a warm content-cache hit\n\t// hydration doesn't run, so the inner cachedQuery serves this from KV\n\t// instead of falling through to D1 on every request.\n\treturn requestCached(\n\t\t`terms:${collection}:${entryId}:${taxonomyName ?? \"*\"}:${locale ?? \"*\"}`,\n\t\t() =>\n\t\t\tcachedQuery({\n\t\t\t\tnamespace: [...contentCacheNamespaces(collection), CacheNamespace.TAXONOMIES],\n\t\t\t\tkey: `entryTerms:${collection}:${entryId}:${taxonomyName ?? \"*\"}:${locale ?? \"*\"}`,\n\t\t\t\tload: async () => {\n\t\t\t\t\tconst db = await getDb();\n\t\t\t\t\tconst rows = await selectEntryTermRows(db, collection, [entryId], taxonomyName, locale);\n\t\t\t\t\treturn rows.map<TaxonomyTerm>((row) => ({\n\t\t\t\t\t\tid: row.id,\n\t\t\t\t\t\tname: row.name,\n\t\t\t\t\t\tslug: row.slug,\n\t\t\t\t\t\tlabel: row.label,\n\t\t\t\t\t\tparentId: row.parent_id ?? undefined,\n\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\tlocale: row.locale,\n\t\t\t\t\t\ttranslationGroup: row.translation_group,\n\t\t\t\t\t}));\n\t\t\t\t},\n\t\t\t}),\n\t);\n}\n\n/**\n * Terms for multiple entries of one taxonomy, single query.\n */\nexport async function getTermsForEntries(\n\tcollection: string,\n\tentryIds: string[],\n\ttaxonomyName: string,\n\toptions: TaxonomyQueryOptions = {},\n): Promise<Map<string, TaxonomyTerm[]>> {\n\tconst uniqueIds = [...new Set(entryIds)];\n\tif (uniqueIds.length === 0) return new Map();\n\tconst locale = resolveLocale(options.locale);\n\tconst localeKey = locale ?? \"*\";\n\n\t// The query result is a Map, which JSON can't represent — cache it as an\n\t// array of [entryId, terms] pairs and rebuild the Map on read.\n\tconst load = async (): Promise<Array<[string, TaxonomyTerm[]]>> => {\n\t\tconst result = new Map<string, TaxonomyTerm[]>();\n\t\tfor (const id of uniqueIds) result.set(id, []);\n\n\t\t// Entry-term hydration (getAllTermsForEntries -> primeEntryTermsCache)\n\t\t// seeds the per-entry cache under the same key getEntryTerms uses:\n\t\t// `terms:${collection}:${entryId}:${taxonomyName}:${localeKey}`, storing a\n\t\t// TaxonomyTerm[] (including `[]` for entries with no terms). Satisfy those\n\t\t// from cache and run the batched query only for the ids that missed.\n\t\tconst missedIds: string[] = [];\n\t\ttype CacheRead = { id: string; terms: TaxonomyTerm[] } | { id: string; miss: true };\n\t\tconst cacheReads: Array<Promise<CacheRead>> = [];\n\t\tfor (const id of uniqueIds) {\n\t\t\tconst cached = peekRequestCache<TaxonomyTerm[]>(\n\t\t\t\t`terms:${collection}:${id}:${taxonomyName}:${localeKey}`,\n\t\t\t);\n\t\t\tif (cached) {\n\t\t\t\t// A peeked promise can reject (e.g. a sibling getEntryTerms hit a\n\t\t\t\t// missing table). Treat a rejection as a cache miss so the batched\n\t\t\t\t// query path -- and its isMissingTableError guard below -- still runs,\n\t\t\t\t// rather than propagating an uncaught error.\n\t\t\t\tcacheReads.push(\n\t\t\t\t\tcached.then(\n\t\t\t\t\t\t(terms): CacheRead => ({ id, terms }),\n\t\t\t\t\t\t(): CacheRead => ({ id, miss: true }),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmissedIds.push(id);\n\t\t\t}\n\t\t}\n\t\tfor (const read of await Promise.all(cacheReads)) {\n\t\t\tif (\"miss\" in read) {\n\t\t\t\tmissedIds.push(read.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Return a private copy. The cached array and its term objects are shared\n\t\t\t// with getEntryTerms/getAllTermsForEntries (primeEntryTermsCache stores\n\t\t\t// the same references), so a caller that mutates the result -- sorting in\n\t\t\t// place, pushing into `children` -- must not poison the cache. The\n\t\t\t// pre-cache implementation always returned freshly built arrays.\n\t\t\tresult.set(\n\t\t\t\tread.id,\n\t\t\t\tread.terms.map((t) => ({ ...t, children: [...t.children] })),\n\t\t\t);\n\t\t}\n\n\t\tif (missedIds.length === 0) return [...result.entries()];\n\n\t\tconst db = await getDb();\n\t\tfor (const chunk of chunks(missedIds, SQL_BATCH_SIZE)) {\n\t\t\tlet rows;\n\t\t\ttry {\n\t\t\t\trows = await selectEntryTermRows(db, collection, chunk, taxonomyName, locale);\n\t\t\t} catch (error) {\n\t\t\t\tif (isMissingTableError(error)) return [...result.entries()];\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tfor (const row of rows) {\n\t\t\t\tconst term: TaxonomyTerm = {\n\t\t\t\t\tid: row.id,\n\t\t\t\t\tname: row.name,\n\t\t\t\t\tslug: row.slug,\n\t\t\t\t\tlabel: row.label,\n\t\t\t\t\tparentId: row.parent_id ?? undefined,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\tlocale: row.locale,\n\t\t\t\t\ttranslationGroup: row.translation_group,\n\t\t\t\t};\n\t\t\t\tconst terms = result.get(row.entry_id);\n\t\t\t\tif (terms) terms.push(term);\n\t\t\t}\n\t\t}\n\n\t\treturn [...result.entries()];\n\t};\n\n\t// Key on the sorted unique ids. Bound the key length: very large batches\n\t// (rare; they come from collection hydration, already served by the content\n\t// cache) bypass the object cache rather than blow past KV's key limit.\n\tconst idKey = uniqueIds.toSorted().join(\",\");\n\tconst pairs =\n\t\tidKey.length <= 256\n\t\t\t? await cachedQuery({\n\t\t\t\t\tnamespace: [...contentCacheNamespaces(collection), CacheNamespace.TAXONOMIES],\n\t\t\t\t\tkey: `termsForEntries:${collection}:${taxonomyName}:${locale ?? \"*\"}:${idKey}`,\n\t\t\t\t\tload,\n\t\t\t\t})\n\t\t\t: await load();\n\n\treturn new Map(pairs);\n}\n\n/**\n * Batch-fetch terms for multiple entries across ALL taxonomies in one query.\n * Primes the request-cache for subsequent per-entry calls to `getEntryTerms`.\n */\nexport async function getAllTermsForEntries(\n\tcollection: string,\n\tentryIds: string[],\n\toptions: TaxonomyQueryOptions = {},\n): Promise<Map<string, Record<string, TaxonomyTerm[]>>> {\n\tconst result = new Map<string, Record<string, TaxonomyTerm[]>>();\n\tconst uniqueIds = [...new Set(entryIds)];\n\tfor (const id of uniqueIds) result.set(id, {});\n\tif (uniqueIds.length === 0) return result;\n\n\tconst db = await getDb();\n\tconst locale = resolveLocale(options.locale);\n\tconst applicableTaxonomyNames = await getCollectionTaxonomyNames(collection, { locale });\n\n\tfor (const chunk of chunks(uniqueIds, SQL_BATCH_SIZE)) {\n\t\tlet rows;\n\t\ttry {\n\t\t\trows = await selectEntryTermRows(db, collection, chunk, undefined, locale);\n\t\t} catch (error) {\n\t\t\tif (isMissingTableError(error)) {\n\t\t\t\tfor (const id of uniqueIds) {\n\t\t\t\t\tprimeEntryTermsCache(collection, id, {}, applicableTaxonomyNames, locale);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\n\t\tfor (const row of rows) {\n\t\t\tconst term: TaxonomyTerm = {\n\t\t\t\tid: row.id,\n\t\t\t\tname: row.name,\n\t\t\t\tslug: row.slug,\n\t\t\t\tlabel: row.label,\n\t\t\t\tparentId: row.parent_id ?? undefined,\n\t\t\t\tchildren: [],\n\t\t\t\tlocale: row.locale,\n\t\t\t\ttranslationGroup: row.translation_group,\n\t\t\t};\n\t\t\tconst byTaxonomy = result.get(row.entry_id);\n\t\t\tif (!byTaxonomy) continue;\n\t\t\tconst existing = byTaxonomy[row.name];\n\t\t\tif (existing) existing.push(term);\n\t\t\telse byTaxonomy[row.name] = [term];\n\t\t}\n\t}\n\n\tfor (const [entryId, byTaxonomy] of result) {\n\t\tprimeEntryTermsCache(collection, entryId, byTaxonomy, applicableTaxonomyNames, locale);\n\t}\n\n\treturn result;\n}\n\n/**\n * Return the list of taxonomy names applicable to a collection, request-\n * cached so a page render only pays for it once.\n *\n * Returns an empty list when taxonomies haven't been defined yet.\n */\nasync function getCollectionTaxonomyNames(\n\tcollection: string,\n\toptions: TaxonomyQueryOptions,\n): Promise<string[]> {\n\ttry {\n\t\tconst defs = await getTaxonomyDefs(options);\n\t\treturn defs.filter((d) => d.collections.includes(collection)).map((d) => d.name);\n\t} catch (error) {\n\t\tif (isMissingTableError(error)) return [];\n\t\tthrow error;\n\t}\n}\n\n/**\n * Pre-populate the request-cache for every getEntryTerms call-shape that\n * could hit this entry:\n *\n * getEntryTerms(collection, entryId) -> key `terms:C:E:*`\n * getEntryTerms(collection, entryId, \"tag\") -> key `terms:C:E:tag`\n * getEntryTerms(collection, entryId, \"category\") -> key `terms:C:E:category`\n * ...one per taxonomy that applies to this collection\n *\n * Taxonomies with no rows on this entry are seeded with `[]` so legacy\n * callers short-circuit to the cached empty array instead of re-querying.\n */\nfunction primeEntryTermsCache(\n\tcollection: string,\n\tentryId: string,\n\tbyTaxonomy: Record<string, TaxonomyTerm[]>,\n\tapplicableTaxonomyNames: string[],\n\tlocale: string | undefined,\n): void {\n\tconst localeKey = locale ?? \"*\";\n\tfor (const name of applicableTaxonomyNames) {\n\t\tsetRequestCacheEntry(\n\t\t\t`terms:${collection}:${entryId}:${name}:${localeKey}`,\n\t\t\tbyTaxonomy[name] ?? [],\n\t\t);\n\t}\n\tfor (const [name, terms] of Object.entries(byTaxonomy)) {\n\t\tsetRequestCacheEntry(`terms:${collection}:${entryId}:${name}:${localeKey}`, terms);\n\t}\n\tconst allTerms = Object.values(byTaxonomy).flat();\n\tsetRequestCacheEntry(`terms:${collection}:${entryId}:*:${localeKey}`, allTerms);\n}\n\n/**\n * Prime the per-entry request cache from terms that were folded into the\n * content query (query.ts `hydrateEntryTerms` fast path), so subsequent\n * `getEntryTerms` calls in the same render hit the cache instead of issuing an\n * N+1 query. Seeds the wildcard key and one key per taxonomy present on the\n * entry — purely from the folded data, with no DB lookup.\n *\n * Unlike `getAllTermsForEntries`, this deliberately does NOT seed `[]` for\n * taxonomies that apply to the collection but have no rows on the entry: doing\n * so would require a `getTaxonomyDefs` query, adding a round trip to every fold\n * render to serve the rarer `getEntryTerms(id, absentTaxonomy)` case from cache.\n * That call simply falls through to its own cached query. Keeping the key shape\n * here (rather than in query.ts) prevents the two from drifting.\n */\nexport function primeFoldedEntryTerms(\n\tcollection: string,\n\tperEntry: Array<{ entryId: string; byTaxonomy: Record<string, TaxonomyTerm[]> }>,\n\toptions: TaxonomyQueryOptions = {},\n): void {\n\tif (perEntry.length === 0) return;\n\tconst locale = resolveLocale(options.locale);\n\tfor (const { entryId, byTaxonomy } of perEntry) {\n\t\tprimeEntryTermsCache(collection, entryId, byTaxonomy, [], locale);\n\t}\n}\n\n/**\n * Get entries by term. Both the lookup (term slug in the active locale) and\n * the content query respect the active locale.\n */\nexport async function getEntriesByTerm(\n\tcollection: string,\n\ttaxonomyName: string,\n\ttermSlug: string,\n\toptions: TaxonomyQueryOptions = {},\n): Promise<Array<{ id: string; data: Record<string, unknown> }>> {\n\tconst { getEmDashCollection } = await import(\"../query.js\");\n\n\tconst queryOptions: Record<string, unknown> = {\n\t\twhere: { [taxonomyName]: termSlug },\n\t};\n\tif (options.locale !== undefined) queryOptions.locale = options.locale;\n\tconst { entries } = await getEmDashCollection(collection, queryOptions);\n\treturn entries;\n}\n\nfunction rowToTaxonomyDef(row: {\n\tid: string;\n\tname: string;\n\tlabel: string;\n\tlabel_singular: string | null;\n\thierarchical: number;\n\tcollections: string | null;\n\tlocale: string;\n\ttranslation_group: string | null;\n}): TaxonomyDef {\n\treturn {\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tlabel: row.label,\n\t\tlabelSingular: row.label_singular ?? undefined,\n\t\thierarchical: row.hierarchical === 1,\n\t\tcollections: row.collections ? JSON.parse(row.collections) : [],\n\t\tlocale: row.locale,\n\t\ttranslationGroup: row.translation_group,\n\t};\n}\n\n/**\n * Build tree structure from flat terms\n */\nfunction buildTree(flatTerms: TaxonomyTermRow[]): TaxonomyTerm[] {\n\t// parent_id holds the parent's translation_group, so link children by it.\n\t// Key by (locale, group): a child's parent lives in the same locale, and an\n\t// unfiltered set mixes locales whose translated siblings share a group —\n\t// keying by group alone would collide and misattach children across locales.\n\tconst byLocaleGroup = new Map<string, TaxonomyTerm>();\n\tconst nodes: TaxonomyTerm[] = [];\n\tconst roots: TaxonomyTerm[] = [];\n\n\tfor (const term of flatTerms) {\n\t\tconst node: TaxonomyTerm = {\n\t\t\tid: term.id,\n\t\t\tname: term.name,\n\t\t\tslug: term.slug,\n\t\t\tlabel: term.label,\n\t\t\tparentId: term.parent_id ?? undefined,\n\t\t\tdescription: term.data ? JSON.parse(term.data).description : undefined,\n\t\t\tchildren: [],\n\t\t\tlocale: term.locale,\n\t\t\ttranslationGroup: term.translation_group,\n\t\t};\n\t\tbyLocaleGroup.set(`${term.locale}::${term.translation_group ?? term.id}`, node);\n\t\tnodes.push(node);\n\t}\n\n\tfor (const node of nodes) {\n\t\tconst parent = node.parentId\n\t\t\t? byLocaleGroup.get(`${node.locale}::${node.parentId}`)\n\t\t\t: undefined;\n\t\tif (parent) {\n\t\t\tparent.children.push(node);\n\t\t} else {\n\t\t\troots.push(node);\n\t\t}\n\t}\n\n\treturn roots;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,SAAS,iBACR,IACA,cACA,YACA,QACyB;AACzB,QAAO,GAAG;;;eAGI,IAAI,IAAI,MAAM,aAAa,CAAC;;yBAElB,WAAW;kFAC8C,aAAa;KAC1F,SAAS,GAAG,kBAAkB,WAAW,GAAG,GAAG;SAC3C,qBAAqB,IAAI,aAAa,IAAI,CAAC;;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AAK,CAAC,cAAc;GAC7D,UAAU,EAAE;GACZ,QAAQ,KAAK;GACb,kBAAkB,KAAK;GACvB;AACD,gBAAc,IAAI,GAAG,KAAK,OAAO,IAAI,KAAK,qBAAqB,KAAK,MAAM,KAAK;AAC/E,QAAM,KAAK,KAAK;;AAGjB,MAAK,MAAM,QAAQ,OAAO;EACzB,MAAM,SAAS,KAAK,WACjB,cAAc,IAAI,GAAG,KAAK,OAAO,IAAI,KAAK,WAAW,GACrD;AACH,MAAI,OACH,QAAO,SAAS,KAAK,KAAK;MAE1B,OAAM,KAAK,KAAK;;AAIlB,QAAO"}
|
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
import { u as __exportAll } from "./runner-CIltKk4i.mjs";
|
|
2
|
-
import { t as validateIdentifier } from "./validate-DANX1-Qi.mjs";
|
|
3
|
-
import { p as invalidateTaxonomyObjectCache } from "./object-cache-DlSVbn5Y.mjs";
|
|
4
|
-
import { n as slugify } from "./slugify-T5GHH42D.mjs";
|
|
5
|
-
import { t as withTransaction } from "./transaction-BcJO4Tmc.mjs";
|
|
6
|
-
import { sql } from "kysely";
|
|
7
|
-
import { ulid } from "ulidx";
|
|
8
|
-
|
|
9
|
-
//#region src/database/repositories/taxonomy.ts
|
|
10
|
-
var taxonomy_exports = /* @__PURE__ */ __exportAll({ TaxonomyRepository: () => TaxonomyRepository });
|
|
11
|
-
/**
|
|
12
|
-
* Translation groups per reorder `UPDATE`. Each costs three bound parameters —
|
|
13
|
-
* a CASE `WHEN`/`THEN` pair plus one slot in the `IN` list — which keeps a
|
|
14
|
-
* statement inside D1's 100-parameter ceiling.
|
|
15
|
-
*/
|
|
16
|
-
const GROUPS_PER_UPDATE = 32;
|
|
17
|
-
const NUMERIC_SUFFIX_PATTERN = /^\d+$/;
|
|
18
|
-
/** Deal the listed groups back out over the slots they hold, in the order given. */
|
|
19
|
-
function permuteWithinSlots(listed, occupied) {
|
|
20
|
-
const slots = occupied.toSorted((a, b) => a - b);
|
|
21
|
-
const target = /* @__PURE__ */ new Map();
|
|
22
|
-
listed.forEach((group, index) => {
|
|
23
|
-
const position = slots[index];
|
|
24
|
-
if (position !== void 0) target.set(group, position);
|
|
25
|
-
});
|
|
26
|
-
return target;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Renumber a whole sibling group 0..n-1, with the listed groups in the order
|
|
30
|
-
* given and every other member left in the place it already held.
|
|
31
|
-
*
|
|
32
|
-
* Works off each member's index in the sequence rather than its stored value,
|
|
33
|
-
* which is what lets it resolve positions that tie. The sort is stable, so
|
|
34
|
-
* tied members keep the order `siblings` arrives in — deterministic, but a
|
|
35
|
-
* listing that mixes locales breaks a tie on whichever locale's label sorts
|
|
36
|
-
* first, not on the order any one caller rendered.
|
|
37
|
-
*/
|
|
38
|
-
function renumberSiblings(listed, siblings) {
|
|
39
|
-
const sequence = siblings.toSorted((a, b) => a.position - b.position);
|
|
40
|
-
const wanted = new Set(listed);
|
|
41
|
-
const target = /* @__PURE__ */ new Map();
|
|
42
|
-
let next = 0;
|
|
43
|
-
sequence.forEach(({ group }, index) => {
|
|
44
|
-
const replacement = wanted.has(group) ? listed[next++] : void 0;
|
|
45
|
-
target.set(replacement ?? group, index);
|
|
46
|
-
});
|
|
47
|
-
return target;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Taxonomy repository for categories, tags, and other classification.
|
|
51
|
-
*
|
|
52
|
-
* Terms are per-locale. Translations of the same term share a `translation_group`
|
|
53
|
-
* ULID. `content_taxonomies` stores translation_groups on both sides so a single
|
|
54
|
-
* association spans every locale of a post and term.
|
|
55
|
-
*
|
|
56
|
-
* Strict lookup methods use only the locale callers supply. The explicitly
|
|
57
|
-
* resolved methods accept both the preferred and default locales so their
|
|
58
|
-
* fallback policy stays visible at the call site.
|
|
59
|
-
*
|
|
60
|
-
* `sort_order` is per translation_group, not per row: every row sharing a
|
|
61
|
-
* translation_group carries the same value, so a term holds one position across
|
|
62
|
-
* all its locales. Sibling groups are keyed on the raw `parent_id` column, which
|
|
63
|
-
* is locale-agnostic for the same reason (it stores the parent's
|
|
64
|
-
* translation_group). Writes must preserve both invariants.
|
|
65
|
-
*/
|
|
66
|
-
var TaxonomyRepository = class {
|
|
67
|
-
constructor(db) {
|
|
68
|
-
this.db = db;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Create a new taxonomy term. When `translationOf` is set the new row joins
|
|
72
|
-
* the source term's translation_group; otherwise a fresh group is minted
|
|
73
|
-
* (matching the migration backfill pattern `translation_group = id`).
|
|
74
|
-
*/
|
|
75
|
-
async create(input) {
|
|
76
|
-
const id = ulid();
|
|
77
|
-
const parentInput = input.parentId === void 0 || input.parentId === "" ? null : input.parentId;
|
|
78
|
-
const parentId = parentInput ? await this.resolveParentRef(parentInput) : null;
|
|
79
|
-
let translationGroup = id;
|
|
80
|
-
let sortOrder = null;
|
|
81
|
-
if (input.translationOf) {
|
|
82
|
-
const source = await this.findById(input.translationOf);
|
|
83
|
-
if (source?.translationGroup) translationGroup = source.translationGroup;
|
|
84
|
-
if (source && source.parentId === parentId) sortOrder = source.sortOrder;
|
|
85
|
-
}
|
|
86
|
-
sortOrder ??= await this.nextSortOrder(input.name, parentId);
|
|
87
|
-
await this.db.insertInto("taxonomies").values({
|
|
88
|
-
id,
|
|
89
|
-
name: input.name,
|
|
90
|
-
slug: input.slug,
|
|
91
|
-
label: input.label,
|
|
92
|
-
parent_id: parentId,
|
|
93
|
-
data: input.data ? JSON.stringify(input.data) : null,
|
|
94
|
-
sort_order: sortOrder,
|
|
95
|
-
...input.locale !== void 0 ? { locale: input.locale } : {},
|
|
96
|
-
translation_group: translationGroup
|
|
97
|
-
}).execute();
|
|
98
|
-
invalidateTaxonomyObjectCache();
|
|
99
|
-
const taxonomy = await this.findById(id);
|
|
100
|
-
if (!taxonomy) throw new Error("Failed to create taxonomy");
|
|
101
|
-
return taxonomy;
|
|
102
|
-
}
|
|
103
|
-
async findById(id) {
|
|
104
|
-
const row = await this.db.selectFrom("taxonomies").selectAll().where("id", "=", id).executeTakeFirst();
|
|
105
|
-
return row ? this.rowToTaxonomy(row) : null;
|
|
106
|
-
}
|
|
107
|
-
/** Resolve either a locale row id or a locale-agnostic translation group. */
|
|
108
|
-
async findByIdOrTranslationGroup(id) {
|
|
109
|
-
const row = await this.db.selectFrom("taxonomies").selectAll().where((eb) => eb.or([eb("id", "=", id), eb("translation_group", "=", id)])).orderBy("locale", "asc").orderBy("id", "asc").executeTakeFirst();
|
|
110
|
-
return row ? this.rowToTaxonomy(row) : null;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Find a term by (name, slug). When `locale` is provided, filter by it.
|
|
114
|
-
* When omitted, returns the lowest-locale-code match (deterministic across
|
|
115
|
-
* calls). Mirrors `ContentRepository.findBySlug`.
|
|
116
|
-
*/
|
|
117
|
-
async findBySlug(name, slug, locale) {
|
|
118
|
-
let query = this.db.selectFrom("taxonomies").selectAll().where("name", "=", name).where("slug", "=", slug);
|
|
119
|
-
if (locale !== void 0) query = query.where("locale", "=", locale);
|
|
120
|
-
const row = await query.orderBy("locale", "asc").executeTakeFirst();
|
|
121
|
-
return row ? this.rowToTaxonomy(row) : null;
|
|
122
|
-
}
|
|
123
|
-
/** Generate a locale-scoped term slug, adding a numeric suffix when needed. */
|
|
124
|
-
async generateUniqueSlug(name, text, locale) {
|
|
125
|
-
const baseSlug = slugify(text);
|
|
126
|
-
let query = this.db.selectFrom("taxonomies").select("slug").where("name", "=", name).where((eb) => eb.or([eb("slug", "=", baseSlug), eb("slug", "like", `${baseSlug}-%`)]));
|
|
127
|
-
if (locale !== void 0) query = query.where("locale", "=", locale);
|
|
128
|
-
const candidates = await query.execute();
|
|
129
|
-
if (!candidates.some((candidate) => candidate.slug === baseSlug)) return baseSlug;
|
|
130
|
-
let maxSuffix = 0;
|
|
131
|
-
const prefix = `${baseSlug}-`;
|
|
132
|
-
for (const candidate of candidates) {
|
|
133
|
-
if (!candidate.slug.startsWith(prefix)) continue;
|
|
134
|
-
const suffix = candidate.slug.slice(prefix.length);
|
|
135
|
-
if (!NUMERIC_SUFFIX_PATTERN.test(suffix)) continue;
|
|
136
|
-
maxSuffix = Math.max(maxSuffix, Number.parseInt(suffix, 10));
|
|
137
|
-
}
|
|
138
|
-
return `${baseSlug}-${maxSuffix + 1}`;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Get all terms for a taxonomy (e.g., all categories).
|
|
142
|
-
*
|
|
143
|
-
* `sort_order` carries the manual order set from the admin; it is 0 for
|
|
144
|
-
* terms nobody has reordered, so an untouched taxonomy still comes back
|
|
145
|
-
* alphabetically. `id asc` is a stable tiebreaker for terms that share both
|
|
146
|
-
* values. Without it the SQL ordering is implementation-defined when they match.
|
|
147
|
-
*/
|
|
148
|
-
async findByName(name, options = {}) {
|
|
149
|
-
let query = this.db.selectFrom("taxonomies").selectAll().where("name", "=", name).orderBy("sort_order", "asc").orderBy("label", "asc").orderBy("id", "asc");
|
|
150
|
-
if (options.locale !== void 0) query = query.where("locale", "=", options.locale);
|
|
151
|
-
if (options.parentId !== void 0) if (options.parentId === null) query = query.where("parent_id", "is", null);
|
|
152
|
-
else query = query.where("parent_id", "=", options.parentId);
|
|
153
|
-
return (await query.execute()).map((row) => this.rowToTaxonomy(row));
|
|
154
|
-
}
|
|
155
|
-
async findByNameResolved(name, locale, defaultLocale) {
|
|
156
|
-
const locales = [...new Set([locale, defaultLocale])];
|
|
157
|
-
const rows = await this.db.selectFrom("taxonomies").selectAll().where("name", "=", name).where("locale", "in", locales).orderBy("sort_order", "asc").orderBy("label", "asc").orderBy("id", "asc").execute();
|
|
158
|
-
const selected = /* @__PURE__ */ new Map();
|
|
159
|
-
for (const row of rows) {
|
|
160
|
-
const term = this.rowToTaxonomy(row);
|
|
161
|
-
const group = term.translationGroup ?? term.id;
|
|
162
|
-
if (!selected.get(group) || term.locale === locale) selected.set(group, term);
|
|
163
|
-
}
|
|
164
|
-
return [...selected.values()].toSorted((a, b) => a.sortOrder - b.sortOrder || a.label.localeCompare(b.label) || a.id.localeCompare(b.id));
|
|
165
|
-
}
|
|
166
|
-
async findPageByName(name, options = {}) {
|
|
167
|
-
const limit = Math.max(1, Math.min(options.limit ?? 50, 100));
|
|
168
|
-
let query = this.db.selectFrom("taxonomies").selectAll().where("name", "=", name);
|
|
169
|
-
if (options.locale !== void 0) query = query.where("locale", "=", options.locale);
|
|
170
|
-
if (options.parentId !== void 0) query = options.parentId === null ? query.where("parent_id", "is", null) : query.where("parent_id", "=", options.parentId);
|
|
171
|
-
if (options.cursor) {
|
|
172
|
-
const cursor = options.cursor;
|
|
173
|
-
query = query.where((eb) => eb.or([
|
|
174
|
-
eb("sort_order", ">", cursor.sortOrder),
|
|
175
|
-
eb.and([eb("sort_order", "=", cursor.sortOrder), eb("label", ">", cursor.label)]),
|
|
176
|
-
eb.and([
|
|
177
|
-
eb("sort_order", "=", cursor.sortOrder),
|
|
178
|
-
eb("label", "=", cursor.label),
|
|
179
|
-
eb("id", ">", cursor.id)
|
|
180
|
-
])
|
|
181
|
-
]));
|
|
182
|
-
}
|
|
183
|
-
query = query.orderBy("sort_order", "asc").orderBy("label", "asc").orderBy("id", "asc");
|
|
184
|
-
const rows = await query.limit(limit + 1).execute();
|
|
185
|
-
return {
|
|
186
|
-
items: rows.slice(0, limit).map((row) => this.rowToTaxonomy(row)),
|
|
187
|
-
hasMore: rows.length > limit
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Children of a term. Accepts a term id OR a translation_group and resolves
|
|
192
|
-
* to the group, since `parent_id` stores the parent's translation_group.
|
|
193
|
-
* Pass `locale` to scope to one locale's tree (children share the parent's
|
|
194
|
-
* group across locales); omit it to find children in every locale (used to
|
|
195
|
-
* block deletes that would orphan a sibling translation's subtree).
|
|
196
|
-
*/
|
|
197
|
-
async findChildren(parentIdOrGroup, locale) {
|
|
198
|
-
const group = await this.resolveTranslationGroup(parentIdOrGroup);
|
|
199
|
-
if (!group) return [];
|
|
200
|
-
let query = this.db.selectFrom("taxonomies").selectAll().where("parent_id", "=", group).orderBy("sort_order", "asc").orderBy("label", "asc").orderBy("id", "asc");
|
|
201
|
-
if (locale !== void 0) query = query.where("locale", "=", locale);
|
|
202
|
-
return (await query.execute()).map((row) => this.rowToTaxonomy(row));
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Every translation sibling of a term (including itself), identified by
|
|
206
|
-
* their shared `translation_group`.
|
|
207
|
-
*/
|
|
208
|
-
async findTranslations(translationGroup) {
|
|
209
|
-
return (await this.db.selectFrom("taxonomies").selectAll().where("translation_group", "=", translationGroup).orderBy("locale", "asc").execute()).map((row) => this.rowToTaxonomy(row));
|
|
210
|
-
}
|
|
211
|
-
async update(id, input) {
|
|
212
|
-
const existing = await this.findById(id);
|
|
213
|
-
if (!existing) return null;
|
|
214
|
-
const updates = {};
|
|
215
|
-
if (input.slug !== void 0) updates.slug = input.slug;
|
|
216
|
-
if (input.label !== void 0) updates.label = input.label;
|
|
217
|
-
if (input.data !== void 0) updates.data = JSON.stringify(input.data);
|
|
218
|
-
const group = {};
|
|
219
|
-
if (input.parentId !== void 0) {
|
|
220
|
-
const parentId = input.parentId === "" || input.parentId === null ? null : await this.resolveParentRef(input.parentId);
|
|
221
|
-
if (parentId !== existing.parentId) {
|
|
222
|
-
group.parent_id = parentId;
|
|
223
|
-
group.sort_order = await this.nextSortOrder(existing.name, parentId);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
const hasRowUpdates = Object.keys(updates).length > 0;
|
|
227
|
-
const hasGroupUpdates = Object.keys(group).length > 0;
|
|
228
|
-
if (hasRowUpdates || hasGroupUpdates) {
|
|
229
|
-
await withTransaction(this.db, async (trx) => {
|
|
230
|
-
if (hasRowUpdates) await trx.updateTable("taxonomies").set(updates).where("id", "=", id).execute();
|
|
231
|
-
if (hasGroupUpdates) await trx.updateTable("taxonomies").set(group).where("translation_group", "=", existing.translationGroup ?? existing.id).execute();
|
|
232
|
-
});
|
|
233
|
-
invalidateTaxonomyObjectCache();
|
|
234
|
-
}
|
|
235
|
-
return this.findById(id);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Move `groups` (translation_groups, in the desired order) into the positions
|
|
239
|
-
* those same groups already occupy, leaving every other member of the sibling
|
|
240
|
-
* group where it is.
|
|
241
|
-
*
|
|
242
|
-
* `groups` may be a subset: a locale renders only the terms translated into
|
|
243
|
-
* it, so an admin in `fr` often cannot name every member. A group left out
|
|
244
|
-
* keeps its place, which is also what makes a stale list harmless.
|
|
245
|
-
*
|
|
246
|
-
* `siblings` is every member of the group with the position it holds, in a
|
|
247
|
-
* listing's order — tied positions are resolved by that order, so pass it as
|
|
248
|
-
* read. Groups already at their target are skipped, so one swap rewrites two
|
|
249
|
-
* groups rather than the whole list.
|
|
250
|
-
*/
|
|
251
|
-
async reorder(groups, siblings) {
|
|
252
|
-
const current = new Map(siblings.map(({ group, position }) => [group, position]));
|
|
253
|
-
const listed = [];
|
|
254
|
-
const occupied = [];
|
|
255
|
-
for (const group of groups) {
|
|
256
|
-
const position = current.get(group);
|
|
257
|
-
if (position === void 0) continue;
|
|
258
|
-
listed.push(group);
|
|
259
|
-
occupied.push(position);
|
|
260
|
-
}
|
|
261
|
-
if (listed.length === 0) return;
|
|
262
|
-
const changed = [...new Set(occupied).size === occupied.length ? permuteWithinSlots(listed, occupied) : renumberSiblings(listed, siblings)].filter(([group, position]) => current.get(group) !== position);
|
|
263
|
-
if (changed.length === 0) return;
|
|
264
|
-
await this.applyPositions(changed);
|
|
265
|
-
invalidateTaxonomyObjectCache();
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Write one position per translation_group, GROUPS_PER_UPDATE at a time so
|
|
269
|
-
* each statement stays inside D1's parameter ceiling.
|
|
270
|
-
*
|
|
271
|
-
* D1 has no transactions — `withTransaction` runs its callback bare there —
|
|
272
|
-
* so a chunk is the unit that can't tear. A reorder spanning several chunks
|
|
273
|
-
* can, and leaves ties, which the next reorder renumbers away.
|
|
274
|
-
*/
|
|
275
|
-
async applyPositions(positions) {
|
|
276
|
-
for (let index = 0; index < positions.length; index += GROUPS_PER_UPDATE) {
|
|
277
|
-
const chunk = positions.slice(index, index + GROUPS_PER_UPDATE);
|
|
278
|
-
await sql`
|
|
279
|
-
UPDATE taxonomies
|
|
280
|
-
SET sort_order = CASE translation_group ${sql.join(chunk.map(([group, position]) => sql`WHEN ${group} THEN CAST(${position} AS INTEGER)`), sql` `)} END
|
|
281
|
-
WHERE translation_group IN (${sql.join(chunk.map(([group]) => sql`${group}`))})
|
|
282
|
-
`.execute(this.db);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Position for a term joining a sibling group: one past the last member, or
|
|
287
|
-
* 0 when the group is empty.
|
|
288
|
-
*
|
|
289
|
-
* Bounds are taken across every locale because a position belongs to the
|
|
290
|
-
* translation_group, not to a row — a term translated into only one locale
|
|
291
|
-
* still occupies its slot for all of them.
|
|
292
|
-
*/
|
|
293
|
-
async nextSortOrder(name, parentId) {
|
|
294
|
-
let query = this.db.selectFrom("taxonomies").select((eb) => eb.fn.max("sort_order").as("max")).where("name", "=", name);
|
|
295
|
-
query = parentId === null ? query.where("parent_id", "is", null) : query.where("parent_id", "=", parentId);
|
|
296
|
-
const bounds = await query.executeTakeFirst();
|
|
297
|
-
if (!bounds || bounds.max === null) return 0;
|
|
298
|
-
return bounds.max + 1;
|
|
299
|
-
}
|
|
300
|
-
async delete(id) {
|
|
301
|
-
const term = await this.findById(id);
|
|
302
|
-
if (!term) return false;
|
|
303
|
-
if (term.translationGroup) {
|
|
304
|
-
if ((await this.db.selectFrom("taxonomies").select("id").where("translation_group", "=", term.translationGroup).where("id", "!=", id).execute()).length === 0) await this.db.deleteFrom("content_taxonomies").where("taxonomy_id", "=", term.translationGroup).execute();
|
|
305
|
-
}
|
|
306
|
-
const result = await this.db.deleteFrom("taxonomies").where("id", "=", id).executeTakeFirst();
|
|
307
|
-
invalidateTaxonomyObjectCache();
|
|
308
|
-
return (result.numDeletedRows ?? 0n) > 0n;
|
|
309
|
-
}
|
|
310
|
-
async attachToEntry(collection, entryId, taxonomyId) {
|
|
311
|
-
const taxonomyGroup = await this.resolveTranslationGroup(taxonomyId);
|
|
312
|
-
if (!taxonomyGroup) return;
|
|
313
|
-
await this.attachGroupsToEntry(collection, entryId, [taxonomyGroup]);
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Attach already-resolved term translation groups in one insert and return
|
|
317
|
-
* the number of assignments that did not already exist.
|
|
318
|
-
*/
|
|
319
|
-
async attachGroupsToEntry(collection, entryId, taxonomyGroups) {
|
|
320
|
-
const uniqueGroups = [...new Set(taxonomyGroups)];
|
|
321
|
-
if (uniqueGroups.length === 0) return 0;
|
|
322
|
-
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
323
|
-
if (!entryGroup) return 0;
|
|
324
|
-
const result = await this.db.insertInto("content_taxonomies").values(uniqueGroups.map((taxonomy_id) => ({
|
|
325
|
-
collection,
|
|
326
|
-
entry_id: entryGroup,
|
|
327
|
-
taxonomy_id
|
|
328
|
-
}))).onConflict((oc) => oc.doNothing()).executeTakeFirst();
|
|
329
|
-
const inserted = Number(result.numInsertedOrUpdatedRows ?? 0n);
|
|
330
|
-
if (inserted > 0) invalidateTaxonomyObjectCache();
|
|
331
|
-
return inserted;
|
|
332
|
-
}
|
|
333
|
-
async detachFromEntry(collection, entryId, taxonomyId) {
|
|
334
|
-
const [entryGroup, taxonomyGroup] = await Promise.all([this.resolveEntryTranslationGroup(collection, entryId), this.resolveTranslationGroup(taxonomyId)]);
|
|
335
|
-
if (!entryGroup || !taxonomyGroup) return;
|
|
336
|
-
await this.db.deleteFrom("content_taxonomies").where("collection", "=", collection).where("entry_id", "=", entryGroup).where("taxonomy_id", "=", taxonomyGroup).execute();
|
|
337
|
-
invalidateTaxonomyObjectCache();
|
|
338
|
-
}
|
|
339
|
-
/** Remove already-resolved term groups without replacing concurrent assignments. */
|
|
340
|
-
async detachGroupsFromEntry(collection, entryId, taxonomyGroups) {
|
|
341
|
-
const uniqueGroups = [...new Set(taxonomyGroups)];
|
|
342
|
-
if (uniqueGroups.length === 0) return 0;
|
|
343
|
-
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
344
|
-
if (!entryGroup) return 0;
|
|
345
|
-
const result = await this.db.deleteFrom("content_taxonomies").where("collection", "=", collection).where("entry_id", "=", entryGroup).where("taxonomy_id", "in", uniqueGroups).executeTakeFirst();
|
|
346
|
-
const removed = Number(result.numDeletedRows ?? 0n);
|
|
347
|
-
if (removed > 0) invalidateTaxonomyObjectCache();
|
|
348
|
-
return removed;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Taxonomy terms assigned to a content entry, resolved into a specific locale.
|
|
352
|
-
* Terms whose translation_group lacks a row in the requested locale are
|
|
353
|
-
* omitted — callers wanting fallback behaviour apply it themselves.
|
|
354
|
-
*/
|
|
355
|
-
async getTermsForEntry(collection, entryId, taxonomyName, locale) {
|
|
356
|
-
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
357
|
-
if (!entryGroup) return [];
|
|
358
|
-
let query = this.db.selectFrom("content_taxonomies").innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id").selectAll("taxonomies").where("content_taxonomies.collection", "=", collection).where("content_taxonomies.entry_id", "=", entryGroup);
|
|
359
|
-
if (taxonomyName) query = query.where("taxonomies.name", "=", taxonomyName);
|
|
360
|
-
if (locale !== void 0) query = query.where("taxonomies.locale", "=", locale);
|
|
361
|
-
return (await query.orderBy("taxonomies.locale", "asc").execute()).map((row) => this.rowToTaxonomy(row));
|
|
362
|
-
}
|
|
363
|
-
async getTermAssignmentsForEntry(collection, entryId, taxonomyName, locale, defaultLocale) {
|
|
364
|
-
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
365
|
-
if (!entryGroup) return [];
|
|
366
|
-
const rows = await this.db.selectFrom("content_taxonomies").innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id").selectAll("taxonomies").select("content_taxonomies.taxonomy_id as assignment_group").where("content_taxonomies.collection", "=", collection).where("content_taxonomies.entry_id", "=", entryGroup).where("taxonomies.name", "=", taxonomyName).orderBy("content_taxonomies.taxonomy_id", "asc").orderBy("taxonomies.locale", "asc").execute();
|
|
367
|
-
const byGroup = /* @__PURE__ */ new Map();
|
|
368
|
-
for (const row of rows) {
|
|
369
|
-
const variants = byGroup.get(row.assignment_group) ?? [];
|
|
370
|
-
variants.push(this.rowToTaxonomy(row));
|
|
371
|
-
byGroup.set(row.assignment_group, variants);
|
|
372
|
-
}
|
|
373
|
-
return Array.from(byGroup, ([translationGroup, variants]) => {
|
|
374
|
-
return {
|
|
375
|
-
translationGroup,
|
|
376
|
-
term: variants.find((variant) => variant.locale === locale) ?? variants.find((variant) => variant.locale === defaultLocale) ?? null,
|
|
377
|
-
availableLocales: variants.map((variant) => variant.locale),
|
|
378
|
-
translations: variants.map((variant) => ({
|
|
379
|
-
id: variant.id,
|
|
380
|
-
slug: variant.slug,
|
|
381
|
-
locale: variant.locale
|
|
382
|
-
}))
|
|
383
|
-
};
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Replace all assignments of a given taxonomy for one content entry.
|
|
388
|
-
* Term ids OR translation_groups are accepted and normalised to groups.
|
|
389
|
-
*/
|
|
390
|
-
async setTermsForEntry(collection, entryId, taxonomyName, termIds) {
|
|
391
|
-
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
392
|
-
if (!entryGroup) return;
|
|
393
|
-
const groups = [];
|
|
394
|
-
for (const id of termIds) {
|
|
395
|
-
const group = await this.resolveTranslationGroup(id);
|
|
396
|
-
if (group) groups.push(group);
|
|
397
|
-
}
|
|
398
|
-
const newGroups = new Set(groups);
|
|
399
|
-
const current = await this.db.selectFrom("content_taxonomies").innerJoin("taxonomies", "taxonomies.translation_group", "content_taxonomies.taxonomy_id").select(["content_taxonomies.taxonomy_id as group"]).distinct().where("content_taxonomies.collection", "=", collection).where("content_taxonomies.entry_id", "=", entryGroup).where("taxonomies.name", "=", taxonomyName).execute();
|
|
400
|
-
const currentGroups = new Set(current.map((r) => r.group));
|
|
401
|
-
const toRemove = [...currentGroups].filter((g) => !newGroups.has(g));
|
|
402
|
-
if (toRemove.length > 0) await this.db.deleteFrom("content_taxonomies").where("collection", "=", collection).where("entry_id", "=", entryGroup).where("taxonomy_id", "in", toRemove).execute();
|
|
403
|
-
const toAdd = [...newGroups].filter((g) => !currentGroups.has(g));
|
|
404
|
-
if (toAdd.length > 0) await this.db.insertInto("content_taxonomies").values(toAdd.map((taxonomy_id) => ({
|
|
405
|
-
collection,
|
|
406
|
-
entry_id: entryGroup,
|
|
407
|
-
taxonomy_id
|
|
408
|
-
}))).onConflict((oc) => oc.doNothing()).execute();
|
|
409
|
-
if (toRemove.length > 0 || toAdd.length > 0) invalidateTaxonomyObjectCache();
|
|
410
|
-
}
|
|
411
|
-
async clearEntryTerms(collection, entryId) {
|
|
412
|
-
const entryGroup = await this.resolveEntryTranslationGroup(collection, entryId);
|
|
413
|
-
if (!entryGroup) return 0;
|
|
414
|
-
return this.clearEntryGroupTerms(collection, entryGroup);
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Remove every term assignment held by an entry translation group. Takes the
|
|
418
|
-
* group rather than an entry id, so it still works after the group's last
|
|
419
|
-
* row has been deleted.
|
|
420
|
-
*/
|
|
421
|
-
async clearEntryGroupTerms(collection, entryGroup) {
|
|
422
|
-
const result = await this.db.deleteFrom("content_taxonomies").where("collection", "=", collection).where("entry_id", "=", entryGroup).executeTakeFirst();
|
|
423
|
-
const removed = Number(result.numDeletedRows ?? 0);
|
|
424
|
-
if (removed > 0) invalidateTaxonomyObjectCache();
|
|
425
|
-
return removed;
|
|
426
|
-
}
|
|
427
|
-
async resolveEntryTranslationGroup(collection, entryIdOrGroup) {
|
|
428
|
-
validateIdentifier(collection, "collection type");
|
|
429
|
-
const tableName = `ec_${collection}`;
|
|
430
|
-
return (await sql`
|
|
431
|
-
SELECT translation_group
|
|
432
|
-
FROM ${sql.ref(tableName)}
|
|
433
|
-
WHERE id = ${entryIdOrGroup} OR translation_group = ${entryIdOrGroup}
|
|
434
|
-
LIMIT 1
|
|
435
|
-
`.execute(this.db)).rows[0]?.translation_group ?? null;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Count content entries that use any translation of this term. Accepts
|
|
439
|
-
* either a term id or a translation_group — we normalise to the group.
|
|
440
|
-
*
|
|
441
|
-
* Counts raw pivot rows regardless of the entry's status or deletion —
|
|
442
|
-
* drafts and trashed entries are included. User-facing counts (admin term
|
|
443
|
-
* list/get, public widget and term pages) use `fetchVisibleTermCounts`
|
|
444
|
-
* from `taxonomies/term-counts.ts` instead, which counts only publicly
|
|
445
|
-
* visible entries.
|
|
446
|
-
*/
|
|
447
|
-
async countEntriesWithTerm(termIdOrGroup) {
|
|
448
|
-
const group = await this.resolveTranslationGroup(termIdOrGroup);
|
|
449
|
-
if (!group) return 0;
|
|
450
|
-
const result = await this.db.selectFrom("content_taxonomies").select((eb) => eb.fn.count("entry_id").as("count")).where("taxonomy_id", "=", group).executeTakeFirst();
|
|
451
|
-
return Number(result?.count ?? 0);
|
|
452
|
-
}
|
|
453
|
-
/**
|
|
454
|
-
* Resolve a parent reference (a row id or a translation_group) to the value
|
|
455
|
-
* persisted in `parent_id`: the parent's translation_group, which is
|
|
456
|
-
* locale-agnostic so the child stays nested in every locale. A
|
|
457
|
-
* translation_group normally equals its anchor row's id, which satisfies the
|
|
458
|
-
* self-FK on `parent_id`. If that anchor row is missing (a translation whose
|
|
459
|
-
* anchor was deleted), fall back to the id we were given so we never write a
|
|
460
|
-
* dangling FK value.
|
|
461
|
-
*/
|
|
462
|
-
async resolveParentRef(idOrGroup) {
|
|
463
|
-
const group = await this.resolveTranslationGroup(idOrGroup);
|
|
464
|
-
if (!group) return idOrGroup;
|
|
465
|
-
return await this.db.selectFrom("taxonomies").select("id").where("id", "=", group).executeTakeFirst() ? group : idOrGroup;
|
|
466
|
-
}
|
|
467
|
-
async resolveTranslationGroup(idOrGroup) {
|
|
468
|
-
return (await this.db.selectFrom("taxonomies").select(["translation_group"]).where((eb) => eb.or([eb("id", "=", idOrGroup), eb("translation_group", "=", idOrGroup)])).executeTakeFirst())?.translation_group ?? null;
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Batch count entries for multiple taxonomy translation_groups.
|
|
472
|
-
* Chunks the query at SQL_BATCH_SIZE to stay below D1's bind-parameter limit.
|
|
473
|
-
* Returns a Map from translation_group to count.
|
|
474
|
-
*
|
|
475
|
-
* Pass translation_groups (not term ids) — `content_taxonomies.taxonomy_id`
|
|
476
|
-
* stores the translation_group so a single assignment spans every locale.
|
|
477
|
-
*
|
|
478
|
-
* Like `countEntriesWithTerm`, this counts raw pivot rows regardless of
|
|
479
|
-
* status/deletion; user-facing counts go through `fetchVisibleTermCounts`.
|
|
480
|
-
*/
|
|
481
|
-
async countEntriesForTerms(translationGroups) {
|
|
482
|
-
if (translationGroups.length === 0) return /* @__PURE__ */ new Map();
|
|
483
|
-
const { chunks, SQL_BATCH_SIZE } = await import("./chunks-DUK-cWXi.mjs").then((n) => n.r);
|
|
484
|
-
const counts = /* @__PURE__ */ new Map();
|
|
485
|
-
for (const chunk of chunks(translationGroups, SQL_BATCH_SIZE)) {
|
|
486
|
-
const rows = await this.db.selectFrom("content_taxonomies").select(["taxonomy_id", (eb) => eb.fn.count("entry_id").as("count")]).where("taxonomy_id", "in", chunk).groupBy("taxonomy_id").execute();
|
|
487
|
-
for (const row of rows) counts.set(row.taxonomy_id, Number(row.count || 0));
|
|
488
|
-
}
|
|
489
|
-
return counts;
|
|
490
|
-
}
|
|
491
|
-
rowToTaxonomy(row) {
|
|
492
|
-
return {
|
|
493
|
-
id: row.id,
|
|
494
|
-
name: row.name,
|
|
495
|
-
slug: row.slug,
|
|
496
|
-
label: row.label,
|
|
497
|
-
parentId: row.parent_id,
|
|
498
|
-
data: row.data ? JSON.parse(row.data) : null,
|
|
499
|
-
locale: row.locale,
|
|
500
|
-
translationGroup: row.translation_group,
|
|
501
|
-
sortOrder: row.sort_order
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
//#endregion
|
|
507
|
-
export { taxonomy_exports as n, TaxonomyRepository as t };
|
|
508
|
-
//# sourceMappingURL=taxonomy-c1Q8PMFF.mjs.map
|