emdash 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-token-CKphU6ur.mjs +26 -0
- package/dist/action-token-CKphU6ur.mjs.map +1 -0
- package/dist/activation-X5iMalte.mjs +387 -0
- package/dist/activation-X5iMalte.mjs.map +1 -0
- package/dist/adapters-DFsc9XjW.d.mts +173 -0
- package/dist/adapters-DFsc9XjW.d.mts.map +1 -0
- package/dist/after-B3AvMfBQ.mjs +50 -0
- package/dist/after-B3AvMfBQ.mjs.map +1 -0
- package/dist/allowed-origins-BFDNF-05.mjs +116 -0
- package/dist/allowed-origins-BFDNF-05.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +7 -65
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +7 -12
- package/dist/api-tokens-B-p5eI6J.mjs +9 -0
- package/dist/api-tokens-B-p5eI6J.mjs.map +1 -0
- package/dist/api-tokens-D27OQ0oQ.mjs +173 -0
- package/dist/api-tokens-D27OQ0oQ.mjs.map +1 -0
- package/dist/apply-Culv7QJl.mjs +1774 -0
- package/dist/apply-Culv7QJl.mjs.map +1 -0
- package/dist/approvals-oLE5G5jw.mjs +460 -0
- package/dist/approvals-oLE5G5jw.mjs.map +1 -0
- package/dist/artifact-fetch-ByK_1pck.mjs +659 -0
- package/dist/artifact-fetch-ByK_1pck.mjs.map +1 -0
- package/dist/artifacts-BXKMIV2F.mjs +323 -0
- package/dist/artifacts-BXKMIV2F.mjs.map +1 -0
- package/dist/astro/index.d.mts +17 -14
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +257 -24
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +15 -12
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +62 -25
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +5 -7
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -1
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +18 -26
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +128 -80
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +15 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +62 -158
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/PluginRegistry.d.mts +1 -5
- package/dist/astro/routes/PluginRegistry.d.mts.map +1 -1
- package/dist/astro/routes/PluginRegistry.mjs +11 -10
- package/dist/astro/routes/PluginRegistry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +3 -18
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +3 -18
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -8
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -9
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +3 -8
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +5 -21
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +5 -21
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +5 -21
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +8 -33
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +8 -33
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +8 -32
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +9 -25
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.mjs +16 -25
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +3 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +5 -23
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/core-update.mjs +160 -10
- package/dist/astro/routes/api/admin/core-update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -8
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +6 -25
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +4 -29
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +5 -36
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +6 -26
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -7
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -7
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +4 -10
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +4 -10
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +3 -87
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -8
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +4 -86
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +5 -86
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +9 -97
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +3 -87
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -8
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +3 -86
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +9 -97
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +3 -86
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +7 -86
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +14 -98
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +6 -10
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +11 -89
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +4 -8
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +8 -87
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +7 -86
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +4 -8
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +3 -86
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -8
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +3 -86
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +1 -5
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +6 -50
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +6 -50
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +8 -52
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +8 -51
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +8 -53
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +8 -53
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +8 -53
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +9 -54
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +9 -53
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +10 -54
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +8 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +9 -54
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +7 -52
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +11 -54
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -6
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -5
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +4 -19
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +11 -10
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +3 -18
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +10 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/handover.mjs +3 -9
- package/dist/astro/routes/api/auth/handover.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +11 -26
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +13 -23
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -23
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +2 -6
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.mjs +15 -26
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +5 -20
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/me.d.mts +3 -1
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +30 -30
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +2 -6
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +6 -14
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +3 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +3 -18
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -26
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -23
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -24
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -26
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +11 -26
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +9 -24
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -5
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -1
- package/dist/astro/routes/api/calendar.mjs +5 -19
- package/dist/astro/routes/api/calendar.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +5 -19
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +8 -26
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -6
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +14 -24
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -6
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +9 -24
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -7
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +2 -13
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -43
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -23
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +5 -45
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +5 -45
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -7
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs +16 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions/editors.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts +2 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +28 -7
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/room.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/room.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/room.mjs +29 -0
- package/dist/astro/routes/api/content/_collection_/_id_/room.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -24
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +32 -38
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -6
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +7 -23
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +28 -52
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -6
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +5 -19
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +4 -19
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +141 -21
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +2 -6
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -1
- package/dist/astro/routes/api/dev/scheduled-tasks.mjs +4 -125
- package/dist/astro/routes/api/dev/scheduled-tasks.mjs.map +1 -1
- package/dist/astro/routes/api/health.mjs +3 -7
- package/dist/astro/routes/api/health.mjs.map +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +4 -3
- package/dist/astro/routes/api/import/probe.d.mts.map +1 -1
- package/dist/astro/routes/api/import/probe.mjs +6 -37
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts +6 -3
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +10 -32
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +32 -14
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +147 -47
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +16 -13
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +11 -27
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +10 -26
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +16 -13
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -39
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +6 -37
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +16 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +189 -61
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.d.mts.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +32 -13
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +130 -126
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +50 -30
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/replace.mjs +5 -20
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -10
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/usage.mjs +6 -38
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +5 -36
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +4 -7
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +52 -13
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/_id_.mjs +5 -20
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/index.mjs +5 -20
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -6
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -6
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/index.mjs +2 -6
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/upload-url.mjs +8 -23
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +20 -43
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -25
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +8 -25
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +8 -25
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +5 -6
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -9
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/code.mjs +6 -13
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/token.mjs +5 -12
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/register.mjs +4 -9
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -9
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -9
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/token.mjs +5 -10
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -1
- package/dist/astro/routes/api/openapi.json.mjs +15 -31
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +2 -13
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +5 -28
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +5 -28
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +6 -29
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +6 -29
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +5 -45
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +5 -45
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -6
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +7 -23
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +5 -87
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +5 -87
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/index.mjs +5 -87
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +5 -87
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +4 -22
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +5 -87
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +3 -86
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +5 -26
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +4 -25
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +5 -26
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +3 -14
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +4 -25
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +5 -25
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +5 -25
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +4 -10
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +3 -10
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/export.mjs +4 -10
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/index.mjs +5 -11
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/domain-notify.d.mts.map +1 -1
- package/dist/astro/routes/api/settings/domain-notify.mjs +14 -14
- package/dist/astro/routes/api/settings/domain-notify.mjs.map +1 -1
- package/dist/astro/routes/api/settings/domain.mjs +8 -27
- package/dist/astro/routes/api/settings/domain.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.d.mts +2 -1
- package/dist/astro/routes/api/settings/email.d.mts.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +124 -16
- package/dist/astro/routes/api/settings/email.mjs.map +1 -1
- package/dist/astro/routes/api/settings.mjs +7 -35
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -29
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +10 -24
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +13 -58
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -6
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +14 -65
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +3 -7
- package/dist/astro/routes/api/setup/status.mjs.map +1 -1
- package/dist/astro/routes/api/site/domain-proof.mjs +2 -21
- package/dist/astro/routes/api/site/domain-proof.mjs.map +1 -1
- package/dist/astro/routes/api/snapshot.mjs +6 -13
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +7 -34
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +7 -34
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +8 -34
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +7 -34
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +5 -32
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +8 -34
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +13 -46
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +8 -34
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +4 -10
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
- package/dist/astro/routes/api/typegen.mjs +3 -7
- package/dist/astro/routes/api/typegen.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/action-token.mjs +3 -10
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +3 -26
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +1 -5
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/auth.d.mts.map +1 -1
- package/dist/astro/routes/api/well-known/auth.mjs +4 -3
- package/dist/astro/routes/api/well-known/auth.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +11 -22
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -27
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -15
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -27
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +2 -6
- package/dist/astro/routes/api/widget-components.mjs.map +1 -1
- package/dist/astro/routes/robots.txt.d.mts.map +1 -1
- package/dist/astro/routes/robots.txt.mjs +6 -24
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +11 -25
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.d.mts.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +5 -23
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +49 -23
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-T3NRtoQ5.mjs +127 -0
- package/dist/audit-T3NRtoQ5.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/auth/providers/microsoft.d.mts +1 -1
- package/dist/authoritative-records-Cd5BVXRs.mjs +5183 -0
- package/dist/authoritative-records-Cd5BVXRs.mjs.map +1 -0
- package/dist/authorize-B-4ogCQG.mjs +74 -0
- package/dist/authorize-B-4ogCQG.mjs.map +1 -0
- package/dist/backup-BQhg3MEK.mjs +246 -0
- package/dist/backup-BQhg3MEK.mjs.map +1 -0
- package/dist/base64-GXviT28w.mjs +63 -0
- package/dist/base64-GXviT28w.mjs.map +1 -0
- package/dist/block-types-BTzqdEZV.mjs +132 -0
- package/dist/block-types-BTzqdEZV.mjs.map +1 -0
- package/dist/block-values-DzZIh7WN.mjs +215 -0
- package/dist/block-values-DzZIh7WN.mjs.map +1 -0
- package/dist/byline--sweE_MZ.mjs +930 -0
- package/dist/byline--sweE_MZ.mjs.map +1 -0
- package/dist/byline-fields-Czdq4Yad.mjs +123 -0
- package/dist/byline-fields-Czdq4Yad.mjs.map +1 -0
- package/dist/byline-registry-Cr7kjrxM.mjs +406 -0
- package/dist/byline-registry-Cr7kjrxM.mjs.map +1 -0
- package/dist/bylines-DnuH3H8z.mjs +234 -0
- package/dist/bylines-DnuH3H8z.mjs.map +1 -0
- package/dist/bylines-txlwgzIK.mjs +150 -0
- package/dist/bylines-txlwgzIK.mjs.map +1 -0
- package/dist/cache-BjnpmIpb.mjs +151 -0
- package/dist/cache-BjnpmIpb.mjs.map +1 -0
- package/dist/canonical-Cb-rJGRU.mjs +174 -0
- package/dist/canonical-Cb-rJGRU.mjs.map +1 -0
- package/dist/capture-triggers-BZmIEdX2.mjs +362 -0
- package/dist/capture-triggers-BZmIEdX2.mjs.map +1 -0
- package/dist/challenge-store-B0PoBBqW.mjs +51 -0
- package/dist/challenge-store-B0PoBBqW.mjs.map +1 -0
- package/dist/checksum-CH9TyM-N.mjs +162 -0
- package/dist/checksum-CH9TyM-N.mjs.map +1 -0
- package/dist/chrome-tags-BocDVqqx.mjs +24 -0
- package/dist/chrome-tags-BocDVqqx.mjs.map +1 -0
- package/dist/chunks-DRnEstVb.mjs +25 -0
- package/dist/chunks-DRnEstVb.mjs.map +1 -0
- package/dist/cli/index.mjs +892 -94
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +97 -97
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +15 -6
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-slugs-cache-CYMrqHZ6.mjs +91 -0
- package/dist/collection-slugs-cache-CYMrqHZ6.mjs.map +1 -0
- package/dist/comment-BGeXmJ8F.mjs +335 -0
- package/dist/comment-BGeXmJ8F.mjs.map +1 -0
- package/dist/comment-reaction-ty-JEDYR.mjs +85 -0
- package/dist/comment-reaction-ty-JEDYR.mjs.map +1 -0
- package/dist/comments-ByrrLvZL.mjs +99 -0
- package/dist/comments-ByrrLvZL.mjs.map +1 -0
- package/dist/comments-DqhARoef.mjs +195 -0
- package/dist/comments-DqhARoef.mjs.map +1 -0
- package/dist/components-u2HE5Mu9.mjs +112 -0
- package/dist/components-u2HE5Mu9.mjs.map +1 -0
- package/dist/config-B4F2ttAZ.d.mts +7230 -0
- package/dist/config-B4F2ttAZ.d.mts.map +1 -0
- package/dist/config-BnrtMvHW.mjs +228 -0
- package/dist/config-BnrtMvHW.mjs.map +1 -0
- package/dist/config-DEse9gaE.d.mts +41 -0
- package/dist/config-DEse9gaE.d.mts.map +1 -0
- package/dist/connection-BaIVuaDX.mjs +36 -0
- package/dist/connection-BaIVuaDX.mjs.map +1 -0
- package/dist/content-Dxztag5t.mjs +2270 -0
- package/dist/content-Dxztag5t.mjs.map +1 -0
- package/dist/content-list-query-yYbBU-dB.d.mts +26 -0
- package/dist/content-list-query-yYbBU-dB.d.mts.map +1 -0
- package/dist/content-policy-Drm9sqdA.mjs +68 -0
- package/dist/content-policy-Drm9sqdA.mjs.map +1 -0
- package/dist/content-repair-2PdahlgZ.mjs +443 -0
- package/dist/content-repair-2PdahlgZ.mjs.map +1 -0
- package/dist/content-save-KMll0S7E.mjs +202 -0
- package/dist/content-save-KMll0S7E.mjs.map +1 -0
- package/dist/context-C3OZjexd.mjs +2225 -0
- package/dist/context-C3OZjexd.mjs.map +1 -0
- package/dist/credits-C8uXoWfN.mjs +110 -0
- package/dist/credits-C8uXoWfN.mjs.map +1 -0
- package/dist/cron-CrjBjDuy.mjs +310 -0
- package/dist/cron-CrjBjDuy.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -4
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +2 -7
- package/dist/db/libsql-migrations.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +2 -7
- package/dist/db/postgres-migrations.mjs.map +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +2 -7
- package/dist/db/sqlite-migrations.mjs.map +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/default-DPoN3H5H.mjs +81 -0
- package/dist/default-DPoN3H5H.mjs.map +1 -0
- package/dist/deferred-tasks-uSx5qCFn.d.mts +10 -0
- package/dist/deferred-tasks-uSx5qCFn.d.mts.map +1 -0
- package/dist/deferred-tasks-yv85msJv.mjs +52 -0
- package/dist/deferred-tasks-yv85msJv.mjs.map +1 -0
- package/dist/destination-BNL1K7Mz.mjs +18 -0
- package/dist/destination-BNL1K7Mz.mjs.map +1 -0
- package/dist/dev-typegen-BVQAguf4.mjs +29 -0
- package/dist/dev-typegen-BVQAguf4.mjs.map +1 -0
- package/dist/device-flow-hT8lKWXq.mjs +519 -0
- package/dist/device-flow-hT8lKWXq.mjs.map +1 -0
- package/dist/dialect-helpers-DqUMP9fJ.mjs +350 -0
- package/dist/dialect-helpers-DqUMP9fJ.mjs.map +1 -0
- package/dist/digest-xYRiuW_E.mjs +194 -0
- package/dist/digest-xYRiuW_E.mjs.map +1 -0
- package/dist/direct-executor-CZ2SH1bq.mjs +117 -0
- package/dist/direct-executor-CZ2SH1bq.mjs.map +1 -0
- package/dist/dist-kxThYgdL.mjs +810 -0
- package/dist/dist-kxThYgdL.mjs.map +1 -0
- package/dist/email-console-CochjAlh.mjs +50 -0
- package/dist/email-console-CochjAlh.mjs.map +1 -0
- package/dist/email-locale-BoxaIPG8.mjs +25 -0
- package/dist/email-locale-BoxaIPG8.mjs.map +1 -0
- package/dist/email-smtp-BnHR_Ccx.mjs +643 -0
- package/dist/email-smtp-BnHR_Ccx.mjs.map +1 -0
- package/dist/emdash-runtime-CXsdCQnM.mjs +5262 -0
- package/dist/emdash-runtime-CXsdCQnM.mjs.map +1 -0
- package/dist/enrich-BReo_COC.mjs +203 -0
- package/dist/enrich-BReo_COC.mjs.map +1 -0
- package/dist/entry-lock-BfnhlRhC.mjs +207 -0
- package/dist/entry-lock-BfnhlRhC.mjs.map +1 -0
- package/dist/entry-lock-DsVhZcJN.mjs +1228 -0
- package/dist/entry-lock-DsVhZcJN.mjs.map +1 -0
- package/dist/entry-locks-D_kjygT1.mjs +173 -0
- package/dist/entry-locks-D_kjygT1.mjs.map +1 -0
- package/dist/env-types-CXI9uaMU.mjs +38 -0
- package/dist/env-types-CXI9uaMU.mjs.map +1 -0
- package/dist/error-DcDNU7hZ.mjs +92 -0
- package/dist/error-DcDNU7hZ.mjs.map +1 -0
- package/dist/errors-BYdjOimY.mjs +18 -0
- package/dist/errors-BYdjOimY.mjs.map +1 -0
- package/dist/errors-CJ6711al.mjs +120 -0
- package/dist/errors-CJ6711al.mjs.map +1 -0
- package/dist/errors-CwYHYcWF.mjs +502 -0
- package/dist/errors-CwYHYcWF.mjs.map +1 -0
- package/dist/escape-YSAGQRHa.mjs +9 -0
- package/dist/escape-YSAGQRHa.mjs.map +1 -0
- package/dist/fence-C3MLClBo.mjs +162 -0
- package/dist/fence-C3MLClBo.mjs.map +1 -0
- package/dist/field-defs-cache-Cpk0eFsQ.mjs +79 -0
- package/dist/field-defs-cache-Cpk0eFsQ.mjs.map +1 -0
- package/dist/field-map-6o9hPcRl.mjs +84 -0
- package/dist/field-map-6o9hPcRl.mjs.map +1 -0
- package/dist/focal-point-Cup37tLI.mjs +23 -0
- package/dist/focal-point-Cup37tLI.mjs.map +1 -0
- package/dist/fts-manager-B3iLXCGz.mjs +500 -0
- package/dist/fts-manager-B3iLXCGz.mjs.map +1 -0
- package/dist/gc-D24C-KP7.mjs +62 -0
- package/dist/gc-D24C-KP7.mjs.map +1 -0
- package/dist/hash-SY9Nq5FH.mjs +37 -0
- package/dist/hash-SY9Nq5FH.mjs.map +1 -0
- package/dist/hook-result-BU5rI-6M.d.mts +31 -0
- package/dist/hook-result-BU5rI-6M.d.mts.map +1 -0
- package/dist/hook-result-CO4E3zDv.mjs +3854 -0
- package/dist/hook-result-CO4E3zDv.mjs.map +1 -0
- package/dist/hreflang-Bzvlo9Ci.mjs +105 -0
- package/dist/hreflang-Bzvlo9Ci.mjs.map +1 -0
- package/dist/hreflang-Ds0WbBOu.d.mts +51 -0
- package/dist/hreflang-Ds0WbBOu.d.mts.map +1 -0
- package/dist/http-route-dispatch-BsjkWBZF.mjs +348 -0
- package/dist/http-route-dispatch-BsjkWBZF.mjs.map +1 -0
- package/dist/identity-CahxkBZC.mjs +35 -0
- package/dist/identity-CahxkBZC.mjs.map +1 -0
- package/dist/index-BauU0yTw.d.mts +261 -0
- package/dist/index-BauU0yTw.d.mts.map +1 -0
- package/dist/index.d.mts +26 -24
- package/dist/index.mjs +2111 -121
- package/dist/index.mjs.map +1 -0
- package/dist/init-lock-Dn7efXfy.mjs +56 -0
- package/dist/init-lock-Dn7efXfy.mjs.map +1 -0
- package/dist/install-finalization-CIl610wT.mjs +58 -0
- package/dist/install-finalization-CIl610wT.mjs.map +1 -0
- package/dist/json-recordset-CrS6ZqMk.mjs +12 -0
- package/dist/json-recordset-CrS6ZqMk.mjs.map +1 -0
- package/dist/json-schema-CBcJlGcY.mjs +15 -0
- package/dist/json-schema-CBcJlGcY.mjs.map +1 -0
- package/dist/keys-DJ62Wt5b.mjs +61 -0
- package/dist/keys-DJ62Wt5b.mjs.map +1 -0
- package/dist/kinds-D7_f3Qu3.mjs +974 -0
- package/dist/kinds-D7_f3Qu3.mjs.map +1 -0
- package/dist/lifecycle-DPCkpFHV.mjs +49 -0
- package/dist/lifecycle-DPCkpFHV.mjs.map +1 -0
- package/dist/limits-Bv6mXNM-.mjs +44 -0
- package/dist/limits-Bv6mXNM-.mjs.map +1 -0
- package/dist/load-r9P0fsRH.mjs +36 -0
- package/dist/load-r9P0fsRH.mjs.map +1 -0
- package/dist/loader-CSEfTKzr.mjs +1537 -0
- package/dist/loader-CSEfTKzr.mjs.map +1 -0
- package/dist/loops-BxzrcxPO.mjs +217 -0
- package/dist/loops-BxzrcxPO.mjs.map +1 -0
- package/dist/manifest-builder-BLWqITXR.mjs +196 -0
- package/dist/manifest-builder-BLWqITXR.mjs.map +1 -0
- package/dist/manifest-schema-BRpk5V7x.mjs +497 -0
- package/dist/manifest-schema-BRpk5V7x.mjs.map +1 -0
- package/dist/marketplace-5YFgYPVr.mjs +257 -0
- package/dist/marketplace-5YFgYPVr.mjs.map +1 -0
- package/dist/marketplace-zPVE4UY5.mjs +965 -0
- package/dist/marketplace-zPVE4UY5.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts.map +1 -1
- package/dist/media/image-endpoint.mjs +2 -1
- package/dist/media/image-endpoint.mjs.map +1 -1
- package/dist/media/index.d.mts +10 -5
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +4 -4
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +17 -14
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +3 -20
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-C5fg1Xte.d.mts +203 -0
- package/dist/media-C5fg1Xte.d.mts.map +1 -0
- package/dist/media-CPETKjop.mjs +424 -0
- package/dist/media-CPETKjop.mjs.map +1 -0
- package/dist/media-Cid3xIHk.mjs +294 -0
- package/dist/media-Cid3xIHk.mjs.map +1 -0
- package/dist/media-DJaAAYI2.mjs +2805 -0
- package/dist/media-DJaAAYI2.mjs.map +1 -0
- package/dist/media-allowlist-B7JwNf-U.mjs +75 -0
- package/dist/media-allowlist-B7JwNf-U.mjs.map +1 -0
- package/dist/media-folders-BI7B7XUM.mjs +210 -0
- package/dist/media-folders-BI7B7XUM.mjs.map +1 -0
- package/dist/media-url-xWuPVfqO.mjs +43 -0
- package/dist/media-url-xWuPVfqO.mjs.map +1 -0
- package/dist/media-usage-SwtWPxy4.mjs +282 -0
- package/dist/media-usage-SwtWPxy4.mjs.map +1 -0
- package/dist/media-usage-activation-BTa1H4wE.mjs +78 -0
- package/dist/media-usage-activation-BTa1H4wE.mjs.map +1 -0
- package/dist/media-usage-work-BxHWfbKq.mjs +1036 -0
- package/dist/media-usage-work-BxHWfbKq.mjs.map +1 -0
- package/dist/media-usage-work-DYenZS8y.mjs +151 -0
- package/dist/media-usage-work-DYenZS8y.mjs.map +1 -0
- package/dist/menu-FtSf33fF.mjs +420 -0
- package/dist/menu-FtSf33fF.mjs.map +1 -0
- package/dist/menus--MSfZ5Eu.mjs +433 -0
- package/dist/menus--MSfZ5Eu.mjs.map +1 -0
- package/dist/menus-C8h6Jtpu.mjs +92 -0
- package/dist/menus-C8h6Jtpu.mjs.map +1 -0
- package/dist/menus-CpFAi_LK.mjs +434 -0
- package/dist/menus-CpFAi_LK.mjs.map +1 -0
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +2 -6
- package/dist/mime-Dx6aHTsR.mjs +82 -0
- package/dist/mime-Dx6aHTsR.mjs.map +1 -0
- package/dist/mode-D6Qg_-2J.mjs +23 -0
- package/dist/mode-D6Qg_-2J.mjs.map +1 -0
- package/dist/node-sqlite-compat-DvYkqx7Q.mjs +63 -0
- package/dist/node-sqlite-compat-DvYkqx7Q.mjs.map +1 -0
- package/dist/normalize-qcU0SKGf.mjs +220 -0
- package/dist/normalize-qcU0SKGf.mjs.map +1 -0
- package/dist/oauth-authorization-CBxtOboy.mjs +287 -0
- package/dist/oauth-authorization-CBxtOboy.mjs.map +1 -0
- package/dist/oauth-clients-HLGHmHqI.mjs +266 -0
- package/dist/oauth-clients-HLGHmHqI.mjs.map +1 -0
- package/dist/oauth-state-store-B4YAveSb.mjs +80 -0
- package/dist/oauth-state-store-B4YAveSb.mjs.map +1 -0
- package/dist/oauth-user-lookup-CTYMaKlq.mjs +26 -0
- package/dist/oauth-user-lookup-CTYMaKlq.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/object-cache-DeATK4vw.mjs +805 -0
- package/dist/object-cache-DeATK4vw.mjs.map +1 -0
- package/dist/options-BJZMHnpx.d.mts +81 -0
- package/dist/options-BJZMHnpx.d.mts.map +1 -0
- package/dist/options-CMocxAku.mjs +208 -0
- package/dist/options-CMocxAku.mjs.map +1 -0
- package/dist/ownership-46c5NS0I.mjs +12 -0
- package/dist/ownership-46c5NS0I.mjs.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +23 -27
- package/dist/page/index.mjs.map +1 -1
- package/dist/parse-B1E5cdyD.mjs +82 -0
- package/dist/parse-B1E5cdyD.mjs.map +1 -0
- package/dist/parse-Clt6wmpy.d.mts +178 -0
- package/dist/parse-Clt6wmpy.d.mts.map +1 -0
- package/dist/parts-CMwESQ6e.mjs +68 -0
- package/dist/parts-CMwESQ6e.mjs.map +1 -0
- package/dist/passkey-config-DiVZI-cx.mjs +46 -0
- package/dist/passkey-config-DiVZI-cx.mjs.map +1 -0
- package/dist/paths-NrYImb_h.mjs +77 -0
- package/dist/paths-NrYImb_h.mjs.map +1 -0
- package/dist/patterns-BxMSQThP.mjs +174 -0
- package/dist/patterns-BxMSQThP.mjs.map +1 -0
- package/dist/placeholder-B0vI-EQ9.d.mts +316 -0
- package/dist/placeholder-B0vI-EQ9.d.mts.map +1 -0
- package/dist/plan-CSb3BdFS.mjs +135 -0
- package/dist/plan-CSb3BdFS.mjs.map +1 -0
- package/dist/plugin-settings-HdYYRFi3.mjs +162 -0
- package/dist/plugin-settings-HdYYRFi3.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +24 -15
- package/dist/plugin-test-runtime.d.mts.map +1 -1
- package/dist/plugin-test-runtime.mjs +11 -127
- package/dist/plugin-tool-name-CCXxYq3K.mjs +27 -0
- package/dist/plugin-tool-name-CCXxYq3K.mjs.map +1 -0
- package/dist/plugin-types.d.mts +2 -2
- package/dist/plugin-utils.d.mts +15 -12
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +15 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +6 -4
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/plugins/host.d.mts +13 -6
- package/dist/plugins/host.d.mts.map +1 -0
- package/dist/plugins/host.mjs +10 -63
- package/dist/plugins-Bc70Xs37.mjs +261 -0
- package/dist/plugins-Bc70Xs37.mjs.map +1 -0
- package/dist/policy-C-ngDrxa.mjs +56 -0
- package/dist/policy-C-ngDrxa.mjs.map +1 -0
- package/dist/portable-text-T17rOqF7.mjs +454 -0
- package/dist/portable-text-T17rOqF7.mjs.map +1 -0
- package/dist/protocol-CmSX4cXv.d.mts +65 -0
- package/dist/protocol-CmSX4cXv.d.mts.map +1 -0
- package/dist/public-plugin-api-routes-_xsWTlwE.mjs +316 -0
- package/dist/public-plugin-api-routes-_xsWTlwE.mjs.map +1 -0
- package/dist/public-submission-ui3pFYtq.mjs +253 -0
- package/dist/public-submission-ui3pFYtq.mjs.map +1 -0
- package/dist/public-url-DMRZPAiW.mjs +123 -0
- package/dist/public-url-DMRZPAiW.mjs.map +1 -0
- package/dist/query-C1K9PzUc.mjs +41 -0
- package/dist/query-C1K9PzUc.mjs.map +1 -0
- package/dist/query-DdmHrvie.mjs +1201 -0
- package/dist/query-DdmHrvie.mjs.map +1 -0
- package/dist/query-EVjg8-Bq.mjs +37 -0
- package/dist/query-EVjg8-Bq.mjs.map +1 -0
- package/dist/range-BaF0521t.mjs +51 -0
- package/dist/range-BaF0521t.mjs.map +1 -0
- package/dist/rate-limit-6MngP0_m.mjs +127 -0
- package/dist/rate-limit-6MngP0_m.mjs.map +1 -0
- package/dist/receipt-BFm5eaN7.mjs +43 -0
- package/dist/receipt-BFm5eaN7.mjs.map +1 -0
- package/dist/redirect-ChcHI1KC.mjs +466 -0
- package/dist/redirect-ChcHI1KC.mjs.map +1 -0
- package/dist/redirect-EpidEf_5.mjs +19 -0
- package/dist/redirect-EpidEf_5.mjs.map +1 -0
- package/dist/redirect-paths-B9cXh9Wv.mjs +36 -0
- package/dist/redirect-paths-B9cXh9Wv.mjs.map +1 -0
- package/dist/redirects-D3zHoxhn.mjs +446 -0
- package/dist/redirects-D3zHoxhn.mjs.map +1 -0
- package/dist/redirects-dFPJ0HrD.mjs +148 -0
- package/dist/redirects-dFPJ0HrD.mjs.map +1 -0
- package/dist/registry/testing.mjs +2 -3
- package/dist/registry/testing.mjs.map +1 -1
- package/dist/registry-CDzYrAFY.mjs +6074 -0
- package/dist/registry-CDzYrAFY.mjs.map +1 -0
- package/dist/registry-Cf9vkVxW.mjs +1449 -0
- package/dist/registry-Cf9vkVxW.mjs.map +1 -0
- package/dist/registry-mZi_lxtT.mjs +755 -0
- package/dist/registry-mZi_lxtT.mjs.map +1 -0
- package/dist/relations-Eyop_U4o.mjs +798 -0
- package/dist/relations-Eyop_U4o.mjs.map +1 -0
- package/dist/request-cache-BYMs-BGX.mjs +104 -0
- package/dist/request-cache-BYMs-BGX.mjs.map +1 -0
- package/dist/request-context.d.mts +16 -3
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs +22 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/request-meta-DsSkOdO0.mjs +141 -0
- package/dist/request-meta-DsSkOdO0.mjs.map +1 -0
- package/dist/resolve-Z5YK_6ew.mjs +199 -0
- package/dist/resolve-Z5YK_6ew.mjs.map +1 -0
- package/dist/resolve-s7ANHtFx.mjs +92 -0
- package/dist/resolve-s7ANHtFx.mjs.map +1 -0
- package/dist/rev-B6HS7337.mjs +50 -0
- package/dist/rev-B6HS7337.mjs.map +1 -0
- package/dist/revision-D7EedSdU.mjs +503 -0
- package/dist/revision-D7EedSdU.mjs.map +1 -0
- package/dist/rooms/index.d.mts +48 -0
- package/dist/rooms/index.d.mts.map +1 -0
- package/dist/rooms/index.mjs +6 -0
- package/dist/rooms/node/index.d.mts +25 -0
- package/dist/rooms/node/index.d.mts.map +1 -0
- package/dist/rooms/node/index.mjs +583 -0
- package/dist/rooms/node/index.mjs.map +1 -0
- package/dist/rooms/notifications.d.mts +47 -0
- package/dist/rooms/notifications.d.mts.map +1 -0
- package/dist/rooms/notifications.mjs +125 -0
- package/dist/rooms/notifications.mjs.map +1 -0
- package/dist/rooms/room.d.mts +76 -0
- package/dist/rooms/room.d.mts.map +1 -0
- package/dist/rooms/room.mjs +1257 -0
- package/dist/rooms/room.mjs.map +1 -0
- package/dist/rooms/site.d.mts +23 -0
- package/dist/rooms/site.d.mts.map +1 -0
- package/dist/rooms/site.mjs +146 -0
- package/dist/rooms/site.mjs.map +1 -0
- package/dist/rooms-CSNLTJsG.mjs +331 -0
- package/dist/rooms-CSNLTJsG.mjs.map +1 -0
- package/dist/rooms-CVsLla78.mjs +169 -0
- package/dist/rooms-CVsLla78.mjs.map +1 -0
- package/dist/rooms-CyXG83RZ.d.mts +4653 -0
- package/dist/rooms-CyXG83RZ.d.mts.map +1 -0
- package/dist/route-cache-CBpXPq-N.mjs +30 -0
- package/dist/route-cache-CBpXPq-N.mjs.map +1 -0
- package/dist/route-cache-DkhMwAIC.mjs +20 -0
- package/dist/route-cache-DkhMwAIC.mjs.map +1 -0
- package/dist/route-wire-DKSTaEz_.mjs +197 -0
- package/dist/route-wire-DKSTaEz_.mjs.map +1 -0
- package/dist/routes-QcHRiebw.mjs +272 -0
- package/dist/routes-QcHRiebw.mjs.map +1 -0
- package/dist/runner-4BfB04Rg.mjs +6950 -0
- package/dist/runner-4BfB04Rg.mjs.map +1 -0
- package/dist/runner-CAHS_KER.d.mts +79 -0
- package/dist/runner-CAHS_KER.d.mts.map +1 -0
- package/dist/runtime-holder-0g6pqbzx.mjs +36 -0
- package/dist/runtime-holder-0g6pqbzx.mjs.map +1 -0
- package/dist/runtime.d.mts +16 -13
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +1 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scheduler-health-C5HEg2Yl.mjs +31 -0
- package/dist/scheduler-health-C5HEg2Yl.mjs.map +1 -0
- package/dist/schema/project-env-types.mjs +7 -55
- package/dist/schema/project-env-types.mjs.map +1 -1
- package/dist/schema-DS7ooMmp.mjs +13 -0
- package/dist/schema-DS7ooMmp.mjs.map +1 -0
- package/dist/schema-Mjtj7n1t.mjs +815 -0
- package/dist/schema-Mjtj7n1t.mjs.map +1 -0
- package/dist/scopes-BaR6WUyq.mjs +34 -0
- package/dist/scopes-BaR6WUyq.mjs.map +1 -0
- package/dist/search-B9RFgr0N.mjs +450 -0
- package/dist/search-B9RFgr0N.mjs.map +1 -0
- package/dist/secrets-C4UrjPiG.mjs +369 -0
- package/dist/secrets-C4UrjPiG.mjs.map +1 -0
- package/dist/sections-Bfa0oF8Q.mjs +129 -0
- package/dist/sections-Bfa0oF8Q.mjs.map +1 -0
- package/dist/sections-Bn2C6we7.mjs +222 -0
- package/dist/sections-Bn2C6we7.mjs.map +1 -0
- package/dist/seed/index.d.mts +3 -3
- package/dist/seed/index.mjs +6 -54
- package/dist/seo/index.d.mts +8 -6
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +10 -41
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-DPW6k5_-.mjs +188 -0
- package/dist/seo-DPW6k5_-.mjs.map +1 -0
- package/dist/service-B4mHMku9.mjs +150 -0
- package/dist/service-B4mHMku9.mjs.map +1 -0
- package/dist/session-user-CF2jNfj7.mjs +61 -0
- package/dist/session-user-CF2jNfj7.mjs.map +1 -0
- package/dist/settings-4r88LLIM.mjs +66 -0
- package/dist/settings-4r88LLIM.mjs.map +1 -0
- package/dist/settings-BB2xxz3Y.mjs +74 -0
- package/dist/settings-BB2xxz3Y.mjs.map +1 -0
- package/dist/settings-BTkGl-bX.mjs +413 -0
- package/dist/settings-BTkGl-bX.mjs.map +1 -0
- package/dist/settings-y8Jx8b7g.mjs +157 -0
- package/dist/settings-y8Jx8b7g.mjs.map +1 -0
- package/dist/setup-complete-BGRiC59t.mjs +65 -0
- package/dist/setup-complete-BGRiC59t.mjs.map +1 -0
- package/dist/setup-nonce-D43FsOgZ.mjs +25 -0
- package/dist/setup-nonce-D43FsOgZ.mjs.map +1 -0
- package/dist/single-flight-cache-BCP1Tvcm.mjs +104 -0
- package/dist/single-flight-cache-BCP1Tvcm.mjs.map +1 -0
- package/dist/site-domain-CFX7g6ik.mjs +131 -0
- package/dist/site-domain-CFX7g6ik.mjs.map +1 -0
- package/dist/site-settings-C0D9fv7e.mjs +50 -0
- package/dist/site-settings-C0D9fv7e.mjs.map +1 -0
- package/dist/site-title-C0JVN6en.mjs +14 -0
- package/dist/site-title-C0JVN6en.mjs.map +1 -0
- package/dist/site-url-DzVnHJ8j.mjs +45 -0
- package/dist/site-url-DzVnHJ8j.mjs.map +1 -0
- package/dist/sitemap-name-Ja_Cvwx9.mjs +26 -0
- package/dist/sitemap-name-Ja_Cvwx9.mjs.map +1 -0
- package/dist/slug-CO2jtUda.mjs +16 -0
- package/dist/slug-CO2jtUda.mjs.map +1 -0
- package/dist/slugify-sxuydlHd.mjs +22 -0
- package/dist/slugify-sxuydlHd.mjs.map +1 -0
- package/dist/snapshot-C9OWUtFr.mjs +466 -0
- package/dist/snapshot-C9OWUtFr.mjs.map +1 -0
- package/dist/snapshot-CR5tan8p.mjs +184 -0
- package/dist/snapshot-CR5tan8p.mjs.map +1 -0
- package/dist/ssrf-Lj1KZxYt.mjs +406 -0
- package/dist/ssrf-Lj1KZxYt.mjs.map +1 -0
- package/dist/stage-ChbGIslu.mjs +662 -0
- package/dist/stage-ChbGIslu.mjs.map +1 -0
- package/dist/staged-BN8pRZwX.mjs +686 -0
- package/dist/staged-BN8pRZwX.mjs.map +1 -0
- package/dist/state-DtcE0eN3.mjs +178 -0
- package/dist/state-DtcE0eN3.mjs.map +1 -0
- package/dist/status-vvme29qV.mjs +30 -0
- package/dist/status-vvme29qV.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage-query-BDUX3Cef.d.mts +1608 -0
- package/dist/storage-query-BDUX3Cef.d.mts.map +1 -0
- package/dist/tar-CAvEHFbE.mjs +449 -0
- package/dist/tar-CAvEHFbE.mjs.map +1 -0
- package/dist/target-BM_6fT9m.mjs +27 -0
- package/dist/target-BM_6fT9m.mjs.map +1 -0
- package/dist/taxonomies-BMuFLd53.mjs +722 -0
- package/dist/taxonomies-BMuFLd53.mjs.map +1 -0
- package/dist/taxonomies-ClkYcmcH.mjs +937 -0
- package/dist/taxonomies-ClkYcmcH.mjs.map +1 -0
- package/dist/taxonomy-s1GcBCRo.mjs +593 -0
- package/dist/taxonomy-s1GcBCRo.mjs.map +1 -0
- package/dist/tokens-Cpm6FIKJ.mjs +171 -0
- package/dist/tokens-Cpm6FIKJ.mjs.map +1 -0
- package/dist/transaction-SKrr6u84.mjs +44 -0
- package/dist/transaction-SKrr6u84.mjs.map +1 -0
- package/dist/transfer-B3CsI5MG.mjs +8963 -0
- package/dist/transfer-B3CsI5MG.mjs.map +1 -0
- package/dist/transfer-DqUiK3ca.mjs +166 -0
- package/dist/transfer-DqUiK3ca.mjs.map +1 -0
- package/dist/transfer-download-CWPfhL91.mjs +33 -0
- package/dist/transfer-download-CWPfhL91.mjs.map +1 -0
- package/dist/transformations-ClH4dJeM.mjs +196 -0
- package/dist/transformations-ClH4dJeM.mjs.map +1 -0
- package/dist/transport-C6Ps8ejN.mjs +144 -0
- package/dist/transport-C6Ps8ejN.mjs.map +1 -0
- package/dist/transport-D4hWYmO_.d.mts +42 -0
- package/dist/transport-D4hWYmO_.d.mts.map +1 -0
- package/dist/trusted-proxy-CWX1sqgb.mjs +51 -0
- package/dist/trusted-proxy-CWX1sqgb.mjs.map +1 -0
- package/dist/turnstile-B6zM50Mh.mjs +58 -0
- package/dist/turnstile-B6zM50Mh.mjs.map +1 -0
- package/dist/types-BBH-w_KS.mjs +133 -0
- package/dist/types-BBH-w_KS.mjs.map +1 -0
- package/dist/types-Ba3bWb9D.mjs +37 -0
- package/dist/types-Ba3bWb9D.mjs.map +1 -0
- package/dist/types-BmBK2cqf.mjs +201 -0
- package/dist/types-BmBK2cqf.mjs.map +1 -0
- package/dist/types-C0M6z2A4.mjs +16 -0
- package/dist/types-C0M6z2A4.mjs.map +1 -0
- package/dist/types-CG1dR_Cm.d.mts +934 -0
- package/dist/types-CG1dR_Cm.d.mts.map +1 -0
- package/dist/types-CImd8MBY.d.mts +1756 -0
- package/dist/types-CImd8MBY.d.mts.map +1 -0
- package/dist/types-CML-oGr6.d.mts +293 -0
- package/dist/types-CML-oGr6.d.mts.map +1 -0
- package/dist/types-CZO9f_vJ.d.mts +381 -0
- package/dist/types-CZO9f_vJ.d.mts.map +1 -0
- package/dist/types-CpFfDrGH.mjs +18 -0
- package/dist/types-CpFfDrGH.mjs.map +1 -0
- package/dist/types-D2zSjG0c.mjs +63 -0
- package/dist/types-D2zSjG0c.mjs.map +1 -0
- package/dist/types-DLKviL1s.d.mts +93 -0
- package/dist/types-DLKviL1s.d.mts.map +1 -0
- package/dist/types-Df0R58Wu.mjs +77 -0
- package/dist/types-Df0R58Wu.mjs.map +1 -0
- package/dist/types-DwNwhyWP.d.mts +227 -0
- package/dist/types-DwNwhyWP.d.mts.map +1 -0
- package/dist/types-DwZgl0Zn.d.mts +366 -0
- package/dist/types-DwZgl0Zn.d.mts.map +1 -0
- package/dist/types-Dyb_OuSw.d.mts +125 -0
- package/dist/types-Dyb_OuSw.d.mts.map +1 -0
- package/dist/types-iOnPkHRk.d.mts +209 -0
- package/dist/types-iOnPkHRk.d.mts.map +1 -0
- package/dist/ui-comments.d.mts +66 -0
- package/dist/ui-search.d.mts +75 -0
- package/dist/ui-webmcp-search.d.mts +29 -0
- package/dist/ui.d.mts +576 -0
- package/dist/upload-attempts-5Ot7-vsw.mjs +32 -0
- package/dist/upload-attempts-5Ot7-vsw.mjs.map +1 -0
- package/dist/url-BVdd-tah.mjs +104 -0
- package/dist/url-BVdd-tah.mjs.map +1 -0
- package/dist/url-ZCjpMO-q.mjs +74 -0
- package/dist/url-ZCjpMO-q.mjs.map +1 -0
- package/dist/url-pattern-BQT-sGmD.mjs +41 -0
- package/dist/url-pattern-BQT-sGmD.mjs.map +1 -0
- package/dist/urls-Cq_hUk4P.mjs +79 -0
- package/dist/urls-Cq_hUk4P.mjs.map +1 -0
- package/dist/user-C4km6fox.mjs +184 -0
- package/dist/user-C4km6fox.mjs.map +1 -0
- package/dist/utils-Cpo0_V09.d.mts +374 -0
- package/dist/utils-Cpo0_V09.d.mts.map +1 -0
- package/dist/utils-DMDmdhU3.mjs +450 -0
- package/dist/utils-DMDmdhU3.mjs.map +1 -0
- package/dist/validate-BNupiQtz.mjs +524 -0
- package/dist/validate-BNupiQtz.mjs.map +1 -0
- package/dist/validate-DBfkJa3O.d.mts +472 -0
- package/dist/validate-DBfkJa3O.d.mts.map +1 -0
- package/dist/validation-W_efZFgP.mjs +204 -0
- package/dist/validation-W_efZFgP.mjs.map +1 -0
- package/dist/version-C61rw8-y.mjs +9 -0
- package/dist/version-C61rw8-y.mjs.map +1 -0
- package/dist/version-DhGLeLRo.mjs +7 -0
- package/dist/version-DhGLeLRo.mjs.map +1 -0
- package/dist/version-eqLBDtcz.mjs +49 -0
- package/dist/version-eqLBDtcz.mjs.map +1 -0
- package/dist/video-My3h7vwE.mjs +18 -0
- package/dist/video-My3h7vwE.mjs.map +1 -0
- package/dist/virtual-modules-BZKqvjRC.mjs +568 -0
- package/dist/virtual-modules-BZKqvjRC.mjs.map +1 -0
- package/dist/widgets-DAdni19y.mjs +134 -0
- package/dist/widgets-DAdni19y.mjs.map +1 -0
- package/dist/wxr-DDPJOgkM.mjs +1054 -0
- package/dist/wxr-DDPJOgkM.mjs.map +1 -0
- package/dist/wxr-taxonomies-B0U2fJgs.mjs +735 -0
- package/dist/wxr-taxonomies-B0U2fJgs.mjs.map +1 -0
- package/dist/wxr-taxonomies-CyP2k4-Q.d.mts +34 -0
- package/dist/wxr-taxonomies-CyP2k4-Q.d.mts.map +1 -0
- package/dist/zod-generator-ChRSYUix.mjs +425 -0
- package/dist/zod-generator-ChRSYUix.mjs.map +1 -0
- package/package.json +81 -33
- package/src/api/content-save.ts +281 -0
- package/src/api/error.ts +6 -2
- package/src/api/errors.ts +11 -0
- package/src/api/handlers/content.ts +92 -26
- package/src/api/handlers/device-flow.ts +1 -3
- package/src/api/handlers/entry-lock.ts +69 -14
- package/src/api/handlers/marketplace.ts +8 -2
- package/src/api/handlers/media-allowlist.ts +56 -0
- package/src/api/handlers/media-upload.ts +9 -1
- package/src/api/handlers/menus.ts +3 -3
- package/src/api/handlers/oauth-authorization.ts +1 -3
- package/src/api/handlers/plugins.ts +4 -4
- package/src/api/handlers/registry.ts +33 -21
- package/src/api/handlers/relations.ts +20 -4
- package/src/api/handlers/revision.ts +29 -0
- package/src/api/handlers/rooms.ts +233 -0
- package/src/api/handlers/site-domain.ts +1 -1
- package/src/api/handlers/snapshot.ts +90 -30
- package/src/api/handlers/staged-references.ts +14 -0
- package/src/api/list-preconditions.ts +101 -0
- package/src/api/openapi/document.ts +5 -5
- package/src/api/parse.ts +3 -2
- package/src/api/public-url.ts +21 -0
- package/src/api/schemas/auth.ts +57 -1
- package/src/api/schemas/content.ts +14 -0
- package/src/api/schemas/entry-lock.ts +6 -1
- package/src/api/schemas/import.ts +6 -0
- package/src/api/schemas/index.ts +1 -0
- package/src/api/schemas/media.ts +20 -0
- package/src/api/schemas/rooms.ts +27 -0
- package/src/api/schemas/schema.ts +9 -1
- package/src/api/schemas/settings.ts +2 -0
- package/src/api/site-title.ts +13 -0
- package/src/api/types.ts +3 -0
- package/src/astro/integration/admin-nav.ts +52 -0
- package/src/astro/integration/index.ts +26 -5
- package/src/astro/integration/routes.ts +15 -5
- package/src/astro/integration/runtime.ts +46 -0
- package/src/astro/integration/shims/use-sync-external-store-with-selector.js +2 -0
- package/src/astro/integration/shims/use-sync-external-store.js +4 -1
- package/src/astro/integration/virtual-modules.ts +80 -17
- package/src/astro/integration/vite-config.ts +136 -0
- package/src/astro/middleware/auth.ts +53 -18
- package/src/astro/middleware/media-usage-write-fence.ts +4 -0
- package/src/astro/middleware/redirect.ts +11 -1
- package/src/astro/middleware/request-context.ts +57 -27
- package/src/astro/middleware.ts +44 -29
- package/src/astro/routes/PluginRegistry.tsx +21 -17
- package/src/astro/routes/api/admin/comments/[id]/status.ts +9 -1
- package/src/astro/routes/api/admin/comments/[id].ts +10 -3
- package/src/astro/routes/api/admin/comments/bulk.ts +18 -4
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +1 -1
- package/src/astro/routes/api/admin/plugins/registry/install.ts +1 -1
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +9 -2
- package/src/astro/routes/api/auth/dev-bypass.ts +20 -1
- package/src/astro/routes/api/auth/invite/complete.ts +2 -1
- package/src/astro/routes/api/auth/invite/index.ts +9 -2
- package/src/astro/routes/api/auth/invite/register-options.ts +2 -1
- package/src/astro/routes/api/auth/magic-link/send.ts +9 -2
- package/src/astro/routes/api/auth/me.ts +38 -17
- package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +6 -11
- package/src/astro/routes/api/auth/oauth/[provider].ts +6 -11
- package/src/astro/routes/api/auth/passkey/options.ts +2 -1
- package/src/astro/routes/api/auth/passkey/register/options.ts +2 -1
- package/src/astro/routes/api/auth/passkey/register/verify.ts +2 -1
- package/src/astro/routes/api/auth/passkey/verify.ts +2 -1
- package/src/astro/routes/api/auth/signup/complete.ts +2 -1
- package/src/astro/routes/api/auth/signup/request.ts +2 -1
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +2 -2
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +1 -0
- package/src/astro/routes/api/content/[collection]/[id]/lock.ts +6 -3
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +6 -2
- package/src/astro/routes/api/content/[collection]/[id]/revisions/editors.ts +30 -0
- package/src/astro/routes/api/content/[collection]/[id]/revisions.ts +37 -1
- package/src/astro/routes/api/content/[collection]/[id]/room.ts +43 -0
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +3 -1
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +54 -2
- package/src/astro/routes/api/content/[collection]/[id].ts +22 -73
- package/src/astro/routes/api/import/wordpress/analyze.ts +16 -29
- package/src/astro/routes/api/import/wordpress/execute.ts +193 -15
- package/src/astro/routes/api/import/wordpress/media.ts +6 -1
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +9 -5
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +25 -19
- package/src/astro/routes/api/manifest.ts +40 -5
- package/src/astro/routes/api/media/[id]/confirm.ts +42 -14
- package/src/astro/routes/api/media/asset/[id]/[filename].ts +1 -0
- package/src/astro/routes/api/media/file/[...key].ts +19 -4
- package/src/astro/routes/api/media/upload-url.ts +1 -1
- package/src/astro/routes/api/media.ts +14 -4
- package/src/astro/routes/api/oauth/device/authorize.ts +0 -2
- package/src/astro/routes/api/oauth/token.ts +5 -1
- package/src/astro/routes/api/revisions/[revisionId]/restore.ts +1 -1
- package/src/astro/routes/api/settings/domain-notify.ts +9 -2
- package/src/astro/routes/api/settings/email.ts +197 -8
- package/src/astro/routes/api/setup/admin-verify.ts +2 -1
- package/src/astro/routes/api/setup/admin.ts +2 -1
- package/src/astro/routes/api/setup/dev-bypass.ts +3 -1
- package/src/astro/routes/api/setup/index.ts +5 -2
- package/src/astro/routes/api/well-known/auth.ts +2 -1
- package/src/astro/routes/api/widget-areas/[name]/reorder.ts +7 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +3 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +2 -1
- package/src/astro/routes/api/widget-areas/[name].ts +2 -1
- package/src/astro/routes/api/widget-areas/index.ts +2 -1
- package/src/astro/routes/robots.txt.ts +9 -10
- package/src/astro/routes/sitemap-[collection].xml.ts +5 -6
- package/src/astro/routes/sitemap.xml.ts +2 -6
- package/src/astro/runtime-holder.ts +41 -0
- package/src/astro/types.ts +46 -8
- package/src/auth/api-tokens.ts +3 -0
- package/src/auth/oauth-env.ts +35 -0
- package/src/bylines/field-defs-cache.ts +9 -4
- package/src/cleanup.ts +44 -0
- package/src/cli/commands/export-seed.ts +4 -3
- package/src/cli/commands/import/wordpress.ts +158 -56
- package/src/cli/commands/import.ts +139 -0
- package/src/cli/commands/login.ts +26 -1
- package/src/cli/commands/schema.ts +2 -2
- package/src/cli/commands/seed.ts +3 -3
- package/src/cli/credentials.ts +58 -17
- package/src/cli/index.ts +4 -1
- package/src/cli/wxr/parser.ts +15 -13
- package/src/client/index.ts +38 -24
- package/src/client/portable-text.ts +390 -192
- package/src/client/transport.ts +14 -4
- package/src/comments/public-submission.ts +7 -0
- package/src/comments/route-cache.ts +39 -0
- package/src/components/Columns.astro +2 -4
- package/src/components/CommentForm.astro +6 -0
- package/src/components/Comments.astro +5 -1
- package/src/components/Cover.astro +2 -4
- package/src/components/EmDashHead.astro +9 -7
- package/src/components/EmDashImage.astro +161 -34
- package/src/components/EmDashMedia.astro +36 -31
- package/src/components/Embed.astro +49 -17
- package/src/components/Gallery.astro +6 -2
- package/src/components/Image.astro +15 -3
- package/src/components/InlinePortableTextEditor.tsx +1 -0
- package/src/components/LiveSearch.astro +23 -1
- package/src/components/PortableText.astro +5 -8
- package/src/components/inline-bubble-menu.tsx +109 -95
- package/src/components/inline-image.tsx +54 -48
- package/src/components/marks/Link.astro +7 -0
- package/src/components/widgets/Archives.astro +6 -2
- package/src/components/widgets/Categories.astro +7 -2
- package/src/components/widgets/RecentPosts.astro +23 -13
- package/src/components/widgets/Search.astro +3 -1
- package/src/components/widgets/Tags.astro +7 -2
- package/src/config/options-schema.ts +124 -0
- package/src/content/converters/video.ts +6 -65
- package/src/database/dialect-helpers.ts +67 -3
- package/src/database/migrations/092_plugin_kv_options.ts +93 -0
- package/src/database/migrations/093_menu_item_orphans.ts +21 -0
- package/src/database/migrations/094_media_usage_file_url_reindex.ts +57 -0
- package/src/database/migrations/095_plugin_storage_unique_scope.ts +134 -0
- package/src/database/migrations/096_revision_kind_and_editors.ts +29 -0
- package/src/database/migrations/097_room_storage.ts +43 -0
- package/src/database/migrations/content-sized.ts +16 -0
- package/src/database/migrations/policy.ts +6 -1
- package/src/database/migrations/runner.ts +37 -8
- package/src/database/plugin-storage-index-name.ts +29 -0
- package/src/database/repositories/byline.ts +99 -86
- package/src/database/repositories/content.ts +179 -17
- package/src/database/repositories/entry-locks.ts +35 -29
- package/src/database/repositories/media-usage.ts +1 -1
- package/src/database/repositories/media.ts +40 -0
- package/src/database/repositories/menu.ts +193 -135
- package/src/database/repositories/redirect.ts +116 -46
- package/src/database/repositories/revision.ts +216 -20
- package/src/database/repositories/seo.ts +2 -0
- package/src/database/repositories/taxonomy.ts +91 -27
- package/src/database/repositories/types.ts +3 -3
- package/src/database/repositories/user.ts +34 -0
- package/src/database/transaction.ts +23 -2
- package/src/database/types.ts +24 -2
- package/src/emdash-runtime.ts +1071 -247
- package/src/i18n/resolve.ts +10 -0
- package/src/import/index.ts +0 -12
- package/src/import/menus.ts +202 -151
- package/src/import/registry.ts +30 -1
- package/src/import/utils.ts +15 -2
- package/src/index.ts +11 -0
- package/src/loader.ts +209 -115
- package/src/mcp/server.ts +103 -29
- package/src/media/content-disposition.ts +56 -0
- package/src/media/enrich.ts +20 -4
- package/src/media/image-endpoint.ts +1 -0
- package/src/media/mime.ts +1 -0
- package/src/media/normalize.ts +2 -0
- package/src/media/placeholder.ts +4 -0
- package/src/media/portable-text-file-refs.ts +98 -0
- package/src/media/responsive.ts +29 -1
- package/src/media/types.ts +2 -0
- package/src/media/url.ts +15 -0
- package/src/media/usage/content-fields.ts +2 -1
- package/src/media/usage/content-snapshots.ts +111 -34
- package/src/media/usage/extractor.ts +42 -8
- package/src/media/usage/types.ts +5 -0
- package/src/menus/index.ts +137 -25
- package/src/object-cache/index.ts +402 -17
- package/src/page/jsonld.ts +26 -11
- package/src/plugin-test-runtime.ts +1 -0
- package/src/plugins/adapt-sandbox-entry.ts +2 -0
- package/src/plugins/content-policy.ts +36 -2
- package/src/plugins/context.ts +17 -7
- package/src/plugins/cron.ts +6 -3
- package/src/plugins/define-plugin.ts +5 -1
- package/src/plugins/editor-draft.ts +9 -3
- package/src/plugins/email-smtp.ts +936 -0
- package/src/plugins/hooks.ts +34 -8
- package/src/plugins/host.ts +2 -0
- package/src/plugins/http-route-dispatch.ts +3 -1
- package/src/plugins/lifecycle.ts +25 -1
- package/src/plugins/manager.ts +3 -0
- package/src/plugins/sandbox/types.ts +10 -1
- package/src/plugins/storage-indexes.ts +64 -55
- package/src/plugins/types.ts +16 -1
- package/src/query.ts +116 -47
- package/src/redirects/cache.ts +3 -2
- package/src/redirects/loops.ts +20 -4
- package/src/redirects/patterns.ts +16 -0
- package/src/request-context.ts +29 -1
- package/src/rooms/document.ts +99 -0
- package/src/rooms/hash.ts +19 -0
- package/src/rooms/index.ts +28 -0
- package/src/rooms/kysely-store.ts +279 -0
- package/src/rooms/limits.ts +41 -0
- package/src/rooms/merge.ts +115 -0
- package/src/rooms/node/index.ts +30 -0
- package/src/rooms/node/registry.ts +232 -0
- package/src/rooms/node/signals.ts +89 -0
- package/src/rooms/node/upgrades.ts +210 -0
- package/src/rooms/notifications.ts +157 -0
- package/src/rooms/parts.ts +74 -0
- package/src/rooms/room.ts +1559 -0
- package/src/rooms/site.ts +185 -0
- package/src/rooms/snapshot.ts +11 -0
- package/src/rooms/types.ts +298 -0
- package/src/scheduled-publish.ts +18 -5
- package/src/schema/registry.ts +14 -3
- package/src/schema/types.ts +17 -8
- package/src/search/errors.ts +22 -0
- package/src/search/fts-manager.ts +26 -9
- package/src/search/index.ts +2 -0
- package/src/seed/apply.ts +161 -92
- package/src/seed/index.ts +1 -1
- package/src/seed/load.ts +9 -0
- package/src/seed/types.ts +23 -14
- package/src/seo/hreflang.ts +5 -4
- package/src/seo/index.ts +10 -4
- package/src/seo/title-field.ts +19 -0
- package/src/settings/index.ts +36 -3
- package/src/settings/types.ts +7 -0
- package/src/taxonomies/index.ts +77 -76
- package/src/transfer/analyze/target.ts +5 -0
- package/src/transfer/domain.ts +23 -0
- package/src/transfer/export/readers.ts +6 -2
- package/src/transfer/format/columns.ts +4 -0
- package/src/transfer/format/settings.ts +1 -0
- package/src/transfer/import/advance.ts +12 -1
- package/src/transfer/import/scaffold.ts +73 -9
- package/src/transfer/import/stages.ts +53 -2
- package/src/ui.ts +18 -19
- package/src/utils/revalidating-cache.ts +85 -0
- package/src/virtual-modules.d.ts +20 -3
- package/src/visual-editing/toolbar.ts +79 -52
- package/src/widgets/index.ts +27 -13
- package/src/widgets/recent-posts.ts +13 -0
- package/dist/action-token-B1ds4laA.mjs +0 -26
- package/dist/action-token-B1ds4laA.mjs.map +0 -1
- package/dist/activation-sGF9br3X.mjs +0 -387
- package/dist/activation-sGF9br3X.mjs.map +0 -1
- package/dist/adapters-BOMSX9PU.d.mts +0 -173
- package/dist/adapters-BOMSX9PU.d.mts.map +0 -1
- package/dist/after-PcEvMY_6.mjs +0 -96
- package/dist/after-PcEvMY_6.mjs.map +0 -1
- package/dist/allowed-origins-CovsTkm3.mjs +0 -116
- package/dist/allowed-origins-CovsTkm3.mjs.map +0 -1
- package/dist/api-C_LxFnOm.mjs +0 -5077
- package/dist/api-C_LxFnOm.mjs.map +0 -1
- package/dist/api-tokens-C7l0GUAF.mjs +0 -3
- package/dist/api-tokens-DQ9Ee-vP.mjs +0 -173
- package/dist/api-tokens-DQ9Ee-vP.mjs.map +0 -1
- package/dist/apply-CLjfxvyH.mjs +0 -1758
- package/dist/apply-CLjfxvyH.mjs.map +0 -1
- package/dist/approvals-ocK89i4H.mjs +0 -460
- package/dist/approvals-ocK89i4H.mjs.map +0 -1
- package/dist/artifact-fetch-CgvvpoWQ.mjs +0 -659
- package/dist/artifact-fetch-CgvvpoWQ.mjs.map +0 -1
- package/dist/artifacts-DwOYYBQm.mjs +0 -323
- package/dist/artifacts-DwOYYBQm.mjs.map +0 -1
- package/dist/audit-B8XE-0UV.mjs +0 -127
- package/dist/audit-B8XE-0UV.mjs.map +0 -1
- package/dist/authoritative-records-LPtrIGOY.mjs +0 -5183
- package/dist/authoritative-records-LPtrIGOY.mjs.map +0 -1
- package/dist/authorize-CoDsRRp5.mjs +0 -74
- package/dist/authorize-CoDsRRp5.mjs.map +0 -1
- package/dist/backup-2Wj-hTCN.mjs +0 -246
- package/dist/backup-2Wj-hTCN.mjs.map +0 -1
- package/dist/base64-BQBZwXCx.mjs +0 -63
- package/dist/base64-BQBZwXCx.mjs.map +0 -1
- package/dist/block-types-C3gJEe7l.mjs +0 -132
- package/dist/block-types-C3gJEe7l.mjs.map +0 -1
- package/dist/block-values-CgbMtSGU.mjs +0 -215
- package/dist/block-values-CgbMtSGU.mjs.map +0 -1
- package/dist/byline-CzGZC2Zs.mjs +0 -922
- package/dist/byline-CzGZC2Zs.mjs.map +0 -1
- package/dist/byline-fields-B1qHvRps.mjs +0 -280
- package/dist/byline-fields-B1qHvRps.mjs.map +0 -1
- package/dist/byline-fields-vYd_4Q1e.mjs +0 -123
- package/dist/byline-fields-vYd_4Q1e.mjs.map +0 -1
- package/dist/byline-registry-BhzpO41z.mjs +0 -406
- package/dist/byline-registry-BhzpO41z.mjs.map +0 -1
- package/dist/bylines-BF555iIz.mjs +0 -150
- package/dist/bylines-BF555iIz.mjs.map +0 -1
- package/dist/bylines-DJx6IWWi.mjs +0 -234
- package/dist/bylines-DJx6IWWi.mjs.map +0 -1
- package/dist/cache-BWzswWB-.mjs +0 -151
- package/dist/cache-BWzswWB-.mjs.map +0 -1
- package/dist/canonical-DjF_z6GI.mjs +0 -174
- package/dist/canonical-DjF_z6GI.mjs.map +0 -1
- package/dist/capture-triggers-D7g3fOZj.mjs +0 -362
- package/dist/capture-triggers-D7g3fOZj.mjs.map +0 -1
- package/dist/challenge-store-Cfjdvw86.mjs +0 -51
- package/dist/challenge-store-Cfjdvw86.mjs.map +0 -1
- package/dist/checksum-BF4acJwn.mjs +0 -162
- package/dist/checksum-BF4acJwn.mjs.map +0 -1
- package/dist/chrome-tags-BDs29G3g.mjs +0 -24
- package/dist/chrome-tags-BDs29G3g.mjs.map +0 -1
- package/dist/chunks-CYBOL-zn.mjs +0 -25
- package/dist/chunks-CYBOL-zn.mjs.map +0 -1
- package/dist/collection-slugs-cache-B2J5aESO.mjs +0 -91
- package/dist/collection-slugs-cache-B2J5aESO.mjs.map +0 -1
- package/dist/comment-DV7dybcs.mjs +0 -335
- package/dist/comment-DV7dybcs.mjs.map +0 -1
- package/dist/comment-reaction-CWwqiT6x.mjs +0 -85
- package/dist/comment-reaction-CWwqiT6x.mjs.map +0 -1
- package/dist/comments-DVjWJm8X.mjs +0 -99
- package/dist/comments-DVjWJm8X.mjs.map +0 -1
- package/dist/comments-Q-ILHCEI.mjs +0 -195
- package/dist/comments-Q-ILHCEI.mjs.map +0 -1
- package/dist/components-DnOmvvgg.mjs +0 -112
- package/dist/components-DnOmvvgg.mjs.map +0 -1
- package/dist/config-9IzA83_U.d.mts +0 -6811
- package/dist/config-9IzA83_U.d.mts.map +0 -1
- package/dist/config-BdQzFtmR.mjs +0 -228
- package/dist/config-BdQzFtmR.mjs.map +0 -1
- package/dist/config-Cs2RBkJ6.d.mts +0 -41
- package/dist/config-Cs2RBkJ6.d.mts.map +0 -1
- package/dist/connection-CiXgZyCY.mjs +0 -36
- package/dist/connection-CiXgZyCY.mjs.map +0 -1
- package/dist/content-Dt0Os_WQ.mjs +0 -2109
- package/dist/content-Dt0Os_WQ.mjs.map +0 -1
- package/dist/content-list-query-BK26u9Ly.d.mts +0 -26
- package/dist/content-list-query-BK26u9Ly.d.mts.map +0 -1
- package/dist/content-policy-BLDbNJOb.mjs +0 -46
- package/dist/content-policy-BLDbNJOb.mjs.map +0 -1
- package/dist/content-repair-CjwbLy4m.mjs +0 -442
- package/dist/content-repair-CjwbLy4m.mjs.map +0 -1
- package/dist/context-ErV7UdQY.mjs +0 -2089
- package/dist/context-ErV7UdQY.mjs.map +0 -1
- package/dist/credits-BRyjafiF.mjs +0 -110
- package/dist/credits-BRyjafiF.mjs.map +0 -1
- package/dist/cron-Bm5xa7tv.mjs +0 -306
- package/dist/cron-Bm5xa7tv.mjs.map +0 -1
- package/dist/dashboard-DVxQ5XiI.mjs +0 -168
- package/dist/dashboard-DVxQ5XiI.mjs.map +0 -1
- package/dist/default-B9Tf2n94.mjs +0 -81
- package/dist/default-B9Tf2n94.mjs.map +0 -1
- package/dist/deferred-tasks-CpPEqsga.d.mts +0 -9
- package/dist/deferred-tasks-CpPEqsga.d.mts.map +0 -1
- package/dist/destination-DR3IHjmy.mjs +0 -18
- package/dist/destination-DR3IHjmy.mjs.map +0 -1
- package/dist/dev-typegen-ZeWYV8Jp.mjs +0 -29
- package/dist/dev-typegen-ZeWYV8Jp.mjs.map +0 -1
- package/dist/device-flow-BbYNZ9Xi.mjs +0 -521
- package/dist/device-flow-BbYNZ9Xi.mjs.map +0 -1
- package/dist/dialect-helpers-7_IqPdh9.mjs +0 -307
- package/dist/dialect-helpers-7_IqPdh9.mjs.map +0 -1
- package/dist/digest-DlBa7kJl.mjs +0 -194
- package/dist/digest-DlBa7kJl.mjs.map +0 -1
- package/dist/direct-executor-5T8gkhvA.mjs +0 -117
- package/dist/direct-executor-5T8gkhvA.mjs.map +0 -1
- package/dist/dist-DY0aOmAP.mjs +0 -810
- package/dist/dist-DY0aOmAP.mjs.map +0 -1
- package/dist/email-console-v3OM8It-.mjs +0 -50
- package/dist/email-console-v3OM8It-.mjs.map +0 -1
- package/dist/email-locale-CoZo-oZx.mjs +0 -25
- package/dist/email-locale-CoZo-oZx.mjs.map +0 -1
- package/dist/emdash-runtime-DwezbIqQ.mjs +0 -4392
- package/dist/emdash-runtime-DwezbIqQ.mjs.map +0 -1
- package/dist/enrich-C3XIJi0O.mjs +0 -194
- package/dist/enrich-C3XIJi0O.mjs.map +0 -1
- package/dist/entry-lock-CY7XpdSw.d.mts +0 -4568
- package/dist/entry-lock-CY7XpdSw.d.mts.map +0 -1
- package/dist/entry-lock-DDuWaAiP.mjs +0 -1211
- package/dist/entry-lock-DDuWaAiP.mjs.map +0 -1
- package/dist/entry-lock-D_Og9Gy3.mjs +0 -163
- package/dist/entry-lock-D_Og9Gy3.mjs.map +0 -1
- package/dist/entry-locks-Cp8_BcQQ.mjs +0 -167
- package/dist/entry-locks-Cp8_BcQQ.mjs.map +0 -1
- package/dist/env-types-Br8uywYA.mjs +0 -38
- package/dist/env-types-Br8uywYA.mjs.map +0 -1
- package/dist/error-CT2SsX5S.mjs +0 -90
- package/dist/error-CT2SsX5S.mjs.map +0 -1
- package/dist/errors-BMaCpLeS.mjs +0 -479
- package/dist/errors-BMaCpLeS.mjs.map +0 -1
- package/dist/errors-DlJwot7q.mjs +0 -120
- package/dist/errors-DlJwot7q.mjs.map +0 -1
- package/dist/escape-BfbDyuQ-.mjs +0 -9
- package/dist/escape-BfbDyuQ-.mjs.map +0 -1
- package/dist/fence-BOD3SxZG.mjs +0 -162
- package/dist/fence-BOD3SxZG.mjs.map +0 -1
- package/dist/field-defs-cache-C7sR7ZeU.mjs +0 -77
- package/dist/field-defs-cache-C7sR7ZeU.mjs.map +0 -1
- package/dist/field-map-C_rDXfdJ.mjs +0 -84
- package/dist/field-map-C_rDXfdJ.mjs.map +0 -1
- package/dist/focal-point-CgCcr1Ca.mjs +0 -23
- package/dist/focal-point-CgCcr1Ca.mjs.map +0 -1
- package/dist/fts-manager-BzFo0xx6.mjs +0 -483
- package/dist/fts-manager-BzFo0xx6.mjs.map +0 -1
- package/dist/gc-B_c3DPpi.mjs +0 -75
- package/dist/gc-B_c3DPpi.mjs.map +0 -1
- package/dist/hash-A-o2ZX8O.mjs +0 -37
- package/dist/hash-A-o2ZX8O.mjs.map +0 -1
- package/dist/hook-result-f8t7hIuu.d.mts +0 -31
- package/dist/hook-result-f8t7hIuu.d.mts.map +0 -1
- package/dist/hreflang-BpUK9Lcu.mjs +0 -105
- package/dist/hreflang-BpUK9Lcu.mjs.map +0 -1
- package/dist/hreflang-D07R-RbI.d.mts +0 -50
- package/dist/hreflang-D07R-RbI.d.mts.map +0 -1
- package/dist/http-route-dispatch-C2Ep2Uf6.mjs +0 -342
- package/dist/http-route-dispatch-C2Ep2Uf6.mjs.map +0 -1
- package/dist/identity-BivQ8wkV.mjs +0 -35
- package/dist/identity-BivQ8wkV.mjs.map +0 -1
- package/dist/import-B4UvHNJz.mjs +0 -2126
- package/dist/import-B4UvHNJz.mjs.map +0 -1
- package/dist/index-C37Ty40w.d.mts +0 -623
- package/dist/index-C37Ty40w.d.mts.map +0 -1
- package/dist/init-lock-BGmew3r1.mjs +0 -56
- package/dist/init-lock-BGmew3r1.mjs.map +0 -1
- package/dist/install-finalization-BbYaB4wj.mjs +0 -58
- package/dist/install-finalization-BbYaB4wj.mjs.map +0 -1
- package/dist/json-recordset-BjYIWFkV.mjs +0 -12
- package/dist/json-recordset-BjYIWFkV.mjs.map +0 -1
- package/dist/json-schema-Cde7le0s.mjs +0 -15
- package/dist/json-schema-Cde7le0s.mjs.map +0 -1
- package/dist/keys-CusTXpw-.mjs +0 -61
- package/dist/keys-CusTXpw-.mjs.map +0 -1
- package/dist/kinds-DogmNB6n.mjs +0 -974
- package/dist/kinds-DogmNB6n.mjs.map +0 -1
- package/dist/lifecycle-BLCoCz4T.mjs +0 -25
- package/dist/lifecycle-BLCoCz4T.mjs.map +0 -1
- package/dist/load-Dds3KhXr.mjs +0 -28
- package/dist/load-Dds3KhXr.mjs.map +0 -1
- package/dist/loader-D4w4XE7q.mjs +0 -1420
- package/dist/loader-D4w4XE7q.mjs.map +0 -1
- package/dist/loops-IYgzQdQu.mjs +0 -205
- package/dist/loops-IYgzQdQu.mjs.map +0 -1
- package/dist/manifest-builder-CGF5kujD.mjs +0 -196
- package/dist/manifest-builder-CGF5kujD.mjs.map +0 -1
- package/dist/manifest-schema-B0BxPSjB.mjs +0 -497
- package/dist/manifest-schema-B0BxPSjB.mjs.map +0 -1
- package/dist/marketplace-DNvEGLqU.mjs +0 -257
- package/dist/marketplace-DNvEGLqU.mjs.map +0 -1
- package/dist/media-BL9MRrSG.mjs +0 -294
- package/dist/media-BL9MRrSG.mjs.map +0 -1
- package/dist/media-B_x5B9EA.mjs +0 -373
- package/dist/media-B_x5B9EA.mjs.map +0 -1
- package/dist/media-allowlist-CpmqBbIQ.mjs +0 -45
- package/dist/media-allowlist-CpmqBbIQ.mjs.map +0 -1
- package/dist/media-folders-CNs_A_B-.mjs +0 -210
- package/dist/media-folders-CNs_A_B-.mjs.map +0 -1
- package/dist/media-qTTHVkls.mjs +0 -416
- package/dist/media-qTTHVkls.mjs.map +0 -1
- package/dist/media-url-GJboA1fl.mjs +0 -43
- package/dist/media-url-GJboA1fl.mjs.map +0 -1
- package/dist/media-usage-ClWgrX0d.mjs +0 -282
- package/dist/media-usage-ClWgrX0d.mjs.map +0 -1
- package/dist/media-usage-activation-B8Fjtq0h.mjs +0 -78
- package/dist/media-usage-activation-B8Fjtq0h.mjs.map +0 -1
- package/dist/media-usage-work-L8-Au4j-.mjs +0 -1036
- package/dist/media-usage-work-L8-Au4j-.mjs.map +0 -1
- package/dist/media-usage-work-LXgze5j9.mjs +0 -151
- package/dist/media-usage-work-LXgze5j9.mjs.map +0 -1
- package/dist/menus-BAxcbsbv.mjs +0 -818
- package/dist/menus-BAxcbsbv.mjs.map +0 -1
- package/dist/menus-BI6oBXco.mjs +0 -92
- package/dist/menus-BI6oBXco.mjs.map +0 -1
- package/dist/menus-fvGFd4m6.mjs +0 -3725
- package/dist/menus-fvGFd4m6.mjs.map +0 -1
- package/dist/mime-DwhtRyUt.mjs +0 -81
- package/dist/mime-DwhtRyUt.mjs.map +0 -1
- package/dist/mode-DIDSUwuN.mjs +0 -23
- package/dist/mode-DIDSUwuN.mjs.map +0 -1
- package/dist/node-sqlite-compat-Ddr_mlR9.mjs +0 -63
- package/dist/node-sqlite-compat-Ddr_mlR9.mjs.map +0 -1
- package/dist/normalize-Ip_hFAm8.mjs +0 -216
- package/dist/normalize-Ip_hFAm8.mjs.map +0 -1
- package/dist/oauth-authorization-CcMgeT8R.mjs +0 -274
- package/dist/oauth-authorization-CcMgeT8R.mjs.map +0 -1
- package/dist/oauth-clients-C_osi0PU.mjs +0 -266
- package/dist/oauth-clients-C_osi0PU.mjs.map +0 -1
- package/dist/oauth-state-store-DGLP-6CK.mjs +0 -50
- package/dist/oauth-state-store-DGLP-6CK.mjs.map +0 -1
- package/dist/oauth-user-lookup-z77Ee0Hm.mjs +0 -26
- package/dist/oauth-user-lookup-z77Ee0Hm.mjs.map +0 -1
- package/dist/object-cache-EjasjtoQ.mjs +0 -586
- package/dist/object-cache-EjasjtoQ.mjs.map +0 -1
- package/dist/options-CmUpkyKW.d.mts +0 -81
- package/dist/options-CmUpkyKW.d.mts.map +0 -1
- package/dist/options-DhrI7eMv.mjs +0 -208
- package/dist/options-DhrI7eMv.mjs.map +0 -1
- package/dist/ownership-DCk5NutQ.mjs +0 -12
- package/dist/ownership-DCk5NutQ.mjs.map +0 -1
- package/dist/parse-2W-E2f7w.mjs +0 -81
- package/dist/parse-2W-E2f7w.mjs.map +0 -1
- package/dist/parse-6pN8Xqg5.d.mts +0 -176
- package/dist/parse-6pN8Xqg5.d.mts.map +0 -1
- package/dist/passkey-config-DTTZB6EI.mjs +0 -46
- package/dist/passkey-config-DTTZB6EI.mjs.map +0 -1
- package/dist/paths-CQA62503.mjs +0 -77
- package/dist/paths-CQA62503.mjs.map +0 -1
- package/dist/patterns-CryGz_EV.mjs +0 -159
- package/dist/patterns-CryGz_EV.mjs.map +0 -1
- package/dist/placeholder-BlfXkucE.d.mts +0 -313
- package/dist/placeholder-BlfXkucE.d.mts.map +0 -1
- package/dist/plan-B95eiwnF.mjs +0 -135
- package/dist/plan-B95eiwnF.mjs.map +0 -1
- package/dist/plugin-tool-name-BDA7m4Xa.mjs +0 -27
- package/dist/plugin-tool-name-BDA7m4Xa.mjs.map +0 -1
- package/dist/plugins-BhxLJ008.mjs +0 -261
- package/dist/plugins-BhxLJ008.mjs.map +0 -1
- package/dist/policy-DOJ2sPqB.mjs +0 -53
- package/dist/policy-DOJ2sPqB.mjs.map +0 -1
- package/dist/portable-text-RCMpCj47.mjs +0 -311
- package/dist/portable-text-RCMpCj47.mjs.map +0 -1
- package/dist/preview-DFwL5APO.mjs +0 -107
- package/dist/preview-DFwL5APO.mjs.map +0 -1
- package/dist/protocol-B-ztxp_y.d.mts +0 -65
- package/dist/protocol-B-ztxp_y.d.mts.map +0 -1
- package/dist/public-plugin-api-routes-ik4fPZMv.mjs +0 -316
- package/dist/public-plugin-api-routes-ik4fPZMv.mjs.map +0 -1
- package/dist/public-submission-C5JZIykp.mjs +0 -251
- package/dist/public-submission-C5JZIykp.mjs.map +0 -1
- package/dist/public-url-CQwzRljH.mjs +0 -101
- package/dist/public-url-CQwzRljH.mjs.map +0 -1
- package/dist/query-BFHjCzSh.mjs +0 -37
- package/dist/query-BFHjCzSh.mjs.map +0 -1
- package/dist/query-DuwyFr5Z.mjs +0 -41
- package/dist/query-DuwyFr5Z.mjs.map +0 -1
- package/dist/query-eR_Nz70M.mjs +0 -1157
- package/dist/query-eR_Nz70M.mjs.map +0 -1
- package/dist/range-BQWPjWgQ.mjs +0 -51
- package/dist/range-BQWPjWgQ.mjs.map +0 -1
- package/dist/rate-limit-mPKeQ3sm.mjs +0 -127
- package/dist/rate-limit-mPKeQ3sm.mjs.map +0 -1
- package/dist/receipt-CmUpyuW5.mjs +0 -43
- package/dist/receipt-CmUpyuW5.mjs.map +0 -1
- package/dist/redirect-BtiMkehU.mjs +0 -19
- package/dist/redirect-BtiMkehU.mjs.map +0 -1
- package/dist/redirect-DcmNMvOs.mjs +0 -423
- package/dist/redirect-DcmNMvOs.mjs.map +0 -1
- package/dist/redirect-paths-K5i3xYfR.mjs +0 -36
- package/dist/redirect-paths-K5i3xYfR.mjs.map +0 -1
- package/dist/redirects-BA_TvtuH.mjs +0 -148
- package/dist/redirects-BA_TvtuH.mjs.map +0 -1
- package/dist/redirects-BIrRvgn4.mjs +0 -446
- package/dist/redirects-BIrRvgn4.mjs.map +0 -1
- package/dist/registry-DymfZkAN.mjs +0 -8374
- package/dist/registry-DymfZkAN.mjs.map +0 -1
- package/dist/relations-DrEs3Sc1.mjs +0 -789
- package/dist/relations-DrEs3Sc1.mjs.map +0 -1
- package/dist/request-cache-5z2WzWmh.mjs +0 -104
- package/dist/request-cache-5z2WzWmh.mjs.map +0 -1
- package/dist/request-meta-o8RIf9pa.mjs +0 -141
- package/dist/request-meta-o8RIf9pa.mjs.map +0 -1
- package/dist/resolve-CVy9xgy_.mjs +0 -102
- package/dist/resolve-CVy9xgy_.mjs.map +0 -1
- package/dist/resolve-DdNXBJSr.mjs +0 -199
- package/dist/resolve-DdNXBJSr.mjs.map +0 -1
- package/dist/revision-Dx7Uth1X.mjs +0 -374
- package/dist/revision-Dx7Uth1X.mjs.map +0 -1
- package/dist/route-cache-DAG5dPhh.mjs +0 -20
- package/dist/route-cache-DAG5dPhh.mjs.map +0 -1
- package/dist/route-wire-Xbsu8Vih.mjs +0 -197
- package/dist/route-wire-Xbsu8Vih.mjs.map +0 -1
- package/dist/routes-YQkSOsws.mjs +0 -272
- package/dist/routes-YQkSOsws.mjs.map +0 -1
- package/dist/runner-CLorw5vo.mjs +0 -6669
- package/dist/runner-CLorw5vo.mjs.map +0 -1
- package/dist/runner-g1A9P-wD.d.mts +0 -73
- package/dist/runner-g1A9P-wD.d.mts.map +0 -1
- package/dist/schema-Bss8qImF.mjs +0 -13
- package/dist/schema-Bss8qImF.mjs.map +0 -1
- package/dist/schema-C036pqEw.mjs +0 -815
- package/dist/schema-C036pqEw.mjs.map +0 -1
- package/dist/scopes-C_SoYl9x.mjs +0 -34
- package/dist/scopes-C_SoYl9x.mjs.map +0 -1
- package/dist/search-uNqCgePJ.mjs +0 -450
- package/dist/search-uNqCgePJ.mjs.map +0 -1
- package/dist/secrets-Cc_O3Kp-.mjs +0 -369
- package/dist/secrets-Cc_O3Kp-.mjs.map +0 -1
- package/dist/sections-BLusMa96.mjs +0 -346
- package/dist/sections-BLusMa96.mjs.map +0 -1
- package/dist/seo-BodxIpws.mjs +0 -188
- package/dist/seo-BodxIpws.mjs.map +0 -1
- package/dist/seo-DaMYIQY8.mjs +0 -133
- package/dist/seo-DaMYIQY8.mjs.map +0 -1
- package/dist/service-BuM1BRsA.mjs +0 -150
- package/dist/service-BuM1BRsA.mjs.map +0 -1
- package/dist/session-user-2DpQDMKw.mjs +0 -61
- package/dist/session-user-2DpQDMKw.mjs.map +0 -1
- package/dist/settings-B3ZmPF_8.mjs +0 -73
- package/dist/settings-B3ZmPF_8.mjs.map +0 -1
- package/dist/settings-P5hwPX6_.mjs +0 -66
- package/dist/settings-P5hwPX6_.mjs.map +0 -1
- package/dist/settings-yIqoN-Ok.mjs +0 -519
- package/dist/settings-yIqoN-Ok.mjs.map +0 -1
- package/dist/setup-complete-eu6MUQnt.mjs +0 -65
- package/dist/setup-complete-eu6MUQnt.mjs.map +0 -1
- package/dist/setup-nonce-CyPOapqY.mjs +0 -25
- package/dist/setup-nonce-CyPOapqY.mjs.map +0 -1
- package/dist/single-flight-cache-D0EaGbN1.mjs +0 -104
- package/dist/single-flight-cache-D0EaGbN1.mjs.map +0 -1
- package/dist/site-domain-8lEJl_0U.mjs +0 -131
- package/dist/site-domain-8lEJl_0U.mjs.map +0 -1
- package/dist/site-settings-uPkW0e6o.mjs +0 -50
- package/dist/site-settings-uPkW0e6o.mjs.map +0 -1
- package/dist/site-url-25SGVXwL.mjs +0 -45
- package/dist/site-url-25SGVXwL.mjs.map +0 -1
- package/dist/sitemap-name-DTK7CYnY.mjs +0 -26
- package/dist/sitemap-name-DTK7CYnY.mjs.map +0 -1
- package/dist/slug-BEDl2IJY.mjs +0 -16
- package/dist/slug-BEDl2IJY.mjs.map +0 -1
- package/dist/slugify-BDEG9pLk.mjs +0 -22
- package/dist/slugify-BDEG9pLk.mjs.map +0 -1
- package/dist/snapshot-CvkIBRLY.mjs +0 -414
- package/dist/snapshot-CvkIBRLY.mjs.map +0 -1
- package/dist/ssrf-BBXcxG-f.mjs +0 -1
- package/dist/ssrf-mcCKMH6B.mjs +0 -406
- package/dist/ssrf-mcCKMH6B.mjs.map +0 -1
- package/dist/stage-BQfGzGOy.mjs +0 -662
- package/dist/stage-BQfGzGOy.mjs.map +0 -1
- package/dist/staged-B5vQGeSf.mjs +0 -686
- package/dist/staged-B5vQGeSf.mjs.map +0 -1
- package/dist/state-dO6t6OxV.mjs +0 -178
- package/dist/state-dO6t6OxV.mjs.map +0 -1
- package/dist/status-DSURZwKS.mjs +0 -30
- package/dist/status-DSURZwKS.mjs.map +0 -1
- package/dist/storage-query-Cy0SZ8iG.d.mts +0 -1619
- package/dist/storage-query-Cy0SZ8iG.d.mts.map +0 -1
- package/dist/tar-DWzcUZ_Q.mjs +0 -449
- package/dist/tar-DWzcUZ_Q.mjs.map +0 -1
- package/dist/target-C9htUbrT.mjs +0 -27
- package/dist/target-C9htUbrT.mjs.map +0 -1
- package/dist/taxonomies-By2aGvq2.mjs +0 -729
- package/dist/taxonomies-By2aGvq2.mjs.map +0 -1
- package/dist/taxonomies-CVRd_jz0.mjs +0 -937
- package/dist/taxonomies-CVRd_jz0.mjs.map +0 -1
- package/dist/taxonomy-BG_xu2Qf.mjs +0 -563
- package/dist/taxonomy-BG_xu2Qf.mjs.map +0 -1
- package/dist/tokens-U5vzgSrM.mjs +0 -171
- package/dist/tokens-U5vzgSrM.mjs.map +0 -1
- package/dist/transaction-CkoQ5wqQ.mjs +0 -29
- package/dist/transaction-CkoQ5wqQ.mjs.map +0 -1
- package/dist/transfer-DA0OSfaT.mjs +0 -8873
- package/dist/transfer-DA0OSfaT.mjs.map +0 -1
- package/dist/transfer-Pyf3d7ka.mjs +0 -166
- package/dist/transfer-Pyf3d7ka.mjs.map +0 -1
- package/dist/transfer-download-cX7SuWEy.mjs +0 -33
- package/dist/transfer-download-cX7SuWEy.mjs.map +0 -1
- package/dist/transformations-DczubD4j.mjs +0 -196
- package/dist/transformations-DczubD4j.mjs.map +0 -1
- package/dist/transport-Dm5QzpT_.d.mts +0 -42
- package/dist/transport-Dm5QzpT_.d.mts.map +0 -1
- package/dist/transport-DtIrjEFO.mjs +0 -137
- package/dist/transport-DtIrjEFO.mjs.map +0 -1
- package/dist/trusted-proxy-CDRd5Kmw.mjs +0 -51
- package/dist/trusted-proxy-CDRd5Kmw.mjs.map +0 -1
- package/dist/turnstile-Ct5YuFNY.mjs +0 -58
- package/dist/turnstile-Ct5YuFNY.mjs.map +0 -1
- package/dist/types-Bgujop4S.d.mts +0 -374
- package/dist/types-Bgujop4S.d.mts.map +0 -1
- package/dist/types-BirHUEXt.mjs +0 -18
- package/dist/types-BirHUEXt.mjs.map +0 -1
- package/dist/types-BqJgTL_y.d.mts +0 -293
- package/dist/types-BqJgTL_y.d.mts.map +0 -1
- package/dist/types-C-lrOt9T.d.mts +0 -87
- package/dist/types-C-lrOt9T.d.mts.map +0 -1
- package/dist/types-CCEHAhOv.d.mts +0 -916
- package/dist/types-CCEHAhOv.d.mts.map +0 -1
- package/dist/types-CLVwYRBr.d.mts +0 -227
- package/dist/types-CLVwYRBr.d.mts.map +0 -1
- package/dist/types-C_asjp1J.mjs +0 -201
- package/dist/types-C_asjp1J.mjs.map +0 -1
- package/dist/types-CadaL_k8.d.mts +0 -366
- package/dist/types-CadaL_k8.d.mts.map +0 -1
- package/dist/types-DVbTb4Hk.mjs +0 -77
- package/dist/types-DVbTb4Hk.mjs.map +0 -1
- package/dist/types-Ddku19Zw.d.mts +0 -209
- package/dist/types-Ddku19Zw.d.mts.map +0 -1
- package/dist/types-DwhEvIVb.mjs +0 -133
- package/dist/types-DwhEvIVb.mjs.map +0 -1
- package/dist/types-FIiGQ3PE.mjs +0 -16
- package/dist/types-FIiGQ3PE.mjs.map +0 -1
- package/dist/types-OauzCOY0.mjs +0 -37
- package/dist/types-OauzCOY0.mjs.map +0 -1
- package/dist/types-mQGTpP-4.d.mts +0 -1741
- package/dist/types-mQGTpP-4.d.mts.map +0 -1
- package/dist/types-nbjz3Mgm.d.mts +0 -125
- package/dist/types-nbjz3Mgm.d.mts.map +0 -1
- package/dist/update-check-hW32-0pf.mjs +0 -161
- package/dist/update-check-hW32-0pf.mjs.map +0 -1
- package/dist/upload-attempts-Bpik1TLF.mjs +0 -32
- package/dist/upload-attempts-Bpik1TLF.mjs.map +0 -1
- package/dist/url-DTfGDJhI.mjs +0 -104
- package/dist/url-DTfGDJhI.mjs.map +0 -1
- package/dist/url-pattern-CJeCyNij.mjs +0 -41
- package/dist/url-pattern-CJeCyNij.mjs.map +0 -1
- package/dist/user-nQInBZbE.mjs +0 -171
- package/dist/user-nQInBZbE.mjs.map +0 -1
- package/dist/utils-govudc_U.mjs +0 -442
- package/dist/utils-govudc_U.mjs.map +0 -1
- package/dist/validate-BxLvcDYh.mjs +0 -524
- package/dist/validate-BxLvcDYh.mjs.map +0 -1
- package/dist/validate-mnoVfASU.d.mts +0 -468
- package/dist/validate-mnoVfASU.d.mts.map +0 -1
- package/dist/validation-DQDEvh87.mjs +0 -221
- package/dist/validation-DQDEvh87.mjs.map +0 -1
- package/dist/version-BOFfLiVT.mjs +0 -49
- package/dist/version-BOFfLiVT.mjs.map +0 -1
- package/dist/version-Dcvx_C9g.mjs +0 -7
- package/dist/version-Dcvx_C9g.mjs.map +0 -1
- package/dist/version-DzTJ3gD7.mjs +0 -9
- package/dist/version-DzTJ3gD7.mjs.map +0 -1
- package/dist/video-BX7AI5nJ.mjs +0 -54
- package/dist/video-BX7AI5nJ.mjs.map +0 -1
- package/dist/virtual-modules-CU29aip9.mjs +0 -515
- package/dist/virtual-modules-CU29aip9.mjs.map +0 -1
- package/dist/widgets-HIeFmZxt.mjs +0 -121
- package/dist/widgets-HIeFmZxt.mjs.map +0 -1
- package/dist/wxr-taxonomies-Dy2i2ON3.d.mts +0 -34
- package/dist/wxr-taxonomies-Dy2i2ON3.d.mts.map +0 -1
- package/dist/wxr-taxonomies-DyOGhl8W.mjs +0 -454
- package/dist/wxr-taxonomies-DyOGhl8W.mjs.map +0 -1
- package/dist/zod-generator-VxCPVDpo.mjs +0 -425
- package/dist/zod-generator-VxCPVDpo.mjs.map +0 -1
package/src/emdash-runtime.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { getLocaleDir, resolveLocale } from "@emdash-cms/admin/locales";
|
|
11
|
-
import { Permissions } from "@emdash-cms/auth";
|
|
11
|
+
import { Permissions, toRoleLevel, type RoleLevel } from "@emdash-cms/auth";
|
|
12
12
|
import type { Element } from "@emdash-cms/blocks";
|
|
13
13
|
import {
|
|
14
14
|
normalizePluginPagePath,
|
|
@@ -22,14 +22,17 @@ import { Kysely, type Dialect } from "kysely";
|
|
|
22
22
|
import virtualConfig from "virtual:emdash/config";
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import { overlayDraft, saveContent, type ContentWrite } from "./api/content-save.js";
|
|
26
|
+
import { ErrorCode, mapErrorStatus } from "./api/errors.js";
|
|
26
27
|
import { buildManifestCollections } from "./api/handlers/manifest.js";
|
|
27
28
|
import {
|
|
28
29
|
handleMediaUpload as uploadMedia,
|
|
29
30
|
type MediaUploadInput,
|
|
30
31
|
} from "./api/handlers/media-upload.js";
|
|
31
32
|
import { resolveReferenceSelection } from "./api/handlers/relations.js";
|
|
33
|
+
import { handleRevisionEditors } from "./api/handlers/revision.js";
|
|
32
34
|
import {
|
|
35
|
+
liveReferenceData,
|
|
33
36
|
liveReferenceSelection,
|
|
34
37
|
mergeStagedReferenceBaselines,
|
|
35
38
|
mergeStagedReferences,
|
|
@@ -38,7 +41,13 @@ import {
|
|
|
38
41
|
type StagedReferenceBaselines,
|
|
39
42
|
type StagedReferences,
|
|
40
43
|
} from "./api/handlers/staged-references.js";
|
|
41
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
LIST_CONFLICT_MESSAGE,
|
|
46
|
+
listsMatch,
|
|
47
|
+
type ListPreconditions,
|
|
48
|
+
} from "./api/list-preconditions.js";
|
|
49
|
+
import { encodeRev, validateRev } from "./api/rev.js";
|
|
50
|
+
import { resolveSiteTitle } from "./api/site-title.js";
|
|
42
51
|
import { getSiteBaseUrl, resolveSiteOrigin } from "./api/site-url.js";
|
|
43
52
|
import type {
|
|
44
53
|
EmDashConfig,
|
|
@@ -58,6 +67,8 @@ import {
|
|
|
58
67
|
type RuntimeMigrationMode,
|
|
59
68
|
} from "./database/migrations/policy.js";
|
|
60
69
|
import {
|
|
70
|
+
getAppliedMigrationCount,
|
|
71
|
+
isMigrationCountCurrent,
|
|
61
72
|
MIGRATION_RACE_WAIT_MS,
|
|
62
73
|
MigrationFailedError,
|
|
63
74
|
MigrationLockHeldError,
|
|
@@ -67,7 +78,13 @@ import { AuditRepository } from "./database/repositories/audit.js";
|
|
|
67
78
|
import { CommentRepository } from "./database/repositories/comment.js";
|
|
68
79
|
import type { CommentStatus } from "./database/repositories/comment.js";
|
|
69
80
|
import { ContentRepository } from "./database/repositories/content.js";
|
|
70
|
-
import {
|
|
81
|
+
import { MediaRepository } from "./database/repositories/media.js";
|
|
82
|
+
import {
|
|
83
|
+
RevisionRepository,
|
|
84
|
+
type Revision,
|
|
85
|
+
type RevisionCredit,
|
|
86
|
+
type RevisionKind,
|
|
87
|
+
} from "./database/repositories/revision.js";
|
|
71
88
|
import { selectTaxonomyDefs } from "./database/repositories/taxonomy-def.js";
|
|
72
89
|
import { ContentMutationConflictError } from "./database/repositories/types.js";
|
|
73
90
|
import type {
|
|
@@ -81,6 +98,7 @@ import { warnAboutUnconfiguredTaxonomyLocales } from "./i18n/taxonomy-locale-dia
|
|
|
81
98
|
import { safeJsonSchemaToZod } from "./mcp/json-schema.js";
|
|
82
99
|
import { pluginToolName } from "./mcp/plugin-tool-name.js";
|
|
83
100
|
import { normalizeMediaValue } from "./media/normalize.js";
|
|
101
|
+
import { linkPortableTextFileUrls } from "./media/portable-text-file-refs.js";
|
|
84
102
|
import type { MediaProvider, MediaProviderCapabilities } from "./media/types.js";
|
|
85
103
|
import { activateMediaUsageCapture } from "./media/usage/activation.js";
|
|
86
104
|
import {
|
|
@@ -92,6 +110,7 @@ import {
|
|
|
92
110
|
import { processMediaUsageWorkAfterWrite } from "./media/usage/work-processor.js";
|
|
93
111
|
import {
|
|
94
112
|
scheduledPolicyRejectionKey,
|
|
113
|
+
toScheduledRejectionReason,
|
|
95
114
|
type ScheduledPolicyRejection,
|
|
96
115
|
} from "./plugins/content-policy.js";
|
|
97
116
|
import { createCommentAccess, createTaxonomyAccessWithWrite } from "./plugins/context.js";
|
|
@@ -102,7 +121,7 @@ import {
|
|
|
102
121
|
getSandboxSaveRejectionDetails,
|
|
103
122
|
} from "./plugins/sandbox/proxy.js";
|
|
104
123
|
import { createSandboxRunnerOptions } from "./plugins/sandbox/runner-options.js";
|
|
105
|
-
import { getSandboxRouteErrorDetails } from "./plugins/sandbox/types.js";
|
|
124
|
+
import { getSandboxRouteErrorDetails, SandboxUnavailableError } from "./plugins/sandbox/types.js";
|
|
106
125
|
import type {
|
|
107
126
|
SandboxedPluginInstance,
|
|
108
127
|
SandboxRunner,
|
|
@@ -203,26 +222,6 @@ interface PageContributions {
|
|
|
203
222
|
import { after } from "./after.js";
|
|
204
223
|
import { maybeRunScheduledBackup } from "./api/handlers/backup.js";
|
|
205
224
|
import { changedStoragelessDataKeys, storagelessDataKeyError } from "./api/handlers/content.js";
|
|
206
|
-
import { loadBundleFromR2 } from "./api/handlers/marketplace.js";
|
|
207
|
-
import {
|
|
208
|
-
runSystemCleanup,
|
|
209
|
-
shouldRunSystemCleanup as shouldRunSystemCleanupNow,
|
|
210
|
-
} from "./cleanup.js";
|
|
211
|
-
import {
|
|
212
|
-
DEFAULT_COMMENT_MODERATOR_PLUGIN_ID,
|
|
213
|
-
defaultCommentModerate,
|
|
214
|
-
} from "./comments/moderator.js";
|
|
215
|
-
import { submitPublicComment } from "./comments/public-submission.js";
|
|
216
|
-
import {
|
|
217
|
-
CommentStatusConflictError,
|
|
218
|
-
createComment,
|
|
219
|
-
moderateComment,
|
|
220
|
-
type CommentCreateInput,
|
|
221
|
-
type CommentCreateResult,
|
|
222
|
-
type CommentHookRunner,
|
|
223
|
-
} from "./comments/service.js";
|
|
224
|
-
import { validateEncryptionKeyAtStartup } from "./config/secrets.js";
|
|
225
|
-
import { OptionsRepository } from "./database/repositories/options.js";
|
|
226
225
|
import {
|
|
227
226
|
handleContentList,
|
|
228
227
|
handleContentAuthors,
|
|
@@ -245,6 +244,9 @@ import {
|
|
|
245
244
|
handleContentDiscardDraft,
|
|
246
245
|
handleContentCompare,
|
|
247
246
|
handleContentTranslations,
|
|
247
|
+
} from "./api/handlers/content.js";
|
|
248
|
+
import { loadBundleFromR2 } from "./api/handlers/marketplace.js";
|
|
249
|
+
import {
|
|
248
250
|
handleMediaList,
|
|
249
251
|
handleMediaGet,
|
|
250
252
|
handleMediaCreate,
|
|
@@ -252,26 +254,48 @@ import {
|
|
|
252
254
|
handleMediaUpdate,
|
|
253
255
|
handleMediaReplaceMetadata,
|
|
254
256
|
handleMediaDelete,
|
|
257
|
+
} from "./api/handlers/media.js";
|
|
258
|
+
import {
|
|
255
259
|
handleRevisionList,
|
|
256
260
|
handleRevisionGet,
|
|
257
261
|
handleRevisionRestore,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
} from "./api/handlers/revision.js";
|
|
263
|
+
import {
|
|
264
|
+
runSystemCleanup,
|
|
265
|
+
shouldRunSystemCleanup as shouldRunSystemCleanupNow,
|
|
266
|
+
} from "./cleanup.js";
|
|
267
|
+
import {
|
|
268
|
+
DEFAULT_COMMENT_MODERATOR_PLUGIN_ID,
|
|
269
|
+
defaultCommentModerate,
|
|
270
|
+
} from "./comments/moderator.js";
|
|
271
|
+
import { submitPublicComment } from "./comments/public-submission.js";
|
|
272
|
+
import {
|
|
273
|
+
CommentStatusConflictError,
|
|
274
|
+
createComment,
|
|
275
|
+
moderateComment,
|
|
276
|
+
type CommentCreateInput,
|
|
277
|
+
type CommentCreateResult,
|
|
278
|
+
type CommentHookRunner,
|
|
279
|
+
} from "./comments/service.js";
|
|
280
|
+
import { validateEncryptionKeyAtStartup } from "./config/secrets.js";
|
|
281
|
+
import { OptionsRepository } from "./database/repositories/options.js";
|
|
282
|
+
import type { Database } from "./database/types.js";
|
|
265
283
|
import { getDb } from "./loader.js";
|
|
266
284
|
import { isRecord } from "./plugin-utils.js";
|
|
267
285
|
import { CronExecutor, setCronTasksEnabled, type InvokeCronHookFn } from "./plugins/cron.js";
|
|
268
286
|
import { definePlugin } from "./plugins/define-plugin.js";
|
|
269
287
|
import { DEV_CONSOLE_EMAIL_PLUGIN_ID, devConsoleEmailDeliver } from "./plugins/email-console.js";
|
|
288
|
+
import {
|
|
289
|
+
createSmtpEmailDeliverFromDb,
|
|
290
|
+
isSmtpEnvConfigured,
|
|
291
|
+
SMTP_EMAIL_PLUGIN_ID,
|
|
292
|
+
} from "./plugins/email-smtp.js";
|
|
270
293
|
import { EmailPipeline } from "./plugins/email.js";
|
|
271
294
|
import {
|
|
272
295
|
createHookPipeline,
|
|
273
296
|
EXCLUSIVE_HOOK_KEY_PREFIX,
|
|
274
297
|
getActiveContentSaveHookName,
|
|
298
|
+
HookTimeoutError,
|
|
275
299
|
resolveExclusiveHooks as resolveExclusiveHooksShared,
|
|
276
300
|
type HookPipeline,
|
|
277
301
|
} from "./plugins/hooks.js";
|
|
@@ -292,13 +316,23 @@ import { isContentSaveRejection } from "./plugins/save-rejection.js";
|
|
|
292
316
|
import type { CronScheduler } from "./plugins/scheduler/types.js";
|
|
293
317
|
import { PluginStateRepository, rowToPluginState } from "./plugins/state.js";
|
|
294
318
|
import type { PluginState } from "./plugins/state.js";
|
|
295
|
-
import {
|
|
319
|
+
import {
|
|
320
|
+
generateIndexName,
|
|
321
|
+
getStorageIndexDefinitions,
|
|
322
|
+
syncDeclaredStorageIndexes,
|
|
323
|
+
type StorageIndexSyncResult,
|
|
324
|
+
} from "./plugins/storage-indexes.js";
|
|
296
325
|
import { getRegistryConfigInput, resolveManifestRegistryConfig } from "./registry/config.js";
|
|
297
326
|
import { requestCached } from "./request-cache.js";
|
|
298
327
|
import { getRequestContext } from "./request-context.js";
|
|
328
|
+
import { notifyRoom } from "./rooms/notifications.js";
|
|
329
|
+
import { roomId, RoomSaveError, type EntryRef, type RuntimeRoomHost } from "./rooms/types.js";
|
|
299
330
|
import { publishDueContent, type PublishedRef } from "./scheduled-publish.js";
|
|
331
|
+
import { normalizeBlocksData, resolveBlockTypes } from "./schema/block-values.js";
|
|
332
|
+
import { SchemaError, SchemaRegistry } from "./schema/registry.js";
|
|
300
333
|
import { FTSManager } from "./search/fts-manager.js";
|
|
301
334
|
import { invalidateSiteSettingsCache } from "./settings/index.js";
|
|
335
|
+
import type { Storage } from "./storage/types.js";
|
|
302
336
|
import { assertSiteWriteAllowed } from "./transfer/fence.js";
|
|
303
337
|
|
|
304
338
|
const DRAFT_ONLY_UPDATE_KEYS = new Set([
|
|
@@ -316,6 +350,8 @@ const DRAFT_ONLY_UPDATE_KEYS = new Set([
|
|
|
316
350
|
const ARRAY_FIELD_TYPES = new Set<string>(["portableText", "multiSelect", "repeater"]);
|
|
317
351
|
const MAX_DRAFT_STAGE_ATTEMPTS = 32;
|
|
318
352
|
const PLUGIN_INVOCATION_RELEASE_GRACE_MS = 60_000;
|
|
353
|
+
/** Publish errors a scheduled retry cannot clear: the entry has to change first. */
|
|
354
|
+
const SCHEDULED_REFUSAL_CODES: ReadonlySet<string> = new Set(["VALIDATION_ERROR", "SLUG_CONFLICT"]);
|
|
319
355
|
|
|
320
356
|
type ContentPolicyHookName =
|
|
321
357
|
| "content:beforePublish"
|
|
@@ -329,6 +365,20 @@ interface ContentPolicyMutationOptions {
|
|
|
329
365
|
pluginInvocationId?: string;
|
|
330
366
|
}
|
|
331
367
|
|
|
368
|
+
/** An operation the entry's room refused or couldn't hold for. */
|
|
369
|
+
type RoomOperationFailure = {
|
|
370
|
+
success: false;
|
|
371
|
+
error: { code: string; message: string };
|
|
372
|
+
status?: number;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
interface PublishOptions extends ContentPolicyMutationOptions {
|
|
376
|
+
publishedAt?: string;
|
|
377
|
+
requireScheduledDue?: boolean;
|
|
378
|
+
expectedScheduledAt?: string;
|
|
379
|
+
currentTime?: Date;
|
|
380
|
+
}
|
|
381
|
+
|
|
332
382
|
type ContentPolicyCheck =
|
|
333
383
|
| { allowed: true; revision: string }
|
|
334
384
|
| {
|
|
@@ -343,6 +393,8 @@ type ContentPolicyCheck =
|
|
|
343
393
|
*/
|
|
344
394
|
export interface SandboxedPluginEntry {
|
|
345
395
|
id: string;
|
|
396
|
+
displayName?: string;
|
|
397
|
+
description?: string;
|
|
346
398
|
version: string;
|
|
347
399
|
options: Record<string, unknown>;
|
|
348
400
|
code: string;
|
|
@@ -437,6 +489,12 @@ export interface MediaProviderContext {
|
|
|
437
489
|
*/
|
|
438
490
|
export type CreateSchedulerFn = (executor: CronExecutor) => CronScheduler;
|
|
439
491
|
|
|
492
|
+
/**
|
|
493
|
+
* Builds the runtime's co-editing room host. Injected via
|
|
494
|
+
* `virtual:emdash/rooms`, so only hosts that can run rooms load their code.
|
|
495
|
+
*/
|
|
496
|
+
export type CreateRoomHostFn = (runtime: EmDashRuntime) => RuntimeRoomHost | null;
|
|
497
|
+
|
|
440
498
|
/**
|
|
441
499
|
* Dependencies injected from virtual modules (middleware reads these)
|
|
442
500
|
*/
|
|
@@ -472,6 +530,12 @@ export interface RuntimeDependencies {
|
|
|
472
530
|
* integration means core has no adapter-specific runtime checks.
|
|
473
531
|
*/
|
|
474
532
|
createScheduler?: CreateSchedulerFn | null;
|
|
533
|
+
/**
|
|
534
|
+
* Factory for the co-editing room host, from the generated
|
|
535
|
+
* `virtual:emdash/rooms` module. When absent or null, or when it returns
|
|
536
|
+
* null, every join gets single-editor mode.
|
|
537
|
+
*/
|
|
538
|
+
createRoomHost?: CreateRoomHostFn | null;
|
|
475
539
|
/** Media provider entries from virtual module */
|
|
476
540
|
mediaProviderEntries?: MediaProviderEntry[];
|
|
477
541
|
sandboxedPluginEntries: SandboxedPluginEntry[];
|
|
@@ -542,6 +606,13 @@ export interface EmDashRuntimeParts {
|
|
|
542
606
|
pipelineRef: { current: HookPipeline };
|
|
543
607
|
}
|
|
544
608
|
|
|
609
|
+
function listConflict() {
|
|
610
|
+
return {
|
|
611
|
+
success: false as const,
|
|
612
|
+
error: { code: "LIST_CONFLICT", message: LIST_CONFLICT_MESSAGE },
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
|
|
545
616
|
/**
|
|
546
617
|
* A `ContentSaveRejectedError` carries a message the plugin wrote for the
|
|
547
618
|
* editor; every other exception stays internal and is replaced by a generic
|
|
@@ -575,6 +646,37 @@ function beforeSaveFailure(error: unknown) {
|
|
|
575
646
|
};
|
|
576
647
|
}
|
|
577
648
|
|
|
649
|
+
/**
|
|
650
|
+
* How a draft save's revision is credited. Only an autosave replaces the draft revision it builds
|
|
651
|
+
* on, and only when that one is an autosave too. An autosave names the save's editors, then the
|
|
652
|
+
* names it carries from the replaced autosave (or that revision's author when it names none), once
|
|
653
|
+
* each and latest first. A kept save names only the editors its caller passed, once each.
|
|
654
|
+
* `replaced` is the draft revision the save builds on, or null when there is none or it is also
|
|
655
|
+
* the live revision.
|
|
656
|
+
*/
|
|
657
|
+
function revisionCredit(input: {
|
|
658
|
+
autosave: boolean;
|
|
659
|
+
actorId: string | undefined;
|
|
660
|
+
editedBy: readonly string[] | undefined;
|
|
661
|
+
replaced: (RevisionCredit & { authorId: string | null }) | null;
|
|
662
|
+
}): { kind: RevisionKind | null; editedBy: string[] | null; replaces: boolean } {
|
|
663
|
+
const { autosave, actorId, editedBy, replaced } = input;
|
|
664
|
+
if (!autosave) {
|
|
665
|
+
return {
|
|
666
|
+
kind: null,
|
|
667
|
+
editedBy: editedBy?.length ? [...new Set(editedBy)] : null,
|
|
668
|
+
replaces: false,
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
const replaces = replaced?.kind === "autosave";
|
|
672
|
+
const own = editedBy ?? (actorId ? [actorId] : []);
|
|
673
|
+
const carried = replaces
|
|
674
|
+
? (replaced.editedBy ?? (replaced.authorId ? [replaced.authorId] : []))
|
|
675
|
+
: [];
|
|
676
|
+
const names = [...new Set([...own, ...carried])];
|
|
677
|
+
return { kind: "autosave", editedBy: names.length > 0 ? names : null, replaces };
|
|
678
|
+
}
|
|
679
|
+
|
|
578
680
|
/**
|
|
579
681
|
* Convert a ContentItem to Record<string, unknown> for hook consumption.
|
|
580
682
|
* Hooks receive the full item as a flat record.
|
|
@@ -661,6 +763,16 @@ function getDbHolder(): DbHolder {
|
|
|
661
763
|
*/
|
|
662
764
|
const DB_INIT_FAILURE_BACKOFF_MS = 30_000;
|
|
663
765
|
|
|
766
|
+
/** The failure a db init is still backing off from, if any. */
|
|
767
|
+
function activeInitFailure(holder: DbHolder, cacheKey: string) {
|
|
768
|
+
const failure = holder.failures.get(cacheKey);
|
|
769
|
+
if (!failure) return undefined;
|
|
770
|
+
if (Date.now() - failure.at < DB_INIT_FAILURE_BACKOFF_MS) return failure;
|
|
771
|
+
// Expired — drop it so the map only ever holds active backoffs.
|
|
772
|
+
holder.failures.delete(cacheKey);
|
|
773
|
+
return undefined;
|
|
774
|
+
}
|
|
775
|
+
|
|
664
776
|
/**
|
|
665
777
|
* The most content rows auto mode migrates inside a deployed Worker request.
|
|
666
778
|
* Datetime normalization (079) issues about one statement per row it changes,
|
|
@@ -790,6 +902,7 @@ export class EmDashRuntime {
|
|
|
790
902
|
readonly email: EmailPipeline | null;
|
|
791
903
|
|
|
792
904
|
private cronScheduler: CronScheduler | null;
|
|
905
|
+
private _rooms: RuntimeRoomHost | null = null;
|
|
793
906
|
private enabledPlugins: Set<string>;
|
|
794
907
|
private pluginStates: Map<string, string>;
|
|
795
908
|
private readonly activePluginContentActions = new Map<string, number>();
|
|
@@ -819,8 +932,17 @@ export class EmDashRuntime {
|
|
|
819
932
|
/** All plugins eligible for the hook pipeline (includes built-in plugins).
|
|
820
933
|
* Stored so we can rebuild the pipeline when plugins are enabled/disabled. */
|
|
821
934
|
private allPipelinePlugins: ResolvedPlugin[];
|
|
822
|
-
/**
|
|
823
|
-
|
|
935
|
+
/**
|
|
936
|
+
* Plugin IDs whose declared storage indexes have been materialized without
|
|
937
|
+
* errors. Per-plugin tracking lets retries target only the plugins that
|
|
938
|
+
* failed a previous synchronization, and it keeps newly-installed plugins
|
|
939
|
+
* from being treated as ready before their own indexes exist.
|
|
940
|
+
*/
|
|
941
|
+
private storageIndexesReady = new Set<string>();
|
|
942
|
+
private storageIndexesSyncPromises = new Map<
|
|
943
|
+
string,
|
|
944
|
+
{ declaration: object; promise: Promise<StorageIndexSyncResult> }
|
|
945
|
+
>();
|
|
824
946
|
/** Factory options for the hook pipeline context factory */
|
|
825
947
|
private pipelineFactoryOptions: {
|
|
826
948
|
db: Kysely<Database>;
|
|
@@ -865,6 +987,11 @@ export class EmDashRuntime {
|
|
|
865
987
|
return this._db;
|
|
866
988
|
}
|
|
867
989
|
|
|
990
|
+
/** Co-editing rooms, or null where co-editing is off or this host can't run rooms. */
|
|
991
|
+
get rooms(): RuntimeRoomHost | null {
|
|
992
|
+
return this._rooms;
|
|
993
|
+
}
|
|
994
|
+
|
|
868
995
|
/** Bind the platform cache provider used by plugin actions, including request-less cron hooks. */
|
|
869
996
|
setPluginContentCacheInvalidator(
|
|
870
997
|
invalidateContentCache: PluginContentCacheInvalidator | undefined,
|
|
@@ -973,6 +1100,16 @@ export class EmDashRuntime {
|
|
|
973
1100
|
if (options.invalidateContentCache) {
|
|
974
1101
|
this.pluginContentCacheInvalidator = options.invalidateContentCache;
|
|
975
1102
|
}
|
|
1103
|
+
|
|
1104
|
+
// Try to materialize plugin-declared indexes before any scheduled plugin
|
|
1105
|
+
// work runs. A partial result leaves failed plugins unmarked so the next
|
|
1106
|
+
// tick retries them.
|
|
1107
|
+
try {
|
|
1108
|
+
await this.ensureStorageIndexesSynced();
|
|
1109
|
+
} catch (error) {
|
|
1110
|
+
console.error("[plugins] Storage index sync failed:", error);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
976
1113
|
let processed = 0;
|
|
977
1114
|
if (this.cronExecutor) {
|
|
978
1115
|
try {
|
|
@@ -1016,8 +1153,10 @@ export class EmDashRuntime {
|
|
|
1016
1153
|
|
|
1017
1154
|
await this.runSystemCleanupIfDue(currentTime);
|
|
1018
1155
|
|
|
1156
|
+
// Retry any plugin storage-index sync that did not complete earlier in
|
|
1157
|
+
// this tick or in a previous tick.
|
|
1019
1158
|
try {
|
|
1020
|
-
await this.
|
|
1159
|
+
await this.ensureStorageIndexesSynced();
|
|
1021
1160
|
} catch (error) {
|
|
1022
1161
|
console.error("[plugins] Storage index sync failed:", error);
|
|
1023
1162
|
}
|
|
@@ -1043,24 +1182,151 @@ export class EmDashRuntime {
|
|
|
1043
1182
|
} catch (error) {
|
|
1044
1183
|
console.error("[cleanup] System cleanup failed:", error);
|
|
1045
1184
|
}
|
|
1185
|
+
if (this._rooms) {
|
|
1186
|
+
try {
|
|
1187
|
+
await this._rooms.expireIdle();
|
|
1188
|
+
} catch (error) {
|
|
1189
|
+
console.error("[co-editing] Hourly room drop failed:", error);
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1046
1192
|
}
|
|
1047
1193
|
|
|
1048
1194
|
/**
|
|
1049
|
-
*
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1195
|
+
* Build the deduplicated set of plugins that may declare storage indexes.
|
|
1196
|
+
* Includes configured/trusted plugins, adapted sandboxed plugins, and cached
|
|
1197
|
+
* marketplace/registry manifests for plugins that may not have been loaded
|
|
1198
|
+
* into the pipeline yet.
|
|
1053
1199
|
*/
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1200
|
+
private getStorageIndexPlugins(): Map<
|
|
1201
|
+
string,
|
|
1202
|
+
{
|
|
1203
|
+
id: string;
|
|
1204
|
+
storage?: Record<
|
|
1205
|
+
string,
|
|
1206
|
+
{ indexes: Array<string | string[]>; uniqueIndexes?: Array<string | string[]> }
|
|
1207
|
+
>;
|
|
1208
|
+
}
|
|
1209
|
+
> {
|
|
1210
|
+
const map = new Map<
|
|
1211
|
+
string,
|
|
1212
|
+
{
|
|
1213
|
+
id: string;
|
|
1214
|
+
storage?: Record<
|
|
1215
|
+
string,
|
|
1216
|
+
{ indexes: Array<string | string[]>; uniqueIndexes?: Array<string | string[]> }
|
|
1217
|
+
>;
|
|
1218
|
+
}
|
|
1219
|
+
>();
|
|
1220
|
+
for (const plugin of this.allPipelinePlugins) {
|
|
1221
|
+
map.set(plugin.id, plugin);
|
|
1222
|
+
}
|
|
1223
|
+
for (const manifest of marketplaceManifestCache.values()) {
|
|
1224
|
+
if (!map.has(manifest.id)) {
|
|
1225
|
+
map.set(manifest.id, manifest);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
return map;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
private async runStorageIndexSync(pluginId: string): Promise<StorageIndexSyncResult> {
|
|
1232
|
+
const candidates = [...this.getStorageIndexPlugins().values()].filter(
|
|
1233
|
+
(plugin) => !this.storageIndexesReady.has(plugin.id) && plugin.id === pluginId,
|
|
1234
|
+
);
|
|
1235
|
+
const errors: StorageIndexSyncResult["errors"] = [];
|
|
1236
|
+
|
|
1237
|
+
for (const plugin of candidates) {
|
|
1238
|
+
try {
|
|
1239
|
+
const stored = await this.db
|
|
1240
|
+
.selectFrom("_plugin_indexes")
|
|
1241
|
+
.select(["collection", "index_name"])
|
|
1242
|
+
.where("plugin_id", "=", plugin.id)
|
|
1243
|
+
.execute();
|
|
1244
|
+
const storage = { ...plugin.storage };
|
|
1245
|
+
const expected = new Map<string, Set<string>>();
|
|
1246
|
+
for (const [collection, config] of Object.entries(storage)) {
|
|
1247
|
+
expected.set(
|
|
1248
|
+
collection,
|
|
1249
|
+
new Set(
|
|
1250
|
+
getStorageIndexDefinitions(config.indexes, config).map((entry) =>
|
|
1251
|
+
generateIndexName(plugin.id, collection, entry.fields, {
|
|
1252
|
+
unique: entry.unique,
|
|
1253
|
+
}),
|
|
1254
|
+
),
|
|
1255
|
+
),
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
let hasExtra = false;
|
|
1259
|
+
for (const row of stored) {
|
|
1260
|
+
if (!expected.get(row.collection)?.delete(row.index_name)) hasExtra = true;
|
|
1261
|
+
// Removed collections still need their old indexes dropped.
|
|
1262
|
+
if (!Object.hasOwn(storage, row.collection)) storage[row.collection] = { indexes: [] };
|
|
1263
|
+
}
|
|
1264
|
+
const hasMissing = [...expected.values()].some((names) => names.size > 0);
|
|
1265
|
+
if (hasExtra || hasMissing) {
|
|
1266
|
+
const result = await syncDeclaredStorageIndexes(this.db, [{ id: plugin.id, storage }]);
|
|
1267
|
+
errors.push(...result.errors);
|
|
1268
|
+
if (!result.ok) continue;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
// A version change can invalidate a pass while its database work is in flight.
|
|
1272
|
+
if (this.getStorageIndexPlugins().get(plugin.id) === plugin) {
|
|
1273
|
+
this.storageIndexesReady.add(plugin.id);
|
|
1274
|
+
}
|
|
1275
|
+
} catch (error) {
|
|
1276
|
+
console.error(`[plugins] Failed to check storage indexes for ${plugin.id}:`, error);
|
|
1277
|
+
errors.push({
|
|
1278
|
+
pluginId: plugin.id,
|
|
1279
|
+
collection: "(sync)",
|
|
1280
|
+
index: "(sync)",
|
|
1281
|
+
error: error instanceof Error ? error.message : String(error),
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
return { ok: errors.length === 0, errors };
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
private invalidateStorageIndexReadiness(pluginId: string): void {
|
|
1290
|
+
// Keep the flight: its DDL must finish before a replacement version can sync.
|
|
1291
|
+
this.storageIndexesReady.delete(pluginId);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* Ensure declared storage indexes are ready before state-changing plugin
|
|
1296
|
+
* work runs. Returns `true` only when the requested plugin (or all plugins,
|
|
1297
|
+
* when no ID is given) has been successfully synchronized. Uses a single
|
|
1298
|
+
* in-flight sync per plugin, shared by targeted and all-plugin callers.
|
|
1299
|
+
*/
|
|
1300
|
+
async ensureStorageIndexesSynced(pluginId?: string): Promise<boolean> {
|
|
1301
|
+
if (!pluginId) {
|
|
1302
|
+
const results = await Promise.all(
|
|
1303
|
+
Array.from(this.getStorageIndexPlugins().keys(), (id) =>
|
|
1304
|
+
this.ensureStorageIndexesSynced(id),
|
|
1305
|
+
),
|
|
1306
|
+
);
|
|
1307
|
+
return results.every(Boolean);
|
|
1308
|
+
}
|
|
1309
|
+
if (this.storageIndexesReady.has(pluginId)) return true;
|
|
1310
|
+
|
|
1311
|
+
const declaration = this.getStorageIndexPlugins().get(pluginId);
|
|
1312
|
+
if (!declaration) return false;
|
|
1313
|
+
let flight = this.storageIndexesSyncPromises.get(pluginId);
|
|
1314
|
+
if (!flight) {
|
|
1315
|
+
const promise = this.runStorageIndexSync(pluginId).finally(() => {
|
|
1316
|
+
if (this.storageIndexesSyncPromises.get(pluginId)?.promise === promise) {
|
|
1317
|
+
this.storageIndexesSyncPromises.delete(pluginId);
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
flight = { declaration, promise };
|
|
1321
|
+
this.storageIndexesSyncPromises.set(pluginId, flight);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
await flight.promise;
|
|
1325
|
+
if (this.getStorageIndexPlugins().get(pluginId) !== declaration) return false;
|
|
1326
|
+
if (flight.declaration !== declaration) {
|
|
1327
|
+
return this.ensureStorageIndexesSynced(pluginId);
|
|
1328
|
+
}
|
|
1329
|
+
return this.storageIndexesReady.has(pluginId);
|
|
1064
1330
|
}
|
|
1065
1331
|
|
|
1066
1332
|
/**
|
|
@@ -1075,6 +1341,7 @@ export class EmDashRuntime {
|
|
|
1075
1341
|
|
|
1076
1342
|
/** Stop background work and discard loaded sandbox isolates. */
|
|
1077
1343
|
async shutdown(): Promise<void> {
|
|
1344
|
+
await this._rooms?.shutdown();
|
|
1078
1345
|
await this.stopCron();
|
|
1079
1346
|
sandboxRunner?.setCommentModerate?.(null);
|
|
1080
1347
|
await sandboxRunner?.terminateAll();
|
|
@@ -1097,10 +1364,20 @@ export class EmDashRuntime {
|
|
|
1097
1364
|
async setPluginStatus(pluginId: string, status: "active" | "inactive"): Promise<void> {
|
|
1098
1365
|
this.pluginStates.set(pluginId, status);
|
|
1099
1366
|
if (status === "active") {
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1367
|
+
try {
|
|
1368
|
+
this.setSandboxedPluginActive(pluginId, true);
|
|
1369
|
+
this.enabledPlugins.add(pluginId);
|
|
1370
|
+
await this.rebuildHookPipeline();
|
|
1371
|
+
const results = await this._hooks.runPluginActivate(pluginId);
|
|
1372
|
+
const failure = results.find((result) => !result.success);
|
|
1373
|
+
if (failure) throw failure.error ?? new Error("Plugin activation failed");
|
|
1374
|
+
} catch (error) {
|
|
1375
|
+
this.pluginStates.set(pluginId, "inactive");
|
|
1376
|
+
this.setSandboxedPluginActive(pluginId, false);
|
|
1377
|
+
this.enabledPlugins.delete(pluginId);
|
|
1378
|
+
await this.rebuildHookPipeline();
|
|
1379
|
+
throw error;
|
|
1380
|
+
}
|
|
1104
1381
|
} else {
|
|
1105
1382
|
try {
|
|
1106
1383
|
// Deactivate hooks retain access until their cleanup has finished.
|
|
@@ -1159,12 +1436,13 @@ export class EmDashRuntime {
|
|
|
1159
1436
|
}
|
|
1160
1437
|
|
|
1161
1438
|
/**
|
|
1162
|
-
* Run install → activate once for each
|
|
1439
|
+
* Run install → activate once for each loaded plugin registered in the
|
|
1163
1440
|
* integration config that has no `_plugin_state` row.
|
|
1164
1441
|
*
|
|
1165
1442
|
* Only the isolate whose insert creates the row runs the hooks. A plugin
|
|
1166
|
-
* whose hooks fail is recorded as inactive rather than retried on later
|
|
1167
|
-
* boots; re-enabling it from the admin runs `plugin:activate`.
|
|
1443
|
+
* whose own hooks fail is recorded as inactive rather than retried on later
|
|
1444
|
+
* boots; re-enabling it from the admin runs `plugin:activate`. Sandbox
|
|
1445
|
+
* unavailability leaves no state so the next boot can retry.
|
|
1168
1446
|
*/
|
|
1169
1447
|
private async installUnrecordedConfigPlugins(
|
|
1170
1448
|
configPlugins: ResolvedPlugin[],
|
|
@@ -1172,7 +1450,33 @@ export class EmDashRuntime {
|
|
|
1172
1450
|
): Promise<void> {
|
|
1173
1451
|
const stateRepo = new PluginStateRepository(this.db);
|
|
1174
1452
|
const failed: ResolvedPlugin[] = [];
|
|
1175
|
-
|
|
1453
|
+
let sandboxReadinessFailed = false;
|
|
1454
|
+
let sandboxReadiness: Promise<void> | undefined;
|
|
1455
|
+
const recordFailure = async (
|
|
1456
|
+
plugin: ResolvedPlugin,
|
|
1457
|
+
hook: string,
|
|
1458
|
+
error: Error | undefined,
|
|
1459
|
+
) => {
|
|
1460
|
+
if (
|
|
1461
|
+
this.sandboxedPlugins.has(`${plugin.id}:${plugin.version}`) &&
|
|
1462
|
+
(error?.name === "SandboxUnavailableError" ||
|
|
1463
|
+
(error instanceof HookTimeoutError && sandboxRunner && !sandboxRunner.isHealthy()))
|
|
1464
|
+
) {
|
|
1465
|
+
sandboxReadiness = undefined;
|
|
1466
|
+
await this.db
|
|
1467
|
+
.deleteFrom("_plugin_state")
|
|
1468
|
+
.where("plugin_id", "=", plugin.id)
|
|
1469
|
+
.where("version", "=", plugin.version)
|
|
1470
|
+
.where("source", "=", "config")
|
|
1471
|
+
.where("status", "=", "active")
|
|
1472
|
+
.execute();
|
|
1473
|
+
this.pluginStates.delete(plugin.id);
|
|
1474
|
+
console.warn(
|
|
1475
|
+
`EmDash: Sandbox unavailable for config plugin "${plugin.id}"; retrying on next boot:`,
|
|
1476
|
+
error,
|
|
1477
|
+
);
|
|
1478
|
+
return;
|
|
1479
|
+
}
|
|
1176
1480
|
console.error(
|
|
1177
1481
|
`EmDash: ${hook} failed for config plugin "${plugin.id}"; disabling it:`,
|
|
1178
1482
|
error,
|
|
@@ -1184,20 +1488,60 @@ export class EmDashRuntime {
|
|
|
1184
1488
|
if (recordedStates.has(plugin.id)) continue;
|
|
1185
1489
|
|
|
1186
1490
|
try {
|
|
1491
|
+
if (
|
|
1492
|
+
this.sandboxedPlugins.has(`${plugin.id}:${plugin.version}`) &&
|
|
1493
|
+
(plugin.hooks["plugin:install"] || plugin.hooks["plugin:activate"])
|
|
1494
|
+
) {
|
|
1495
|
+
if (sandboxReadinessFailed) continue;
|
|
1496
|
+
try {
|
|
1497
|
+
// Readiness has its own deadline, not the hook's execution budget.
|
|
1498
|
+
await (sandboxReadiness ??=
|
|
1499
|
+
sandboxRunner?.ensureRunning?.({ waitForPendingRestart: true }) ?? Promise.resolve());
|
|
1500
|
+
if (sandboxRunner && !sandboxRunner.isHealthy()) {
|
|
1501
|
+
throw new SandboxUnavailableError(
|
|
1502
|
+
plugin.id,
|
|
1503
|
+
sandboxRunner.unavailableReason?.() ?? "not ready",
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
} catch (error) {
|
|
1507
|
+
sandboxReadinessFailed = true;
|
|
1508
|
+
console.warn(
|
|
1509
|
+
`EmDash: Sandbox not ready for config plugin "${plugin.id}"; retrying on next boot:`,
|
|
1510
|
+
error,
|
|
1511
|
+
);
|
|
1512
|
+
continue;
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1187
1515
|
if (!(await stateRepo.createActiveIfAbsent(plugin.id, plugin.version, "config"))) continue;
|
|
1188
1516
|
this.pluginStates.set(plugin.id, "active");
|
|
1189
1517
|
|
|
1190
1518
|
const install = await this._hooks.runPluginInstall(plugin.id);
|
|
1191
1519
|
const installFailure = install.find((result) => !result.success);
|
|
1192
1520
|
if (installFailure) {
|
|
1193
|
-
recordFailure(plugin, "plugin:install", installFailure.error);
|
|
1521
|
+
await recordFailure(plugin, "plugin:install", installFailure.error);
|
|
1194
1522
|
continue;
|
|
1195
1523
|
}
|
|
1196
1524
|
|
|
1525
|
+
if (
|
|
1526
|
+
this.sandboxedPlugins.has(`${plugin.id}:${plugin.version}`) &&
|
|
1527
|
+
plugin.hooks["plugin:activate"] &&
|
|
1528
|
+
sandboxRunner &&
|
|
1529
|
+
!sandboxRunner.isHealthy()
|
|
1530
|
+
) {
|
|
1531
|
+
await recordFailure(
|
|
1532
|
+
plugin,
|
|
1533
|
+
"plugin:activate",
|
|
1534
|
+
new SandboxUnavailableError(
|
|
1535
|
+
plugin.id,
|
|
1536
|
+
sandboxRunner.unavailableReason?.() ?? "not ready",
|
|
1537
|
+
),
|
|
1538
|
+
);
|
|
1539
|
+
continue;
|
|
1540
|
+
}
|
|
1197
1541
|
const activate = await this._hooks.runPluginActivate(plugin.id);
|
|
1198
1542
|
const activateFailure = activate.find((result) => !result.success);
|
|
1199
1543
|
if (activateFailure) {
|
|
1200
|
-
recordFailure(plugin, "plugin:activate", activateFailure.error);
|
|
1544
|
+
await recordFailure(plugin, "plugin:activate", activateFailure.error);
|
|
1201
1545
|
}
|
|
1202
1546
|
} catch (error) {
|
|
1203
1547
|
console.error(`EmDash: Config plugin "${plugin.id}" install/activate failed:`, error);
|
|
@@ -1213,6 +1557,7 @@ export class EmDashRuntime {
|
|
|
1213
1557
|
console.error(`EmDash: Failed to record config plugin "${plugin.id}" as disabled:`, error);
|
|
1214
1558
|
}
|
|
1215
1559
|
this.pluginStates.set(plugin.id, "inactive");
|
|
1560
|
+
this.setSandboxedPluginActive(plugin.id, false);
|
|
1216
1561
|
this.enabledPlugins.delete(plugin.id);
|
|
1217
1562
|
}
|
|
1218
1563
|
await this.rebuildHookPipeline();
|
|
@@ -1388,6 +1733,7 @@ export class EmDashRuntime {
|
|
|
1388
1733
|
}
|
|
1389
1734
|
|
|
1390
1735
|
const loaded = await sandboxRunner.load(bundle.manifest, bundle.backendCode);
|
|
1736
|
+
this.invalidateStorageIndexReadiness(pluginId);
|
|
1391
1737
|
sandboxedPluginCache.set(key, loaded);
|
|
1392
1738
|
sandboxedManifestCache.set(key, bundle.manifest);
|
|
1393
1739
|
this.sandboxedPlugins.set(key, loaded);
|
|
@@ -1432,6 +1778,7 @@ export class EmDashRuntime {
|
|
|
1432
1778
|
* Mutates allPipelinePlugins and configuredPlugins in place.
|
|
1433
1779
|
*/
|
|
1434
1780
|
private removePluginFromLists(pluginId: string): void {
|
|
1781
|
+
this.invalidateStorageIndexReadiness(pluginId);
|
|
1435
1782
|
const allIdx = this.allPipelinePlugins.findIndex((p) => p.id === pluginId);
|
|
1436
1783
|
if (allIdx !== -1) this.allPipelinePlugins.splice(allIdx, 1);
|
|
1437
1784
|
const configIdx = this.configuredPlugins.findIndex((p) => p.id === pluginId);
|
|
@@ -1542,6 +1889,7 @@ export class EmDashRuntime {
|
|
|
1542
1889
|
const existing = this.allPipelinePlugins.find((p) => p.id === pluginId);
|
|
1543
1890
|
if (existing && existing.version === bundle.manifest.version) continue;
|
|
1544
1891
|
|
|
1892
|
+
this.invalidateStorageIndexReadiness(pluginId);
|
|
1545
1893
|
// Remove any older version
|
|
1546
1894
|
if (existing) {
|
|
1547
1895
|
this.removePluginFromLists(pluginId);
|
|
@@ -1623,27 +1971,6 @@ export class EmDashRuntime {
|
|
|
1623
1971
|
}
|
|
1624
1972
|
};
|
|
1625
1973
|
|
|
1626
|
-
// Initialize the database and enforce its configured migration policy.
|
|
1627
|
-
const db = await phase("rt.db", "DB init + migration policy", () =>
|
|
1628
|
-
EmDashRuntime.getDatabase(deps),
|
|
1629
|
-
);
|
|
1630
|
-
|
|
1631
|
-
// Resolver for the live connection, mirroring the `get db()` getter
|
|
1632
|
-
// below (which can't be used here — the runtime instance doesn't exist
|
|
1633
|
-
// yet). Long-lived subsystems built during create() (cron executor,
|
|
1634
|
-
// plugin context factory, media providers) capture this resolver rather
|
|
1635
|
-
// than the `db` snapshot, so a connection-backed adapter (Postgres over
|
|
1636
|
-
// Hyperdrive) serves their queries from the current request/event-scoped
|
|
1637
|
-
// connection in ALS instead of the per-isolate singleton — whose socket
|
|
1638
|
-
// belongs to an earlier request and would trip workerd's cross-request
|
|
1639
|
-
// I/O guard. Stateless adapters (D1, Node SQLite) set no ALS db on most
|
|
1640
|
-
// paths, so this falls back to the singleton: unchanged behavior.
|
|
1641
|
-
const resolveDb = (): Kysely<Database> => {
|
|
1642
|
-
const ctx = getRequestContext();
|
|
1643
|
-
// eslint-disable-next-line typescript/no-unsafe-type-assertion -- ALS db is typed unknown to avoid a circular import; middleware always sets a Kysely<Database>
|
|
1644
|
-
return (ctx?.db as Kysely<Database> | undefined) ?? db;
|
|
1645
|
-
};
|
|
1646
|
-
|
|
1647
1974
|
// Validate EMDASH_ENCRYPTION_KEY once here so a malformed value
|
|
1648
1975
|
// surfaces in startup logs. Plugin secret-setting operations re-read
|
|
1649
1976
|
// the key and fail closed at their own boundary, so validation here
|
|
@@ -1656,27 +1983,9 @@ export class EmDashRuntime {
|
|
|
1656
1983
|
// Initialize storage (sync)
|
|
1657
1984
|
const storage = EmDashRuntime.getStorage(deps);
|
|
1658
1985
|
|
|
1659
|
-
let pluginStates: Map<string, string> = new Map();
|
|
1660
|
-
let pluginStatesRead = false;
|
|
1661
|
-
let installedPluginStates: PluginState[] = [];
|
|
1662
|
-
let exclusiveHookSelections: Map<string, string | undefined> | undefined;
|
|
1663
1986
|
const configuredLocales: string[] =
|
|
1664
1987
|
virtualConfig?.i18n?.locales ?? getI18nConfig()?.locales ?? [];
|
|
1665
1988
|
const localeCasingRepairVersion = getLocaleCasingRepairVersion(configuredLocales);
|
|
1666
|
-
let storedLocaleCasingRepairVersion: string | undefined;
|
|
1667
|
-
let siteInfo:
|
|
1668
|
-
| {
|
|
1669
|
-
siteName?: string;
|
|
1670
|
-
siteUrl?: string;
|
|
1671
|
-
locale?: string;
|
|
1672
|
-
trailingSlash?: "always" | "never" | "ignore";
|
|
1673
|
-
}
|
|
1674
|
-
| undefined;
|
|
1675
|
-
// "Already complete" by default so a read failure (e.g. tables absent on a
|
|
1676
|
-
// pre-migration db) skips seeding rather than seeding a half-built db.
|
|
1677
|
-
let seedComplete = true;
|
|
1678
|
-
let setupDone = true;
|
|
1679
|
-
let seedCollectionsReadable = false;
|
|
1680
1989
|
|
|
1681
1990
|
// Seeding must only touch the configured singleton, never a borrowed
|
|
1682
1991
|
// per-request db (playground / DO preview) or the loader-fallback db.
|
|
@@ -1691,7 +2000,7 @@ export class EmDashRuntime {
|
|
|
1691
2000
|
// singleton must never coalesce or one request's reads could land in
|
|
1692
2001
|
// another's batch. Backends without a coalescing dialect (Node/SQLite)
|
|
1693
2002
|
// fall back to the singleton, where serialization costs nothing.
|
|
1694
|
-
let
|
|
2003
|
+
let coalescingDb: Kysely<Database> | undefined;
|
|
1695
2004
|
let readDbDisposable: Kysely<Database> | undefined;
|
|
1696
2005
|
const disposeReadDb = async () => {
|
|
1697
2006
|
const disposable = readDbDisposable;
|
|
@@ -1707,14 +2016,13 @@ export class EmDashRuntime {
|
|
|
1707
2016
|
try {
|
|
1708
2017
|
const dialect = deps.createCoalescingDialect(deps.config.database.config);
|
|
1709
2018
|
if (dialect) {
|
|
1710
|
-
|
|
1711
|
-
readDbDisposable =
|
|
2019
|
+
coalescingDb = new Kysely<Database>({ dialect, log: kyselyLogOption() });
|
|
2020
|
+
readDbDisposable = coalescingDb;
|
|
1712
2021
|
}
|
|
1713
2022
|
} catch {
|
|
1714
|
-
|
|
2023
|
+
// Fall back to the singleton below.
|
|
1715
2024
|
}
|
|
1716
2025
|
}
|
|
1717
|
-
const optionsRepo = new OptionsRepository(readDb);
|
|
1718
2026
|
let missingManualSchemaError: unknown;
|
|
1719
2027
|
const captureMissingManualSchema = (error: unknown) => {
|
|
1720
2028
|
if ((deps.migrationMode ?? "auto") === "manual" && isMissingTableError(error)) {
|
|
@@ -1722,8 +2030,9 @@ export class EmDashRuntime {
|
|
|
1722
2030
|
}
|
|
1723
2031
|
};
|
|
1724
2032
|
|
|
1725
|
-
const readSiteInfo = async () => {
|
|
1726
|
-
const siteOpts = await
|
|
2033
|
+
const readSiteInfo = async (readDb: Kysely<Database>) => {
|
|
2034
|
+
const siteOpts = await new OptionsRepository(readDb).getMany([
|
|
2035
|
+
"site:title",
|
|
1727
2036
|
"emdash:site_title",
|
|
1728
2037
|
"site:url",
|
|
1729
2038
|
"emdash:site_url",
|
|
@@ -1732,7 +2041,10 @@ export class EmDashRuntime {
|
|
|
1732
2041
|
AUTO_SEED_COMPLETE_OPTION,
|
|
1733
2042
|
SETUP_COMPLETE_OPTION,
|
|
1734
2043
|
]);
|
|
1735
|
-
const siteTitle =
|
|
2044
|
+
const siteTitle = resolveSiteTitle(
|
|
2045
|
+
siteOpts.get("site:title"),
|
|
2046
|
+
siteOpts.get("emdash:site_title"),
|
|
2047
|
+
);
|
|
1736
2048
|
const siteUrl = resolveSiteOrigin(
|
|
1737
2049
|
deps.config,
|
|
1738
2050
|
siteOpts.get("site:url"),
|
|
@@ -1740,91 +2052,183 @@ export class EmDashRuntime {
|
|
|
1740
2052
|
);
|
|
1741
2053
|
const locale = siteOpts.get("emdash:locale");
|
|
1742
2054
|
const repairVersion = siteOpts.get(LOCALE_CASING_REPAIR_OPTION);
|
|
1743
|
-
storedLocaleCasingRepairVersion =
|
|
1744
|
-
typeof repairVersion === "string" ? repairVersion : undefined;
|
|
1745
|
-
seedComplete = siteOpts.get(AUTO_SEED_COMPLETE_OPTION) === true;
|
|
1746
|
-
setupDone = siteOpts.get(SETUP_COMPLETE_OPTION) === true;
|
|
1747
2055
|
return {
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
2056
|
+
siteInfo: {
|
|
2057
|
+
siteName: deps.siteInfo?.name ?? siteTitle,
|
|
2058
|
+
siteUrl: deps.siteInfo?.url ?? siteUrl,
|
|
2059
|
+
locale: deps.siteInfo?.locale ?? (typeof locale === "string" ? locale : undefined),
|
|
2060
|
+
// trailingSlash is a build-time Astro routing decision, not a
|
|
2061
|
+
// user-editable setting, so it comes from the Astro config
|
|
2062
|
+
// (virtual:emdash/config), not the options table.
|
|
2063
|
+
trailingSlash: deps.siteInfo?.trailingSlash ?? virtualConfig?.trailingSlash,
|
|
2064
|
+
},
|
|
2065
|
+
storedLocaleCasingRepairVersion:
|
|
2066
|
+
typeof repairVersion === "string" ? repairVersion : undefined,
|
|
2067
|
+
seedComplete: siteOpts.get(AUTO_SEED_COMPLETE_OPTION) === true,
|
|
2068
|
+
setupDone: siteOpts.get(SETUP_COMPLETE_OPTION) === true,
|
|
1755
2069
|
};
|
|
1756
2070
|
};
|
|
1757
2071
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
captureMissingManualSchema(error);
|
|
1777
|
-
// options may not exist yet on a pre-migration db.
|
|
1778
|
-
}
|
|
1779
|
-
}),
|
|
1780
|
-
phase("rt.hookselections", "Exclusive hook selections", async () => {
|
|
1781
|
-
// Built-in and sandboxed providers register after these reads, so
|
|
1782
|
-
// only configured plugins' hooks and the always-present
|
|
1783
|
-
// comment:moderate are known here. Hook resolution reads the rest.
|
|
1784
|
-
const keys = Array.from(
|
|
1785
|
-
new Set([
|
|
1786
|
-
"comment:moderate",
|
|
1787
|
-
...deps.plugins.flatMap((plugin) =>
|
|
1788
|
-
Object.entries(plugin.hooks)
|
|
1789
|
-
.filter(([, hook]) => hook?.exclusive)
|
|
1790
|
-
.map(([name]) => name),
|
|
1791
|
-
),
|
|
1792
|
-
]),
|
|
1793
|
-
(name) => `${EXCLUSIVE_HOOK_KEY_PREFIX}${name}`,
|
|
1794
|
-
);
|
|
1795
|
-
try {
|
|
1796
|
-
const stored = await optionsRepo.getMany<string>(keys);
|
|
1797
|
-
exclusiveHookSelections = new Map(keys.map((key) => [key, stored.get(key)]));
|
|
1798
|
-
} catch (error) {
|
|
1799
|
-
captureMissingManualSchema(error);
|
|
1800
|
-
// Hook resolution reads the selections itself when this fails.
|
|
1801
|
-
}
|
|
1802
|
-
}),
|
|
1803
|
-
];
|
|
1804
|
-
|
|
1805
|
-
if (ownsConfiguredDb) {
|
|
1806
|
-
coldStartReads.push(
|
|
1807
|
-
phase("rt.seedcheck", "Auto-seed gate", async () => {
|
|
2072
|
+
// Each pass returns its own results, so a pass that runs again after
|
|
2073
|
+
// migrations replaces the first pass's results whole.
|
|
2074
|
+
const runColdStartReads = async (readDb: Kysely<Database>) => {
|
|
2075
|
+
const reads: {
|
|
2076
|
+
pluginStates: Map<string, string>;
|
|
2077
|
+
pluginStatesRead: boolean;
|
|
2078
|
+
installedPluginStates: PluginState[];
|
|
2079
|
+
exclusiveHookSelections?: Map<string, string | undefined>;
|
|
2080
|
+
site?: Awaited<ReturnType<typeof readSiteInfo>>;
|
|
2081
|
+
seedCollectionsReadable: boolean;
|
|
2082
|
+
} = {
|
|
2083
|
+
pluginStates: new Map(),
|
|
2084
|
+
pluginStatesRead: false,
|
|
2085
|
+
installedPluginStates: [],
|
|
2086
|
+
seedCollectionsReadable: false,
|
|
2087
|
+
};
|
|
2088
|
+
const coldStartReads: Array<Promise<void>> = [
|
|
2089
|
+
phase("rt.plugins", "Plugin states", async () => {
|
|
1808
2090
|
try {
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
.
|
|
1814
|
-
.
|
|
1815
|
-
.execute();
|
|
1816
|
-
primeRegisteredCollections(collectionRows.map((row) => row.slug));
|
|
1817
|
-
seedCollectionsReadable = true;
|
|
2091
|
+
const states = await readDb.selectFrom("_plugin_state").selectAll().execute();
|
|
2092
|
+
reads.pluginStates = new Map(states.map((s) => [s.plugin_id, s.status]));
|
|
2093
|
+
reads.pluginStatesRead = true;
|
|
2094
|
+
reads.installedPluginStates = states
|
|
2095
|
+
.filter((s) => s.source === "marketplace" || s.source === "registry")
|
|
2096
|
+
.map(rowToPluginState);
|
|
1818
2097
|
} catch (error) {
|
|
1819
2098
|
captureMissingManualSchema(error);
|
|
1820
|
-
//
|
|
1821
|
-
// a seed onto a half-built db.
|
|
2099
|
+
// _plugin_state may not exist yet on a pre-migration db.
|
|
1822
2100
|
}
|
|
1823
2101
|
}),
|
|
1824
|
-
|
|
2102
|
+
phase("rt.site", "Site info options", async () => {
|
|
2103
|
+
try {
|
|
2104
|
+
reads.site = await readSiteInfo(readDb);
|
|
2105
|
+
} catch (error) {
|
|
2106
|
+
captureMissingManualSchema(error);
|
|
2107
|
+
// options may not exist yet on a pre-migration db.
|
|
2108
|
+
}
|
|
2109
|
+
}),
|
|
2110
|
+
phase("rt.hookselections", "Exclusive hook selections", async () => {
|
|
2111
|
+
// Built-in and sandboxed providers register after these reads, so
|
|
2112
|
+
// only configured plugins' hooks and the always-present
|
|
2113
|
+
// comment:moderate and email:deliver are known here. Hook
|
|
2114
|
+
// resolution reads the rest.
|
|
2115
|
+
const keys = Array.from(
|
|
2116
|
+
new Set([
|
|
2117
|
+
"comment:moderate",
|
|
2118
|
+
"email:deliver",
|
|
2119
|
+
...deps.plugins.flatMap((plugin) =>
|
|
2120
|
+
Object.entries(plugin.hooks)
|
|
2121
|
+
.filter(([, hook]) => hook?.exclusive)
|
|
2122
|
+
.map(([name]) => name),
|
|
2123
|
+
),
|
|
2124
|
+
]),
|
|
2125
|
+
(name) => `${EXCLUSIVE_HOOK_KEY_PREFIX}${name}`,
|
|
2126
|
+
);
|
|
2127
|
+
try {
|
|
2128
|
+
const stored = await new OptionsRepository(readDb).getMany<string>(keys);
|
|
2129
|
+
reads.exclusiveHookSelections = new Map(keys.map((key) => [key, stored.get(key)]));
|
|
2130
|
+
} catch (error) {
|
|
2131
|
+
captureMissingManualSchema(error);
|
|
2132
|
+
// Hook resolution reads the selections itself when this fails.
|
|
2133
|
+
}
|
|
2134
|
+
}),
|
|
2135
|
+
];
|
|
2136
|
+
|
|
2137
|
+
if (ownsConfiguredDb) {
|
|
2138
|
+
coldStartReads.push(
|
|
2139
|
+
phase("rt.seedcheck", "Auto-seed gate", async () => {
|
|
2140
|
+
try {
|
|
2141
|
+
// Selecting the slugs instead of COUNT(*) costs the same
|
|
2142
|
+
// round trip and primes the registered-collections cache,
|
|
2143
|
+
// so the first render on this isolate skips its own lookup.
|
|
2144
|
+
const collectionRows = await readDb
|
|
2145
|
+
.selectFrom("_emdash_collections")
|
|
2146
|
+
.select("slug")
|
|
2147
|
+
.execute();
|
|
2148
|
+
primeRegisteredCollections(collectionRows.map((row) => row.slug));
|
|
2149
|
+
reads.seedCollectionsReadable = true;
|
|
2150
|
+
} catch (error) {
|
|
2151
|
+
captureMissingManualSchema(error);
|
|
2152
|
+
// Leave collections unreadable so a read failure never triggers
|
|
2153
|
+
// a seed onto a half-built db.
|
|
2154
|
+
}
|
|
2155
|
+
}),
|
|
2156
|
+
);
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
await Promise.all(coldStartReads);
|
|
2160
|
+
return reads;
|
|
2161
|
+
};
|
|
2162
|
+
|
|
2163
|
+
// The applied-migration count rides in the cold-start batch on the
|
|
2164
|
+
// coalescing connection instead of costing its own round trip first. In
|
|
2165
|
+
// auto mode the policy uses it for its fast path. Reads in a batch whose
|
|
2166
|
+
// count was current saw a fully migrated schema; otherwise they run again
|
|
2167
|
+
// once the policy has finished.
|
|
2168
|
+
let migrationsCurrent = false;
|
|
2169
|
+
let foldedColdStartReads: ReturnType<typeof runColdStartReads> | undefined;
|
|
2170
|
+
let appliedMigrationCount: Promise<number | null | undefined> | undefined;
|
|
2171
|
+
// Only fold when getDatabase will actually initialize: a cached db needs
|
|
2172
|
+
// no count, and during a backoff getDatabase throws without touching the
|
|
2173
|
+
// database, so neither should the reads.
|
|
2174
|
+
if (
|
|
2175
|
+
coalescingDb &&
|
|
2176
|
+
(deps.migrationMode ?? "auto") === "auto" &&
|
|
2177
|
+
EmDashRuntime.databaseNeedsInit(deps)
|
|
2178
|
+
) {
|
|
2179
|
+
// A read error leaves the policy to read the count itself.
|
|
2180
|
+
appliedMigrationCount = getAppliedMigrationCount(coalescingDb).catch(() => undefined);
|
|
2181
|
+
foldedColdStartReads = runColdStartReads(coalescingDb);
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
// Initialize the database and enforce its configured migration policy.
|
|
2185
|
+
let db: Kysely<Database>;
|
|
2186
|
+
try {
|
|
2187
|
+
db = await phase("rt.db", "DB init + migration policy", async () => {
|
|
2188
|
+
const count = await appliedMigrationCount;
|
|
2189
|
+
migrationsCurrent = isMigrationCountCurrent(count);
|
|
2190
|
+
return EmDashRuntime.getDatabase(deps, { appliedMigrationCount: count });
|
|
2191
|
+
});
|
|
2192
|
+
} catch (error) {
|
|
2193
|
+
// Drain the folded reads without letting a secondary read failure
|
|
2194
|
+
// replace the migration/init error we want to report.
|
|
2195
|
+
await foldedColdStartReads?.catch(() => undefined);
|
|
2196
|
+
await disposeReadDb();
|
|
2197
|
+
throw error;
|
|
1825
2198
|
}
|
|
1826
2199
|
|
|
1827
|
-
|
|
2200
|
+
// Resolver for the live connection, mirroring the `get db()` getter
|
|
2201
|
+
// below (which can't be used here — the runtime instance doesn't exist
|
|
2202
|
+
// yet). Long-lived subsystems built during create() (cron executor,
|
|
2203
|
+
// plugin context factory, media providers) capture this resolver rather
|
|
2204
|
+
// than the `db` snapshot, so a connection-backed adapter (Postgres over
|
|
2205
|
+
// Hyperdrive) serves their queries from the current request/event-scoped
|
|
2206
|
+
// connection in ALS instead of the per-isolate singleton — whose socket
|
|
2207
|
+
// belongs to an earlier request and would trip workerd's cross-request
|
|
2208
|
+
// I/O guard. Stateless adapters (D1, Node SQLite) set no ALS db on most
|
|
2209
|
+
// paths, so this falls back to the singleton: unchanged behavior.
|
|
2210
|
+
const resolveDb = (): Kysely<Database> => {
|
|
2211
|
+
const ctx = getRequestContext();
|
|
2212
|
+
// eslint-disable-next-line typescript/no-unsafe-type-assertion -- ALS db is typed unknown to avoid a circular import; middleware always sets a Kysely<Database>
|
|
2213
|
+
return (ctx?.db as Kysely<Database> | undefined) ?? db;
|
|
2214
|
+
};
|
|
2215
|
+
|
|
2216
|
+
const readDb = coalescingDb ?? db;
|
|
2217
|
+
const foldedReads = await foldedColdStartReads;
|
|
2218
|
+
const reads = foldedReads && migrationsCurrent ? foldedReads : await runColdStartReads(readDb);
|
|
2219
|
+
const {
|
|
2220
|
+
pluginStates,
|
|
2221
|
+
pluginStatesRead,
|
|
2222
|
+
installedPluginStates,
|
|
2223
|
+
exclusiveHookSelections,
|
|
2224
|
+
seedCollectionsReadable,
|
|
2225
|
+
} = reads;
|
|
2226
|
+
let siteInfo = reads.site?.siteInfo;
|
|
2227
|
+
const storedLocaleCasingRepairVersion = reads.site?.storedLocaleCasingRepairVersion;
|
|
2228
|
+
// "Already complete" by default so a read failure (e.g. tables absent on a
|
|
2229
|
+
// pre-migration db) skips seeding rather than seeding a half-built db.
|
|
2230
|
+
const seedComplete = reads.site?.seedComplete ?? true;
|
|
2231
|
+
const setupDone = reads.site?.setupDone ?? true;
|
|
1828
2232
|
if (missingManualSchemaError) {
|
|
1829
2233
|
await disposeReadDb();
|
|
1830
2234
|
throw missingManualSchemaError;
|
|
@@ -1889,7 +2293,7 @@ export class EmDashRuntime {
|
|
|
1889
2293
|
// The site-info read ran before the seed wrote its defaults, so
|
|
1890
2294
|
// refresh the snapshot the plugin context sees.
|
|
1891
2295
|
try {
|
|
1892
|
-
siteInfo = await readSiteInfo();
|
|
2296
|
+
siteInfo = (await readSiteInfo(readDb)).siteInfo;
|
|
1893
2297
|
} catch {
|
|
1894
2298
|
// Non-fatal — plugin context falls back to undefined fields.
|
|
1895
2299
|
}
|
|
@@ -1945,6 +2349,34 @@ export class EmDashRuntime {
|
|
|
1945
2349
|
}
|
|
1946
2350
|
}
|
|
1947
2351
|
|
|
2352
|
+
// Register the built-in SMTP email provider, even unconfigured, so it
|
|
2353
|
+
// appears in the Settings → Email provider list. The handler loads its
|
|
2354
|
+
// config (DB first, env fallback) on every send. Secrets read
|
|
2355
|
+
// process.env only: import.meta.env is inlined at build time.
|
|
2356
|
+
try {
|
|
2357
|
+
const smtpPlugin = definePlugin({
|
|
2358
|
+
id: SMTP_EMAIL_PLUGIN_ID,
|
|
2359
|
+
version: "1.0.0",
|
|
2360
|
+
capabilities: ["hooks.email-transport:register"],
|
|
2361
|
+
hooks: {
|
|
2362
|
+
"email:deliver": {
|
|
2363
|
+
exclusive: true,
|
|
2364
|
+
// EHLO, STARTTLS, AUTH and DATA over the public internet need far
|
|
2365
|
+
// more than the 5s default hook timeout.
|
|
2366
|
+
timeout: 30_000,
|
|
2367
|
+
handler: createSmtpEmailDeliverFromDb(
|
|
2368
|
+
resolveDb,
|
|
2369
|
+
process.env.EMDASH_ENCRYPTION_KEY ?? null,
|
|
2370
|
+
),
|
|
2371
|
+
},
|
|
2372
|
+
},
|
|
2373
|
+
});
|
|
2374
|
+
allPipelinePlugins.push(smtpPlugin);
|
|
2375
|
+
enabledPlugins.add(smtpPlugin.id);
|
|
2376
|
+
} catch (error) {
|
|
2377
|
+
console.warn("[email] Failed to register SMTP email provider:", error);
|
|
2378
|
+
}
|
|
2379
|
+
|
|
1948
2380
|
// Register built-in default comment moderator.
|
|
1949
2381
|
// Always present as a fallback: exclusive hook resolution selects a
|
|
1950
2382
|
// single plugin moderator (e.g. AI moderation) over it unless the site
|
|
@@ -2162,6 +2594,7 @@ export class EmDashRuntime {
|
|
|
2162
2594
|
contentActions,
|
|
2163
2595
|
now: deps.now,
|
|
2164
2596
|
storage: storage ?? undefined,
|
|
2597
|
+
imagePlaceholders: deps.config.imagePlaceholders ?? true,
|
|
2165
2598
|
siteInfo,
|
|
2166
2599
|
commentModerate: (
|
|
2167
2600
|
pluginId: string,
|
|
@@ -2362,11 +2795,17 @@ export class EmDashRuntime {
|
|
|
2362
2795
|
sandboxRunner?.setContentActions?.(contentActions);
|
|
2363
2796
|
|
|
2364
2797
|
if (ownsConfiguredDb && pluginStatesRead) {
|
|
2798
|
+
// A sandbox that failed to load must not consume its first-install guard.
|
|
2799
|
+
const configPlugins = [
|
|
2800
|
+
...deps.plugins,
|
|
2801
|
+
...allPipelinePlugins.filter((plugin) => configuredSandboxIds.has(plugin.id)),
|
|
2802
|
+
];
|
|
2365
2803
|
await phase("rt.lifecycle", "Config plugin install/activate", () =>
|
|
2366
|
-
runtime.installUnrecordedConfigPlugins(
|
|
2804
|
+
runtime.installUnrecordedConfigPlugins(configPlugins, new Map(pluginStates)),
|
|
2367
2805
|
);
|
|
2368
2806
|
}
|
|
2369
2807
|
|
|
2808
|
+
runtime._rooms = deps.createRoomHost?.(runtime) ?? null;
|
|
2370
2809
|
return runtime;
|
|
2371
2810
|
}
|
|
2372
2811
|
|
|
@@ -2394,10 +2833,29 @@ export class EmDashRuntime {
|
|
|
2394
2833
|
}));
|
|
2395
2834
|
}
|
|
2396
2835
|
|
|
2836
|
+
/**
|
|
2837
|
+
* Whether getDatabase would initialize the configured database: it isn't
|
|
2838
|
+
* cached yet and isn't backing off after a failed init.
|
|
2839
|
+
*/
|
|
2840
|
+
private static databaseNeedsInit(deps: RuntimeDependencies): boolean {
|
|
2841
|
+
const dbConfig = deps.config.database;
|
|
2842
|
+
if (!dbConfig) return false;
|
|
2843
|
+
const holder = getDbHolder();
|
|
2844
|
+
return (
|
|
2845
|
+
!holder.cache.has(dbConfig.entrypoint) && !activeInitFailure(holder, dbConfig.entrypoint)
|
|
2846
|
+
);
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2397
2849
|
/**
|
|
2398
2850
|
* Get or create database instance
|
|
2851
|
+
*
|
|
2852
|
+
* `appliedMigrationCount` is a count the caller already read from this
|
|
2853
|
+
* database; the migration policy uses it rather than reading its own.
|
|
2399
2854
|
*/
|
|
2400
|
-
private static async getDatabase(
|
|
2855
|
+
private static async getDatabase(
|
|
2856
|
+
deps: RuntimeDependencies,
|
|
2857
|
+
options?: { appliedMigrationCount?: number | null },
|
|
2858
|
+
): Promise<Kysely<Database>> {
|
|
2401
2859
|
// Only use the per-request `ctx.db` when it's an isolated instance
|
|
2402
2860
|
// (playground / DO preview). Plain D1 Sessions set `ctx.db` on every
|
|
2403
2861
|
// anonymous request — if we captured one of those session-bound
|
|
@@ -2436,16 +2894,12 @@ export class EmDashRuntime {
|
|
|
2436
2894
|
const holder = getDbHolder();
|
|
2437
2895
|
|
|
2438
2896
|
const throwIfBackingOff = () => {
|
|
2439
|
-
const failure = holder
|
|
2897
|
+
const failure = activeInitFailure(holder, cacheKey);
|
|
2440
2898
|
if (!failure) return;
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
);
|
|
2446
|
-
}
|
|
2447
|
-
// Expired — drop it so the map only ever holds active backoffs.
|
|
2448
|
-
holder.failures.delete(cacheKey);
|
|
2899
|
+
throw new Error(
|
|
2900
|
+
`Database initialization is backing off after a recent migration failure: ${failure.message}`,
|
|
2901
|
+
{ cause: failure.cause },
|
|
2902
|
+
);
|
|
2449
2903
|
};
|
|
2450
2904
|
throwIfBackingOff();
|
|
2451
2905
|
|
|
@@ -2464,6 +2918,7 @@ export class EmDashRuntime {
|
|
|
2464
2918
|
try {
|
|
2465
2919
|
await enforceRuntimeMigrationPolicy(db, deps.migrationMode ?? "auto", {
|
|
2466
2920
|
contentRowLimit: autoMigrationContentRowLimit(),
|
|
2921
|
+
appliedCount: options?.appliedMigrationCount,
|
|
2467
2922
|
});
|
|
2468
2923
|
} catch (error) {
|
|
2469
2924
|
// Only a failed migration run, a lock its holder left behind, or
|
|
@@ -3011,6 +3466,7 @@ export class EmDashRuntime {
|
|
|
3011
3466
|
|
|
3012
3467
|
// The pipeline was created from only enabled plugins, so all providers
|
|
3013
3468
|
// in it are active. The isActive check always returns true.
|
|
3469
|
+
const smtpFromEnv = isSmtpEnvConfigured();
|
|
3014
3470
|
await resolveExclusiveHooksShared({
|
|
3015
3471
|
pipeline,
|
|
3016
3472
|
isActive: () => true,
|
|
@@ -3030,7 +3486,14 @@ export class EmDashRuntime {
|
|
|
3030
3486
|
await optionsRepo.delete(key);
|
|
3031
3487
|
},
|
|
3032
3488
|
preferredHints,
|
|
3033
|
-
|
|
3489
|
+
// Env-configured SMTP gives way to an email plugin. Without env config,
|
|
3490
|
+
// SMTP serves email only once selected in Settings → Email.
|
|
3491
|
+
fallbackProviders: new Set([
|
|
3492
|
+
DEFAULT_COMMENT_MODERATOR_PLUGIN_ID,
|
|
3493
|
+
...(smtpFromEnv ? [SMTP_EMAIL_PLUGIN_ID] : []),
|
|
3494
|
+
DEV_CONSOLE_EMAIL_PLUGIN_ID,
|
|
3495
|
+
]),
|
|
3496
|
+
manualProviders: smtpFromEnv ? undefined : new Set([SMTP_EMAIL_PLUGIN_ID]),
|
|
3034
3497
|
});
|
|
3035
3498
|
}
|
|
3036
3499
|
|
|
@@ -3378,9 +3841,10 @@ export class EmDashRuntime {
|
|
|
3378
3841
|
id: string,
|
|
3379
3842
|
locale?: string,
|
|
3380
3843
|
referenceOptions?: { includeDrafts: boolean },
|
|
3844
|
+
draftOptions?: { includeStagedSlug?: boolean },
|
|
3381
3845
|
) {
|
|
3382
3846
|
const result = await handleContentGet(this.db, collection, id, locale, referenceOptions);
|
|
3383
|
-
return this.hydrateDraftData(result);
|
|
3847
|
+
return this.hydrateDraftData(result, draftOptions);
|
|
3384
3848
|
}
|
|
3385
3849
|
|
|
3386
3850
|
async handleContentGetIncludingTrashed(collection: string, id: string, locale?: string) {
|
|
@@ -3543,6 +4007,7 @@ export class EmDashRuntime {
|
|
|
3543
4007
|
const saveHookDetails = {
|
|
3544
4008
|
locale,
|
|
3545
4009
|
...(body.translationOf ? { translationOf: body.translationOf } : {}),
|
|
4010
|
+
...(actor ? { editedBy: [actor.id] } : {}),
|
|
3546
4011
|
};
|
|
3547
4012
|
|
|
3548
4013
|
const collectionInfo = await this.schemaRegistry
|
|
@@ -3682,6 +4147,8 @@ export class EmDashRuntime {
|
|
|
3682
4147
|
};
|
|
3683
4148
|
taxonomies?: Record<string, string[]>;
|
|
3684
4149
|
references?: Record<string, string[]>;
|
|
4150
|
+
/** The lists this save was based on. A stored list that differs fails it with `LIST_CONFLICT`. */
|
|
4151
|
+
expected?: ListPreconditions;
|
|
3685
4152
|
publishedAt?: string | null;
|
|
3686
4153
|
locale?: string;
|
|
3687
4154
|
/** Replace the previous autosave revision after staging this save. */
|
|
@@ -3692,6 +4159,8 @@ export class EmDashRuntime {
|
|
|
3692
4159
|
* passed to content hooks; never changes entry ownership.
|
|
3693
4160
|
*/
|
|
3694
4161
|
actor?: ActorInfo;
|
|
4162
|
+
/** Users whose edits this save holds, latest first. Defaults to the actor alone. */
|
|
4163
|
+
editedBy?: readonly string[];
|
|
3695
4164
|
migrateBlocks?: boolean;
|
|
3696
4165
|
replaceBlocks?: boolean;
|
|
3697
4166
|
},
|
|
@@ -3702,6 +4171,7 @@ export class EmDashRuntime {
|
|
|
3702
4171
|
const repo = new ContentRepository(this.db);
|
|
3703
4172
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
3704
4173
|
const resolvedId = resolvedItem?.id ?? id;
|
|
4174
|
+
const checksLists = Boolean(body.expected?.bylines || body.expected?.references);
|
|
3705
4175
|
|
|
3706
4176
|
// Validate _rev early — before draft revision writes which modify the version.
|
|
3707
4177
|
// The token is checked again against the row the draft UPDATE is conditioned
|
|
@@ -3716,6 +4186,7 @@ export class EmDashRuntime {
|
|
|
3716
4186
|
}
|
|
3717
4187
|
const revCheck = validateRev(body._rev, resolvedItem);
|
|
3718
4188
|
if (!revCheck.valid) {
|
|
4189
|
+
if (checksLists) return listConflict();
|
|
3719
4190
|
return {
|
|
3720
4191
|
success: false as const,
|
|
3721
4192
|
error: { code: "CONFLICT", message: revCheck.message },
|
|
@@ -3725,11 +4196,30 @@ export class EmDashRuntime {
|
|
|
3725
4196
|
const {
|
|
3726
4197
|
_rev: _discardedRev,
|
|
3727
4198
|
actor: _discardedActor,
|
|
4199
|
+
editedBy: passedEditors,
|
|
3728
4200
|
migrateBlocks,
|
|
3729
4201
|
replaceBlocks,
|
|
4202
|
+
expected,
|
|
3730
4203
|
...bodyWithoutRev
|
|
3731
4204
|
} = body;
|
|
4205
|
+
// The lists are compared once, so every write below is conditioned on the entry as it was
|
|
4206
|
+
// read before them: a write in between changes its version.
|
|
4207
|
+
let revGuard = body._rev;
|
|
4208
|
+
if (expected && checksLists) {
|
|
4209
|
+
if (!resolvedItem) {
|
|
4210
|
+
return {
|
|
4211
|
+
success: false as const,
|
|
4212
|
+
error: { code: "NOT_FOUND", message: `Content item not found: ${id}` },
|
|
4213
|
+
};
|
|
4214
|
+
}
|
|
4215
|
+
if (!(await listsMatch(this.db, collection, resolvedItem, expected))) return listConflict();
|
|
4216
|
+
revGuard ??= encodeRev(resolvedItem);
|
|
4217
|
+
}
|
|
4218
|
+
const editedBy = passedEditors?.length ? [...new Set(passedEditors)] : undefined;
|
|
3732
4219
|
const blockWriteOptions = { migrateBlocks, replaceBlocks };
|
|
4220
|
+
const saveHookEditors: ContentSaveHookDetails = {
|
|
4221
|
+
editedBy: editedBy ?? (actor ? [actor.id] : undefined),
|
|
4222
|
+
};
|
|
3733
4223
|
|
|
3734
4224
|
// Loaded once and threaded through normalization, the stale-key drop and the draft
|
|
3735
4225
|
// merge below: each of those needs the field list and the registry does not cache.
|
|
@@ -3740,6 +4230,24 @@ export class EmDashRuntime {
|
|
|
3740
4230
|
? await this.schemaRegistry.getCollectionWithFields(collection).catch(() => null)
|
|
3741
4231
|
: null;
|
|
3742
4232
|
const knownFieldSlugs = new Set((collectionInfo?.fields ?? []).map((f) => f.slug));
|
|
4233
|
+
// Staging a draft and writing live columns are two writes, so a list conflict between them
|
|
4234
|
+
// would leave the draft staged. A save based on a read of the lists makes only one of them.
|
|
4235
|
+
if (
|
|
4236
|
+
checksLists &&
|
|
4237
|
+
collectionInfo?.supports?.includes("revisions") &&
|
|
4238
|
+
Object.entries(bodyWithoutRev).some(
|
|
4239
|
+
([key, value]) => value !== undefined && !DRAFT_ONLY_UPDATE_KEYS.has(key),
|
|
4240
|
+
)
|
|
4241
|
+
) {
|
|
4242
|
+
return {
|
|
4243
|
+
success: false as const,
|
|
4244
|
+
error: {
|
|
4245
|
+
code: "VALIDATION_ERROR",
|
|
4246
|
+
message:
|
|
4247
|
+
"A save with `expected` can't change draft and live values together in a collection with revisions. Send them as two saves.",
|
|
4248
|
+
},
|
|
4249
|
+
};
|
|
4250
|
+
}
|
|
3743
4251
|
|
|
3744
4252
|
// A collection that keeps drafts merges `data` into a revision instead of
|
|
3745
4253
|
// writing columns, so a reference field's slug would land in the revision
|
|
@@ -3780,7 +4288,9 @@ export class EmDashRuntime {
|
|
|
3780
4288
|
false,
|
|
3781
4289
|
resolvedItem?.id,
|
|
3782
4290
|
actor,
|
|
3783
|
-
resolvedItem?.locale
|
|
4291
|
+
resolvedItem?.locale
|
|
4292
|
+
? { ...saveHookEditors, locale: resolvedItem.locale }
|
|
4293
|
+
: saveHookEditors,
|
|
3784
4294
|
);
|
|
3785
4295
|
processedData = hookResult.content;
|
|
3786
4296
|
} catch (error) {
|
|
@@ -3860,6 +4370,7 @@ export class EmDashRuntime {
|
|
|
3860
4370
|
// Draft data lives only in the revisions table.
|
|
3861
4371
|
let usesDraftRevisions = false;
|
|
3862
4372
|
let draftStorageChanged = false;
|
|
4373
|
+
let stagedWrite: ContentWrite | undefined;
|
|
3863
4374
|
if (processedData || bodyWithoutRev.references) {
|
|
3864
4375
|
if (collectionInfo?.supports?.includes("revisions")) {
|
|
3865
4376
|
usesDraftRevisions = true;
|
|
@@ -3898,9 +4409,10 @@ export class EmDashRuntime {
|
|
|
3898
4409
|
|
|
3899
4410
|
const revisionRepo = new RevisionRepository(this.db);
|
|
3900
4411
|
let existing = await repo.findById(collection, resolvedId);
|
|
3901
|
-
if (
|
|
3902
|
-
const revCheck = validateRev(
|
|
4412
|
+
if (revGuard && existing) {
|
|
4413
|
+
const revCheck = validateRev(revGuard, existing);
|
|
3903
4414
|
if (!revCheck.valid) {
|
|
4415
|
+
if (checksLists) return listConflict();
|
|
3904
4416
|
return {
|
|
3905
4417
|
success: false as const,
|
|
3906
4418
|
error: { code: "CONFLICT", message: revCheck.message },
|
|
@@ -3909,13 +4421,10 @@ export class EmDashRuntime {
|
|
|
3909
4421
|
}
|
|
3910
4422
|
|
|
3911
4423
|
for (let attempt = 0; existing && attempt < MAX_DRAFT_STAGE_ATTEMPTS; attempt++) {
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
} else {
|
|
3917
|
-
baseData = existing.data;
|
|
3918
|
-
}
|
|
4424
|
+
const draftBase = existing.draftRevisionId
|
|
4425
|
+
? await revisionRepo.findDraftBase(existing.draftRevisionId)
|
|
4426
|
+
: null;
|
|
4427
|
+
const baseData = draftBase?.data ?? existing.data;
|
|
3919
4428
|
let attemptData = processedData ?? {};
|
|
3920
4429
|
try {
|
|
3921
4430
|
attemptData = await normalizeBlocksData(
|
|
@@ -3969,16 +4478,28 @@ export class EmDashRuntime {
|
|
|
3969
4478
|
);
|
|
3970
4479
|
}
|
|
3971
4480
|
|
|
4481
|
+
const entryGroup = existing.translationGroup;
|
|
4482
|
+
await repo.keepStartingRevision(revisionRepo, collection, existing, () =>
|
|
4483
|
+
liveReferenceData(this.db, collection, entryGroup),
|
|
4484
|
+
);
|
|
4485
|
+
const credit = revisionCredit({
|
|
4486
|
+
autosave: bodyWithoutRev.skipRevision === true,
|
|
4487
|
+
actorId: actor?.id,
|
|
4488
|
+
editedBy,
|
|
4489
|
+
replaced: existing.draftRevisionId === existing.liveRevisionId ? null : draftBase,
|
|
4490
|
+
});
|
|
3972
4491
|
const revision = await revisionRepo.create({
|
|
3973
4492
|
collection,
|
|
3974
4493
|
entryId: resolvedId,
|
|
3975
4494
|
data: mergedData,
|
|
3976
4495
|
authorId: actor?.id,
|
|
4496
|
+
kind: credit.kind,
|
|
4497
|
+
editedBy: credit.editedBy,
|
|
3977
4498
|
});
|
|
3978
4499
|
|
|
3979
|
-
let staged:
|
|
4500
|
+
let staged: Pick<ContentItemInternal, "version" | "updatedAt"> | null;
|
|
3980
4501
|
try {
|
|
3981
|
-
staged = await repo.
|
|
4502
|
+
staged = await repo.stageDraftRevision(collection, resolvedId, revision.id, existing);
|
|
3982
4503
|
} catch (error) {
|
|
3983
4504
|
try {
|
|
3984
4505
|
await revisionRepo.deleteIfUnreferenced(collection, resolvedId, revision.id);
|
|
@@ -4000,6 +4521,7 @@ export class EmDashRuntime {
|
|
|
4000
4521
|
cleanupError,
|
|
4001
4522
|
);
|
|
4002
4523
|
}
|
|
4524
|
+
if (checksLists) return listConflict();
|
|
4003
4525
|
if (body._rev || attempt === MAX_DRAFT_STAGE_ATTEMPTS - 1) {
|
|
4004
4526
|
const error = new ContentMutationConflictError();
|
|
4005
4527
|
return {
|
|
@@ -4013,13 +4535,18 @@ export class EmDashRuntime {
|
|
|
4013
4535
|
|
|
4014
4536
|
draftStorageChanged = true;
|
|
4015
4537
|
processedData = attemptData;
|
|
4538
|
+
stagedWrite = {
|
|
4539
|
+
rev: encodeRev({ ...existing, ...staged }),
|
|
4540
|
+
...overlayDraft(existing, revision.data),
|
|
4541
|
+
};
|
|
4016
4542
|
|
|
4017
|
-
if (
|
|
4543
|
+
if (credit.replaces && existing.draftRevisionId) {
|
|
4018
4544
|
try {
|
|
4019
4545
|
await revisionRepo.deleteIfUnreferenced(
|
|
4020
4546
|
collection,
|
|
4021
4547
|
resolvedId,
|
|
4022
4548
|
existing.draftRevisionId,
|
|
4549
|
+
{ autosaveOnly: true },
|
|
4023
4550
|
);
|
|
4024
4551
|
} catch (error) {
|
|
4025
4552
|
console.error(
|
|
@@ -4057,13 +4584,19 @@ export class EmDashRuntime {
|
|
|
4057
4584
|
? await handleContentGet(this.db, collection, resolvedId)
|
|
4058
4585
|
: await handleContentUpdate(this.db, collection, resolvedId, {
|
|
4059
4586
|
...bodyWithoutRev,
|
|
4060
|
-
|
|
4587
|
+
// Staging advanced the version a client token holds, so only the lists' own guard
|
|
4588
|
+
// carries over, as the version staging left.
|
|
4589
|
+
_rev: draftStorageChanged ? (checksLists ? stagedWrite?.rev : undefined) : revGuard,
|
|
4061
4590
|
data: usesDraftRevisions ? undefined : processedData,
|
|
4062
4591
|
slug: usesDraftRevisions ? undefined : bodyWithoutRev.slug,
|
|
4063
4592
|
references: usesDraftRevisions ? undefined : bodyWithoutRev.references,
|
|
4064
4593
|
authorId: bodyWithoutRev.authorId,
|
|
4065
4594
|
bylines: bodyWithoutRev.bylines,
|
|
4066
4595
|
});
|
|
4596
|
+
if (!result.success && checksLists && result.error.code === "CONFLICT") return listConflict();
|
|
4597
|
+
if (result.success && bodyWithoutRev.references) {
|
|
4598
|
+
notifyRoom({ collection, id: resolvedId }, ["references"]);
|
|
4599
|
+
}
|
|
4067
4600
|
|
|
4068
4601
|
const liveContentChanged = usesDraftRevisions
|
|
4069
4602
|
? liveMetaTouched
|
|
@@ -4109,17 +4642,26 @@ export class EmDashRuntime {
|
|
|
4109
4642
|
false,
|
|
4110
4643
|
actor,
|
|
4111
4644
|
undefined,
|
|
4112
|
-
savedLocale ? { locale: savedLocale } :
|
|
4645
|
+
savedLocale ? { ...saveHookEditors, locale: savedLocale } : saveHookEditors,
|
|
4113
4646
|
);
|
|
4114
4647
|
}
|
|
4115
4648
|
|
|
4116
4649
|
if (hydrated.success) {
|
|
4650
|
+
// Only the draft path knows its own write: the column handler reads the row again after
|
|
4651
|
+
// writing, outside a transaction on D1, so that read can include another write.
|
|
4652
|
+
if (stagedWrite && !liveMetaTouched) {
|
|
4653
|
+
return { ...hydrated, liveContentChanged, saved: stagedWrite };
|
|
4654
|
+
}
|
|
4117
4655
|
return { ...hydrated, liveContentChanged };
|
|
4118
4656
|
}
|
|
4119
4657
|
return hydrated;
|
|
4120
4658
|
}
|
|
4121
4659
|
|
|
4122
|
-
async handleContentDelete(collection: string, id: string) {
|
|
4660
|
+
async handleContentDelete(collection: string, id: string, options: { actor?: ActorInfo } = {}) {
|
|
4661
|
+
return this.withRoomHold({ collection, id }, options, () => this.trashEntry(collection, id));
|
|
4662
|
+
}
|
|
4663
|
+
|
|
4664
|
+
private async trashEntry(collection: string, id: string) {
|
|
4123
4665
|
// Run beforeDelete hooks (trusted plugins)
|
|
4124
4666
|
if (this.hooks.hasHooks("content:beforeDelete")) {
|
|
4125
4667
|
const { allowed } = await this.hooks.runContentBeforeDelete(id, collection);
|
|
@@ -4465,6 +5007,76 @@ export class EmDashRuntime {
|
|
|
4465
5007
|
);
|
|
4466
5008
|
}
|
|
4467
5009
|
|
|
5010
|
+
/**
|
|
5011
|
+
* Runs a user's operation on an entry while the entry's room, if one is open in this process,
|
|
5012
|
+
* holds: the room saves a kept checkpoint as the actor first, and merges the entry once the
|
|
5013
|
+
* operation ends. `run` gets the caller's `_rev`, or else the checkpoint's. Operations that
|
|
5014
|
+
* replace the draft pass the values they write as `overwrite`: an open room refuses rich text
|
|
5015
|
+
* it can't represent, and afterwards writes the stored values over its document. Callers pass
|
|
5016
|
+
* the entry's ID: a slug finds no room.
|
|
5017
|
+
*/
|
|
5018
|
+
private async withRoomHold<T>(
|
|
5019
|
+
entry: EntryRef,
|
|
5020
|
+
options: {
|
|
5021
|
+
_rev?: string;
|
|
5022
|
+
actor?: { id: string };
|
|
5023
|
+
origin?: ContentActionOrigin;
|
|
5024
|
+
overwrite?: () => Promise<Record<string, unknown> | null | undefined>;
|
|
5025
|
+
},
|
|
5026
|
+
run: (rev: string | undefined) => Promise<T>,
|
|
5027
|
+
): Promise<T | RoomOperationFailure> {
|
|
5028
|
+
const rooms = this._rooms;
|
|
5029
|
+
const actorId = options.actor?.id;
|
|
5030
|
+
const source = options.origin?.source;
|
|
5031
|
+
if (!rooms || actorId === undefined || source === "scheduler" || source === "plugin") {
|
|
5032
|
+
return run(options._rev);
|
|
5033
|
+
}
|
|
5034
|
+
const id = roomId(entry);
|
|
5035
|
+
if (options.overwrite && (await rooms.isOpen(id))) {
|
|
5036
|
+
// The editor schema loads only where a room is open.
|
|
5037
|
+
const { findUnsupportedPortableTextMarks } =
|
|
5038
|
+
await import("@emdash-cms/admin/internal/portable-text");
|
|
5039
|
+
const values = await options.overwrite();
|
|
5040
|
+
const collection = await this.schemaRegistry.getCollectionWithFields(entry.collection);
|
|
5041
|
+
for (const field of collection?.fields ?? []) {
|
|
5042
|
+
const value = values?.[field.slug];
|
|
5043
|
+
if (field.type !== "portableText" || !Array.isArray(value)) continue;
|
|
5044
|
+
const marks = findUnsupportedPortableTextMarks(value);
|
|
5045
|
+
if (marks.length === 0) continue;
|
|
5046
|
+
return {
|
|
5047
|
+
success: false,
|
|
5048
|
+
error: {
|
|
5049
|
+
code: "ROOM_UNSUPPORTED_CONTENT",
|
|
5050
|
+
message: `The ${field.slug} field has formatting the editor can't show while the entry is open: ${marks.join(", ")}`,
|
|
5051
|
+
},
|
|
5052
|
+
};
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5055
|
+
let held: Awaited<ReturnType<RuntimeRoomHost["save"]>>;
|
|
5056
|
+
try {
|
|
5057
|
+
held = await rooms.save(id, actorId, options._rev);
|
|
5058
|
+
} catch (error) {
|
|
5059
|
+
if (error instanceof RoomSaveError) return roomSaveFailure(error);
|
|
5060
|
+
throw error;
|
|
5061
|
+
}
|
|
5062
|
+
if (held === null) return run(options._rev);
|
|
5063
|
+
if (held === "conflict") {
|
|
5064
|
+
return {
|
|
5065
|
+
success: false,
|
|
5066
|
+
error: { code: "CONFLICT", message: "Revision precondition did not match" },
|
|
5067
|
+
};
|
|
5068
|
+
}
|
|
5069
|
+
try {
|
|
5070
|
+
return await run(options._rev ?? held.rev);
|
|
5071
|
+
} finally {
|
|
5072
|
+
try {
|
|
5073
|
+
await rooms.release(id, held.hold, { overwrite: options.overwrite !== undefined });
|
|
5074
|
+
} catch (error) {
|
|
5075
|
+
console.error(`[co-editing] room ${id} couldn't merge after an operation:`, error);
|
|
5076
|
+
}
|
|
5077
|
+
}
|
|
5078
|
+
}
|
|
5079
|
+
|
|
4468
5080
|
private async checkContentPolicy(
|
|
4469
5081
|
name: ContentPolicyHookName,
|
|
4470
5082
|
collection: string,
|
|
@@ -4601,20 +5213,43 @@ export class EmDashRuntime {
|
|
|
4601
5213
|
};
|
|
4602
5214
|
}
|
|
4603
5215
|
|
|
4604
|
-
async
|
|
5216
|
+
private async unscheduleRefusedPublish(
|
|
4605
5217
|
collection: string,
|
|
4606
5218
|
id: string,
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
5219
|
+
revision: string | undefined,
|
|
5220
|
+
error: { code?: string; message?: string } | undefined,
|
|
5221
|
+
): Promise<void> {
|
|
5222
|
+
if (!error?.code || !SCHEDULED_REFUSAL_CODES.has(error.code)) return;
|
|
5223
|
+
const reason = toScheduledRejectionReason(error.message);
|
|
5224
|
+
if (!reason || revision === undefined) return;
|
|
5225
|
+
const unscheduled = await handleScheduledPolicyRejection(this.db, collection, id, {
|
|
5226
|
+
_rev: revision,
|
|
5227
|
+
rejection: {
|
|
5228
|
+
collection,
|
|
5229
|
+
id,
|
|
5230
|
+
code: error.code,
|
|
5231
|
+
reason,
|
|
5232
|
+
rejectedAt: (this.runtimeDeps.now?.() ?? new Date()).toISOString(),
|
|
5233
|
+
},
|
|
5234
|
+
});
|
|
5235
|
+
if (!unscheduled.success) {
|
|
5236
|
+
console.error(
|
|
5237
|
+
`[scheduled-publish] Failed to unschedule refused ${collection}/${id}:`,
|
|
5238
|
+
unscheduled.error,
|
|
5239
|
+
);
|
|
5240
|
+
return;
|
|
5241
|
+
}
|
|
5242
|
+
await this.refreshContentUsageAfterSuccessfulWrite(collection, [unscheduled.data.item.id]);
|
|
5243
|
+
this.runAfterUnscheduleHooks(contentItemToRecord(unscheduled.data.item), collection);
|
|
5244
|
+
}
|
|
5245
|
+
|
|
5246
|
+
async handleContentPublish(collection: string, id: string, options: PublishOptions = {}) {
|
|
5247
|
+
return this.withRoomHold({ collection, id }, options, (_rev) =>
|
|
5248
|
+
this.publishEntry(collection, id, { ...options, _rev }),
|
|
5249
|
+
);
|
|
5250
|
+
}
|
|
5251
|
+
|
|
5252
|
+
private async publishEntry(collection: string, id: string, options: PublishOptions) {
|
|
4618
5253
|
const policy = await this.checkContentPolicy(
|
|
4619
5254
|
"content:beforePublish",
|
|
4620
5255
|
collection,
|
|
@@ -4646,6 +5281,9 @@ export class EmDashRuntime {
|
|
|
4646
5281
|
...handlerOptions,
|
|
4647
5282
|
_rev: policy.revision,
|
|
4648
5283
|
});
|
|
5284
|
+
if (!result.success && options.origin?.source === "scheduler") {
|
|
5285
|
+
await this.unscheduleRefusedPublish(collection, id, policy.revision, result.error);
|
|
5286
|
+
}
|
|
4649
5287
|
if (result.success && result.data) {
|
|
4650
5288
|
await this.clearScheduledPolicyRejection(
|
|
4651
5289
|
collection,
|
|
@@ -4682,6 +5320,16 @@ export class EmDashRuntime {
|
|
|
4682
5320
|
collection: string,
|
|
4683
5321
|
id: string,
|
|
4684
5322
|
options: ContentPolicyMutationOptions = {},
|
|
5323
|
+
) {
|
|
5324
|
+
return this.withRoomHold({ collection, id }, options, (_rev) =>
|
|
5325
|
+
this.unpublishEntry(collection, id, { ...options, _rev }),
|
|
5326
|
+
);
|
|
5327
|
+
}
|
|
5328
|
+
|
|
5329
|
+
private async unpublishEntry(
|
|
5330
|
+
collection: string,
|
|
5331
|
+
id: string,
|
|
5332
|
+
options: ContentPolicyMutationOptions,
|
|
4685
5333
|
) {
|
|
4686
5334
|
const policy = await this.checkContentPolicy(
|
|
4687
5335
|
"content:beforeUnpublish",
|
|
@@ -4717,6 +5365,17 @@ export class EmDashRuntime {
|
|
|
4717
5365
|
id: string,
|
|
4718
5366
|
scheduledAt: string,
|
|
4719
5367
|
options: ContentPolicyMutationOptions = {},
|
|
5368
|
+
) {
|
|
5369
|
+
return this.withRoomHold({ collection, id }, options, (_rev) =>
|
|
5370
|
+
this.scheduleEntry(collection, id, scheduledAt, { ...options, _rev }),
|
|
5371
|
+
);
|
|
5372
|
+
}
|
|
5373
|
+
|
|
5374
|
+
private async scheduleEntry(
|
|
5375
|
+
collection: string,
|
|
5376
|
+
id: string,
|
|
5377
|
+
scheduledAt: string,
|
|
5378
|
+
options: ContentPolicyMutationOptions,
|
|
4720
5379
|
) {
|
|
4721
5380
|
const policy = await this.checkContentPolicy(
|
|
4722
5381
|
"content:beforeSchedule",
|
|
@@ -4762,11 +5421,17 @@ export class EmDashRuntime {
|
|
|
4762
5421
|
async handleContentUnschedule(
|
|
4763
5422
|
collection: string,
|
|
4764
5423
|
id: string,
|
|
4765
|
-
options: {
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
5424
|
+
options: ContentPolicyMutationOptions = {},
|
|
5425
|
+
) {
|
|
5426
|
+
return this.withRoomHold({ collection, id }, options, (_rev) =>
|
|
5427
|
+
this.unscheduleEntry(collection, id, { ...options, _rev }),
|
|
5428
|
+
);
|
|
5429
|
+
}
|
|
5430
|
+
|
|
5431
|
+
private async unscheduleEntry(
|
|
5432
|
+
collection: string,
|
|
5433
|
+
id: string,
|
|
5434
|
+
options: ContentPolicyMutationOptions,
|
|
4770
5435
|
) {
|
|
4771
5436
|
const result = await handleContentUnschedule(this.db, collection, id, { _rev: options._rev });
|
|
4772
5437
|
if (result.success && result.data) {
|
|
@@ -4790,7 +5455,23 @@ export class EmDashRuntime {
|
|
|
4790
5455
|
return handleContentCountScheduled(this.db, collection);
|
|
4791
5456
|
}
|
|
4792
5457
|
|
|
4793
|
-
async handleContentDiscardDraft(
|
|
5458
|
+
async handleContentDiscardDraft(
|
|
5459
|
+
collection: string,
|
|
5460
|
+
id: string,
|
|
5461
|
+
options: { _rev?: string; actor?: ActorInfo } = {},
|
|
5462
|
+
) {
|
|
5463
|
+
return this.withRoomHold(
|
|
5464
|
+
{ collection, id },
|
|
5465
|
+
{
|
|
5466
|
+
...options,
|
|
5467
|
+
overwrite: async () =>
|
|
5468
|
+
(await new ContentRepository(this.db).findById(collection, id))?.data,
|
|
5469
|
+
},
|
|
5470
|
+
(_rev) => this.discardEntryDraft(collection, id, { _rev }),
|
|
5471
|
+
);
|
|
5472
|
+
}
|
|
5473
|
+
|
|
5474
|
+
private async discardEntryDraft(collection: string, id: string, options: { _rev?: string }) {
|
|
4794
5475
|
const result = await handleContentDiscardDraft(this.db, collection, id, options);
|
|
4795
5476
|
if (result.success && result.data) {
|
|
4796
5477
|
await this.refreshContentUsageAfterSuccessfulWrite(collection, [result.data.item.id]);
|
|
@@ -4832,12 +5513,17 @@ export class EmDashRuntime {
|
|
|
4832
5513
|
error: { code: "NO_STORAGE", message: "Storage not configured" },
|
|
4833
5514
|
};
|
|
4834
5515
|
}
|
|
4835
|
-
const result = await uploadMedia(
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
5516
|
+
const result = await uploadMedia(
|
|
5517
|
+
this.db,
|
|
5518
|
+
this.storage,
|
|
5519
|
+
{ ...input, placeholders: input.placeholders ?? this.config.imagePlaceholders ?? true },
|
|
5520
|
+
{
|
|
5521
|
+
beforeUpload: async (file) => {
|
|
5522
|
+
if (!this.hooks.hasHooks("media:beforeUpload")) return file;
|
|
5523
|
+
return (await this.hooks.runMediaBeforeUpload(file)).file;
|
|
5524
|
+
},
|
|
4839
5525
|
},
|
|
4840
|
-
|
|
5526
|
+
);
|
|
4841
5527
|
if (result.success && !result.data.deduplicated && this.hooks.hasHooks("media:afterUpload")) {
|
|
4842
5528
|
const item = result.data.item;
|
|
4843
5529
|
await this.hooks.runMediaAfterUpload({
|
|
@@ -5149,15 +5835,19 @@ export class EmDashRuntime {
|
|
|
5149
5835
|
return handleRevisionList(this.db, collection, entryId, params);
|
|
5150
5836
|
}
|
|
5151
5837
|
|
|
5838
|
+
async handleRevisionEditors(collection: string, entryId: string, since: string | null) {
|
|
5839
|
+
return handleRevisionEditors(this.db, collection, entryId, since);
|
|
5840
|
+
}
|
|
5841
|
+
|
|
5152
5842
|
async handleRevisionGet(revisionId: string) {
|
|
5153
5843
|
return handleRevisionGet(this.db, revisionId);
|
|
5154
5844
|
}
|
|
5155
5845
|
|
|
5156
|
-
|
|
5846
|
+
/** Without `role`, reads the caller's current role, which only a recovery revision needs. */
|
|
5847
|
+
async handleRevisionRestore(revisionId: string, callerUserId: string, role?: RoleLevel) {
|
|
5157
5848
|
// Discover the parent entry up front so we can branch on whether
|
|
5158
5849
|
// the collection uses draft revisions.
|
|
5159
|
-
const
|
|
5160
|
-
const revision = await revisionRepo.findById(revisionId);
|
|
5850
|
+
const revision = await new RevisionRepository(this.db).findDraftBase(revisionId);
|
|
5161
5851
|
if (!revision) {
|
|
5162
5852
|
return {
|
|
5163
5853
|
success: false as const,
|
|
@@ -5167,6 +5857,23 @@ export class EmDashRuntime {
|
|
|
5167
5857
|
},
|
|
5168
5858
|
};
|
|
5169
5859
|
}
|
|
5860
|
+
return this.withRoomHold(
|
|
5861
|
+
{ collection: revision.collection, id: revision.entryId },
|
|
5862
|
+
{ actor: { id: callerUserId }, overwrite: async () => revision.data },
|
|
5863
|
+
() => this.restoreRevision(revisionId, revision, callerUserId, role),
|
|
5864
|
+
);
|
|
5865
|
+
}
|
|
5866
|
+
|
|
5867
|
+
private async restoreRevision(
|
|
5868
|
+
revisionId: string,
|
|
5869
|
+
revision: Revision & RevisionCredit,
|
|
5870
|
+
callerUserId: string,
|
|
5871
|
+
role: RoleLevel | undefined,
|
|
5872
|
+
) {
|
|
5873
|
+
const revisionRepo = new RevisionRepository(this.db);
|
|
5874
|
+
if (revision.kind === "recovery") {
|
|
5875
|
+
return this.restoreRecoveryRevision(revision, callerUserId, role);
|
|
5876
|
+
}
|
|
5170
5877
|
|
|
5171
5878
|
const collectionInfo = await this.schemaRegistry.getCollectionWithFields(revision.collection);
|
|
5172
5879
|
const usesDraftRevisions = collectionInfo?.supports?.includes("revisions") ?? false;
|
|
@@ -5254,6 +5961,48 @@ export class EmDashRuntime {
|
|
|
5254
5961
|
}
|
|
5255
5962
|
}
|
|
5256
5963
|
|
|
5964
|
+
/**
|
|
5965
|
+
* Recovery revisions are stored without validation or hooks, so restoring one saves its
|
|
5966
|
+
* fields and slug as the restoring user, as a kept save.
|
|
5967
|
+
*/
|
|
5968
|
+
private async restoreRecoveryRevision(
|
|
5969
|
+
revision: { collection: string; entryId: string; data: Record<string, unknown> },
|
|
5970
|
+
callerUserId: string,
|
|
5971
|
+
role: RoleLevel | undefined,
|
|
5972
|
+
) {
|
|
5973
|
+
const user =
|
|
5974
|
+
role === undefined ? await this.findEnabledUser(callerUserId) : { id: callerUserId, role };
|
|
5975
|
+
if (!user) {
|
|
5976
|
+
return {
|
|
5977
|
+
success: false as const,
|
|
5978
|
+
error: { code: "FORBIDDEN", message: "Insufficient permissions" },
|
|
5979
|
+
};
|
|
5980
|
+
}
|
|
5981
|
+
const slug = revision.data._slug;
|
|
5982
|
+
return saveContent(this, {
|
|
5983
|
+
collection: revision.collection,
|
|
5984
|
+
id: revision.entryId,
|
|
5985
|
+
user,
|
|
5986
|
+
body: {
|
|
5987
|
+
data: Object.fromEntries(
|
|
5988
|
+
Object.entries(revision.data).filter(([key]) => !key.startsWith("_")),
|
|
5989
|
+
),
|
|
5990
|
+
// A room leaves the slug null when it couldn't read it; that must not clear the entry's.
|
|
5991
|
+
...(typeof slug === "string" ? { slug } : {}),
|
|
5992
|
+
},
|
|
5993
|
+
});
|
|
5994
|
+
}
|
|
5995
|
+
|
|
5996
|
+
private async findEnabledUser(id: string): Promise<{ id: string; role: RoleLevel } | null> {
|
|
5997
|
+
const row = await this.db
|
|
5998
|
+
.selectFrom("users")
|
|
5999
|
+
.select(["role", "disabled"])
|
|
6000
|
+
.where("id", "=", id)
|
|
6001
|
+
.executeTakeFirst();
|
|
6002
|
+
const role = row && !row.disabled ? toRoleLevel(row.role) : null;
|
|
6003
|
+
return role === null ? null : { id, role };
|
|
6004
|
+
}
|
|
6005
|
+
|
|
5257
6006
|
private async findSyncedSiblingsForUsageRefresh(
|
|
5258
6007
|
collection: string,
|
|
5259
6008
|
contentId: string,
|
|
@@ -5643,6 +6392,24 @@ export class EmDashRuntime {
|
|
|
5643
6392
|
};
|
|
5644
6393
|
}
|
|
5645
6394
|
|
|
6395
|
+
// State-changing plugin routes may rely on declared unique indexes and
|
|
6396
|
+
// other constraints. Block them until those indexes are materialized.
|
|
6397
|
+
// Read-only routes skip this check so ordinary logged-out GET requests
|
|
6398
|
+
// don't pay for index DDL.
|
|
6399
|
+
if (normalizedMethod !== "GET" && normalizedMethod !== "HEAD") {
|
|
6400
|
+
const indexesReady = await this.ensureStorageIndexesSynced(pluginId);
|
|
6401
|
+
if (!indexesReady) {
|
|
6402
|
+
return {
|
|
6403
|
+
success: false,
|
|
6404
|
+
status: 503,
|
|
6405
|
+
error: {
|
|
6406
|
+
code: "STORAGE_INDEXES_NOT_READY",
|
|
6407
|
+
message: "Plugin storage indexes are not ready",
|
|
6408
|
+
},
|
|
6409
|
+
};
|
|
6410
|
+
}
|
|
6411
|
+
}
|
|
6412
|
+
|
|
5646
6413
|
// Authenticated caller for `ctx.user`. Undefined for public routes
|
|
5647
6414
|
// (the catch-all only forwards the caller after private-route auth)
|
|
5648
6415
|
// and for machine tokens with no bound user.
|
|
@@ -5887,7 +6654,7 @@ export class EmDashRuntime {
|
|
|
5887
6654
|
const headers = new Headers(request.headers);
|
|
5888
6655
|
headers.delete("content-length");
|
|
5889
6656
|
headers.delete("content-encoding");
|
|
5890
|
-
const internalRequest = new Request(request
|
|
6657
|
+
const internalRequest = new Request(request, {
|
|
5891
6658
|
method: "POST",
|
|
5892
6659
|
headers,
|
|
5893
6660
|
body: JSON.stringify(input),
|
|
@@ -5980,8 +6747,9 @@ export class EmDashRuntime {
|
|
|
5980
6747
|
|
|
5981
6748
|
/**
|
|
5982
6749
|
* Normalize field values in content data before validation.
|
|
5983
|
-
* Turns a blank string in an array-valued field into `null`,
|
|
5984
|
-
* missing image/file dimensions, storageKey, mimeType, and filename from
|
|
6750
|
+
* Turns a blank string in an array-valued field into `null`, fills
|
|
6751
|
+
* missing image/file dimensions, storageKey, mimeType, and filename from
|
|
6752
|
+
* providers, and links rich text media named by file URL to its media item.
|
|
5985
6753
|
*/
|
|
5986
6754
|
private async normalizeFieldValues(
|
|
5987
6755
|
collection: string,
|
|
@@ -6020,7 +6788,27 @@ export class EmDashRuntime {
|
|
|
6020
6788
|
const blockFields = includeBlocks
|
|
6021
6789
|
? collectionInfo.fields.filter((field) => field.type === "blocks")
|
|
6022
6790
|
: [];
|
|
6791
|
+
// Collected across top-level and block fields so linking costs one lookup.
|
|
6792
|
+
const portableTextValues: { owner: Record<string, unknown>; slug: string }[] =
|
|
6793
|
+
collectionInfo.fields
|
|
6794
|
+
.filter((field) => field.type === "portableText" && Array.isArray(result[field.slug]))
|
|
6795
|
+
.map((field) => ({ owner: result, slug: field.slug }));
|
|
6796
|
+
const linkPortableTextValues = async () => {
|
|
6797
|
+
if (portableTextValues.length === 0) return;
|
|
6798
|
+
try {
|
|
6799
|
+
const linked = await linkPortableTextFileUrls(
|
|
6800
|
+
portableTextValues.map(({ owner, slug }) => owner[slug]),
|
|
6801
|
+
(storageKeys) => new MediaRepository(this.db).findIdsByStorageKeys(storageKeys),
|
|
6802
|
+
);
|
|
6803
|
+
for (const [index, { owner, slug }] of portableTextValues.entries()) {
|
|
6804
|
+
owner[slug] = linked[index];
|
|
6805
|
+
}
|
|
6806
|
+
} catch {
|
|
6807
|
+
// Don't fail the save if linking file URLs to media items fails
|
|
6808
|
+
}
|
|
6809
|
+
};
|
|
6023
6810
|
if (imageFields.length === 0 && repeaterFields.length === 0 && blockFields.length === 0) {
|
|
6811
|
+
await linkPortableTextValues();
|
|
6024
6812
|
return result;
|
|
6025
6813
|
}
|
|
6026
6814
|
|
|
@@ -6038,6 +6826,8 @@ export class EmDashRuntime {
|
|
|
6038
6826
|
: await normalizeMediaValue(value, getProvider);
|
|
6039
6827
|
if (normalized) {
|
|
6040
6828
|
result[field.slug] = normalized;
|
|
6829
|
+
} else if (isBlankString(value)) {
|
|
6830
|
+
result[field.slug] = null;
|
|
6041
6831
|
}
|
|
6042
6832
|
} catch {
|
|
6043
6833
|
// Don't fail the save if normalization fails for a single field
|
|
@@ -6065,6 +6855,8 @@ export class EmDashRuntime {
|
|
|
6065
6855
|
const normalized = await normalizeImageValue(subValue, getProvider);
|
|
6066
6856
|
if (normalized) {
|
|
6067
6857
|
normalizedItem[slug] = normalized;
|
|
6858
|
+
} else if (isBlankString(subValue)) {
|
|
6859
|
+
normalizedItem[slug] = null;
|
|
6068
6860
|
}
|
|
6069
6861
|
} catch {
|
|
6070
6862
|
// Don't fail the save if normalization fails for a single sub-field
|
|
@@ -6093,12 +6885,18 @@ export class EmDashRuntime {
|
|
|
6093
6885
|
const nestedValue = normalizedBlock[nestedField.slug];
|
|
6094
6886
|
if (nestedValue == null) continue;
|
|
6095
6887
|
try {
|
|
6096
|
-
if (nestedField.type === "image") {
|
|
6097
|
-
const normalized =
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
if (normalized)
|
|
6888
|
+
if (nestedField.type === "image" || nestedField.type === "file") {
|
|
6889
|
+
const normalized =
|
|
6890
|
+
nestedField.type === "image"
|
|
6891
|
+
? await normalizeImageValue(nestedValue, getProvider)
|
|
6892
|
+
: await normalizeMediaValue(nestedValue, getProvider);
|
|
6893
|
+
if (normalized) {
|
|
6894
|
+
normalizedBlock[nestedField.slug] = normalized;
|
|
6895
|
+
} else if (isBlankString(nestedValue)) {
|
|
6896
|
+
normalizedBlock[nestedField.slug] = null;
|
|
6897
|
+
}
|
|
6898
|
+
} else if (nestedField.type === "portableText" && Array.isArray(nestedValue)) {
|
|
6899
|
+
portableTextValues.push({ owner: normalizedBlock, slug: nestedField.slug });
|
|
6102
6900
|
} else if (nestedField.type === "repeater" && Array.isArray(nestedValue)) {
|
|
6103
6901
|
const imageSlugs = (nestedField.validation?.subFields ?? [])
|
|
6104
6902
|
.filter((subField) => subField.type === "image")
|
|
@@ -6113,7 +6911,11 @@ export class EmDashRuntime {
|
|
|
6113
6911
|
normalizedItem[slug],
|
|
6114
6912
|
getProvider,
|
|
6115
6913
|
);
|
|
6116
|
-
if (normalized)
|
|
6914
|
+
if (normalized) {
|
|
6915
|
+
normalizedItem[slug] = normalized;
|
|
6916
|
+
} else if (isBlankString(normalizedItem[slug])) {
|
|
6917
|
+
normalizedItem[slug] = null;
|
|
6918
|
+
}
|
|
6117
6919
|
} catch {
|
|
6118
6920
|
continue;
|
|
6119
6921
|
}
|
|
@@ -6132,6 +6934,7 @@ export class EmDashRuntime {
|
|
|
6132
6934
|
}
|
|
6133
6935
|
}
|
|
6134
6936
|
|
|
6937
|
+
await linkPortableTextValues();
|
|
6135
6938
|
return result;
|
|
6136
6939
|
}
|
|
6137
6940
|
|
|
@@ -6505,6 +7308,10 @@ export class EmDashRuntime {
|
|
|
6505
7308
|
}
|
|
6506
7309
|
}
|
|
6507
7310
|
|
|
7311
|
+
function isBlankString(value: unknown): boolean {
|
|
7312
|
+
return typeof value === "string" && value.trim() === "";
|
|
7313
|
+
}
|
|
7314
|
+
|
|
6508
7315
|
/**
|
|
6509
7316
|
* Normalize an image field value together with its `darkVariant`. The media
|
|
6510
7317
|
* normalizer only keeps the media item's own keys, so the variant is normalized
|
|
@@ -6538,3 +7345,20 @@ async function normalizePrimaryImageValue(
|
|
|
6538
7345
|
}
|
|
6539
7346
|
return normalizeMediaValue(value, getProvider);
|
|
6540
7347
|
}
|
|
7348
|
+
|
|
7349
|
+
/** A failed room save fails the operation, with the status its reason gives. */
|
|
7350
|
+
function roomSaveFailure(error: RoomSaveError): RoomOperationFailure {
|
|
7351
|
+
return {
|
|
7352
|
+
success: false,
|
|
7353
|
+
error: { code: error.code, message: error.message },
|
|
7354
|
+
status: roomSaveStatus(error),
|
|
7355
|
+
};
|
|
7356
|
+
}
|
|
7357
|
+
|
|
7358
|
+
function roomSaveStatus({ reason, code }: RoomSaveError): number {
|
|
7359
|
+
if (reason === "CONFLICT") return 409;
|
|
7360
|
+
if (reason === "FORBIDDEN") return 403;
|
|
7361
|
+
if (reason === "NOT_FOUND") return 404;
|
|
7362
|
+
if (code === "UNLOADED" || code === "SITE_UNAVAILABLE") return 503;
|
|
7363
|
+
return mapErrorStatus(code);
|
|
7364
|
+
}
|