emdash 1.4.0 → 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 -64
- 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 -15
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +217 -24
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +15 -13
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +59 -24
- 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 +122 -79
- 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 -13
- 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 -32
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +8 -32
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +8 -31
- 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 -86
- 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 -85
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +5 -85
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +9 -96
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +3 -86
- 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 -85
- 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 -96
- 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 -85
- 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 -85
- 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 -97
- 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 -88
- 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 -86
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +7 -85
- 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 -85
- 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 -85
- 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 -49
- 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 -49
- 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 -51
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +8 -50
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +7 -51
- 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 -52
- 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 -52
- 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 -51
- 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 -52
- 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 -53
- 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 -51
- 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 -51
- 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 -52
- 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 -51
- 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 -53
- 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 -51
- 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 -51
- 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 -53
- 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 -51
- 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 -51
- 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 -53
- 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 -4
- 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 +5 -3
- package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +32 -15
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +146 -45
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +16 -14
- 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 +8 -24
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +16 -14
- 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 -14
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +187 -58
- 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 -125
- 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 +5 -12
- 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 -26
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -26
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -26
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -26
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +8 -26
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +8 -26
- 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.mjs +4 -9
- 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 -86
- 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 -86
- 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 -86
- 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 -86
- 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 -86
- 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 -86
- 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 -86
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +5 -86
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +5 -86
- 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 -86
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +3 -85
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +5 -27
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +4 -26
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +5 -27
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +3 -15
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +4 -26
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +5 -26
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +5 -26
- 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 -57
- 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 -64
- 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.mjs +8 -30
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -31
- 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 -30
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -18
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -30
- 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 +45 -21
- 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 -93
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +70 -70
- 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 -25
- package/dist/index.mjs +2111 -120
- 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 -15
- 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 +23 -16
- package/dist/plugin-test-runtime.d.mts.map +1 -1
- package/dist/plugin-test-runtime.mjs +10 -125
- 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 -13
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +15 -13
- 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 -62
- 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 -14
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +1 -9
- 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 -54
- 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 -53
- 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 +43 -8
- 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/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/index.ts +19 -5
- package/src/astro/integration/routes.ts +15 -5
- package/src/astro/integration/runtime.ts +32 -0
- package/src/astro/integration/virtual-modules.ts +80 -17
- package/src/astro/integration/vite-config.ts +136 -0
- package/src/astro/middleware/auth.ts +44 -16
- 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 +11 -0
- 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 +22 -16
- 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 +1 -0
- 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/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 +1 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +2 -2
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +1 -1
- package/src/astro/routes/api/widget-areas/[name].ts +1 -1
- package/src/astro/routes/api/widget-areas/index.ts +1 -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 +42 -5
- package/src/auth/oauth-env.ts +35 -0
- package/src/bylines/field-defs-cache.ts +9 -4
- 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/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 +57 -0
- 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 +94 -89
- package/src/database/repositories/content.ts +162 -13
- package/src/database/repositories/entry-locks.ts +35 -29
- package/src/database/repositories/media-usage.ts +1 -1
- package/src/database/repositories/media.ts +23 -0
- package/src/database/repositories/menu.ts +30 -3
- 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/user.ts +34 -0
- package/src/database/transaction.ts +23 -2
- package/src/database/types.ts +23 -1
- package/src/emdash-runtime.ts +1048 -240
- 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/index.ts +10 -0
- package/src/loader.ts +109 -26
- package/src/mcp/server.ts +103 -29
- 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/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-snapshots.ts +111 -34
- package/src/media/usage/extractor.ts +42 -8
- package/src/media/usage/types.ts +5 -0
- package/src/object-cache/index.ts +382 -19
- package/src/page/jsonld.ts +26 -11
- 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 +72 -7
- 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 +10 -2
- package/src/search/errors.ts +22 -0
- package/src/search/fts-manager.ts +21 -6
- package/src/search/index.ts +2 -0
- package/src/seed/apply.ts +109 -48
- package/src/seed/index.ts +1 -1
- package/src/seed/load.ts +9 -0
- package/src/seed/types.ts +20 -11
- 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 +55 -25
- 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/scaffold.ts +66 -8
- package/src/ui.ts +18 -19
- package/src/virtual-modules.d.ts +20 -3
- package/src/visual-editing/toolbar.ts +73 -51
- package/src/widgets/recent-posts.ts +13 -0
- package/dist/action-token-SK8zyN7w.mjs +0 -26
- package/dist/action-token-SK8zyN7w.mjs.map +0 -1
- package/dist/activation-CGlyigmg.mjs +0 -387
- package/dist/activation-CGlyigmg.mjs.map +0 -1
- package/dist/adapters-D9a1PfqH.d.mts +0 -173
- package/dist/adapters-D9a1PfqH.d.mts.map +0 -1
- package/dist/after-32yNRvd2.mjs +0 -99
- package/dist/after-32yNRvd2.mjs.map +0 -1
- package/dist/allowed-origins-CEug-p0t.mjs +0 -116
- package/dist/allowed-origins-CEug-p0t.mjs.map +0 -1
- package/dist/api--PYoyeTo.mjs +0 -5098
- package/dist/api--PYoyeTo.mjs.map +0 -1
- package/dist/api-tokens-DqSlkDVI.mjs +0 -9
- package/dist/api-tokens-DqSlkDVI.mjs.map +0 -1
- package/dist/api-tokens-GNCsIegW.mjs +0 -173
- package/dist/api-tokens-GNCsIegW.mjs.map +0 -1
- package/dist/apply-DVnupNeS.mjs +0 -1760
- package/dist/apply-DVnupNeS.mjs.map +0 -1
- package/dist/approvals-DTtYSB27.mjs +0 -460
- package/dist/approvals-DTtYSB27.mjs.map +0 -1
- package/dist/artifact-fetch-DIh7iyOV.mjs +0 -659
- package/dist/artifact-fetch-DIh7iyOV.mjs.map +0 -1
- package/dist/artifacts-Dvdp2KK-.mjs +0 -323
- package/dist/artifacts-Dvdp2KK-.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-CQlB3JzE.mjs +0 -5183
- package/dist/authoritative-records-CQlB3JzE.mjs.map +0 -1
- package/dist/authorize-NJgp8kLI.mjs +0 -74
- package/dist/authorize-NJgp8kLI.mjs.map +0 -1
- package/dist/backup-8rPSJ28a.mjs +0 -246
- package/dist/backup-8rPSJ28a.mjs.map +0 -1
- package/dist/base64-BQBZwXCx.mjs +0 -63
- package/dist/base64-BQBZwXCx.mjs.map +0 -1
- package/dist/block-types-BbOrfnWs.mjs +0 -132
- package/dist/block-types-BbOrfnWs.mjs.map +0 -1
- package/dist/block-values-Dg0-8PPS.mjs +0 -215
- package/dist/block-values-Dg0-8PPS.mjs.map +0 -1
- package/dist/byline-DHJS-GGb.mjs +0 -994
- package/dist/byline-DHJS-GGb.mjs.map +0 -1
- package/dist/byline-fields-CiR8FvvF.mjs +0 -280
- package/dist/byline-fields-CiR8FvvF.mjs.map +0 -1
- package/dist/byline-fields-D6KYsEa7.mjs +0 -123
- package/dist/byline-fields-D6KYsEa7.mjs.map +0 -1
- package/dist/byline-registry-BhzpO41z.mjs +0 -406
- package/dist/byline-registry-BhzpO41z.mjs.map +0 -1
- package/dist/bylines-Bsg5cH4S.mjs +0 -234
- package/dist/bylines-Bsg5cH4S.mjs.map +0 -1
- package/dist/bylines-f_ZEc6Sn.mjs +0 -150
- package/dist/bylines-f_ZEc6Sn.mjs.map +0 -1
- package/dist/cache-5DHbpEWu.mjs +0 -151
- package/dist/cache-5DHbpEWu.mjs.map +0 -1
- package/dist/canonical-BudtH-Fx.mjs +0 -174
- package/dist/canonical-BudtH-Fx.mjs.map +0 -1
- package/dist/capture-triggers-BezAvWcB.mjs +0 -362
- package/dist/capture-triggers-BezAvWcB.mjs.map +0 -1
- package/dist/challenge-store-B1C0V4b3.mjs +0 -51
- package/dist/challenge-store-B1C0V4b3.mjs.map +0 -1
- package/dist/checksum-CEqvfxGX.mjs +0 -162
- package/dist/checksum-CEqvfxGX.mjs.map +0 -1
- package/dist/chrome-tags-BIKBMZYO.mjs +0 -24
- package/dist/chrome-tags-BIKBMZYO.mjs.map +0 -1
- package/dist/chunks-DiW8VMwz.mjs +0 -25
- package/dist/chunks-DiW8VMwz.mjs.map +0 -1
- package/dist/collection-slugs-cache-DIrLjqH-.mjs +0 -91
- package/dist/collection-slugs-cache-DIrLjqH-.mjs.map +0 -1
- package/dist/comment-DB74Zpa4.mjs +0 -335
- package/dist/comment-DB74Zpa4.mjs.map +0 -1
- package/dist/comment-reaction-BScxIWUn.mjs +0 -85
- package/dist/comment-reaction-BScxIWUn.mjs.map +0 -1
- package/dist/comments-Cor_zKml.mjs +0 -195
- package/dist/comments-Cor_zKml.mjs.map +0 -1
- package/dist/comments-yiRFx3w5.mjs +0 -99
- package/dist/comments-yiRFx3w5.mjs.map +0 -1
- package/dist/components-Brp__9xo.mjs +0 -112
- package/dist/components-Brp__9xo.mjs.map +0 -1
- package/dist/config-D44_8G9J.d.mts +0 -41
- package/dist/config-D44_8G9J.d.mts.map +0 -1
- package/dist/config-DBU6iUQB.mjs +0 -228
- package/dist/config-DBU6iUQB.mjs.map +0 -1
- package/dist/config-sDhZvkLR.d.mts +0 -6835
- package/dist/config-sDhZvkLR.d.mts.map +0 -1
- package/dist/connection-BtEN_lP9.mjs +0 -36
- package/dist/connection-BtEN_lP9.mjs.map +0 -1
- package/dist/content-BKHUVsE5.mjs +0 -2112
- package/dist/content-BKHUVsE5.mjs.map +0 -1
- package/dist/content-list-query-ByP4jRpZ.d.mts +0 -26
- package/dist/content-list-query-ByP4jRpZ.d.mts.map +0 -1
- package/dist/content-policy-BmE0MPZY.mjs +0 -46
- package/dist/content-policy-BmE0MPZY.mjs.map +0 -1
- package/dist/content-repair-Ukdxoq-R.mjs +0 -442
- package/dist/content-repair-Ukdxoq-R.mjs.map +0 -1
- package/dist/context-CzjejcsE.mjs +0 -2089
- package/dist/context-CzjejcsE.mjs.map +0 -1
- package/dist/credits-BKREepht.mjs +0 -110
- package/dist/credits-BKREepht.mjs.map +0 -1
- package/dist/cron-D7obTIfk.mjs +0 -306
- package/dist/cron-D7obTIfk.mjs.map +0 -1
- package/dist/dashboard-ynr1qJWM.mjs +0 -168
- package/dist/dashboard-ynr1qJWM.mjs.map +0 -1
- package/dist/default-C0W-PhAp.mjs +0 -81
- package/dist/default-C0W-PhAp.mjs.map +0 -1
- package/dist/deferred-tasks-wlMFJL95.d.mts +0 -10
- package/dist/deferred-tasks-wlMFJL95.d.mts.map +0 -1
- package/dist/destination-DR3IHjmy.mjs +0 -18
- package/dist/destination-DR3IHjmy.mjs.map +0 -1
- package/dist/dev-typegen-EBni_pOQ.mjs +0 -29
- package/dist/dev-typegen-EBni_pOQ.mjs.map +0 -1
- package/dist/device-flow-D1U392GC.mjs +0 -519
- package/dist/device-flow-D1U392GC.mjs.map +0 -1
- package/dist/dialect-helpers-B1XN2HGB.mjs +0 -314
- package/dist/dialect-helpers-B1XN2HGB.mjs.map +0 -1
- package/dist/digest-DJ1tHCgy.mjs +0 -194
- package/dist/digest-DJ1tHCgy.mjs.map +0 -1
- package/dist/direct-executor-Bs2g0ake.mjs +0 -117
- package/dist/direct-executor-Bs2g0ake.mjs.map +0 -1
- package/dist/dist-BUmWMTbN.mjs +0 -810
- package/dist/dist-BUmWMTbN.mjs.map +0 -1
- package/dist/email-console-FFVJWb9N.mjs +0 -50
- package/dist/email-console-FFVJWb9N.mjs.map +0 -1
- package/dist/email-locale-Bs3HFdnq.mjs +0 -25
- package/dist/email-locale-Bs3HFdnq.mjs.map +0 -1
- package/dist/emdash-runtime-C8T-pZpS.mjs +0 -4425
- package/dist/emdash-runtime-C8T-pZpS.mjs.map +0 -1
- package/dist/enrich-DFlfnd3u.mjs +0 -194
- package/dist/enrich-DFlfnd3u.mjs.map +0 -1
- package/dist/entry-lock-BulbgPBX.d.mts +0 -4568
- package/dist/entry-lock-BulbgPBX.d.mts.map +0 -1
- package/dist/entry-lock-CRVmruM0.mjs +0 -1211
- package/dist/entry-lock-CRVmruM0.mjs.map +0 -1
- package/dist/entry-lock-D-zJQ4q6.mjs +0 -163
- package/dist/entry-lock-D-zJQ4q6.mjs.map +0 -1
- package/dist/entry-locks-CJ9uhqg1.mjs +0 -167
- package/dist/entry-locks-CJ9uhqg1.mjs.map +0 -1
- package/dist/env-types-BE3bCvfP.mjs +0 -38
- package/dist/env-types-BE3bCvfP.mjs.map +0 -1
- package/dist/error-BCMgPxdn.mjs +0 -90
- package/dist/error-BCMgPxdn.mjs.map +0 -1
- package/dist/errors-8gJqv-XV.mjs +0 -492
- package/dist/errors-8gJqv-XV.mjs.map +0 -1
- package/dist/errors-B4f4It-2.mjs +0 -120
- package/dist/errors-B4f4It-2.mjs.map +0 -1
- package/dist/escape-lsNq38PP.mjs +0 -9
- package/dist/escape-lsNq38PP.mjs.map +0 -1
- package/dist/fence-Dagicj14.mjs +0 -162
- package/dist/fence-Dagicj14.mjs.map +0 -1
- package/dist/field-map-BSXdNGt5.mjs +0 -84
- package/dist/field-map-BSXdNGt5.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-6861qcwk.mjs +0 -489
- package/dist/fts-manager-6861qcwk.mjs.map +0 -1
- package/dist/gc-CNkXB3mE.mjs +0 -75
- package/dist/gc-CNkXB3mE.mjs.map +0 -1
- package/dist/hash-BJaeek87.mjs +0 -37
- package/dist/hash-BJaeek87.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-8dUOJAPJ.d.mts +0 -50
- package/dist/hreflang-8dUOJAPJ.d.mts.map +0 -1
- package/dist/hreflang-BW5A4FLK.mjs +0 -105
- package/dist/hreflang-BW5A4FLK.mjs.map +0 -1
- package/dist/http-route-dispatch-rXKvTNm9.mjs +0 -342
- package/dist/http-route-dispatch-rXKvTNm9.mjs.map +0 -1
- package/dist/identity-CPRRSovU.mjs +0 -35
- package/dist/identity-CPRRSovU.mjs.map +0 -1
- package/dist/import-yVbfPyfd.mjs +0 -2126
- package/dist/import-yVbfPyfd.mjs.map +0 -1
- package/dist/index-VM7Fzxwe.d.mts +0 -260
- package/dist/index-VM7Fzxwe.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-RU6VrHOX.mjs +0 -58
- package/dist/install-finalization-RU6VrHOX.mjs.map +0 -1
- package/dist/json-recordset-D0WhN2UA.mjs +0 -12
- package/dist/json-recordset-D0WhN2UA.mjs.map +0 -1
- package/dist/json-schema-v_D_pPNG.mjs +0 -15
- package/dist/json-schema-v_D_pPNG.mjs.map +0 -1
- package/dist/keys-CifIkT0N.mjs +0 -61
- package/dist/keys-CifIkT0N.mjs.map +0 -1
- package/dist/kinds-B_Qcl5pz.mjs +0 -974
- package/dist/kinds-B_Qcl5pz.mjs.map +0 -1
- package/dist/lifecycle-B8d7Rdqx.mjs +0 -25
- package/dist/lifecycle-B8d7Rdqx.mjs.map +0 -1
- package/dist/load-D4xtzm6h.mjs +0 -28
- package/dist/load-D4xtzm6h.mjs.map +0 -1
- package/dist/loader-DhnedqY4.mjs +0 -1478
- package/dist/loader-DhnedqY4.mjs.map +0 -1
- package/dist/loops-B2YS-Zzr.mjs +0 -205
- package/dist/loops-B2YS-Zzr.mjs.map +0 -1
- package/dist/manifest-builder-g1FLviel.mjs +0 -196
- package/dist/manifest-builder-g1FLviel.mjs.map +0 -1
- package/dist/manifest-schema-DNb4XmTS.mjs +0 -497
- package/dist/manifest-schema-DNb4XmTS.mjs.map +0 -1
- package/dist/marketplace-CqbgeIa7.mjs +0 -257
- package/dist/marketplace-CqbgeIa7.mjs.map +0 -1
- package/dist/media-BR4_t-Wd.mjs +0 -416
- package/dist/media-BR4_t-Wd.mjs.map +0 -1
- package/dist/media-CikS-q6E.mjs +0 -294
- package/dist/media-CikS-q6E.mjs.map +0 -1
- package/dist/media-DepNLhPq.mjs +0 -383
- package/dist/media-DepNLhPq.mjs.map +0 -1
- package/dist/media-allowlist-BMBLqyWh.mjs +0 -45
- package/dist/media-allowlist-BMBLqyWh.mjs.map +0 -1
- package/dist/media-folders-CI0Wydfo.mjs +0 -210
- package/dist/media-folders-CI0Wydfo.mjs.map +0 -1
- package/dist/media-url-BQgKvpQ5.mjs +0 -43
- package/dist/media-url-BQgKvpQ5.mjs.map +0 -1
- package/dist/media-usage-X1_20MY-.mjs +0 -282
- package/dist/media-usage-X1_20MY-.mjs.map +0 -1
- package/dist/media-usage-activation-bWusy3M2.mjs +0 -78
- package/dist/media-usage-activation-bWusy3M2.mjs.map +0 -1
- package/dist/media-usage-work-B2RaoJIa.mjs +0 -151
- package/dist/media-usage-work-B2RaoJIa.mjs.map +0 -1
- package/dist/media-usage-work-BCK2J-v_.mjs +0 -1036
- package/dist/media-usage-work-BCK2J-v_.mjs.map +0 -1
- package/dist/menus-B0Qqv_cS.mjs +0 -837
- package/dist/menus-B0Qqv_cS.mjs.map +0 -1
- package/dist/menus-oypxT1pI.mjs +0 -3802
- package/dist/menus-oypxT1pI.mjs.map +0 -1
- package/dist/menus-uEAxWAm1.mjs +0 -92
- package/dist/menus-uEAxWAm1.mjs.map +0 -1
- package/dist/mime-D1We9jUx.mjs +0 -81
- package/dist/mime-D1We9jUx.mjs.map +0 -1
- package/dist/mode-C-D3qICy.mjs +0 -23
- package/dist/mode-C-D3qICy.mjs.map +0 -1
- package/dist/node-sqlite-compat-CrKzRr0J.mjs +0 -63
- package/dist/node-sqlite-compat-CrKzRr0J.mjs.map +0 -1
- package/dist/normalize-Cx-bNwhP.mjs +0 -220
- package/dist/normalize-Cx-bNwhP.mjs.map +0 -1
- package/dist/oauth-authorization-CPLgBrdo.mjs +0 -287
- package/dist/oauth-authorization-CPLgBrdo.mjs.map +0 -1
- package/dist/oauth-clients-BT0Pg-MO.mjs +0 -266
- package/dist/oauth-clients-BT0Pg-MO.mjs.map +0 -1
- package/dist/oauth-state-store-BndCfRum.mjs +0 -50
- package/dist/oauth-state-store-BndCfRum.mjs.map +0 -1
- package/dist/oauth-user-lookup-BDgF6IVG.mjs +0 -26
- package/dist/oauth-user-lookup-BDgF6IVG.mjs.map +0 -1
- package/dist/object-cache-DmKr09La.mjs +0 -603
- package/dist/object-cache-DmKr09La.mjs.map +0 -1
- package/dist/options-BUUgroHg.d.mts +0 -81
- package/dist/options-BUUgroHg.d.mts.map +0 -1
- package/dist/options-DhrI7eMv.mjs +0 -208
- package/dist/options-DhrI7eMv.mjs.map +0 -1
- package/dist/ownership-MiyA7qKO.mjs +0 -12
- package/dist/ownership-MiyA7qKO.mjs.map +0 -1
- package/dist/parse-B_b6gZxG.mjs +0 -81
- package/dist/parse-B_b6gZxG.mjs.map +0 -1
- package/dist/parse-Dndx1QmN.d.mts +0 -176
- package/dist/parse-Dndx1QmN.d.mts.map +0 -1
- package/dist/passkey-config-D2Lua5__.mjs +0 -46
- package/dist/passkey-config-D2Lua5__.mjs.map +0 -1
- package/dist/paths-biDzFTY2.mjs +0 -77
- package/dist/paths-biDzFTY2.mjs.map +0 -1
- package/dist/patterns-CryGz_EV.mjs +0 -159
- package/dist/patterns-CryGz_EV.mjs.map +0 -1
- package/dist/placeholder-CSKu5OkD.d.mts +0 -314
- package/dist/placeholder-CSKu5OkD.d.mts.map +0 -1
- package/dist/plan-CCoqxNoU.mjs +0 -135
- package/dist/plan-CCoqxNoU.mjs.map +0 -1
- package/dist/plugin-tool-name-DDUgN_0p.mjs +0 -27
- package/dist/plugin-tool-name-DDUgN_0p.mjs.map +0 -1
- package/dist/plugins-COJ2L49n.mjs +0 -261
- package/dist/plugins-COJ2L49n.mjs.map +0 -1
- package/dist/policy-BPugqmeV.mjs +0 -53
- package/dist/policy-BPugqmeV.mjs.map +0 -1
- package/dist/portable-text-BH4zgkSm.mjs +0 -311
- package/dist/portable-text-BH4zgkSm.mjs.map +0 -1
- package/dist/preview-DLexxwp3.mjs +0 -107
- package/dist/preview-DLexxwp3.mjs.map +0 -1
- package/dist/protocol-PoAfD_9W.d.mts +0 -65
- package/dist/protocol-PoAfD_9W.d.mts.map +0 -1
- package/dist/public-plugin-api-routes-CMljrTby.mjs +0 -316
- package/dist/public-plugin-api-routes-CMljrTby.mjs.map +0 -1
- package/dist/public-submission-ayqoyee4.mjs +0 -251
- package/dist/public-submission-ayqoyee4.mjs.map +0 -1
- package/dist/public-url-Bt98vysr.mjs +0 -101
- package/dist/public-url-Bt98vysr.mjs.map +0 -1
- package/dist/query-BFHjCzSh.mjs +0 -37
- package/dist/query-BFHjCzSh.mjs.map +0 -1
- package/dist/query-D62NntCZ.mjs +0 -1146
- package/dist/query-D62NntCZ.mjs.map +0 -1
- package/dist/query-LmPY2y0C.mjs +0 -41
- package/dist/query-LmPY2y0C.mjs.map +0 -1
- package/dist/range-CYfeXgGK.mjs +0 -51
- package/dist/range-CYfeXgGK.mjs.map +0 -1
- package/dist/rate-limit-C04Llsoc.mjs +0 -127
- package/dist/rate-limit-C04Llsoc.mjs.map +0 -1
- package/dist/receipt-BUsQCOeM.mjs +0 -43
- package/dist/receipt-BUsQCOeM.mjs.map +0 -1
- package/dist/redirect-CQAV7mCo.mjs +0 -19
- package/dist/redirect-CQAV7mCo.mjs.map +0 -1
- package/dist/redirect-DjLdw427.mjs +0 -423
- package/dist/redirect-DjLdw427.mjs.map +0 -1
- package/dist/redirect-paths-DOaVBp6E.mjs +0 -36
- package/dist/redirect-paths-DOaVBp6E.mjs.map +0 -1
- package/dist/redirects-Cpq1catN.mjs +0 -446
- package/dist/redirects-Cpq1catN.mjs.map +0 -1
- package/dist/redirects-CyvvZrCJ.mjs +0 -148
- package/dist/redirects-CyvvZrCJ.mjs.map +0 -1
- package/dist/registry-B0-O575m.mjs +0 -8374
- package/dist/registry-B0-O575m.mjs.map +0 -1
- package/dist/relations-WIOojTL4.mjs +0 -789
- package/dist/relations-WIOojTL4.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-bwZ_NsvU.mjs +0 -141
- package/dist/request-meta-bwZ_NsvU.mjs.map +0 -1
- package/dist/resolve-BNnm8EkB.mjs +0 -102
- package/dist/resolve-BNnm8EkB.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-QSOyDEw0.mjs +0 -20
- package/dist/route-cache-QSOyDEw0.mjs.map +0 -1
- package/dist/route-wire-Ca_HWCZ5.mjs +0 -197
- package/dist/route-wire-Ca_HWCZ5.mjs.map +0 -1
- package/dist/routes-avqgc-8r.mjs +0 -272
- package/dist/routes-avqgc-8r.mjs.map +0 -1
- package/dist/runner-Bkkfk4O8.mjs +0 -6669
- package/dist/runner-Bkkfk4O8.mjs.map +0 -1
- package/dist/runner-Dfgp6-S_.d.mts +0 -73
- package/dist/runner-Dfgp6-S_.d.mts.map +0 -1
- package/dist/schema-B-3rntlX.mjs +0 -815
- package/dist/schema-B-3rntlX.mjs.map +0 -1
- package/dist/schema-BqBlUZtb.mjs +0 -13
- package/dist/schema-BqBlUZtb.mjs.map +0 -1
- package/dist/scopes-DNaY7Ey0.mjs +0 -34
- package/dist/scopes-DNaY7Ey0.mjs.map +0 -1
- package/dist/search-BPWTnpnD.mjs +0 -450
- package/dist/search-BPWTnpnD.mjs.map +0 -1
- package/dist/secrets-Dswzrz3k.mjs +0 -369
- package/dist/secrets-Dswzrz3k.mjs.map +0 -1
- package/dist/sections-rSao6rBG.mjs +0 -346
- package/dist/sections-rSao6rBG.mjs.map +0 -1
- package/dist/seo-B_H_pqOd.mjs +0 -133
- package/dist/seo-B_H_pqOd.mjs.map +0 -1
- package/dist/seo-ClB-dw9w.mjs +0 -188
- package/dist/seo-ClB-dw9w.mjs.map +0 -1
- package/dist/service-DpiUQVpp.mjs +0 -150
- package/dist/service-DpiUQVpp.mjs.map +0 -1
- package/dist/session-user-DiE4JKPP.mjs +0 -61
- package/dist/session-user-DiE4JKPP.mjs.map +0 -1
- package/dist/settings--XlUdUaI.mjs +0 -66
- package/dist/settings--XlUdUaI.mjs.map +0 -1
- package/dist/settings-D932YP2-.mjs +0 -519
- package/dist/settings-D932YP2-.mjs.map +0 -1
- package/dist/settings-Dd1uivmQ.mjs +0 -73
- package/dist/settings-Dd1uivmQ.mjs.map +0 -1
- package/dist/setup-complete-qsJYWutC.mjs +0 -65
- package/dist/setup-complete-qsJYWutC.mjs.map +0 -1
- package/dist/setup-nonce-CBFgUFXw.mjs +0 -25
- package/dist/setup-nonce-CBFgUFXw.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-oRGS_JfA.mjs +0 -131
- package/dist/site-domain-oRGS_JfA.mjs.map +0 -1
- package/dist/site-settings-DRHfX7bq.mjs +0 -50
- package/dist/site-settings-DRHfX7bq.mjs.map +0 -1
- package/dist/site-url-MB685I5X.mjs +0 -45
- package/dist/site-url-MB685I5X.mjs.map +0 -1
- package/dist/sitemap-name-B8QP8wud.mjs +0 -26
- package/dist/sitemap-name-B8QP8wud.mjs.map +0 -1
- package/dist/slug-aVnUV4SL.mjs +0 -16
- package/dist/slug-aVnUV4SL.mjs.map +0 -1
- package/dist/slugify-BDEG9pLk.mjs +0 -22
- package/dist/slugify-BDEG9pLk.mjs.map +0 -1
- package/dist/snapshot-BjaXDZQ5.mjs +0 -414
- package/dist/snapshot-BjaXDZQ5.mjs.map +0 -1
- package/dist/ssrf-BcYjyM4M.mjs +0 -406
- package/dist/ssrf-BcYjyM4M.mjs.map +0 -1
- package/dist/ssrf-DM0E-D_8.mjs +0 -1
- package/dist/stage-CZQnXM_G.mjs +0 -662
- package/dist/stage-CZQnXM_G.mjs.map +0 -1
- package/dist/staged-ByBmPFtX.mjs +0 -686
- package/dist/staged-ByBmPFtX.mjs.map +0 -1
- package/dist/state-CFbGZziM.mjs +0 -178
- package/dist/state-CFbGZziM.mjs.map +0 -1
- package/dist/status-BFNdxzKc.mjs +0 -30
- package/dist/status-BFNdxzKc.mjs.map +0 -1
- package/dist/storage-query-BFp06Y0s.d.mts +0 -1627
- package/dist/storage-query-BFp06Y0s.d.mts.map +0 -1
- package/dist/tar-DFjExb9X.mjs +0 -449
- package/dist/tar-DFjExb9X.mjs.map +0 -1
- package/dist/target-CWZs2-o6.mjs +0 -27
- package/dist/target-CWZs2-o6.mjs.map +0 -1
- package/dist/taxonomies-5SR76j11.mjs +0 -937
- package/dist/taxonomies-5SR76j11.mjs.map +0 -1
- package/dist/taxonomies-B__VmCKQ.mjs +0 -703
- package/dist/taxonomies-B__VmCKQ.mjs.map +0 -1
- package/dist/taxonomy-CMI5fczd.mjs +0 -563
- package/dist/taxonomy-CMI5fczd.mjs.map +0 -1
- package/dist/tokens-BnhSnGwJ.mjs +0 -171
- package/dist/tokens-BnhSnGwJ.mjs.map +0 -1
- package/dist/transaction-CkoQ5wqQ.mjs +0 -29
- package/dist/transaction-CkoQ5wqQ.mjs.map +0 -1
- package/dist/transfer-BbKfufJ4.mjs +0 -166
- package/dist/transfer-BbKfufJ4.mjs.map +0 -1
- package/dist/transfer-DTGblAj2.mjs +0 -8910
- package/dist/transfer-DTGblAj2.mjs.map +0 -1
- package/dist/transfer-download-D9LQEDX0.mjs +0 -33
- package/dist/transfer-download-D9LQEDX0.mjs.map +0 -1
- package/dist/transformations-Bx4lYY0Y.mjs +0 -196
- package/dist/transformations-Bx4lYY0Y.mjs.map +0 -1
- package/dist/transport-Dm5QzpT_.d.mts +0 -42
- package/dist/transport-Dm5QzpT_.d.mts.map +0 -1
- package/dist/transport-Dzpn5b3i.mjs +0 -137
- package/dist/transport-Dzpn5b3i.mjs.map +0 -1
- package/dist/trusted-proxy-BU3Nx9g1.mjs +0 -51
- package/dist/trusted-proxy-BU3Nx9g1.mjs.map +0 -1
- package/dist/turnstile-Cs2wfkJG.mjs +0 -58
- package/dist/turnstile-Cs2wfkJG.mjs.map +0 -1
- package/dist/types-BAsCk5KU.d.mts +0 -87
- package/dist/types-BAsCk5KU.d.mts.map +0 -1
- package/dist/types-BuvSwT9Y.d.mts +0 -375
- package/dist/types-BuvSwT9Y.d.mts.map +0 -1
- package/dist/types-C4KT3Md2.d.mts +0 -293
- package/dist/types-C4KT3Md2.d.mts.map +0 -1
- package/dist/types-CVXHwIBB.d.mts +0 -125
- package/dist/types-CVXHwIBB.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-CgfFGfO5.mjs +0 -16
- package/dist/types-CgfFGfO5.mjs.map +0 -1
- package/dist/types-Cj0_yZkn.mjs +0 -18
- package/dist/types-Cj0_yZkn.mjs.map +0 -1
- package/dist/types-CjftrmZR.d.mts +0 -1741
- package/dist/types-CjftrmZR.d.mts.map +0 -1
- package/dist/types-DKwRUA-x.d.mts +0 -916
- package/dist/types-DKwRUA-x.d.mts.map +0 -1
- package/dist/types-DwhEvIVb.mjs +0 -133
- package/dist/types-DwhEvIVb.mjs.map +0 -1
- package/dist/types-GwAyS5SH.d.mts +0 -227
- package/dist/types-GwAyS5SH.d.mts.map +0 -1
- package/dist/types-qHVygneX.mjs +0 -77
- package/dist/types-qHVygneX.mjs.map +0 -1
- package/dist/types-sUHaH7lC.mjs +0 -37
- package/dist/types-sUHaH7lC.mjs.map +0 -1
- package/dist/types-uU2YNYSt.d.mts +0 -209
- package/dist/types-uU2YNYSt.d.mts.map +0 -1
- package/dist/update-check-ABBJgg6M.mjs +0 -161
- package/dist/update-check-ABBJgg6M.mjs.map +0 -1
- package/dist/upload-attempts-DPFC4COv.mjs +0 -32
- package/dist/upload-attempts-DPFC4COv.mjs.map +0 -1
- package/dist/url-DTfGDJhI.mjs +0 -104
- package/dist/url-DTfGDJhI.mjs.map +0 -1
- package/dist/url-pattern-QATUE_rv.mjs +0 -41
- package/dist/url-pattern-QATUE_rv.mjs.map +0 -1
- package/dist/user-By8SzQxS.mjs +0 -171
- package/dist/user-By8SzQxS.mjs.map +0 -1
- package/dist/utils-D5uOi6WS.mjs +0 -450
- package/dist/utils-D5uOi6WS.mjs.map +0 -1
- package/dist/utils-Szp4iBQB.d.mts +0 -376
- package/dist/utils-Szp4iBQB.d.mts.map +0 -1
- package/dist/validate-DDvxy6qG.d.mts +0 -468
- package/dist/validate-DDvxy6qG.d.mts.map +0 -1
- package/dist/validate-Dz-TIOFB.mjs +0 -524
- package/dist/validate-Dz-TIOFB.mjs.map +0 -1
- package/dist/validation-Fc9ZSUS_.mjs +0 -221
- package/dist/validation-Fc9ZSUS_.mjs.map +0 -1
- package/dist/version-BZj18Q7G.mjs +0 -9
- package/dist/version-BZj18Q7G.mjs.map +0 -1
- package/dist/version-Bu6Nlbb5.mjs +0 -7
- package/dist/version-Bu6Nlbb5.mjs.map +0 -1
- package/dist/version-DqB7LIO7.mjs +0 -49
- package/dist/version-DqB7LIO7.mjs.map +0 -1
- package/dist/video-DytCnw3L.mjs +0 -54
- package/dist/video-DytCnw3L.mjs.map +0 -1
- package/dist/virtual-modules-DO954n7P.mjs +0 -515
- package/dist/virtual-modules-DO954n7P.mjs.map +0 -1
- package/dist/widgets-BUx_Mf2q.mjs +0 -134
- package/dist/widgets-BUx_Mf2q.mjs.map +0 -1
- package/dist/wxr-taxonomies-DbJtWrWM.mjs +0 -454
- package/dist/wxr-taxonomies-DbJtWrWM.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/zod-generator--nlM0930.mjs +0 -425
- package/dist/zod-generator--nlM0930.mjs.map +0 -1
|
@@ -0,0 +1,1774 @@
|
|
|
1
|
+
import { m as __exportAll } from "./runner-4BfB04Rg.mjs";
|
|
2
|
+
import { c as executeAtomicBatchIfSupported, u as isPostgres } from "./dialect-helpers-DqUMP9fJ.mjs";
|
|
3
|
+
import { l as resolveConfiguredLocale, o as getLocaleRank, r as getI18nConfig } from "./config-Cs_AwWXI.mjs";
|
|
4
|
+
import { t as OptionsRepository } from "./options-CMocxAku.mjs";
|
|
5
|
+
import { t as ContentRepository } from "./content-Dxztag5t.mjs";
|
|
6
|
+
import { n as localeMatches, r as localeOrder } from "./query-EVjg8-Bq.mjs";
|
|
7
|
+
import { _ as invalidateWidgetObjectCache, i as coalesceObjectCacheWrites, p as invalidateMenuObjectCache } from "./object-cache-DeATK4vw.mjs";
|
|
8
|
+
import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DRnEstVb.mjs";
|
|
9
|
+
import { t as RevisionRepository } from "./revision-D7EedSdU.mjs";
|
|
10
|
+
import { t as withTransaction } from "./transaction-SKrr6u84.mjs";
|
|
11
|
+
import { t as MediaRepository } from "./media-DJaAAYI2.mjs";
|
|
12
|
+
import { t as TaxonomyRepository } from "./taxonomy-s1GcBCRo.mjs";
|
|
13
|
+
import { t as RedirectRepository } from "./redirect-ChcHI1KC.mjs";
|
|
14
|
+
import { t as BylineRepository } from "./byline--sweE_MZ.mjs";
|
|
15
|
+
import { t as imageSize } from "./dist-kxThYgdL.mjs";
|
|
16
|
+
import { t as FTSManager } from "./fts-manager-B3iLXCGz.mjs";
|
|
17
|
+
import { C as saveTaxonomyStructure, x as findTaxonomyStructure } from "./loader-CSEfTKzr.mjs";
|
|
18
|
+
import { R as BlockTypeRegistry, W as markContentMediaUsageCollectionStaleSafely, n as SchemaRegistry, t as SchemaError } from "./registry-CDzYrAFY.mjs";
|
|
19
|
+
import { n as computeContentHash } from "./hash-SY9Nq5FH.mjs";
|
|
20
|
+
import { r as localMediaFileUrl } from "./url-ZCjpMO-q.mjs";
|
|
21
|
+
import { a as resolveBlockTypes, i as normalizeBlocksData } from "./block-values-DzZIh7WN.mjs";
|
|
22
|
+
import { m as setReferenceSelection } from "./relations-Eyop_U4o.mjs";
|
|
23
|
+
import { n as createFieldRelation, t as bindReferenceField } from "./schema-Mjtj7n1t.mjs";
|
|
24
|
+
import { c as invalidateSiteSettingsCache, d as setSiteSettings } from "./settings-BTkGl-bX.mjs";
|
|
25
|
+
import { a as ssrfSafeFetch, s as validateExternalUrl } from "./ssrf-Lj1KZxYt.mjs";
|
|
26
|
+
import { n as validateSeed, t as findTaxonomyStructureSource } from "./validate-BNupiQtz.mjs";
|
|
27
|
+
import { ulid } from "ulidx";
|
|
28
|
+
import mime from "mime/lite";
|
|
29
|
+
|
|
30
|
+
//#region src/content/converters/gallery.ts
|
|
31
|
+
/**
|
|
32
|
+
* Shared sanitization for gallery block images and image media, used by both
|
|
33
|
+
* converters so the editor round-trip and the stored shape stay in lockstep.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Read an image's media reference, alt text, and dimensions. Accepts the
|
|
37
|
+
* reference shape (`_ref`, `url`) and the MediaValue that seeded `$media`
|
|
38
|
+
* stores instead (`id`, `src`, `meta.storageKey`, dimensions). The image's own
|
|
39
|
+
* `alt`, `width`, and `height` take precedence over the asset's.
|
|
40
|
+
*/
|
|
41
|
+
function resolveImageMedia(image) {
|
|
42
|
+
const record = isRecord(image) ? image : {};
|
|
43
|
+
const asset = isRecord(record.asset) ? record.asset : {};
|
|
44
|
+
const storageKey = isRecord(asset.meta) ? nonEmptyString(asset.meta.storageKey) : void 0;
|
|
45
|
+
const url = nonEmptyString(asset.url) ?? nonEmptyString(asset.src) ?? (storageKey ? localMediaFileUrl(storageKey) : void 0);
|
|
46
|
+
const provider = nonEmptyString(asset.provider);
|
|
47
|
+
const alt = nonEmptyString(record.alt) ?? nonEmptyString(asset.alt);
|
|
48
|
+
const width = typeof record.width === "number" ? record.width : asset.width;
|
|
49
|
+
const height = typeof record.height === "number" ? record.height : asset.height;
|
|
50
|
+
const media = { asset: {
|
|
51
|
+
_type: "reference",
|
|
52
|
+
_ref: nonEmptyString(asset._ref) ?? nonEmptyString(asset.id) ?? "",
|
|
53
|
+
...url ? { url } : {},
|
|
54
|
+
...provider ? { provider } : {}
|
|
55
|
+
} };
|
|
56
|
+
if (alt) media.alt = alt;
|
|
57
|
+
if (typeof width === "number") media.width = width;
|
|
58
|
+
if (typeof height === "number") media.height = height;
|
|
59
|
+
return media;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Normalize an untrusted `images` value into well-formed gallery images.
|
|
63
|
+
* Non-object entries and entries without an asset object are dropped.
|
|
64
|
+
* Missing `_key`s are filled via `generateKey` when provided (PM → PT);
|
|
65
|
+
* left empty otherwise (PT → PM keeps whatever the block carried).
|
|
66
|
+
*/
|
|
67
|
+
function sanitizeGalleryImages(value, generateKey) {
|
|
68
|
+
if (!Array.isArray(value)) return [];
|
|
69
|
+
const images = [];
|
|
70
|
+
for (const entry of value) {
|
|
71
|
+
if (!isRecord(entry)) continue;
|
|
72
|
+
const record = entry;
|
|
73
|
+
if (!isRecord(record.asset)) continue;
|
|
74
|
+
const { asset, alt, width, height } = resolveImageMedia(record);
|
|
75
|
+
const image = {
|
|
76
|
+
_type: "image",
|
|
77
|
+
_key: typeof record._key === "string" && record._key ? record._key : generateKey ? generateKey() : "",
|
|
78
|
+
asset
|
|
79
|
+
};
|
|
80
|
+
if (alt) image.alt = alt;
|
|
81
|
+
if (typeof record.caption === "string" && record.caption) image.caption = record.caption;
|
|
82
|
+
if (width !== void 0) image.width = width;
|
|
83
|
+
if (height !== void 0) image.height = height;
|
|
84
|
+
if (typeof record.focalX === "number") image.focalX = record.focalX;
|
|
85
|
+
if (typeof record.focalY === "number") image.focalY = record.focalY;
|
|
86
|
+
if (typeof record.blurhash === "string" && record.blurhash) image.blurhash = record.blurhash;
|
|
87
|
+
if (typeof record.dominantColor === "string" && record.dominantColor) image.dominantColor = record.dominantColor;
|
|
88
|
+
images.push(image);
|
|
89
|
+
}
|
|
90
|
+
return images;
|
|
91
|
+
}
|
|
92
|
+
function nonEmptyString(value) {
|
|
93
|
+
return typeof value === "string" && value ? value : void 0;
|
|
94
|
+
}
|
|
95
|
+
function isRecord(value) {
|
|
96
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/seed/apply.ts
|
|
101
|
+
/**
|
|
102
|
+
* Seed engine - applies seed files to database
|
|
103
|
+
*
|
|
104
|
+
* This is the core implementation that bootstraps an EmDash site from a seed file.
|
|
105
|
+
* Apply order is critical for foreign keys and references.
|
|
106
|
+
*/
|
|
107
|
+
var apply_exports = /* @__PURE__ */ __exportAll({
|
|
108
|
+
applySeed: () => applySeed,
|
|
109
|
+
applySeedWithinBudget: () => applySeedWithinBudget
|
|
110
|
+
});
|
|
111
|
+
const SEED_MENU_ITEM_INSERT_BATCH_SIZE = 6;
|
|
112
|
+
const SEED_WIDGET_INSERT_BATCH_SIZE = 10;
|
|
113
|
+
async function replaceSeedChildren(db, parentTable, parentIds, buildStatements) {
|
|
114
|
+
if (parentIds.length === 0) return;
|
|
115
|
+
if (await executeAtomicBatchIfSupported(db, buildStatements(db)) !== null) return;
|
|
116
|
+
await withTransaction(db, async (trx) => {
|
|
117
|
+
if (isPostgres(trx)) await trx.selectFrom(parentTable).select("id").where("id", "in", parentIds).orderBy("id").forUpdate().execute();
|
|
118
|
+
for (const statement of buildStatements(trx)) await statement.execute();
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async function applySiteSettings(db, settings, onConflict, result) {
|
|
122
|
+
const entries = Object.entries(settings).filter(([, value]) => value !== void 0);
|
|
123
|
+
if (entries.length === 0) return;
|
|
124
|
+
if (onConflict === "update") {
|
|
125
|
+
await setSiteSettings(settings, db);
|
|
126
|
+
result.settings.applied += entries.length;
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const options = new OptionsRepository(db);
|
|
130
|
+
let applied = 0;
|
|
131
|
+
try {
|
|
132
|
+
for (const [key, value] of entries) {
|
|
133
|
+
const write = await options.compareAndSet(`site:${key}`, null, value);
|
|
134
|
+
if (!write.applied && onConflict === "error") throw new Error(`Conflict: site setting "site:${key}" already exists`);
|
|
135
|
+
if (write.applied) applied++;
|
|
136
|
+
}
|
|
137
|
+
} finally {
|
|
138
|
+
if (applied > 0) {
|
|
139
|
+
result.settings.applied += applied;
|
|
140
|
+
invalidateSiteSettingsCache();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Set a collection's `titleField`/`dateField`: a separate write run after the
|
|
146
|
+
* fields exist, so `updateCollection` can validate them. No-op when neither is set.
|
|
147
|
+
*/
|
|
148
|
+
async function applyDisplayDateFields(registry, collection) {
|
|
149
|
+
if (collection.titleField === void 0 && collection.dateField === void 0) return;
|
|
150
|
+
await registry.updateCollection(collection.slug, {
|
|
151
|
+
titleField: collection.titleField,
|
|
152
|
+
dateField: collection.dateField
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
const FILE_EXTENSION_PATTERN = /\.([a-z0-9]+)(?:\?|$)/i;
|
|
156
|
+
const SEED_RELATION_NAME_MAX_ATTEMPTS = 5;
|
|
157
|
+
const SEED_RELATION_INSERT_BATCH_SIZE = 10;
|
|
158
|
+
/** Pattern to remove file extensions */
|
|
159
|
+
const EXTENSION_PATTERN = /\.[^.]+$/;
|
|
160
|
+
/** Pattern to remove query parameters */
|
|
161
|
+
const QUERY_PARAM_PATTERN = /\?.*$/;
|
|
162
|
+
/** Pattern to remove non-alphanumeric characters (except dash and underscore) */
|
|
163
|
+
const SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
|
|
164
|
+
/** Pattern to collapse multiple hyphens */
|
|
165
|
+
const MULTIPLE_HYPHENS_PATTERN = /-+/g;
|
|
166
|
+
/** The `category` and `tag` defs that migrations insert on every new database. */
|
|
167
|
+
const BUILT_IN_TAXONOMY_DEFS = new Map([["taxdef_category", {
|
|
168
|
+
label: "Categories",
|
|
169
|
+
label_singular: "Category",
|
|
170
|
+
hierarchical: 1,
|
|
171
|
+
collections: "[\"posts\"]"
|
|
172
|
+
}], ["taxdef_tag", {
|
|
173
|
+
label: "Tags",
|
|
174
|
+
label_singular: "Tag",
|
|
175
|
+
hierarchical: 0,
|
|
176
|
+
collections: "[\"posts\"]"
|
|
177
|
+
}]]);
|
|
178
|
+
/** Whether `def` is a built-in `category`/`tag` definition still holding its migration defaults. */
|
|
179
|
+
function isUntouchedBuiltInTaxonomyDef(def) {
|
|
180
|
+
const builtIn = BUILT_IN_TAXONOMY_DEFS.get(def.id);
|
|
181
|
+
return builtIn !== void 0 && def.label === builtIn.label && def.label_singular === builtIn.label_singular && def.hierarchical === builtIn.hierarchical && def.collections === builtIn.collections;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Apply a seed file to the database
|
|
185
|
+
*
|
|
186
|
+
* This function is idempotent - safe to run multiple times.
|
|
187
|
+
*
|
|
188
|
+
* @param db - Kysely database instance
|
|
189
|
+
* @param seed - Seed file to apply
|
|
190
|
+
* @param options - Application options
|
|
191
|
+
* @returns Result summary
|
|
192
|
+
*/
|
|
193
|
+
async function applySeed(db, seed, options = {}) {
|
|
194
|
+
const { result } = await coalesceObjectCacheWrites(() => applySeedWrites(db, seed, options, null));
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Apply a seed over several calls, for a platform that caps the queries or
|
|
199
|
+
* fetches of one request.
|
|
200
|
+
*
|
|
201
|
+
* The limits are thresholds, checked before each taxonomy term, byline and
|
|
202
|
+
* content entry is created and before the phases that follow content. Schema,
|
|
203
|
+
* taxonomy definitions and settings are applied in every call, the item that
|
|
204
|
+
* crosses a threshold finishes, and the phases after content (menus,
|
|
205
|
+
* redirects, widgets, sections) run in one call, so set the limits well below
|
|
206
|
+
* the platform's. A call that stops returns `complete: false`; applying the
|
|
207
|
+
* same seed again continues with the first item not yet created. A call
|
|
208
|
+
* creates at least one item before it stops, so repeated calls finish. A
|
|
209
|
+
* `$media` URL used by entries in different calls is still downloaded each time
|
|
210
|
+
* so its content hash can be computed, but the resulting media row is reused
|
|
211
|
+
* when an existing ready row has the same hash. Requires
|
|
212
|
+
* `onConflict: "skip"`.
|
|
213
|
+
*/
|
|
214
|
+
async function applySeedWithinBudget(db, seed, options, limits) {
|
|
215
|
+
const budget = new SeedBudget(limits);
|
|
216
|
+
return coalesceObjectCacheWrites(() => applySeedWrites(db.withPlugin(budget), seed, options, budget));
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Counts what a budgeted call spends. As a Kysely plugin it sees every query
|
|
220
|
+
* the call runs, including those inside transactions.
|
|
221
|
+
*/
|
|
222
|
+
var SeedBudget = class {
|
|
223
|
+
#queries = 0;
|
|
224
|
+
#mediaDownloads = 0;
|
|
225
|
+
constructor(limits) {
|
|
226
|
+
this.limits = limits;
|
|
227
|
+
}
|
|
228
|
+
transformQuery(args) {
|
|
229
|
+
this.#queries++;
|
|
230
|
+
return args.node;
|
|
231
|
+
}
|
|
232
|
+
transformResult(args) {
|
|
233
|
+
return Promise.resolve(args.result);
|
|
234
|
+
}
|
|
235
|
+
countMediaDownload() {
|
|
236
|
+
this.#mediaDownloads++;
|
|
237
|
+
}
|
|
238
|
+
isSpent() {
|
|
239
|
+
const { queries, mediaDownloads } = this.limits;
|
|
240
|
+
return queries !== void 0 && this.#queries >= queries || mediaDownloads !== void 0 && this.#mediaDownloads >= mediaDownloads;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
async function applySeedWrites(db, seed, options, budget) {
|
|
244
|
+
const validation = validateSeed(seed);
|
|
245
|
+
if (!validation.valid) throw new Error(`Invalid seed file:\n${validation.errors.join("\n")}`);
|
|
246
|
+
const { includeContent = false, storage, skipMediaDownload = false, onConflict = "skip" } = options;
|
|
247
|
+
if (budget && onConflict !== "skip") throw new Error("A seed budget requires onConflict: \"skip\"");
|
|
248
|
+
const result = {
|
|
249
|
+
blockTypes: {
|
|
250
|
+
created: 0,
|
|
251
|
+
skipped: 0,
|
|
252
|
+
updated: 0
|
|
253
|
+
},
|
|
254
|
+
collections: {
|
|
255
|
+
created: 0,
|
|
256
|
+
skipped: 0,
|
|
257
|
+
updated: 0
|
|
258
|
+
},
|
|
259
|
+
fields: {
|
|
260
|
+
created: 0,
|
|
261
|
+
skipped: 0,
|
|
262
|
+
updated: 0
|
|
263
|
+
},
|
|
264
|
+
relations: {
|
|
265
|
+
created: 0,
|
|
266
|
+
skipped: 0,
|
|
267
|
+
updated: 0
|
|
268
|
+
},
|
|
269
|
+
taxonomies: {
|
|
270
|
+
created: 0,
|
|
271
|
+
skipped: 0,
|
|
272
|
+
terms: 0
|
|
273
|
+
},
|
|
274
|
+
bylines: {
|
|
275
|
+
created: 0,
|
|
276
|
+
skipped: 0,
|
|
277
|
+
updated: 0
|
|
278
|
+
},
|
|
279
|
+
menus: {
|
|
280
|
+
created: 0,
|
|
281
|
+
items: 0
|
|
282
|
+
},
|
|
283
|
+
redirects: {
|
|
284
|
+
created: 0,
|
|
285
|
+
skipped: 0,
|
|
286
|
+
updated: 0
|
|
287
|
+
},
|
|
288
|
+
widgetAreas: {
|
|
289
|
+
created: 0,
|
|
290
|
+
widgets: 0
|
|
291
|
+
},
|
|
292
|
+
sections: {
|
|
293
|
+
created: 0,
|
|
294
|
+
skipped: 0,
|
|
295
|
+
updated: 0
|
|
296
|
+
},
|
|
297
|
+
settings: { applied: 0 },
|
|
298
|
+
content: {
|
|
299
|
+
created: 0,
|
|
300
|
+
skipped: 0,
|
|
301
|
+
updated: 0
|
|
302
|
+
},
|
|
303
|
+
media: {
|
|
304
|
+
created: 0,
|
|
305
|
+
skipped: 0
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
let complete = true;
|
|
309
|
+
const progress = {
|
|
310
|
+
done: 0,
|
|
311
|
+
total: countSeedItems(seed, includeContent)
|
|
312
|
+
};
|
|
313
|
+
const mayCreateItem = () => !budget || result.taxonomies.terms + result.bylines.created + result.content.created === 0 || !budget.isSpent();
|
|
314
|
+
const mediaContext = {
|
|
315
|
+
db,
|
|
316
|
+
storage: storage ?? null,
|
|
317
|
+
skipMediaDownload,
|
|
318
|
+
mediaBasePath: options.mediaBasePath,
|
|
319
|
+
mediaCache: /* @__PURE__ */ new Map(),
|
|
320
|
+
budget
|
|
321
|
+
};
|
|
322
|
+
const seedIdMap = /* @__PURE__ */ new Map();
|
|
323
|
+
const seedBylineIdMap = /* @__PURE__ */ new Map();
|
|
324
|
+
const staleMarkedContentCollections = /* @__PURE__ */ new Set();
|
|
325
|
+
const failedStaleContentCollections = /* @__PURE__ */ new Set();
|
|
326
|
+
const defaultLocale = getI18nConfig()?.defaultLocale ?? seed.defaultLocale ?? "en";
|
|
327
|
+
const markSeedContentCollectionStale = async (collectionSlug) => {
|
|
328
|
+
if (staleMarkedContentCollections.has(collectionSlug)) return;
|
|
329
|
+
if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
|
|
330
|
+
staleMarkedContentCollections.add(collectionSlug);
|
|
331
|
+
failedStaleContentCollections.delete(collectionSlug);
|
|
332
|
+
} else failedStaleContentCollections.add(collectionSlug);
|
|
333
|
+
};
|
|
334
|
+
const retryFailedSeedContentStaleMarks = async () => {
|
|
335
|
+
for (const collectionSlug of failedStaleContentCollections) if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
|
|
336
|
+
staleMarkedContentCollections.add(collectionSlug);
|
|
337
|
+
failedStaleContentCollections.delete(collectionSlug);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
if (seed.settings) await applySiteSettings(db, seed.settings, onConflict, result);
|
|
341
|
+
if (seed.relations) await applySeedRelations(db, seed.relations, seed.collections ?? [], onConflict, result);
|
|
342
|
+
if (seed.blockTypes) {
|
|
343
|
+
const registry = new BlockTypeRegistry(db);
|
|
344
|
+
for (const blockType of seed.blockTypes) {
|
|
345
|
+
const existing = await registry.getBlockType(blockType.slug);
|
|
346
|
+
await registry.applySeedBlockType(blockType, onConflict);
|
|
347
|
+
if (!existing) result.blockTypes.created++;
|
|
348
|
+
else if (onConflict === "update") result.blockTypes.updated++;
|
|
349
|
+
else result.blockTypes.skipped++;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (seed.collections) {
|
|
353
|
+
const registry = new SchemaRegistry(db);
|
|
354
|
+
const seedCollectionSlugs = new Set(seed.collections.map((collection) => collection.slug));
|
|
355
|
+
const knownRelations = await readRelationEnds(db);
|
|
356
|
+
const relationSlugs = new Set(knownRelations.keys());
|
|
357
|
+
const externalTargetExists = /* @__PURE__ */ new Map();
|
|
358
|
+
const pendingRelations = [];
|
|
359
|
+
for (const collection of seed.collections) {
|
|
360
|
+
if (await registry.getCollection(collection.slug)) {
|
|
361
|
+
if (onConflict === "error") throw new Error(`Conflict: collection "${collection.slug}" already exists`);
|
|
362
|
+
if (onConflict === "update") {
|
|
363
|
+
await registry.updateCollection(collection.slug, {
|
|
364
|
+
label: collection.label,
|
|
365
|
+
labelSingular: collection.labelSingular,
|
|
366
|
+
description: collection.description,
|
|
367
|
+
icon: collection.icon,
|
|
368
|
+
admin: collection.admin,
|
|
369
|
+
supports: collection.supports || [],
|
|
370
|
+
urlPattern: collection.urlPattern,
|
|
371
|
+
routable: collection.routable,
|
|
372
|
+
hidden: collection.hidden,
|
|
373
|
+
sortOrder: collection.sortOrder,
|
|
374
|
+
group: collection.group,
|
|
375
|
+
commentsEnabled: collection.commentsEnabled,
|
|
376
|
+
editLocking: collection.editLocking
|
|
377
|
+
});
|
|
378
|
+
result.collections.updated++;
|
|
379
|
+
for (const field of collection.fields) {
|
|
380
|
+
const existingField = await registry.getField(collection.slug, field.slug);
|
|
381
|
+
await upsertSeedField(db, collection.slug, field, existingField, knownRelations);
|
|
382
|
+
if (existingField) result.fields.updated++;
|
|
383
|
+
else result.fields.created++;
|
|
384
|
+
}
|
|
385
|
+
await applyDisplayDateFields(registry, collection);
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
result.collections.skipped++;
|
|
389
|
+
result.fields.skipped += collection.fields.length;
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
const fields = [];
|
|
393
|
+
for (const field of collection.fields) {
|
|
394
|
+
let fieldValidation = field.validation;
|
|
395
|
+
const bound = resolveSeedFieldRelation(collection.slug, field, knownRelations);
|
|
396
|
+
const targetCollection = !bound && field.type === "reference" && typeof fieldValidation?.targetCollection === "string" ? fieldValidation.targetCollection : void 0;
|
|
397
|
+
if (bound) fieldValidation = {
|
|
398
|
+
...fieldValidation,
|
|
399
|
+
...bound
|
|
400
|
+
};
|
|
401
|
+
if (targetCollection) {
|
|
402
|
+
let targetExists = seedCollectionSlugs.has(targetCollection);
|
|
403
|
+
if (!targetExists) {
|
|
404
|
+
targetExists = externalTargetExists.get(targetCollection) ?? false;
|
|
405
|
+
if (!externalTargetExists.has(targetCollection)) {
|
|
406
|
+
targetExists = Boolean(await registry.getCollection(targetCollection));
|
|
407
|
+
externalTargetExists.set(targetCollection, targetExists);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (!targetExists) throw new SchemaError(`Target collection "${targetCollection}" not found`, "COLLECTION_NOT_FOUND");
|
|
411
|
+
const relationId = ulid();
|
|
412
|
+
const relationSlug = allocateSeedRelationName(collection.slug, field.slug, relationSlugs);
|
|
413
|
+
pendingRelations.push({
|
|
414
|
+
id: relationId,
|
|
415
|
+
slug: relationSlug,
|
|
416
|
+
parent_collection: collection.slug,
|
|
417
|
+
child_collection: targetCollection,
|
|
418
|
+
parent_label: collection.label,
|
|
419
|
+
parent_label_singular: collection.labelSingular ?? null,
|
|
420
|
+
child_label: field.label,
|
|
421
|
+
max_children_per_parent: fieldValidation?.multiple ? null : 1
|
|
422
|
+
});
|
|
423
|
+
fieldValidation = {
|
|
424
|
+
...fieldValidation,
|
|
425
|
+
relation: relationSlug,
|
|
426
|
+
relationSide: "parent"
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
fields.push({
|
|
430
|
+
slug: field.slug,
|
|
431
|
+
label: field.label,
|
|
432
|
+
type: field.type,
|
|
433
|
+
required: field.required || false,
|
|
434
|
+
unique: field.unique || false,
|
|
435
|
+
searchable: field.searchable || false,
|
|
436
|
+
indexed: field.indexed || false,
|
|
437
|
+
translatable: field.translatable,
|
|
438
|
+
defaultValue: field.defaultValue,
|
|
439
|
+
validation: fieldValidation,
|
|
440
|
+
widget: field.widget,
|
|
441
|
+
options: field.options
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
await registry.createSeedCollection({
|
|
445
|
+
slug: collection.slug,
|
|
446
|
+
label: collection.label,
|
|
447
|
+
labelSingular: collection.labelSingular,
|
|
448
|
+
description: collection.description,
|
|
449
|
+
icon: collection.icon,
|
|
450
|
+
admin: collection.admin,
|
|
451
|
+
supports: collection.supports || [],
|
|
452
|
+
urlPattern: collection.urlPattern,
|
|
453
|
+
routable: collection.routable,
|
|
454
|
+
hidden: collection.hidden,
|
|
455
|
+
sortOrder: collection.sortOrder,
|
|
456
|
+
group: collection.group,
|
|
457
|
+
commentsEnabled: collection.commentsEnabled,
|
|
458
|
+
editLocking: collection.editLocking
|
|
459
|
+
}, fields);
|
|
460
|
+
await applyDisplayDateFields(registry, collection);
|
|
461
|
+
result.collections.created++;
|
|
462
|
+
result.fields.created += collection.fields.length;
|
|
463
|
+
}
|
|
464
|
+
for (const relationBatch of chunks(pendingRelations, SEED_RELATION_INSERT_BATCH_SIZE)) await db.insertInto("_emdash_relations").values(relationBatch).execute();
|
|
465
|
+
}
|
|
466
|
+
if (seed.taxonomies) {
|
|
467
|
+
const termSeedIdMap = /* @__PURE__ */ new Map();
|
|
468
|
+
const taxonomiesBySeedId = /* @__PURE__ */ new Map();
|
|
469
|
+
for (const taxonomy of seed.taxonomies) if (taxonomy.id) taxonomiesBySeedId.set(taxonomy.id, taxonomy);
|
|
470
|
+
const untouchedBuiltInDefIds = new Set((await db.selectFrom("_emdash_taxonomy_defs").select([
|
|
471
|
+
"id",
|
|
472
|
+
"label",
|
|
473
|
+
"label_singular",
|
|
474
|
+
"hierarchical",
|
|
475
|
+
"collections"
|
|
476
|
+
]).where("id", "in", [...BUILT_IN_TAXONOMY_DEFS.keys()]).execute()).filter(isUntouchedBuiltInTaxonomyDef).map((def) => def.id));
|
|
477
|
+
const declaresOwnStructure = (taxonomy) => findTaxonomyStructureSource(taxonomy, taxonomiesBySeedId) === taxonomy;
|
|
478
|
+
const orderedTaxonomies = [...seed.taxonomies.filter(declaresOwnStructure), ...seed.taxonomies.filter((taxonomy) => !declaresOwnStructure(taxonomy))];
|
|
479
|
+
for (const taxonomy of orderedTaxonomies) {
|
|
480
|
+
const defLocale = resolveConfiguredLocale(taxonomy.locale ?? defaultLocale);
|
|
481
|
+
const defsOfName = await db.selectFrom("_emdash_taxonomy_defs").select(["id", "locale"]).where("name", "=", taxonomy.name).execute();
|
|
482
|
+
const existingDef = defsOfName.filter((def) => resolveConfiguredLocale(def.locale) === defLocale).toSorted((a, b) => getLocaleRank(a.locale, defLocale) - getLocaleRank(b.locale, defLocale) || a.id.localeCompare(b.id))[0];
|
|
483
|
+
const unclaimed = existingDef !== void 0 && untouchedBuiltInDefIds.has(existingDef.id);
|
|
484
|
+
if (existingDef && onConflict === "error" && !unclaimed) throw new Error(`Conflict: taxonomy "${taxonomy.name}" (${defLocale}) already exists`);
|
|
485
|
+
const replacesDef = onConflict === "update" || unclaimed;
|
|
486
|
+
const existingStructure = await findTaxonomyStructure(db, taxonomy.name);
|
|
487
|
+
const replacesStructure = replacesDef || defsOfName.every((def) => untouchedBuiltInDefIds.has(def.id));
|
|
488
|
+
const writesStructure = !existingStructure || replacesStructure && !taxonomy.translationOf;
|
|
489
|
+
const structure = existingStructure && !writesStructure ? existingStructure : {
|
|
490
|
+
hierarchical: taxonomy.hierarchical ?? existingStructure?.hierarchical ?? false,
|
|
491
|
+
collections: taxonomy.collections ?? existingStructure?.collections ?? []
|
|
492
|
+
};
|
|
493
|
+
const defId = existingDef?.id ?? ulid();
|
|
494
|
+
const translationGroup = writesStructure ? await saveTaxonomyStructure(db, taxonomy.name, existingStructure?.id ?? defId, structure) : existingStructure.id;
|
|
495
|
+
if (existingDef) if (replacesDef) await db.updateTable("_emdash_taxonomy_defs").set({
|
|
496
|
+
label: taxonomy.label,
|
|
497
|
+
label_singular: taxonomy.labelSingular ?? null
|
|
498
|
+
}).where("id", "=", existingDef.id).execute();
|
|
499
|
+
else result.taxonomies.skipped++;
|
|
500
|
+
else {
|
|
501
|
+
await db.insertInto("_emdash_taxonomy_defs").values({
|
|
502
|
+
id: defId,
|
|
503
|
+
name: taxonomy.name,
|
|
504
|
+
label: taxonomy.label,
|
|
505
|
+
label_singular: taxonomy.labelSingular ?? null,
|
|
506
|
+
hierarchical: structure.hierarchical ? 1 : 0,
|
|
507
|
+
collections: JSON.stringify(structure.collections),
|
|
508
|
+
locale: defLocale,
|
|
509
|
+
translation_group: translationGroup
|
|
510
|
+
}).execute();
|
|
511
|
+
result.taxonomies.created++;
|
|
512
|
+
}
|
|
513
|
+
if (includeContent && taxonomy.terms && taxonomy.terms.length > 0) {
|
|
514
|
+
const termRepo = new TaxonomyRepository(db);
|
|
515
|
+
const existingTerms = await findExistingSeedTerms(db, taxonomy.name, taxonomy.terms);
|
|
516
|
+
if (structure.hierarchical) {
|
|
517
|
+
const applied = await applyHierarchicalTerms(termRepo, taxonomy.name, defLocale, taxonomy.terms, existingTerms, termSeedIdMap, result, onConflict, mayCreateItem);
|
|
518
|
+
progress.done += applied.processed;
|
|
519
|
+
complete = applied.complete;
|
|
520
|
+
} else for (const term of taxonomy.terms) {
|
|
521
|
+
const termLocale = resolveConfiguredLocale(term.locale ?? defLocale);
|
|
522
|
+
const termKey = seedTermKey(termLocale, term.slug);
|
|
523
|
+
const existingId = existingTerms.get(termKey);
|
|
524
|
+
if (existingId) {
|
|
525
|
+
if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomy.name}" (${termLocale}) already exists`);
|
|
526
|
+
if (onConflict === "update") {
|
|
527
|
+
await termRepo.update(existingId, {
|
|
528
|
+
label: term.label,
|
|
529
|
+
data: term.description ? { description: term.description } : {}
|
|
530
|
+
});
|
|
531
|
+
result.taxonomies.terms++;
|
|
532
|
+
}
|
|
533
|
+
if (term.id) termSeedIdMap.set(term.id, existingId);
|
|
534
|
+
progress.done++;
|
|
535
|
+
} else {
|
|
536
|
+
if (!mayCreateItem()) {
|
|
537
|
+
complete = false;
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
|
|
541
|
+
const created = await termRepo.create({
|
|
542
|
+
name: taxonomy.name,
|
|
543
|
+
slug: term.slug,
|
|
544
|
+
label: term.label,
|
|
545
|
+
data: term.description ? { description: term.description } : void 0,
|
|
546
|
+
locale: termLocale,
|
|
547
|
+
translationOf
|
|
548
|
+
});
|
|
549
|
+
existingTerms.set(termKey, created.id);
|
|
550
|
+
if (term.id) termSeedIdMap.set(term.id, created.id);
|
|
551
|
+
result.taxonomies.terms++;
|
|
552
|
+
progress.done++;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (!complete) break;
|
|
557
|
+
}
|
|
558
|
+
const { invalidateTaxonomyDefsCache } = await import("./taxonomies-BMuFLd53.mjs").then((n) => n.f);
|
|
559
|
+
invalidateTaxonomyDefsCache();
|
|
560
|
+
}
|
|
561
|
+
if (complete && includeContent && seed.bylines) {
|
|
562
|
+
const bylineRepo = new BylineRepository(db);
|
|
563
|
+
const existingBylines = await findExistingSeedBylines(db, seed.bylines.map((byline) => byline.slug));
|
|
564
|
+
for (const byline of seed.bylines) {
|
|
565
|
+
const existingId = existingBylines.get(byline.slug);
|
|
566
|
+
if (existingId) {
|
|
567
|
+
if (onConflict === "error") throw new Error(`Conflict: byline "${byline.slug}" already exists`);
|
|
568
|
+
if (onConflict === "update") {
|
|
569
|
+
const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
|
|
570
|
+
try {
|
|
571
|
+
if (!await bylineRepo.update(existingId, {
|
|
572
|
+
displayName: byline.displayName,
|
|
573
|
+
bio: byline.bio ?? null,
|
|
574
|
+
websiteUrl: byline.websiteUrl ?? null,
|
|
575
|
+
isGuest: byline.isGuest,
|
|
576
|
+
...avatar ? { avatarMediaId: avatar.id } : {}
|
|
577
|
+
})) throw new Error(`Byline "${byline.slug}" disappeared during update`);
|
|
578
|
+
} catch (error) {
|
|
579
|
+
if (avatar?.created) await deleteMediaRow(db, avatar.id);
|
|
580
|
+
throw error;
|
|
581
|
+
}
|
|
582
|
+
seedBylineIdMap.set(byline.id, existingId);
|
|
583
|
+
result.bylines.updated++;
|
|
584
|
+
if (avatar?.created) result.media.created++;
|
|
585
|
+
progress.done++;
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
seedBylineIdMap.set(byline.id, existingId);
|
|
589
|
+
result.bylines.skipped++;
|
|
590
|
+
progress.done++;
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
593
|
+
if (!mayCreateItem()) {
|
|
594
|
+
complete = false;
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
|
|
598
|
+
let createdId;
|
|
599
|
+
try {
|
|
600
|
+
createdId = (await bylineRepo.create({
|
|
601
|
+
slug: byline.slug,
|
|
602
|
+
displayName: byline.displayName,
|
|
603
|
+
bio: byline.bio ?? null,
|
|
604
|
+
websiteUrl: byline.websiteUrl ?? null,
|
|
605
|
+
isGuest: byline.isGuest,
|
|
606
|
+
avatarMediaId: avatar?.id ?? null
|
|
607
|
+
})).id;
|
|
608
|
+
} catch (error) {
|
|
609
|
+
if (avatar?.created) await deleteMediaRow(db, avatar.id);
|
|
610
|
+
throw error;
|
|
611
|
+
}
|
|
612
|
+
existingBylines.set(byline.slug, createdId);
|
|
613
|
+
seedBylineIdMap.set(byline.id, createdId);
|
|
614
|
+
result.bylines.created++;
|
|
615
|
+
if (avatar?.created) result.media.created++;
|
|
616
|
+
progress.done++;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (complete && includeContent && seed.content) {
|
|
620
|
+
const contentRepo = new ContentRepository(db);
|
|
621
|
+
const schemaRegistry = new SchemaRegistry(db);
|
|
622
|
+
const datetimeContexts = /* @__PURE__ */ new Map();
|
|
623
|
+
try {
|
|
624
|
+
for (const [collectionSlug, entries] of Object.entries(seed.content)) {
|
|
625
|
+
const clearedTaxonomyGroups = /* @__PURE__ */ new Set();
|
|
626
|
+
const collectionInfo = await schemaRegistry.getCollectionWithFields(collectionSlug);
|
|
627
|
+
const collectionRoutable = collectionInfo?.routable !== false;
|
|
628
|
+
const referenceFields = referenceFieldsOf(collectionInfo);
|
|
629
|
+
const resolvedBlockTypes = collectionInfo?.fields.some((field) => field.type === "blocks") ? await resolveBlockTypes(db) : void 0;
|
|
630
|
+
const existingEntries = await findExistingSeedEntries(contentRepo, collectionSlug, entries, defaultLocale);
|
|
631
|
+
const trashedEntries = await findExistingSeedEntries(contentRepo, collectionSlug, entries.filter((entry) => {
|
|
632
|
+
const { slug, locale } = seedEntryIdentity(entry, defaultLocale);
|
|
633
|
+
return !existingEntries.has(seedEntryKey(entry, slug, locale));
|
|
634
|
+
}), defaultLocale, true);
|
|
635
|
+
for (const entry of entries) {
|
|
636
|
+
const { slug: entrySlug, locale: entryLocale } = seedEntryIdentity(entry, defaultLocale);
|
|
637
|
+
const entryKey = seedEntryKey(entry, entrySlug, entryLocale);
|
|
638
|
+
const existing = existingEntries.get(entryKey);
|
|
639
|
+
if (!existing) {
|
|
640
|
+
if (trashedEntries.get(entryKey)) {
|
|
641
|
+
if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists (in trash)`);
|
|
642
|
+
console.warn(`content.${collectionSlug}: "${entrySlug ?? entry.id}" (${entryLocale}) exists in the trash — skipping`);
|
|
643
|
+
result.content.skipped++;
|
|
644
|
+
progress.done++;
|
|
645
|
+
continue;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
if (existing) {
|
|
649
|
+
if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists`);
|
|
650
|
+
if (onConflict === "update") {
|
|
651
|
+
let resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
|
|
652
|
+
if (collectionInfo) resolvedData = await normalizeBlocksData(db, collectionInfo, resolvedData, existing.data, { restoreBlocks: true }, false, resolvedBlockTypes);
|
|
653
|
+
const { columnData, edges } = splitReferenceFields(collectionSlug, referenceFields, resolvedData);
|
|
654
|
+
const status = entry.status || "published";
|
|
655
|
+
let contentMutated = false;
|
|
656
|
+
try {
|
|
657
|
+
await withTransaction(db, async (trx) => {
|
|
658
|
+
const trxContentRepo = new ContentRepository(trx, datetimeContexts);
|
|
659
|
+
const trxBylineRepo = new BylineRepository(trx);
|
|
660
|
+
const trxRevisionRepo = new RevisionRepository(trx, datetimeContexts);
|
|
661
|
+
await trxContentRepo.update(collectionSlug, existing.id, {
|
|
662
|
+
status,
|
|
663
|
+
data: columnData
|
|
664
|
+
});
|
|
665
|
+
contentMutated = true;
|
|
666
|
+
await applyContentBylines(trxBylineRepo, collectionSlug, existing.id, entry, seedBylineIdMap, true);
|
|
667
|
+
await applyContentTaxonomies(trx, collectionSlug, existing.id, entry, existing.locale ?? entryLocale, existing.translationGroup ?? existing.id, clearedTaxonomyGroups);
|
|
668
|
+
await applyContentReferences(trx, collectionSlug, existing.id, edges);
|
|
669
|
+
if (status === "published") {
|
|
670
|
+
const draft = await trxRevisionRepo.create({
|
|
671
|
+
collection: collectionSlug,
|
|
672
|
+
entryId: existing.id,
|
|
673
|
+
data: columnData
|
|
674
|
+
});
|
|
675
|
+
try {
|
|
676
|
+
await trxContentRepo.setDraftRevision(collectionSlug, existing.id, draft.id);
|
|
677
|
+
await trxContentRepo.publish(collectionSlug, existing.id, void 0, false, void 0, true, collectionRoutable);
|
|
678
|
+
} catch (error) {
|
|
679
|
+
try {
|
|
680
|
+
await trxRevisionRepo.deleteIfUnreferenced(collectionSlug, existing.id, draft.id);
|
|
681
|
+
} catch (cleanupError) {
|
|
682
|
+
console.error(`[seed] Failed to clean up unstaged revision ${draft.id}:`, cleanupError);
|
|
683
|
+
}
|
|
684
|
+
throw error;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
} catch (error) {
|
|
689
|
+
if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
|
|
690
|
+
throw error;
|
|
691
|
+
}
|
|
692
|
+
seedIdMap.set(entry.id, existing.id);
|
|
693
|
+
result.content.updated++;
|
|
694
|
+
progress.done++;
|
|
695
|
+
await markSeedContentCollectionStale(collectionSlug);
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
result.content.skipped++;
|
|
699
|
+
seedIdMap.set(entry.id, existing.id);
|
|
700
|
+
progress.done++;
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
if (!mayCreateItem()) {
|
|
704
|
+
complete = false;
|
|
705
|
+
break;
|
|
706
|
+
}
|
|
707
|
+
let resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
|
|
708
|
+
if (collectionInfo) resolvedData = await normalizeBlocksData(db, collectionInfo, resolvedData, {}, { restoreBlocks: true }, false, resolvedBlockTypes);
|
|
709
|
+
const { columnData, edges } = splitReferenceFields(collectionSlug, referenceFields, resolvedData);
|
|
710
|
+
let translationOf;
|
|
711
|
+
if (entry.translationOf) {
|
|
712
|
+
const sourceId = seedIdMap.get(entry.translationOf);
|
|
713
|
+
if (!sourceId) console.warn(`content.${collectionSlug}: translationOf "${entry.translationOf}" not found (not yet created or missing). Skipping translation link.`);
|
|
714
|
+
else translationOf = sourceId;
|
|
715
|
+
}
|
|
716
|
+
const status = entry.status || "published";
|
|
717
|
+
let contentMutated = false;
|
|
718
|
+
let created;
|
|
719
|
+
try {
|
|
720
|
+
created = await withTransaction(db, async (trx) => {
|
|
721
|
+
const trxContentRepo = new ContentRepository(trx, datetimeContexts);
|
|
722
|
+
const trxBylineRepo = new BylineRepository(trx);
|
|
723
|
+
const item = await trxContentRepo.create({
|
|
724
|
+
...entrySlug ? {} : { id: entry.id },
|
|
725
|
+
type: collectionSlug,
|
|
726
|
+
slug: entrySlug,
|
|
727
|
+
status,
|
|
728
|
+
data: columnData,
|
|
729
|
+
locale: entryLocale,
|
|
730
|
+
translationOf,
|
|
731
|
+
publishedAt: status === "published" ? (/* @__PURE__ */ new Date()).toISOString() : null
|
|
732
|
+
});
|
|
733
|
+
contentMutated = true;
|
|
734
|
+
await applyContentBylines(trxBylineRepo, collectionSlug, item.id, entry, seedBylineIdMap);
|
|
735
|
+
await applyContentTaxonomies(trx, collectionSlug, item.id, entry, entryLocale, void 0, clearedTaxonomyGroups);
|
|
736
|
+
await applyContentReferences(trx, collectionSlug, item.id, edges);
|
|
737
|
+
if (status === "published") await trxContentRepo.publish(collectionSlug, item.id, void 0, false, void 0, true, collectionRoutable);
|
|
738
|
+
return item;
|
|
739
|
+
});
|
|
740
|
+
} catch (error) {
|
|
741
|
+
if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
|
|
742
|
+
throw error;
|
|
743
|
+
}
|
|
744
|
+
seedIdMap.set(entry.id, created.id);
|
|
745
|
+
existingEntries.set(entryKey, created);
|
|
746
|
+
result.content.created++;
|
|
747
|
+
progress.done++;
|
|
748
|
+
await markSeedContentCollectionStale(collectionSlug);
|
|
749
|
+
}
|
|
750
|
+
if (!complete) break;
|
|
751
|
+
}
|
|
752
|
+
} finally {
|
|
753
|
+
await retryFailedSeedContentStaleMarks();
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (complete && !mayCreateItem()) complete = false;
|
|
757
|
+
if (!complete) {
|
|
758
|
+
await invalidateSeedCaches();
|
|
759
|
+
return {
|
|
760
|
+
result,
|
|
761
|
+
complete,
|
|
762
|
+
progress
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
if (seed.menus) {
|
|
766
|
+
const menuSeedIdMap = /* @__PURE__ */ new Map();
|
|
767
|
+
const itemSeedIdMap = /* @__PURE__ */ new Map();
|
|
768
|
+
const menuIds = [];
|
|
769
|
+
const itemRows = [];
|
|
770
|
+
try {
|
|
771
|
+
for (const menu of seed.menus) {
|
|
772
|
+
const locale = resolveConfiguredLocale(menu.locale ?? defaultLocale);
|
|
773
|
+
let lookup = db.selectFrom("_emdash_menus").selectAll().where("name", "=", menu.name).where(localeMatches("locale", locale)).orderBy(localeOrder("locale", locale), "asc").orderBy("id", "asc");
|
|
774
|
+
const existingMenu = await lookup.executeTakeFirst();
|
|
775
|
+
let menuId;
|
|
776
|
+
let translationGroup;
|
|
777
|
+
if (existingMenu) {
|
|
778
|
+
menuId = existingMenu.id;
|
|
779
|
+
translationGroup = existingMenu.translation_group ?? existingMenu.id;
|
|
780
|
+
} else {
|
|
781
|
+
menuId = ulid();
|
|
782
|
+
translationGroup = menuId;
|
|
783
|
+
if (menu.translationOf) {
|
|
784
|
+
const source = menuSeedIdMap.get(menu.translationOf);
|
|
785
|
+
if (source) translationGroup = source.translationGroup;
|
|
786
|
+
else console.warn(`menu "${menu.name}" (${locale}): translationOf "${menu.translationOf}" not found yet; minting a fresh group.`);
|
|
787
|
+
}
|
|
788
|
+
if (await db.insertInto("_emdash_menus").values({
|
|
789
|
+
id: menuId,
|
|
790
|
+
name: menu.name,
|
|
791
|
+
label: menu.label,
|
|
792
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
793
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
794
|
+
locale,
|
|
795
|
+
translation_group: translationGroup
|
|
796
|
+
}).onConflict((conflict) => conflict.columns(["name", "locale"]).doNothing()).returning("id").executeTakeFirst()) result.menus.created++;
|
|
797
|
+
else {
|
|
798
|
+
const concurrentMenu = await lookup.executeTakeFirstOrThrow();
|
|
799
|
+
menuId = concurrentMenu.id;
|
|
800
|
+
translationGroup = concurrentMenu.translation_group ?? concurrentMenu.id;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
if (menu.id) menuSeedIdMap.set(menu.id, {
|
|
804
|
+
id: menuId,
|
|
805
|
+
translationGroup
|
|
806
|
+
});
|
|
807
|
+
menuIds.push(menuId);
|
|
808
|
+
const itemCount = collectMenuItems(itemRows, menuId, existingMenu?.locale ?? locale, menu.items, null, 0, seedIdMap, itemSeedIdMap);
|
|
809
|
+
result.menus.items += itemCount;
|
|
810
|
+
}
|
|
811
|
+
const buildStatements = (target) => [...menuIds.map((id) => target.deleteFrom("_emdash_menu_items").where("menu_id", "=", id)), ...chunks(itemRows, SEED_MENU_ITEM_INSERT_BATCH_SIZE).map((rows) => target.insertInto("_emdash_menu_items").values(rows))];
|
|
812
|
+
await replaceSeedChildren(db, "_emdash_menus", menuIds, buildStatements);
|
|
813
|
+
} finally {
|
|
814
|
+
invalidateMenuObjectCache();
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (seed.redirects) {
|
|
818
|
+
const redirectRepo = new RedirectRepository(db);
|
|
819
|
+
for (const redirect of seed.redirects) {
|
|
820
|
+
const existing = await redirectRepo.findBySource(redirect.source);
|
|
821
|
+
if (existing) {
|
|
822
|
+
if (onConflict === "error") throw new Error(`Conflict: redirect "${redirect.source}" already exists`);
|
|
823
|
+
if (onConflict === "update") {
|
|
824
|
+
await redirectRepo.update(existing.id, {
|
|
825
|
+
destination: redirect.destination,
|
|
826
|
+
type: redirect.type,
|
|
827
|
+
enabled: redirect.enabled,
|
|
828
|
+
groupName: redirect.groupName
|
|
829
|
+
});
|
|
830
|
+
result.redirects.updated++;
|
|
831
|
+
continue;
|
|
832
|
+
}
|
|
833
|
+
result.redirects.skipped++;
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
await redirectRepo.create({
|
|
837
|
+
source: redirect.source,
|
|
838
|
+
destination: redirect.destination,
|
|
839
|
+
type: redirect.type,
|
|
840
|
+
enabled: redirect.enabled,
|
|
841
|
+
groupName: redirect.groupName
|
|
842
|
+
});
|
|
843
|
+
result.redirects.created++;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
if (seed.widgetAreas) try {
|
|
847
|
+
const areaIds = [];
|
|
848
|
+
const widgetRows = [];
|
|
849
|
+
for (const area of seed.widgetAreas) {
|
|
850
|
+
const lookup = db.selectFrom("_emdash_widget_areas").selectAll().where("name", "=", area.name);
|
|
851
|
+
const existingArea = await lookup.executeTakeFirst();
|
|
852
|
+
let areaId;
|
|
853
|
+
if (existingArea) areaId = existingArea.id;
|
|
854
|
+
else {
|
|
855
|
+
areaId = ulid();
|
|
856
|
+
if (await db.insertInto("_emdash_widget_areas").values({
|
|
857
|
+
id: areaId,
|
|
858
|
+
name: area.name,
|
|
859
|
+
label: area.label,
|
|
860
|
+
description: area.description ?? null
|
|
861
|
+
}).onConflict((conflict) => conflict.column("name").doNothing()).returning("id").executeTakeFirst()) result.widgetAreas.created++;
|
|
862
|
+
else areaId = (await lookup.executeTakeFirstOrThrow()).id;
|
|
863
|
+
}
|
|
864
|
+
areaIds.push(areaId);
|
|
865
|
+
for (let i = 0; i < area.widgets.length; i++) {
|
|
866
|
+
const widget = area.widgets[i];
|
|
867
|
+
widgetRows.push(createSeedWidgetRow(areaId, widget, i));
|
|
868
|
+
result.widgetAreas.widgets++;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
await replaceSeedChildren(db, "_emdash_widget_areas", areaIds, (target) => [...areaIds.map((id) => target.deleteFrom("_emdash_widgets").where("area_id", "=", id)), ...chunks(widgetRows, SEED_WIDGET_INSERT_BATCH_SIZE).map((rows) => target.insertInto("_emdash_widgets").values(rows))]);
|
|
872
|
+
} finally {
|
|
873
|
+
invalidateWidgetObjectCache();
|
|
874
|
+
}
|
|
875
|
+
if (seed.sections) for (const section of seed.sections) {
|
|
876
|
+
const existing = await db.selectFrom("_emdash_sections").select("id").where("slug", "=", section.slug).executeTakeFirst();
|
|
877
|
+
if (existing) {
|
|
878
|
+
if (onConflict === "error") throw new Error(`Conflict: section "${section.slug}" already exists`);
|
|
879
|
+
if (onConflict === "update") {
|
|
880
|
+
await db.updateTable("_emdash_sections").set({
|
|
881
|
+
title: section.title,
|
|
882
|
+
description: section.description ?? null,
|
|
883
|
+
keywords: section.keywords ? JSON.stringify(section.keywords) : null,
|
|
884
|
+
content: JSON.stringify(section.content),
|
|
885
|
+
source: section.source || "theme",
|
|
886
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
887
|
+
}).where("id", "=", existing.id).execute();
|
|
888
|
+
result.sections.updated++;
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
result.sections.skipped++;
|
|
892
|
+
continue;
|
|
893
|
+
}
|
|
894
|
+
const id = ulid();
|
|
895
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
896
|
+
await db.insertInto("_emdash_sections").values({
|
|
897
|
+
id,
|
|
898
|
+
slug: section.slug,
|
|
899
|
+
title: section.title,
|
|
900
|
+
description: section.description ?? null,
|
|
901
|
+
keywords: section.keywords ? JSON.stringify(section.keywords) : null,
|
|
902
|
+
content: JSON.stringify(section.content),
|
|
903
|
+
preview_media_id: null,
|
|
904
|
+
source: section.source || "theme",
|
|
905
|
+
theme_id: section.source === "theme" ? section.slug : null,
|
|
906
|
+
created_at: now,
|
|
907
|
+
updated_at: now
|
|
908
|
+
}).execute();
|
|
909
|
+
result.sections.created++;
|
|
910
|
+
}
|
|
911
|
+
if (seed.collections) {
|
|
912
|
+
const ftsManager = new FTSManager(db);
|
|
913
|
+
for (const collection of seed.collections) if (collection.supports?.includes("search")) {
|
|
914
|
+
if ((await ftsManager.getSearchableFields(collection.slug)).length > 0) try {
|
|
915
|
+
await ftsManager.enableSearch(collection.slug);
|
|
916
|
+
} catch (err) {
|
|
917
|
+
console.warn(`Failed to enable search for ${collection.slug}:`, err);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
if (result.redirects.created + result.redirects.updated > 0) {
|
|
922
|
+
const { publishRedirectChanges } = await import("./artifacts-BXKMIV2F.mjs").then((n) => n.t);
|
|
923
|
+
await publishRedirectChanges(db);
|
|
924
|
+
}
|
|
925
|
+
await invalidateSeedCaches();
|
|
926
|
+
return {
|
|
927
|
+
result,
|
|
928
|
+
complete,
|
|
929
|
+
progress
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function countSeedItems(seed, includeContent) {
|
|
933
|
+
if (!includeContent) return 0;
|
|
934
|
+
const terms = (seed.taxonomies ?? []).reduce((total, taxonomy) => total + (taxonomy.terms?.length ?? 0), 0);
|
|
935
|
+
const entries = Object.values(seed.content ?? {}).reduce((total, collectionEntries) => total + collectionEntries.length, 0);
|
|
936
|
+
return terms + (seed.bylines?.length ?? 0) + entries;
|
|
937
|
+
}
|
|
938
|
+
function seedTermKey(locale, slug) {
|
|
939
|
+
return `${locale}::${slug}`;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Find which of a taxonomy's seed terms already exist, as term ids keyed by
|
|
943
|
+
* `seedTermKey`. Each query covers a batch of slugs.
|
|
944
|
+
*/
|
|
945
|
+
async function findExistingSeedTerms(db, taxonomyName, terms) {
|
|
946
|
+
const selected = /* @__PURE__ */ new Map();
|
|
947
|
+
for (const batch of chunks([...new Set(terms.map((term) => term.slug))], SQL_BATCH_SIZE)) {
|
|
948
|
+
const rows = await db.selectFrom("taxonomies").select([
|
|
949
|
+
"id",
|
|
950
|
+
"slug",
|
|
951
|
+
"locale"
|
|
952
|
+
]).where("name", "=", taxonomyName).where("slug", "in", batch).execute();
|
|
953
|
+
for (const row of rows) {
|
|
954
|
+
const canonicalLocale = resolveConfiguredLocale(row.locale);
|
|
955
|
+
const key = seedTermKey(canonicalLocale, row.slug);
|
|
956
|
+
const previous = selected.get(key);
|
|
957
|
+
if (previous === void 0 || getLocaleRank(row.locale, canonicalLocale) < getLocaleRank(previous.locale, canonicalLocale) || getLocaleRank(row.locale, canonicalLocale) === getLocaleRank(previous.locale, canonicalLocale) && row.id.localeCompare(previous.id) < 0) selected.set(key, {
|
|
958
|
+
id: row.id,
|
|
959
|
+
locale: row.locale
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
return new Map(Array.from(selected, ([key, value]) => [key, value.id]));
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Match seed bylines by slug, preferring a path over its stored code aliases.
|
|
967
|
+
* Across different configured locales, keep the lowest-locale selection.
|
|
968
|
+
*/
|
|
969
|
+
async function findExistingSeedBylines(db, slugs) {
|
|
970
|
+
const existing = /* @__PURE__ */ new Map();
|
|
971
|
+
for (const batch of chunks([...new Set(slugs)], SQL_BATCH_SIZE)) {
|
|
972
|
+
const rows = await db.selectFrom("_emdash_bylines").select([
|
|
973
|
+
"id",
|
|
974
|
+
"slug",
|
|
975
|
+
"locale"
|
|
976
|
+
]).where("slug", "in", batch).orderBy("locale", "asc").orderBy("id", "asc").execute();
|
|
977
|
+
for (const row of rows) {
|
|
978
|
+
const previous = existing.get(row.slug);
|
|
979
|
+
const locale = resolveConfiguredLocale(row.locale);
|
|
980
|
+
if (!previous || resolveConfiguredLocale(previous.locale) === locale && getLocaleRank(row.locale, locale) < getLocaleRank(previous.locale, locale)) existing.set(row.slug, row);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
return new Map(Array.from(existing, ([slug, row]) => [slug, row.id]));
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Invalidate caches that may have been affected by seed data.
|
|
987
|
+
* Seed creates bylines, redirects, and collections, all of which
|
|
988
|
+
* have module-level caches in the hot path.
|
|
989
|
+
*/
|
|
990
|
+
async function invalidateSeedCaches() {
|
|
991
|
+
const { invalidateBylineCache } = await import("./bylines-txlwgzIK.mjs").then((n) => n.t);
|
|
992
|
+
const { invalidateRedirectCache } = await import("./cache-BjnpmIpb.mjs").then((n) => n.t);
|
|
993
|
+
const { invalidateUrlPatternCache } = await import("./query-DdmHrvie.mjs").then((n) => n.s);
|
|
994
|
+
invalidateBylineCache();
|
|
995
|
+
invalidateRedirectCache();
|
|
996
|
+
invalidateUrlPatternCache();
|
|
997
|
+
}
|
|
998
|
+
function seedEntryIdentity(entry, defaultLocale) {
|
|
999
|
+
return {
|
|
1000
|
+
slug: typeof entry.slug === "string" && entry.slug.trim().length > 0 ? entry.slug : null,
|
|
1001
|
+
locale: resolveConfiguredLocale(entry.locale ?? defaultLocale)
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
async function readRelationEnds(db) {
|
|
1005
|
+
const rows = await db.selectFrom("_emdash_relations").select([
|
|
1006
|
+
"slug",
|
|
1007
|
+
"parent_collection",
|
|
1008
|
+
"child_collection"
|
|
1009
|
+
]).execute();
|
|
1010
|
+
return new Map(rows.map((row) => [row.slug, {
|
|
1011
|
+
parentCollection: row.parent_collection,
|
|
1012
|
+
childCollection: row.child_collection
|
|
1013
|
+
}]));
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Resolve the relation a seed reference field names, and which end of it this
|
|
1017
|
+
* collection sits on.
|
|
1018
|
+
*
|
|
1019
|
+
* `relationSide` is only needed for a self-referential relation, where both ends
|
|
1020
|
+
* are this collection; otherwise the side follows from which end matches.
|
|
1021
|
+
* `targetCollection` is the collection at the other end, derived rather than
|
|
1022
|
+
* trusted, so a seed cannot declare a target the relation disagrees with.
|
|
1023
|
+
*/
|
|
1024
|
+
function resolveSeedFieldRelation(collectionSlug, field, knownRelations) {
|
|
1025
|
+
if (field.type !== "reference") return null;
|
|
1026
|
+
const named = field.validation?.relation;
|
|
1027
|
+
if (typeof named !== "string" || named.length === 0) return null;
|
|
1028
|
+
const relation = knownRelations.get(named);
|
|
1029
|
+
if (!relation) throw new SchemaError(`Relation "${named}" not found`, "RELATION_NOT_FOUND");
|
|
1030
|
+
const declared = field.validation?.relationSide;
|
|
1031
|
+
const side = declared === "parent" || declared === "child" ? declared : relation.parentCollection === collectionSlug ? "parent" : "child";
|
|
1032
|
+
if ((side === "parent" ? relation.parentCollection : relation.childCollection) !== collectionSlug) throw new SchemaError(`Relation "${named}" has no ${side} end on collection "${collectionSlug}"`, "VALIDATION_ERROR");
|
|
1033
|
+
return {
|
|
1034
|
+
relation: named,
|
|
1035
|
+
relationSide: side,
|
|
1036
|
+
targetCollection: side === "parent" ? relation.childCollection : relation.parentCollection
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Create or update the relations a seed declares, before the fields that name
|
|
1041
|
+
* them.
|
|
1042
|
+
*
|
|
1043
|
+
* A relation's two collections are fixed once it exists: changing one would
|
|
1044
|
+
* leave its links pointing into a collection that is no longer an end of it, so
|
|
1045
|
+
* a seed that names different ones fails rather than rewriting the row. Labels
|
|
1046
|
+
* and limits are updated under `onConflict: "update"`.
|
|
1047
|
+
*/
|
|
1048
|
+
async function applySeedRelations(db, relations, seedCollections, onConflict, result) {
|
|
1049
|
+
const existing = await readRelationEnds(db);
|
|
1050
|
+
const known = new Set(seedCollections.map((collection) => collection.slug));
|
|
1051
|
+
for (const row of await db.selectFrom("_emdash_collections").select("slug").execute()) known.add(row.slug);
|
|
1052
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1053
|
+
for (const relation of relations) {
|
|
1054
|
+
for (const end of [relation.parentCollection, relation.childCollection]) if (!known.has(end)) throw new SchemaError(`Relation "${relation.slug}" names collection "${end}", which does not exist`, "COLLECTION_NOT_FOUND");
|
|
1055
|
+
const current = existing.get(relation.slug);
|
|
1056
|
+
if (current) {
|
|
1057
|
+
if (current.parentCollection !== relation.parentCollection || current.childCollection !== relation.childCollection) throw new SchemaError(`Relation "${relation.slug}" joins ${current.parentCollection} to ${current.childCollection}; a relation's collections cannot change`, "RELATION_COLLECTIONS_IMMUTABLE");
|
|
1058
|
+
if (onConflict === "error") throw new Error(`Conflict: relation "${relation.slug}" already exists`);
|
|
1059
|
+
if (onConflict !== "update") {
|
|
1060
|
+
result.relations.skipped++;
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
1063
|
+
await db.updateTable("_emdash_relations").set({
|
|
1064
|
+
parent_label: relation.parentLabel,
|
|
1065
|
+
parent_label_singular: relation.parentLabelSingular ?? null,
|
|
1066
|
+
child_label: relation.childLabel,
|
|
1067
|
+
child_label_singular: relation.childLabelSingular ?? null,
|
|
1068
|
+
max_children_per_parent: relation.maxChildrenPerParent ?? null,
|
|
1069
|
+
max_parents_per_child: relation.maxParentsPerChild ?? null,
|
|
1070
|
+
updated_at: now
|
|
1071
|
+
}).where("slug", "=", relation.slug).execute();
|
|
1072
|
+
result.relations.updated++;
|
|
1073
|
+
continue;
|
|
1074
|
+
}
|
|
1075
|
+
await db.insertInto("_emdash_relations").values({
|
|
1076
|
+
id: ulid(),
|
|
1077
|
+
slug: relation.slug,
|
|
1078
|
+
parent_collection: relation.parentCollection,
|
|
1079
|
+
child_collection: relation.childCollection,
|
|
1080
|
+
parent_label: relation.parentLabel,
|
|
1081
|
+
parent_label_singular: relation.parentLabelSingular ?? null,
|
|
1082
|
+
child_label: relation.childLabel,
|
|
1083
|
+
child_label_singular: relation.childLabelSingular ?? null,
|
|
1084
|
+
max_children_per_parent: relation.maxChildrenPerParent ?? null,
|
|
1085
|
+
max_parents_per_child: relation.maxParentsPerChild ?? null,
|
|
1086
|
+
created_at: now,
|
|
1087
|
+
updated_at: now
|
|
1088
|
+
}).execute();
|
|
1089
|
+
existing.set(relation.slug, {
|
|
1090
|
+
parentCollection: relation.parentCollection,
|
|
1091
|
+
childCollection: relation.childCollection
|
|
1092
|
+
});
|
|
1093
|
+
result.relations.created++;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
function allocateSeedRelationName(collectionSlug, fieldSlug, usedNames) {
|
|
1097
|
+
const baseName = `${collectionSlug}_${fieldSlug}`.slice(0, 63);
|
|
1098
|
+
for (let attempt = 0; attempt < SEED_RELATION_NAME_MAX_ATTEMPTS; attempt++) {
|
|
1099
|
+
const suffix = attempt === 0 ? "" : `_${attempt + 1}`;
|
|
1100
|
+
const name = attempt === 0 ? baseName : `${baseName.slice(0, 63 - suffix.length)}${suffix}`;
|
|
1101
|
+
if (!usedNames.has(name)) {
|
|
1102
|
+
usedNames.add(name);
|
|
1103
|
+
return name;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
throw new SchemaError("Could not allocate a unique relation name", "RELATION_NAME_CONFLICT");
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Slugful entries use the existing locale-aware key. Slugless seed entries
|
|
1110
|
+
* persist their seed ID, which keeps re-application idempotent.
|
|
1111
|
+
*/
|
|
1112
|
+
function seedEntryKey(entry, slug, locale) {
|
|
1113
|
+
return slug === null ? `id:${entry.id}` : `slug:${locale}:${slug}`;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Find which of a collection's seed entries already exist, keyed by
|
|
1117
|
+
* `seedEntryKey`. Each query covers a batch of entries.
|
|
1118
|
+
*/
|
|
1119
|
+
async function findExistingSeedEntries(repo, collectionSlug, entries, defaultLocale, includeTrashed = false) {
|
|
1120
|
+
const identities = entries.map((entry) => ({
|
|
1121
|
+
entry,
|
|
1122
|
+
...seedEntryIdentity(entry, defaultLocale)
|
|
1123
|
+
}));
|
|
1124
|
+
const slugsByLocale = /* @__PURE__ */ new Map();
|
|
1125
|
+
for (const { slug, locale } of identities) {
|
|
1126
|
+
if (slug === null) continue;
|
|
1127
|
+
const slugs = slugsByLocale.get(locale);
|
|
1128
|
+
if (slugs) slugs.push(slug);
|
|
1129
|
+
else slugsByLocale.set(locale, [slug]);
|
|
1130
|
+
}
|
|
1131
|
+
const bySlug = /* @__PURE__ */ new Map();
|
|
1132
|
+
for (const [locale, slugs] of slugsByLocale) bySlug.set(locale, await repo.findManyBySlugsInLocale(collectionSlug, slugs, locale, { includeTrashed }));
|
|
1133
|
+
const byId = await repo.findManyByIds(collectionSlug, identities.filter(({ slug }) => slug === null).map(({ entry }) => entry.id), { includeTrashed });
|
|
1134
|
+
const existing = /* @__PURE__ */ new Map();
|
|
1135
|
+
for (const { entry, slug, locale } of identities) {
|
|
1136
|
+
const item = slug === null ? byId.get(entry.id) : bySlug.get(locale)?.get(slug);
|
|
1137
|
+
if (item) existing.set(seedEntryKey(entry, slug, locale), item);
|
|
1138
|
+
}
|
|
1139
|
+
return existing;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Apply hierarchical taxonomy terms (parents before children). Stops before
|
|
1143
|
+
* creating a term once `mayCreate` returns false, and returns how many terms
|
|
1144
|
+
* were found or created.
|
|
1145
|
+
*/
|
|
1146
|
+
async function applyHierarchicalTerms(termRepo, taxonomyName, defLocale, terms, existingTerms, termSeedIdMap, result, onConflict, mayCreate) {
|
|
1147
|
+
let processed = 0;
|
|
1148
|
+
const slugToId = /* @__PURE__ */ new Map();
|
|
1149
|
+
const resolveTermLocale = (term) => resolveConfiguredLocale(term.locale ?? defLocale);
|
|
1150
|
+
let remaining = [...terms];
|
|
1151
|
+
let maxPasses = 10;
|
|
1152
|
+
while (remaining.length > 0 && maxPasses > 0) {
|
|
1153
|
+
const processedThisPass = [];
|
|
1154
|
+
for (const term of remaining) {
|
|
1155
|
+
const termLocale = resolveTermLocale(term);
|
|
1156
|
+
const parentReady = !term.parent || slugToId.has(`${termLocale}::${term.parent}`);
|
|
1157
|
+
const translationReady = !term.translationOf || termSeedIdMap.has(term.translationOf);
|
|
1158
|
+
if (!parentReady || !translationReady) continue;
|
|
1159
|
+
const parentId = term.parent ? slugToId.get(`${termLocale}::${term.parent}`) : void 0;
|
|
1160
|
+
const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
|
|
1161
|
+
const termKey = seedTermKey(termLocale, term.slug);
|
|
1162
|
+
const existingId = existingTerms.get(termKey);
|
|
1163
|
+
if (existingId) {
|
|
1164
|
+
if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomyName}" (${termLocale}) already exists`);
|
|
1165
|
+
if (onConflict === "update") {
|
|
1166
|
+
await termRepo.update(existingId, {
|
|
1167
|
+
label: term.label,
|
|
1168
|
+
parentId,
|
|
1169
|
+
data: term.description ? { description: term.description } : {}
|
|
1170
|
+
});
|
|
1171
|
+
result.taxonomies.terms++;
|
|
1172
|
+
}
|
|
1173
|
+
slugToId.set(termKey, existingId);
|
|
1174
|
+
if (term.id) termSeedIdMap.set(term.id, existingId);
|
|
1175
|
+
} else {
|
|
1176
|
+
if (!mayCreate()) return {
|
|
1177
|
+
processed,
|
|
1178
|
+
complete: false
|
|
1179
|
+
};
|
|
1180
|
+
const created = await termRepo.create({
|
|
1181
|
+
name: taxonomyName,
|
|
1182
|
+
slug: term.slug,
|
|
1183
|
+
label: term.label,
|
|
1184
|
+
parentId,
|
|
1185
|
+
data: term.description ? { description: term.description } : void 0,
|
|
1186
|
+
locale: termLocale,
|
|
1187
|
+
translationOf
|
|
1188
|
+
});
|
|
1189
|
+
existingTerms.set(termKey, created.id);
|
|
1190
|
+
slugToId.set(termKey, created.id);
|
|
1191
|
+
if (term.id) termSeedIdMap.set(term.id, created.id);
|
|
1192
|
+
result.taxonomies.terms++;
|
|
1193
|
+
}
|
|
1194
|
+
processed++;
|
|
1195
|
+
processedThisPass.push(term.slug + "::" + termLocale);
|
|
1196
|
+
}
|
|
1197
|
+
remaining = remaining.filter((term) => !processedThisPass.includes(term.slug + "::" + resolveTermLocale(term)));
|
|
1198
|
+
maxPasses--;
|
|
1199
|
+
}
|
|
1200
|
+
if (remaining.length > 0) console.warn(`Could not process ${remaining.length} terms due to missing parents/translations`);
|
|
1201
|
+
return {
|
|
1202
|
+
processed,
|
|
1203
|
+
complete: true
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Apply byline credits to a content entry.
|
|
1208
|
+
* In update mode, clears existing credits even if the seed has none.
|
|
1209
|
+
*/
|
|
1210
|
+
async function applyContentBylines(bylineRepo, collectionSlug, contentId, entry, seedBylineIdMap, isUpdate = false) {
|
|
1211
|
+
if (!entry.bylines || entry.bylines.length === 0) {
|
|
1212
|
+
if (isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, []);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
const credits = entry.bylines.map((credit) => {
|
|
1216
|
+
const bylineId = seedBylineIdMap.get(credit.byline);
|
|
1217
|
+
if (!bylineId) return null;
|
|
1218
|
+
return {
|
|
1219
|
+
bylineId,
|
|
1220
|
+
roleLabel: credit.roleLabel ?? null
|
|
1221
|
+
};
|
|
1222
|
+
}).filter((credit) => Boolean(credit));
|
|
1223
|
+
if (credits.length !== entry.bylines.length) console.warn(`content.${collectionSlug}.${entry.slug ?? entry.id}: one or more byline refs could not be resolved`);
|
|
1224
|
+
if (credits.length > 0 || isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, credits);
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Apply taxonomy term assignments to a content entry.
|
|
1228
|
+
* In update mode, clears existing assignments before re-attaching.
|
|
1229
|
+
*/
|
|
1230
|
+
/**
|
|
1231
|
+
* Create or update a field from a seed.
|
|
1232
|
+
*
|
|
1233
|
+
* A reference field bound to a relation is storage-less: it persists no column
|
|
1234
|
+
* and its edges live in `_emdash_content_references`. Seeds create fields
|
|
1235
|
+
* through the registry (not the schema handler that owns the relation
|
|
1236
|
+
* lifecycle), so this mirrors the handler — it creates the relation on first
|
|
1237
|
+
* insert (field + relation in one transaction) and preserves the
|
|
1238
|
+
* server-assigned `validation.relation`/`targetCollection` on re-apply, since a
|
|
1239
|
+
* seed's field validation omits them and would otherwise orphan the relation. A
|
|
1240
|
+
* reference field with no `targetCollection` cannot form a relation, so it is
|
|
1241
|
+
* created column-backed, holding a plain entry id.
|
|
1242
|
+
*/
|
|
1243
|
+
async function upsertSeedField(db, collectionSlug, field, existing, knownRelations) {
|
|
1244
|
+
const bound = resolveSeedFieldRelation(collectionSlug, field, knownRelations);
|
|
1245
|
+
if (existing) {
|
|
1246
|
+
const update = {
|
|
1247
|
+
label: field.label,
|
|
1248
|
+
type: field.type,
|
|
1249
|
+
required: field.required || false,
|
|
1250
|
+
unique: field.unique || false,
|
|
1251
|
+
searchable: field.searchable || false,
|
|
1252
|
+
indexed: field.indexed || false,
|
|
1253
|
+
translatable: field.translatable,
|
|
1254
|
+
defaultValue: field.defaultValue,
|
|
1255
|
+
widget: field.widget,
|
|
1256
|
+
options: field.options
|
|
1257
|
+
};
|
|
1258
|
+
if (!bound && field.type === "reference" && !existing.validation?.relation && typeof field.validation?.targetCollection === "string") {
|
|
1259
|
+
await bindReferenceField(db, collectionSlug, existing, {
|
|
1260
|
+
...update,
|
|
1261
|
+
validation: field.validation
|
|
1262
|
+
}, field.validation.targetCollection);
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
const validation = bound ? {
|
|
1266
|
+
...field.validation,
|
|
1267
|
+
...bound
|
|
1268
|
+
} : field.type === "reference" && existing.validation?.relation ? {
|
|
1269
|
+
...field.validation,
|
|
1270
|
+
relation: existing.validation.relation,
|
|
1271
|
+
relationSide: existing.validation.relationSide,
|
|
1272
|
+
targetCollection: existing.validation.targetCollection
|
|
1273
|
+
} : field.validation;
|
|
1274
|
+
await new SchemaRegistry(db).updateField(collectionSlug, field.slug, {
|
|
1275
|
+
...update,
|
|
1276
|
+
validation
|
|
1277
|
+
});
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
const input = {
|
|
1281
|
+
slug: field.slug,
|
|
1282
|
+
label: field.label,
|
|
1283
|
+
type: field.type,
|
|
1284
|
+
required: field.required || false,
|
|
1285
|
+
unique: field.unique || false,
|
|
1286
|
+
searchable: field.searchable || false,
|
|
1287
|
+
indexed: field.indexed || false,
|
|
1288
|
+
translatable: field.translatable,
|
|
1289
|
+
defaultValue: field.defaultValue,
|
|
1290
|
+
validation: field.validation,
|
|
1291
|
+
widget: field.widget,
|
|
1292
|
+
options: field.options
|
|
1293
|
+
};
|
|
1294
|
+
if (bound) {
|
|
1295
|
+
await new SchemaRegistry(db).createField(collectionSlug, {
|
|
1296
|
+
...input,
|
|
1297
|
+
validation: {
|
|
1298
|
+
...field.validation,
|
|
1299
|
+
...bound
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1304
|
+
const targetCollection = field.type === "reference" && typeof field.validation?.targetCollection === "string" ? field.validation.targetCollection : void 0;
|
|
1305
|
+
if (targetCollection) {
|
|
1306
|
+
await withTransaction(db, async (trx) => {
|
|
1307
|
+
const relation = await createFieldRelation(trx, collectionSlug, field.slug, field.label, targetCollection, field.validation?.multiple ? null : 1);
|
|
1308
|
+
await new SchemaRegistry(trx).createField(collectionSlug, {
|
|
1309
|
+
...input,
|
|
1310
|
+
validation: {
|
|
1311
|
+
...field.validation,
|
|
1312
|
+
relation: relation.slug,
|
|
1313
|
+
relationSide: "parent"
|
|
1314
|
+
}
|
|
1315
|
+
});
|
|
1316
|
+
});
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
await new SchemaRegistry(db).createField(collectionSlug, input);
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Split resolved content `data` into the plain column data and the reference
|
|
1323
|
+
* edge writes. A reference field bound to a relation is storage-less, so its key
|
|
1324
|
+
* left in `data` would hit the column writer (and `syncDataColumns` on publish)
|
|
1325
|
+
* and throw "no such column". Its `$ref:`-resolved value — a child entry id or
|
|
1326
|
+
* an array of them — is captured as an edge write instead, keyed by the field's
|
|
1327
|
+
* relation. A reference field with no relation still owns its column, so its
|
|
1328
|
+
* resolved id is written there like any other string.
|
|
1329
|
+
*/
|
|
1330
|
+
/** One collection's reference fields by slug, read once per collection: the
|
|
1331
|
+
* schema phase has finished by the time content is applied. */
|
|
1332
|
+
function referenceFieldsOf(collection) {
|
|
1333
|
+
return new Map((collection?.fields ?? []).filter((f) => f.type === "reference").map((f) => [f.slug, f]));
|
|
1334
|
+
}
|
|
1335
|
+
function splitReferenceFields(collectionSlug, referenceFields, data) {
|
|
1336
|
+
if (referenceFields.size === 0) return {
|
|
1337
|
+
columnData: data,
|
|
1338
|
+
edges: []
|
|
1339
|
+
};
|
|
1340
|
+
const columnData = {};
|
|
1341
|
+
const edges = [];
|
|
1342
|
+
for (const [key, value] of Object.entries(data)) {
|
|
1343
|
+
if (!referenceFields.get(key)?.validation?.relation) {
|
|
1344
|
+
columnData[key] = value;
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
const childIds = [];
|
|
1348
|
+
for (const candidate of Array.isArray(value) ? value : [value]) {
|
|
1349
|
+
if (typeof candidate !== "string" || candidate.length === 0) continue;
|
|
1350
|
+
if (candidate.startsWith("$ref:")) {
|
|
1351
|
+
console.warn(`content.${collectionSlug}: reference "${candidate}" in field "${key}" did not resolve (not yet created or missing). Skipping.`);
|
|
1352
|
+
continue;
|
|
1353
|
+
}
|
|
1354
|
+
childIds.push(candidate);
|
|
1355
|
+
}
|
|
1356
|
+
edges.push({
|
|
1357
|
+
fieldSlug: key,
|
|
1358
|
+
childIds
|
|
1359
|
+
});
|
|
1360
|
+
}
|
|
1361
|
+
return {
|
|
1362
|
+
columnData,
|
|
1363
|
+
edges
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Write reference edges for a content entry, replacing any existing set per
|
|
1368
|
+
* relation (so re-applying a seed is idempotent). Throws to abort the enclosing
|
|
1369
|
+
* transaction if a child entry cannot be resolved — a half-written entry is
|
|
1370
|
+
* worse than a failed apply.
|
|
1371
|
+
*/
|
|
1372
|
+
async function applyContentReferences(trx, collectionSlug, contentId, edges) {
|
|
1373
|
+
for (const { fieldSlug, childIds } of edges) {
|
|
1374
|
+
const result = await setReferenceSelection(trx, collectionSlug, contentId, fieldSlug, childIds);
|
|
1375
|
+
if (!result.success) throw new Error(`content.${collectionSlug}: failed to write references for "${contentId}": ${result.error.message}`);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
async function applyContentTaxonomies(db, collectionSlug, contentId, entry, locale, updateGroup, clearedGroups) {
|
|
1379
|
+
const termRepo = new TaxonomyRepository(db);
|
|
1380
|
+
const shouldClear = updateGroup !== void 0 && !clearedGroups.has(updateGroup);
|
|
1381
|
+
if (shouldClear) {
|
|
1382
|
+
await termRepo.clearEntryTerms(collectionSlug, contentId);
|
|
1383
|
+
clearedGroups.add(updateGroup);
|
|
1384
|
+
}
|
|
1385
|
+
if (!entry.taxonomies) {
|
|
1386
|
+
if (shouldClear) {
|
|
1387
|
+
const { invalidateTermCache } = await import("./taxonomies-BMuFLd53.mjs").then((n) => n.f);
|
|
1388
|
+
invalidateTermCache();
|
|
1389
|
+
}
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1392
|
+
for (const [taxonomyName, termSlugs] of Object.entries(entry.taxonomies)) for (const termSlug of termSlugs) {
|
|
1393
|
+
const term = await termRepo.findBySlug(taxonomyName, termSlug, locale);
|
|
1394
|
+
if (!term) {
|
|
1395
|
+
console.warn(`content.${collectionSlug}: taxonomy term "${taxonomyName}/${termSlug}" not found in locale "${locale}". Skipping assignment.`);
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
await termRepo.attachToEntry(collectionSlug, contentId, term.id);
|
|
1399
|
+
}
|
|
1400
|
+
const { invalidateTermCache } = await import("./taxonomies-BMuFLd53.mjs").then((n) => n.f);
|
|
1401
|
+
invalidateTermCache();
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Collect menu item rows recursively.
|
|
1405
|
+
*
|
|
1406
|
+
* When a `SeedMenuItem` carries `id`/`translationOf`, the import resolves the
|
|
1407
|
+
* source item's `translation_group` so cross-locale "same nav entry" links
|
|
1408
|
+
* survive export → apply. Items without `translationOf` get a fresh group
|
|
1409
|
+
* (= their own id).
|
|
1410
|
+
*/
|
|
1411
|
+
function collectMenuItems(rows, menuId, locale, items, parentId, startOrder, seedIdMap, itemSeedIdMap) {
|
|
1412
|
+
let count = 0;
|
|
1413
|
+
let order = startOrder;
|
|
1414
|
+
for (const item of items) {
|
|
1415
|
+
const itemId = ulid();
|
|
1416
|
+
const itemLocale = item.locale ?? locale;
|
|
1417
|
+
let referenceId = null;
|
|
1418
|
+
let referenceCollection = null;
|
|
1419
|
+
if (item.type !== "custom" && item.type !== "taxonomy") {
|
|
1420
|
+
const collection = item.collection || (item.type === "page" || item.type === "post" ? `${item.type}s` : null);
|
|
1421
|
+
if (item.ref) {
|
|
1422
|
+
const resolved = seedIdMap.get(item.ref);
|
|
1423
|
+
if (resolved && collection) {
|
|
1424
|
+
referenceId = resolved;
|
|
1425
|
+
referenceCollection = collection;
|
|
1426
|
+
}
|
|
1427
|
+
} else referenceCollection = collection;
|
|
1428
|
+
}
|
|
1429
|
+
let translationGroup = itemId;
|
|
1430
|
+
if (item.translationOf) {
|
|
1431
|
+
const source = itemSeedIdMap.get(item.translationOf);
|
|
1432
|
+
if (source) translationGroup = source.translationGroup;
|
|
1433
|
+
else console.warn(`menu item "${item.label ?? item.url ?? item.ref ?? "(unlabeled)"}" (${itemLocale}): translationOf "${item.translationOf}" not found yet; minting a fresh group.`);
|
|
1434
|
+
}
|
|
1435
|
+
rows.push({
|
|
1436
|
+
id: itemId,
|
|
1437
|
+
menu_id: menuId,
|
|
1438
|
+
parent_id: parentId,
|
|
1439
|
+
sort_order: order,
|
|
1440
|
+
type: item.type,
|
|
1441
|
+
reference_collection: referenceCollection,
|
|
1442
|
+
reference_id: referenceId,
|
|
1443
|
+
custom_url: item.url ?? null,
|
|
1444
|
+
label: item.label || "",
|
|
1445
|
+
title_attr: item.titleAttr ?? null,
|
|
1446
|
+
target: item.target ?? null,
|
|
1447
|
+
css_classes: item.cssClasses ?? null,
|
|
1448
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1449
|
+
locale: itemLocale,
|
|
1450
|
+
translation_group: translationGroup
|
|
1451
|
+
});
|
|
1452
|
+
if (item.id) itemSeedIdMap.set(item.id, {
|
|
1453
|
+
id: itemId,
|
|
1454
|
+
translationGroup
|
|
1455
|
+
});
|
|
1456
|
+
count++;
|
|
1457
|
+
order++;
|
|
1458
|
+
if (item.children && item.children.length > 0) {
|
|
1459
|
+
const childCount = collectMenuItems(rows, menuId, itemLocale, item.children, itemId, 0, seedIdMap, itemSeedIdMap);
|
|
1460
|
+
count += childCount;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
return count;
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Build a widget row
|
|
1467
|
+
*/
|
|
1468
|
+
function createSeedWidgetRow(areaId, widget, sortOrder) {
|
|
1469
|
+
return {
|
|
1470
|
+
id: ulid(),
|
|
1471
|
+
area_id: areaId,
|
|
1472
|
+
sort_order: sortOrder,
|
|
1473
|
+
type: widget.type,
|
|
1474
|
+
title: widget.title ?? null,
|
|
1475
|
+
content: widget.content ? JSON.stringify(widget.content) : null,
|
|
1476
|
+
menu_name: widget.menuName ?? null,
|
|
1477
|
+
component_id: widget.componentId ?? null,
|
|
1478
|
+
component_props: widget.props ? JSON.stringify(widget.props) : null
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Type guard for $media reference
|
|
1483
|
+
*/
|
|
1484
|
+
function isSeedMediaReference(value) {
|
|
1485
|
+
if (typeof value !== "object" || value === null || !("$media" in value)) return false;
|
|
1486
|
+
const media = value.$media;
|
|
1487
|
+
return typeof media === "object" && media !== null && ("url" in media && typeof media.url === "string" || "file" in media && typeof media.file === "string");
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Resolve $ref: and $media references in content data
|
|
1491
|
+
*/
|
|
1492
|
+
async function resolveReferences(data, seedIdMap, mediaContext, result) {
|
|
1493
|
+
const resolved = {};
|
|
1494
|
+
for (const [key, value] of Object.entries(data)) resolved[key] = await resolveValue(value, seedIdMap, mediaContext, result);
|
|
1495
|
+
return resolved;
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Resolve a single value recursively
|
|
1499
|
+
*/
|
|
1500
|
+
async function resolveValue(value, seedIdMap, mediaContext, result) {
|
|
1501
|
+
if (typeof value === "string" && value.startsWith("$ref:")) {
|
|
1502
|
+
const seedId = value.slice(5);
|
|
1503
|
+
return seedIdMap.get(seedId) ?? value;
|
|
1504
|
+
}
|
|
1505
|
+
if (isSeedMediaReference(value)) return resolveMedia(value, mediaContext, result);
|
|
1506
|
+
if (Array.isArray(value)) return Promise.all(value.map((item) => resolveValue(item, seedIdMap, mediaContext, result)));
|
|
1507
|
+
if (typeof value === "object" && value !== null) {
|
|
1508
|
+
const resolved = {};
|
|
1509
|
+
for (const [k, v] of Object.entries(value)) resolved[k] = await resolveValue(v, seedIdMap, mediaContext, result);
|
|
1510
|
+
if (resolved._type === "gallery" && Array.isArray(resolved.images)) resolved.images = sanitizeGalleryImages(resolved.images, ulid);
|
|
1511
|
+
else if (resolved._type === "image" && "asset" in value && isSeedMediaReference(value.asset)) {
|
|
1512
|
+
const [image] = sanitizeGalleryImages([resolved], ulid);
|
|
1513
|
+
if (image) Object.assign(resolved, image);
|
|
1514
|
+
}
|
|
1515
|
+
return resolved;
|
|
1516
|
+
}
|
|
1517
|
+
return value;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Resolve a seeded byline avatar to a `media` row id. The file is assumed to
|
|
1521
|
+
* already exist in storage (the caller supplies its `storageKey`), so nothing
|
|
1522
|
+
* is downloaded or uploaded.
|
|
1523
|
+
*
|
|
1524
|
+
* Idempotent: if a media row with the same `storageKey` already exists it is
|
|
1525
|
+
* reused rather than duplicated, so re-applying a seed in `update` mode does
|
|
1526
|
+
* not leak rows. `created` reports whether a new row was inserted, so the
|
|
1527
|
+
* caller can both account for it and delete it if the subsequent byline write
|
|
1528
|
+
* fails (the only cross-dialect way to avoid an orphan — `withTransaction`
|
|
1529
|
+
* is a no-op on D1).
|
|
1530
|
+
*/
|
|
1531
|
+
async function resolveSeedBylineAvatar(db, avatar) {
|
|
1532
|
+
const existing = await db.selectFrom("media").select("id").where("storage_key", "=", avatar.storageKey).orderBy("id", "asc").executeTakeFirst();
|
|
1533
|
+
if (existing) return {
|
|
1534
|
+
id: existing.id,
|
|
1535
|
+
created: false
|
|
1536
|
+
};
|
|
1537
|
+
const basename = avatar.storageKey.split("/").pop();
|
|
1538
|
+
const filename = avatar.filename ?? (basename && basename.length > 0 ? basename : avatar.storageKey);
|
|
1539
|
+
return {
|
|
1540
|
+
id: (await new MediaRepository(db).create({
|
|
1541
|
+
filename,
|
|
1542
|
+
mimeType: avatar.mimeType ?? "image/jpeg",
|
|
1543
|
+
storageKey: avatar.storageKey,
|
|
1544
|
+
alt: avatar.alt,
|
|
1545
|
+
width: avatar.width,
|
|
1546
|
+
height: avatar.height,
|
|
1547
|
+
status: "ready"
|
|
1548
|
+
})).id,
|
|
1549
|
+
created: true
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Delete a media row by id. Best-effort cleanup for a failed byline write: a
|
|
1554
|
+
* failure here must not mask the original error that triggered the cleanup, so
|
|
1555
|
+
* it is logged and swallowed rather than thrown.
|
|
1556
|
+
*/
|
|
1557
|
+
async function deleteMediaRow(db, id) {
|
|
1558
|
+
try {
|
|
1559
|
+
await db.deleteFrom("media").where("id", "=", id).execute();
|
|
1560
|
+
} catch (error) {
|
|
1561
|
+
console.warn(`[seed] failed to clean up orphaned avatar media ${id}:`, error);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Resolve a $media reference by reading or downloading and uploading the media
|
|
1566
|
+
*/
|
|
1567
|
+
async function resolveMedia(ref, ctx, result) {
|
|
1568
|
+
const { alt, filename, caption, libraryCaption } = ref.$media;
|
|
1569
|
+
const url = ref.$media.url ?? void 0;
|
|
1570
|
+
const file = ref.$media.file ?? void 0;
|
|
1571
|
+
const source = file ?? url;
|
|
1572
|
+
const cacheKey = file === void 0 ? `url:${url}` : `file:${file}`;
|
|
1573
|
+
if (file !== void 0 && url !== void 0 || !source) {
|
|
1574
|
+
console.warn(" ⚠️ $media requires exactly one non-empty url or file");
|
|
1575
|
+
result.media.skipped++;
|
|
1576
|
+
return null;
|
|
1577
|
+
}
|
|
1578
|
+
const cached = ctx.mediaCache.get(cacheKey);
|
|
1579
|
+
if (cached) {
|
|
1580
|
+
result.media.skipped++;
|
|
1581
|
+
return {
|
|
1582
|
+
...cached,
|
|
1583
|
+
alt: alt ?? cached.alt,
|
|
1584
|
+
caption: caption ?? cached.caption
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
if (ctx.skipMediaDownload) {
|
|
1588
|
+
if (file !== void 0) {
|
|
1589
|
+
console.warn(`Skipping local $media file (skipMediaDownload is enabled): ${file}`);
|
|
1590
|
+
result.media.skipped++;
|
|
1591
|
+
return null;
|
|
1592
|
+
}
|
|
1593
|
+
const defaultCaption = libraryCaption ?? void 0;
|
|
1594
|
+
const mediaValue = {
|
|
1595
|
+
provider: "external",
|
|
1596
|
+
id: ulid(),
|
|
1597
|
+
src: source,
|
|
1598
|
+
alt: alt ?? void 0,
|
|
1599
|
+
caption: caption ?? defaultCaption,
|
|
1600
|
+
filename: filename ?? void 0
|
|
1601
|
+
};
|
|
1602
|
+
ctx.mediaCache.set(cacheKey, {
|
|
1603
|
+
...mediaValue,
|
|
1604
|
+
caption: defaultCaption
|
|
1605
|
+
});
|
|
1606
|
+
result.media.skipped++;
|
|
1607
|
+
return mediaValue;
|
|
1608
|
+
}
|
|
1609
|
+
if (!ctx.storage) {
|
|
1610
|
+
console.warn(`Skipping $media reference (no storage configured): ${source}`);
|
|
1611
|
+
result.media.skipped++;
|
|
1612
|
+
return null;
|
|
1613
|
+
}
|
|
1614
|
+
try {
|
|
1615
|
+
let body;
|
|
1616
|
+
let contentType;
|
|
1617
|
+
let ext;
|
|
1618
|
+
let sourceFilename;
|
|
1619
|
+
if (file !== void 0) {
|
|
1620
|
+
if (!ctx.mediaBasePath) throw new Error("$media.file requires mediaBasePath");
|
|
1621
|
+
const { readFile, realpath } = await import("node:fs/promises");
|
|
1622
|
+
const { basename, extname, isAbsolute, relative, resolve, sep } = await import("node:path");
|
|
1623
|
+
const base = await realpath(ctx.mediaBasePath);
|
|
1624
|
+
const withinBase = (target) => {
|
|
1625
|
+
const path = relative(base, target);
|
|
1626
|
+
return path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path);
|
|
1627
|
+
};
|
|
1628
|
+
const target = resolve(base, file);
|
|
1629
|
+
if (isAbsolute(file) || !withinBase(target)) throw new Error("$media.file must be relative to and remain within mediaBasePath");
|
|
1630
|
+
const realTarget = await realpath(target);
|
|
1631
|
+
if (!withinBase(realTarget)) throw new Error("$media.file must remain within mediaBasePath after resolving symlinks");
|
|
1632
|
+
ctx.budget?.countMediaDownload();
|
|
1633
|
+
body = new Uint8Array(await readFile(realTarget));
|
|
1634
|
+
contentType = mime.getType(file) || "application/octet-stream";
|
|
1635
|
+
ext = getExtensionFromContentType(contentType) || extname(file) || ".bin";
|
|
1636
|
+
sourceFilename = basename(file);
|
|
1637
|
+
} else {
|
|
1638
|
+
validateExternalUrl(source);
|
|
1639
|
+
console.log(` 📥 Downloading: ${url}`);
|
|
1640
|
+
ctx.budget?.countMediaDownload();
|
|
1641
|
+
const response = await ssrfSafeFetch(source, { headers: { "User-Agent": "EmDash-CMS/1.0" } });
|
|
1642
|
+
if (!response.ok) {
|
|
1643
|
+
console.warn(` ⚠️ Failed to download ${url}: ${response.status}`);
|
|
1644
|
+
result.media.skipped++;
|
|
1645
|
+
return null;
|
|
1646
|
+
}
|
|
1647
|
+
contentType = response.headers.get("content-type") || "application/octet-stream";
|
|
1648
|
+
ext = getExtensionFromContentType(contentType) || getExtensionFromUrl(source) || ".bin";
|
|
1649
|
+
body = new Uint8Array(await response.arrayBuffer());
|
|
1650
|
+
sourceFilename = generateFilename(source, ext);
|
|
1651
|
+
}
|
|
1652
|
+
const contentHash = await computeContentHash(body);
|
|
1653
|
+
const mediaRepo = new MediaRepository(ctx.db);
|
|
1654
|
+
const existing = await mediaRepo.findByContentHash(contentHash);
|
|
1655
|
+
if (existing) {
|
|
1656
|
+
const mediaValue = {
|
|
1657
|
+
provider: "local",
|
|
1658
|
+
id: existing.id,
|
|
1659
|
+
alt: alt ?? existing.alt ?? void 0,
|
|
1660
|
+
caption: caption ?? existing.caption ?? void 0,
|
|
1661
|
+
width: existing.width ?? void 0,
|
|
1662
|
+
height: existing.height ?? void 0,
|
|
1663
|
+
mimeType: existing.mimeType,
|
|
1664
|
+
filename: existing.filename,
|
|
1665
|
+
meta: { storageKey: existing.storageKey }
|
|
1666
|
+
};
|
|
1667
|
+
ctx.mediaCache.set(cacheKey, {
|
|
1668
|
+
...mediaValue,
|
|
1669
|
+
caption: existing.caption ?? void 0
|
|
1670
|
+
});
|
|
1671
|
+
result.media.skipped++;
|
|
1672
|
+
console.log(` ✅ Reused: ${existing.filename}`);
|
|
1673
|
+
return mediaValue;
|
|
1674
|
+
}
|
|
1675
|
+
const storageId = ulid();
|
|
1676
|
+
const finalFilename = filename || sourceFilename;
|
|
1677
|
+
const storageKey = `${storageId}${ext}`;
|
|
1678
|
+
let width;
|
|
1679
|
+
let height;
|
|
1680
|
+
if (contentType.startsWith("image/")) {
|
|
1681
|
+
const dimensions = getImageDimensions(body);
|
|
1682
|
+
width = dimensions?.width;
|
|
1683
|
+
height = dimensions?.height;
|
|
1684
|
+
}
|
|
1685
|
+
await ctx.storage.upload({
|
|
1686
|
+
key: storageKey,
|
|
1687
|
+
body,
|
|
1688
|
+
contentType
|
|
1689
|
+
});
|
|
1690
|
+
const media = await mediaRepo.create({
|
|
1691
|
+
filename: finalFilename,
|
|
1692
|
+
mimeType: contentType,
|
|
1693
|
+
size: body.length,
|
|
1694
|
+
width,
|
|
1695
|
+
height,
|
|
1696
|
+
alt,
|
|
1697
|
+
caption: (libraryCaption === void 0 ? caption : libraryCaption) ?? void 0,
|
|
1698
|
+
storageKey,
|
|
1699
|
+
contentHash,
|
|
1700
|
+
status: "ready"
|
|
1701
|
+
});
|
|
1702
|
+
const mediaValue = {
|
|
1703
|
+
provider: "local",
|
|
1704
|
+
id: media.id,
|
|
1705
|
+
alt: alt ?? void 0,
|
|
1706
|
+
caption: caption ?? media.caption ?? void 0,
|
|
1707
|
+
width,
|
|
1708
|
+
height,
|
|
1709
|
+
mimeType: contentType,
|
|
1710
|
+
filename: finalFilename,
|
|
1711
|
+
meta: { storageKey }
|
|
1712
|
+
};
|
|
1713
|
+
ctx.mediaCache.set(cacheKey, {
|
|
1714
|
+
...mediaValue,
|
|
1715
|
+
caption: media.caption ?? void 0
|
|
1716
|
+
});
|
|
1717
|
+
result.media.created++;
|
|
1718
|
+
console.log(` ✅ Uploaded: ${finalFilename}`);
|
|
1719
|
+
return mediaValue;
|
|
1720
|
+
} catch (error) {
|
|
1721
|
+
console.warn(` ⚠️ Error processing $media ${source}:`, error instanceof Error ? error.message : error);
|
|
1722
|
+
result.media.skipped++;
|
|
1723
|
+
return null;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Get file extension from content type
|
|
1728
|
+
*/
|
|
1729
|
+
function getExtensionFromContentType(contentType) {
|
|
1730
|
+
const baseMime = contentType.split(";")[0].trim();
|
|
1731
|
+
const ext = mime.getExtension(baseMime);
|
|
1732
|
+
return ext ? `.${ext}` : null;
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Get file extension from URL
|
|
1736
|
+
*/
|
|
1737
|
+
function getExtensionFromUrl(url) {
|
|
1738
|
+
try {
|
|
1739
|
+
const match = new URL(url).pathname.match(FILE_EXTENSION_PATTERN);
|
|
1740
|
+
return match ? `.${match[1]}` : null;
|
|
1741
|
+
} catch {
|
|
1742
|
+
return null;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Generate a filename from URL
|
|
1747
|
+
*/
|
|
1748
|
+
function generateFilename(url, ext) {
|
|
1749
|
+
try {
|
|
1750
|
+
return `${(new URL(url).pathname.split("/").pop() || "media").replace(EXTENSION_PATTERN, "").replace(QUERY_PARAM_PATTERN, "").replace(SANITIZE_PATTERN, "-").replace(MULTIPLE_HYPHENS_PATTERN, "-") || "media"}${ext}`;
|
|
1751
|
+
} catch {
|
|
1752
|
+
return `media${ext}`;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* Get image dimensions from buffer using image-size.
|
|
1757
|
+
* Supports PNG, JPEG, GIF, WebP, AVIF, SVG, TIFF, and more.
|
|
1758
|
+
*/
|
|
1759
|
+
function getImageDimensions(buffer) {
|
|
1760
|
+
try {
|
|
1761
|
+
const result = imageSize(buffer);
|
|
1762
|
+
if (result.width != null && result.height != null) return {
|
|
1763
|
+
width: result.width,
|
|
1764
|
+
height: result.height
|
|
1765
|
+
};
|
|
1766
|
+
return null;
|
|
1767
|
+
} catch {
|
|
1768
|
+
return null;
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
//#endregion
|
|
1773
|
+
export { sanitizeGalleryImages as a, resolveImageMedia as i, applySeedWithinBudget as n, apply_exports as r, applySeed as t };
|
|
1774
|
+
//# sourceMappingURL=apply-Culv7QJl.mjs.map
|