emdash 1.0.0 → 1.0.1-rc.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/README.md +4 -0
- package/dist/action-token-DBki7IT4.mjs +26 -0
- package/dist/action-token-DBki7IT4.mjs.map +1 -0
- package/dist/activation-DDuqAat2.mjs +387 -0
- package/dist/activation-DDuqAat2.mjs.map +1 -0
- package/dist/adapters-DcqT_GzQ.d.mts +171 -0
- package/dist/adapters-DcqT_GzQ.d.mts.map +1 -0
- package/dist/after-PcEvMY_6.mjs +96 -0
- package/dist/after-PcEvMY_6.mjs.map +1 -0
- package/dist/allowed-origins-CFtudhyw.mjs +116 -0
- package/dist/allowed-origins-CFtudhyw.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +69 -0
- package/dist/api/route-utils.d.mts.map +1 -0
- package/dist/api/route-utils.mjs +85 -0
- package/dist/api/route-utils.mjs.map +1 -0
- package/dist/api/schemas/index.d.mts +2 -0
- package/dist/api/schemas/index.mjs +13 -0
- package/dist/api-BJFwdTiG.mjs +4974 -0
- package/dist/api-BJFwdTiG.mjs.map +1 -0
- package/dist/api-tokens-BLz2MtQs.mjs +3 -0
- package/dist/api-tokens-P3mAaQgr.mjs +166 -0
- package/dist/api-tokens-P3mAaQgr.mjs.map +1 -0
- package/dist/apply-BNvvsD51.mjs +1672 -0
- package/dist/apply-BNvvsD51.mjs.map +1 -0
- package/dist/approvals-quy61IC4.mjs +460 -0
- package/dist/approvals-quy61IC4.mjs.map +1 -0
- package/dist/artifact-fetch-CWxyELVI.mjs +659 -0
- package/dist/artifact-fetch-CWxyELVI.mjs.map +1 -0
- package/dist/astro/image-endpoint.d.mts +8 -0
- package/dist/astro/image-endpoint.d.mts.map +1 -0
- package/dist/astro/image-endpoint.mjs +55 -0
- package/dist/astro/image-endpoint.mjs.map +1 -0
- package/dist/astro/index.d.mts +39 -7
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +908 -514
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +15 -7
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +146 -211
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts +15 -0
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs +117 -0
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -0
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +48 -15
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts +5 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +542 -76
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +66 -4
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +817 -1844
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +19 -0
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -0
- package/dist/astro/routes/PluginRegistry.mjs +26 -0
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts +15 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +78 -0
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.d.mts +15 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +78 -0
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts +11 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +35 -0
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts +17 -0
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +54 -0
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts +8 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +25 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts +10 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +66 -0
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/byline-fields/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +54 -0
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts +8 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +38 -0
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts +10 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +92 -0
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +9 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +84 -0
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/bylines/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs +91 -0
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +59 -0
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_.d.mts +15 -0
- package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/_id_.mjs +51 -0
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/bulk.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/bulk.mjs +49 -0
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/counts.d.mts +8 -0
- package/dist/astro/routes/api/admin/comments/counts.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/counts.mjs +29 -0
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -0
- package/dist/astro/routes/api/admin/comments/index.d.mts +11 -0
- package/dist/astro/routes/api/admin/comments/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/comments/index.mjs +53 -0
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/core-update.d.mts +8 -0
- package/dist/astro/routes/api/admin/core-update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/core-update.mjs +28 -0
- package/dist/astro/routes/api/admin/core-update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts +8 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +50 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +35 -0
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +54 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +45 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +45 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +56 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/repair.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +53 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts +8 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts +19 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +71 -0
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.d.mts +15 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +52 -0
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +28 -0
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +28 -0
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +105 -0
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +41 -0
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts +9 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +116 -0
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +112 -0
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +139 -0
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/index.mjs +103 -0
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +44 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +99 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +142 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +106 -0
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +112 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +160 -0
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +362 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +155 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -0
- 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.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +117 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs +109 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts +8 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +29 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +99 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +44 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +115 -0
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -0
- 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 +69 -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 +69 -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 +68 -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 +71 -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 +68 -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 +71 -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 +70 -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 +67 -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 +70 -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 +92 -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 +67 -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 +71 -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 +79 -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 +67 -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 +78 -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 +78 -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 +67 -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 +71 -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 +68 -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 +67 -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 +100 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +45 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +34 -0
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/users/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +117 -0
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +56 -0
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/users/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/users/index.mjs +67 -0
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/dev-bypass.d.mts +9 -0
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/dev-bypass.mjs +83 -0
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/accept.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/accept.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/accept.mjs +36 -0
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/complete.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/complete.mjs +70 -0
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/index.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/index.mjs +70 -0
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/invite/register-options.d.mts +8 -0
- package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/invite/register-options.mjs +57 -0
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/logout.d.mts +8 -0
- package/dist/astro/routes/api/auth/logout.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/logout.mjs +29 -0
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/send.d.mts +8 -0
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/send.mjs +69 -0
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts +9 -0
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +59 -0
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/me.d.mts +14 -0
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/me.mjs +71 -0
- package/dist/astro/routes/api/auth/me.mjs.map +1 -0
- package/dist/astro/routes/api/auth/mode.d.mts +8 -0
- package/dist/astro/routes/api/auth/mode.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/mode.mjs +34 -0
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts +8 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +149 -0
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts +8 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +66 -0
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/_id_.d.mts +15 -0
- package/dist/astro/routes/api/auth/passkey/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +75 -0
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/index.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/index.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/index.mjs +30 -0
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/options.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/options.mjs +50 -0
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +57 -0
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +72 -0
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/passkey/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/passkey/verify.mjs +63 -0
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/complete.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/complete.mjs +71 -0
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/request.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/request.mjs +57 -0
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -0
- package/dist/astro/routes/api/auth/signup/verify.d.mts +8 -0
- package/dist/astro/routes/api/auth/signup/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/auth/signup/verify.mjs +37 -0
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +15 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +60 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +9 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts.map +1 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +189 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +22 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +51 -0
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +32 -0
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +73 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +25 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +38 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +135 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts +15 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +74 -0
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +80 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +75 -0
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +30 -0
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +24 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +85 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts +15 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +133 -0
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +45 -0
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +58 -0
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +114 -0
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/authors.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/authors.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/authors.mjs +21 -0
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.d.mts +9 -0
- package/dist/astro/routes/api/content/_collection_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs +77 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/trash.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/trash.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/trash.mjs +36 -0
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -0
- package/dist/astro/routes/api/dashboard.d.mts +8 -0
- package/dist/astro/routes/api/dashboard.d.mts.map +1 -0
- package/dist/astro/routes/api/dashboard.mjs +37 -0
- package/dist/astro/routes/api/dashboard.mjs.map +1 -0
- package/dist/astro/routes/api/dev/emails.d.mts +9 -0
- package/dist/astro/routes/api/dev/emails.d.mts.map +1 -0
- package/dist/astro/routes/api/dev/emails.mjs +22 -0
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -0
- package/dist/astro/routes/api/health.d.mts +8 -0
- package/dist/astro/routes/api/health.d.mts.map +1 -0
- package/dist/astro/routes/api/health.mjs +23 -0
- package/dist/astro/routes/api/health.mjs.map +1 -0
- package/dist/astro/routes/api/import/probe.d.mts +18 -0
- package/dist/astro/routes/api/import/probe.d.mts.map +1 -0
- package/dist/astro/routes/api/import/probe.mjs +56 -0
- package/dist/astro/routes/api/import/probe.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts +88 -0
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +315 -0
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +66 -0
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/execute.mjs +353 -0
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/media.d.mts +51 -0
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/media.mjs +241 -0
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/prepare.d.mts +20 -0
- package/dist/astro/routes/api/import/wordpress/prepare.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +131 -0
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +63 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +149 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +37 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +179 -0
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +16 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +92 -0
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts +8 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +29 -0
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +60 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +718 -0
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -0
- package/dist/astro/routes/api/manifest.d.mts +8 -0
- package/dist/astro/routes/api/manifest.d.mts.map +1 -0
- package/dist/astro/routes/api/manifest.mjs +65 -0
- package/dist/astro/routes/api/manifest.mjs.map +1 -0
- package/dist/astro/routes/api/mcp.d.mts +16 -0
- package/dist/astro/routes/api/mcp.d.mts.map +1 -0
- package/dist/astro/routes/api/mcp.mjs +2693 -0
- package/dist/astro/routes/api/mcp.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/confirm.d.mts +11 -0
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/confirm.mjs +178 -0
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs +99 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/upload.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs +170 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/usage.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/usage.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs +60 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_.d.mts +23 -0
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_.mjs +129 -0
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts +8 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +54 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.d.mts +8 -0
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs +83 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts +10 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs +60 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/index.d.mts +9 -0
- package/dist/astro/routes/api/media/folders/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/index.mjs +49 -0
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts +15 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +54 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts +15 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +77 -0
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/index.d.mts +11 -0
- package/dist/astro/routes/api/media/providers/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/providers/index.mjs +23 -0
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/upload-url.d.mts +11 -0
- package/dist/astro/routes/api/media/upload-url.d.mts.map +1 -0
- package/dist/astro/routes/api/media/upload-url.mjs +106 -0
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -0
- package/dist/astro/routes/api/media.d.mts +17 -0
- package/dist/astro/routes/api/media.d.mts.map +1 -0
- package/dist/astro/routes/api/media.mjs +211 -0
- package/dist/astro/routes/api/media.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts +9 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +68 -0
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/items.mjs +48 -0
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +48 -0
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_/translations.d.mts +9 -0
- package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs +79 -0
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/menus/_name_.d.mts +10 -0
- package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/_name_.mjs +80 -0
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/menus/index.d.mts +9 -0
- package/dist/astro/routes/api/menus/index.d.mts.map +1 -0
- package/dist/astro/routes/api/menus/index.mjs +57 -0
- package/dist/astro/routes/api/menus/index.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/authorize.d.mts +9 -0
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/authorize.mjs +276 -0
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/authorize.d.mts +9 -0
- package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/authorize.mjs +48 -0
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/code.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/code.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/code.mjs +38 -0
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/device/token.d.mts +8 -0
- package/dist/astro/routes/api/oauth/device/token.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/device/token.mjs +49 -0
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/register.d.mts +9 -0
- package/dist/astro/routes/api/oauth/register.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/register.mjs +123 -0
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token/refresh.d.mts +8 -0
- package/dist/astro/routes/api/oauth/token/refresh.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token/refresh.mjs +32 -0
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token/revoke.d.mts +8 -0
- package/dist/astro/routes/api/oauth/token/revoke.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token/revoke.mjs +29 -0
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -0
- package/dist/astro/routes/api/oauth/token.d.mts +9 -0
- package/dist/astro/routes/api/oauth/token.d.mts.map +1 -0
- package/dist/astro/routes/api/oauth/token.mjs +143 -0
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -0
- package/dist/astro/routes/api/openapi.json.d.mts +8 -0
- package/dist/astro/routes/api/openapi.json.d.mts.map +1 -0
- package/dist/astro/routes/api/openapi.json.mjs +3676 -0
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts +13 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +44 -0
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/404s/index.d.mts +10 -0
- package/dist/astro/routes/api/redirects/404s/index.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/404s/index.mjs +76 -0
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/404s/summary.d.mts +8 -0
- package/dist/astro/routes/api/redirects/404s/summary.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/404s/summary.mjs +48 -0
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/_id_.d.mts +10 -0
- package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/_id_.mjs +80 -0
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/redirects/index.d.mts +9 -0
- package/dist/astro/routes/api/redirects/index.d.mts.map +1 -0
- package/dist/astro/routes/api/redirects/index.mjs +63 -0
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -0
- package/dist/astro/routes/api/relations/_id_/index.d.mts +10 -0
- package/dist/astro/routes/api/relations/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/relations/_id_/index.mjs +94 -0
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/relations/index.d.mts +9 -0
- package/dist/astro/routes/api/relations/index.d.mts.map +1 -0
- package/dist/astro/routes/api/relations/index.mjs +78 -0
- package/dist/astro/routes/api/relations/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts +8 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +21 -0
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts +8 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.d.mts.map +1 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +48 -0
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -0
- 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 +109 -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 +103 -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 +109 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts +10 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +123 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +111 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +102 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts +10 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +127 -0
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/collections/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/index.mjs +111 -0
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +101 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.d.mts +8 -0
- package/dist/astro/routes/api/schema/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +92 -0
- package/dist/astro/routes/api/schema/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.d.mts +8 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +103 -0
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/schema/orphans/index.d.mts +8 -0
- package/dist/astro/routes/api/schema/orphans/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/orphans/index.mjs +98 -0
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -0
- package/dist/astro/routes/api/search/enable.d.mts +17 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -0
- package/dist/astro/routes/api/search/enable.mjs +71 -0
- package/dist/astro/routes/api/search/enable.mjs.map +1 -0
- package/dist/astro/routes/api/search/index.d.mts +17 -0
- package/dist/astro/routes/api/search/index.d.mts.map +1 -0
- package/dist/astro/routes/api/search/index.mjs +66 -0
- package/dist/astro/routes/api/search/index.mjs.map +1 -0
- package/dist/astro/routes/api/search/rebuild.d.mts +14 -0
- package/dist/astro/routes/api/search/rebuild.d.mts.map +1 -0
- package/dist/astro/routes/api/search/rebuild.mjs +60 -0
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -0
- package/dist/astro/routes/api/search/stats.d.mts +11 -0
- package/dist/astro/routes/api/search/stats.d.mts.map +1 -0
- package/dist/astro/routes/api/search/stats.mjs +33 -0
- package/dist/astro/routes/api/search/stats.mjs.map +1 -0
- package/dist/astro/routes/api/search/suggest.d.mts +16 -0
- package/dist/astro/routes/api/search/suggest.d.mts.map +1 -0
- package/dist/astro/routes/api/search/suggest.mjs +55 -0
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -0
- package/dist/astro/routes/api/sections/_slug_.d.mts +10 -0
- package/dist/astro/routes/api/sections/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/sections/_slug_.mjs +77 -0
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/sections/index.d.mts +9 -0
- package/dist/astro/routes/api/sections/index.d.mts.map +1 -0
- package/dist/astro/routes/api/sections/index.mjs +60 -0
- package/dist/astro/routes/api/sections/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts +9 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +50 -0
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/index.d.mts +8 -0
- package/dist/astro/routes/api/settings/backups/archives/index.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +26 -0
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/export.d.mts +8 -0
- package/dist/astro/routes/api/settings/backups/export.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/export.mjs +37 -0
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -0
- package/dist/astro/routes/api/settings/backups/index.d.mts +9 -0
- package/dist/astro/routes/api/settings/backups/index.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/backups/index.mjs +54 -0
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -0
- package/dist/astro/routes/api/settings/email.d.mts +18 -0
- package/dist/astro/routes/api/settings/email.d.mts.map +1 -0
- package/dist/astro/routes/api/settings/email.mjs +107 -0
- package/dist/astro/routes/api/settings/email.mjs.map +1 -0
- package/dist/astro/routes/api/settings.d.mts +21 -0
- package/dist/astro/routes/api/settings.d.mts.map +1 -0
- package/dist/astro/routes/api/settings.mjs +76 -0
- package/dist/astro/routes/api/settings.mjs.map +1 -0
- package/dist/astro/routes/api/setup/admin-verify.d.mts +8 -0
- package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/admin-verify.mjs +83 -0
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -0
- package/dist/astro/routes/api/setup/admin.d.mts +8 -0
- package/dist/astro/routes/api/setup/admin.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/admin.mjs +83 -0
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -0
- package/dist/astro/routes/api/setup/dev-bypass.d.mts +9 -0
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/dev-bypass.mjs +172 -0
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -0
- package/dist/astro/routes/api/setup/dev-reset.d.mts +8 -0
- package/dist/astro/routes/api/setup/dev-reset.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/dev-reset.mjs +27 -0
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -0
- package/dist/astro/routes/api/setup/index.d.mts +8 -0
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/index.mjs +147 -0
- package/dist/astro/routes/api/setup/index.mjs.map +1 -0
- package/dist/astro/routes/api/setup/status.d.mts +8 -0
- package/dist/astro/routes/api/setup/status.d.mts.map +1 -0
- package/dist/astro/routes/api/setup/status.mjs +62 -0
- package/dist/astro/routes/api/setup/status.mjs.map +1 -0
- package/dist/astro/routes/api/snapshot.d.mts +8 -0
- package/dist/astro/routes/api/snapshot.d.mts.map +1 -0
- package/dist/astro/routes/api/snapshot.mjs +68 -0
- package/dist/astro/routes/api/snapshot.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +57 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts +9 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +92 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +103 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts +15 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +83 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +55 -0
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts +19 -0
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs +104 -0
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -0
- 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 +297 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.d.mts +15 -0
- package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +75 -0
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -0
- package/dist/astro/routes/api/themes/preview.d.mts +8 -0
- package/dist/astro/routes/api/themes/preview.d.mts.map +1 -0
- package/dist/astro/routes/api/themes/preview.mjs +52 -0
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -0
- package/dist/astro/routes/api/typegen.d.mts +18 -0
- package/dist/astro/routes/api/typegen.d.mts.map +1 -0
- package/dist/astro/routes/api/typegen.mjs +50 -0
- package/dist/astro/routes/api/typegen.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/action-token.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/action-token.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs +27 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +44 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +22 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/auth.d.mts +8 -0
- package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/auth.mjs +42 -0
- package/dist/astro/routes/api/well-known/auth.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts +8 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +33 -0
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts +8 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.d.mts.map +1 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +22 -0
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +49 -0
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +78 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts +8 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +64 -0
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/_name_.mjs +55 -0
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -0
- package/dist/astro/routes/api/widget-areas/index.d.mts +9 -0
- package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-areas/index.mjs +74 -0
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -0
- package/dist/astro/routes/api/widget-components.d.mts +8 -0
- package/dist/astro/routes/api/widget-components.d.mts.map +1 -0
- package/dist/astro/routes/api/widget-components.mjs +20 -0
- package/dist/astro/routes/api/widget-components.mjs.map +1 -0
- package/dist/astro/routes/robots.txt.d.mts +8 -0
- package/dist/astro/routes/robots.txt.d.mts.map +1 -0
- package/dist/astro/routes/robots.txt.mjs +65 -0
- package/dist/astro/routes/robots.txt.mjs.map +1 -0
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts +8 -0
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -0
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +131 -0
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -0
- package/dist/astro/routes/sitemap.xml.d.mts +8 -0
- package/dist/astro/routes/sitemap.xml.d.mts.map +1 -0
- package/dist/astro/routes/sitemap.xml.mjs +68 -0
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -0
- package/dist/astro/types.d.mts +246 -25
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-BszbE_BP.mjs +127 -0
- package/dist/audit-BszbE_BP.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +13 -0
- package/dist/auth/providers/github.d.mts.map +1 -0
- package/dist/auth/providers/github.mjs +18 -0
- package/dist/auth/providers/github.mjs.map +1 -0
- package/dist/auth/providers/google.d.mts +13 -0
- package/dist/auth/providers/google.d.mts.map +1 -0
- package/dist/auth/providers/google.mjs +18 -0
- package/dist/auth/providers/google.mjs.map +1 -0
- package/dist/authoritative-records-dSvXCfzb.mjs +5172 -0
- package/dist/authoritative-records-dSvXCfzb.mjs.map +1 -0
- package/dist/authorize-CJtizVbp.mjs +49 -0
- package/dist/authorize-CJtizVbp.mjs.map +1 -0
- package/dist/backup-Cpl8TqRz.mjs +246 -0
- package/dist/backup-Cpl8TqRz.mjs.map +1 -0
- package/dist/base64-DvnNgP7e.mjs +63 -0
- package/dist/base64-DvnNgP7e.mjs.map +1 -0
- package/dist/block-types-DIG_KZwi.mjs +132 -0
- package/dist/block-types-DIG_KZwi.mjs.map +1 -0
- package/dist/block-values-BrTrtA-v.mjs +175 -0
- package/dist/block-values-BrTrtA-v.mjs.map +1 -0
- package/dist/byline-02tu_Uc-.mjs +909 -0
- package/dist/byline-02tu_Uc-.mjs.map +1 -0
- package/dist/byline-fields-DHJs0Mja.mjs +280 -0
- package/dist/byline-fields-DHJs0Mja.mjs.map +1 -0
- package/dist/byline-fields-xdxE9kxZ.mjs +123 -0
- package/dist/byline-fields-xdxE9kxZ.mjs.map +1 -0
- package/dist/byline-registry-dvt4N3xV.mjs +406 -0
- package/dist/byline-registry-dvt4N3xV.mjs.map +1 -0
- package/dist/bylines-CTGTsEAs.mjs +150 -0
- package/dist/bylines-CTGTsEAs.mjs.map +1 -0
- package/dist/bylines-DATJ0B8u.mjs +214 -0
- package/dist/bylines-DATJ0B8u.mjs.map +1 -0
- package/dist/cache-CPanL9IO.mjs +114 -0
- package/dist/cache-CPanL9IO.mjs.map +1 -0
- package/dist/canonical-CAecl1UQ.mjs +174 -0
- package/dist/canonical-CAecl1UQ.mjs.map +1 -0
- package/dist/capture-triggers-CdZfvHtF.mjs +362 -0
- package/dist/capture-triggers-CdZfvHtF.mjs.map +1 -0
- package/dist/challenge-store-CxZxPqaw.mjs +51 -0
- package/dist/challenge-store-CxZxPqaw.mjs.map +1 -0
- package/dist/checksum-DtH6m5uk.mjs +162 -0
- package/dist/checksum-DtH6m5uk.mjs.map +1 -0
- package/dist/chrome-tags-CKELm-bo.mjs +24 -0
- package/dist/chrome-tags-CKELm-bo.mjs.map +1 -0
- package/dist/chunks-DBmkKmBH.mjs +25 -0
- package/dist/chunks-DBmkKmBH.mjs.map +1 -0
- package/dist/cli/index.mjs +3021 -1548
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1296 -11
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +313 -27
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-JecE26cS.mjs +436 -0
- package/dist/collection-deletion-JecE26cS.mjs.map +1 -0
- package/dist/collection-deletion-processor-DgCfF3a1.mjs +217 -0
- package/dist/collection-deletion-processor-DgCfF3a1.mjs.map +1 -0
- package/dist/collection-slugs-cache-BNRAPNiu.mjs +85 -0
- package/dist/collection-slugs-cache-BNRAPNiu.mjs.map +1 -0
- package/dist/comment-Cq1UYN8_.mjs +313 -0
- package/dist/comment-Cq1UYN8_.mjs.map +1 -0
- package/dist/comment-reaction-DPeGAfjd.mjs +85 -0
- package/dist/comment-reaction-DPeGAfjd.mjs.map +1 -0
- package/dist/comments-BRtp992B.mjs +99 -0
- package/dist/comments-BRtp992B.mjs.map +1 -0
- package/dist/comments-Bi2j9IoX.mjs +195 -0
- package/dist/comments-Bi2j9IoX.mjs.map +1 -0
- package/dist/components-CQY-Sgm-.mjs +108 -0
- package/dist/components-CQY-Sgm-.mjs.map +1 -0
- package/dist/config-B-uePMLj.d.mts +39 -0
- package/dist/config-B-uePMLj.d.mts.map +1 -0
- package/dist/config-BVX7iYr4.d.mts +6679 -0
- package/dist/config-BVX7iYr4.d.mts.map +1 -0
- package/dist/config-CXPcy2iY.mjs +228 -0
- package/dist/config-CXPcy2iY.mjs.map +1 -0
- package/dist/config-CvmjJcVw.mjs +73 -0
- package/dist/config-CvmjJcVw.mjs.map +1 -0
- package/dist/connection-B9pIasFd.mjs +36 -0
- package/dist/connection-B9pIasFd.mjs.map +1 -0
- package/dist/content-RzEXY3QX.mjs +2020 -0
- package/dist/content-RzEXY3QX.mjs.map +1 -0
- package/dist/content-list-query-DiNwyKtd.d.mts +26 -0
- package/dist/content-list-query-DiNwyKtd.d.mts.map +1 -0
- package/dist/content-policy-Dm32n9C6.mjs +46 -0
- package/dist/content-policy-Dm32n9C6.mjs.map +1 -0
- package/dist/content-repair-B-k5JrVN.mjs +442 -0
- package/dist/content-repair-B-k5JrVN.mjs.map +1 -0
- package/dist/context-CTkYVMZV.mjs +2026 -0
- package/dist/context-CTkYVMZV.mjs.map +1 -0
- package/dist/credits-CAFPFhuk.mjs +110 -0
- package/dist/credits-CAFPFhuk.mjs.map +1 -0
- package/dist/cron-xe5XKqA-.mjs +306 -0
- package/dist/cron-xe5XKqA-.mjs.map +1 -0
- package/dist/dashboard-BoV4pwPP.mjs +151 -0
- package/dist/dashboard-BoV4pwPP.mjs.map +1 -0
- package/dist/database/instrumentation.d.mts +35 -5
- package/dist/database/instrumentation.d.mts.map +1 -1
- package/dist/database/instrumentation.mjs +40 -9
- package/dist/database/instrumentation.mjs.map +1 -1
- package/dist/database/migration-lock.d.mts +37 -0
- package/dist/database/migration-lock.d.mts.map +1 -0
- package/dist/database/migration-lock.mjs +76 -0
- package/dist/database/migration-lock.mjs.map +1 -0
- package/dist/database/pg-migration-lock.d.mts +21 -0
- package/dist/database/pg-migration-lock.d.mts.map +1 -0
- package/dist/database/pg-migration-lock.mjs +42 -0
- package/dist/database/pg-migration-lock.mjs.map +1 -0
- package/dist/datetime-normalization-PeiEdcRY.mjs +187 -0
- package/dist/datetime-normalization-PeiEdcRY.mjs.map +1 -0
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +35 -10
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +11 -0
- package/dist/db/libsql-migrations.d.mts.map +1 -0
- package/dist/db/libsql-migrations.mjs +58 -0
- package/dist/db/libsql-migrations.mjs.map +1 -0
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/libsql.d.mts.map +1 -1
- package/dist/db/libsql.mjs +7 -2
- package/dist/db/libsql.mjs.map +1 -1
- package/dist/db/postgres-migrations.d.mts +10 -0
- package/dist/db/postgres-migrations.d.mts.map +1 -0
- package/dist/db/postgres-migrations.mjs +48 -0
- package/dist/db/postgres-migrations.mjs.map +1 -0
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/postgres.d.mts.map +1 -1
- package/dist/db/postgres.mjs +20 -10
- package/dist/db/postgres.mjs.map +1 -1
- package/dist/db/sqlite-migrations.d.mts +10 -0
- package/dist/db/sqlite-migrations.d.mts.map +1 -0
- package/dist/db/sqlite-migrations.mjs +29 -0
- package/dist/db/sqlite-migrations.mjs.map +1 -0
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.d.mts.map +1 -1
- package/dist/db/sqlite.mjs +9 -4
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/db-errors-CBD5yMro.mjs +55 -0
- package/dist/db-errors-CBD5yMro.mjs.map +1 -0
- package/dist/default-DaoYyFRS.mjs +81 -0
- package/dist/default-DaoYyFRS.mjs.map +1 -0
- package/dist/deferred-tasks-BYcDx2o_.d.mts +9 -0
- package/dist/deferred-tasks-BYcDx2o_.d.mts.map +1 -0
- package/dist/destination-r2zIAZ2S.mjs +18 -0
- package/dist/destination-r2zIAZ2S.mjs.map +1 -0
- package/dist/dev-typegen-8JlYYFno.mjs +29 -0
- package/dist/dev-typegen-8JlYYFno.mjs.map +1 -0
- package/dist/device-flow-Ma5P5d2e.mjs +521 -0
- package/dist/device-flow-Ma5P5d2e.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-DiYAoZpf.mjs +194 -0
- package/dist/digest-DiYAoZpf.mjs.map +1 -0
- package/dist/direct-executor-FCIRepAU.mjs +104 -0
- package/dist/direct-executor-FCIRepAU.mjs.map +1 -0
- package/dist/dist-Cfu8mMBs.mjs +810 -0
- package/dist/dist-Cfu8mMBs.mjs.map +1 -0
- package/dist/email-console-DmqVF5J_.mjs +50 -0
- package/dist/email-console-DmqVF5J_.mjs.map +1 -0
- package/dist/email-locale-Cc5YSXfJ.mjs +25 -0
- package/dist/email-locale-Cc5YSXfJ.mjs.map +1 -0
- package/dist/emdash-runtime-YPrVnr6x.mjs +4226 -0
- package/dist/emdash-runtime-YPrVnr6x.mjs.map +1 -0
- package/dist/enrich-BDdVNeDK.mjs +194 -0
- package/dist/enrich-BDdVNeDK.mjs.map +1 -0
- package/dist/entry-lock-BtDo1zFm.d.mts +4544 -0
- package/dist/entry-lock-BtDo1zFm.d.mts.map +1 -0
- package/dist/entry-lock-PP1JCXBB.mjs +1180 -0
- package/dist/entry-lock-PP1JCXBB.mjs.map +1 -0
- package/dist/entry-lock-WyppUeRW.mjs +163 -0
- package/dist/entry-lock-WyppUeRW.mjs.map +1 -0
- package/dist/entry-locks-DJAqVweV.mjs +167 -0
- package/dist/entry-locks-DJAqVweV.mjs.map +1 -0
- package/dist/env-types-BaTCgn-y.mjs +38 -0
- package/dist/env-types-BaTCgn-y.mjs.map +1 -0
- package/dist/error-CEdm_AWU.mjs +90 -0
- package/dist/error-CEdm_AWU.mjs.map +1 -0
- package/dist/errors-9P_FDrJ_.mjs +17 -0
- package/dist/errors-9P_FDrJ_.mjs.map +1 -0
- package/dist/errors-CNvATh_7.mjs +469 -0
- package/dist/errors-CNvATh_7.mjs.map +1 -0
- package/dist/errors-CjXd1LgH.mjs +120 -0
- package/dist/errors-CjXd1LgH.mjs.map +1 -0
- package/dist/escape-nJW7dR0s.mjs +9 -0
- package/dist/escape-nJW7dR0s.mjs.map +1 -0
- package/dist/fence-BrnQffdY.mjs +162 -0
- package/dist/fence-BrnQffdY.mjs.map +1 -0
- package/dist/field-defs-cache-DEkFYCDE.mjs +77 -0
- package/dist/field-defs-cache-DEkFYCDE.mjs.map +1 -0
- package/dist/field-map-BfYMstlG.mjs +83 -0
- package/dist/field-map-BfYMstlG.mjs.map +1 -0
- package/dist/focal-point-JX8kcOTQ.mjs +23 -0
- package/dist/focal-point-JX8kcOTQ.mjs.map +1 -0
- package/dist/fts-manager-DU03MxWu.mjs +443 -0
- package/dist/fts-manager-DU03MxWu.mjs.map +1 -0
- package/dist/gc-BO9NqlAe.mjs +75 -0
- package/dist/gc-BO9NqlAe.mjs.map +1 -0
- package/dist/hash-CY4QdeMJ.mjs +37 -0
- package/dist/hash-CY4QdeMJ.mjs.map +1 -0
- package/dist/hook-result-DSRRxu_-.d.mts +31 -0
- package/dist/hook-result-DSRRxu_-.d.mts.map +1 -0
- package/dist/hreflang--av8HanY.d.mts +50 -0
- package/dist/hreflang--av8HanY.d.mts.map +1 -0
- package/dist/hreflang-CNbZjm4g.mjs +105 -0
- package/dist/hreflang-CNbZjm4g.mjs.map +1 -0
- package/dist/http-route-dispatch-16nzAM5m.mjs +339 -0
- package/dist/http-route-dispatch-16nzAM5m.mjs.map +1 -0
- package/dist/identity-DNaOsiip.mjs +35 -0
- package/dist/identity-DNaOsiip.mjs.map +1 -0
- package/dist/import-DUV3Gl6-.mjs +2020 -0
- package/dist/import-DUV3Gl6-.mjs.map +1 -0
- package/dist/index-m-lYQRqs.d.mts +623 -0
- package/dist/index-m-lYQRqs.d.mts.map +1 -0
- package/dist/index.d.mts +27 -11
- package/dist/index.mjs +120 -28
- package/dist/init-lock-4eRRB4Le.mjs +56 -0
- package/dist/init-lock-4eRRB4Le.mjs.map +1 -0
- package/dist/install-finalization-CPM7Gged.mjs +58 -0
- package/dist/install-finalization-CPM7Gged.mjs.map +1 -0
- package/dist/keys-B8g41vwJ.mjs +61 -0
- package/dist/keys-B8g41vwJ.mjs.map +1 -0
- package/dist/kinds-BKu9nb7q.mjs +974 -0
- package/dist/kinds-BKu9nb7q.mjs.map +1 -0
- package/dist/lifecycle-CpebZNAA.mjs +25 -0
- package/dist/lifecycle-CpebZNAA.mjs.map +1 -0
- package/dist/load-dHcR5yh9.mjs +28 -0
- package/dist/load-dHcR5yh9.mjs.map +1 -0
- package/dist/loader-CWb-ja1p.mjs +1197 -0
- package/dist/loader-CWb-ja1p.mjs.map +1 -0
- package/dist/loops-Dn1i16FP.mjs +205 -0
- package/dist/loops-Dn1i16FP.mjs.map +1 -0
- package/dist/manifest-builder-0ZHXBxOL.mjs +189 -0
- package/dist/manifest-builder-0ZHXBxOL.mjs.map +1 -0
- package/dist/manifest-schema-gy37bD_D.mjs +496 -0
- package/dist/manifest-schema-gy37bD_D.mjs.map +1 -0
- package/dist/marketplace-tHWSsCUo.mjs +257 -0
- package/dist/marketplace-tHWSsCUo.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts +104 -0
- package/dist/media/image-endpoint.d.mts.map +1 -0
- package/dist/media/image-endpoint.mjs +190 -0
- package/dist/media/image-endpoint.mjs.map +1 -0
- package/dist/media/index.d.mts +45 -2
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +17 -3
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +24 -7
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +41 -12
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-3v7mqAVX.mjs +294 -0
- package/dist/media-3v7mqAVX.mjs.map +1 -0
- package/dist/media-CputjGE1.mjs +373 -0
- package/dist/media-CputjGE1.mjs.map +1 -0
- package/dist/media-D1z_jisb.mjs +408 -0
- package/dist/media-D1z_jisb.mjs.map +1 -0
- package/dist/media-allowlist-D5a4d-RA.mjs +44 -0
- package/dist/media-allowlist-D5a4d-RA.mjs.map +1 -0
- package/dist/media-folders-D2VdVBf6.mjs +210 -0
- package/dist/media-folders-D2VdVBf6.mjs.map +1 -0
- package/dist/media-url-DloW2xrP.mjs +43 -0
- package/dist/media-url-DloW2xrP.mjs.map +1 -0
- package/dist/media-usage-B8q0owWQ.mjs +1629 -0
- package/dist/media-usage-B8q0owWQ.mjs.map +1 -0
- package/dist/media-usage-activation-CQWOOTJi.mjs +78 -0
- package/dist/media-usage-activation-CQWOOTJi.mjs.map +1 -0
- package/dist/media-usage-work-BC0qpkMD.mjs +152 -0
- package/dist/media-usage-work-BC0qpkMD.mjs.map +1 -0
- package/dist/media-usage-work-BlMjwPg8.mjs +586 -0
- package/dist/media-usage-work-BlMjwPg8.mjs.map +1 -0
- package/dist/menus-BQKqf0Up.mjs +92 -0
- package/dist/menus-BQKqf0Up.mjs.map +1 -0
- package/dist/menus-XQdKk-87.mjs +3647 -0
- package/dist/menus-XQdKk-87.mjs.map +1 -0
- package/dist/menus-trvc6_fW.mjs +753 -0
- package/dist/menus-trvc6_fW.mjs.map +1 -0
- package/dist/migrations/index.d.mts +22 -0
- package/dist/migrations/index.d.mts.map +1 -0
- package/dist/migrations/index.mjs +8 -0
- package/dist/mime-IZf-LHIS.mjs +36 -0
- package/dist/mime-IZf-LHIS.mjs.map +1 -0
- package/dist/mode-nh0ppSX5.mjs +23 -0
- package/dist/mode-nh0ppSX5.mjs.map +1 -0
- package/dist/node-sqlite-compat-CDOEcc97.mjs +63 -0
- package/dist/node-sqlite-compat-CDOEcc97.mjs.map +1 -0
- package/dist/normalize-BuWa0lvd.mjs +191 -0
- package/dist/normalize-BuWa0lvd.mjs.map +1 -0
- package/dist/oauth-authorization-BtYQ80uU.mjs +274 -0
- package/dist/oauth-authorization-BtYQ80uU.mjs.map +1 -0
- package/dist/oauth-clients-C1S4NQHh.mjs +266 -0
- package/dist/oauth-clients-C1S4NQHh.mjs.map +1 -0
- package/dist/oauth-state-store-CpGi2FZH.mjs +50 -0
- package/dist/oauth-state-store-CpGi2FZH.mjs.map +1 -0
- package/dist/oauth-user-lookup-BNp1aFAr.mjs +26 -0
- package/dist/oauth-user-lookup-BNp1aFAr.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +15 -0
- package/dist/object-cache/memory.d.mts.map +1 -0
- package/dist/object-cache/memory.mjs +56 -0
- package/dist/object-cache/memory.mjs.map +1 -0
- package/dist/object-cache-Bo6DGaC9.mjs +586 -0
- package/dist/object-cache-Bo6DGaC9.mjs.map +1 -0
- package/dist/options-DhrI7eMv.mjs +208 -0
- package/dist/options-DhrI7eMv.mjs.map +1 -0
- package/dist/options-Dl_W57-_.d.mts +81 -0
- package/dist/options-Dl_W57-_.d.mts.map +1 -0
- package/dist/ownership-DoeAIuTg.mjs +12 -0
- package/dist/ownership-DoeAIuTg.mjs.map +1 -0
- package/dist/page/index.d.mts +19 -5
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +32 -7
- package/dist/page/index.mjs.map +1 -1
- package/dist/parse-Gt2l4Sld.mjs +81 -0
- package/dist/parse-Gt2l4Sld.mjs.map +1 -0
- package/dist/parse-QVS0t5oR.d.mts +172 -0
- package/dist/parse-QVS0t5oR.d.mts.map +1 -0
- package/dist/passkey-config-C-MxsV22.mjs +46 -0
- package/dist/passkey-config-C-MxsV22.mjs.map +1 -0
- package/dist/paths-CqFwkjY8.mjs +77 -0
- package/dist/paths-CqFwkjY8.mjs.map +1 -0
- package/dist/patterns-DyZJ67I7.mjs +140 -0
- package/dist/patterns-DyZJ67I7.mjs.map +1 -0
- package/dist/placeholder-Dn7MMdWr.d.mts +306 -0
- package/dist/placeholder-Dn7MMdWr.d.mts.map +1 -0
- package/dist/plan-D8s1n84S.mjs +135 -0
- package/dist/plan-D8s1n84S.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +120 -0
- package/dist/plugin-test-runtime.d.mts.map +1 -0
- package/dist/plugin-test-runtime.mjs +126 -0
- package/dist/plugin-types.d.mts +196 -0
- package/dist/plugin-types.d.mts.map +1 -0
- package/dist/plugin-types.mjs +18 -0
- package/dist/plugin-types.mjs.map +1 -0
- package/dist/plugin-utils.d.mts +36 -16
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugin-utils.mjs +19 -16
- package/dist/plugin-utils.mjs.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +23 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +124 -28
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/plugins/host.d.mts +7 -0
- package/dist/plugins/host.mjs +59 -0
- package/dist/plugins/http-wire.d.mts +25 -0
- package/dist/plugins/http-wire.d.mts.map +1 -0
- package/dist/plugins/http-wire.mjs +148 -0
- package/dist/plugins/http-wire.mjs.map +1 -0
- package/dist/plugins/secret-redactor.d.mts +9 -0
- package/dist/plugins/secret-redactor.d.mts.map +1 -0
- package/dist/plugins/secret-redactor.mjs +51 -0
- package/dist/plugins/secret-redactor.mjs.map +1 -0
- package/dist/plugins-BpLkXA1S.mjs +277 -0
- package/dist/plugins-BpLkXA1S.mjs.map +1 -0
- package/dist/policy-C1qpNxrr.mjs +45 -0
- package/dist/policy-C1qpNxrr.mjs.map +1 -0
- package/dist/portable-text-BnRuiR1-.mjs +307 -0
- package/dist/portable-text-BnRuiR1-.mjs.map +1 -0
- package/dist/preview-DU5rwz_m.mjs +107 -0
- package/dist/preview-DU5rwz_m.mjs.map +1 -0
- package/dist/protocol-cEfbPvM6.d.mts +61 -0
- package/dist/protocol-cEfbPvM6.d.mts.map +1 -0
- package/dist/public-submission-x1eaT6Tx.mjs +250 -0
- package/dist/public-submission-x1eaT6Tx.mjs.map +1 -0
- package/dist/public-url-B5a0QAh6.mjs +101 -0
- package/dist/public-url-B5a0QAh6.mjs.map +1 -0
- package/dist/query-DSEkrw_m.mjs +41 -0
- package/dist/query-DSEkrw_m.mjs.map +1 -0
- package/dist/query-dHwqNf85.mjs +1161 -0
- package/dist/query-dHwqNf85.mjs.map +1 -0
- package/dist/rate-limit-BXx3Ecp9.mjs +120 -0
- package/dist/rate-limit-BXx3Ecp9.mjs.map +1 -0
- package/dist/receipt-RG5_pwsj.mjs +43 -0
- package/dist/receipt-RG5_pwsj.mjs.map +1 -0
- package/dist/redirect-BRoLiWQE.mjs +19 -0
- package/dist/redirect-BRoLiWQE.mjs.map +1 -0
- package/dist/redirect-BvFKh8Sz.mjs +416 -0
- package/dist/redirect-BvFKh8Sz.mjs.map +1 -0
- package/dist/redirects-CWQMKYOS.mjs +446 -0
- package/dist/redirects-CWQMKYOS.mjs.map +1 -0
- package/dist/redirects-D4EWeXAo.mjs +148 -0
- package/dist/redirects-D4EWeXAo.mjs.map +1 -0
- package/dist/registry/testing.d.mts +26 -0
- package/dist/registry/testing.d.mts.map +1 -0
- package/dist/registry/testing.mjs +265 -0
- package/dist/registry/testing.mjs.map +1 -0
- package/dist/registry-CtHRqVe-.mjs +6771 -0
- package/dist/registry-CtHRqVe-.mjs.map +1 -0
- package/dist/relations-CVI2nbrn.mjs +776 -0
- package/dist/relations-CVI2nbrn.mjs.map +1 -0
- package/dist/request-cache-C4CIo5ad.mjs +104 -0
- package/dist/request-cache-C4CIo5ad.mjs.map +1 -0
- package/dist/request-context.d.mts +45 -1
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs +17 -3
- package/dist/request-context.mjs.map +1 -1
- package/dist/request-meta-B6blULFY.mjs +141 -0
- package/dist/request-meta-B6blULFY.mjs.map +1 -0
- package/dist/resolve-Cw4rWFJl.mjs +100 -0
- package/dist/resolve-Cw4rWFJl.mjs.map +1 -0
- package/dist/resolve-D-kqyKns.mjs +199 -0
- package/dist/resolve-D-kqyKns.mjs.map +1 -0
- package/dist/revision-CGkQA0e5.mjs +366 -0
- package/dist/revision-CGkQA0e5.mjs.map +1 -0
- package/dist/route-wire-DK600v4u.mjs +197 -0
- package/dist/route-wire-DK600v4u.mjs.map +1 -0
- package/dist/routes-D0u5zK2P.mjs +272 -0
- package/dist/routes-D0u5zK2P.mjs.map +1 -0
- package/dist/runner-CC8LZx97.d.mts +68 -0
- package/dist/runner-CC8LZx97.d.mts.map +1 -0
- package/dist/runner-CLpxmhl8.mjs +6197 -0
- package/dist/runner-CLpxmhl8.mjs.map +1 -0
- package/dist/runtime.d.mts +13 -6
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +6 -4
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema/project-env-types.d.mts +12 -0
- package/dist/schema/project-env-types.d.mts.map +1 -0
- package/dist/schema/project-env-types.mjs +86 -0
- package/dist/schema/project-env-types.mjs.map +1 -0
- package/dist/schema-BZPj3kwZ.mjs +13 -0
- package/dist/schema-BZPj3kwZ.mjs.map +1 -0
- package/dist/schema-Berj5VQx.mjs +815 -0
- package/dist/schema-Berj5VQx.mjs.map +1 -0
- package/dist/scopes-CxvclshI.mjs +34 -0
- package/dist/scopes-CxvclshI.mjs.map +1 -0
- package/dist/search-CD5MiMdh.mjs +448 -0
- package/dist/search-CD5MiMdh.mjs.map +1 -0
- package/dist/secrets-CIi0nFiR.mjs +341 -0
- package/dist/secrets-CIi0nFiR.mjs.map +1 -0
- package/dist/sections-Do5KdTSQ.mjs +346 -0
- package/dist/sections-Do5KdTSQ.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +47 -14
- package/dist/seo/index.d.mts +15 -2
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +39 -18
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-C61bnPuV.mjs +114 -0
- package/dist/seo-C61bnPuV.mjs.map +1 -0
- package/dist/seo-DpYxmGaL.mjs +133 -0
- package/dist/seo-DpYxmGaL.mjs.map +1 -0
- package/dist/service-BFUImckH.mjs +150 -0
- package/dist/service-BFUImckH.mjs.map +1 -0
- package/dist/session-user-DVcHsFD5.mjs +61 -0
- package/dist/session-user-DVcHsFD5.mjs.map +1 -0
- package/dist/settings-B0zQj_Tj.mjs +61 -0
- package/dist/settings-B0zQj_Tj.mjs.map +1 -0
- package/dist/settings-Ckzmx-A1.mjs +51 -0
- package/dist/settings-Ckzmx-A1.mjs.map +1 -0
- package/dist/settings-CnWoEDb0.mjs +439 -0
- package/dist/settings-CnWoEDb0.mjs.map +1 -0
- package/dist/setup-complete-B2_dhZZz.mjs +65 -0
- package/dist/setup-complete-B2_dhZZz.mjs.map +1 -0
- package/dist/setup-nonce-CJV9ftSK.mjs +25 -0
- package/dist/setup-nonce-CJV9ftSK.mjs.map +1 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs +104 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs.map +1 -0
- package/dist/site-settings-AYFvhwQn.mjs +50 -0
- package/dist/site-settings-AYFvhwQn.mjs.map +1 -0
- package/dist/site-url-Ceq_AUK0.mjs +16 -0
- package/dist/site-url-Ceq_AUK0.mjs.map +1 -0
- package/dist/slugify-T5GHH42D.mjs +17 -0
- package/dist/slugify-T5GHH42D.mjs.map +1 -0
- package/dist/snapshot-Dzsn3NZa.mjs +414 -0
- package/dist/snapshot-Dzsn3NZa.mjs.map +1 -0
- package/dist/ssrf-DsmvZB80.mjs +406 -0
- package/dist/ssrf-DsmvZB80.mjs.map +1 -0
- package/dist/ssrf-tA45vIPX.mjs +1 -0
- package/dist/stage-BcuakqfP.mjs +662 -0
- package/dist/stage-BcuakqfP.mjs.map +1 -0
- package/dist/staged-Bw5eHbKS.mjs +686 -0
- package/dist/staged-Bw5eHbKS.mjs.map +1 -0
- package/dist/state-kGdOMQRY.mjs +153 -0
- package/dist/state-kGdOMQRY.mjs.map +1 -0
- package/dist/status-D39Fpy8R.mjs +30 -0
- package/dist/status-D39Fpy8R.mjs.map +1 -0
- package/dist/storage/local.d.mts +2 -1
- package/dist/storage/local.d.mts.map +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/local.mjs.map +1 -1
- package/dist/storage/s3.d.mts +2 -1
- package/dist/storage/s3.d.mts.map +1 -1
- package/dist/storage/s3.mjs +4 -3
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/storage-query-CKNIJhjo.d.mts +1614 -0
- package/dist/storage-query-CKNIJhjo.d.mts.map +1 -0
- package/dist/tar-n2OXqKpZ.mjs +449 -0
- package/dist/tar-n2OXqKpZ.mjs.map +1 -0
- package/dist/target-DOFs5oUC.mjs +27 -0
- package/dist/target-DOFs5oUC.mjs.map +1 -0
- package/dist/taxonomies-CMCnItWf.mjs +939 -0
- package/dist/taxonomies-CMCnItWf.mjs.map +1 -0
- package/dist/taxonomies-CvBe3xhM.mjs +697 -0
- package/dist/taxonomies-CvBe3xhM.mjs.map +1 -0
- package/dist/taxonomy-BesdHIwi.mjs +525 -0
- package/dist/taxonomy-BesdHIwi.mjs.map +1 -0
- package/dist/tokens-BIGxi8sP.mjs +171 -0
- package/dist/tokens-BIGxi8sP.mjs.map +1 -0
- package/dist/transaction-BVYIo_yu.mjs +29 -0
- package/dist/transaction-BVYIo_yu.mjs.map +1 -0
- package/dist/transfer-5Ce0QuNS.mjs +8856 -0
- package/dist/transfer-5Ce0QuNS.mjs.map +1 -0
- package/dist/transfer-CzdXsFRx.mjs +166 -0
- package/dist/transfer-CzdXsFRx.mjs.map +1 -0
- package/dist/transfer-download-Dc-ltjZY.mjs +33 -0
- package/dist/transfer-download-Dc-ltjZY.mjs.map +1 -0
- package/dist/transformations-BLzqMnpY.mjs +196 -0
- package/dist/transformations-BLzqMnpY.mjs.map +1 -0
- package/dist/transport-k1fykDBh.d.mts +42 -0
- package/dist/transport-k1fykDBh.d.mts.map +1 -0
- package/dist/transport-umzEbgYO.mjs +136 -0
- package/dist/transport-umzEbgYO.mjs.map +1 -0
- package/dist/trusted-proxy-BqfQFs6a.mjs +51 -0
- package/dist/trusted-proxy-BqfQFs6a.mjs.map +1 -0
- package/dist/turnstile-CvvKLtqE.mjs +53 -0
- package/dist/turnstile-CvvKLtqE.mjs.map +1 -0
- package/dist/types-B8tO_KdV.d.mts +896 -0
- package/dist/types-B8tO_KdV.d.mts.map +1 -0
- package/dist/types-BGmQ0uXs.mjs +201 -0
- package/dist/types-BGmQ0uXs.mjs.map +1 -0
- package/dist/types-BYaPWs_F.d.mts +198 -0
- package/dist/types-BYaPWs_F.d.mts.map +1 -0
- package/dist/types-CLTQ9b_r.d.mts +374 -0
- package/dist/types-CLTQ9b_r.d.mts.map +1 -0
- package/dist/types-CPkQw2T2.d.mts +85 -0
- package/dist/types-CPkQw2T2.d.mts.map +1 -0
- package/dist/types-CQLvuXoZ.d.mts +198 -0
- package/dist/types-CQLvuXoZ.d.mts.map +1 -0
- package/dist/types-CV5xszpF.d.mts +363 -0
- package/dist/types-CV5xszpF.d.mts.map +1 -0
- package/dist/types-CVsmpTcU.mjs +18 -0
- package/dist/types-CVsmpTcU.mjs.map +1 -0
- package/dist/types-CdEMurNh.mjs +77 -0
- package/dist/types-CdEMurNh.mjs.map +1 -0
- package/dist/types-CxwtnuSS.mjs +37 -0
- package/dist/types-CxwtnuSS.mjs.map +1 -0
- package/dist/types-DGw8KMX_.mjs +16 -0
- package/dist/types-DGw8KMX_.mjs.map +1 -0
- package/dist/types-DOfVMPoo.d.mts +125 -0
- package/dist/types-DOfVMPoo.d.mts.map +1 -0
- package/dist/types-Dsco9Y38.d.mts +1720 -0
- package/dist/types-Dsco9Y38.d.mts.map +1 -0
- package/dist/types-LtS0SM4F.d.mts +287 -0
- package/dist/types-LtS0SM4F.d.mts.map +1 -0
- package/dist/types-j6MBDjlZ.mjs +103 -0
- package/dist/types-j6MBDjlZ.mjs.map +1 -0
- package/dist/update-check-B2JKz5cr.mjs +161 -0
- package/dist/update-check-B2JKz5cr.mjs.map +1 -0
- package/dist/upload-attempts-BodUoFBu.mjs +32 -0
- package/dist/upload-attempts-BodUoFBu.mjs.map +1 -0
- package/dist/url-Dn3IStq8.mjs +104 -0
- package/dist/url-Dn3IStq8.mjs.map +1 -0
- package/dist/url-pattern-DGAG6ZP2.mjs +41 -0
- package/dist/url-pattern-DGAG6ZP2.mjs.map +1 -0
- package/dist/user-BOvuF1sQ.mjs +171 -0
- package/dist/user-BOvuF1sQ.mjs.map +1 -0
- package/dist/utils-CoV-PYhg.mjs +439 -0
- package/dist/utils-CoV-PYhg.mjs.map +1 -0
- package/dist/validate-DANX1-Qi.mjs +120 -0
- package/dist/validate-DANX1-Qi.mjs.map +1 -0
- package/dist/validate-DpP1QUiV.d.mts +468 -0
- package/dist/validate-DpP1QUiV.d.mts.map +1 -0
- package/dist/validate-WkjGwBSO.mjs +516 -0
- package/dist/validate-WkjGwBSO.mjs.map +1 -0
- package/dist/validation-DG7Y9H4u.mjs +219 -0
- package/dist/validation-DG7Y9H4u.mjs.map +1 -0
- package/dist/version-BnlfLUa6.mjs +7 -0
- package/dist/version-BnlfLUa6.mjs.map +1 -0
- package/dist/version-BwEGkqkx.mjs +9 -0
- package/dist/version-BwEGkqkx.mjs.map +1 -0
- package/dist/virtual-modules-B6vJW15k.mjs +516 -0
- package/dist/virtual-modules-B6vJW15k.mjs.map +1 -0
- package/dist/widgets-D7I_9xff.mjs +126 -0
- package/dist/widgets-D7I_9xff.mjs.map +1 -0
- package/dist/wxr-taxonomies-Di1w9HDU.d.mts +34 -0
- package/dist/wxr-taxonomies-Di1w9HDU.d.mts.map +1 -0
- package/dist/wxr-taxonomies-m_141EtN.mjs +453 -0
- package/dist/wxr-taxonomies-m_141EtN.mjs.map +1 -0
- package/dist/zod-generator-DnfG5sGQ.mjs +424 -0
- package/dist/zod-generator-DnfG5sGQ.mjs.map +1 -0
- package/locals.d.ts +1 -6
- package/package.json +142 -31
- package/src/after.ts +6 -1
- package/src/api/authorize.ts +27 -1
- package/src/api/email-locale.ts +24 -0
- package/src/api/error.ts +22 -7
- package/src/api/errors.ts +131 -0
- package/src/api/handlers/api-tokens.ts +37 -3
- package/src/api/handlers/backup.ts +318 -0
- package/src/api/handlers/block-types.ts +129 -0
- package/src/api/handlers/bulk-tag.ts +309 -0
- package/src/api/handlers/byline-fields.ts +212 -0
- package/src/api/handlers/bylines.ts +283 -0
- package/src/api/handlers/comment-reactions.ts +165 -0
- package/src/api/handlers/comments.ts +6 -32
- package/src/api/handlers/content.ts +1552 -156
- package/src/api/handlers/dashboard.ts +73 -38
- package/src/api/handlers/device-flow.ts +80 -23
- package/src/api/handlers/entry-lock.ts +206 -0
- package/src/api/handlers/index.ts +90 -0
- package/src/api/handlers/manifest.ts +245 -12
- package/src/api/handlers/marketplace.ts +251 -53
- package/src/api/handlers/media-allowlist.ts +52 -0
- package/src/api/handlers/media-folders.ts +130 -0
- package/src/api/handlers/media-upload.ts +186 -0
- package/src/api/handlers/media-usage-activation.ts +102 -0
- package/src/api/handlers/media-usage-work.ts +188 -0
- package/src/api/handlers/media-usage.ts +418 -0
- package/src/api/handlers/media.ts +207 -16
- package/src/api/handlers/menus.ts +294 -392
- package/src/api/handlers/oauth-authorization.ts +74 -39
- package/src/api/handlers/oauth-clients.ts +1 -1
- package/src/api/handlers/plugin-settings.ts +250 -0
- package/src/api/handlers/plugins.ts +195 -41
- package/src/api/handlers/redirects.ts +225 -131
- package/src/api/handlers/registry.ts +1844 -0
- package/src/api/handlers/relations.ts +960 -0
- package/src/api/handlers/revision.ts +70 -20
- package/src/api/handlers/schema.ts +486 -8
- package/src/api/handlers/seo.ts +68 -5
- package/src/api/handlers/settings.ts +2 -2
- package/src/api/handlers/snapshot.ts +359 -68
- package/src/api/handlers/staged-references.ts +208 -0
- package/src/api/handlers/taxonomies.ts +887 -156
- package/src/api/handlers/transfer.ts +1347 -0
- package/src/api/handlers/update-check.ts +236 -0
- package/src/api/handlers/validate-media-fields.ts +237 -0
- package/src/api/handlers/validate-references.ts +146 -0
- package/src/api/handlers/validation.ts +120 -19
- package/src/api/media-usage-write-fence.ts +43 -0
- package/src/api/openapi/document.ts +1644 -262
- package/src/api/parse.ts +3 -17
- package/src/api/public-url.ts +66 -6
- package/src/api/redirect.ts +9 -1
- package/src/api/schemas/auth.ts +10 -4
- package/src/api/schemas/byline-fields.ts +188 -0
- package/src/api/schemas/bylines.ts +97 -1
- package/src/api/schemas/comments.ts +19 -3
- package/src/api/schemas/common.ts +29 -9
- package/src/api/schemas/content.ts +302 -8
- package/src/api/schemas/entry-lock.ts +57 -0
- package/src/api/schemas/import.ts +69 -14
- package/src/api/schemas/index.ts +4 -0
- package/src/api/schemas/media-usage.ts +341 -0
- package/src/api/schemas/media.ts +186 -5
- package/src/api/schemas/menus.ts +50 -22
- package/src/api/schemas/redirects.ts +17 -5
- package/src/api/schemas/relations.ts +121 -0
- package/src/api/schemas/schema.ts +267 -7
- package/src/api/schemas/search.ts +7 -0
- package/src/api/schemas/sections.ts +3 -3
- package/src/api/schemas/settings.ts +41 -9
- package/src/api/schemas/setup.ts +1 -1
- package/src/api/schemas/taxonomies.ts +134 -10
- package/src/api/schemas/transfer.ts +249 -0
- package/src/api/schemas/users.ts +2 -2
- package/src/api/setup-complete.ts +49 -1
- package/src/api/site-url.ts +16 -6
- package/src/api/transfer-download.ts +36 -0
- package/src/api/types.ts +45 -10
- package/src/astro/dev-typegen.ts +28 -0
- package/src/astro/image-endpoint.ts +84 -0
- package/src/astro/index.ts +6 -0
- package/src/astro/integration/dev-typegen.ts +120 -0
- package/src/astro/integration/index.ts +501 -122
- package/src/astro/integration/route-naming.ts +19 -0
- package/src/astro/integration/routes.ts +367 -16
- package/src/astro/integration/runtime.ts +250 -24
- package/src/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/src/astro/integration/shims/use-sync-external-store.js +1 -0
- package/src/astro/integration/virtual-modules.ts +213 -7
- package/src/astro/integration/vite-config.ts +261 -31
- package/src/astro/middleware/auth.ts +157 -102
- package/src/astro/middleware/csp.ts +79 -3
- package/src/astro/middleware/media-usage-write-fence.ts +125 -0
- package/src/astro/middleware/redirect.ts +68 -24
- package/src/astro/middleware/request-context.ts +223 -27
- package/src/astro/middleware/scoped-db.ts +183 -0
- package/src/astro/middleware/stream-end-metrics.ts +102 -0
- package/src/astro/middleware.ts +699 -115
- package/src/astro/object-cache/adapters.ts +50 -0
- package/src/astro/prefetch.ts +82 -0
- package/src/astro/public-plugin-api-routes.ts +42 -0
- package/src/astro/routes/PluginRegistry.tsx +5 -2
- package/src/astro/routes/admin.astro +74 -19
- package/src/astro/routes/api/admin/api-tokens/index.ts +6 -3
- package/src/astro/routes/api/admin/byline-fields/[slug]/usage.ts +36 -0
- package/src/astro/routes/api/admin/byline-fields/[slug].ts +92 -0
- package/src/astro/routes/api/admin/byline-fields/index.ts +66 -0
- package/src/astro/routes/api/admin/byline-fields/reorder.ts +39 -0
- package/src/astro/routes/api/admin/bylines/[id]/index.ts +34 -31
- package/src/astro/routes/api/admin/bylines/[id]/translations.ts +102 -0
- package/src/astro/routes/api/admin/bylines/index.ts +25 -11
- package/src/astro/routes/api/admin/comments/[id]/status.ts +23 -60
- package/src/astro/routes/api/admin/comments/index.ts +1 -2
- package/src/astro/routes/api/admin/core-update.ts +34 -0
- package/src/astro/routes/api/admin/hooks/exclusive/index.ts +1 -5
- package/src/astro/routes/api/admin/media-usage/activation.ts +42 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/index.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/collection-deletions/retry.ts +22 -0
- package/src/astro/routes/api/admin/media-usage/progress.ts +37 -0
- package/src/astro/routes/api/admin/media-usage/repair.ts +24 -0
- package/src/astro/routes/api/admin/media-usage/work/index.ts +26 -0
- package/src/astro/routes/api/admin/media-usage/work/retry.ts +26 -0
- package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
- package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +7 -10
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +7 -10
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +7 -0
- package/src/astro/routes/api/admin/plugins/[id]/mcp.ts +42 -0
- package/src/astro/routes/api/admin/plugins/[id]/settings.ts +80 -0
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +6 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +31 -4
- package/src/astro/routes/api/admin/plugins/index.ts +10 -0
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/icon.ts +6 -2
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +25 -3
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +57 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +112 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +538 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +134 -0
- package/src/astro/routes/api/admin/plugins/registry/publisher-handle.ts +59 -0
- package/src/astro/routes/api/admin/plugins/registry/verify.ts +61 -0
- package/src/astro/routes/api/admin/plugins/updates.ts +45 -6
- package/src/astro/routes/api/admin/scheduled-policy-rejections/[collection]/[id].ts +34 -0
- package/src/astro/routes/api/admin/themes/marketplace/[id]/thumbnail.ts +6 -2
- package/src/astro/routes/api/admin/themes/marketplace/index.ts +1 -1
- 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 +11 -3
- package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
- package/src/astro/routes/api/auth/invite/complete.ts +10 -5
- package/src/astro/routes/api/auth/invite/index.ts +17 -3
- package/src/astro/routes/api/auth/invite/register-options.ts +8 -1
- package/src/astro/routes/api/auth/magic-link/send.ts +11 -3
- package/src/astro/routes/api/auth/magic-link/verify.ts +40 -39
- package/src/astro/routes/api/auth/me.ts +34 -11
- package/src/astro/routes/api/auth/mode.ts +6 -14
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +30 -9
- package/src/astro/routes/api/auth/oauth/[provider].ts +24 -7
- package/src/astro/routes/api/auth/passkey/options.ts +2 -21
- package/src/astro/routes/api/auth/passkey/register/verify.ts +6 -1
- package/src/astro/routes/api/auth/passkey/verify.ts +10 -5
- package/src/astro/routes/api/auth/signup/complete.ts +10 -5
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +4 -246
- package/src/astro/routes/api/comments/[collection]/[contentId]/reactions.ts +97 -0
- package/src/astro/routes/api/content/[collection]/[id]/compare.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +26 -6
- package/src/astro/routes/api/content/[collection]/[id]/duplicate.ts +5 -6
- package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
- package/src/astro/routes/api/content/[collection]/[id]/permanent.ts +3 -4
- package/src/astro/routes/api/content/[collection]/[id]/plugin-extensions/[pluginId]/[kind]/[extensionId].ts +29 -0
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +87 -15
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +58 -8
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/children.ts +52 -0
- package/src/astro/routes/api/content/[collection]/[id]/references/[relation]/parents.ts +47 -0
- package/src/astro/routes/api/content/[collection]/[id]/restore.ts +6 -4
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +6 -6
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +42 -9
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +103 -38
- package/src/astro/routes/api/content/[collection]/[id]/translations.ts +4 -5
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +26 -6
- package/src/astro/routes/api/content/[collection]/[id].ts +62 -18
- package/src/astro/routes/api/content/[collection]/authors.ts +33 -0
- package/src/astro/routes/api/content/[collection]/index.ts +10 -9
- package/src/astro/routes/api/content/[collection]/trash.ts +2 -3
- package/src/astro/routes/api/health.ts +18 -0
- package/src/astro/routes/api/import/wordpress/execute.ts +428 -8
- package/src/astro/routes/api/import/wordpress/media.ts +9 -3
- package/src/astro/routes/api/import/wordpress/prepare.ts +10 -12
- package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +225 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +132 -273
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +798 -46
- package/src/astro/routes/api/manifest.ts +85 -46
- package/src/astro/routes/api/mcp.ts +6 -2
- package/src/astro/routes/api/media/[id]/confirm.ts +169 -11
- package/src/astro/routes/api/media/[id]/replace.ts +114 -0
- package/src/astro/routes/api/media/[id]/upload.ts +262 -0
- package/src/astro/routes/api/media/[id]/usage.ts +30 -0
- package/src/astro/routes/api/media/[id].ts +32 -18
- package/src/astro/routes/api/media/asset/[id]/[filename].ts +50 -0
- package/src/astro/routes/api/media/file/[...key].ts +37 -1
- package/src/astro/routes/api/media/folders/[id].ts +55 -0
- package/src/astro/routes/api/media/folders/index.ts +37 -0
- package/src/astro/routes/api/media/providers/[providerId]/index.ts +12 -3
- package/src/astro/routes/api/media/upload-url.ts +44 -37
- package/src/astro/routes/api/media.ts +115 -33
- package/src/astro/routes/api/menus/[name]/items/[id].ts +74 -0
- package/src/astro/routes/api/menus/[name]/items.ts +12 -60
- package/src/astro/routes/api/menus/[name]/reorder.ts +12 -4
- package/src/astro/routes/api/menus/[name]/translations.ts +85 -0
- package/src/astro/routes/api/menus/[name].ts +25 -11
- package/src/astro/routes/api/menus/index.ts +13 -7
- package/src/astro/routes/api/oauth/authorize.ts +47 -15
- package/src/astro/routes/api/oauth/device/authorize.ts +33 -4
- package/src/astro/routes/api/oauth/register.ts +22 -2
- package/src/astro/routes/api/openapi.json.ts +27 -10
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +13 -59
- package/src/astro/routes/api/redirects/404s/index.ts +7 -1
- package/src/astro/routes/api/redirects/404s/summary.ts +3 -1
- package/src/astro/routes/api/redirects/[id].ts +7 -4
- package/src/astro/routes/api/redirects/index.ts +5 -3
- package/src/astro/routes/api/relations/[id]/index.ts +84 -0
- package/src/astro/routes/api/relations/index.ts +56 -0
- package/src/astro/routes/api/revisions/[revisionId]/index.ts +1 -1
- package/src/astro/routes/api/revisions/[revisionId]/restore.ts +17 -1
- 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/schema/collections/[slug]/fields/[fieldSlug].ts +9 -13
- package/src/astro/routes/api/schema/collections/[slug]/fields/index.ts +2 -8
- package/src/astro/routes/api/schema/collections/[slug]/fields/reorder.ts +1 -2
- package/src/astro/routes/api/schema/collections/[slug]/index.ts +5 -11
- package/src/astro/routes/api/schema/collections/index.ts +4 -4
- package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +19 -19
- package/src/astro/routes/api/schema/orphans/[slug].ts +1 -1
- package/src/astro/routes/api/schema/orphans/index.ts +1 -1
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/index.ts +13 -2
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/sections/[slug].ts +7 -1
- package/src/astro/routes/api/sections/index.ts +5 -1
- package/src/astro/routes/api/settings/backups/archives/[name].ts +78 -0
- package/src/astro/routes/api/settings/backups/archives/index.ts +33 -0
- package/src/astro/routes/api/settings/backups/export.ts +43 -0
- package/src/astro/routes/api/settings/backups/index.ts +76 -0
- package/src/astro/routes/api/settings/email.ts +1 -1
- package/src/astro/routes/api/settings.ts +4 -1
- package/src/astro/routes/api/setup/admin-verify.ts +20 -10
- package/src/astro/routes/api/setup/admin.ts +11 -4
- package/src/astro/routes/api/setup/dev-bypass.ts +26 -10
- package/src/astro/routes/api/setup/index.ts +71 -36
- package/src/astro/routes/api/snapshot.ts +48 -19
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +44 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +92 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +28 -23
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +19 -15
- package/src/astro/routes/api/taxonomies/[name]/translations.ts +48 -0
- package/src/astro/routes/api/taxonomies/[name].ts +107 -0
- package/src/astro/routes/api/taxonomies/bulk-tag.ts +29 -0
- package/src/astro/routes/api/taxonomies/index.ts +13 -8
- package/src/astro/routes/api/themes/preview.ts +11 -5
- package/src/astro/routes/api/typegen.ts +4 -42
- package/src/astro/routes/api/visual-editing/action-token.ts +36 -0
- package/src/astro/routes/api/visual-editing/content/[collection]/[id]/publish.ts +32 -0
- package/src/astro/routes/api/visual-editing/toolbar-labels.ts +16 -0
- package/src/astro/routes/api/well-known/oauth-authorization-server.ts +4 -1
- package/src/astro/routes/api/well-known/oauth-protected-resource.ts +5 -1
- package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name].ts +3 -1
- package/src/astro/routes/api/widget-areas/index.ts +3 -1
- package/src/astro/routes/sitemap-[collection].xml.ts +133 -14
- package/src/astro/session-user.ts +71 -0
- package/src/astro/types.ts +304 -16
- package/src/auth/allowed-origins.ts +168 -0
- package/src/auth/api-tokens.ts +2 -0
- package/src/auth/challenge-store.ts +3 -1
- package/src/auth/oauth-state-store.ts +3 -0
- package/src/auth/passkey-config.ts +35 -13
- package/src/auth/providers/github-admin.tsx +5 -6
- package/src/auth/providers/google-admin.tsx +5 -6
- package/src/auth/rate-limit.ts +6 -5
- package/src/auth/scopes.ts +14 -9
- package/src/auth/trusted-proxy.ts +1 -1
- package/src/aws-sdk.d.ts +1 -0
- package/src/bylines/credits.ts +149 -0
- package/src/bylines/field-defs-cache.ts +188 -0
- package/src/bylines/index.ts +152 -152
- package/src/cache/chrome-tags.ts +24 -0
- package/src/cleanup.ts +72 -26
- package/src/cli/client-factory.ts +6 -2
- package/src/cli/commands/content.ts +48 -7
- package/src/cli/commands/doctor.ts +219 -7
- package/src/cli/commands/export-seed.ts +1021 -142
- package/src/cli/commands/init.ts +4 -8
- package/src/cli/commands/login.ts +8 -1
- package/src/cli/commands/media.ts +127 -0
- package/src/cli/commands/migrate.ts +641 -0
- package/src/cli/commands/secrets.ts +183 -0
- package/src/cli/commands/seed.ts +9 -3
- package/src/cli/commands/site.ts +556 -0
- package/src/cli/credentials.ts +2 -61
- package/src/cli/index.ts +6 -28
- 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/cli/wxr/parser.ts +263 -0
- package/src/client/index.ts +849 -31
- package/src/client/portable-text.ts +41 -0
- package/src/client/transport.ts +23 -9
- package/src/comments/public-submission.ts +254 -0
- package/src/comments/query.ts +78 -7
- package/src/comments/ranking.ts +58 -0
- package/src/comments/service.ts +60 -13
- package/src/comments/turnstile.ts +64 -0
- package/src/components/Block.astro +83 -0
- package/src/components/BlockquoteGroup.astro +34 -0
- package/src/components/Blocks.astro +46 -0
- package/src/components/Break.astro +2 -2
- package/src/components/Columns.astro +3 -1
- package/src/components/CommentForm.astro +13 -6
- package/src/components/Comments.astro +137 -2
- package/src/components/Cover.astro +3 -1
- package/src/components/EmDashBodyEnd.astro +4 -1
- package/src/components/EmDashBodyStart.astro +4 -1
- package/src/components/EmDashHead.astro +113 -25
- package/src/components/EmDashImage.astro +210 -53
- package/src/components/EmDashMedia.astro +3 -3
- package/src/components/Embed.astro +1 -1
- package/src/components/Gallery.astro +166 -29
- package/src/components/Image.astro +158 -40
- package/src/components/InlineEditor.astro +3 -1
- package/src/components/InlinePortableTextEditor.tsx +854 -97
- package/src/components/JsonLdScript.astro +9 -0
- package/src/components/LiveSearch.astro +63 -4
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +34 -2
- package/src/components/Table.astro +147 -62
- package/src/components/WidgetArea.astro +3 -2
- package/src/components/blocks.ts +44 -0
- package/src/components/code-mark.ts +11 -0
- package/src/components/index.ts +25 -8
- package/src/components/inline-code-block.tsx +474 -0
- package/src/components/live-search-routing.ts +30 -0
- package/src/components/marks/Link.astro +5 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/components/portable-text-blockquote-group.ts +68 -0
- package/src/components/portable-text-text-align.ts +38 -0
- package/src/components/widgets/Archives.astro +7 -41
- package/src/components/widgets/Categories.astro +1 -1
- package/src/components/widgets/Tags.astro +1 -1
- package/src/config/errors.ts +13 -0
- package/src/config/secrets.ts +562 -0
- package/src/content/converters/gallery.ts +101 -0
- package/src/content/converters/image-link.ts +27 -0
- package/src/content/converters/index.ts +3 -0
- package/src/content/converters/mark-safety.ts +121 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-identity.ts +139 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +400 -90
- package/src/content/converters/prosemirror-to-portable-text.ts +234 -46
- package/src/content/converters/types.ts +80 -0
- package/src/content/known-fields.ts +44 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/content-list-query.ts +29 -0
- package/src/database/connection.ts +9 -41
- package/src/database/content-datetime.ts +228 -0
- package/src/database/datetime-storage.ts +452 -0
- package/src/database/dialect-helpers.ts +352 -10
- package/src/database/errors.ts +14 -0
- package/src/database/index.ts +11 -3
- package/src/database/instrumentation.ts +56 -9
- package/src/database/json-recordset.ts +16 -0
- package/src/database/migration-lock.ts +140 -0
- package/src/database/migrations/006_taxonomy_defs.ts +1 -1
- package/src/database/migrations/014_draft_revisions.ts +6 -6
- package/src/database/migrations/016_api_tokens.ts +18 -3
- package/src/database/migrations/017_authorization_codes.ts +14 -4
- package/src/database/migrations/019_i18n.ts +3 -3
- package/src/database/migrations/034_published_at_index.ts +1 -1
- package/src/database/migrations/035_bounded_404_log.ts +37 -31
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +655 -0
- package/src/database/migrations/037_credential_algorithm.ts +18 -0
- package/src/database/migrations/038_registry_plugin_state.ts +130 -0
- package/src/database/migrations/039_fix_fts5_triggers.ts +264 -0
- package/src/database/migrations/040_byline_i18n.ts +497 -0
- package/src/database/migrations/041_content_locale_list_index.ts +47 -0
- package/src/database/migrations/042_byline_fields.ts +157 -0
- package/src/database/migrations/043_content_references.ts +121 -0
- package/src/database/migrations/044_comment_reactions.ts +56 -0
- package/src/database/migrations/045_taxonomy_parent_group.ts +68 -0
- package/src/database/migrations/046_media_usage_index.ts +115 -0
- package/src/database/migrations/047_restore_taxonomy_parent_index.ts +29 -0
- package/src/database/migrations/048_restore_content_taxonomies_term_index.ts +32 -0
- package/src/database/migrations/049_taxonomies_name_locale_index.ts +42 -0
- package/src/database/migrations/050_media_usage_index_status.ts +142 -0
- package/src/database/migrations/051_content_taxonomies_denorm.ts +120 -0
- package/src/database/migrations/052_media_usage_read_index.ts +26 -0
- package/src/database/migrations/053_plugin_mcp_tools.ts +21 -0
- package/src/database/migrations/054_media_upload_attempts.ts +41 -0
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -0
- package/src/database/migrations/060_collection_admin_config.ts +16 -0
- package/src/database/migrations/061_media_usage_cleanup.ts +77 -0
- package/src/database/migrations/062_media_usage_cleanup_fence.ts +295 -0
- package/src/database/migrations/063_media_usage_incremental_work.ts +397 -0
- package/src/database/migrations/064_fts_plain_text.ts +253 -0
- package/src/database/migrations/065_media_usage_collection_deletion.ts +85 -0
- package/src/database/migrations/066_media_usage_reconciliation.ts +115 -0
- package/src/database/migrations/067_indexed_content_fields.ts +39 -0
- package/src/database/migrations/068_content_taxonomy_entry_groups.ts +61 -0
- package/src/database/migrations/069_collection_title_date_fields.ts +45 -0
- package/src/database/migrations/070_collection_routable.ts +18 -0
- package/src/database/migrations/071_restore_content_bylines_table.ts +43 -0
- package/src/database/migrations/072_media_folders.ts +72 -0
- package/src/database/migrations/073_media_focal_point.ts +57 -0
- package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
- package/src/database/migrations/075_entry_edit_locks.ts +44 -0
- package/src/database/migrations/076_collection_nav_group.ts +22 -0
- package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
- package/src/database/migrations/078_menu_item_translation_groups.ts +15 -0
- package/src/database/migrations/079_datetime_normalization.ts +13 -0
- package/src/database/migrations/080_content_translation_locale_unique.ts +88 -0
- package/src/database/migrations/081_redirect_write_guards.ts +260 -0
- package/src/database/migrations/082_taxonomy_translation_locale_unique.ts +49 -0
- 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/086_relations_structural.ts +197 -0
- package/src/database/migrations/087_reference_field_relations.ts +407 -0
- package/src/database/migrations/088_cron_oneshot_utc.ts +39 -0
- package/src/database/migrations/089_auto_seed_completion.ts +13 -0
- package/src/database/migrations/policy.ts +70 -0
- package/src/database/migrations/runner.ts +416 -43
- package/src/database/pg-migration-lock.ts +69 -0
- package/src/database/reference-backfill.ts +141 -0
- package/src/database/repositories/audit.ts +13 -3
- package/src/database/repositories/byline.ts +1120 -87
- package/src/database/repositories/comment-reaction.ts +132 -0
- package/src/database/repositories/comment.ts +99 -3
- package/src/database/repositories/content.ts +2210 -267
- package/src/database/repositories/entry-locks.ts +257 -0
- package/src/database/repositories/index.ts +21 -0
- package/src/database/repositories/media-folders.ts +115 -0
- package/src/database/repositories/media-usage-work.ts +1132 -0
- package/src/database/repositories/media-usage.ts +4040 -0
- package/src/database/repositories/media.ts +465 -55
- package/src/database/repositories/menu.ts +657 -0
- package/src/database/repositories/options.ts +128 -10
- package/src/database/repositories/plugin-storage.ts +265 -44
- package/src/database/repositories/redirect.ts +296 -79
- package/src/database/repositories/relation.ts +1004 -0
- package/src/database/repositories/revision.ts +225 -31
- package/src/database/repositories/seo.ts +3 -0
- package/src/database/repositories/taxonomy-def.ts +126 -0
- package/src/database/repositories/taxonomy.ts +747 -97
- package/src/database/repositories/types.ts +209 -0
- package/src/database/repositories/user.ts +18 -0
- package/src/database/transaction.ts +12 -0
- package/src/database/types.ts +525 -7
- package/src/database/validate.ts +39 -0
- package/src/datetime-normalization.ts +311 -0
- package/src/db/adapters.ts +105 -5
- package/src/db/index.ts +6 -1
- package/src/db/libsql-migrations.ts +72 -0
- package/src/db/libsql.ts +1 -3
- package/src/db/node-sqlite-compat.ts +105 -0
- package/src/db/postgres-migrations.ts +59 -0
- package/src/db/postgres.ts +28 -2
- package/src/db/sqlite-migrations.ts +37 -0
- package/src/db/sqlite.ts +4 -7
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +4558 -909
- package/src/fields/boolean.ts +1 -1
- package/src/fields/datetime.ts +1 -1
- package/src/fields/file.ts +15 -11
- package/src/fields/image.ts +29 -13
- package/src/fields/integer.ts +1 -1
- package/src/fields/json.ts +1 -1
- package/src/fields/multiselect.ts +1 -1
- package/src/fields/number.ts +1 -1
- package/src/fields/portable-text.ts +1 -1
- package/src/fields/richtext.ts +1 -1
- package/src/fields/select.ts +1 -1
- package/src/fields/slug.ts +1 -1
- package/src/fields/text.ts +1 -1
- package/src/fields/textarea.ts +1 -1
- package/src/fields/types.ts +29 -9
- package/src/i18n/config.ts +57 -10
- package/src/i18n/normalize.ts +31 -0
- package/src/i18n/repair-locale-casing.ts +37 -0
- package/src/i18n/resolve.ts +272 -0
- package/src/i18n/taxonomy-locale-diagnostic.ts +47 -0
- package/src/import/comments.ts +159 -0
- package/src/import/index.ts +8 -1
- package/src/import/settings.ts +65 -189
- package/src/import/sources/wordpress-plugin.ts +347 -44
- package/src/import/sources/wxr.ts +20 -3
- package/src/import/ssrf.ts +20 -500
- package/src/import/types.ts +12 -0
- package/src/import/utils.ts +214 -0
- package/src/import/wxr-taxonomies.ts +748 -0
- package/src/index.ts +274 -20
- package/src/loader.ts +1257 -152
- package/src/mcp/server.ts +2065 -272
- package/src/mcp/transfer.ts +569 -0
- package/src/media/enrich.ts +78 -0
- package/src/media/focal-point.ts +37 -0
- package/src/media/image-endpoint.ts +206 -0
- package/src/media/index.ts +1 -0
- package/src/media/local-runtime.ts +49 -15
- package/src/media/local.ts +1 -1
- package/src/media/mime.ts +76 -0
- package/src/media/normalize.ts +82 -9
- package/src/media/placeholder.ts +29 -9
- package/src/media/responsive.ts +148 -0
- package/src/media/types.ts +24 -0
- package/src/media/upload-attempts.ts +38 -0
- package/src/media/url.ts +15 -0
- package/src/media/usage/activation.ts +762 -0
- package/src/media/usage/capture-triggers.ts +559 -0
- package/src/media/usage/cleanup.ts +306 -0
- package/src/media/usage/collection-deletion-processor.ts +360 -0
- package/src/media/usage/collection-deletion.ts +846 -0
- package/src/media/usage/content-fields.ts +220 -0
- package/src/media/usage/content-refresh.ts +1000 -0
- package/src/media/usage/content-repair.ts +802 -0
- package/src/media/usage/content-snapshots.ts +516 -0
- package/src/media/usage/extractor.ts +427 -0
- package/src/media/usage/gc.ts +50 -0
- package/src/media/usage/maintenance-engine.ts +166 -0
- package/src/media/usage/projection-fingerprint.ts +143 -0
- package/src/media/usage/reconciliation-processor.ts +449 -0
- package/src/media/usage/reconciliation.ts +1200 -0
- package/src/media/usage/schema-invalidation.ts +72 -0
- package/src/media/usage/site-settings.ts +52 -0
- package/src/media/usage/source-key.ts +26 -0
- package/src/media/usage/types.ts +50 -0
- package/src/media/usage/work-processor.ts +489 -0
- package/src/menus/index.ts +408 -198
- package/src/menus/types.ts +15 -1
- package/src/migrations/config-loader.ts +210 -0
- package/src/migrations/direct-executor.ts +179 -0
- package/src/migrations/identity.ts +46 -0
- package/src/migrations/index.ts +20 -0
- package/src/migrations/integration-metadata.ts +67 -0
- package/src/migrations/manifest-builder.ts +55 -0
- package/src/migrations/manifest-writer.ts +63 -0
- package/src/migrations/manifest.ts +197 -0
- package/src/migrations/protocol.ts +69 -0
- package/src/migrations/target.ts +35 -0
- package/src/object-cache/codec.ts +73 -0
- package/src/object-cache/index.ts +852 -0
- package/src/object-cache/memory.ts +91 -0
- package/src/object-cache/types.ts +125 -0
- package/src/page/absolute-url.ts +146 -0
- package/src/page/jsonld.ts +10 -2
- package/src/page/metadata.ts +50 -3
- package/src/page/seo-contributions.ts +94 -6
- package/src/page/seo-panel.ts +47 -0
- package/src/page/site-identity.ts +58 -0
- package/src/plugin-test-runtime.ts +18 -0
- package/src/plugin-types.ts +410 -0
- package/src/plugin-utils.ts +31 -6
- package/src/plugins/adapt-sandbox-entry.ts +249 -56
- package/src/plugins/byline-access.ts +158 -0
- package/src/plugins/conditional-storage.ts +30 -0
- package/src/plugins/content-access.ts +170 -0
- package/src/plugins/content-policy.ts +74 -0
- package/src/plugins/context.ts +1160 -251
- package/src/plugins/cron.ts +69 -19
- package/src/plugins/define-plugin.ts +129 -86
- package/src/plugins/editor-draft.ts +257 -0
- package/src/plugins/email-console.ts +3 -1
- package/src/plugins/email.ts +16 -0
- package/src/plugins/hooks.ts +330 -57
- package/src/plugins/host.ts +30 -0
- package/src/plugins/http-route-dispatch.ts +389 -0
- package/src/plugins/http-wire.ts +180 -0
- package/src/plugins/index.ts +148 -12
- package/src/plugins/install-finalization.ts +77 -0
- package/src/plugins/lifecycle.ts +47 -0
- package/src/plugins/manager.ts +40 -2
- package/src/plugins/manifest-schema.ts +452 -49
- package/src/plugins/marketplace.ts +110 -42
- package/src/plugins/media.ts +166 -0
- package/src/plugins/request-meta.ts +12 -2
- package/src/plugins/route-error.ts +57 -0
- package/src/plugins/route-wire.ts +304 -0
- package/src/plugins/routes.ts +183 -62
- package/src/plugins/sandbox/hook-result.ts +52 -0
- package/src/plugins/sandbox/index.ts +25 -1
- package/src/plugins/sandbox/noop.ts +13 -5
- package/src/plugins/sandbox/proxy.ts +130 -0
- package/src/plugins/sandbox/runner-options.ts +16 -0
- package/src/plugins/sandbox/types.ts +218 -9
- package/src/plugins/save-rejection.ts +20 -0
- package/src/plugins/scheduler/node.ts +9 -2
- package/src/plugins/secret-redactor.ts +65 -0
- package/src/plugins/settings.ts +303 -0
- package/src/plugins/state.ts +137 -39
- package/src/plugins/storage-indexes.ts +50 -11
- package/src/plugins/storage-query.ts +111 -32
- package/src/plugins/storage-update.ts +96 -0
- package/src/plugins/types.ts +1014 -152
- package/src/preview/urls.ts +23 -3
- package/src/query.ts +1188 -85
- package/src/redirects/cache.ts +113 -23
- package/src/redirects/destination.ts +20 -0
- package/src/redirects/loops.ts +10 -6
- package/src/redirects/patterns.ts +12 -30
- package/src/redirects/status.ts +27 -0
- package/src/references/field-map.ts +115 -0
- package/src/references/resolve.ts +160 -0
- package/src/references/staged.ts +157 -0
- package/src/references/types.ts +16 -0
- package/src/registry/artifact-checksum.ts +15 -0
- package/src/registry/artifact-fetch.ts +317 -0
- package/src/registry/artifact-verification.ts +85 -0
- package/src/registry/authoritative-records.ts +206 -0
- package/src/registry/config.ts +461 -0
- package/src/registry/plugin-id.ts +116 -0
- package/src/registry/publisher-handle.ts +273 -0
- package/src/registry/record-labels.ts +28 -0
- package/src/registry/testing.ts +145 -0
- package/src/registry/types.ts +126 -0
- package/src/request-cache.ts +31 -4
- package/src/request-context.ts +62 -3
- package/src/scheduled-publish.ts +225 -0
- package/src/scheduler-health.ts +46 -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 +671 -0
- package/src/schema/collection-slugs-cache.ts +157 -0
- package/src/schema/env-types.ts +37 -0
- package/src/schema/index.ts +29 -0
- package/src/schema/project-env-types.ts +41 -0
- package/src/schema/query.ts +11 -4
- package/src/schema/registry.ts +1837 -264
- package/src/schema/types.ts +326 -5
- package/src/schema/url-pattern.ts +43 -0
- package/src/schema/zod-generator.ts +357 -34
- package/src/search/fts-manager.ts +256 -39
- package/src/search/index.ts +2 -0
- package/src/search/match.ts +50 -0
- package/src/search/query.ts +155 -18
- package/src/search/types.ts +18 -0
- package/src/security/ssrf.ts +549 -0
- package/src/seed/apply.ts +1547 -274
- package/src/seed/ownership.ts +15 -0
- package/src/seed/types.ts +145 -11
- package/src/seed/validate.ts +415 -26
- package/src/seo/hreflang.ts +196 -0
- package/src/seo/index.ts +28 -32
- package/src/seo/media-url.ts +58 -0
- package/src/settings/index.ts +206 -27
- package/src/settings/types.ts +42 -1
- package/src/storage/local.ts +2 -1
- package/src/storage/s3.ts +6 -4
- package/src/storage/types.ts +8 -0
- package/src/taxonomies/index.ts +686 -302
- package/src/taxonomies/term-counts.ts +175 -0
- package/src/taxonomies/types.ts +10 -0
- 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 +219 -0
- package/src/transfer/analyze/validate.ts +1550 -0
- package/src/transfer/analyze/values.ts +341 -0
- package/src/transfer/analyze/write-rules.ts +204 -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 +1168 -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 +727 -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 +952 -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 +288 -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-comments.ts +19 -0
- package/src/ui.ts +26 -3
- package/src/utils/base64.ts +7 -2
- package/src/utils/db-errors.ts +26 -0
- package/src/utils/hash.ts +14 -3
- package/src/utils/init-lock.ts +143 -0
- package/src/utils/single-flight-cache.ts +194 -0
- package/src/utils/slugify.ts +1 -29
- package/src/utils/url.ts +58 -3
- package/src/virtual-modules.d.ts +84 -0
- package/src/visual-editing/action-token.ts +31 -0
- package/src/visual-editing/editable.ts +41 -35
- package/src/visual-editing/toolbar-bootstrap.ts +145 -0
- package/src/visual-editing/toolbar.ts +273 -48
- package/src/widgets/archives.ts +68 -0
- package/src/widgets/index.ts +83 -54
- package/dist/adapters-BKSf3T9R.d.mts +0 -121
- package/dist/adapters-BKSf3T9R.d.mts.map +0 -1
- package/dist/apply-x0eMK1lX.mjs +0 -1528
- package/dist/apply-x0eMK1lX.mjs.map +0 -1
- package/dist/base64-MBPo9ozB.mjs +0 -59
- package/dist/base64-MBPo9ozB.mjs.map +0 -1
- package/dist/byline-Chbr2GoP.mjs +0 -220
- package/dist/byline-Chbr2GoP.mjs.map +0 -1
- package/dist/bylines-CRNsVG88.mjs +0 -157
- package/dist/bylines-CRNsVG88.mjs.map +0 -1
- package/dist/cache-BkKBuIvS.mjs +0 -56
- package/dist/cache-BkKBuIvS.mjs.map +0 -1
- package/dist/chunk-ClPoSABd.mjs +0 -21
- package/dist/chunks-HGz06Soa.mjs +0 -19
- package/dist/chunks-HGz06Soa.mjs.map +0 -1
- package/dist/config-BXwuX8Bx.mjs +0 -47
- package/dist/config-BXwuX8Bx.mjs.map +0 -1
- package/dist/connection-2igzM-AT.mjs +0 -57
- package/dist/connection-2igzM-AT.mjs.map +0 -1
- package/dist/content-BcQPYxdV.mjs +0 -878
- package/dist/content-BcQPYxdV.mjs.map +0 -1
- package/dist/db-errors-l1Qh2RPR.mjs +0 -41
- package/dist/db-errors-l1Qh2RPR.mjs.map +0 -1
- package/dist/default-DCVqE5ib.mjs +0 -81
- package/dist/default-DCVqE5ib.mjs.map +0 -1
- package/dist/dialect-helpers-DhTzaUxP.mjs +0 -93
- package/dist/dialect-helpers-DhTzaUxP.mjs.map +0 -1
- package/dist/error-zG5T1UGA.mjs +0 -27
- package/dist/error-zG5T1UGA.mjs.map +0 -1
- package/dist/index-DIb-CzNx.d.mts +0 -4955
- package/dist/index-DIb-CzNx.d.mts.map +0 -1
- package/dist/load-CyEoextb.mjs +0 -28
- package/dist/load-CyEoextb.mjs.map +0 -1
- package/dist/loader-CndGj8kM.mjs +0 -457
- package/dist/loader-CndGj8kM.mjs.map +0 -1
- package/dist/manifest-schema-DH9xhc6t.mjs +0 -199
- package/dist/manifest-schema-DH9xhc6t.mjs.map +0 -1
- package/dist/media-D8FbNsl0.mjs +0 -197
- package/dist/media-D8FbNsl0.mjs.map +0 -1
- package/dist/mode-BnAOqItE.mjs +0 -23
- package/dist/mode-BnAOqItE.mjs.map +0 -1
- package/dist/patterns-CrCYkMBb.mjs +0 -93
- package/dist/patterns-CrCYkMBb.mjs.map +0 -1
- package/dist/placeholder-C-fk5hYI.mjs +0 -268
- package/dist/placeholder-C-fk5hYI.mjs.map +0 -1
- package/dist/placeholder-D29tWZ7o.d.mts +0 -284
- package/dist/placeholder-D29tWZ7o.d.mts.map +0 -1
- package/dist/query-fqEdLFms.mjs +0 -558
- package/dist/query-fqEdLFms.mjs.map +0 -1
- package/dist/redirect-D_pshWdf.mjs +0 -302
- package/dist/redirect-D_pshWdf.mjs.map +0 -1
- package/dist/registry-C3Mr0ODu.mjs +0 -902
- package/dist/registry-C3Mr0ODu.mjs.map +0 -1
- package/dist/request-cache-Ci7f5pBb.mjs +0 -79
- package/dist/request-cache-Ci7f5pBb.mjs.map +0 -1
- package/dist/runner-OURCaApa.d.mts +0 -34
- package/dist/runner-OURCaApa.d.mts.map +0 -1
- package/dist/runner-tQ7BJ4T7.mjs +0 -1619
- package/dist/runner-tQ7BJ4T7.mjs.map +0 -1
- package/dist/search-BoZYFuUk.mjs +0 -9637
- package/dist/search-BoZYFuUk.mjs.map +0 -1
- package/dist/taxonomies-B4IAshV8.mjs +0 -308
- package/dist/taxonomies-B4IAshV8.mjs.map +0 -1
- package/dist/tokens-D9vnZqYS.mjs +0 -171
- package/dist/tokens-D9vnZqYS.mjs.map +0 -1
- package/dist/transaction-Cn2rjY78.mjs +0 -28
- package/dist/transaction-Cn2rjY78.mjs.map +0 -1
- package/dist/transport-C9ugt2Nr.mjs +0 -418
- package/dist/transport-C9ugt2Nr.mjs.map +0 -1
- package/dist/transport-CUnEL3Vs.d.mts +0 -42
- package/dist/transport-CUnEL3Vs.d.mts.map +0 -1
- package/dist/types-BIgulNsW.mjs +0 -68
- package/dist/types-BIgulNsW.mjs.map +0 -1
- package/dist/types-Bm1dn-q3.mjs +0 -83
- package/dist/types-Bm1dn-q3.mjs.map +0 -1
- package/dist/types-BmPPSUEx.d.mts +0 -243
- package/dist/types-BmPPSUEx.d.mts.map +0 -1
- package/dist/types-BrA0xf5I.d.mts +0 -126
- package/dist/types-BrA0xf5I.d.mts.map +0 -1
- package/dist/types-CS8FIX7L.d.mts +0 -435
- package/dist/types-CS8FIX7L.d.mts.map +0 -1
- package/dist/types-CgqmmMJB.mjs +0 -16
- package/dist/types-CgqmmMJB.mjs.map +0 -1
- package/dist/types-DIMwPFub.d.mts +0 -192
- package/dist/types-DIMwPFub.d.mts.map +0 -1
- package/dist/types-i36XcA_X.d.mts +0 -1252
- package/dist/types-i36XcA_X.d.mts.map +0 -1
- package/dist/validate-CxVsLehf.mjs +0 -328
- package/dist/validate-CxVsLehf.mjs.map +0 -1
- package/dist/validate-DHxmpFJt.d.mts +0 -331
- package/dist/validate-DHxmpFJt.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs +0 -97
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/validation-C-ZpN2GI.mjs +0 -144
- package/dist/validation-C-ZpN2GI.mjs.map +0 -1
- package/dist/version-DJrV1K0M.mjs +0 -7
- package/dist/version-DJrV1K0M.mjs.map +0 -1
- package/dist/zod-generator-CpwccCIv.mjs +0 -132
- package/dist/zod-generator-CpwccCIv.mjs.map +0 -1
- package/src/cli/commands/auth.ts +0 -46
- package/src/cli/commands/bundle-utils.ts +0 -273
- package/src/cli/commands/bundle.ts +0 -626
- package/src/cli/commands/dev.ts +0 -191
- package/src/cli/commands/plugin-init.ts +0 -291
- package/src/cli/commands/plugin-validate.ts +0 -31
- package/src/cli/commands/plugin.ts +0 -33
- package/src/cli/commands/publish.ts +0 -697
- package/src/plugins/scheduler/piggyback.ts +0 -71
|
@@ -5,28 +5,81 @@
|
|
|
5
5
|
import type { Kysely } from "kysely";
|
|
6
6
|
import { sql } from "kysely";
|
|
7
7
|
|
|
8
|
+
import type { ContentFieldFilters } from "../../content-list-query.js";
|
|
9
|
+
import { isSqlite } from "../../database/dialect-helpers.js";
|
|
8
10
|
import { BylineRepository } from "../../database/repositories/byline.js";
|
|
9
11
|
import type { ContentBylineInput } from "../../database/repositories/byline.js";
|
|
10
12
|
import { CommentRepository } from "../../database/repositories/comment.js";
|
|
11
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
ContentRepository,
|
|
15
|
+
isSystemOrderField,
|
|
16
|
+
type ContentRevisionPrecondition,
|
|
17
|
+
} from "../../database/repositories/content.js";
|
|
18
|
+
import { EntryLockRepository } from "../../database/repositories/entry-locks.js";
|
|
19
|
+
import { OptionsRepository } from "../../database/repositories/options.js";
|
|
12
20
|
import { RedirectRepository } from "../../database/repositories/redirect.js";
|
|
21
|
+
import { RelationRepository } from "../../database/repositories/relation.js";
|
|
13
22
|
import { RevisionRepository } from "../../database/repositories/revision.js";
|
|
14
23
|
import { SeoRepository } from "../../database/repositories/seo.js";
|
|
24
|
+
import { TaxonomyRepository } from "../../database/repositories/taxonomy.js";
|
|
15
25
|
import {
|
|
26
|
+
ContentCollectionNotFoundError,
|
|
27
|
+
ContentMutationConflictError,
|
|
16
28
|
EmDashValidationError,
|
|
29
|
+
ScheduledNotDueError,
|
|
17
30
|
InvalidCursorError,
|
|
31
|
+
type BylineSummary,
|
|
32
|
+
type ContentBylineCredit,
|
|
33
|
+
type ContentBylineFilter,
|
|
34
|
+
type ContentDateField,
|
|
18
35
|
type ContentItem,
|
|
19
36
|
type ContentSeo,
|
|
20
37
|
type ContentSeoInput,
|
|
38
|
+
type FindManyOptions,
|
|
21
39
|
} from "../../database/repositories/types.js";
|
|
40
|
+
import { UserRepository } from "../../database/repositories/user.js";
|
|
22
41
|
import { withTransaction } from "../../database/transaction.js";
|
|
23
42
|
import type { Database } from "../../database/types.js";
|
|
24
43
|
import { validateIdentifier } from "../../database/validate.js";
|
|
25
|
-
import { isI18nEnabled } from "../../i18n/config.js";
|
|
44
|
+
import { getI18nConfig, isI18nEnabled, resolveConfiguredLocale } from "../../i18n/config.js";
|
|
45
|
+
import {
|
|
46
|
+
scheduledPolicyRejectionKey,
|
|
47
|
+
type ScheduledPolicyRejection,
|
|
48
|
+
} from "../../plugins/content-policy.js";
|
|
26
49
|
import { invalidateRedirectCache } from "../../redirects/cache.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
50
|
+
import { requestCached } from "../../request-cache.js";
|
|
51
|
+
import { isStoragelessFieldRow } from "../../schema/types.js";
|
|
52
|
+
import { FTSManager } from "../../search/fts-manager.js";
|
|
53
|
+
import { invalidateTermCache } from "../../taxonomies/index.js";
|
|
54
|
+
import { isMissingColumnError, isMissingTableError } from "../../utils/db-errors.js";
|
|
55
|
+
import { decodeRev, encodeRev, validateRev } from "../rev.js";
|
|
29
56
|
import type { ApiResult, ContentListResponse, ContentResponse } from "../types.js";
|
|
57
|
+
import {
|
|
58
|
+
getReferenceTitleField,
|
|
59
|
+
type ReferenceSelectionWrite,
|
|
60
|
+
resolveEntries,
|
|
61
|
+
resolveEntryGroups,
|
|
62
|
+
resolveReferenceSelection,
|
|
63
|
+
resolveReferenceSelectionTargets,
|
|
64
|
+
type ResolvedReferenceTargets,
|
|
65
|
+
writeReferenceSelection,
|
|
66
|
+
} from "./relations.js";
|
|
67
|
+
import {
|
|
68
|
+
applyStagedReferences,
|
|
69
|
+
liveReferenceSelection,
|
|
70
|
+
pageStagedGroups,
|
|
71
|
+
readStagedReferenceBaselines,
|
|
72
|
+
readStagedReferences,
|
|
73
|
+
recordPublishedReferences,
|
|
74
|
+
STAGED_REFERENCES_KEY,
|
|
75
|
+
type StagedReferences,
|
|
76
|
+
validateStagedReferences,
|
|
77
|
+
} from "./staged-references.js";
|
|
78
|
+
import { validateMediaFields } from "./validate-media-fields.js";
|
|
79
|
+
import {
|
|
80
|
+
referenceFieldConstraints,
|
|
81
|
+
validateRequiredReferencesPresent,
|
|
82
|
+
} from "./validate-references.js";
|
|
30
83
|
|
|
31
84
|
/**
|
|
32
85
|
* Narrow a caught error to one carrying a structured `apiError` discriminant.
|
|
@@ -44,6 +97,119 @@ function hasApiError(error: unknown): error is Error & { apiError: { code: strin
|
|
|
44
97
|
);
|
|
45
98
|
}
|
|
46
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Abort the surrounding transaction when a relation's limit refused an edge.
|
|
102
|
+
*
|
|
103
|
+
* `farSide` names the end that filled up, which is the opposite of the end the
|
|
104
|
+
* refused group sits on: a child that cannot take another parent refuses with
|
|
105
|
+
* `"parent"`.
|
|
106
|
+
*/
|
|
107
|
+
function throwIfReferenceLimitRefused(rejected: string[], farSide: "parent" | "child"): void {
|
|
108
|
+
if (rejected.length === 0) return;
|
|
109
|
+
throw Object.assign(
|
|
110
|
+
new Error(
|
|
111
|
+
`Entry '${rejected[0]}' already has the maximum number of ${farSide} entries on this relation.`,
|
|
112
|
+
),
|
|
113
|
+
{ apiError: { code: "VALIDATION_ERROR" } },
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** The slug a draft revision stages, when it stages one. */
|
|
118
|
+
function readStagedSlug(data: Record<string, unknown> | undefined): string | null {
|
|
119
|
+
return typeof data?._slug === "string" ? data._slug : null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Make every refusal `publish()` decides before it writes, ahead of it.
|
|
124
|
+
*
|
|
125
|
+
* `publish()` decides all of them again and stays authoritative; this does not
|
|
126
|
+
* replace it. It exists for the one caller that has irreversible work to do
|
|
127
|
+
* first — promoting a draft's staged reference selection, which nothing takes
|
|
128
|
+
* back where `withTransaction` degrades to plain statements. A refusal that
|
|
129
|
+
* landed after that promotion would leave a draft's links live on an entry that
|
|
130
|
+
* never published.
|
|
131
|
+
*
|
|
132
|
+
* The optimistic fence `publish()` ends on is not checked here, because it is
|
|
133
|
+
* the write itself: a publish lost to a concurrent edit still promotes.
|
|
134
|
+
*/
|
|
135
|
+
async function assertPublishWillNotBeRefused(
|
|
136
|
+
db: Kysely<Database>,
|
|
137
|
+
collection: string,
|
|
138
|
+
id: string,
|
|
139
|
+
existing: ContentItem,
|
|
140
|
+
options: {
|
|
141
|
+
stagedSlug: string | null;
|
|
142
|
+
requireSlug: boolean;
|
|
143
|
+
requireDue?: boolean;
|
|
144
|
+
expectedScheduledAt?: string;
|
|
145
|
+
expectedRevision?: ContentRevisionPrecondition;
|
|
146
|
+
},
|
|
147
|
+
): Promise<void> {
|
|
148
|
+
const { expectedRevision } = options;
|
|
149
|
+
if (
|
|
150
|
+
expectedRevision &&
|
|
151
|
+
(existing.version !== expectedRevision.version ||
|
|
152
|
+
existing.updatedAt !== expectedRevision.updatedAt)
|
|
153
|
+
) {
|
|
154
|
+
throw new ContentMutationConflictError();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (
|
|
158
|
+
options.requireDue &&
|
|
159
|
+
options.expectedScheduledAt !== undefined &&
|
|
160
|
+
existing.scheduledAt !== options.expectedScheduledAt
|
|
161
|
+
) {
|
|
162
|
+
throw new ScheduledNotDueError();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const intendedSlug = options.stagedSlug ?? existing.slug;
|
|
166
|
+
if (options.requireSlug && !intendedSlug?.trim()) {
|
|
167
|
+
throw new EmDashValidationError("Cannot publish routable content without a slug");
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Only a publish that moves the slug can collide, so this costs a read on
|
|
171
|
+
// that path alone.
|
|
172
|
+
if (
|
|
173
|
+
options.stagedSlug !== null &&
|
|
174
|
+
options.stagedSlug !== existing.slug &&
|
|
175
|
+
existing.locale !== null
|
|
176
|
+
) {
|
|
177
|
+
const conflict = await new ContentRepository(db).findBySlugIncludingTrashed(
|
|
178
|
+
collection,
|
|
179
|
+
options.stagedSlug,
|
|
180
|
+
existing.locale,
|
|
181
|
+
);
|
|
182
|
+
if (conflict && conflict.id !== id) {
|
|
183
|
+
throw new EmDashValidationError(
|
|
184
|
+
`Cannot publish: slug '${options.stagedSlug}' is already used by another entry` +
|
|
185
|
+
` in this collection (id: ${conflict.id}). Choose a different slug.`,
|
|
186
|
+
{ code: "SLUG_CONFLICT" },
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function isTranslationLocaleConflict(error: unknown, collection: string): boolean {
|
|
193
|
+
if (!(error instanceof Error)) return false;
|
|
194
|
+
const message = error.message.toLowerCase();
|
|
195
|
+
const storedIndexName = `uidx_ec_${collection}_active_tg_locale`.slice(0, 63).toLowerCase();
|
|
196
|
+
return (
|
|
197
|
+
message.includes(storedIndexName) ||
|
|
198
|
+
(message.includes("unique constraint failed") &&
|
|
199
|
+
message.includes("translation_group") &&
|
|
200
|
+
message.includes("locale"))
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function decodeRevisionPrecondition(
|
|
205
|
+
rev: string | undefined,
|
|
206
|
+
): ContentRevisionPrecondition | undefined {
|
|
207
|
+
if (rev === undefined) return undefined;
|
|
208
|
+
const decoded = decodeRev(rev);
|
|
209
|
+
if (!decoded) throw new ContentMutationConflictError("Revision precondition did not match");
|
|
210
|
+
return decoded;
|
|
211
|
+
}
|
|
212
|
+
|
|
47
213
|
/**
|
|
48
214
|
* Extract a slug source (title or name) from content data.
|
|
49
215
|
* Returns null if no suitable string field is found.
|
|
@@ -65,14 +231,46 @@ const SEO_DEFAULTS: ContentSeo = {
|
|
|
65
231
|
|
|
66
232
|
/**
|
|
67
233
|
* Check if a collection has SEO enabled.
|
|
234
|
+
*
|
|
235
|
+
* Cached per request so bulk imports do not re-query `_emdash_collections`
|
|
236
|
+
* for every item they create.
|
|
68
237
|
*/
|
|
69
238
|
async function collectionHasSeo(db: Kysely<Database>, collection: string): Promise<boolean> {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
239
|
+
return requestCached(`collectionHasSeo:${collection}`, async () => {
|
|
240
|
+
const row = await db
|
|
241
|
+
.selectFrom("_emdash_collections")
|
|
242
|
+
.select("has_seo")
|
|
243
|
+
.where("slug", "=", collection)
|
|
244
|
+
.executeTakeFirst();
|
|
245
|
+
return row?.has_seo === 1;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Collection publication metadata, cached per request for bulk imports.
|
|
251
|
+
*/
|
|
252
|
+
async function getCollectionPublishConfig(
|
|
253
|
+
db: Kysely<Database>,
|
|
254
|
+
collection: string,
|
|
255
|
+
): Promise<{ supportsRevisions: boolean; routable: boolean }> {
|
|
256
|
+
return requestCached(`collectionPublishConfig:${collection}`, async () => {
|
|
257
|
+
const row = await db
|
|
258
|
+
.selectFrom("_emdash_collections")
|
|
259
|
+
.select(["supports", "routable"])
|
|
260
|
+
.where("slug", "=", collection)
|
|
261
|
+
.executeTakeFirst();
|
|
262
|
+
const supports: unknown = row?.supports ? JSON.parse(row.supports) : [];
|
|
263
|
+
return {
|
|
264
|
+
supportsRevisions: Array.isArray(supports) && supports.includes("revisions"),
|
|
265
|
+
routable: row?.routable !== 0,
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function requireRoutablePublishSlug(routable: boolean, slug: string | null | undefined): void {
|
|
271
|
+
if (routable && !slug?.trim()) {
|
|
272
|
+
throw new EmDashValidationError("Cannot publish routable content without a slug");
|
|
273
|
+
}
|
|
76
274
|
}
|
|
77
275
|
|
|
78
276
|
/**
|
|
@@ -115,7 +313,11 @@ async function hydrateBylines(
|
|
|
115
313
|
item: ContentItem,
|
|
116
314
|
): Promise<void> {
|
|
117
315
|
const bylineRepo = new BylineRepository(db);
|
|
118
|
-
|
|
316
|
+
// Strict per-locale (migration 040): a credit at locale X renders iff a
|
|
317
|
+
// byline row exists at locale X in the credited translation_group. The
|
|
318
|
+
// junction itself spans translations; rendering does not fall back.
|
|
319
|
+
const localeOpt = item.locale ? { locale: item.locale } : undefined;
|
|
320
|
+
const bylines = await bylineRepo.getContentBylines(collection, item.id, localeOpt);
|
|
119
321
|
|
|
120
322
|
if (bylines.length > 0) {
|
|
121
323
|
item.bylines = bylines.map((c) => ({ ...c, source: "explicit" as const }));
|
|
@@ -123,13 +325,21 @@ async function hydrateBylines(
|
|
|
123
325
|
return;
|
|
124
326
|
}
|
|
125
327
|
|
|
126
|
-
//
|
|
328
|
+
// `primaryBylineId` is set iff junction rows exist; non-null
|
|
329
|
+
// suppresses author fallback even when the credit doesn't resolve
|
|
330
|
+
// at this locale.
|
|
127
331
|
if (item.primaryBylineId) {
|
|
128
|
-
item.
|
|
332
|
+
item.bylines = [];
|
|
333
|
+
item.byline = null;
|
|
334
|
+
return;
|
|
129
335
|
}
|
|
130
336
|
|
|
131
337
|
if (item.authorId) {
|
|
132
|
-
|
|
338
|
+
// Same strict-locale rule as explicit credits: a user-linked byline
|
|
339
|
+
// renders on the entry only when a sibling exists at the entry's
|
|
340
|
+
// locale. Without this we'd silently surface the default-locale
|
|
341
|
+
// row, which contradicts the per-locale model.
|
|
342
|
+
const fallback = await bylineRepo.findByUserId(item.authorId, localeOpt);
|
|
133
343
|
if (fallback) {
|
|
134
344
|
item.bylines = [{ byline: fallback, sortOrder: 0, roleLabel: null, source: "inferred" }];
|
|
135
345
|
item.byline = fallback;
|
|
@@ -141,8 +351,139 @@ async function hydrateBylines(
|
|
|
141
351
|
item.byline = null;
|
|
142
352
|
}
|
|
143
353
|
|
|
354
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
355
|
+
return typeof value === "object" && value !== null;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Hydrate the first page of each reference field's selection onto a single
|
|
360
|
+
* content item, keyed by field slug — the same key the create and update bodies
|
|
361
|
+
* take a selection under.
|
|
362
|
+
*
|
|
363
|
+
* Callers must have already decided `includeDrafts` — draft visibility is
|
|
364
|
+
* enforced by the caller, not this helper — because a resolved entry can carry
|
|
365
|
+
* a draft or scheduled entry's id and slug. The admin's REST GET route is the
|
|
366
|
+
* only caller, and it asks for every entry it serves, so a collection with no
|
|
367
|
+
* reference field still pays the two lookups below.
|
|
368
|
+
*
|
|
369
|
+
* For a caller that opted into drafts, a field whose selection is staged in the
|
|
370
|
+
* entry's draft revision is answered from that revision; every other field, and
|
|
371
|
+
* every field for a caller that did not opt in, is answered from the links,
|
|
372
|
+
* which hold the published selection. That is what keeps a picker change on a
|
|
373
|
+
* published entry invisible until it is published.
|
|
374
|
+
*
|
|
375
|
+
* Either selection arrives one page at a time, with the cursor to walk the rest
|
|
376
|
+
* through the edge routes — a draft's pending selection can be as long as a
|
|
377
|
+
* published one, and a caller that reads an entry should not have to take a
|
|
378
|
+
* field of a thousand entries to find out.
|
|
379
|
+
*/
|
|
380
|
+
async function hydrateReferences(
|
|
381
|
+
db: Kysely<Database>,
|
|
382
|
+
collection: string,
|
|
383
|
+
item: ContentItem,
|
|
384
|
+
includeDrafts: boolean,
|
|
385
|
+
): Promise<void> {
|
|
386
|
+
if (!item.translationGroup) return;
|
|
387
|
+
|
|
388
|
+
const collectionRow = await db
|
|
389
|
+
.selectFrom("_emdash_collections")
|
|
390
|
+
.select("id")
|
|
391
|
+
.where("slug", "=", collection)
|
|
392
|
+
.executeTakeFirst();
|
|
393
|
+
if (!collectionRow) return;
|
|
394
|
+
|
|
395
|
+
const fields = await db
|
|
396
|
+
.selectFrom("_emdash_fields")
|
|
397
|
+
.select(["slug", "validation"])
|
|
398
|
+
.where("collection_id", "=", collectionRow.id)
|
|
399
|
+
.where("type", "=", "reference")
|
|
400
|
+
.execute();
|
|
401
|
+
|
|
402
|
+
const references: NonNullable<ContentItem["references"]> = {};
|
|
403
|
+
if (fields.length === 0) {
|
|
404
|
+
item.references = references;
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const repo = new RelationRepository(db);
|
|
409
|
+
const content = new ContentRepository(db);
|
|
410
|
+
|
|
411
|
+
const staged =
|
|
412
|
+
includeDrafts && item.draftRevisionId
|
|
413
|
+
? readStagedReferences(
|
|
414
|
+
(await new RevisionRepository(db).findById(item.draftRevisionId))?.data,
|
|
415
|
+
)
|
|
416
|
+
: undefined;
|
|
417
|
+
|
|
418
|
+
for (const field of fields) {
|
|
419
|
+
let validation: Record<string, unknown> = {};
|
|
420
|
+
if (field.validation) {
|
|
421
|
+
let parsed: unknown;
|
|
422
|
+
try {
|
|
423
|
+
parsed = JSON.parse(field.validation);
|
|
424
|
+
} catch {
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
if (isRecord(parsed)) validation = parsed;
|
|
428
|
+
}
|
|
429
|
+
const relation = typeof validation.relation === "string" ? validation.relation : undefined;
|
|
430
|
+
const targetCollection =
|
|
431
|
+
typeof validation.targetCollection === "string" ? validation.targetCollection : undefined;
|
|
432
|
+
// A field with no relation keeps its own column; its value is already in
|
|
433
|
+
// `data` and there are no links to resolve.
|
|
434
|
+
if (!relation || !targetCollection) continue;
|
|
435
|
+
|
|
436
|
+
const stagedGroups = staged?.[field.slug];
|
|
437
|
+
if (stagedGroups) {
|
|
438
|
+
// Paged like the links below it: the REST contract promises one page and
|
|
439
|
+
// a cursor whichever selection answers, and the editor walks the rest
|
|
440
|
+
// through the same edge route either way.
|
|
441
|
+
const page = pageStagedGroups(stagedGroups);
|
|
442
|
+
references[field.slug] = {
|
|
443
|
+
children: await resolveEntryGroups(
|
|
444
|
+
content,
|
|
445
|
+
targetCollection,
|
|
446
|
+
page.groups,
|
|
447
|
+
item.locale,
|
|
448
|
+
includeDrafts,
|
|
449
|
+
await getReferenceTitleField(db, targetCollection),
|
|
450
|
+
),
|
|
451
|
+
...(page.nextCursor ? { nextCursor: page.nextCursor } : {}),
|
|
452
|
+
};
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// A field on the child end of its relation selects parents, which carry no
|
|
457
|
+
// order of their own — `sort_order` positions children within one parent.
|
|
458
|
+
const onChildSide = validation.relationSide === "child";
|
|
459
|
+
const edges = onChildSide
|
|
460
|
+
? await repo.getParentsPage(relation, item.translationGroup)
|
|
461
|
+
: await repo.getChildrenPage(relation, item.translationGroup);
|
|
462
|
+
const children = await resolveEntries(
|
|
463
|
+
content,
|
|
464
|
+
targetCollection,
|
|
465
|
+
edges.items,
|
|
466
|
+
(e) => (onChildSide ? e.parentGroup : e.childGroup),
|
|
467
|
+
item.locale,
|
|
468
|
+
includeDrafts,
|
|
469
|
+
await getReferenceTitleField(db, targetCollection),
|
|
470
|
+
);
|
|
471
|
+
references[field.slug] = {
|
|
472
|
+
children,
|
|
473
|
+
...(edges.nextCursor ? { nextCursor: edges.nextCursor } : {}),
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
item.references = references;
|
|
478
|
+
}
|
|
479
|
+
|
|
144
480
|
/**
|
|
145
481
|
* Batch-hydrate bylines for multiple items using two bulk queries instead of N+1.
|
|
482
|
+
*
|
|
483
|
+
* Items may live at different locales (e.g. a list endpoint returning the
|
|
484
|
+
* translations of an entry). Group by `item.locale` and call the strict
|
|
485
|
+
* per-locale repo method once per group so each item resolves against its
|
|
486
|
+
* own locale's byline rows.
|
|
146
487
|
*/
|
|
147
488
|
async function hydrateBylinesMany(
|
|
148
489
|
db: Kysely<Database>,
|
|
@@ -153,43 +494,76 @@ async function hydrateBylinesMany(
|
|
|
153
494
|
|
|
154
495
|
const bylineRepo = new BylineRepository(db);
|
|
155
496
|
|
|
156
|
-
// 1.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
// 2. Collect authorIds that need fallback lookup
|
|
161
|
-
const fallbackAuthorIds: string[] = [];
|
|
497
|
+
// 1. Bucket items by locale so we can call the strict-locale repo
|
|
498
|
+
// once per bucket. Items with a null/undefined locale (pre-i18n
|
|
499
|
+
// rows on a single-locale install) share an "unscoped" bucket.
|
|
500
|
+
const localeBuckets = new Map<string | null, ContentItem[]>();
|
|
162
501
|
for (const item of items) {
|
|
163
|
-
|
|
164
|
-
|
|
502
|
+
const key = item.locale ?? null;
|
|
503
|
+
const bucket = localeBuckets.get(key);
|
|
504
|
+
if (bucket) bucket.push(item);
|
|
505
|
+
else localeBuckets.set(key, [item]);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// 2. Per-locale: fetch explicit credits. Items whose credits don't
|
|
509
|
+
// resolve at this locale go through a locale-agnostic "has any
|
|
510
|
+
// junction" check before being considered for author inference —
|
|
511
|
+
// explicit editorial intent at any locale beats inferred fallback.
|
|
512
|
+
const bylinesByItem = new Map<string, ContentBylineCredit[]>();
|
|
513
|
+
const itemsNeedingAuthorCheck: ContentItem[] = [];
|
|
514
|
+
for (const [locale, bucket] of localeBuckets) {
|
|
515
|
+
const localeOpt = locale ? { locale } : undefined;
|
|
516
|
+
const ids = bucket.map((i) => i.id);
|
|
517
|
+
const credits = await bylineRepo.getContentBylinesMany(collection, ids, localeOpt);
|
|
518
|
+
for (const [id, list] of credits) bylinesByItem.set(id, list);
|
|
519
|
+
|
|
520
|
+
for (const item of bucket) {
|
|
521
|
+
if (credits.has(item.id) && credits.get(item.id)!.length > 0) continue;
|
|
522
|
+
if (item.authorId) itemsNeedingAuthorCheck.push(item);
|
|
165
523
|
}
|
|
166
524
|
}
|
|
167
525
|
|
|
168
|
-
// 3.
|
|
169
|
-
|
|
170
|
-
const
|
|
526
|
+
// 3. Author fallback applies only when no explicit credit exists
|
|
527
|
+
// (primaryBylineId null).
|
|
528
|
+
const fallbackByItem = new Map<string, BylineSummary>();
|
|
529
|
+
if (itemsNeedingAuthorCheck.length > 0) {
|
|
530
|
+
const authorBuckets = new Map<string | null, ContentItem[]>();
|
|
531
|
+
for (const item of itemsNeedingAuthorCheck) {
|
|
532
|
+
if (item.primaryBylineId) continue;
|
|
533
|
+
const key = item.locale ?? null;
|
|
534
|
+
const bucket = authorBuckets.get(key);
|
|
535
|
+
if (bucket) bucket.push(item);
|
|
536
|
+
else authorBuckets.set(key, [item]);
|
|
537
|
+
}
|
|
171
538
|
|
|
172
|
-
|
|
539
|
+
for (const [locale, bucket] of authorBuckets) {
|
|
540
|
+
const localeOpt = locale ? { locale } : undefined;
|
|
541
|
+
const authorIds = bucket.map((i) => i.authorId).filter((id): id is string => id !== null);
|
|
542
|
+
const uniqueAuthorIds = [...new Set(authorIds)];
|
|
543
|
+
if (uniqueAuthorIds.length === 0) continue;
|
|
544
|
+
const authorMap = await bylineRepo.findByUserIds(uniqueAuthorIds, localeOpt);
|
|
545
|
+
for (const item of bucket) {
|
|
546
|
+
if (!item.authorId) continue;
|
|
547
|
+
const f = authorMap.get(item.authorId);
|
|
548
|
+
if (f) fallbackByItem.set(item.id, f);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// 4. Assign to each item.
|
|
173
554
|
for (const item of items) {
|
|
174
|
-
const explicit =
|
|
555
|
+
const explicit = bylinesByItem.get(item.id);
|
|
175
556
|
if (explicit && explicit.length > 0) {
|
|
176
557
|
item.bylines = explicit.map((c) => ({ ...c, source: "explicit" as const }));
|
|
177
558
|
item.byline = explicit[0]?.byline ?? null;
|
|
178
559
|
continue;
|
|
179
560
|
}
|
|
180
561
|
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
item.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (item.authorId) {
|
|
187
|
-
const fallback = authorBylineMap.get(item.authorId);
|
|
188
|
-
if (fallback) {
|
|
189
|
-
item.bylines = [{ byline: fallback, sortOrder: 0, roleLabel: null, source: "inferred" }];
|
|
190
|
-
item.byline = fallback;
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
562
|
+
const fallback = fallbackByItem.get(item.id);
|
|
563
|
+
if (fallback) {
|
|
564
|
+
item.bylines = [{ byline: fallback, sortOrder: 0, roleLabel: null, source: "inferred" }];
|
|
565
|
+
item.byline = fallback;
|
|
566
|
+
continue;
|
|
193
567
|
}
|
|
194
568
|
|
|
195
569
|
item.bylines = [];
|
|
@@ -208,7 +582,11 @@ async function resolveId(
|
|
|
208
582
|
identifier: string,
|
|
209
583
|
locale?: string,
|
|
210
584
|
): Promise<string | null> {
|
|
211
|
-
const item = await repo.findByIdOrSlug(
|
|
585
|
+
const item = await repo.findByIdOrSlug(
|
|
586
|
+
collection,
|
|
587
|
+
identifier,
|
|
588
|
+
locale ? resolveConfiguredLocale(locale) : undefined,
|
|
589
|
+
);
|
|
212
590
|
return item?.id ?? null;
|
|
213
591
|
}
|
|
214
592
|
|
|
@@ -222,7 +600,11 @@ async function resolveIdIncludingTrashed(
|
|
|
222
600
|
identifier: string,
|
|
223
601
|
locale?: string,
|
|
224
602
|
): Promise<string | null> {
|
|
225
|
-
const item = await repo.findByIdOrSlugIncludingTrashed(
|
|
603
|
+
const item = await repo.findByIdOrSlugIncludingTrashed(
|
|
604
|
+
collection,
|
|
605
|
+
identifier,
|
|
606
|
+
locale ? resolveConfiguredLocale(locale) : undefined,
|
|
607
|
+
);
|
|
226
608
|
return item?.id ?? null;
|
|
227
609
|
}
|
|
228
610
|
|
|
@@ -234,6 +616,8 @@ export interface TrashedContentItem {
|
|
|
234
616
|
type: string;
|
|
235
617
|
slug: string | null;
|
|
236
618
|
status: string;
|
|
619
|
+
locale: string | null;
|
|
620
|
+
translationGroup: string | null;
|
|
237
621
|
data: Record<string, unknown>;
|
|
238
622
|
authorId: string | null;
|
|
239
623
|
createdAt: string;
|
|
@@ -242,6 +626,245 @@ export interface TrashedContentItem {
|
|
|
242
626
|
deletedAt: string;
|
|
243
627
|
}
|
|
244
628
|
|
|
629
|
+
/**
|
|
630
|
+
* Resolve the columns a content-list search should match against. Always
|
|
631
|
+
* includes `slug` (a standard column), adds the configured `titleField` plus
|
|
632
|
+
* the `title`/`name` display fields when the collection actually defines them,
|
|
633
|
+
* mirroring the admin's item-title resolution (titleField -> title -> name ->
|
|
634
|
+
* slug), and includes every field explicitly marked searchable. Returning only
|
|
635
|
+
* schema-backed columns avoids "no such column" errors.
|
|
636
|
+
*/
|
|
637
|
+
async function resolveSearchColumns(db: Kysely<Database>, collection: string): Promise<string[]> {
|
|
638
|
+
const row = await db
|
|
639
|
+
.selectFrom("_emdash_collections")
|
|
640
|
+
.select(["id", "title_field"])
|
|
641
|
+
.where("slug", "=", collection)
|
|
642
|
+
.executeTakeFirst();
|
|
643
|
+
if (!row) return ["slug"];
|
|
644
|
+
|
|
645
|
+
const fields = await db
|
|
646
|
+
.selectFrom("_emdash_fields")
|
|
647
|
+
.select(["slug", "searchable"])
|
|
648
|
+
.where("collection_id", "=", row.id)
|
|
649
|
+
.orderBy("sort_order", "asc")
|
|
650
|
+
.execute();
|
|
651
|
+
const columns = new Set(["slug"]);
|
|
652
|
+
const fieldSlugs = new Set(fields.map((f) => f.slug));
|
|
653
|
+
|
|
654
|
+
// A configured titleField takes precedence, then the conventional
|
|
655
|
+
// title/name fields. A null title_field falls through to those defaults.
|
|
656
|
+
if (row.title_field && fieldSlugs.has(row.title_field)) columns.add(row.title_field);
|
|
657
|
+
for (const candidate of ["title", "name"]) {
|
|
658
|
+
if (fieldSlugs.has(candidate)) columns.add(candidate);
|
|
659
|
+
}
|
|
660
|
+
for (const field of fields) {
|
|
661
|
+
if (field.searchable === 1) columns.add(field.slug);
|
|
662
|
+
}
|
|
663
|
+
return [...columns];
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* The keys of `data` that name a storage-less field — a reference field bound
|
|
668
|
+
* to a relation, whose selection lives in the edge table and reaches the API
|
|
669
|
+
* under the separate `references` key.
|
|
670
|
+
*
|
|
671
|
+
* A reference field with no relation still owns its column, so its value in
|
|
672
|
+
* `data` is exactly where it belongs and is not returned here.
|
|
673
|
+
*/
|
|
674
|
+
async function storagelessDataKeys(
|
|
675
|
+
db: Kysely<Database>,
|
|
676
|
+
collection: string,
|
|
677
|
+
data: Record<string, unknown>,
|
|
678
|
+
): Promise<string[]> {
|
|
679
|
+
const collectionRow = await db
|
|
680
|
+
.selectFrom("_emdash_collections")
|
|
681
|
+
.select("id")
|
|
682
|
+
.where("slug", "=", collection)
|
|
683
|
+
.executeTakeFirst();
|
|
684
|
+
if (!collectionRow) return [];
|
|
685
|
+
const fields = await db
|
|
686
|
+
.selectFrom("_emdash_fields")
|
|
687
|
+
.select(["slug", "type", "validation"])
|
|
688
|
+
.where("collection_id", "=", collectionRow.id)
|
|
689
|
+
.execute();
|
|
690
|
+
const storageless = new Set(fields.filter(isStoragelessFieldRow).map((f) => f.slug));
|
|
691
|
+
if (storageless.size === 0) return [];
|
|
692
|
+
return Object.keys(data).filter((key) => storageless.has(key));
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Refuse a `data` payload that tries to set a storage-less field.
|
|
697
|
+
*
|
|
698
|
+
* Such a key would otherwise reach the column writer and throw "no such
|
|
699
|
+
* column". Dropping it instead is worse than refusing it: a client that can
|
|
700
|
+
* only write `data` would be told its write succeeded while nothing was linked.
|
|
701
|
+
* On a collection that keeps drafts the key never reaches the column writer at
|
|
702
|
+
* all — it is merged into the draft revision's JSON — so the runtime applies
|
|
703
|
+
* this before staging rather than leaving it to the write below.
|
|
704
|
+
*/
|
|
705
|
+
export function storagelessDataKeyError(keys: string[]): {
|
|
706
|
+
success: false;
|
|
707
|
+
error: { code: string; message: string };
|
|
708
|
+
} {
|
|
709
|
+
return {
|
|
710
|
+
success: false,
|
|
711
|
+
error: {
|
|
712
|
+
code: "VALIDATION_ERROR",
|
|
713
|
+
message: `Reference fields bound to a relation are set through 'references', not 'data': ${keys.join(", ")}`,
|
|
714
|
+
},
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* The storage-less keys in `data` that an update is actually trying to change.
|
|
720
|
+
*
|
|
721
|
+
* A field bound to a relation after its column existed keeps that column, and
|
|
722
|
+
* every read hands the value frozen in it back under the field's own slug. A
|
|
723
|
+
* read-then-write client — the admin editor among them — therefore echoes a key
|
|
724
|
+
* it never touched, and refusing that would make such an entry unsaveable. An
|
|
725
|
+
* echo asks for nothing; a different value is an attempt to set a selection
|
|
726
|
+
* through the one channel that cannot carry it.
|
|
727
|
+
*
|
|
728
|
+
* A key the entry does not store counts as changed, which is every key of a
|
|
729
|
+
* field that never had a column: there is nothing for such a payload to be
|
|
730
|
+
* echoing, and letting it through would reach the column writer.
|
|
731
|
+
*/
|
|
732
|
+
export function changedStoragelessDataKeys(
|
|
733
|
+
storageless: ReadonlySet<string>,
|
|
734
|
+
data: Record<string, unknown>,
|
|
735
|
+
stored: Record<string, unknown>,
|
|
736
|
+
): string[] {
|
|
737
|
+
return Object.keys(data).filter(
|
|
738
|
+
(key) =>
|
|
739
|
+
storageless.has(key) &&
|
|
740
|
+
(!Object.hasOwn(stored, key) || JSON.stringify(data[key]) !== JSON.stringify(stored[key])),
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Decide whether the content-list `q` filter can be served from the
|
|
746
|
+
* collection's FTS5 index instead of a full-scan substring LIKE (#1517).
|
|
747
|
+
*
|
|
748
|
+
* Requires SQLite (FTS5 is SQLite-only), search enabled on the collection,
|
|
749
|
+
* every non-slug display column present in the searchable-field set (or the
|
|
750
|
+
* index would miss matches the LIKE finds), and the index table actually
|
|
751
|
+
* existing.
|
|
752
|
+
*/
|
|
753
|
+
async function canUseFtsForListFilter(
|
|
754
|
+
db: Kysely<Database>,
|
|
755
|
+
collection: string,
|
|
756
|
+
searchColumns: string[],
|
|
757
|
+
): Promise<boolean> {
|
|
758
|
+
if (!isSqlite(db)) return false;
|
|
759
|
+
const ftsManager = new FTSManager(db);
|
|
760
|
+
const config = await ftsManager.getSearchConfig(collection);
|
|
761
|
+
if (!config?.enabled) return false;
|
|
762
|
+
const searchable = new Set(await ftsManager.getSearchableFields(collection));
|
|
763
|
+
const covered = searchColumns.every((col) => col === "slug" || searchable.has(col));
|
|
764
|
+
if (!covered) return false;
|
|
765
|
+
return ftsManager.ftsTableExists(collection);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Create a 301 auto-redirect from an entry's old URL to its new one after a
|
|
770
|
+
* slug change, using the collection's URL pattern. Shared by
|
|
771
|
+
* handleContentUpdate (direct slug edits) and handleContentPublish (slug edits
|
|
772
|
+
* staged as `_slug` in a draft revision, which only land on publish).
|
|
773
|
+
*/
|
|
774
|
+
async function createSlugChangeRedirect(
|
|
775
|
+
db: Kysely<Database>,
|
|
776
|
+
collection: string,
|
|
777
|
+
oldSlug: string,
|
|
778
|
+
newSlug: string,
|
|
779
|
+
contentId: string,
|
|
780
|
+
oldPublishedAt: string | null,
|
|
781
|
+
newPublishedAt: string | null,
|
|
782
|
+
): Promise<void> {
|
|
783
|
+
// A URL pattern has no locale token, so every locale variant of an entry
|
|
784
|
+
// generates the same URL, and slugs are unique per (slug, locale) — a
|
|
785
|
+
// translation may still hold the old slug. Redirecting away from a URL
|
|
786
|
+
// another row still answers on would take that page down: the redirect
|
|
787
|
+
// middleware runs `order: "pre"`, so routing never gets a chance.
|
|
788
|
+
// Any surviving row counts, published or not: a draft that publishes later
|
|
789
|
+
// would otherwise be shadowed by the redirect.
|
|
790
|
+
if (await slugStillTaken(db, collection, oldSlug, contentId)) return;
|
|
791
|
+
|
|
792
|
+
const collectionRow = await db
|
|
793
|
+
.selectFrom("_emdash_collections")
|
|
794
|
+
.select("url_pattern")
|
|
795
|
+
.where("slug", "=", collection)
|
|
796
|
+
.executeTakeFirst();
|
|
797
|
+
|
|
798
|
+
const redirectRepo = new RedirectRepository(db);
|
|
799
|
+
await redirectRepo.createAutoRedirect(
|
|
800
|
+
collection,
|
|
801
|
+
oldSlug,
|
|
802
|
+
newSlug,
|
|
803
|
+
contentId,
|
|
804
|
+
collectionRow?.url_pattern ?? null,
|
|
805
|
+
oldPublishedAt,
|
|
806
|
+
newPublishedAt,
|
|
807
|
+
);
|
|
808
|
+
invalidateRedirectCache();
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/** Whether a row other than `contentId` still holds `slug` in this collection. */
|
|
812
|
+
async function slugStillTaken(
|
|
813
|
+
db: Kysely<Database>,
|
|
814
|
+
collection: string,
|
|
815
|
+
slug: string,
|
|
816
|
+
contentId: string,
|
|
817
|
+
): Promise<boolean> {
|
|
818
|
+
validateIdentifier(collection, "collection slug");
|
|
819
|
+
const result = await sql<{ id: string }>`
|
|
820
|
+
SELECT id FROM ${sql.ref(`ec_${collection}`)}
|
|
821
|
+
WHERE slug = ${slug}
|
|
822
|
+
AND id != ${contentId}
|
|
823
|
+
AND deleted_at IS NULL
|
|
824
|
+
LIMIT 1
|
|
825
|
+
`.execute(db);
|
|
826
|
+
return result.rows.length > 0;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/** Matches a date-only `YYYY-MM-DD` bound (no time component). */
|
|
830
|
+
const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Normalize a date-range bound to an ISO datetime for lexicographic comparison
|
|
834
|
+
* against stored ISO 8601 timestamps. A bare `YYYY-MM-DD` is widened to the
|
|
835
|
+
* appropriate UTC day boundary so the range stays inclusive: a `start` bound
|
|
836
|
+
* becomes the start of the day and an `end` bound the end of the day.
|
|
837
|
+
* Otherwise a date-only upper bound would exclude every same-day row (since
|
|
838
|
+
* `2024-06-01T12:00:00Z` sorts after `2024-06-01`). Full datetimes pass
|
|
839
|
+
* through unchanged.
|
|
840
|
+
*/
|
|
841
|
+
function normalizeDateBound(value: string | undefined, edge: "start" | "end"): string | undefined {
|
|
842
|
+
if (!value) return undefined;
|
|
843
|
+
if (!DATE_ONLY_RE.test(value)) return new Date(value).toISOString();
|
|
844
|
+
return edge === "start" ? `${value}T00:00:00.000Z` : `${value}T23:59:59.999Z`;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Build the repository's byline filter from the wire params.
|
|
849
|
+
*
|
|
850
|
+
* `locale` is the locale the list is scoped to, which is the locale an
|
|
851
|
+
* inferred credit has to resolve at — the admin list is always scoped to the
|
|
852
|
+
* locale picked in its switcher.
|
|
853
|
+
*/
|
|
854
|
+
function resolveBylineFilter(
|
|
855
|
+
params: { bylines?: string[]; bylinesNone?: boolean; includeInferredBylines?: boolean },
|
|
856
|
+
locale: string | undefined,
|
|
857
|
+
): ContentBylineFilter | undefined {
|
|
858
|
+
const includeInferred = params.includeInferredBylines === true;
|
|
859
|
+
|
|
860
|
+
if (params.bylinesNone) return { mode: "none", includeInferred, locale };
|
|
861
|
+
|
|
862
|
+
const bylineIds = params.bylines ?? [];
|
|
863
|
+
if (bylineIds.length === 0) return undefined;
|
|
864
|
+
|
|
865
|
+
return { mode: "any", bylineIds, includeInferred, locale };
|
|
866
|
+
}
|
|
867
|
+
|
|
245
868
|
/**
|
|
246
869
|
* Create content list handler
|
|
247
870
|
*/
|
|
@@ -255,13 +878,62 @@ export async function handleContentList(
|
|
|
255
878
|
orderBy?: string;
|
|
256
879
|
order?: "asc" | "desc";
|
|
257
880
|
locale?: string;
|
|
881
|
+
q?: string;
|
|
882
|
+
authorId?: string;
|
|
883
|
+
dateField?: ContentDateField;
|
|
884
|
+
dateFrom?: string;
|
|
885
|
+
dateTo?: string;
|
|
886
|
+
bylines?: string[];
|
|
887
|
+
bylinesNone?: boolean;
|
|
888
|
+
includeInferredBylines?: boolean;
|
|
889
|
+
fieldFilters?: ContentFieldFilters;
|
|
258
890
|
},
|
|
259
891
|
): Promise<ApiResult<ContentListResponse>> {
|
|
260
892
|
try {
|
|
261
893
|
const repo = new ContentRepository(db);
|
|
262
|
-
const where:
|
|
894
|
+
const where: FindManyOptions["where"] = {};
|
|
263
895
|
if (params.status) where.status = params.status;
|
|
264
|
-
|
|
896
|
+
const locale = params.locale ? resolveConfiguredLocale(params.locale) : undefined;
|
|
897
|
+
if (locale) where.locale = locale;
|
|
898
|
+
if (params.authorId) where.authorId = params.authorId;
|
|
899
|
+
if (params.fieldFilters && Object.keys(params.fieldFilters).length > 0) {
|
|
900
|
+
where.fieldFilters = params.fieldFilters;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
const bylineFilter = resolveBylineFilter(params, locale);
|
|
904
|
+
if (bylineFilter) where.bylineFilter = bylineFilter;
|
|
905
|
+
|
|
906
|
+
// A date range requires a target column; ignore stray from/to without
|
|
907
|
+
// a field so a half-specified filter doesn't silently drop all rows.
|
|
908
|
+
if (params.dateField && (params.dateFrom || params.dateTo)) {
|
|
909
|
+
where.dateFilter = {
|
|
910
|
+
field: params.dateField,
|
|
911
|
+
from: normalizeDateBound(params.dateFrom, "start"),
|
|
912
|
+
to: normalizeDateBound(params.dateTo, "end"),
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
const q = params.q?.trim();
|
|
917
|
+
if (q) {
|
|
918
|
+
where.q = q;
|
|
919
|
+
where.searchColumns = await resolveSearchColumns(db, collection);
|
|
920
|
+
where.useFts = await canUseFtsForListFilter(db, collection, where.searchColumns);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// Sorting by a non-system field (a collection's titleField/dateField)
|
|
924
|
+
// needs the collection's *actual* sort fields resolved server-side,
|
|
925
|
+
// so the orderBy set stays closed. Only query when it's not a system field.
|
|
926
|
+
let sortableExtras: string[] | undefined;
|
|
927
|
+
if (params.orderBy && !isSystemOrderField(params.orderBy)) {
|
|
928
|
+
const coll = await db
|
|
929
|
+
.selectFrom("_emdash_collections")
|
|
930
|
+
.select(["title_field", "date_field"])
|
|
931
|
+
.where("slug", "=", collection)
|
|
932
|
+
.executeTakeFirst();
|
|
933
|
+
sortableExtras = [coll?.title_field, coll?.date_field].filter(
|
|
934
|
+
(slug): slug is string => !!slug,
|
|
935
|
+
);
|
|
936
|
+
}
|
|
265
937
|
|
|
266
938
|
const result = await repo.findMany(collection, {
|
|
267
939
|
cursor: params.cursor,
|
|
@@ -270,6 +942,7 @@ export async function handleContentList(
|
|
|
270
942
|
orderBy: params.orderBy
|
|
271
943
|
? { field: params.orderBy, direction: params.order || "desc" }
|
|
272
944
|
: undefined,
|
|
945
|
+
sortableExtras,
|
|
273
946
|
});
|
|
274
947
|
|
|
275
948
|
// Hydrate SEO data if the collection has SEO enabled
|
|
@@ -282,6 +955,7 @@ export async function handleContentList(
|
|
|
282
955
|
data: {
|
|
283
956
|
items: result.items,
|
|
284
957
|
nextCursor: result.nextCursor,
|
|
958
|
+
total: result.total,
|
|
285
959
|
},
|
|
286
960
|
};
|
|
287
961
|
} catch (error) {
|
|
@@ -291,7 +965,7 @@ export async function handleContentList(
|
|
|
291
965
|
error: { code: "INVALID_CURSOR", message: error.message },
|
|
292
966
|
};
|
|
293
967
|
}
|
|
294
|
-
if (isMissingTableError(error)) {
|
|
968
|
+
if (error instanceof ContentCollectionNotFoundError || isMissingTableError(error)) {
|
|
295
969
|
return {
|
|
296
970
|
success: false,
|
|
297
971
|
error: {
|
|
@@ -300,6 +974,15 @@ export async function handleContentList(
|
|
|
300
974
|
},
|
|
301
975
|
};
|
|
302
976
|
}
|
|
977
|
+
if (isMissingColumnError(error, "deleted_at")) {
|
|
978
|
+
return {
|
|
979
|
+
success: false,
|
|
980
|
+
error: {
|
|
981
|
+
code: "COLLECTION_SCHEMA_MISMATCH",
|
|
982
|
+
message: `Collection '${collection}' backing table is missing the 'deleted_at' column`,
|
|
983
|
+
},
|
|
984
|
+
};
|
|
985
|
+
}
|
|
303
986
|
if (error instanceof EmDashValidationError) {
|
|
304
987
|
// e.g. invalid orderBy field
|
|
305
988
|
return {
|
|
@@ -318,6 +1001,62 @@ export async function handleContentList(
|
|
|
318
1001
|
}
|
|
319
1002
|
}
|
|
320
1003
|
|
|
1004
|
+
/** A content author option for the admin author filter. */
|
|
1005
|
+
export interface ContentAuthor {
|
|
1006
|
+
id: string;
|
|
1007
|
+
name: string | null;
|
|
1008
|
+
email: string;
|
|
1009
|
+
avatarUrl: string | null;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* List the distinct authors of a collection's live content.
|
|
1014
|
+
*
|
|
1015
|
+
* Backs the admin content-list author filter. Unlike `/admin/users` (ADMIN
|
|
1016
|
+
* only), this is gated on `content:read`, so any editor can filter by author.
|
|
1017
|
+
* Returns only users who have authored at least one non-trashed entry, sorted
|
|
1018
|
+
* by display name then email for a stable dropdown order.
|
|
1019
|
+
*/
|
|
1020
|
+
export async function handleContentAuthors(
|
|
1021
|
+
db: Kysely<Database>,
|
|
1022
|
+
collection: string,
|
|
1023
|
+
): Promise<ApiResult<{ items: ContentAuthor[] }>> {
|
|
1024
|
+
try {
|
|
1025
|
+
const repo = new ContentRepository(db);
|
|
1026
|
+
const authorIds = await repo.findDistinctAuthorIds(collection);
|
|
1027
|
+
if (authorIds.length === 0) {
|
|
1028
|
+
return { success: true, data: { items: [] } };
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
const userRepo = new UserRepository(db);
|
|
1032
|
+
const users = await userRepo.findByIds(authorIds);
|
|
1033
|
+
|
|
1034
|
+
const items: ContentAuthor[] = users
|
|
1035
|
+
.map((u) => ({ id: u.id, name: u.name, email: u.email, avatarUrl: u.avatarUrl }))
|
|
1036
|
+
.toSorted((a, b) => (a.name ?? a.email).localeCompare(b.name ?? b.email));
|
|
1037
|
+
|
|
1038
|
+
return { success: true, data: { items } };
|
|
1039
|
+
} catch (error) {
|
|
1040
|
+
if (isMissingTableError(error)) {
|
|
1041
|
+
return {
|
|
1042
|
+
success: false,
|
|
1043
|
+
error: {
|
|
1044
|
+
code: "COLLECTION_NOT_FOUND",
|
|
1045
|
+
message: `Collection '${collection}' not found`,
|
|
1046
|
+
},
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
console.error("Content authors error:", error);
|
|
1050
|
+
return {
|
|
1051
|
+
success: false,
|
|
1052
|
+
error: {
|
|
1053
|
+
code: "CONTENT_AUTHORS_ERROR",
|
|
1054
|
+
message: "Failed to list content authors",
|
|
1055
|
+
},
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
321
1060
|
/**
|
|
322
1061
|
* Get single content item
|
|
323
1062
|
*/
|
|
@@ -326,10 +1065,15 @@ export async function handleContentGet(
|
|
|
326
1065
|
collection: string,
|
|
327
1066
|
id: string,
|
|
328
1067
|
locale?: string,
|
|
1068
|
+
referenceOptions?: { includeDrafts: boolean },
|
|
329
1069
|
): Promise<ApiResult<ContentResponse>> {
|
|
330
1070
|
try {
|
|
331
1071
|
const repo = new ContentRepository(db);
|
|
332
|
-
const item = await repo.findByIdOrSlug(
|
|
1072
|
+
const item = await repo.findByIdOrSlug(
|
|
1073
|
+
collection,
|
|
1074
|
+
id,
|
|
1075
|
+
locale ? resolveConfiguredLocale(locale) : undefined,
|
|
1076
|
+
);
|
|
333
1077
|
|
|
334
1078
|
if (!item) {
|
|
335
1079
|
return {
|
|
@@ -345,6 +1089,12 @@ export async function handleContentGet(
|
|
|
345
1089
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
346
1090
|
await hydrateSeo(db, collection, item, hasSeo);
|
|
347
1091
|
await hydrateBylines(db, collection, item);
|
|
1092
|
+
// Opt-in: hydration is skipped entirely unless the caller passes
|
|
1093
|
+
// `referenceOptions`, since it can leak draft child ids/slugs — see
|
|
1094
|
+
// `hydrateReferences`'s doc comment.
|
|
1095
|
+
if (referenceOptions) {
|
|
1096
|
+
await hydrateReferences(db, collection, item, referenceOptions.includeDrafts);
|
|
1097
|
+
}
|
|
348
1098
|
|
|
349
1099
|
return {
|
|
350
1100
|
success: true,
|
|
@@ -374,7 +1124,11 @@ export async function handleContentGetIncludingTrashed(
|
|
|
374
1124
|
): Promise<ApiResult<ContentResponse>> {
|
|
375
1125
|
try {
|
|
376
1126
|
const repo = new ContentRepository(db);
|
|
377
|
-
const item = await repo.findByIdOrSlugIncludingTrashed(
|
|
1127
|
+
const item = await repo.findByIdOrSlugIncludingTrashed(
|
|
1128
|
+
collection,
|
|
1129
|
+
id,
|
|
1130
|
+
locale ? resolveConfiguredLocale(locale) : undefined,
|
|
1131
|
+
);
|
|
378
1132
|
|
|
379
1133
|
if (!item) {
|
|
380
1134
|
return {
|
|
@@ -419,13 +1173,16 @@ export async function handleContentCreate(
|
|
|
419
1173
|
collection: string,
|
|
420
1174
|
body: {
|
|
421
1175
|
data: Record<string, unknown>;
|
|
422
|
-
slug?: string;
|
|
1176
|
+
slug?: string | null;
|
|
423
1177
|
status?: string;
|
|
424
1178
|
authorId?: string;
|
|
425
1179
|
bylines?: ContentBylineInput[];
|
|
426
1180
|
locale?: string;
|
|
427
1181
|
translationOf?: string;
|
|
428
1182
|
seo?: ContentSeoInput;
|
|
1183
|
+
taxonomies?: Record<string, string[]>;
|
|
1184
|
+
/** Reference fields: field slug → ordered selected entry ids. */
|
|
1185
|
+
references?: Record<string, string[]>;
|
|
429
1186
|
createdAt?: string | null;
|
|
430
1187
|
publishedAt?: string | null;
|
|
431
1188
|
},
|
|
@@ -444,19 +1201,86 @@ export async function handleContentCreate(
|
|
|
444
1201
|
};
|
|
445
1202
|
}
|
|
446
1203
|
|
|
1204
|
+
const storagelessKeys = await storagelessDataKeys(db, collection, body.data);
|
|
1205
|
+
if (storagelessKeys.length > 0) return storagelessDataKeyError(storagelessKeys);
|
|
1206
|
+
|
|
1207
|
+
const mimeCheck = await validateMediaFields(db, collection, body.data);
|
|
1208
|
+
if (!mimeCheck.success) return mimeCheck;
|
|
1209
|
+
|
|
1210
|
+
const requiredReferences = await validateRequiredReferencesPresent(
|
|
1211
|
+
db,
|
|
1212
|
+
collection,
|
|
1213
|
+
body.references,
|
|
1214
|
+
body.translationOf,
|
|
1215
|
+
);
|
|
1216
|
+
if (!requiredReferences.success) return requiredReferences;
|
|
1217
|
+
|
|
447
1218
|
// Wrap content + SEO writes in a transaction for atomicity
|
|
448
1219
|
const item = await withTransaction(db, async (trx) => {
|
|
449
1220
|
const repo = new ContentRepository(trx);
|
|
450
1221
|
const bylineRepo = new BylineRepository(trx);
|
|
1222
|
+
const inheritedFields = body.translationOf
|
|
1223
|
+
? (
|
|
1224
|
+
await trx
|
|
1225
|
+
.selectFrom("_emdash_fields as field")
|
|
1226
|
+
.innerJoin(
|
|
1227
|
+
"_emdash_collections as collection",
|
|
1228
|
+
"collection.id",
|
|
1229
|
+
"field.collection_id",
|
|
1230
|
+
)
|
|
1231
|
+
.select("field.slug")
|
|
1232
|
+
.where("collection.slug", "=", collection)
|
|
1233
|
+
.where("field.translatable", "=", 0)
|
|
1234
|
+
.execute()
|
|
1235
|
+
).map((field) => field.slug)
|
|
1236
|
+
: [];
|
|
1237
|
+
|
|
1238
|
+
// Resolve the whole selection before the entry is written. On D1 the
|
|
1239
|
+
// statements below land one at a time with nothing to roll them back, so
|
|
1240
|
+
// a field slug or a selected id that fails to resolve has to fail here,
|
|
1241
|
+
// while the only thing written is nothing.
|
|
1242
|
+
const referenceWrites: ResolvedReferenceTargets[] = [];
|
|
1243
|
+
if (body.references) {
|
|
1244
|
+
// A new translation joins the source's group, which may already hold
|
|
1245
|
+
// links the far-side count must discount.
|
|
1246
|
+
const entryGroup = body.translationOf
|
|
1247
|
+
? ((await repo.findById(collection, body.translationOf))?.translationGroup ?? null)
|
|
1248
|
+
: null;
|
|
1249
|
+
for (const [fieldSlug, selectedIds] of Object.entries(body.references)) {
|
|
1250
|
+
const resolved = await resolveReferenceSelectionTargets(
|
|
1251
|
+
trx,
|
|
1252
|
+
collection,
|
|
1253
|
+
fieldSlug,
|
|
1254
|
+
selectedIds,
|
|
1255
|
+
entryGroup,
|
|
1256
|
+
);
|
|
1257
|
+
if (!resolved.success) {
|
|
1258
|
+
throw Object.assign(new Error(resolved.error.message), {
|
|
1259
|
+
apiError: { code: resolved.error.code },
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
referenceWrites.push(resolved.data);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// Default to the configured site locale rather than the repo's
|
|
1267
|
+
// hard-coded "en" — otherwise non-English default-locale sites
|
|
1268
|
+
// silently create entries in a locale the editor never chose.
|
|
1269
|
+
const effectiveLocale = body.locale
|
|
1270
|
+
? resolveConfiguredLocale(body.locale)
|
|
1271
|
+
: getI18nConfig()?.defaultLocale;
|
|
451
1272
|
|
|
452
|
-
// Auto-generate slug from title/name if not explicitly provided
|
|
453
1273
|
let slug: string | null | undefined = body.slug;
|
|
454
1274
|
if (!slug) {
|
|
455
1275
|
const slugSource = getSlugSource(body.data);
|
|
456
1276
|
if (slugSource) {
|
|
457
|
-
slug = await repo.generateUniqueSlug(collection, slugSource,
|
|
1277
|
+
slug = await repo.generateUniqueSlug(collection, slugSource, effectiveLocale);
|
|
458
1278
|
}
|
|
459
1279
|
}
|
|
1280
|
+
if (body.status === "published") {
|
|
1281
|
+
const publishConfig = await getCollectionPublishConfig(trx, collection);
|
|
1282
|
+
requireRoutablePublishSlug(publishConfig.routable, slug);
|
|
1283
|
+
}
|
|
460
1284
|
|
|
461
1285
|
const created = await repo.create({
|
|
462
1286
|
type: collection,
|
|
@@ -464,16 +1288,39 @@ export async function handleContentCreate(
|
|
|
464
1288
|
data: body.data,
|
|
465
1289
|
status: body.status || "draft",
|
|
466
1290
|
authorId: body.authorId,
|
|
467
|
-
locale:
|
|
1291
|
+
locale: effectiveLocale,
|
|
468
1292
|
translationOf: body.translationOf,
|
|
1293
|
+
inheritFields: inheritedFields,
|
|
469
1294
|
createdAt: body.createdAt,
|
|
470
1295
|
publishedAt: body.publishedAt,
|
|
471
1296
|
});
|
|
472
1297
|
|
|
473
1298
|
if (body.bylines !== undefined) {
|
|
474
|
-
await bylineRepo.setContentBylines(collection, created.id, body.bylines);
|
|
475
|
-
|
|
1299
|
+
const credits = await bylineRepo.setContentBylines(collection, created.id, body.bylines);
|
|
1300
|
+
// `setContentBylines` translates wire row ids to their
|
|
1301
|
+
// `translation_group` before writing. The response-shape
|
|
1302
|
+
// `primaryBylineId` must match what's now in the DB, so read
|
|
1303
|
+
// it from the returned credit (whose `byline` came from a
|
|
1304
|
+
// hydration round-trip).
|
|
1305
|
+
created.primaryBylineId = credits[0]?.byline.translationGroup ?? null;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// Taxonomy assignments already belong to the content translation
|
|
1309
|
+
// group. Byline credits remain per content row and need copying.
|
|
1310
|
+
// Explicit `body.bylines` wins — `copyContentBylines` no-ops
|
|
1311
|
+
// when the target already has credits, but the cleaner guard
|
|
1312
|
+
// is to skip the call entirely.
|
|
1313
|
+
if (body.translationOf) {
|
|
1314
|
+
if (body.bylines === undefined) {
|
|
1315
|
+
await bylineRepo.copyContentBylines(collection, body.translationOf, created.id);
|
|
1316
|
+
// `copyContentBylines` writes the source's primary
|
|
1317
|
+
// pointer onto the new row; reflect it in-memory so the
|
|
1318
|
+
// response includes it before hydrateBylines runs.
|
|
1319
|
+
const source = await repo.findById(collection, body.translationOf);
|
|
1320
|
+
if (source) created.primaryBylineId = source.primaryBylineId;
|
|
1321
|
+
}
|
|
476
1322
|
}
|
|
1323
|
+
|
|
477
1324
|
await hydrateBylines(trx, collection, created);
|
|
478
1325
|
|
|
479
1326
|
// Side-write SEO data if provided
|
|
@@ -485,6 +1332,30 @@ export async function handleContentCreate(
|
|
|
485
1332
|
created.seo = { ...SEO_DEFAULTS };
|
|
486
1333
|
}
|
|
487
1334
|
|
|
1335
|
+
// Attach taxonomy terms in the same transaction. The MCP tool
|
|
1336
|
+
// (and the REST create body) previously accepted a `taxonomies`
|
|
1337
|
+
// field on `content_create` without doing anything with it, so
|
|
1338
|
+
// agents publishing a categorized/tagged entry had to make N
|
|
1339
|
+
// follow-up REST calls per taxonomy. This resolves each slug in
|
|
1340
|
+
// the entry's locale and pipes it through the same
|
|
1341
|
+
// `setTermsForEntry` path the `.../terms/{taxonomy}` REST route
|
|
1342
|
+
// uses, so the two entry points can't drift.
|
|
1343
|
+
if (body.taxonomies) {
|
|
1344
|
+
await assignTaxonomies(trx, collection, created.id, effectiveLocale, body.taxonomies);
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
// Attach the links resolved above. Nothing here can fail on the
|
|
1348
|
+
// caller's input any more, so the entry cannot be left written with a
|
|
1349
|
+
// selection that was rejected.
|
|
1350
|
+
if (created.translationGroup) {
|
|
1351
|
+
for (const write of referenceWrites) {
|
|
1352
|
+
await writeReferenceSelection(trx, {
|
|
1353
|
+
...write,
|
|
1354
|
+
entryGroup: created.translationGroup,
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
|
|
488
1359
|
return created;
|
|
489
1360
|
});
|
|
490
1361
|
|
|
@@ -493,6 +1364,14 @@ export async function handleContentCreate(
|
|
|
493
1364
|
data: { item, _rev: encodeRev(item) },
|
|
494
1365
|
};
|
|
495
1366
|
} catch (error) {
|
|
1367
|
+
// Handle structured errors thrown from inside the transaction (e.g. a
|
|
1368
|
+
// reference resolution failure from `setReferenceSelection`).
|
|
1369
|
+
if (hasApiError(error)) {
|
|
1370
|
+
return {
|
|
1371
|
+
success: false,
|
|
1372
|
+
error: { code: error.apiError.code, message: error.message },
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
496
1375
|
if (isMissingTableError(error)) {
|
|
497
1376
|
return {
|
|
498
1377
|
success: false,
|
|
@@ -503,6 +1382,12 @@ export async function handleContentCreate(
|
|
|
503
1382
|
};
|
|
504
1383
|
}
|
|
505
1384
|
if (error instanceof EmDashValidationError) {
|
|
1385
|
+
if (error.message === "Translation source content not found") {
|
|
1386
|
+
return {
|
|
1387
|
+
success: false,
|
|
1388
|
+
error: { code: "NOT_FOUND", message: error.message },
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
506
1391
|
return {
|
|
507
1392
|
success: false,
|
|
508
1393
|
error: { code: "VALIDATION_ERROR", message: error.message },
|
|
@@ -515,6 +1400,19 @@ export async function handleContentCreate(
|
|
|
515
1400
|
// messages also contain "constraint failed".
|
|
516
1401
|
const message = error instanceof Error ? error.message.toLowerCase() : "";
|
|
517
1402
|
if (message.includes("unique constraint failed") || message.includes("duplicate key")) {
|
|
1403
|
+
if (
|
|
1404
|
+
message.includes("active_tg_locale") ||
|
|
1405
|
+
(message.includes("translation_group") && message.includes("locale"))
|
|
1406
|
+
) {
|
|
1407
|
+
const locale = body.locale ?? getI18nConfig()?.defaultLocale ?? "en";
|
|
1408
|
+
return {
|
|
1409
|
+
success: false,
|
|
1410
|
+
error: {
|
|
1411
|
+
code: "CONFLICT",
|
|
1412
|
+
message: `Translation already exists in locale "${locale}" for this content item`,
|
|
1413
|
+
},
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
518
1416
|
// Detect slug-specific collisions by message fingerprint
|
|
519
1417
|
if (message.includes("slug")) {
|
|
520
1418
|
return {
|
|
@@ -557,12 +1455,16 @@ export async function handleContentUpdate(
|
|
|
557
1455
|
id: string,
|
|
558
1456
|
body: {
|
|
559
1457
|
data?: Record<string, unknown>;
|
|
560
|
-
slug?: string;
|
|
1458
|
+
slug?: string | null;
|
|
561
1459
|
status?: string;
|
|
562
1460
|
authorId?: string | null;
|
|
563
1461
|
bylines?: ContentBylineInput[];
|
|
1462
|
+
locale?: string;
|
|
564
1463
|
_rev?: string;
|
|
565
1464
|
seo?: ContentSeoInput;
|
|
1465
|
+
taxonomies?: Record<string, string[]>;
|
|
1466
|
+
/** Reference fields: field slug → ordered selected entry ids. */
|
|
1467
|
+
references?: Record<string, string[]>;
|
|
566
1468
|
publishedAt?: string | null;
|
|
567
1469
|
},
|
|
568
1470
|
): Promise<ApiResult<ContentResponse>> {
|
|
@@ -580,10 +1482,28 @@ export async function handleContentUpdate(
|
|
|
580
1482
|
};
|
|
581
1483
|
}
|
|
582
1484
|
|
|
1485
|
+
if (body.data) {
|
|
1486
|
+
const mimeCheck = await validateMediaFields(db, collection, body.data);
|
|
1487
|
+
if (!mimeCheck.success) return mimeCheck;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
583
1490
|
const repo = new ContentRepository(db);
|
|
584
1491
|
|
|
585
1492
|
// Resolve slug → ID if needed
|
|
586
|
-
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
1493
|
+
const resolvedId = (await resolveId(repo, collection, id, body.locale)) ?? id;
|
|
1494
|
+
|
|
1495
|
+
if (body.data) {
|
|
1496
|
+
const storagelessKeys = await storagelessDataKeys(db, collection, body.data);
|
|
1497
|
+
if (storagelessKeys.length > 0) {
|
|
1498
|
+
const stored = await repo.findById(collection, resolvedId);
|
|
1499
|
+
const changed = changedStoragelessDataKeys(
|
|
1500
|
+
new Set(storagelessKeys),
|
|
1501
|
+
body.data,
|
|
1502
|
+
stored?.data ?? {},
|
|
1503
|
+
);
|
|
1504
|
+
if (changed.length > 0) return storagelessDataKeyError(changed);
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
587
1507
|
|
|
588
1508
|
// Wrap content + SEO writes in a transaction for atomicity.
|
|
589
1509
|
// The _rev check is inside the transaction so the read-then-write
|
|
@@ -594,7 +1514,9 @@ export async function handleContentUpdate(
|
|
|
594
1514
|
|
|
595
1515
|
// Read existing item once for both _rev check and old slug capture
|
|
596
1516
|
const existing =
|
|
597
|
-
body._rev || body.slug
|
|
1517
|
+
body._rev || body.slug !== undefined || body.status === "published"
|
|
1518
|
+
? await trxRepo.findById(collection, resolvedId)
|
|
1519
|
+
: null;
|
|
598
1520
|
|
|
599
1521
|
// Validate _rev if provided (optimistic concurrency)
|
|
600
1522
|
if (body._rev) {
|
|
@@ -618,6 +1540,41 @@ export async function handleContentUpdate(
|
|
|
618
1540
|
oldSlug = existing.slug;
|
|
619
1541
|
}
|
|
620
1542
|
|
|
1543
|
+
const resultingStatus = body.status ?? existing?.status;
|
|
1544
|
+
if (resultingStatus === "published") {
|
|
1545
|
+
if (!existing) {
|
|
1546
|
+
throw Object.assign(new Error(`Content item not found: ${id}`), {
|
|
1547
|
+
apiError: { code: "NOT_FOUND" as const },
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
const publishConfig = await getCollectionPublishConfig(trx, collection);
|
|
1551
|
+
const intendedSlug = body.slug !== undefined ? body.slug : existing.slug;
|
|
1552
|
+
requireRoutablePublishSlug(publishConfig.routable, intendedSlug);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
// Resolve the whole selection before the update, for the reason the
|
|
1556
|
+
// matching block in `handleContentCreate` gives: on D1 the columns,
|
|
1557
|
+
// bylines and SEO below are committed one statement at a time, and a
|
|
1558
|
+
// reference rejected after them cannot take them back.
|
|
1559
|
+
const referenceWrites: ReferenceSelectionWrite[] = [];
|
|
1560
|
+
if (body.references) {
|
|
1561
|
+
for (const [fieldSlug, selectedIds] of Object.entries(body.references)) {
|
|
1562
|
+
const resolved = await resolveReferenceSelection(
|
|
1563
|
+
trx,
|
|
1564
|
+
collection,
|
|
1565
|
+
resolvedId,
|
|
1566
|
+
fieldSlug,
|
|
1567
|
+
selectedIds,
|
|
1568
|
+
);
|
|
1569
|
+
if (!resolved.success) {
|
|
1570
|
+
throw Object.assign(new Error(resolved.error.message), {
|
|
1571
|
+
apiError: { code: resolved.error.code },
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
referenceWrites.push(resolved.data);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
|
|
621
1578
|
const updated = await trxRepo.update(collection, resolvedId, {
|
|
622
1579
|
data: body.data,
|
|
623
1580
|
slug: body.slug,
|
|
@@ -627,35 +1584,35 @@ export async function handleContentUpdate(
|
|
|
627
1584
|
});
|
|
628
1585
|
|
|
629
1586
|
if (body.bylines !== undefined) {
|
|
630
|
-
await bylineRepo.setContentBylines(collection, resolvedId, body.bylines);
|
|
631
|
-
|
|
1587
|
+
const credits = await bylineRepo.setContentBylines(collection, resolvedId, body.bylines);
|
|
1588
|
+
// `setContentBylines` translates wire row ids to their
|
|
1589
|
+
// `translation_group` before writing. Read the in-memory
|
|
1590
|
+
// pointer from the persisted credit so the response shape
|
|
1591
|
+
// matches the DB. See the matching block in handleContentCreate.
|
|
1592
|
+
updated.primaryBylineId = credits[0]?.byline.translationGroup ?? null;
|
|
632
1593
|
}
|
|
633
1594
|
|
|
634
|
-
// Create auto-redirect when slug changes
|
|
1595
|
+
// Create auto-redirect when slug changes. Date tokens in the URL
|
|
1596
|
+
// pattern resolve from the publish date, so the old URL uses the
|
|
1597
|
+
// pre-update date (the URL that was actually live) and the new URL
|
|
1598
|
+
// the post-update one.
|
|
635
1599
|
if (oldSlug && body.slug) {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
.select("url_pattern")
|
|
639
|
-
.where("slug", "=", collection)
|
|
640
|
-
.executeTakeFirst();
|
|
641
|
-
|
|
642
|
-
const redirectRepo = new RedirectRepository(trx);
|
|
643
|
-
await redirectRepo.createAutoRedirect(
|
|
1600
|
+
await createSlugChangeRedirect(
|
|
1601
|
+
trx,
|
|
644
1602
|
collection,
|
|
645
1603
|
oldSlug,
|
|
646
1604
|
body.slug,
|
|
647
1605
|
resolvedId,
|
|
648
|
-
|
|
1606
|
+
existing?.publishedAt ?? null,
|
|
1607
|
+
updated.publishedAt ?? null,
|
|
649
1608
|
);
|
|
650
|
-
invalidateRedirectCache();
|
|
651
1609
|
}
|
|
652
1610
|
|
|
653
1611
|
// Sync non-translatable fields to sibling locales in the same
|
|
654
1612
|
// translation group. Only runs when i18n is enabled, data was updated,
|
|
655
1613
|
// and the item belongs to a translation group with siblings.
|
|
656
1614
|
if (isI18nEnabled() && body.data && updated.translationGroup) {
|
|
657
|
-
await syncNonTranslatableFields(
|
|
658
|
-
trx,
|
|
1615
|
+
await trxRepo.syncNonTranslatableFields(
|
|
659
1616
|
collection,
|
|
660
1617
|
updated.id,
|
|
661
1618
|
updated.translationGroup,
|
|
@@ -674,6 +1631,25 @@ export async function handleContentUpdate(
|
|
|
674
1631
|
|
|
675
1632
|
await hydrateBylines(trx, collection, updated);
|
|
676
1633
|
|
|
1634
|
+
// Replace taxonomy assignments in the same transaction. Uses the
|
|
1635
|
+
// entry's own locale (post-update) to resolve slugs so an update
|
|
1636
|
+
// that also changes locale still lands on the correct term
|
|
1637
|
+
// variants. See handleContentCreate for rationale.
|
|
1638
|
+
if (body.taxonomies) {
|
|
1639
|
+
await assignTaxonomies(
|
|
1640
|
+
trx,
|
|
1641
|
+
collection,
|
|
1642
|
+
resolvedId,
|
|
1643
|
+
updated.locale ?? body.locale,
|
|
1644
|
+
body.taxonomies,
|
|
1645
|
+
);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
// Replace the links from the selection resolved above.
|
|
1649
|
+
for (const write of referenceWrites) {
|
|
1650
|
+
await writeReferenceSelection(trx, write);
|
|
1651
|
+
}
|
|
1652
|
+
|
|
677
1653
|
return updated;
|
|
678
1654
|
});
|
|
679
1655
|
|
|
@@ -755,8 +1731,42 @@ export async function handleContentDuplicate(
|
|
|
755
1731
|
const repo = new ContentRepository(trx);
|
|
756
1732
|
const bylineRepo = new BylineRepository(trx);
|
|
757
1733
|
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
1734
|
+
const original = await repo.findById(collection, resolvedId);
|
|
758
1735
|
const dup = await repo.duplicate(collection, resolvedId, authorId);
|
|
759
1736
|
|
|
1737
|
+
// Reference edges are storage-less (keyed by translation_group, not in
|
|
1738
|
+
// `data`), so they don't ride along in the row copy — carry the original's
|
|
1739
|
+
// outgoing references onto the duplicate explicitly.
|
|
1740
|
+
if (original?.translationGroup && dup.translationGroup) {
|
|
1741
|
+
const relations = new RelationRepository(trx);
|
|
1742
|
+
// A relation's limits bind a copied edge like any other, and a
|
|
1743
|
+
// selection the copy cannot hold is not one to drop quietly: the
|
|
1744
|
+
// duplicate would look complete with a reference field the editor
|
|
1745
|
+
// never emptied. Refuse instead, and name what refused it.
|
|
1746
|
+
throwIfReferenceLimitRefused(
|
|
1747
|
+
await relations.copyParentEdges(original.translationGroup, dup.translationGroup),
|
|
1748
|
+
"parent",
|
|
1749
|
+
);
|
|
1750
|
+
|
|
1751
|
+
// Where a field on this collection binds the *child* end, its
|
|
1752
|
+
// backlinks are the field's value, so a duplicate that dropped them
|
|
1753
|
+
// would lose that field's whole selection. Backlinks no field views
|
|
1754
|
+
// still point only at the original.
|
|
1755
|
+
for (const field of (await referenceFieldConstraints(trx, collection)).values()) {
|
|
1756
|
+
if (field.relationSide !== "child") continue;
|
|
1757
|
+
const parents = await relations.getParents(field.relation, original.translationGroup);
|
|
1758
|
+
if (parents.length === 0) continue;
|
|
1759
|
+
throwIfReferenceLimitRefused(
|
|
1760
|
+
await relations.setParents(
|
|
1761
|
+
field.relation,
|
|
1762
|
+
dup.translationGroup,
|
|
1763
|
+
parents.map((parent) => parent.parentGroup),
|
|
1764
|
+
),
|
|
1765
|
+
"child",
|
|
1766
|
+
);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
|
|
760
1770
|
const existingBylines = await bylineRepo.getContentBylines(collection, resolvedId);
|
|
761
1771
|
if (existingBylines.length > 0) {
|
|
762
1772
|
await bylineRepo.setContentBylines(
|
|
@@ -796,6 +1806,14 @@ export async function handleContentDuplicate(
|
|
|
796
1806
|
},
|
|
797
1807
|
};
|
|
798
1808
|
}
|
|
1809
|
+
// A relation limit that refused a copied edge names the entry that refused
|
|
1810
|
+
// it, which the editor needs to act on.
|
|
1811
|
+
if (hasApiError(err)) {
|
|
1812
|
+
return {
|
|
1813
|
+
success: false,
|
|
1814
|
+
error: { code: err.apiError.code, message: err.message },
|
|
1815
|
+
};
|
|
1816
|
+
}
|
|
799
1817
|
console.error("Content duplicate error:", err);
|
|
800
1818
|
return {
|
|
801
1819
|
success: false,
|
|
@@ -814,15 +1832,19 @@ export async function handleContentDelete(
|
|
|
814
1832
|
db: Kysely<Database>,
|
|
815
1833
|
collection: string,
|
|
816
1834
|
id: string,
|
|
817
|
-
): Promise<ApiResult<{ deleted: true }>> {
|
|
1835
|
+
): Promise<ApiResult<{ deleted: true; id: string }>> {
|
|
818
1836
|
try {
|
|
819
|
-
const
|
|
1837
|
+
const result = await withTransaction(db, async (trx) => {
|
|
820
1838
|
const repo = new ContentRepository(trx);
|
|
821
1839
|
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
822
|
-
|
|
1840
|
+
const deleted = await repo.delete(collection, resolvedId);
|
|
1841
|
+
if (deleted) {
|
|
1842
|
+
await new EntryLockRepository(trx).releaseEntry(collection, resolvedId);
|
|
1843
|
+
}
|
|
1844
|
+
return { id: resolvedId, deleted };
|
|
823
1845
|
});
|
|
824
1846
|
|
|
825
|
-
if (!deleted) {
|
|
1847
|
+
if (!result.deleted) {
|
|
826
1848
|
return {
|
|
827
1849
|
success: false,
|
|
828
1850
|
error: {
|
|
@@ -834,7 +1856,7 @@ export async function handleContentDelete(
|
|
|
834
1856
|
|
|
835
1857
|
return {
|
|
836
1858
|
success: true,
|
|
837
|
-
data: { deleted: true },
|
|
1859
|
+
data: { deleted: true, id: result.id },
|
|
838
1860
|
};
|
|
839
1861
|
} catch (error) {
|
|
840
1862
|
console.error("Content delete error:", error);
|
|
@@ -855,15 +1877,17 @@ export async function handleContentRestore(
|
|
|
855
1877
|
db: Kysely<Database>,
|
|
856
1878
|
collection: string,
|
|
857
1879
|
id: string,
|
|
858
|
-
|
|
1880
|
+
options: { _rev?: string } = {},
|
|
1881
|
+
): Promise<ApiResult<{ restored: true; item: ContentItem; _rev: string }>> {
|
|
859
1882
|
try {
|
|
860
|
-
const
|
|
1883
|
+
const expectedRevision = decodeRevisionPrecondition(options._rev);
|
|
1884
|
+
const item = await withTransaction(db, async (trx) => {
|
|
861
1885
|
const repo = new ContentRepository(trx);
|
|
862
1886
|
const resolvedId = (await resolveIdIncludingTrashed(repo, collection, id)) ?? id;
|
|
863
|
-
return repo.restore(collection, resolvedId);
|
|
1887
|
+
return repo.restore(collection, resolvedId, expectedRevision);
|
|
864
1888
|
});
|
|
865
1889
|
|
|
866
|
-
if (!
|
|
1890
|
+
if (!item) {
|
|
867
1891
|
return {
|
|
868
1892
|
success: false,
|
|
869
1893
|
error: {
|
|
@@ -875,9 +1899,24 @@ export async function handleContentRestore(
|
|
|
875
1899
|
|
|
876
1900
|
return {
|
|
877
1901
|
success: true,
|
|
878
|
-
data: { restored: true },
|
|
1902
|
+
data: { restored: true, item, _rev: encodeRev(item) },
|
|
879
1903
|
};
|
|
880
1904
|
} catch (error) {
|
|
1905
|
+
if (error instanceof ContentMutationConflictError) {
|
|
1906
|
+
return {
|
|
1907
|
+
success: false,
|
|
1908
|
+
error: { code: "CONFLICT", message: error.message },
|
|
1909
|
+
};
|
|
1910
|
+
}
|
|
1911
|
+
if (isTranslationLocaleConflict(error, collection)) {
|
|
1912
|
+
return {
|
|
1913
|
+
success: false,
|
|
1914
|
+
error: {
|
|
1915
|
+
code: "CONFLICT",
|
|
1916
|
+
message: "An active translation already exists in this locale",
|
|
1917
|
+
},
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
881
1920
|
console.error("Content restore error:", error);
|
|
882
1921
|
return {
|
|
883
1922
|
success: false,
|
|
@@ -897,7 +1936,7 @@ export async function handleContentPermanentDelete(
|
|
|
897
1936
|
db: Kysely<Database>,
|
|
898
1937
|
collection: string,
|
|
899
1938
|
id: string,
|
|
900
|
-
): Promise<ApiResult<{ deleted: true }>> {
|
|
1939
|
+
): Promise<ApiResult<{ deleted: true; id: string }>> {
|
|
901
1940
|
try {
|
|
902
1941
|
const repo = new ContentRepository(db);
|
|
903
1942
|
const resolvedId = (await resolveIdIncludingTrashed(repo, collection, id)) ?? id;
|
|
@@ -905,6 +1944,34 @@ export async function handleContentPermanentDelete(
|
|
|
905
1944
|
// Wrap content delete + SEO/comment cleanup in a transaction
|
|
906
1945
|
const deleted = await withTransaction(db, async (trx) => {
|
|
907
1946
|
const trxRepo = new ContentRepository(trx);
|
|
1947
|
+
const item = await trxRepo.findByIdIncludingTrashed(collection, resolvedId);
|
|
1948
|
+
|
|
1949
|
+
// `permanentDelete` removes a trashed row only. Anything cleared ahead of
|
|
1950
|
+
// it has to answer the same question first, or purging a live entry strips
|
|
1951
|
+
// what belongs to it and then reports it was never found — and nothing
|
|
1952
|
+
// throws, so the clear stands even where the transaction is real.
|
|
1953
|
+
if (!item || item.deletedAt === null) return false;
|
|
1954
|
+
|
|
1955
|
+
// Term assignments and reference edges are keyed by translation_group, so
|
|
1956
|
+
// they belong to the group rather than to this row. They go only once no
|
|
1957
|
+
// row of the group is left, trashed ones included, since a trashed row
|
|
1958
|
+
// can still be restored.
|
|
1959
|
+
const lastOfGroup =
|
|
1960
|
+
item.translationGroup !== null
|
|
1961
|
+
? !(await trxRepo.hasTranslationsIncludingTrashed(collection, item.translationGroup, {
|
|
1962
|
+
excludeId: resolvedId,
|
|
1963
|
+
}))
|
|
1964
|
+
: false;
|
|
1965
|
+
|
|
1966
|
+
// The edges go before the row does. On D1 the delete below is committed
|
|
1967
|
+
// on its own, and this row is the only way back to the group that names
|
|
1968
|
+
// them — a cleanup that failed after it would strand edges that still
|
|
1969
|
+
// count and still show up as backlinks, with nothing left to find them
|
|
1970
|
+
// by. Failing here instead leaves everything as it was, to retry.
|
|
1971
|
+
if (lastOfGroup && item.translationGroup) {
|
|
1972
|
+
await new RelationRepository(trx).clearReferencesForGroup(item.translationGroup);
|
|
1973
|
+
}
|
|
1974
|
+
|
|
908
1975
|
const wasDeleted = await trxRepo.permanentDelete(collection, resolvedId);
|
|
909
1976
|
|
|
910
1977
|
if (wasDeleted) {
|
|
@@ -917,6 +1984,13 @@ export async function handleContentPermanentDelete(
|
|
|
917
1984
|
// Clean up revisions for permanently deleted content
|
|
918
1985
|
const revisionRepo = new RevisionRepository(trx);
|
|
919
1986
|
await revisionRepo.deleteByEntry(collection, resolvedId);
|
|
1987
|
+
await new EntryLockRepository(trx).releaseEntry(collection, resolvedId);
|
|
1988
|
+
// Credits belong to this row alone — no other row reads them, so they
|
|
1989
|
+
// go with it whether or not the group survives.
|
|
1990
|
+
await new BylineRepository(trx).deleteContentBylines(collection, resolvedId);
|
|
1991
|
+
if (lastOfGroup && item.translationGroup) {
|
|
1992
|
+
await new TaxonomyRepository(trx).clearEntryGroupTerms(collection, item.translationGroup);
|
|
1993
|
+
}
|
|
920
1994
|
}
|
|
921
1995
|
|
|
922
1996
|
return wasDeleted;
|
|
@@ -934,7 +2008,7 @@ export async function handleContentPermanentDelete(
|
|
|
934
2008
|
|
|
935
2009
|
return {
|
|
936
2010
|
success: true,
|
|
937
|
-
data: { deleted: true },
|
|
2011
|
+
data: { deleted: true, id: resolvedId },
|
|
938
2012
|
};
|
|
939
2013
|
} catch (error) {
|
|
940
2014
|
console.error("Content permanent delete error:", error);
|
|
@@ -954,13 +2028,14 @@ export async function handleContentPermanentDelete(
|
|
|
954
2028
|
export async function handleContentListTrashed(
|
|
955
2029
|
db: Kysely<Database>,
|
|
956
2030
|
collection: string,
|
|
957
|
-
options: { limit?: number; cursor?: string } = {},
|
|
2031
|
+
options: { limit?: number; cursor?: string; locale?: string } = {},
|
|
958
2032
|
): Promise<ApiResult<{ items: TrashedContentItem[]; nextCursor?: string }>> {
|
|
959
2033
|
try {
|
|
960
2034
|
const repo = new ContentRepository(db);
|
|
961
2035
|
const result = await repo.findTrashed(collection, {
|
|
962
2036
|
limit: options.limit,
|
|
963
2037
|
cursor: options.cursor,
|
|
2038
|
+
where: { locale: options.locale },
|
|
964
2039
|
});
|
|
965
2040
|
|
|
966
2041
|
return {
|
|
@@ -971,6 +2046,8 @@ export async function handleContentListTrashed(
|
|
|
971
2046
|
type: item.type,
|
|
972
2047
|
slug: item.slug,
|
|
973
2048
|
status: item.status,
|
|
2049
|
+
locale: item.locale,
|
|
2050
|
+
translationGroup: item.translationGroup,
|
|
974
2051
|
data: item.data,
|
|
975
2052
|
authorId: item.authorId,
|
|
976
2053
|
createdAt: item.createdAt,
|
|
@@ -1005,10 +2082,11 @@ export async function handleContentListTrashed(
|
|
|
1005
2082
|
export async function handleContentCountTrashed(
|
|
1006
2083
|
db: Kysely<Database>,
|
|
1007
2084
|
collection: string,
|
|
2085
|
+
options: { locale?: string } = {},
|
|
1008
2086
|
): Promise<ApiResult<{ count: number }>> {
|
|
1009
2087
|
try {
|
|
1010
2088
|
const repo = new ContentRepository(db);
|
|
1011
|
-
const count = await repo.countTrashed(collection);
|
|
2089
|
+
const count = await repo.countTrashed(collection, { locale: options.locale });
|
|
1012
2090
|
|
|
1013
2091
|
return {
|
|
1014
2092
|
success: true,
|
|
@@ -1034,12 +2112,20 @@ export async function handleContentSchedule(
|
|
|
1034
2112
|
collection: string,
|
|
1035
2113
|
id: string,
|
|
1036
2114
|
scheduledAt: string,
|
|
2115
|
+
currentTime: Date = new Date(),
|
|
2116
|
+
_rev?: string,
|
|
1037
2117
|
): Promise<ApiResult<ContentResponse>> {
|
|
1038
2118
|
try {
|
|
2119
|
+
const expectedRevision = decodeRevisionPrecondition(_rev);
|
|
1039
2120
|
const item = await withTransaction(db, async (trx) => {
|
|
1040
2121
|
const repo = new ContentRepository(trx);
|
|
1041
|
-
const
|
|
1042
|
-
|
|
2122
|
+
const existing = await repo.findByIdOrSlug(collection, id);
|
|
2123
|
+
const resolvedId = existing?.id ?? id;
|
|
2124
|
+
if (existing) {
|
|
2125
|
+
const publishConfig = await getCollectionPublishConfig(trx, collection);
|
|
2126
|
+
requireRoutablePublishSlug(publishConfig.routable, existing.slug);
|
|
2127
|
+
}
|
|
2128
|
+
return repo.schedule(collection, resolvedId, scheduledAt, currentTime, expectedRevision);
|
|
1043
2129
|
});
|
|
1044
2130
|
|
|
1045
2131
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
@@ -1047,9 +2133,15 @@ export async function handleContentSchedule(
|
|
|
1047
2133
|
|
|
1048
2134
|
return {
|
|
1049
2135
|
success: true,
|
|
1050
|
-
data: { item },
|
|
2136
|
+
data: { item, _rev: encodeRev(item) },
|
|
1051
2137
|
};
|
|
1052
2138
|
} catch (error) {
|
|
2139
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2140
|
+
return {
|
|
2141
|
+
success: false,
|
|
2142
|
+
error: { code: "CONFLICT", message: error.message },
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
1053
2145
|
if (error instanceof EmDashValidationError) {
|
|
1054
2146
|
return {
|
|
1055
2147
|
success: false,
|
|
@@ -1077,12 +2169,14 @@ export async function handleContentUnschedule(
|
|
|
1077
2169
|
db: Kysely<Database>,
|
|
1078
2170
|
collection: string,
|
|
1079
2171
|
id: string,
|
|
2172
|
+
options: { _rev?: string } = {},
|
|
1080
2173
|
): Promise<ApiResult<ContentResponse>> {
|
|
1081
2174
|
try {
|
|
2175
|
+
const expectedRevision = decodeRevisionPrecondition(options._rev);
|
|
1082
2176
|
const item = await withTransaction(db, async (trx) => {
|
|
1083
2177
|
const repo = new ContentRepository(trx);
|
|
1084
2178
|
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
1085
|
-
return repo.unschedule(collection, resolvedId);
|
|
2179
|
+
return repo.unschedule(collection, resolvedId, expectedRevision);
|
|
1086
2180
|
});
|
|
1087
2181
|
|
|
1088
2182
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
@@ -1090,9 +2184,24 @@ export async function handleContentUnschedule(
|
|
|
1090
2184
|
|
|
1091
2185
|
return {
|
|
1092
2186
|
success: true,
|
|
1093
|
-
data: { item },
|
|
2187
|
+
data: { item, _rev: encodeRev(item) },
|
|
1094
2188
|
};
|
|
1095
2189
|
} catch (error) {
|
|
2190
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2191
|
+
return {
|
|
2192
|
+
success: false,
|
|
2193
|
+
error: { code: "CONFLICT", message: error.message },
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
if (error instanceof EmDashValidationError) {
|
|
2197
|
+
return {
|
|
2198
|
+
success: false,
|
|
2199
|
+
error: {
|
|
2200
|
+
code: "VALIDATION_ERROR",
|
|
2201
|
+
message: error.message,
|
|
2202
|
+
},
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
1096
2205
|
console.error("Content unschedule error:", error);
|
|
1097
2206
|
return {
|
|
1098
2207
|
success: false,
|
|
@@ -1104,23 +2213,222 @@ export async function handleContentUnschedule(
|
|
|
1104
2213
|
}
|
|
1105
2214
|
}
|
|
1106
2215
|
|
|
2216
|
+
/**
|
|
2217
|
+
* Persist a permanent policy rejection and unschedule the publication.
|
|
2218
|
+
* Databases with transactions commit both writes together. D1 persists the
|
|
2219
|
+
* reason first so a failed option write cannot silently remove the entry from
|
|
2220
|
+
* future sweeps; if unscheduling then fails, the due entry and its dashboard
|
|
2221
|
+
* notice remain available for retry and operator action.
|
|
2222
|
+
*/
|
|
2223
|
+
export async function handleScheduledPolicyRejection(
|
|
2224
|
+
db: Kysely<Database>,
|
|
2225
|
+
collection: string,
|
|
2226
|
+
id: string,
|
|
2227
|
+
options: { _rev: string; rejection: ScheduledPolicyRejection },
|
|
2228
|
+
): Promise<ApiResult<ContentResponse>> {
|
|
2229
|
+
try {
|
|
2230
|
+
const expectedRevision = decodeRevisionPrecondition(options._rev);
|
|
2231
|
+
const item = await withTransaction(db, async (trx) => {
|
|
2232
|
+
const repo = new ContentRepository(trx);
|
|
2233
|
+
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
2234
|
+
const optionsRepo = new OptionsRepository(trx);
|
|
2235
|
+
const rejectionKey = scheduledPolicyRejectionKey(collection, resolvedId);
|
|
2236
|
+
const rejectionRevision = await optionsRepo.setVersioned(rejectionKey, {
|
|
2237
|
+
...options.rejection,
|
|
2238
|
+
id: resolvedId,
|
|
2239
|
+
});
|
|
2240
|
+
try {
|
|
2241
|
+
return await repo.unschedule(collection, resolvedId, expectedRevision);
|
|
2242
|
+
} catch (error) {
|
|
2243
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2244
|
+
try {
|
|
2245
|
+
await optionsRepo.compareAndDelete(rejectionKey, rejectionRevision);
|
|
2246
|
+
} catch (cleanupError) {
|
|
2247
|
+
console.error("Failed to clear stale scheduled policy rejection:", cleanupError);
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
throw error;
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
|
|
2254
|
+
const hasSeo = await collectionHasSeo(db, collection);
|
|
2255
|
+
await hydrateSeo(db, collection, item, hasSeo);
|
|
2256
|
+
return { success: true, data: { item, _rev: encodeRev(item) } };
|
|
2257
|
+
} catch (error) {
|
|
2258
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2259
|
+
return {
|
|
2260
|
+
success: false,
|
|
2261
|
+
error: { code: "CONFLICT", message: error.message },
|
|
2262
|
+
};
|
|
2263
|
+
}
|
|
2264
|
+
if (error instanceof EmDashValidationError) {
|
|
2265
|
+
return {
|
|
2266
|
+
success: false,
|
|
2267
|
+
error: { code: "VALIDATION_ERROR", message: error.message },
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
console.error("Scheduled policy rejection error:", error);
|
|
2271
|
+
return {
|
|
2272
|
+
success: false,
|
|
2273
|
+
error: {
|
|
2274
|
+
code: "CONTENT_UNSCHEDULE_ERROR",
|
|
2275
|
+
message: "Failed to record scheduled publication rejection",
|
|
2276
|
+
},
|
|
2277
|
+
};
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
|
|
1107
2281
|
/**
|
|
1108
2282
|
* Publish content immediately.
|
|
1109
2283
|
*
|
|
1110
|
-
*
|
|
1111
|
-
*
|
|
1112
|
-
* be atomic to prevent FTS shadow table corruption on crash.
|
|
2284
|
+
* Publication is one atomic content-row statement. On databases that support
|
|
2285
|
+
* transactions, the slug redirect and the locale sync stay grouped with it.
|
|
1113
2286
|
*/
|
|
1114
2287
|
export async function handleContentPublish(
|
|
1115
2288
|
db: Kysely<Database>,
|
|
1116
2289
|
collection: string,
|
|
1117
2290
|
id: string,
|
|
2291
|
+
options: {
|
|
2292
|
+
publishedAt?: string;
|
|
2293
|
+
requireScheduledDue?: boolean;
|
|
2294
|
+
expectedScheduledAt?: string;
|
|
2295
|
+
_rev?: string;
|
|
2296
|
+
currentTime?: Date;
|
|
2297
|
+
} = {},
|
|
1118
2298
|
): Promise<ApiResult<ContentResponse>> {
|
|
1119
2299
|
try {
|
|
2300
|
+
const expectedRevision = decodeRevisionPrecondition(options._rev);
|
|
1120
2301
|
const item = await withTransaction(db, async (trx) => {
|
|
1121
2302
|
const repo = new ContentRepository(trx);
|
|
1122
2303
|
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
1123
|
-
|
|
2304
|
+
const publishConfig = await getCollectionPublishConfig(trx, collection);
|
|
2305
|
+
|
|
2306
|
+
// Capture the pre-publish state. For revision-supporting collections a
|
|
2307
|
+
// slug edit is staged as `_slug` in the draft revision and only lands
|
|
2308
|
+
// on the live `slug` column here, inside `repo.publish()` — it never
|
|
2309
|
+
// passes through handleContentUpdate, where slug-change auto-redirects
|
|
2310
|
+
// are normally created.
|
|
2311
|
+
const existing = await repo.findById(collection, resolvedId);
|
|
2312
|
+
|
|
2313
|
+
// A selection staged in the draft becomes the live one here. Validate
|
|
2314
|
+
// before the publishing statement rather than after: `withTransaction`
|
|
2315
|
+
// degrades to sequential statements on D1, so a selection rejected
|
|
2316
|
+
// afterwards would leave the entry published with the old links.
|
|
2317
|
+
const draftRevision =
|
|
2318
|
+
publishConfig.supportsRevisions && existing?.draftRevisionId
|
|
2319
|
+
? await new RevisionRepository(trx).findById(existing.draftRevisionId)
|
|
2320
|
+
: undefined;
|
|
2321
|
+
const stagedReferences = draftRevision ? readStagedReferences(draftRevision.data) : undefined;
|
|
2322
|
+
const stagedReferenceBaselines = draftRevision
|
|
2323
|
+
? readStagedReferenceBaselines(draftRevision.data)
|
|
2324
|
+
: undefined;
|
|
2325
|
+
if (existing?.translationGroup) {
|
|
2326
|
+
const valid = await validateStagedReferences(
|
|
2327
|
+
trx,
|
|
2328
|
+
collection,
|
|
2329
|
+
stagedReferences ?? {},
|
|
2330
|
+
existing.translationGroup,
|
|
2331
|
+
stagedReferenceBaselines,
|
|
2332
|
+
);
|
|
2333
|
+
if (!valid.success) {
|
|
2334
|
+
throw Object.assign(new Error(valid.error.message), {
|
|
2335
|
+
apiError: { code: valid.error.code },
|
|
2336
|
+
});
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
// Promote before the publishing statement, which is also what clears
|
|
2340
|
+
// the draft pointer. On D1 that statement cannot be taken back, and
|
|
2341
|
+
// the draft is the only place the staged selection can be read from
|
|
2342
|
+
// again — a promotion that failed after it would have nothing left to
|
|
2343
|
+
// retry. Replacing a selection is idempotent, so a retry that reaches
|
|
2344
|
+
// here twice writes the same links.
|
|
2345
|
+
//
|
|
2346
|
+
// That ordering only holds if the publish is going to happen, so every
|
|
2347
|
+
// refusal `repo.publish()` decides before it writes is decided here
|
|
2348
|
+
// first. It repeats them all and stays authoritative; running them
|
|
2349
|
+
// early keeps a refusal from landing after a promotion nothing undoes,
|
|
2350
|
+
// which would show readers a selection that was never published. Its
|
|
2351
|
+
// last check is the optimistic fence, which cannot move ahead of the
|
|
2352
|
+
// write it guards.
|
|
2353
|
+
if (stagedReferences) {
|
|
2354
|
+
await assertPublishWillNotBeRefused(trx, collection, resolvedId, existing, {
|
|
2355
|
+
stagedSlug: readStagedSlug(draftRevision?.data),
|
|
2356
|
+
requireSlug: publishConfig.routable,
|
|
2357
|
+
requireDue: options.requireScheduledDue,
|
|
2358
|
+
expectedScheduledAt: options.expectedScheduledAt,
|
|
2359
|
+
expectedRevision,
|
|
2360
|
+
});
|
|
2361
|
+
await applyStagedReferences(
|
|
2362
|
+
trx,
|
|
2363
|
+
collection,
|
|
2364
|
+
existing.translationGroup,
|
|
2365
|
+
stagedReferences,
|
|
2366
|
+
stagedReferenceBaselines,
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
const published = await repo.publish(
|
|
2372
|
+
collection,
|
|
2373
|
+
resolvedId,
|
|
2374
|
+
options.publishedAt,
|
|
2375
|
+
options.requireScheduledDue,
|
|
2376
|
+
options.expectedScheduledAt,
|
|
2377
|
+
publishConfig.supportsRevisions,
|
|
2378
|
+
publishConfig.routable,
|
|
2379
|
+
expectedRevision,
|
|
2380
|
+
options.currentTime,
|
|
2381
|
+
);
|
|
2382
|
+
|
|
2383
|
+
if (
|
|
2384
|
+
publishConfig.supportsRevisions &&
|
|
2385
|
+
published.liveRevisionId &&
|
|
2386
|
+
published.translationGroup
|
|
2387
|
+
) {
|
|
2388
|
+
await recordPublishedReferences(
|
|
2389
|
+
trx,
|
|
2390
|
+
collection,
|
|
2391
|
+
published.liveRevisionId,
|
|
2392
|
+
published.translationGroup,
|
|
2393
|
+
);
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
if (
|
|
2397
|
+
existing &&
|
|
2398
|
+
isI18nEnabled() &&
|
|
2399
|
+
publishConfig.supportsRevisions &&
|
|
2400
|
+
published.translationGroup
|
|
2401
|
+
) {
|
|
2402
|
+
await repo.syncNonTranslatableFields(
|
|
2403
|
+
collection,
|
|
2404
|
+
published.id,
|
|
2405
|
+
published.translationGroup,
|
|
2406
|
+
published.data,
|
|
2407
|
+
{ previous: existing.data },
|
|
2408
|
+
);
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
// Leave a 301 behind when publishing changed the slug of an entry that
|
|
2412
|
+
// was already published — its old URL was live and may be indexed or
|
|
2413
|
+
// linked. A first publish is excluded: a draft's URL was never public.
|
|
2414
|
+
if (
|
|
2415
|
+
existing?.status === "published" &&
|
|
2416
|
+
existing.slug &&
|
|
2417
|
+
published.slug &&
|
|
2418
|
+
existing.slug !== published.slug
|
|
2419
|
+
) {
|
|
2420
|
+
await createSlugChangeRedirect(
|
|
2421
|
+
trx,
|
|
2422
|
+
collection,
|
|
2423
|
+
existing.slug,
|
|
2424
|
+
published.slug,
|
|
2425
|
+
resolvedId,
|
|
2426
|
+
existing.publishedAt ?? null,
|
|
2427
|
+
published.publishedAt ?? null,
|
|
2428
|
+
);
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
return published;
|
|
1124
2432
|
});
|
|
1125
2433
|
|
|
1126
2434
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
@@ -1128,9 +2436,69 @@ export async function handleContentPublish(
|
|
|
1128
2436
|
|
|
1129
2437
|
return {
|
|
1130
2438
|
success: true,
|
|
1131
|
-
data: { item },
|
|
2439
|
+
data: { item, _rev: encodeRev(item) },
|
|
1132
2440
|
};
|
|
1133
2441
|
} catch (error) {
|
|
2442
|
+
if (hasApiError(error)) {
|
|
2443
|
+
return {
|
|
2444
|
+
success: false,
|
|
2445
|
+
error: { code: error.apiError.code, message: error.message },
|
|
2446
|
+
};
|
|
2447
|
+
}
|
|
2448
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2449
|
+
return {
|
|
2450
|
+
success: false,
|
|
2451
|
+
error: {
|
|
2452
|
+
code: "CONFLICT",
|
|
2453
|
+
message: error.message,
|
|
2454
|
+
},
|
|
2455
|
+
};
|
|
2456
|
+
}
|
|
2457
|
+
// The scheduled sweep gates publish on the row still being due; a row
|
|
2458
|
+
// unscheduled in the meantime is a silent skip, not a failure.
|
|
2459
|
+
if (error instanceof ScheduledNotDueError) {
|
|
2460
|
+
return {
|
|
2461
|
+
success: false,
|
|
2462
|
+
error: {
|
|
2463
|
+
code: "NOT_DUE",
|
|
2464
|
+
message: error.message,
|
|
2465
|
+
},
|
|
2466
|
+
};
|
|
2467
|
+
}
|
|
2468
|
+
if (error instanceof EmDashValidationError) {
|
|
2469
|
+
// The staged-slug pre-check tags its error so it maps to the same
|
|
2470
|
+
// 409 SLUG_CONFLICT as direct slug edits in create/update.
|
|
2471
|
+
const details: unknown = error.details;
|
|
2472
|
+
const isSlugConflict =
|
|
2473
|
+
typeof details === "object" &&
|
|
2474
|
+
details !== null &&
|
|
2475
|
+
"code" in details &&
|
|
2476
|
+
details.code === "SLUG_CONFLICT";
|
|
2477
|
+
return {
|
|
2478
|
+
success: false,
|
|
2479
|
+
error: {
|
|
2480
|
+
code: isSlugConflict ? "SLUG_CONFLICT" : "VALIDATION_ERROR",
|
|
2481
|
+
message: error.message,
|
|
2482
|
+
},
|
|
2483
|
+
};
|
|
2484
|
+
}
|
|
2485
|
+
// Backstop for the pre-check inside repo.publish(): a concurrent write
|
|
2486
|
+
// can still take the slug between the check and the UPDATE, in which
|
|
2487
|
+
// case the `(slug, locale)` unique constraint fires. Same fingerprint
|
|
2488
|
+
// mapping as create/update — never a raw SQLite error to the client.
|
|
2489
|
+
const message = error instanceof Error ? error.message.toLowerCase() : "";
|
|
2490
|
+
if (
|
|
2491
|
+
(message.includes("unique constraint failed") || message.includes("duplicate key")) &&
|
|
2492
|
+
message.includes("slug")
|
|
2493
|
+
) {
|
|
2494
|
+
return {
|
|
2495
|
+
success: false,
|
|
2496
|
+
error: {
|
|
2497
|
+
code: "SLUG_CONFLICT",
|
|
2498
|
+
message: `The staged slug is already used by another entry in collection '${collection}'`,
|
|
2499
|
+
},
|
|
2500
|
+
};
|
|
2501
|
+
}
|
|
1134
2502
|
console.error("Content publish error:", error);
|
|
1135
2503
|
return {
|
|
1136
2504
|
success: false,
|
|
@@ -1152,12 +2520,14 @@ export async function handleContentUnpublish(
|
|
|
1152
2520
|
db: Kysely<Database>,
|
|
1153
2521
|
collection: string,
|
|
1154
2522
|
id: string,
|
|
2523
|
+
options: { _rev?: string } = {},
|
|
1155
2524
|
): Promise<ApiResult<ContentResponse>> {
|
|
1156
2525
|
try {
|
|
2526
|
+
const expectedRevision = decodeRevisionPrecondition(options._rev);
|
|
1157
2527
|
const item = await withTransaction(db, async (trx) => {
|
|
1158
2528
|
const repo = new ContentRepository(trx);
|
|
1159
2529
|
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
1160
|
-
return repo.unpublish(collection, resolvedId);
|
|
2530
|
+
return repo.unpublish(collection, resolvedId, expectedRevision);
|
|
1161
2531
|
});
|
|
1162
2532
|
|
|
1163
2533
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
@@ -1165,9 +2535,24 @@ export async function handleContentUnpublish(
|
|
|
1165
2535
|
|
|
1166
2536
|
return {
|
|
1167
2537
|
success: true,
|
|
1168
|
-
data: { item },
|
|
2538
|
+
data: { item, _rev: encodeRev(item) },
|
|
1169
2539
|
};
|
|
1170
2540
|
} catch (error) {
|
|
2541
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2542
|
+
return {
|
|
2543
|
+
success: false,
|
|
2544
|
+
error: { code: "CONFLICT", message: error.message },
|
|
2545
|
+
};
|
|
2546
|
+
}
|
|
2547
|
+
if (error instanceof EmDashValidationError) {
|
|
2548
|
+
return {
|
|
2549
|
+
success: false,
|
|
2550
|
+
error: {
|
|
2551
|
+
code: "VALIDATION_ERROR",
|
|
2552
|
+
message: error.message,
|
|
2553
|
+
},
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
1171
2556
|
console.error("Content unpublish error:", error);
|
|
1172
2557
|
return {
|
|
1173
2558
|
success: false,
|
|
@@ -1213,12 +2598,14 @@ export async function handleContentDiscardDraft(
|
|
|
1213
2598
|
db: Kysely<Database>,
|
|
1214
2599
|
collection: string,
|
|
1215
2600
|
id: string,
|
|
2601
|
+
options: { _rev?: string } = {},
|
|
1216
2602
|
): Promise<ApiResult<ContentResponse>> {
|
|
1217
2603
|
try {
|
|
2604
|
+
const expectedRevision = decodeRevisionPrecondition(options._rev);
|
|
1218
2605
|
const item = await withTransaction(db, async (trx) => {
|
|
1219
2606
|
const repo = new ContentRepository(trx);
|
|
1220
2607
|
const resolvedId = (await resolveId(repo, collection, id)) ?? id;
|
|
1221
|
-
return repo.discardDraft(collection, resolvedId);
|
|
2608
|
+
return repo.discardDraft(collection, resolvedId, expectedRevision);
|
|
1222
2609
|
});
|
|
1223
2610
|
|
|
1224
2611
|
const hasSeo = await collectionHasSeo(db, collection);
|
|
@@ -1226,9 +2613,15 @@ export async function handleContentDiscardDraft(
|
|
|
1226
2613
|
|
|
1227
2614
|
return {
|
|
1228
2615
|
success: true,
|
|
1229
|
-
data: { item },
|
|
2616
|
+
data: { item, _rev: encodeRev(item) },
|
|
1230
2617
|
};
|
|
1231
2618
|
} catch (error) {
|
|
2619
|
+
if (error instanceof ContentMutationConflictError) {
|
|
2620
|
+
return {
|
|
2621
|
+
success: false,
|
|
2622
|
+
error: { code: "CONFLICT", message: error.message },
|
|
2623
|
+
};
|
|
2624
|
+
}
|
|
1232
2625
|
if (error instanceof EmDashValidationError) {
|
|
1233
2626
|
return {
|
|
1234
2627
|
success: false,
|
|
@@ -1282,13 +2675,31 @@ export async function handleContentCompare(
|
|
|
1282
2675
|
const live = entry.liveRevisionId ? await revisionRepo.findById(entry.liveRevisionId) : null;
|
|
1283
2676
|
const draft = entry.draftRevisionId ? await revisionRepo.findById(entry.draftRevisionId) : null;
|
|
1284
2677
|
|
|
2678
|
+
// Reference selections have to be filled in from the links on both sides
|
|
2679
|
+
// before they can be compared. The published selection is the links, not
|
|
2680
|
+
// whatever `_references` the live revision happens to carry; and the draft
|
|
2681
|
+
// stages only the fields its saves named, so the rest of its effective
|
|
2682
|
+
// selection is the live one.
|
|
2683
|
+
const liveReferences = entry.translationGroup
|
|
2684
|
+
? await liveReferenceSelection(db, collection, entry.translationGroup)
|
|
2685
|
+
: {};
|
|
2686
|
+
const withReferences = (
|
|
2687
|
+
revisionData: Record<string, unknown> | undefined,
|
|
2688
|
+
staged: StagedReferences,
|
|
2689
|
+
) => {
|
|
2690
|
+
if (!revisionData) return undefined;
|
|
2691
|
+
const selection = { ...liveReferences, ...staged };
|
|
2692
|
+
if (Object.keys(selection).length === 0) return revisionData;
|
|
2693
|
+
return { ...revisionData, [STAGED_REFERENCES_KEY]: selection };
|
|
2694
|
+
};
|
|
2695
|
+
|
|
1285
2696
|
return {
|
|
1286
2697
|
success: true,
|
|
1287
2698
|
data: {
|
|
1288
2699
|
hasChanges:
|
|
1289
2700
|
entry.draftRevisionId !== null && entry.draftRevisionId !== entry.liveRevisionId,
|
|
1290
|
-
live: live?.data ?? null,
|
|
1291
|
-
draft: draft?.data ?? null,
|
|
2701
|
+
live: withReferences(live?.data, {}) ?? null,
|
|
2702
|
+
draft: withReferences(draft?.data, readStagedReferences(draft?.data) ?? {}) ?? null,
|
|
1292
2703
|
},
|
|
1293
2704
|
};
|
|
1294
2705
|
} catch (error) {
|
|
@@ -1384,71 +2795,56 @@ export async function handleContentTranslations(
|
|
|
1384
2795
|
}
|
|
1385
2796
|
}
|
|
1386
2797
|
|
|
1387
|
-
// ---------------------------------------------------------------------------
|
|
1388
|
-
// Non-translatable field sync
|
|
1389
|
-
// ---------------------------------------------------------------------------
|
|
1390
|
-
|
|
1391
2798
|
/**
|
|
1392
|
-
*
|
|
2799
|
+
* Resolve a `{ taxonomyName: [slug, ...] }` map to term IDs and replace the
|
|
2800
|
+
* entry's assignments for each named taxonomy.
|
|
1393
2801
|
*
|
|
1394
|
-
*
|
|
1395
|
-
*
|
|
1396
|
-
*
|
|
2802
|
+
* Shared by handleContentCreate and handleContentUpdate so both MCP entry
|
|
2803
|
+
* points behave identically. Slug resolution is scoped to `locale`; passing
|
|
2804
|
+
* `undefined` lets `findBySlug` fall back to its default (lowest locale code)
|
|
2805
|
+
* so callers on single-locale sites don't need to know the site's default.
|
|
1397
2806
|
*
|
|
1398
|
-
*
|
|
1399
|
-
*
|
|
2807
|
+
* Throws EmDashValidationError on unknown slug or wrong shape; the calling
|
|
2808
|
+
* handler translates that into a VALIDATION_ERROR response.
|
|
1400
2809
|
*/
|
|
1401
|
-
async function
|
|
2810
|
+
async function assignTaxonomies(
|
|
1402
2811
|
trx: Kysely<Database>,
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
2812
|
+
collection: string,
|
|
2813
|
+
entryId: string,
|
|
2814
|
+
locale: string | undefined,
|
|
2815
|
+
taxonomies: Record<string, string[]>,
|
|
1407
2816
|
): Promise<void> {
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
.selectFrom("_emdash_collections")
|
|
1411
|
-
.select("id")
|
|
1412
|
-
.where("slug", "=", collectionSlug)
|
|
1413
|
-
.executeTakeFirst();
|
|
1414
|
-
|
|
1415
|
-
if (!collection) return;
|
|
1416
|
-
|
|
1417
|
-
// Find non-translatable fields that are present in the update data
|
|
1418
|
-
const fields = await trx
|
|
1419
|
-
.selectFrom("_emdash_fields")
|
|
1420
|
-
.select("slug")
|
|
1421
|
-
.where("collection_id", "=", collection.id)
|
|
1422
|
-
.where("translatable", "=", 0)
|
|
1423
|
-
.execute();
|
|
2817
|
+
const taxRepo = new TaxonomyRepository(trx);
|
|
2818
|
+
let anyChange = false;
|
|
1424
2819
|
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
// Filter to only the non-translatable fields present in this update
|
|
1429
|
-
const syncData: Record<string, unknown> = {};
|
|
1430
|
-
for (const slug of nonTranslatableSlugs) {
|
|
1431
|
-
if (slug in data) {
|
|
1432
|
-
syncData[slug] = data[slug];
|
|
2820
|
+
for (const [taxonomyName, slugs] of Object.entries(taxonomies)) {
|
|
2821
|
+
if (!Array.isArray(slugs)) {
|
|
2822
|
+
throw new EmDashValidationError(`taxonomies.${taxonomyName} must be an array of term slugs`);
|
|
1433
2823
|
}
|
|
1434
|
-
}
|
|
1435
|
-
if (Object.keys(syncData).length === 0) return;
|
|
1436
2824
|
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
2825
|
+
const termIds: string[] = [];
|
|
2826
|
+
for (const slug of slugs) {
|
|
2827
|
+
if (typeof slug !== "string" || slug.length === 0) {
|
|
2828
|
+
throw new EmDashValidationError(
|
|
2829
|
+
`taxonomies.${taxonomyName} contains a non-string or empty slug`,
|
|
2830
|
+
);
|
|
2831
|
+
}
|
|
2832
|
+
const term = await taxRepo.findBySlug(taxonomyName, slug, locale);
|
|
2833
|
+
if (!term) {
|
|
2834
|
+
throw new EmDashValidationError(
|
|
2835
|
+
`Unknown taxonomy term: ${taxonomyName}='${slug}'${
|
|
2836
|
+
locale ? ` (locale '${locale}')` : ""
|
|
2837
|
+
}`,
|
|
2838
|
+
);
|
|
2839
|
+
}
|
|
2840
|
+
termIds.push(term.id);
|
|
2841
|
+
}
|
|
1440
2842
|
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
const serialized = typeof value === "object" && value !== null ? JSON.stringify(value) : value;
|
|
1445
|
-
return sql`${sql.ref(key)} = ${serialized}`;
|
|
1446
|
-
});
|
|
2843
|
+
await taxRepo.setTermsForEntry(collection, entryId, taxonomyName, termIds);
|
|
2844
|
+
anyChange = true;
|
|
2845
|
+
}
|
|
1447
2846
|
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
WHERE translation_group = ${translationGroup}
|
|
1452
|
-
AND id != ${updatedItemId}
|
|
1453
|
-
`.execute(trx);
|
|
2847
|
+
// Match the REST route's behaviour: taxonomy term assignments changed,
|
|
2848
|
+
// so invalidate the taxonomy object cache used during hydration.
|
|
2849
|
+
if (anyChange) invalidateTermCache();
|
|
1454
2850
|
}
|