emdash 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-token-DYwe4Pk0.mjs +26 -0
- package/dist/action-token-DYwe4Pk0.mjs.map +1 -0
- package/dist/activation-LOkDM5WT.mjs +382 -0
- package/dist/activation-LOkDM5WT.mjs.map +1 -0
- package/dist/adapters-B64LbYcB.d.mts +171 -0
- package/dist/adapters-B64LbYcB.d.mts.map +1 -0
- package/dist/allowed-origins-CHB8oZNM.mjs +116 -0
- package/dist/allowed-origins-CHB8oZNM.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -4
- package/dist/api/route-utils.mjs +49 -40
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +11 -7
- package/dist/api-cFFZpyS0.mjs +4718 -0
- package/dist/api-cFFZpyS0.mjs.map +1 -0
- package/dist/api-tokens-CE1ECIg0.mjs +3 -0
- package/dist/api-tokens-s4i4aUp_.mjs +166 -0
- package/dist/api-tokens-s4i4aUp_.mjs.map +1 -0
- package/dist/apply-CoT603H3.mjs +1163 -0
- package/dist/apply-CoT603H3.mjs.map +1 -0
- package/dist/approvals-CqMfNxak.mjs +460 -0
- package/dist/approvals-CqMfNxak.mjs.map +1 -0
- package/dist/artifact-fetch-DZMOGZ3-.mjs +818 -0
- package/dist/artifact-fetch-DZMOGZ3-.mjs.map +1 -0
- package/dist/astro/index.d.mts +14 -14
- package/dist/astro/index.mjs +62 -12
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +14 -12
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +26 -11
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts +9 -1
- package/dist/astro/middleware/media-usage-write-fence.d.mts.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +95 -13
- package/dist/astro/middleware/media-usage-write-fence.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +8 -8
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +145 -47
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +12 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +129 -122
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +14 -8
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +14 -8
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -3
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +17 -11
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +17 -11
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +17 -11
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +25 -19
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +19 -13
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -5
- package/dist/astro/routes/api/admin/comments/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -12
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +7 -5
- package/dist/astro/routes/api/admin/comments/counts.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/index.mjs +18 -12
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +21 -15
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +26 -15
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +32 -19
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +23 -17
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +10 -8
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +10 -8
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +72 -61
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -4
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +74 -63
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +84 -73
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +72 -61
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +83 -72
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +74 -63
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +85 -74
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +8 -6
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +76 -65
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +221 -0
- package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +72 -61
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +71 -60
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +6 -4
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +71 -60
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +4 -2
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +71 -60
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/transfer/_...path_.d.mts +12 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs +144 -0
- package/dist/astro/routes/api/admin/transfer/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +68 -0
- package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +69 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +69 -0
- package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs +91 -0
- package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +78 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +77 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +77 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +70 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +67 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts +8 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +66 -0
- package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.d.mts +9 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs +99 -0
- package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -0
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +14 -8
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +16 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +14 -8
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -3
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +19 -13
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +24 -12
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +18 -12
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -2
- package/dist/astro/routes/api/auth/logout.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.mjs +29 -15
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts +2 -1
- package/dist/astro/routes/api/auth/magic-link/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +37 -17
- package/dist/astro/routes/api/auth/magic-link/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +15 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -2
- package/dist/astro/routes/api/auth/mode.mjs.map +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +14 -8
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +21 -24
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +18 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +19 -13
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +19 -13
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +19 -13
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +18 -12
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -11
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +21 -15
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +10 -8
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +68 -16
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +31 -22
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +31 -22
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -3
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +38 -19
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +18 -13
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -2
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +15 -10
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +15 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +11 -9
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -2
- package/dist/astro/routes/api/dev/emails.mjs.map +1 -1
- package/dist/astro/routes/api/health.mjs +5 -3
- package/dist/astro/routes/api/health.mjs.map +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +27 -21
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -3
- package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress/execute.mjs +18 -16
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -12
- package/dist/astro/routes/api/import/wordpress/media.mjs +19 -13
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +18 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +5 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +4 -2
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +29 -15
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +27 -21
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -13
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +38 -32
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +6 -4
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +717 -67
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +19 -13
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/replace.mjs +16 -10
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +8 -6
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/usage.mjs +34 -21
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +37 -26
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +5 -3
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +31 -2
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/_id_.mjs +16 -10
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/index.mjs +16 -10
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/index.mjs +4 -2
- package/dist/astro/routes/api/media/providers/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/upload-url.mjs +18 -12
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +36 -24
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +18 -12
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +18 -12
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.d.mts.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +9 -6
- package/dist/astro/routes/api/oauth/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -5
- package/dist/astro/routes/api/oauth/device/authorize.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -8
- package/dist/astro/routes/api/oauth/device/code.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -7
- package/dist/astro/routes/api/oauth/device/token.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/register.mjs +4 -2
- package/dist/astro/routes/api/oauth/register.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -5
- package/dist/astro/routes/api/oauth/token/refresh.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/token.mjs +7 -5
- package/dist/astro/routes/api/oauth/token.mjs.map +1 -1
- package/dist/astro/routes/api/openapi.json.mjs +497 -12
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +10 -8
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +21 -15
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +21 -15
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +21 -15
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +21 -15
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +31 -22
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +21 -16
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +31 -22
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -2
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs.map +1 -1
- package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +102 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts +8 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +96 -0
- package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -0
- package/dist/astro/routes/api/schema/block-types/index.d.mts +9 -0
- package/dist/astro/routes/api/schema/block-types/index.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs +102 -0
- package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -0
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +71 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +71 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +71 -60
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +71 -60
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +71 -60
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +71 -60
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +17 -14
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +71 -60
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +71 -60
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +20 -14
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +19 -13
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +20 -14
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +10 -8
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +19 -13
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +19 -13
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +19 -13
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -7
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -6
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/export.mjs +8 -7
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/index.mjs +9 -8
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +6 -4
- package/dist/astro/routes/api/settings/email.mjs.map +1 -1
- package/dist/astro/routes/api/settings.mjs +25 -19
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +20 -14
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +19 -13
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +43 -37
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -2
- package/dist/astro/routes/api/setup/dev-reset.mjs.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +48 -38
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -3
- package/dist/astro/routes/api/setup/status.mjs.map +1 -1
- package/dist/astro/routes/api/snapshot.mjs +10 -8
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +24 -18
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +295 -0
- package/dist/astro/routes/api/taxonomies/bulk-tag.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/index.mjs +25 -19
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +7 -5
- package/dist/astro/routes/api/themes/preview.mjs.map +1 -1
- package/dist/astro/routes/api/typegen.d.mts.map +1 -1
- package/dist/astro/routes/api/typegen.mjs +12 -9
- package/dist/astro/routes/api/typegen.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/action-token.mjs +7 -5
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +22 -16
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +3 -1
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -1
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +16 -10
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +20 -14
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +20 -14
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +10 -8
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +20 -14
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -2
- package/dist/astro/routes/api/widget-components.mjs.map +1 -1
- package/dist/astro/routes/robots.txt.mjs +10 -10
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -13
- package/dist/astro/routes/sitemap.xml.mjs +11 -11
- package/dist/astro/types.d.mts +21 -17
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/audit-RfCugiSB.mjs +127 -0
- package/dist/audit-RfCugiSB.mjs.map +1 -0
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/authoritative-records-CoJvBXAD.mjs +5172 -0
- package/dist/authoritative-records-CoJvBXAD.mjs.map +1 -0
- package/dist/authorize-seCifOMJ.mjs +49 -0
- package/dist/authorize-seCifOMJ.mjs.map +1 -0
- package/dist/backup-CBu0LrXf.mjs +246 -0
- package/dist/backup-CBu0LrXf.mjs.map +1 -0
- package/dist/block-type-registry-DUI_3KxT.mjs +6709 -0
- package/dist/block-type-registry-DUI_3KxT.mjs.map +1 -0
- package/dist/block-types-BmZmLmAD.mjs +132 -0
- package/dist/block-types-BmZmLmAD.mjs.map +1 -0
- package/dist/block-values-C_VIPr5t.mjs +175 -0
- package/dist/block-values-C_VIPr5t.mjs.map +1 -0
- package/dist/byline-DYmkXqvo.mjs +909 -0
- package/dist/byline-DYmkXqvo.mjs.map +1 -0
- package/dist/byline-fields-D28AT-Fh.mjs +123 -0
- package/dist/byline-fields-D28AT-Fh.mjs.map +1 -0
- package/dist/byline-registry-gnKscbQX.mjs +406 -0
- package/dist/byline-registry-gnKscbQX.mjs.map +1 -0
- package/dist/bylines-BPwJqoYH.mjs +232 -0
- package/dist/bylines-BPwJqoYH.mjs.map +1 -0
- package/dist/bylines-ukLaYpVZ.mjs +214 -0
- package/dist/bylines-ukLaYpVZ.mjs.map +1 -0
- package/dist/cache-m7UEkRFV.mjs +108 -0
- package/dist/cache-m7UEkRFV.mjs.map +1 -0
- package/dist/canonical-YhEQezjg.mjs +174 -0
- package/dist/canonical-YhEQezjg.mjs.map +1 -0
- package/dist/capture-triggers-kJyl_yyM.mjs +362 -0
- package/dist/capture-triggers-kJyl_yyM.mjs.map +1 -0
- package/dist/challenge-store-ppU6Uv13.mjs +51 -0
- package/dist/challenge-store-ppU6Uv13.mjs.map +1 -0
- package/dist/checksum-B2IINIlN.mjs +162 -0
- package/dist/checksum-B2IINIlN.mjs.map +1 -0
- package/dist/chrome-tags-DApCQSIk.mjs +24 -0
- package/dist/chrome-tags-DApCQSIk.mjs.map +1 -0
- package/dist/chunks-Dms7Uxbt.mjs +25 -0
- package/dist/chunks-Dms7Uxbt.mjs.map +1 -0
- package/dist/cli/index.mjs +1471 -56
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1050 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +193 -11
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-BIm28mo3.mjs +436 -0
- package/dist/collection-deletion-BIm28mo3.mjs.map +1 -0
- package/dist/collection-deletion-processor-Br6rxs3u.mjs +217 -0
- package/dist/collection-deletion-processor-Br6rxs3u.mjs.map +1 -0
- package/dist/collection-slugs-cache-CjGk__zp.mjs +85 -0
- package/dist/collection-slugs-cache-CjGk__zp.mjs.map +1 -0
- package/dist/comment-CrBl22OF.mjs +313 -0
- package/dist/comment-CrBl22OF.mjs.map +1 -0
- package/dist/comment-reaction-JEQ2Fpd8.mjs +85 -0
- package/dist/comment-reaction-JEQ2Fpd8.mjs.map +1 -0
- package/dist/comments-2ah9du9y.mjs +195 -0
- package/dist/comments-2ah9du9y.mjs.map +1 -0
- package/dist/comments-fHZ8ON9O.mjs +99 -0
- package/dist/comments-fHZ8ON9O.mjs.map +1 -0
- package/dist/components-CXbq7CSM.mjs +108 -0
- package/dist/components-CXbq7CSM.mjs.map +1 -0
- package/dist/config-5ii2haYu.d.mts +6528 -0
- package/dist/config-5ii2haYu.d.mts.map +1 -0
- package/dist/config-CvmjJcVw.mjs +73 -0
- package/dist/config-CvmjJcVw.mjs.map +1 -0
- package/dist/config-IhybvkIQ.mjs +242 -0
- package/dist/config-IhybvkIQ.mjs.map +1 -0
- package/dist/config-Py43JK9r.d.mts +39 -0
- package/dist/config-Py43JK9r.d.mts.map +1 -0
- package/dist/content-DFaIEDj9.mjs +2281 -0
- package/dist/content-DFaIEDj9.mjs.map +1 -0
- package/dist/content-list-query-Dra4Dalc.d.mts +26 -0
- package/dist/content-list-query-Dra4Dalc.d.mts.map +1 -0
- package/dist/content-policy-DFNw91-d.mjs +46 -0
- package/dist/content-policy-DFNw91-d.mjs.map +1 -0
- package/dist/content-repair-Q8IUrpLL.mjs +442 -0
- package/dist/content-repair-Q8IUrpLL.mjs.map +1 -0
- package/dist/context-BeGccdUX.mjs +1921 -0
- package/dist/context-BeGccdUX.mjs.map +1 -0
- package/dist/cron-7DCJwPXq.mjs +284 -0
- package/dist/cron-7DCJwPXq.mjs.map +1 -0
- package/dist/dashboard-DjrB-xxZ.mjs +151 -0
- package/dist/dashboard-DjrB-xxZ.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +3 -3
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +6 -6
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +6 -6
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +6 -6
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +2 -2
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/default-DQ6vsviu.mjs +81 -0
- package/dist/default-DQ6vsviu.mjs.map +1 -0
- package/dist/deferred-tasks-BPxXUB4x.d.mts +9 -0
- package/dist/deferred-tasks-BPxXUB4x.d.mts.map +1 -0
- package/dist/device-flow-CRd6DXmW.mjs +466 -0
- package/dist/device-flow-CRd6DXmW.mjs.map +1 -0
- package/dist/dialect-helpers-7_IqPdh9.mjs +307 -0
- package/dist/dialect-helpers-7_IqPdh9.mjs.map +1 -0
- package/dist/digest-BarSh-pN.mjs +194 -0
- package/dist/digest-BarSh-pN.mjs.map +1 -0
- package/dist/direct-executor-BmuFJJZV.mjs +104 -0
- package/dist/direct-executor-BmuFJJZV.mjs.map +1 -0
- package/dist/dist-BNwANFJR.mjs +810 -0
- package/dist/dist-BNwANFJR.mjs.map +1 -0
- package/dist/email-console-bJn3ctqA.mjs +50 -0
- package/dist/email-console-bJn3ctqA.mjs.map +1 -0
- package/dist/email-locale-CN6WAMx0.mjs +25 -0
- package/dist/email-locale-CN6WAMx0.mjs.map +1 -0
- package/dist/emdash-runtime-DAjghyEG.mjs +4186 -0
- package/dist/emdash-runtime-DAjghyEG.mjs.map +1 -0
- package/dist/enrich-Dl3kZ-lP.mjs +194 -0
- package/dist/enrich-Dl3kZ-lP.mjs.map +1 -0
- package/dist/entry-lock-BJYdBfXb.mjs +1097 -0
- package/dist/entry-lock-BJYdBfXb.mjs.map +1 -0
- package/dist/entry-lock-DHQOxN7R.mjs +163 -0
- package/dist/entry-lock-DHQOxN7R.mjs.map +1 -0
- package/dist/entry-lock-DVhCt49A.d.mts +4368 -0
- package/dist/entry-lock-DVhCt49A.d.mts.map +1 -0
- package/dist/entry-locks-D0foLdjQ.mjs +167 -0
- package/dist/entry-locks-D0foLdjQ.mjs.map +1 -0
- package/dist/error-CfvOHP0M.mjs +90 -0
- package/dist/error-CfvOHP0M.mjs.map +1 -0
- package/dist/errors-BF0_LFhW.mjs +460 -0
- package/dist/errors-BF0_LFhW.mjs.map +1 -0
- package/dist/errors-DgE1zJGG.mjs +120 -0
- package/dist/errors-DgE1zJGG.mjs.map +1 -0
- package/dist/escape-CuaZhZvL.mjs +9 -0
- package/dist/escape-CuaZhZvL.mjs.map +1 -0
- package/dist/fence-CMDXJYc_.mjs +162 -0
- package/dist/fence-CMDXJYc_.mjs.map +1 -0
- package/dist/field-defs-cache-HIgBbqZZ.mjs +77 -0
- package/dist/field-defs-cache-HIgBbqZZ.mjs.map +1 -0
- package/dist/fts-manager-S-K0laoS.mjs +443 -0
- package/dist/fts-manager-S-K0laoS.mjs.map +1 -0
- package/dist/gc-DjKY0Ay1.mjs +75 -0
- package/dist/gc-DjKY0Ay1.mjs.map +1 -0
- package/dist/hash-SDAW6zC-.mjs +37 -0
- package/dist/hash-SDAW6zC-.mjs.map +1 -0
- package/dist/hook-result-B5bXDgS2.d.mts +31 -0
- package/dist/hook-result-B5bXDgS2.d.mts.map +1 -0
- package/dist/hreflang-D5uNnsGJ.d.mts +50 -0
- package/dist/hreflang-D5uNnsGJ.d.mts.map +1 -0
- package/dist/hreflang-DMFBL2eb.mjs +105 -0
- package/dist/hreflang-DMFBL2eb.mjs.map +1 -0
- package/dist/http-route-dispatch-BitqzwMy.mjs +339 -0
- package/dist/http-route-dispatch-BitqzwMy.mjs.map +1 -0
- package/dist/identity-IyNWwXr6.mjs +35 -0
- package/dist/identity-IyNWwXr6.mjs.map +1 -0
- package/dist/import-C3JZplWq.mjs +2020 -0
- package/dist/import-C3JZplWq.mjs.map +1 -0
- package/dist/index-D-hdtLe8.d.mts +623 -0
- package/dist/index-D-hdtLe8.d.mts.map +1 -0
- package/dist/index.d.mts +24 -24
- package/dist/index.mjs +105 -93
- package/dist/install-finalization-DfM1fj5x.mjs +58 -0
- package/dist/install-finalization-DfM1fj5x.mjs.map +1 -0
- package/dist/keys-yxLm5l35.mjs +61 -0
- package/dist/keys-yxLm5l35.mjs.map +1 -0
- package/dist/kinds-CRu_T5T5.mjs +961 -0
- package/dist/kinds-CRu_T5T5.mjs.map +1 -0
- package/dist/lifecycle-BzeGPeQ-.mjs +25 -0
- package/dist/lifecycle-BzeGPeQ-.mjs.map +1 -0
- package/dist/load-XgJiE6_3.mjs +28 -0
- package/dist/load-XgJiE6_3.mjs.map +1 -0
- package/dist/loader-BzqeR1ZN.mjs +1086 -0
- package/dist/loader-BzqeR1ZN.mjs.map +1 -0
- package/dist/loops-BQSzv5Zn.mjs +203 -0
- package/dist/loops-BQSzv5Zn.mjs.map +1 -0
- package/dist/manifest-builder-B8zR-73J.mjs +189 -0
- package/dist/manifest-builder-B8zR-73J.mjs.map +1 -0
- package/dist/manifest-schema-CY3zng_M.mjs +492 -0
- package/dist/manifest-schema-CY3zng_M.mjs.map +1 -0
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +3 -3
- package/dist/media/local-runtime.d.mts +14 -14
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +15 -16
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-Pu1L6xir.mjs +408 -0
- package/dist/media-Pu1L6xir.mjs.map +1 -0
- package/dist/media-Qp5S3eH3.mjs +355 -0
- package/dist/media-Qp5S3eH3.mjs.map +1 -0
- package/dist/media-allowlist-BSoa9Vvm.mjs +44 -0
- package/dist/media-allowlist-BSoa9Vvm.mjs.map +1 -0
- package/dist/media-folders-BE0oo2eX.mjs +210 -0
- package/dist/media-folders-BE0oo2eX.mjs.map +1 -0
- package/dist/media-h7tOiDLj.mjs +221 -0
- package/dist/media-h7tOiDLj.mjs.map +1 -0
- package/dist/media-url-jArBpzIG.mjs +43 -0
- package/dist/media-url-jArBpzIG.mjs.map +1 -0
- package/dist/media-usage-My-Vi-ex.mjs +1629 -0
- package/dist/media-usage-My-Vi-ex.mjs.map +1 -0
- package/dist/media-usage-activation-HKp7zk7W.mjs +78 -0
- package/dist/media-usage-activation-HKp7zk7W.mjs.map +1 -0
- package/dist/media-usage-work-C2OZLCAd.mjs +586 -0
- package/dist/media-usage-work-C2OZLCAd.mjs.map +1 -0
- package/dist/media-usage-work-DwUNbgvS.mjs +152 -0
- package/dist/media-usage-work-DwUNbgvS.mjs.map +1 -0
- package/dist/menus-BM7BPLOb.mjs +139 -0
- package/dist/menus-BM7BPLOb.mjs.map +1 -0
- package/dist/menus-ITeAbcIF.mjs +753 -0
- package/dist/menus-ITeAbcIF.mjs.map +1 -0
- package/dist/menus-TsSGmSR4.mjs +3608 -0
- package/dist/menus-TsSGmSR4.mjs.map +1 -0
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +5 -5
- package/dist/mime-ChLqYwDk.mjs +36 -0
- package/dist/mime-ChLqYwDk.mjs.map +1 -0
- package/dist/mode-CCuKXUci.mjs +23 -0
- package/dist/mode-CCuKXUci.mjs.map +1 -0
- package/dist/node-sqlite-compat-CONMsl-x.mjs +46 -0
- package/dist/node-sqlite-compat-CONMsl-x.mjs.map +1 -0
- package/dist/normalize-CO2P8-iE.mjs +191 -0
- package/dist/normalize-CO2P8-iE.mjs.map +1 -0
- package/dist/oauth-authorization-DlMIL5_h.mjs +274 -0
- package/dist/oauth-authorization-DlMIL5_h.mjs.map +1 -0
- package/dist/oauth-clients-Djq9r_KP.mjs +266 -0
- package/dist/oauth-clients-Djq9r_KP.mjs.map +1 -0
- package/dist/oauth-state-store-BbjnZXNC.mjs +50 -0
- package/dist/oauth-state-store-BbjnZXNC.mjs.map +1 -0
- package/dist/oauth-user-lookup-vue9a64A.mjs +26 -0
- package/dist/oauth-user-lookup-vue9a64A.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/object-cache-CqWNY5uP.mjs +582 -0
- package/dist/object-cache-CqWNY5uP.mjs.map +1 -0
- package/dist/options-DhrI7eMv.mjs +208 -0
- package/dist/options-DhrI7eMv.mjs.map +1 -0
- package/dist/options-SQCHQCPH.d.mts +81 -0
- package/dist/options-SQCHQCPH.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.mjs +9 -9
- package/dist/parse-CVgO-Qai.d.mts +168 -0
- package/dist/parse-CVgO-Qai.d.mts.map +1 -0
- package/dist/parse-DY6OD1j_.mjs +81 -0
- package/dist/parse-DY6OD1j_.mjs.map +1 -0
- package/dist/passkey-config-X_H8128a.mjs +46 -0
- package/dist/passkey-config-X_H8128a.mjs.map +1 -0
- package/dist/paths-JxokKIbr.mjs +77 -0
- package/dist/paths-JxokKIbr.mjs.map +1 -0
- package/dist/patterns-BhAvqO0S.mjs +145 -0
- package/dist/patterns-BhAvqO0S.mjs.map +1 -0
- package/dist/placeholder-MSEd8gty.d.mts +306 -0
- package/dist/placeholder-MSEd8gty.d.mts.map +1 -0
- package/dist/plan-xjcWrAah.mjs +135 -0
- package/dist/plan-xjcWrAah.mjs.map +1 -0
- package/dist/plugin-test-runtime.d.mts +38 -15
- package/dist/plugin-test-runtime.d.mts.map +1 -1
- package/dist/plugin-test-runtime.mjs +112 -99
- package/dist/plugin-types.d.mts +2 -2
- package/dist/plugin-utils.d.mts +12 -12
- package/dist/plugins/adapt-sandbox-entry.d.mts +12 -12
- package/dist/plugins/adapt-sandbox-entry.mjs +3 -3
- package/dist/plugins/host.d.mts +5 -5
- package/dist/plugins/host.mjs +45 -37
- package/dist/plugins-DUXUt8B9.mjs +277 -0
- package/dist/plugins-DUXUt8B9.mjs.map +1 -0
- package/dist/policy-CUvwAARc.mjs +45 -0
- package/dist/policy-CUvwAARc.mjs.map +1 -0
- package/dist/portable-text-5O_ZGUjB.mjs +307 -0
- package/dist/portable-text-5O_ZGUjB.mjs.map +1 -0
- package/dist/preview-CIUcPYr6.mjs +107 -0
- package/dist/preview-CIUcPYr6.mjs.map +1 -0
- package/dist/protocol-B97DZaFr.d.mts +61 -0
- package/dist/protocol-B97DZaFr.d.mts.map +1 -0
- package/dist/public-submission-BFBUrqst.mjs +250 -0
- package/dist/public-submission-BFBUrqst.mjs.map +1 -0
- package/dist/public-url-Bn7U0D7-.mjs +101 -0
- package/dist/public-url-Bn7U0D7-.mjs.map +1 -0
- package/dist/query-B48peoRT.mjs +890 -0
- package/dist/query-B48peoRT.mjs.map +1 -0
- package/dist/query-C4IH0uhR.mjs +41 -0
- package/dist/query-C4IH0uhR.mjs.map +1 -0
- package/dist/rate-limit-BZ6nybgc.mjs +120 -0
- package/dist/rate-limit-BZ6nybgc.mjs.map +1 -0
- package/dist/receipt-B4wJj5Jq.mjs +43 -0
- package/dist/receipt-B4wJj5Jq.mjs.map +1 -0
- package/dist/redirect-Cd1E7VUt.mjs +17 -0
- package/dist/redirect-Cd1E7VUt.mjs.map +1 -0
- package/dist/redirect-iJf5fltD.mjs +415 -0
- package/dist/redirect-iJf5fltD.mjs.map +1 -0
- package/dist/redirects-CYu1u1aK.mjs +446 -0
- package/dist/redirects-CYu1u1aK.mjs.map +1 -0
- package/dist/redirects-Cv9apQKj.mjs +148 -0
- package/dist/redirects-Cv9apQKj.mjs.map +1 -0
- package/dist/registry/testing.mjs +3 -3
- package/dist/relation-M4NUCb0b.mjs +334 -0
- package/dist/relation-M4NUCb0b.mjs.map +1 -0
- package/dist/relations-CCif47Oq.mjs +403 -0
- package/dist/relations-CCif47Oq.mjs.map +1 -0
- package/dist/relations-CK9CYUyr.mjs +310 -0
- package/dist/relations-CK9CYUyr.mjs.map +1 -0
- package/dist/request-cache-DzLYKm_x.mjs +104 -0
- package/dist/request-cache-DzLYKm_x.mjs.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/request-meta-sZXt3sRo.mjs +141 -0
- package/dist/request-meta-sZXt3sRo.mjs.map +1 -0
- package/dist/resolve-2WbQsCvT.mjs +199 -0
- package/dist/resolve-2WbQsCvT.mjs.map +1 -0
- package/dist/route-wire--1hLuACz.mjs +197 -0
- package/dist/route-wire--1hLuACz.mjs.map +1 -0
- package/dist/routes-CUsM40Cc.mjs +272 -0
- package/dist/routes-CUsM40Cc.mjs.map +1 -0
- package/dist/runner-1y4J9fJB.mjs +5742 -0
- package/dist/runner-1y4J9fJB.mjs.map +1 -0
- package/dist/runner-D5_LzKXI.d.mts +68 -0
- package/dist/runner-D5_LzKXI.d.mts.map +1 -0
- package/dist/runtime.d.mts +13 -13
- package/dist/runtime.mjs +4 -4
- package/dist/schema-BABiRdsH.mjs +13 -0
- package/dist/schema-BABiRdsH.mjs.map +1 -0
- package/dist/schema-Du3MzCG0.mjs +446 -0
- package/dist/schema-Du3MzCG0.mjs.map +1 -0
- package/dist/scopes-Dbk-ElhT.mjs +34 -0
- package/dist/scopes-Dbk-ElhT.mjs.map +1 -0
- package/dist/search-Bt1PL1jf.mjs +448 -0
- package/dist/search-Bt1PL1jf.mjs.map +1 -0
- package/dist/secrets-CIi0nFiR.mjs +341 -0
- package/dist/secrets-CIi0nFiR.mjs.map +1 -0
- package/dist/sections-Ddptx_o9.mjs +346 -0
- package/dist/sections-Ddptx_o9.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +35 -30
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +25 -21
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-CZT2oLtT.mjs +114 -0
- package/dist/seo-CZT2oLtT.mjs.map +1 -0
- package/dist/seo-D5w3-Azy.mjs +133 -0
- package/dist/seo-D5w3-Azy.mjs.map +1 -0
- package/dist/service-DuykXPyW.mjs +150 -0
- package/dist/service-DuykXPyW.mjs.map +1 -0
- package/dist/session-user-BhaVp8w0.mjs +51 -0
- package/dist/session-user-BhaVp8w0.mjs.map +1 -0
- package/dist/settings-2xNYr90o.mjs +51 -0
- package/dist/settings-2xNYr90o.mjs.map +1 -0
- package/dist/settings-CgjRWGW9.mjs +439 -0
- package/dist/settings-CgjRWGW9.mjs.map +1 -0
- package/dist/settings-DYidIB26.mjs +61 -0
- package/dist/settings-DYidIB26.mjs.map +1 -0
- package/dist/setup-complete-bOogcHWG.mjs +26 -0
- package/dist/setup-complete-bOogcHWG.mjs.map +1 -0
- package/dist/setup-nonce-0EGuKM4s.mjs +25 -0
- package/dist/setup-nonce-0EGuKM4s.mjs.map +1 -0
- package/dist/site-settings-DOgRUoFX.mjs +50 -0
- package/dist/site-settings-DOgRUoFX.mjs.map +1 -0
- package/dist/site-url-BU_bbxwj.mjs +16 -0
- package/dist/site-url-BU_bbxwj.mjs.map +1 -0
- package/dist/snapshot-CugwUqKQ.mjs +237 -0
- package/dist/snapshot-CugwUqKQ.mjs.map +1 -0
- package/dist/ssrf-CJUnJymJ.mjs +406 -0
- package/dist/ssrf-CJUnJymJ.mjs.map +1 -0
- package/dist/stage-DgrBz_du.mjs +662 -0
- package/dist/stage-DgrBz_du.mjs.map +1 -0
- package/dist/state-DDiPySSG.mjs +153 -0
- package/dist/state-DDiPySSG.mjs.map +1 -0
- package/dist/status-DZKIG4a9.mjs +30 -0
- package/dist/status-DZKIG4a9.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage-query-Bdv7A62k.d.mts +1576 -0
- package/dist/storage-query-Bdv7A62k.d.mts.map +1 -0
- package/dist/tar-_1AgTYFu.mjs +449 -0
- package/dist/tar-_1AgTYFu.mjs.map +1 -0
- package/dist/target-_7pn2Gbg.mjs +27 -0
- package/dist/target-_7pn2Gbg.mjs.map +1 -0
- package/dist/taxonomies-C1IwNe8Q.mjs +697 -0
- package/dist/taxonomies-C1IwNe8Q.mjs.map +1 -0
- package/dist/taxonomies-C_XMoRcX.mjs +939 -0
- package/dist/taxonomies-C_XMoRcX.mjs.map +1 -0
- package/dist/taxonomy-C3Fu1YeH.mjs +525 -0
- package/dist/taxonomy-C3Fu1YeH.mjs.map +1 -0
- package/dist/tokens-u78jETkX.mjs +171 -0
- package/dist/tokens-u78jETkX.mjs.map +1 -0
- package/dist/transfer-BhUCrgDc.mjs +8675 -0
- package/dist/transfer-BhUCrgDc.mjs.map +1 -0
- package/dist/transfer-DIGvR9Af.mjs +166 -0
- package/dist/transfer-DIGvR9Af.mjs.map +1 -0
- package/dist/transfer-download-Pml7RMio.mjs +33 -0
- package/dist/transfer-download-Pml7RMio.mjs.map +1 -0
- package/dist/transformations-9gfpwY65.mjs +196 -0
- package/dist/transformations-9gfpwY65.mjs.map +1 -0
- package/dist/transport-BIfH7_hx.d.mts +42 -0
- package/dist/transport-BIfH7_hx.d.mts.map +1 -0
- package/dist/transport-DKWIq53q.mjs +136 -0
- package/dist/transport-DKWIq53q.mjs.map +1 -0
- package/dist/trusted-proxy-tKiVtyTD.mjs +51 -0
- package/dist/trusted-proxy-tKiVtyTD.mjs.map +1 -0
- package/dist/turnstile-DpsoyOfg.mjs +53 -0
- package/dist/turnstile-DpsoyOfg.mjs.map +1 -0
- package/dist/types-B4sUC2p1.d.mts +198 -0
- package/dist/types-B4sUC2p1.d.mts.map +1 -0
- package/dist/types-B7Lmsh1E.d.mts +887 -0
- package/dist/types-B7Lmsh1E.d.mts.map +1 -0
- package/dist/types-BZakh7Ym.mjs +22 -0
- package/dist/types-BZakh7Ym.mjs.map +1 -0
- package/dist/types-B_CppEmv.d.mts +264 -0
- package/dist/types-B_CppEmv.d.mts.map +1 -0
- package/dist/types-BcrBrE6-.mjs +159 -0
- package/dist/types-BcrBrE6-.mjs.map +1 -0
- package/dist/types-CAZgq9fO.d.mts +124 -0
- package/dist/types-CAZgq9fO.d.mts.map +1 -0
- package/dist/types-Cd-O03VG.d.mts +363 -0
- package/dist/types-Cd-O03VG.d.mts.map +1 -0
- package/dist/types-Cr-Kg-3D.d.mts +1641 -0
- package/dist/types-Cr-Kg-3D.d.mts.map +1 -0
- package/dist/types-D2fvWd1i.d.mts +359 -0
- package/dist/types-D2fvWd1i.d.mts.map +1 -0
- package/dist/types-D7HUsguf.mjs +77 -0
- package/dist/types-D7HUsguf.mjs.map +1 -0
- package/dist/types-DA1Te3Oy.d.mts +198 -0
- package/dist/types-DA1Te3Oy.d.mts.map +1 -0
- package/dist/types-DhV6Q5bP.mjs +18 -0
- package/dist/types-DhV6Q5bP.mjs.map +1 -0
- package/dist/types-DnnVSl6Y.d.mts +85 -0
- package/dist/types-DnnVSl6Y.d.mts.map +1 -0
- package/dist/types-VT4-BugW.mjs +16 -0
- package/dist/types-VT4-BugW.mjs.map +1 -0
- package/dist/upload-attempts-B68ZGNu9.mjs +32 -0
- package/dist/upload-attempts-B68ZGNu9.mjs.map +1 -0
- package/dist/url-pattern-CCeZMGOh.mjs +33 -0
- package/dist/url-pattern-CCeZMGOh.mjs.map +1 -0
- package/dist/user-DDSL-sGw.mjs +171 -0
- package/dist/user-DDSL-sGw.mjs.map +1 -0
- package/dist/utils-DdhmO9w9.mjs +439 -0
- package/dist/utils-DdhmO9w9.mjs.map +1 -0
- package/dist/validate-CHosPEhs.mjs +453 -0
- package/dist/validate-CHosPEhs.mjs.map +1 -0
- package/dist/validate-CM79QXYE.d.mts +432 -0
- package/dist/validate-CM79QXYE.d.mts.map +1 -0
- package/dist/validation-BFecQczG.mjs +218 -0
- package/dist/validation-BFecQczG.mjs.map +1 -0
- package/dist/version-BRZXVifl.mjs +9 -0
- package/dist/version-BRZXVifl.mjs.map +1 -0
- package/dist/version-DUQDHgrf.mjs +7 -0
- package/dist/version-DUQDHgrf.mjs.map +1 -0
- package/dist/widgets-WdV72brA.mjs +126 -0
- package/dist/widgets-WdV72brA.mjs.map +1 -0
- package/dist/wxr-taxonomies-BHTdqkmZ.d.mts +34 -0
- package/dist/wxr-taxonomies-BHTdqkmZ.d.mts.map +1 -0
- package/dist/wxr-taxonomies-DP6ESgMN.mjs +372 -0
- package/dist/wxr-taxonomies-DP6ESgMN.mjs.map +1 -0
- package/dist/zod-generator-D6uE4WiS.mjs +389 -0
- package/dist/zod-generator-D6uE4WiS.mjs.map +1 -0
- package/package.json +6 -5
- package/src/api/authorize.ts +17 -0
- package/src/api/email-locale.ts +24 -0
- package/src/api/errors.ts +16 -0
- package/src/api/handlers/api-tokens.ts +18 -3
- package/src/api/handlers/block-types.ts +129 -0
- package/src/api/handlers/bulk-tag.ts +309 -0
- package/src/api/handlers/comments.ts +0 -28
- package/src/api/handlers/index.ts +10 -0
- package/src/api/handlers/manifest.ts +8 -1
- package/src/api/handlers/marketplace.ts +22 -16
- package/src/api/handlers/media-usage.ts +31 -12
- package/src/api/handlers/media.ts +19 -14
- package/src/api/handlers/schema.ts +33 -8
- package/src/api/handlers/settings.ts +2 -2
- package/src/api/handlers/snapshot.ts +4 -0
- package/src/api/handlers/taxonomies.ts +132 -83
- package/src/api/handlers/transfer.ts +1347 -0
- package/src/api/handlers/validate-media-fields.ts +124 -12
- package/src/api/media-usage-write-fence.ts +5 -26
- package/src/api/openapi/document.ts +614 -5
- package/src/api/schemas/auth.ts +7 -1
- package/src/api/schemas/common.ts +5 -0
- package/src/api/schemas/content.ts +20 -1
- package/src/api/schemas/media-usage.ts +11 -0
- package/src/api/schemas/menus.ts +1 -1
- package/src/api/schemas/schema.ts +117 -0
- package/src/api/schemas/settings.ts +3 -3
- package/src/api/schemas/taxonomies.ts +18 -0
- package/src/api/schemas/transfer.ts +249 -0
- package/src/api/transfer-download.ts +36 -0
- package/src/api/types.ts +3 -0
- package/src/astro/integration/routes.ts +31 -0
- package/src/astro/integration/vite-config.ts +26 -0
- package/src/astro/middleware/auth.ts +30 -7
- package/src/astro/middleware/media-usage-write-fence.ts +106 -11
- package/src/astro/middleware/request-context.ts +16 -2
- package/src/astro/middleware.ts +38 -18
- package/src/astro/routes/admin.astro +3 -1
- package/src/astro/routes/api/admin/hooks/exclusive/index.ts +1 -5
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +4 -3
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +4 -3
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +4 -3
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +4 -3
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +4 -3
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +4 -3
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +3 -3
- package/src/astro/routes/api/admin/plugins/registry/install.ts +3 -3
- package/src/astro/routes/api/admin/plugins/registry/publisher-handle.ts +59 -0
- package/src/astro/routes/api/admin/transfer/[...path].ts +143 -0
- package/src/astro/routes/api/admin/transfer/approvals/[id]/approve.ts +35 -0
- package/src/astro/routes/api/admin/transfer/approvals/[id]/deny.ts +35 -0
- package/src/astro/routes/api/admin/transfer/approvals/index.ts +33 -0
- package/src/astro/routes/api/admin/transfer/capabilities.ts +36 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/advance.ts +34 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/archive.ts +35 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/files/[...path].ts +40 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/index.ts +25 -0
- package/src/astro/routes/api/admin/transfer/exports/[id]/manifest.ts +38 -0
- package/src/astro/routes/api/admin/transfer/exports/index.ts +64 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/abandon.ts +28 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/advance.ts +37 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/analyze.ts +51 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/cancel.ts +27 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/execute.ts +48 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/files/[...path].ts +54 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/index.ts +25 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/missing.ts +34 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/plan.ts +29 -0
- package/src/astro/routes/api/admin/transfer/imports/[id]/receipt.ts +25 -0
- package/src/astro/routes/api/admin/transfer/imports/index.ts +85 -0
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +9 -1
- package/src/astro/routes/api/auth/invite/index.ts +15 -1
- package/src/astro/routes/api/auth/magic-link/send.ts +9 -1
- package/src/astro/routes/api/auth/magic-link/verify.ts +37 -39
- package/src/astro/routes/api/auth/passkey/options.ts +2 -21
- package/src/astro/routes/api/content/[collection]/[id]/preview-url.ts +64 -13
- package/src/astro/routes/api/content/[collection]/[id]/terms/[taxonomy].ts +16 -1
- package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +11 -4
- package/src/astro/routes/api/mcp.ts +1 -0
- package/src/astro/routes/api/media/[id].ts +5 -15
- package/src/astro/routes/api/media/file/[...key].ts +30 -5
- package/src/astro/routes/api/oauth/authorize.ts +4 -0
- package/src/astro/routes/api/schema/block-types/[slug]/index.ts +29 -0
- package/src/astro/routes/api/schema/block-types/[slug]/versions/[version]/activate.ts +31 -0
- package/src/astro/routes/api/schema/block-types/index.ts +29 -0
- package/src/astro/routes/api/taxonomies/bulk-tag.ts +29 -0
- package/src/astro/routes/api/typegen.ts +8 -4
- package/src/astro/types.ts +4 -0
- package/src/auth/api-tokens.ts +1 -0
- package/src/auth/rate-limit.ts +2 -1
- package/src/auth/scopes.ts +11 -0
- package/src/cleanup.ts +14 -0
- package/src/cli/client-factory.ts +6 -1
- package/src/cli/commands/export-seed.ts +41 -15
- package/src/cli/commands/seed.ts +6 -2
- package/src/cli/commands/site.ts +556 -0
- package/src/cli/index.ts +2 -0
- package/src/cli/site/archive.ts +273 -0
- package/src/cli/site/export.ts +311 -0
- package/src/cli/site/import.ts +815 -0
- package/src/cli/site/shared.ts +241 -0
- package/src/client/index.ts +414 -11
- package/src/client/portable-text.ts +41 -0
- package/src/comments/public-submission.ts +19 -11
- package/src/components/Blocks.astro +46 -0
- package/src/components/Gallery.astro +2 -1
- package/src/components/Image.astro +51 -6
- package/src/components/InlinePortableTextEditor.tsx +28 -18
- package/src/components/blocks.ts +44 -0
- package/src/components/index.ts +14 -4
- package/src/content/converters/gallery.ts +54 -16
- package/src/content/converters/image-link.ts +27 -0
- package/src/content/converters/index.ts +1 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +10 -7
- package/src/content/converters/prosemirror-to-portable-text.ts +14 -0
- package/src/content/converters/types.ts +17 -0
- package/src/database/content-datetime.ts +19 -2
- package/src/database/migrations/035_bounded_404_log.ts +28 -39
- package/src/database/migrations/081_redirect_write_guards.ts +7 -4
- package/src/database/migrations/083_block_types.ts +58 -0
- package/src/database/migrations/084_site_transfer.ts +264 -0
- package/src/database/migrations/085_taxonomy_def_groups.ts +155 -0
- package/src/database/migrations/runner.ts +6 -0
- package/src/database/repositories/audit.ts +10 -1
- package/src/database/repositories/byline.ts +4 -1
- package/src/database/repositories/content.ts +83 -11
- package/src/database/repositories/media-usage.ts +43 -13
- package/src/database/repositories/media.ts +32 -1
- package/src/database/repositories/options.ts +12 -0
- package/src/database/repositories/revision.ts +6 -3
- package/src/database/repositories/taxonomy-def.ts +126 -0
- package/src/database/repositories/taxonomy.ts +65 -26
- package/src/database/types.ts +133 -1
- package/src/db/sqlite.ts +1 -1
- package/src/emdash-runtime.ts +287 -51
- package/src/import/utils.ts +8 -1
- package/src/import/wxr-taxonomies.ts +11 -67
- package/src/index.ts +26 -1
- package/src/loader.ts +9 -5
- package/src/mcp/server.ts +521 -29
- package/src/mcp/transfer.ts +569 -0
- package/src/media/local-runtime.ts +5 -18
- package/src/media/upload-attempts.ts +5 -0
- package/src/media/url.ts +15 -0
- package/src/media/usage/content-fields.ts +69 -5
- package/src/media/usage/content-refresh.ts +13 -66
- package/src/media/usage/content-repair.ts +10 -2
- package/src/media/usage/extractor.ts +74 -3
- package/src/media/usage/projection-fingerprint.ts +14 -0
- package/src/media/usage/schema-invalidation.ts +72 -0
- package/src/media/usage/site-settings.ts +52 -0
- package/src/media/usage/types.ts +2 -0
- package/src/object-cache/index.ts +69 -4
- package/src/plugin-test-runtime.ts +1 -0
- package/src/plugins/context.ts +104 -56
- package/src/plugins/cron.ts +6 -4
- package/src/plugins/define-plugin.ts +11 -1
- package/src/plugins/email-console.ts +2 -0
- package/src/plugins/email.ts +16 -0
- package/src/plugins/hooks.ts +33 -9
- package/src/plugins/manifest-schema.ts +1 -0
- package/src/plugins/route-error.ts +57 -0
- package/src/plugins/routes.ts +5 -60
- package/src/plugins/sandbox/types.ts +22 -2
- package/src/plugins/types.ts +4 -0
- package/src/registry/artifact-fetch.ts +17 -4
- package/src/registry/publisher-handle.ts +273 -0
- package/src/schema/block-type-contract.ts +478 -0
- package/src/schema/block-type-registry.ts +689 -0
- package/src/schema/block-types.ts +110 -0
- package/src/schema/block-values.ts +293 -0
- package/src/schema/byline-registry.ts +1 -1
- package/src/schema/index.ts +28 -0
- package/src/schema/registry.ts +462 -12
- package/src/schema/types.ts +12 -1
- package/src/schema/zod-generator.ts +92 -9
- package/src/search/fts-manager.ts +40 -0
- package/src/seed/apply.ts +173 -49
- package/src/seed/types.ts +23 -3
- package/src/seed/validate.ts +131 -7
- package/src/settings/index.ts +32 -9
- package/src/settings/types.ts +15 -0
- package/src/taxonomies/index.ts +72 -83
- package/src/transfer/analyze/index.ts +45 -0
- package/src/transfer/analyze/issues.ts +55 -0
- package/src/transfer/analyze/plan.ts +327 -0
- package/src/transfer/analyze/read.ts +134 -0
- package/src/transfer/analyze/step.ts +551 -0
- package/src/transfer/analyze/target.ts +269 -0
- package/src/transfer/analyze/unique-keys.ts +228 -0
- package/src/transfer/analyze/validate.ts +1412 -0
- package/src/transfer/analyze/values.ts +227 -0
- package/src/transfer/analyze/write-rules.ts +196 -0
- package/src/transfer/audit.ts +38 -0
- package/src/transfer/auth.ts +25 -0
- package/src/transfer/container/tar.ts +242 -0
- package/src/transfer/domain.ts +248 -0
- package/src/transfer/errors.ts +134 -0
- package/src/transfer/export/exporter.ts +1067 -0
- package/src/transfer/export/fence.ts +84 -0
- package/src/transfer/export/media.ts +165 -0
- package/src/transfer/export/readers.ts +1164 -0
- package/src/transfer/export/verify.ts +677 -0
- package/src/transfer/fence.ts +193 -0
- package/src/transfer/format/canonical.ts +151 -0
- package/src/transfer/format/column-codec.ts +275 -0
- package/src/transfer/format/columns.ts +707 -0
- package/src/transfer/format/digest.ts +287 -0
- package/src/transfer/format/features.ts +91 -0
- package/src/transfer/format/issues.ts +39 -0
- package/src/transfer/format/kinds.ts +936 -0
- package/src/transfer/format/limits.ts +87 -0
- package/src/transfer/format/manifest.ts +297 -0
- package/src/transfer/format/media-refs.ts +716 -0
- package/src/transfer/format/paths.ts +73 -0
- package/src/transfer/format/plan.ts +162 -0
- package/src/transfer/format/receipt.ts +43 -0
- package/src/transfer/format/records.ts +127 -0
- package/src/transfer/format/settings.ts +94 -0
- package/src/transfer/format/transformations.ts +260 -0
- package/src/transfer/format/version.ts +9 -0
- package/src/transfer/gc.ts +103 -0
- package/src/transfer/import/advance.ts +522 -0
- package/src/transfer/import/context.ts +281 -0
- package/src/transfer/import/entries.ts +186 -0
- package/src/transfer/import/ids.ts +40 -0
- package/src/transfer/import/index.ts +15 -0
- package/src/transfer/import/media.ts +141 -0
- package/src/transfer/import/rebuild.ts +300 -0
- package/src/transfer/import/rows.ts +114 -0
- package/src/transfer/import/scaffold.ts +221 -0
- package/src/transfer/import/sql.ts +134 -0
- package/src/transfer/import/stages.ts +329 -0
- package/src/transfer/import/writers.ts +370 -0
- package/src/transfer/index.ts +472 -0
- package/src/transfer/ops/approvals.ts +359 -0
- package/src/transfer/ops/budget.ts +82 -0
- package/src/transfer/ops/collation.ts +21 -0
- package/src/transfer/ops/identity-map.ts +142 -0
- package/src/transfer/ops/media-blobs.ts +135 -0
- package/src/transfer/ops/operations.ts +842 -0
- package/src/transfer/ops/package-index.ts +159 -0
- package/src/transfer/ops/staged-files.ts +231 -0
- package/src/transfer/ops/states.ts +265 -0
- package/src/transfer/ops/time.ts +54 -0
- package/src/transfer/schema-importer.ts +34 -0
- package/src/transfer/site-id.ts +30 -0
- package/src/transfer/staging/assembler.ts +217 -0
- package/src/transfer/staging/keys.ts +94 -0
- package/src/transfer/staging/package.ts +229 -0
- package/src/transfer/staging/stage.ts +231 -0
- package/src/ui.ts +19 -0
- package/src/visual-editing/toolbar.ts +125 -37
- package/dist/action-token-On1sot_c.mjs +0 -26
- package/dist/action-token-On1sot_c.mjs.map +0 -1
- package/dist/activation-CaMfdBt1.mjs +0 -382
- package/dist/activation-CaMfdBt1.mjs.map +0 -1
- package/dist/adapters-Cq10K4_c.d.mts +0 -171
- package/dist/adapters-Cq10K4_c.d.mts.map +0 -1
- package/dist/allowed-origins-1Sa-2wZK.mjs +0 -116
- package/dist/allowed-origins-1Sa-2wZK.mjs.map +0 -1
- package/dist/api-DmjKxPCY.mjs +0 -4831
- package/dist/api-DmjKxPCY.mjs.map +0 -1
- package/dist/api-tokens-BIXItFKV.mjs +0 -163
- package/dist/api-tokens-BIXItFKV.mjs.map +0 -1
- package/dist/api-tokens-DS1VzN7_.mjs +0 -3
- package/dist/apply-drpfmqrR.mjs +0 -1005
- package/dist/apply-drpfmqrR.mjs.map +0 -1
- package/dist/artifact-fetch-COiMhVgk.mjs +0 -813
- package/dist/artifact-fetch-COiMhVgk.mjs.map +0 -1
- package/dist/authoritative-records-DbqshfKD.mjs +0 -5172
- package/dist/authoritative-records-DbqshfKD.mjs.map +0 -1
- package/dist/authorize-BXpfMpp0.mjs +0 -40
- package/dist/authorize-BXpfMpp0.mjs.map +0 -1
- package/dist/backup-BsPQdwnS.mjs +0 -246
- package/dist/backup-BsPQdwnS.mjs.map +0 -1
- package/dist/byline-Doh-wt99.mjs +0 -906
- package/dist/byline-Doh-wt99.mjs.map +0 -1
- package/dist/byline-fields-CsrdvaLV.mjs +0 -123
- package/dist/byline-fields-CsrdvaLV.mjs.map +0 -1
- package/dist/byline-registry-D6lWzXk6.mjs +0 -406
- package/dist/byline-registry-D6lWzXk6.mjs.map +0 -1
- package/dist/bylines-Cop0hkoy.mjs +0 -214
- package/dist/bylines-Cop0hkoy.mjs.map +0 -1
- package/dist/bylines-kpBzHPr8.mjs +0 -232
- package/dist/bylines-kpBzHPr8.mjs.map +0 -1
- package/dist/cache-B0pOlXdM.mjs +0 -108
- package/dist/cache-B0pOlXdM.mjs.map +0 -1
- package/dist/capture-triggers-gxQxnxrJ.mjs +0 -362
- package/dist/capture-triggers-gxQxnxrJ.mjs.map +0 -1
- package/dist/challenge-store-CkRdSdd8.mjs +0 -51
- package/dist/challenge-store-CkRdSdd8.mjs.map +0 -1
- package/dist/checksum-Bsi2D9M1.mjs +0 -162
- package/dist/checksum-Bsi2D9M1.mjs.map +0 -1
- package/dist/chrome-tags-D7LGB91U.mjs +0 -24
- package/dist/chrome-tags-D7LGB91U.mjs.map +0 -1
- package/dist/chunks-BmWyou79.mjs +0 -25
- package/dist/chunks-BmWyou79.mjs.map +0 -1
- package/dist/collection-deletion-C3Xixmkx.mjs +0 -436
- package/dist/collection-deletion-C3Xixmkx.mjs.map +0 -1
- package/dist/collection-slugs-cache-D9auiKmI.mjs +0 -85
- package/dist/collection-slugs-cache-D9auiKmI.mjs.map +0 -1
- package/dist/comment-DcT8qdPK.mjs +0 -313
- package/dist/comment-DcT8qdPK.mjs.map +0 -1
- package/dist/comment-reaction-DY5-y8Y5.mjs +0 -85
- package/dist/comment-reaction-DY5-y8Y5.mjs.map +0 -1
- package/dist/comments-B67VRNGw.mjs +0 -204
- package/dist/comments-B67VRNGw.mjs.map +0 -1
- package/dist/comments-BVzzt6x5.mjs +0 -99
- package/dist/comments-BVzzt6x5.mjs.map +0 -1
- package/dist/components-DIl9Qzh6.mjs +0 -108
- package/dist/components-DIl9Qzh6.mjs.map +0 -1
- package/dist/config-B2acLeC5.mjs +0 -242
- package/dist/config-B2acLeC5.mjs.map +0 -1
- package/dist/config-CGVeT8Hc.mjs +0 -73
- package/dist/config-CGVeT8Hc.mjs.map +0 -1
- package/dist/config-D3HhLON3.d.mts +0 -39
- package/dist/config-D3HhLON3.d.mts.map +0 -1
- package/dist/config-DS7e4EZ9.d.mts +0 -6387
- package/dist/config-DS7e4EZ9.d.mts.map +0 -1
- package/dist/content-DZ3B5qtA.mjs +0 -2216
- package/dist/content-DZ3B5qtA.mjs.map +0 -1
- package/dist/content-list-query-CbPdzsna.d.mts +0 -26
- package/dist/content-list-query-CbPdzsna.d.mts.map +0 -1
- package/dist/content-policy-CM4skrNi.mjs +0 -46
- package/dist/content-policy-CM4skrNi.mjs.map +0 -1
- package/dist/content-refresh-BHLHJgyt.mjs +0 -3599
- package/dist/content-refresh-BHLHJgyt.mjs.map +0 -1
- package/dist/content-repair-BVll5WNl.mjs +0 -440
- package/dist/content-repair-BVll5WNl.mjs.map +0 -1
- package/dist/context-B195kjqZ.mjs +0 -1835
- package/dist/context-B195kjqZ.mjs.map +0 -1
- package/dist/cron-BcR3RN4K.mjs +0 -282
- package/dist/cron-BcR3RN4K.mjs.map +0 -1
- package/dist/dashboard-CZD4G7k_.mjs +0 -151
- package/dist/dashboard-CZD4G7k_.mjs.map +0 -1
- package/dist/default-BtlxWgh9.mjs +0 -81
- package/dist/default-BtlxWgh9.mjs.map +0 -1
- package/dist/deferred-tasks-Ba9fphlE.d.mts +0 -9
- package/dist/deferred-tasks-Ba9fphlE.d.mts.map +0 -1
- package/dist/device-flow-3E5l0fpH.mjs +0 -466
- package/dist/device-flow-3E5l0fpH.mjs.map +0 -1
- package/dist/dialect-helpers-CtYdsX4W.mjs +0 -307
- package/dist/dialect-helpers-CtYdsX4W.mjs.map +0 -1
- package/dist/direct-executor-ZI8E01Yt.mjs +0 -104
- package/dist/direct-executor-ZI8E01Yt.mjs.map +0 -1
- package/dist/dist-2hDLsLeq.mjs +0 -810
- package/dist/dist-2hDLsLeq.mjs.map +0 -1
- package/dist/email-console-gc-E3Eqj.mjs +0 -50
- package/dist/email-console-gc-E3Eqj.mjs.map +0 -1
- package/dist/emdash-runtime-DZGinqTL.mjs +0 -4041
- package/dist/emdash-runtime-DZGinqTL.mjs.map +0 -1
- package/dist/enrich-C2Mk0lwE.mjs +0 -194
- package/dist/enrich-C2Mk0lwE.mjs.map +0 -1
- package/dist/entry-lock-D3C99MXS.mjs +0 -1520
- package/dist/entry-lock-D3C99MXS.mjs.map +0 -1
- package/dist/entry-lock-D9rnj2Lu.mjs +0 -163
- package/dist/entry-lock-D9rnj2Lu.mjs.map +0 -1
- package/dist/entry-lock-DX7QkqEg.d.mts +0 -3503
- package/dist/entry-lock-DX7QkqEg.d.mts.map +0 -1
- package/dist/entry-locks-CO_KaoU5.mjs +0 -167
- package/dist/entry-locks-CO_KaoU5.mjs.map +0 -1
- package/dist/error-CCTCskie.mjs +0 -90
- package/dist/error-CCTCskie.mjs.map +0 -1
- package/dist/errors-W3PA8HqB.mjs +0 -447
- package/dist/errors-W3PA8HqB.mjs.map +0 -1
- package/dist/escape-DN4Qmjsl.mjs +0 -9
- package/dist/escape-DN4Qmjsl.mjs.map +0 -1
- package/dist/field-defs-cache-B337z8UJ.mjs +0 -77
- package/dist/field-defs-cache-B337z8UJ.mjs.map +0 -1
- package/dist/fts-manager-DMb0sbIQ.mjs +0 -413
- package/dist/fts-manager-DMb0sbIQ.mjs.map +0 -1
- package/dist/hash-CLVFzWvx.mjs +0 -37
- package/dist/hash-CLVFzWvx.mjs.map +0 -1
- package/dist/hook-result-KY1jq21o.d.mts +0 -31
- package/dist/hook-result-KY1jq21o.d.mts.map +0 -1
- package/dist/hreflang-BgS2FqhH.d.mts +0 -50
- package/dist/hreflang-BgS2FqhH.d.mts.map +0 -1
- package/dist/hreflang-CrJwqoeb.mjs +0 -105
- package/dist/hreflang-CrJwqoeb.mjs.map +0 -1
- package/dist/http-route-dispatch-DAKlanXb.mjs +0 -339
- package/dist/http-route-dispatch-DAKlanXb.mjs.map +0 -1
- package/dist/identity-DRGSHEEr.mjs +0 -35
- package/dist/identity-DRGSHEEr.mjs.map +0 -1
- package/dist/import-DFr5B_hC.mjs +0 -2020
- package/dist/import-DFr5B_hC.mjs.map +0 -1
- package/dist/index-CDwKDkTq.d.mts +0 -623
- package/dist/index-CDwKDkTq.d.mts.map +0 -1
- package/dist/install-finalization-5Os-QZ-2.mjs +0 -58
- package/dist/install-finalization-5Os-QZ-2.mjs.map +0 -1
- package/dist/lifecycle-7e-Lt_kX.mjs +0 -25
- package/dist/lifecycle-7e-Lt_kX.mjs.map +0 -1
- package/dist/load-Cu5bvCZh.mjs +0 -28
- package/dist/load-Cu5bvCZh.mjs.map +0 -1
- package/dist/loader-t4TxaFiQ.mjs +0 -1004
- package/dist/loader-t4TxaFiQ.mjs.map +0 -1
- package/dist/manifest-builder-D31UoJCu.mjs +0 -189
- package/dist/manifest-builder-D31UoJCu.mjs.map +0 -1
- package/dist/manifest-schema-Bkh8SeHd.mjs +0 -491
- package/dist/manifest-schema-Bkh8SeHd.mjs.map +0 -1
- package/dist/media-TBlKCwo7.mjs +0 -334
- package/dist/media-TBlKCwo7.mjs.map +0 -1
- package/dist/media-allowlist-s60eAIf6.mjs +0 -44
- package/dist/media-allowlist-s60eAIf6.mjs.map +0 -1
- package/dist/media-folders-ClIRLUQv.mjs +0 -210
- package/dist/media-folders-ClIRLUQv.mjs.map +0 -1
- package/dist/media-url-DY_ijO3B.mjs +0 -43
- package/dist/media-url-DY_ijO3B.mjs.map +0 -1
- package/dist/media-usage-C4NolTpQ.mjs +0 -1833
- package/dist/media-usage-C4NolTpQ.mjs.map +0 -1
- package/dist/media-usage-activation-CAhmb14O.mjs +0 -78
- package/dist/media-usage-activation-CAhmb14O.mjs.map +0 -1
- package/dist/media-usage-work-Cu5DqewW.mjs +0 -586
- package/dist/media-usage-work-Cu5DqewW.mjs.map +0 -1
- package/dist/media-usage-work-DJr3rOEN.mjs +0 -152
- package/dist/media-usage-work-DJr3rOEN.mjs.map +0 -1
- package/dist/media-usage-write-fence-DW5oHT7q.mjs +0 -42
- package/dist/media-usage-write-fence-DW5oHT7q.mjs.map +0 -1
- package/dist/menus-DbgU9z5Q.mjs +0 -3732
- package/dist/menus-DbgU9z5Q.mjs.map +0 -1
- package/dist/menus-Wy8m5NcH.mjs +0 -753
- package/dist/menus-Wy8m5NcH.mjs.map +0 -1
- package/dist/mime-CCYRC4r1.mjs +0 -36
- package/dist/mime-CCYRC4r1.mjs.map +0 -1
- package/dist/mode-CkmOhFqj.mjs +0 -23
- package/dist/mode-CkmOhFqj.mjs.map +0 -1
- package/dist/node-sqlite-compat-vpVaILnb.mjs +0 -46
- package/dist/node-sqlite-compat-vpVaILnb.mjs.map +0 -1
- package/dist/normalize-dChXQjwS.mjs +0 -191
- package/dist/normalize-dChXQjwS.mjs.map +0 -1
- package/dist/oauth-authorization-DZ-R-hmx.mjs +0 -274
- package/dist/oauth-authorization-DZ-R-hmx.mjs.map +0 -1
- package/dist/oauth-clients-BMPA8vjl.mjs +0 -266
- package/dist/oauth-clients-BMPA8vjl.mjs.map +0 -1
- package/dist/oauth-state-store-0gIdb48-.mjs +0 -50
- package/dist/oauth-state-store-0gIdb48-.mjs.map +0 -1
- package/dist/oauth-user-lookup-ChVW4UWu.mjs +0 -26
- package/dist/oauth-user-lookup-ChVW4UWu.mjs.map +0 -1
- package/dist/object-cache-DlSVbn5Y.mjs +0 -534
- package/dist/object-cache-DlSVbn5Y.mjs.map +0 -1
- package/dist/options-D5WcorD5.mjs +0 -200
- package/dist/options-D5WcorD5.mjs.map +0 -1
- package/dist/options-DAknChnw.d.mts +0 -77
- package/dist/options-DAknChnw.d.mts.map +0 -1
- package/dist/parse-Cr379Av9.mjs +0 -81
- package/dist/parse-Cr379Av9.mjs.map +0 -1
- package/dist/parse-tj9XLNO_.d.mts +0 -165
- package/dist/parse-tj9XLNO_.d.mts.map +0 -1
- package/dist/passkey-config-BD-wMaCf.mjs +0 -46
- package/dist/passkey-config-BD-wMaCf.mjs.map +0 -1
- package/dist/patterns-Do3iqi7N.mjs +0 -145
- package/dist/patterns-Do3iqi7N.mjs.map +0 -1
- package/dist/placeholder-CubPFn_L.d.mts +0 -306
- package/dist/placeholder-CubPFn_L.d.mts.map +0 -1
- package/dist/plugins-DHurtdXQ.mjs +0 -277
- package/dist/plugins-DHurtdXQ.mjs.map +0 -1
- package/dist/policy-lyZnjpwz.mjs +0 -45
- package/dist/policy-lyZnjpwz.mjs.map +0 -1
- package/dist/portable-text-oAwodbPS.mjs +0 -286
- package/dist/portable-text-oAwodbPS.mjs.map +0 -1
- package/dist/preview-Cup2bj8c.mjs +0 -107
- package/dist/preview-Cup2bj8c.mjs.map +0 -1
- package/dist/protocol-C1CNiKX4.d.mts +0 -61
- package/dist/protocol-C1CNiKX4.d.mts.map +0 -1
- package/dist/public-submission-Cs-pFMQK.mjs +0 -245
- package/dist/public-submission-Cs-pFMQK.mjs.map +0 -1
- package/dist/public-url-BWVHsfQv.mjs +0 -101
- package/dist/public-url-BWVHsfQv.mjs.map +0 -1
- package/dist/query-D-lxiOgn.mjs +0 -890
- package/dist/query-D-lxiOgn.mjs.map +0 -1
- package/dist/query-D7kHKOws.mjs +0 -41
- package/dist/query-D7kHKOws.mjs.map +0 -1
- package/dist/rate-limit-CqJn-w4h.mjs +0 -120
- package/dist/rate-limit-CqJn-w4h.mjs.map +0 -1
- package/dist/redirect-BrChFPIu.mjs +0 -17
- package/dist/redirect-BrChFPIu.mjs.map +0 -1
- package/dist/redirect-D2Yo-b6S.mjs +0 -415
- package/dist/redirect-D2Yo-b6S.mjs.map +0 -1
- package/dist/redirects-BCiTaIQ-.mjs +0 -146
- package/dist/redirects-BCiTaIQ-.mjs.map +0 -1
- package/dist/redirects-ByItliuu.mjs +0 -644
- package/dist/redirects-ByItliuu.mjs.map +0 -1
- package/dist/registry-CkuPoZs7.mjs +0 -1222
- package/dist/registry-CkuPoZs7.mjs.map +0 -1
- package/dist/relation-XTAtOpJO.mjs +0 -334
- package/dist/relation-XTAtOpJO.mjs.map +0 -1
- package/dist/relations-B4w-G5U9.mjs +0 -309
- package/dist/relations-B4w-G5U9.mjs.map +0 -1
- package/dist/relations-O63JWBRj.mjs +0 -403
- package/dist/relations-O63JWBRj.mjs.map +0 -1
- package/dist/request-cache-DaMhSQdx.mjs +0 -104
- package/dist/request-cache-DaMhSQdx.mjs.map +0 -1
- package/dist/request-meta-C8yl_sIs.mjs +0 -141
- package/dist/request-meta-C8yl_sIs.mjs.map +0 -1
- package/dist/resolve-BJIS8wKr.mjs +0 -199
- package/dist/resolve-BJIS8wKr.mjs.map +0 -1
- package/dist/route-wire-D66L2oaZ.mjs +0 -197
- package/dist/route-wire-D66L2oaZ.mjs.map +0 -1
- package/dist/routes-DYsTe-oR.mjs +0 -321
- package/dist/routes-DYsTe-oR.mjs.map +0 -1
- package/dist/runner-3gfxRsJG.d.mts +0 -68
- package/dist/runner-3gfxRsJG.d.mts.map +0 -1
- package/dist/runner-ClrleR8A.mjs +0 -5502
- package/dist/runner-ClrleR8A.mjs.map +0 -1
- package/dist/schema-CPhPM9Do.mjs +0 -420
- package/dist/schema-CPhPM9Do.mjs.map +0 -1
- package/dist/schema-DEERRrKS.mjs +0 -9
- package/dist/schema-DEERRrKS.mjs.map +0 -1
- package/dist/scopes-Bn8_rCSt.mjs +0 -27
- package/dist/scopes-Bn8_rCSt.mjs.map +0 -1
- package/dist/search-lami_Ota.mjs +0 -448
- package/dist/search-lami_Ota.mjs.map +0 -1
- package/dist/secrets-DNgVgz_e.mjs +0 -341
- package/dist/secrets-DNgVgz_e.mjs.map +0 -1
- package/dist/sections-BIpd4Cxf.mjs +0 -346
- package/dist/sections-BIpd4Cxf.mjs.map +0 -1
- package/dist/seo-BtU70b7l.mjs +0 -114
- package/dist/seo-BtU70b7l.mjs.map +0 -1
- package/dist/seo-_4qmazxz.mjs +0 -133
- package/dist/seo-_4qmazxz.mjs.map +0 -1
- package/dist/service-Bpy5iTX0.mjs +0 -150
- package/dist/service-Bpy5iTX0.mjs.map +0 -1
- package/dist/session-user-BQeS2Mrb.mjs +0 -51
- package/dist/session-user-BQeS2Mrb.mjs.map +0 -1
- package/dist/settings-DmroR53o.mjs +0 -420
- package/dist/settings-DmroR53o.mjs.map +0 -1
- package/dist/settings-g2F2a3Ub.mjs +0 -51
- package/dist/settings-g2F2a3Ub.mjs.map +0 -1
- package/dist/setup-complete-BrZaXpVV.mjs +0 -26
- package/dist/setup-complete-BrZaXpVV.mjs.map +0 -1
- package/dist/setup-nonce-Cb9-884O.mjs +0 -25
- package/dist/setup-nonce-Cb9-884O.mjs.map +0 -1
- package/dist/site-url-DjhYCaep.mjs +0 -16
- package/dist/site-url-DjhYCaep.mjs.map +0 -1
- package/dist/snapshot-C32Xuv3o.mjs +0 -233
- package/dist/snapshot-C32Xuv3o.mjs.map +0 -1
- package/dist/ssrf-Co1GGFZz.mjs +0 -406
- package/dist/ssrf-Co1GGFZz.mjs.map +0 -1
- package/dist/state-C7gCoiHr.mjs +0 -153
- package/dist/state-C7gCoiHr.mjs.map +0 -1
- package/dist/status-DLoBmcDz.mjs +0 -30
- package/dist/status-DLoBmcDz.mjs.map +0 -1
- package/dist/storage-query-CPctdMKX.d.mts +0 -1519
- package/dist/storage-query-CPctdMKX.d.mts.map +0 -1
- package/dist/target-CUKlGrXb.mjs +0 -27
- package/dist/target-CUKlGrXb.mjs.map +0 -1
- package/dist/taxonomies-BpqpXJUE.mjs +0 -707
- package/dist/taxonomies-BpqpXJUE.mjs.map +0 -1
- package/dist/taxonomies-ClCo4IGO.mjs +0 -899
- package/dist/taxonomies-ClCo4IGO.mjs.map +0 -1
- package/dist/taxonomy-Dj1vpw5E.mjs +0 -508
- package/dist/taxonomy-Dj1vpw5E.mjs.map +0 -1
- package/dist/tokens-Ns02GAma.mjs +0 -171
- package/dist/tokens-Ns02GAma.mjs.map +0 -1
- package/dist/transport-B8P1xsqk.mjs +0 -136
- package/dist/transport-B8P1xsqk.mjs.map +0 -1
- package/dist/transport-BLHZZcD_.d.mts +0 -42
- package/dist/transport-BLHZZcD_.d.mts.map +0 -1
- package/dist/trusted-proxy-Cg7SuD15.mjs +0 -51
- package/dist/trusted-proxy-Cg7SuD15.mjs.map +0 -1
- package/dist/turnstile-DWCSh_Qc.mjs +0 -53
- package/dist/turnstile-DWCSh_Qc.mjs.map +0 -1
- package/dist/types-B3RkqvDW.mjs +0 -156
- package/dist/types-B3RkqvDW.mjs.map +0 -1
- package/dist/types-BtuppOTV.mjs +0 -16
- package/dist/types-BtuppOTV.mjs.map +0 -1
- package/dist/types-CCR3ivXE.d.mts +0 -363
- package/dist/types-CCR3ivXE.d.mts.map +0 -1
- package/dist/types-CSHgU_-_.mjs +0 -18
- package/dist/types-CSHgU_-_.mjs.map +0 -1
- package/dist/types-CbwqGOXm.d.mts +0 -766
- package/dist/types-CbwqGOXm.d.mts.map +0 -1
- package/dist/types-D4RGIc2I.d.mts +0 -198
- package/dist/types-D4RGIc2I.d.mts.map +0 -1
- package/dist/types-DEHidMEk.d.mts +0 -1637
- package/dist/types-DEHidMEk.d.mts.map +0 -1
- package/dist/types-DQeU2SR7.d.mts +0 -279
- package/dist/types-DQeU2SR7.d.mts.map +0 -1
- package/dist/types-DxQWoQLA.d.mts +0 -264
- package/dist/types-DxQWoQLA.d.mts.map +0 -1
- package/dist/types-FBBnGZ2Y.d.mts +0 -198
- package/dist/types-FBBnGZ2Y.d.mts.map +0 -1
- package/dist/types-ZCnlropY.mjs +0 -69
- package/dist/types-ZCnlropY.mjs.map +0 -1
- package/dist/types-_Qtyawiy.d.mts +0 -124
- package/dist/types-_Qtyawiy.d.mts.map +0 -1
- package/dist/types-gC6FAoa_.d.mts +0 -75
- package/dist/types-gC6FAoa_.d.mts.map +0 -1
- package/dist/types-k--LneIF.mjs +0 -22
- package/dist/types-k--LneIF.mjs.map +0 -1
- package/dist/upload-attempts-2xdnoKGe.mjs +0 -27
- package/dist/upload-attempts-2xdnoKGe.mjs.map +0 -1
- package/dist/url-pattern-3m3reMzr.mjs +0 -33
- package/dist/url-pattern-3m3reMzr.mjs.map +0 -1
- package/dist/user-DroRntkx.mjs +0 -171
- package/dist/user-DroRntkx.mjs.map +0 -1
- package/dist/utils-CC2oNGV8.mjs +0 -435
- package/dist/utils-CC2oNGV8.mjs.map +0 -1
- package/dist/validate-BCP9HNDn.mjs +0 -384
- package/dist/validate-BCP9HNDn.mjs.map +0 -1
- package/dist/validate-CyQ7I3xF.d.mts +0 -410
- package/dist/validate-CyQ7I3xF.d.mts.map +0 -1
- package/dist/validation-DBy6WF94.mjs +0 -216
- package/dist/validation-DBy6WF94.mjs.map +0 -1
- package/dist/version-B57E4Uo7.mjs +0 -7
- package/dist/version-B57E4Uo7.mjs.map +0 -1
- package/dist/widgets-wQ7Xcgq8.mjs +0 -126
- package/dist/widgets-wQ7Xcgq8.mjs.map +0 -1
- package/dist/wxr-taxonomies-DIHfvEDt.mjs +0 -406
- package/dist/wxr-taxonomies-DIHfvEDt.mjs.map +0 -1
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts +0 -34
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts.map +0 -1
- package/dist/zod-generator-D_yHIWfs.mjs +0 -329
- package/dist/zod-generator-D_yHIWfs.mjs.map +0 -1
- /package/dist/{ssrf-BRpTDMV6.mjs → ssrf-DpBH7aOt.mjs} +0 -0
package/dist/cli/index.mjs
CHANGED
|
@@ -1,62 +1,76 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as getMigrationStatus, c as formatDatetimeStorageReport, i as getExactMigrationStatus, l as scanDatetimeStorage, s as runMigrations, u as __exportAll } from "../runner-
|
|
2
|
+
import { a as getMigrationStatus, c as formatDatetimeStorageReport, i as getExactMigrationStatus, l as scanDatetimeStorage, s as runMigrations, u as __exportAll } from "../runner-1y4J9fJB.mjs";
|
|
3
3
|
import { t as EmDashDatabaseError } from "../errors-9P_FDrJ_.mjs";
|
|
4
4
|
import { n as isMissingTableError } from "../db-errors-CBD5yMro.mjs";
|
|
5
5
|
import { busyLockHeldSince, migrationLockHeldMessage } from "../database/migration-lock.mjs";
|
|
6
6
|
import { t as validateIdentifier } from "../validate-DANX1-Qi.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { i as isI18nEnabled, r as getI18nConfig } from "../config-
|
|
7
|
+
import { m as listTablesLike } from "../dialect-helpers-7_IqPdh9.mjs";
|
|
8
|
+
import { i as isI18nEnabled, r as getI18nConfig } from "../config-CvmjJcVw.mjs";
|
|
9
9
|
import "../datetime-normalization-PeiEdcRY.mjs";
|
|
10
10
|
import "../after-PcEvMY_6.mjs";
|
|
11
|
-
import { t as OptionsRepository } from "../options-
|
|
11
|
+
import { t as OptionsRepository } from "../options-DhrI7eMv.mjs";
|
|
12
12
|
import { a as encodeBase64url } from "../base64-DvnNgP7e.mjs";
|
|
13
|
-
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-
|
|
14
|
-
import { t as ContentRepository } from "../content-
|
|
15
|
-
import "../object-cache-
|
|
13
|
+
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-CIi0nFiR.mjs";
|
|
14
|
+
import { t as ContentRepository } from "../content-DFaIEDj9.mjs";
|
|
15
|
+
import "../object-cache-CqWNY5uP.mjs";
|
|
16
16
|
import { n as slugify } from "../slugify-T5GHH42D.mjs";
|
|
17
17
|
import "../types-BkUg2yHx.mjs";
|
|
18
|
-
import { t as MediaRepository } from "../media-
|
|
19
|
-
import { t as TaxonomyRepository } from "../taxonomy-
|
|
20
|
-
import "../resolve-
|
|
21
|
-
import "../redirect-
|
|
22
|
-
import "../request-cache-
|
|
23
|
-
import "../byline-registry-
|
|
24
|
-
import "../field-defs-cache-
|
|
25
|
-
import { t as BylineRepository } from "../byline-
|
|
26
|
-
import { t as imageSize } from "../dist-
|
|
27
|
-
import "../fts-manager-
|
|
18
|
+
import { t as MediaRepository } from "../media-Qp5S3eH3.mjs";
|
|
19
|
+
import { t as TaxonomyRepository } from "../taxonomy-C3Fu1YeH.mjs";
|
|
20
|
+
import "../resolve-2WbQsCvT.mjs";
|
|
21
|
+
import "../redirect-iJf5fltD.mjs";
|
|
22
|
+
import "../request-cache-DzLYKm_x.mjs";
|
|
23
|
+
import "../byline-registry-gnKscbQX.mjs";
|
|
24
|
+
import "../field-defs-cache-HIgBbqZZ.mjs";
|
|
25
|
+
import { t as BylineRepository } from "../byline-DYmkXqvo.mjs";
|
|
26
|
+
import { t as imageSize } from "../dist-BNwANFJR.mjs";
|
|
27
|
+
import "../fts-manager-S-K0laoS.mjs";
|
|
28
|
+
import { f as parseTaxonomyCollections, m as selectTaxonomyDefs } from "../loader-BzqeR1ZN.mjs";
|
|
28
29
|
import { kyselyLogOption } from "../database/instrumentation.mjs";
|
|
29
|
-
import "../
|
|
30
|
-
import "../
|
|
31
|
-
import "../
|
|
32
|
-
import "../
|
|
33
|
-
import "../collection-deletion-
|
|
34
|
-
import "../
|
|
35
|
-
import
|
|
36
|
-
import "../
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import "../
|
|
40
|
-
import "../
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import "../
|
|
45
|
-
import { t as
|
|
30
|
+
import "../collection-slugs-cache-CjGk__zp.mjs";
|
|
31
|
+
import "../capture-triggers-kJyl_yyM.mjs";
|
|
32
|
+
import "../activation-LOkDM5WT.mjs";
|
|
33
|
+
import { a as SchemaRegistry, t as BlockTypeRegistry } from "../block-type-registry-DUI_3KxT.mjs";
|
|
34
|
+
import "../collection-deletion-BIm28mo3.mjs";
|
|
35
|
+
import { r as isTransferError, t as TransferError } from "../errors-DgE1zJGG.mjs";
|
|
36
|
+
import "../canonical-YhEQezjg.mjs";
|
|
37
|
+
import { d as sha256Hex, i as createSha256, s as packageDigest } from "../digest-BarSh-pN.mjs";
|
|
38
|
+
import "../hash-SDAW6zC-.mjs";
|
|
39
|
+
import "../zod-generator-D6uE4WiS.mjs";
|
|
40
|
+
import "../block-values-C_VIPr5t.mjs";
|
|
41
|
+
import "../settings-DYidIB26.mjs";
|
|
42
|
+
import "../settings-CgjRWGW9.mjs";
|
|
43
|
+
import { a as pluginManifestBaseSchema } from "../manifest-schema-CY3zng_M.mjs";
|
|
44
|
+
import { i as isDeprecatedCapability, n as capabilitiesToDeclaredAccess$1, r as declaredAccessToCapabilities$1, t as CAPABILITY_RENAMES } from "../types-BZakh7Ym.mjs";
|
|
45
|
+
import "../ssrf-CJUnJymJ.mjs";
|
|
46
|
+
import { t as applySeed } from "../apply-CoT603H3.mjs";
|
|
47
|
+
import "../ssrf-DpBH7aOt.mjs";
|
|
48
|
+
import { n as validateSeed } from "../validate-CHosPEhs.mjs";
|
|
49
|
+
import { a as MigrationManifestValidationError, c as normalizeAstroI18n, i as getMigrationIntegrationMetadata, n as MIGRATION_CONFIG_SYMBOL, s as validateMigrationManifest, t as buildMigrationManifest } from "../manifest-builder-B8zR-73J.mjs";
|
|
50
|
+
import "../identity-IyNWwXr6.mjs";
|
|
51
|
+
import { t as openNodeSqliteDatabase } from "../node-sqlite-compat-CONMsl-x.mjs";
|
|
46
52
|
import { LocalStorage } from "../storage/local.mjs";
|
|
47
|
-
import { t as convertDataForRead } from "../portable-text-
|
|
53
|
+
import { t as convertDataForRead } from "../portable-text-5O_ZGUjB.mjs";
|
|
48
54
|
import { createHeaderAwareFetch, customHeadersInterceptor, getCachedAccessToken, isAccessRedirect, resolveCustomHeaders, runCloudflaredLogin } from "../client/cf-access.mjs";
|
|
49
|
-
import { EmDashClient } from "../client/index.mjs";
|
|
55
|
+
import { EmDashApiError, EmDashClient } from "../client/index.mjs";
|
|
56
|
+
import { a as parseIndexLine, n as unpackSitePackage, o as parseManifest, r as decodeUtf8, t as packSitePackage } from "../tar-_1AgTYFu.mjs";
|
|
57
|
+
import "../kinds-CRu_T5T5.mjs";
|
|
58
|
+
import { t as MANIFEST_PATH } from "../paths-JxokKIbr.mjs";
|
|
59
|
+
import "../transformations-9gfpwY65.mjs";
|
|
60
|
+
import "../version-BRZXVifl.mjs";
|
|
61
|
+
import { r as verifyReceiptDigest } from "../receipt-B4wJj5Jq.mjs";
|
|
50
62
|
import { createRequire } from "node:module";
|
|
51
63
|
import { Kysely, SqliteDialect, sql } from "kysely";
|
|
52
64
|
import { z } from "zod";
|
|
65
|
+
import { ulid } from "ulidx";
|
|
53
66
|
import { extractManifestRoute, extractRouteOptions, isJsonPostRouteContract } from "@emdash-cms/plugin-types";
|
|
54
67
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
55
68
|
import { pathToFileURL } from "node:url";
|
|
56
69
|
import { createHash } from "node:crypto";
|
|
57
|
-
import { access, copyFile, mkdir, readFile, readdir, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
70
|
+
import { access, copyFile, mkdir, readFile, readdir, rename, rm, stat, symlink, writeFile } from "node:fs/promises";
|
|
58
71
|
import { basename, dirname, extname, isAbsolute, join, parse, resolve } from "node:path";
|
|
59
|
-
import { createWriteStream, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
72
|
+
import { createReadStream, createWriteStream, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
73
|
+
import { Readable, Writable } from "node:stream";
|
|
60
74
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
61
75
|
import consola, { consola as consola$1 } from "consola";
|
|
62
76
|
import pc from "picocolors";
|
|
@@ -268,7 +282,8 @@ function removeMarketplaceCredential(registryUrl) {
|
|
|
268
282
|
//#region src/cli/client-factory.ts
|
|
269
283
|
var client_factory_exports = /* @__PURE__ */ __exportAll({
|
|
270
284
|
connectionArgs: () => connectionArgs,
|
|
271
|
-
createClientFromArgs: () => createClientFromArgs
|
|
285
|
+
createClientFromArgs: () => createClientFromArgs,
|
|
286
|
+
resolveBaseUrl: () => resolveBaseUrl
|
|
272
287
|
});
|
|
273
288
|
/**
|
|
274
289
|
* Shared connection args for all CLI commands that talk to an EmDash instance.
|
|
@@ -295,6 +310,10 @@ const connectionArgs = {
|
|
|
295
310
|
description: "Output as JSON"
|
|
296
311
|
}
|
|
297
312
|
};
|
|
313
|
+
/** The instance URL from `--url`, `EMDASH_URL`, or the local dev default. */
|
|
314
|
+
function resolveBaseUrl(args) {
|
|
315
|
+
return args.url || process.env["EMDASH_URL"] || "http://localhost:4321";
|
|
316
|
+
}
|
|
298
317
|
/**
|
|
299
318
|
* Create an EmDashClient from CLI args, env vars, and stored credentials.
|
|
300
319
|
*
|
|
@@ -310,7 +329,7 @@ const connectionArgs = {
|
|
|
310
329
|
* 3. --header CLI flags
|
|
311
330
|
*/
|
|
312
331
|
function createClientFromArgs(args) {
|
|
313
|
-
const baseUrl = args
|
|
332
|
+
const baseUrl = resolveBaseUrl(args);
|
|
314
333
|
let token = args.token || process.env["EMDASH_TOKEN"];
|
|
315
334
|
const isLocal = baseUrl.includes("localhost") || baseUrl.includes("127.0.0.1");
|
|
316
335
|
const cred = !token ? getCredentials(baseUrl) : null;
|
|
@@ -1427,6 +1446,7 @@ async function exportSeed(db, withContent) {
|
|
|
1427
1446
|
}
|
|
1428
1447
|
};
|
|
1429
1448
|
seed.settings = await exportSettings(db);
|
|
1449
|
+
seed.blockTypes = await exportBlockTypes(db);
|
|
1430
1450
|
seed.collections = await exportCollections(db);
|
|
1431
1451
|
const { i18nEnabled, defaultLocale } = await detectLocaleInfo(db, seed.collections);
|
|
1432
1452
|
if (defaultLocale) seed.defaultLocale = defaultLocale;
|
|
@@ -1543,6 +1563,20 @@ async function exportSettings(db) {
|
|
|
1543
1563
|
}
|
|
1544
1564
|
return Object.keys(settings).length > 0 ? settings : void 0;
|
|
1545
1565
|
}
|
|
1566
|
+
async function exportBlockTypes(db) {
|
|
1567
|
+
return (await new BlockTypeRegistry(db).listBlockTypes()).map((blockType) => ({
|
|
1568
|
+
slug: blockType.slug,
|
|
1569
|
+
label: blockType.label,
|
|
1570
|
+
description: blockType.description,
|
|
1571
|
+
icon: blockType.icon,
|
|
1572
|
+
category: blockType.category,
|
|
1573
|
+
currentVersion: blockType.currentVersion,
|
|
1574
|
+
versions: blockType.versions.map((version) => ({
|
|
1575
|
+
version: version.version,
|
|
1576
|
+
fields: version.fields
|
|
1577
|
+
}))
|
|
1578
|
+
}));
|
|
1579
|
+
}
|
|
1546
1580
|
/**
|
|
1547
1581
|
* Export collections and their fields
|
|
1548
1582
|
*/
|
|
@@ -1588,10 +1622,10 @@ async function exportCollections(db) {
|
|
|
1588
1622
|
* Export taxonomy definitions and terms
|
|
1589
1623
|
*/
|
|
1590
1624
|
async function exportTaxonomies(db, i18nEnabled) {
|
|
1591
|
-
const defs = await db
|
|
1625
|
+
const defs = await selectTaxonomyDefs(db).orderBy("d.name").orderBy("d.locale").execute();
|
|
1592
1626
|
const result = [];
|
|
1593
1627
|
const termRepo = new TaxonomyRepository(db);
|
|
1594
|
-
const
|
|
1628
|
+
const anchorByName = /* @__PURE__ */ new Map();
|
|
1595
1629
|
for (const def of defs) {
|
|
1596
1630
|
const defSeedId = i18nEnabled && def.locale ? `tax:${def.name}:${def.locale}` : `tax:${def.name}`;
|
|
1597
1631
|
const terms = await termRepo.findByName(def.name, { locale: def.locale });
|
|
@@ -1623,17 +1657,17 @@ async function exportTaxonomies(db, i18nEnabled) {
|
|
|
1623
1657
|
id: defSeedId,
|
|
1624
1658
|
name: def.name,
|
|
1625
1659
|
label: def.label,
|
|
1626
|
-
labelSingular: def.label_singular || void 0
|
|
1627
|
-
hierarchical: def.hierarchical === 1,
|
|
1628
|
-
collections: def.collections ? JSON.parse(def.collections) : []
|
|
1660
|
+
labelSingular: def.label_singular || void 0
|
|
1629
1661
|
};
|
|
1630
1662
|
if (i18nEnabled && def.locale) {
|
|
1631
1663
|
taxonomy.locale = def.locale;
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1664
|
+
const anchor = anchorByName.get(def.name);
|
|
1665
|
+
if (anchor) taxonomy.translationOf = anchor;
|
|
1666
|
+
else anchorByName.set(def.name, defSeedId);
|
|
1667
|
+
}
|
|
1668
|
+
if (!taxonomy.translationOf) {
|
|
1669
|
+
taxonomy.hierarchical = def.hierarchical === 1;
|
|
1670
|
+
taxonomy.collections = parseTaxonomyCollections(def.collections);
|
|
1637
1671
|
}
|
|
1638
1672
|
if (seedTerms.length > 0) taxonomy.terms = seedTerms;
|
|
1639
1673
|
result.push(taxonomy);
|
|
@@ -3528,16 +3562,16 @@ function totalBundleBytes(entries) {
|
|
|
3528
3562
|
function validateBundleSize(entries) {
|
|
3529
3563
|
const violations = [];
|
|
3530
3564
|
const total = totalBundleBytes(entries);
|
|
3531
|
-
if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes(total)} exceeds maximum of ${formatBytes(MAX_BUNDLE_SIZE)}.`);
|
|
3565
|
+
if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes$1(total)} exceeds maximum of ${formatBytes$1(MAX_BUNDLE_SIZE)}.`);
|
|
3532
3566
|
if (entries.length > MAX_FILE_COUNT) violations.push(`Bundle contains ${entries.length} files, exceeds maximum of ${MAX_FILE_COUNT}.`);
|
|
3533
3567
|
const oversized = entries.filter((e) => e.bytes > MAX_FILE_SIZE).toSorted((a, b) => a.name.localeCompare(b.name));
|
|
3534
|
-
for (const e of oversized) violations.push(`File ${e.name} is ${formatBytes(e.bytes)}, exceeds per-file maximum of ${formatBytes(MAX_FILE_SIZE)}.`);
|
|
3568
|
+
for (const e of oversized) violations.push(`File ${e.name} is ${formatBytes$1(e.bytes)}, exceeds per-file maximum of ${formatBytes$1(MAX_FILE_SIZE)}.`);
|
|
3535
3569
|
return violations;
|
|
3536
3570
|
}
|
|
3537
3571
|
/**
|
|
3538
3572
|
* Render a byte count as a human-friendly string (e.g. "256.0 KB").
|
|
3539
3573
|
*/
|
|
3540
|
-
function formatBytes(n) {
|
|
3574
|
+
function formatBytes$1(n) {
|
|
3541
3575
|
if (n < 1024) return `${n} B`;
|
|
3542
3576
|
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
3543
3577
|
return `${(n / 1024 / 1024).toFixed(2)} MB`;
|
|
@@ -3892,7 +3926,7 @@ const bundleCommand = defineCommand({
|
|
|
3892
3926
|
if (sizeViolations.length > 0) {
|
|
3893
3927
|
for (const v of sizeViolations) consola.error(v);
|
|
3894
3928
|
hasErrors = true;
|
|
3895
|
-
} else consola.info(`Bundle size: ${formatBytes(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
|
|
3929
|
+
} else consola.info(`Bundle size: ${formatBytes$1(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
|
|
3896
3930
|
if (hasErrors) {
|
|
3897
3931
|
consola.error("Bundle validation failed");
|
|
3898
3932
|
process.exit(1);
|
|
@@ -5259,7 +5293,7 @@ const seedCommand = defineCommand({
|
|
|
5259
5293
|
if (result.settings.applied > 0) consola.info(`Settings: ${result.settings.applied} applied`);
|
|
5260
5294
|
if (result.collections.created > 0 || result.collections.skipped > 0 || result.collections.updated > 0) consola.info(`Collections: ${result.collections.created} created, ${result.collections.skipped} skipped, ${result.collections.updated} updated`);
|
|
5261
5295
|
if (result.fields.created > 0 || result.fields.skipped > 0 || result.fields.updated > 0) consola.info(`Fields: ${result.fields.created} created, ${result.fields.skipped} skipped, ${result.fields.updated} updated`);
|
|
5262
|
-
if (result.taxonomies.created > 0 || result.taxonomies.terms > 0) consola.info(`Taxonomies: ${result.taxonomies.created} created, ${result.taxonomies.terms} terms`);
|
|
5296
|
+
if (result.taxonomies.created > 0 || result.taxonomies.skipped > 0 || result.taxonomies.terms > 0) consola.info(`Taxonomies: ${result.taxonomies.created} created, ${result.taxonomies.skipped} skipped, ${result.taxonomies.terms} terms`);
|
|
5263
5297
|
if (result.bylines.created > 0 || result.bylines.skipped > 0 || result.bylines.updated > 0) consola.info(`Bylines: ${result.bylines.created} created, ${result.bylines.skipped} skipped, ${result.bylines.updated} updated`);
|
|
5264
5298
|
if (result.menus.created > 0 || result.menus.items > 0) consola.info(`Menus: ${result.menus.created} created, ${result.menus.items} items`);
|
|
5265
5299
|
if (result.widgetAreas.created > 0 || result.widgetAreas.widgets > 0) consola.info(`Widget Areas: ${result.widgetAreas.created} created, ${result.widgetAreas.widgets} widgets`);
|
|
@@ -5275,6 +5309,1386 @@ const seedCommand = defineCommand({
|
|
|
5275
5309
|
}
|
|
5276
5310
|
});
|
|
5277
5311
|
|
|
5312
|
+
//#endregion
|
|
5313
|
+
//#region src/cli/site/archive.ts
|
|
5314
|
+
/**
|
|
5315
|
+
* Reading and writing `.emdash` site package files on disk.
|
|
5316
|
+
*
|
|
5317
|
+
* Reading never trusts the archive: every entry is hashed and checked
|
|
5318
|
+
* against the manifest and the index chunks it pins before anything is
|
|
5319
|
+
* uploaded, so a damaged or tampered package fails locally.
|
|
5320
|
+
*/
|
|
5321
|
+
/** Split an index chunk into its entries. */
|
|
5322
|
+
function parseIndexChunk(bytes) {
|
|
5323
|
+
const text = decodeUtf8(bytes, "TRANSFER_MANIFEST_INVALID");
|
|
5324
|
+
if (text.length > 0 && !text.endsWith("\n")) throw new TransferError("TRANSFER_MANIFEST_INVALID", "Index chunk must end with a newline");
|
|
5325
|
+
return text.split("\n").slice(0, -1).map((line) => parseIndexLine(line));
|
|
5326
|
+
}
|
|
5327
|
+
function openArchive(path) {
|
|
5328
|
+
return Readable.toWeb(createReadStream(path));
|
|
5329
|
+
}
|
|
5330
|
+
async function readBody(body) {
|
|
5331
|
+
return new Uint8Array(await new Response(body).arrayBuffer());
|
|
5332
|
+
}
|
|
5333
|
+
function mismatch(path, kind) {
|
|
5334
|
+
return kind === "digest" ? new TransferError("TRANSFER_FILE_DIGEST_MISMATCH", "File does not match its digest", { detail: { path } }) : new TransferError("TRANSFER_FILE_SIZE_MISMATCH", "File does not have its declared size", { detail: { path } });
|
|
5335
|
+
}
|
|
5336
|
+
/** Check bytes against a declared size and digest. */
|
|
5337
|
+
async function assertFileMatches(path, bytes, expected) {
|
|
5338
|
+
if (bytes.byteLength !== expected.bytes) throw mismatch(path, "size");
|
|
5339
|
+
if (await sha256Hex(bytes) !== expected.sha256) throw mismatch(path, "digest");
|
|
5340
|
+
}
|
|
5341
|
+
async function hashBody(body) {
|
|
5342
|
+
const hasher = await createSha256();
|
|
5343
|
+
let bytes = 0;
|
|
5344
|
+
await body.pipeTo(new WritableStream({ write(chunk) {
|
|
5345
|
+
bytes += chunk.byteLength;
|
|
5346
|
+
hasher.update(chunk);
|
|
5347
|
+
} }));
|
|
5348
|
+
return {
|
|
5349
|
+
bytes,
|
|
5350
|
+
sha256: await hasher.digest()
|
|
5351
|
+
};
|
|
5352
|
+
}
|
|
5353
|
+
/** Whether the file at `diskPath` exists and has exactly the expected size and digest. */
|
|
5354
|
+
async function diskFileMatches(diskPath, expected) {
|
|
5355
|
+
let info;
|
|
5356
|
+
try {
|
|
5357
|
+
info = await stat(diskPath);
|
|
5358
|
+
} catch {
|
|
5359
|
+
return false;
|
|
5360
|
+
}
|
|
5361
|
+
if (!info.isFile() || info.size !== expected.bytes) return false;
|
|
5362
|
+
return (await hashBody(openArchive(diskPath))).sha256 === expected.sha256;
|
|
5363
|
+
}
|
|
5364
|
+
/**
|
|
5365
|
+
* Stream `body` to `diskPath`, verifying it against the package file `path`
|
|
5366
|
+
* declares. The file appears at `diskPath` only once it is complete and
|
|
5367
|
+
* verified.
|
|
5368
|
+
*/
|
|
5369
|
+
async function saveVerifiedFile(path, body, expected, diskPath) {
|
|
5370
|
+
const temporary = `${diskPath}.download`;
|
|
5371
|
+
const hasher = await createSha256();
|
|
5372
|
+
let bytes = 0;
|
|
5373
|
+
const verify = new TransformStream({ transform(chunk, controller) {
|
|
5374
|
+
bytes += chunk.byteLength;
|
|
5375
|
+
if (bytes > expected.bytes) throw mismatch(path, "size");
|
|
5376
|
+
hasher.update(chunk);
|
|
5377
|
+
controller.enqueue(chunk);
|
|
5378
|
+
} });
|
|
5379
|
+
try {
|
|
5380
|
+
await body.pipeThrough(verify).pipeTo(Writable.toWeb(createWriteStream(temporary)));
|
|
5381
|
+
if (bytes !== expected.bytes) throw mismatch(path, "size");
|
|
5382
|
+
if (await hasher.digest() !== expected.sha256) throw mismatch(path, "digest");
|
|
5383
|
+
await rename(temporary, diskPath);
|
|
5384
|
+
} catch (error) {
|
|
5385
|
+
await rm(temporary, { force: true });
|
|
5386
|
+
throw error;
|
|
5387
|
+
}
|
|
5388
|
+
}
|
|
5389
|
+
/**
|
|
5390
|
+
* Read a package file end to end and verify it: the manifest, every index
|
|
5391
|
+
* chunk the manifest pins, and every file the index lists, each by size and
|
|
5392
|
+
* SHA-256. Fails with a `TransferError` naming the first bad path.
|
|
5393
|
+
*/
|
|
5394
|
+
async function scanSitePackage(archivePath) {
|
|
5395
|
+
let manifestBytes;
|
|
5396
|
+
let manifest;
|
|
5397
|
+
const indexRefs = /* @__PURE__ */ new Map();
|
|
5398
|
+
const declared = /* @__PURE__ */ new Map();
|
|
5399
|
+
const indexEntries = /* @__PURE__ */ new Map();
|
|
5400
|
+
const indexOf = /* @__PURE__ */ new Map();
|
|
5401
|
+
const seen = /* @__PURE__ */ new Map();
|
|
5402
|
+
await unpackSitePackage(openArchive(archivePath), async (file) => {
|
|
5403
|
+
if (file.parsed.type === "manifest") {
|
|
5404
|
+
manifestBytes = await readBody(file.body);
|
|
5405
|
+
manifest = parseManifest(manifestBytes);
|
|
5406
|
+
for (const ref of manifest.index) indexRefs.set(ref.path, {
|
|
5407
|
+
bytes: ref.bytes,
|
|
5408
|
+
sha256: ref.sha256
|
|
5409
|
+
});
|
|
5410
|
+
return;
|
|
5411
|
+
}
|
|
5412
|
+
if (file.parsed.type === "index") {
|
|
5413
|
+
const expected = indexRefs.get(file.path);
|
|
5414
|
+
if (!expected) throw new TransferError("TRANSFER_FILE_NOT_DECLARED", "Index chunk is not listed", { detail: { path: file.path } });
|
|
5415
|
+
if (file.bytes !== expected.bytes) throw mismatch(file.path, "size");
|
|
5416
|
+
const bytes = await readBody(file.body);
|
|
5417
|
+
await assertFileMatches(file.path, bytes, expected);
|
|
5418
|
+
const paths = [];
|
|
5419
|
+
for (const entry of parseIndexChunk(bytes)) {
|
|
5420
|
+
if (declared.has(entry.path)) throw new TransferError("TRANSFER_MANIFEST_INVALID", "File is listed twice", { detail: { path: entry.path } });
|
|
5421
|
+
declared.set(entry.path, {
|
|
5422
|
+
bytes: entry.bytes,
|
|
5423
|
+
sha256: entry.sha256
|
|
5424
|
+
});
|
|
5425
|
+
indexOf.set(entry.path, file.path);
|
|
5426
|
+
paths.push(entry.path);
|
|
5427
|
+
}
|
|
5428
|
+
indexEntries.set(file.path, paths);
|
|
5429
|
+
seen.set(file.path, expected);
|
|
5430
|
+
return;
|
|
5431
|
+
}
|
|
5432
|
+
seen.set(file.path, await hashBody(file.body));
|
|
5433
|
+
}, { expectedBytes: (path) => indexRefs.get(path)?.bytes ?? declared.get(path)?.bytes });
|
|
5434
|
+
if (!manifest || !manifestBytes) throw new TransferError("TRANSFER_CONTAINER_INVALID", "The package has no manifest");
|
|
5435
|
+
for (const [path, expected] of [...indexRefs, ...declared]) {
|
|
5436
|
+
const actual = seen.get(path);
|
|
5437
|
+
if (!actual) throw new TransferError("TRANSFER_FILE_MISSING", "The package is missing a file", { detail: { path } });
|
|
5438
|
+
if (actual.bytes !== expected.bytes) throw mismatch(path, "size");
|
|
5439
|
+
if (actual.sha256 !== expected.sha256) throw mismatch(path, "digest");
|
|
5440
|
+
}
|
|
5441
|
+
for (const path of seen.keys()) if (!indexRefs.has(path) && !declared.has(path)) throw new TransferError("TRANSFER_FILE_NOT_DECLARED", "File is not listed by the package", { detail: { path } });
|
|
5442
|
+
let totalBytes = manifestBytes.byteLength;
|
|
5443
|
+
for (const file of seen.values()) totalBytes += file.bytes;
|
|
5444
|
+
return {
|
|
5445
|
+
manifestBytes,
|
|
5446
|
+
manifest,
|
|
5447
|
+
packageDigest: await packageDigest(manifest),
|
|
5448
|
+
files: seen,
|
|
5449
|
+
indexEntries,
|
|
5450
|
+
indexOf,
|
|
5451
|
+
totalBytes
|
|
5452
|
+
};
|
|
5453
|
+
}
|
|
5454
|
+
/**
|
|
5455
|
+
* Stream `files` into a package file at `outputPath`. Writes go to a
|
|
5456
|
+
* sibling `.partial` file that replaces `outputPath` only once the whole
|
|
5457
|
+
* archive is written; on failure the partial file is removed.
|
|
5458
|
+
*/
|
|
5459
|
+
async function writeSitePackage(outputPath, files) {
|
|
5460
|
+
const partialPath = `${outputPath}.partial`;
|
|
5461
|
+
let bytes = 0;
|
|
5462
|
+
const counter = new TransformStream({ transform(chunk, controller) {
|
|
5463
|
+
bytes += chunk.byteLength;
|
|
5464
|
+
controller.enqueue(chunk);
|
|
5465
|
+
} });
|
|
5466
|
+
const sink = Writable.toWeb(createWriteStream(partialPath));
|
|
5467
|
+
try {
|
|
5468
|
+
await packSitePackage(files).pipeThrough(counter).pipeTo(sink);
|
|
5469
|
+
await rename(partialPath, outputPath);
|
|
5470
|
+
} catch (error) {
|
|
5471
|
+
await rm(partialPath, { force: true });
|
|
5472
|
+
throw error;
|
|
5473
|
+
}
|
|
5474
|
+
return { bytes };
|
|
5475
|
+
}
|
|
5476
|
+
|
|
5477
|
+
//#endregion
|
|
5478
|
+
//#region src/cli/site/shared.ts
|
|
5479
|
+
/**
|
|
5480
|
+
* Shared pieces of `emdash site`: errors, their user-facing messages,
|
|
5481
|
+
* retries, and progress reporting.
|
|
5482
|
+
*/
|
|
5483
|
+
/** A failure the CLI reports with a stable code, like an API error. */
|
|
5484
|
+
var SiteTransferCliError = class extends Error {
|
|
5485
|
+
constructor(code, message, details) {
|
|
5486
|
+
super(message);
|
|
5487
|
+
this.code = code;
|
|
5488
|
+
this.details = details;
|
|
5489
|
+
this.name = "SiteTransferCliError";
|
|
5490
|
+
}
|
|
5491
|
+
};
|
|
5492
|
+
const TRANSFER_MESSAGES = {
|
|
5493
|
+
TRANSFER_TARGET_NOT_EMPTY: "This site already has content. A site package can only be imported into an empty site.",
|
|
5494
|
+
TRANSFER_IMPORT_IN_PROGRESS: "Another import is in progress on this site, or an unfinished import is still blocking writes. Check it with `emdash site import status <operation-id>`.",
|
|
5495
|
+
TRANSFER_EXPORT_CONCURRENT_WRITES: "The site kept changing while it was being exported. Run the export again when the site is quiet.",
|
|
5496
|
+
TRANSFER_OPERATION_NOT_FOUND: "No transfer operation with that id exists on this site.",
|
|
5497
|
+
TRANSFER_EXPIRED: "This transfer has expired and its files were removed. Start a new export or import.",
|
|
5498
|
+
TRANSFER_IDEMPOTENCY_CONFLICT: "This site already has an import started from a different package with the same key.",
|
|
5499
|
+
TRANSFER_MANIFEST_INVALID: "The package manifest is invalid.",
|
|
5500
|
+
TRANSFER_UNSUPPORTED_FORMAT: "This package uses a format version this site does not support. Upgrade EmDash on this site.",
|
|
5501
|
+
TRANSFER_UNSUPPORTED_FEATURE: "This package needs features this site does not support. Upgrade EmDash on this site.",
|
|
5502
|
+
TRANSFER_CONTAINER_INVALID: "The file is not a valid .emdash site package.",
|
|
5503
|
+
TRANSFER_FILE_DIGEST_MISMATCH: "A package file does not match its recorded digest. The package is damaged or was modified.",
|
|
5504
|
+
TRANSFER_FILE_SIZE_MISMATCH: "A package file does not have its recorded size. The package is damaged or was modified.",
|
|
5505
|
+
TRANSFER_FILE_MISSING: "The package is missing files its manifest lists.",
|
|
5506
|
+
TRANSFER_FILE_NOT_DECLARED: "The package contains a file its manifest does not list.",
|
|
5507
|
+
TRANSFER_LIMIT_EXCEEDED: "The package exceeds a limit this site enforces.",
|
|
5508
|
+
TRANSFER_PACKAGE_DIGEST_MISMATCH: "This is not the package that was analyzed. Analyze this package with `--analyze` first.",
|
|
5509
|
+
TRANSFER_PLAN_DIGEST_MISMATCH: "The plan changed since it was reviewed. Run `emdash site import <file> --analyze` again and confirm the new plan digest.",
|
|
5510
|
+
TRANSFER_PLAN_BLOCKED: "The import plan has blockers. Run `emdash site import <file> --analyze` to see them.",
|
|
5511
|
+
TRANSFER_DECISIONS_INVALID: "The import decisions are invalid.",
|
|
5512
|
+
TRANSFER_VERIFICATION_FAILED: "The imported site did not verify against the package, so no receipt was issued. Do not use this site; import into a fresh one."
|
|
5513
|
+
};
|
|
5514
|
+
const TRANSFORMATION_LABELS = {
|
|
5515
|
+
soft_orphan_dropped: "Unused references were left out",
|
|
5516
|
+
avatar_nulled: "Some byline avatars were left out",
|
|
5517
|
+
redirect_duplicate_dropped: "Duplicate redirects were left out",
|
|
5518
|
+
media_not_ready_dropped: "Unfinished media uploads were left out",
|
|
5519
|
+
media_url_relativized: "Media links were made relative",
|
|
5520
|
+
orphan_dropped: "Records without a parent were left out",
|
|
5521
|
+
orphan_reference_nulled: "Broken references were cleared",
|
|
5522
|
+
media_ref_unlinked: "Some media links could not be matched to files",
|
|
5523
|
+
unknown_storage_key: "Some content links to media files the source site doesn't have; those links won't work",
|
|
5524
|
+
principal_mapped: "Authors will be assigned to users on this site",
|
|
5525
|
+
principal_unmapped: "Some content will have no author",
|
|
5526
|
+
seeded_scaffold_removed: "Starter content will be removed",
|
|
5527
|
+
redirect_loop_disabled: "Redirects that loop will be imported turned off",
|
|
5528
|
+
search_unsupported: "Search will be turned off for some collections",
|
|
5529
|
+
float4_rounded: "Some decimal numbers will be rounded",
|
|
5530
|
+
locale_recased: "Locales will use this site's capitalization"
|
|
5531
|
+
};
|
|
5532
|
+
/** A plain-language description of a plan transformation code. */
|
|
5533
|
+
function transformationLabel(code) {
|
|
5534
|
+
const labels = TRANSFORMATION_LABELS;
|
|
5535
|
+
return (Object.hasOwn(labels, code) ? labels[code] : void 0) ?? code;
|
|
5536
|
+
}
|
|
5537
|
+
function withServerDetail(friendly, serverMessage) {
|
|
5538
|
+
return serverMessage && !friendly.includes(serverMessage) ? `${friendly} (${serverMessage})` : friendly;
|
|
5539
|
+
}
|
|
5540
|
+
/** The code and user-facing message for any error `emdash site` can hit. */
|
|
5541
|
+
function describeError(error) {
|
|
5542
|
+
if (error instanceof EmDashApiError) {
|
|
5543
|
+
const friendly = TRANSFER_MESSAGES[error.code];
|
|
5544
|
+
return {
|
|
5545
|
+
code: error.code,
|
|
5546
|
+
message: friendly ? withServerDetail(friendly, error.message) : error.message
|
|
5547
|
+
};
|
|
5548
|
+
}
|
|
5549
|
+
if (error instanceof SiteTransferCliError) return {
|
|
5550
|
+
code: error.code,
|
|
5551
|
+
message: error.message
|
|
5552
|
+
};
|
|
5553
|
+
if (isTransferError(error)) {
|
|
5554
|
+
const friendly = TRANSFER_MESSAGES[error.code];
|
|
5555
|
+
const path = typeof error.detail?.path === "string" ? ` [${error.detail.path}]` : "";
|
|
5556
|
+
return {
|
|
5557
|
+
code: error.code,
|
|
5558
|
+
message: `${friendly ? withServerDetail(friendly, error.message) : error.message}${path}`
|
|
5559
|
+
};
|
|
5560
|
+
}
|
|
5561
|
+
return {
|
|
5562
|
+
code: "UNKNOWN_ERROR",
|
|
5563
|
+
message: error instanceof Error ? error.message : String(error)
|
|
5564
|
+
};
|
|
5565
|
+
}
|
|
5566
|
+
/** Describe a failed operation from its recorded error. */
|
|
5567
|
+
function operationError(operation) {
|
|
5568
|
+
const code = operation.errorCode ?? "TRANSFER_OPERATION_FAILED";
|
|
5569
|
+
const friendly = TRANSFER_MESSAGES[code];
|
|
5570
|
+
const base = friendly ?? `Operation ${operation.id} ended as ${operation.state}.`;
|
|
5571
|
+
return new SiteTransferCliError(code, friendly ? `${base} (operation ${operation.id} is ${operation.state})` : base, operation.errorDetail ?? void 0);
|
|
5572
|
+
}
|
|
5573
|
+
function sleepFor(runtime, ms) {
|
|
5574
|
+
if (ms <= 0) return Promise.resolve();
|
|
5575
|
+
if (runtime.sleep) return runtime.sleep(ms);
|
|
5576
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
5577
|
+
}
|
|
5578
|
+
const MAX_BACKOFF_MS = 8e3;
|
|
5579
|
+
/** Network failures, timeouts, rate limits, and server errors are worth another try. */
|
|
5580
|
+
function isTransient(error) {
|
|
5581
|
+
if (error instanceof EmDashApiError) {
|
|
5582
|
+
if (error.code === "TRANSFER_IMPORT_IN_PROGRESS") return false;
|
|
5583
|
+
return error.status === 408 || error.status === 429 || error.status >= 500;
|
|
5584
|
+
}
|
|
5585
|
+
if (error instanceof SiteTransferCliError || isTransferError(error)) return false;
|
|
5586
|
+
return error instanceof TypeError || error instanceof Error && error.name === "AbortError";
|
|
5587
|
+
}
|
|
5588
|
+
/** Run `fn`, retrying transient failures with exponential backoff. */
|
|
5589
|
+
async function withRetry(runtime, label, fn) {
|
|
5590
|
+
const attempts = runtime.retry?.attempts ?? 5;
|
|
5591
|
+
const base = runtime.retry?.baseDelayMs ?? 500;
|
|
5592
|
+
for (let attempt = 1;; attempt++) try {
|
|
5593
|
+
return await fn();
|
|
5594
|
+
} catch (error) {
|
|
5595
|
+
if (attempt >= attempts || !isTransient(error)) throw error;
|
|
5596
|
+
const delay = Math.min(base * 2 ** (attempt - 1), MAX_BACKOFF_MS);
|
|
5597
|
+
runtime.reporter.warn(`${label} failed (${describeError(error).message}); retrying in ${Math.round(delay / 100) / 10}s`);
|
|
5598
|
+
await sleepFor(runtime, delay);
|
|
5599
|
+
}
|
|
5600
|
+
}
|
|
5601
|
+
/** Emits a progress line at most once per interval, and always when the label changes. */
|
|
5602
|
+
function createProgressLogger(runtime, intervalMs = 2e3) {
|
|
5603
|
+
let lastLabel;
|
|
5604
|
+
let lastAt = 0;
|
|
5605
|
+
return (label, detail) => {
|
|
5606
|
+
const now = Date.now();
|
|
5607
|
+
if (label === lastLabel && now - lastAt < intervalMs) return;
|
|
5608
|
+
lastLabel = label;
|
|
5609
|
+
lastAt = now;
|
|
5610
|
+
runtime.reporter.info(detail ? `${label}: ${detail}` : label);
|
|
5611
|
+
};
|
|
5612
|
+
}
|
|
5613
|
+
function formatBytes(bytes) {
|
|
5614
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
5615
|
+
const units = [
|
|
5616
|
+
"KiB",
|
|
5617
|
+
"MiB",
|
|
5618
|
+
"GiB",
|
|
5619
|
+
"TiB"
|
|
5620
|
+
];
|
|
5621
|
+
let value = bytes / 1024;
|
|
5622
|
+
let unit = 0;
|
|
5623
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
5624
|
+
value /= 1024;
|
|
5625
|
+
unit++;
|
|
5626
|
+
}
|
|
5627
|
+
return `${value.toFixed(1)} ${units[unit]}`;
|
|
5628
|
+
}
|
|
5629
|
+
function formatProgress(progress) {
|
|
5630
|
+
if (!progress) return void 0;
|
|
5631
|
+
const bytes = progress.bytesTotal !== void 0 && progress.bytesDone !== void 0 ? ` (${formatBytes(progress.bytesDone)} / ${formatBytes(progress.bytesTotal)})` : "";
|
|
5632
|
+
return `${progress.done}/${progress.total}${bytes}`;
|
|
5633
|
+
}
|
|
5634
|
+
|
|
5635
|
+
//#endregion
|
|
5636
|
+
//#region src/cli/site/export.ts
|
|
5637
|
+
/**
|
|
5638
|
+
* `emdash site export`: drive a server-side export to completion, then
|
|
5639
|
+
* download its files one by one and assemble the `.emdash` package locally.
|
|
5640
|
+
*
|
|
5641
|
+
* A sidecar `<output>.partial.json` holds the idempotency key and operation
|
|
5642
|
+
* id, so re-running the same command after a crash or disconnect resumes the
|
|
5643
|
+
* same export instead of starting another. Downloaded files are kept in
|
|
5644
|
+
* `<output>.parts/` until the package is assembled, so a re-run only
|
|
5645
|
+
* downloads the files it does not have yet.
|
|
5646
|
+
*/
|
|
5647
|
+
const DOWNLOAD_CONCURRENCY = 4;
|
|
5648
|
+
const sidecarSchema = z.object({
|
|
5649
|
+
version: z.literal(1),
|
|
5650
|
+
baseUrl: z.string(),
|
|
5651
|
+
comments: z.boolean(),
|
|
5652
|
+
idempotencyKey: z.string(),
|
|
5653
|
+
operationId: z.string().nullable()
|
|
5654
|
+
});
|
|
5655
|
+
function exportSidecarPath(outputPath) {
|
|
5656
|
+
return `${outputPath}.partial.json`;
|
|
5657
|
+
}
|
|
5658
|
+
async function readSidecar(path) {
|
|
5659
|
+
let text;
|
|
5660
|
+
try {
|
|
5661
|
+
text = await readFile(path, "utf8");
|
|
5662
|
+
} catch {
|
|
5663
|
+
return null;
|
|
5664
|
+
}
|
|
5665
|
+
try {
|
|
5666
|
+
const parsed = sidecarSchema.safeParse(JSON.parse(text));
|
|
5667
|
+
return parsed.success ? parsed.data : null;
|
|
5668
|
+
} catch {
|
|
5669
|
+
return null;
|
|
5670
|
+
}
|
|
5671
|
+
}
|
|
5672
|
+
async function writeSidecar(path, sidecar) {
|
|
5673
|
+
await writeFile(path, `${JSON.stringify(sidecar, null, " ")}\n`);
|
|
5674
|
+
}
|
|
5675
|
+
async function startOrResume(input, runtime) {
|
|
5676
|
+
const sidecarPath = exportSidecarPath(input.outputPath);
|
|
5677
|
+
let sidecar = await readSidecar(sidecarPath);
|
|
5678
|
+
if (sidecar && (sidecar.baseUrl !== input.baseUrl || sidecar.comments !== input.comments)) {
|
|
5679
|
+
runtime.reporter.warn(`Ignoring ${sidecarPath}: it belongs to an export with different options or from another site.`);
|
|
5680
|
+
sidecar = null;
|
|
5681
|
+
}
|
|
5682
|
+
if (sidecar?.operationId) {
|
|
5683
|
+
const operationId = sidecar.operationId;
|
|
5684
|
+
const operation = (await withRetry(runtime, "Reading the export", () => input.client.transferExportGet(operationId)).catch((error) => {
|
|
5685
|
+
if (error instanceof EmDashApiError && error.code === "TRANSFER_OPERATION_NOT_FOUND") return null;
|
|
5686
|
+
throw error;
|
|
5687
|
+
}))?.operation;
|
|
5688
|
+
if (operation && operation.state !== "failed" && operation.state !== "expired") {
|
|
5689
|
+
if (operation.state !== "complete" || operation.stagingCollectedAt === null) {
|
|
5690
|
+
runtime.reporter.info(`Resuming export ${operation.id}`);
|
|
5691
|
+
return {
|
|
5692
|
+
operation,
|
|
5693
|
+
resumed: true
|
|
5694
|
+
};
|
|
5695
|
+
}
|
|
5696
|
+
}
|
|
5697
|
+
runtime.reporter.warn(operation ? `Export ${operation.id} ${operation.state === "failed" ? `failed (${operation.errorCode ?? "unknown error"})` : "expired"}; starting a new export.` : `Export ${operationId} no longer exists; starting a new export.`);
|
|
5698
|
+
sidecar = null;
|
|
5699
|
+
}
|
|
5700
|
+
const state = sidecar ?? {
|
|
5701
|
+
version: 1,
|
|
5702
|
+
baseUrl: input.baseUrl,
|
|
5703
|
+
comments: input.comments,
|
|
5704
|
+
idempotencyKey: `emdash-cli-export-${ulid()}`,
|
|
5705
|
+
operationId: null
|
|
5706
|
+
};
|
|
5707
|
+
await writeSidecar(sidecarPath, state);
|
|
5708
|
+
const created = await withRetry(runtime, "Starting the export", () => input.client.transferExportCreate(input.comments ? {} : { comments: false }, { idempotencyKey: state.idempotencyKey }));
|
|
5709
|
+
await writeSidecar(sidecarPath, {
|
|
5710
|
+
...state,
|
|
5711
|
+
operationId: created.operation.id
|
|
5712
|
+
});
|
|
5713
|
+
runtime.reporter.info(`${created.created ? "Started" : "Resuming"} export ${created.operation.id}`);
|
|
5714
|
+
return {
|
|
5715
|
+
operation: created.operation,
|
|
5716
|
+
resumed: !created.created
|
|
5717
|
+
};
|
|
5718
|
+
}
|
|
5719
|
+
/** Advance an export until it ends; returns the complete operation. */
|
|
5720
|
+
async function driveExport(client, operation, runtime) {
|
|
5721
|
+
const progress = createProgressLogger(runtime);
|
|
5722
|
+
let current = operation;
|
|
5723
|
+
while (current.state === "pending" || current.state === "running") {
|
|
5724
|
+
const step = await withRetry(runtime, "Export step", () => client.transferExportAdvance(current.id));
|
|
5725
|
+
current = step.operation;
|
|
5726
|
+
progress(`Exporting (${current.stage ?? current.state})`, formatProgress(current.progress));
|
|
5727
|
+
if (step.nextRequestInMs === null) break;
|
|
5728
|
+
await sleepFor(runtime, step.nextRequestInMs);
|
|
5729
|
+
}
|
|
5730
|
+
if (current.state !== "complete") throw operationError(current);
|
|
5731
|
+
return current;
|
|
5732
|
+
}
|
|
5733
|
+
/**
|
|
5734
|
+
* Directory next to the output where downloaded files are kept, by digest,
|
|
5735
|
+
* until the package is assembled. A re-run reuses every file there that
|
|
5736
|
+
* still verifies.
|
|
5737
|
+
*/
|
|
5738
|
+
function exportPartsPath(outputPath) {
|
|
5739
|
+
return `${outputPath}.parts`;
|
|
5740
|
+
}
|
|
5741
|
+
/**
|
|
5742
|
+
* Run `task` over `items` with at most `limit` in flight. After a failure no
|
|
5743
|
+
* new item starts, the ones in flight finish, and the first failure is
|
|
5744
|
+
* thrown.
|
|
5745
|
+
*/
|
|
5746
|
+
async function forEachConcurrently(items, limit, task) {
|
|
5747
|
+
let next = 0;
|
|
5748
|
+
let failure;
|
|
5749
|
+
const worker = async () => {
|
|
5750
|
+
while (!failure && next < items.length) {
|
|
5751
|
+
const item = items[next++];
|
|
5752
|
+
try {
|
|
5753
|
+
await task(item);
|
|
5754
|
+
} catch (error) {
|
|
5755
|
+
failure ??= { error };
|
|
5756
|
+
}
|
|
5757
|
+
}
|
|
5758
|
+
};
|
|
5759
|
+
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));
|
|
5760
|
+
if (failure) throw failure.error;
|
|
5761
|
+
}
|
|
5762
|
+
/**
|
|
5763
|
+
* Download a complete export file by file and write it as a package file.
|
|
5764
|
+
* The manifest must hash to the export's package digest.
|
|
5765
|
+
*/
|
|
5766
|
+
async function downloadExport(client, operation, outputPath, runtime) {
|
|
5767
|
+
const operationId = operation.id;
|
|
5768
|
+
const manifestBytes = await withRetry(runtime, "Downloading the manifest", () => client.transferExportManifest(operationId));
|
|
5769
|
+
const manifest = parseManifest(manifestBytes);
|
|
5770
|
+
const digest = await packageDigest(manifest);
|
|
5771
|
+
if (digest !== operation.packageDigest) throw new SiteTransferCliError("TRANSFER_PACKAGE_DIGEST_MISMATCH", `The downloaded manifest does not match export ${operationId}. Run the export again.`);
|
|
5772
|
+
const partsDir = exportPartsPath(outputPath);
|
|
5773
|
+
await mkdir(partsDir, { recursive: true });
|
|
5774
|
+
const partOf = (file) => join(partsDir, file.sha256);
|
|
5775
|
+
let kept = 0;
|
|
5776
|
+
const fetchPart = async (file) => {
|
|
5777
|
+
if (await diskFileMatches(partOf(file), file)) {
|
|
5778
|
+
kept++;
|
|
5779
|
+
return;
|
|
5780
|
+
}
|
|
5781
|
+
await withRetry(runtime, `Downloading ${file.path}`, async () => {
|
|
5782
|
+
const download = await client.transferExportFile(operationId, file.path);
|
|
5783
|
+
await saveVerifiedFile(file.path, download.body, file, partOf(file));
|
|
5784
|
+
});
|
|
5785
|
+
};
|
|
5786
|
+
const indexChunks = manifest.index.map((ref) => ({
|
|
5787
|
+
path: ref.path,
|
|
5788
|
+
bytes: ref.bytes,
|
|
5789
|
+
sha256: ref.sha256
|
|
5790
|
+
}));
|
|
5791
|
+
const entries = [];
|
|
5792
|
+
for (const chunk of indexChunks) {
|
|
5793
|
+
await fetchPart(chunk);
|
|
5794
|
+
entries.push(...parseIndexChunk(await readFile(partOf(chunk))));
|
|
5795
|
+
}
|
|
5796
|
+
const unique = [...new Map(entries.map((entry) => [entry.sha256, entry])).values()];
|
|
5797
|
+
const total = unique.reduce((sum, entry) => sum + entry.bytes, 0);
|
|
5798
|
+
const progress = createProgressLogger(runtime);
|
|
5799
|
+
let done = 0;
|
|
5800
|
+
let count = 0;
|
|
5801
|
+
await forEachConcurrently(unique, DOWNLOAD_CONCURRENCY, async (entry) => {
|
|
5802
|
+
await fetchPart(entry);
|
|
5803
|
+
done += entry.bytes;
|
|
5804
|
+
count++;
|
|
5805
|
+
progress("Downloading", `${count}/${unique.length} files (${formatBytes(done)} / ${formatBytes(total)})`);
|
|
5806
|
+
});
|
|
5807
|
+
if (kept > 0) runtime.reporter.info(`Reused ${kept} files downloaded by an earlier run`);
|
|
5808
|
+
async function* files() {
|
|
5809
|
+
yield {
|
|
5810
|
+
path: MANIFEST_PATH,
|
|
5811
|
+
bytes: manifestBytes.byteLength,
|
|
5812
|
+
body: () => manifestBytes
|
|
5813
|
+
};
|
|
5814
|
+
for (const file of [...indexChunks, ...entries]) yield {
|
|
5815
|
+
path: file.path,
|
|
5816
|
+
bytes: file.bytes,
|
|
5817
|
+
body: () => openArchive(partOf(file))
|
|
5818
|
+
};
|
|
5819
|
+
}
|
|
5820
|
+
const written = await writeSitePackage(outputPath, files());
|
|
5821
|
+
await rm(partsDir, {
|
|
5822
|
+
recursive: true,
|
|
5823
|
+
force: true
|
|
5824
|
+
});
|
|
5825
|
+
return {
|
|
5826
|
+
packageDigest: digest,
|
|
5827
|
+
files: 1 + indexChunks.length + entries.length,
|
|
5828
|
+
bytes: written.bytes
|
|
5829
|
+
};
|
|
5830
|
+
}
|
|
5831
|
+
async function runSiteExport(input, runtime) {
|
|
5832
|
+
const { operation, resumed } = await startOrResume(input, runtime);
|
|
5833
|
+
const complete = await driveExport(input.client, operation, runtime);
|
|
5834
|
+
runtime.reporter.info(`Export ${complete.id} is complete; downloading`);
|
|
5835
|
+
const downloaded = await downloadExport(input.client, complete, input.outputPath, runtime);
|
|
5836
|
+
await rm(exportSidecarPath(input.outputPath), { force: true });
|
|
5837
|
+
return {
|
|
5838
|
+
operationId: complete.id,
|
|
5839
|
+
output: input.outputPath,
|
|
5840
|
+
packageDigest: downloaded.packageDigest,
|
|
5841
|
+
files: downloaded.files,
|
|
5842
|
+
bytes: downloaded.bytes,
|
|
5843
|
+
resumed
|
|
5844
|
+
};
|
|
5845
|
+
}
|
|
5846
|
+
|
|
5847
|
+
//#endregion
|
|
5848
|
+
//#region src/cli/site/import.ts
|
|
5849
|
+
/**
|
|
5850
|
+
* `emdash site import`: verify a local package, upload what the target is
|
|
5851
|
+
* missing, analyze it into a plan, and execute a confirmed plan.
|
|
5852
|
+
*
|
|
5853
|
+
* Every step is resumable. The import is created with the package digest as
|
|
5854
|
+
* its idempotency key and found again by digest, uploads skip files the
|
|
5855
|
+
* target already verified, and analysis and execution are server-side state
|
|
5856
|
+
* machines the CLI only advances.
|
|
5857
|
+
*/
|
|
5858
|
+
const UPLOAD_CONCURRENCY = 4;
|
|
5859
|
+
/** Buffered upload bytes allowed in flight; one larger file may exceed it. */
|
|
5860
|
+
const UPLOAD_BUFFER_BYTES = 64 * 1024 * 1024;
|
|
5861
|
+
const MISSING_PAGE = 100;
|
|
5862
|
+
const IMPORT_LOOKUP_PAGES = 5;
|
|
5863
|
+
const SHA256_DIGEST_PATTERN = /^sha256:[0-9a-f]{64}$/;
|
|
5864
|
+
const SHA256_HEX_PATTERN = /^[0-9a-f]{64}$/;
|
|
5865
|
+
const ENDED_WITHOUT_RECEIPT = new Set([
|
|
5866
|
+
"failed",
|
|
5867
|
+
"cancelled",
|
|
5868
|
+
"abandoned",
|
|
5869
|
+
"expired"
|
|
5870
|
+
]);
|
|
5871
|
+
/** Whether an import is executing: requested (`planned` at stage `reserve`), running, or verifying. */
|
|
5872
|
+
function isExecuting(operation) {
|
|
5873
|
+
return operation.state === "running" || operation.state === "verifying" || operation.state === "planned" && operation.stage === "reserve";
|
|
5874
|
+
}
|
|
5875
|
+
/** Normalize a plan digest given as `sha256:<hex>` or bare hex. */
|
|
5876
|
+
function normalizePlanDigest(value) {
|
|
5877
|
+
const trimmed = value.trim().toLowerCase();
|
|
5878
|
+
if (SHA256_DIGEST_PATTERN.test(trimmed)) return trimmed;
|
|
5879
|
+
if (SHA256_HEX_PATTERN.test(trimmed)) return `sha256:${trimmed}`;
|
|
5880
|
+
throw new SiteTransferCliError("INVALID_ARGUMENT", "--plan must be a plan digest like sha256:<64 hex characters>");
|
|
5881
|
+
}
|
|
5882
|
+
async function findImportByDigest(client, digest, runtime) {
|
|
5883
|
+
let cursor;
|
|
5884
|
+
for (let page = 0; page < IMPORT_LOOKUP_PAGES; page++) {
|
|
5885
|
+
const result = await withRetry(runtime, "Listing imports", () => client.transferImportList({
|
|
5886
|
+
limit: 100,
|
|
5887
|
+
cursor
|
|
5888
|
+
}));
|
|
5889
|
+
const match = result.items.find((item) => item.packageDigest === digest);
|
|
5890
|
+
if (match) return ENDED_WITHOUT_RECEIPT.has(match.state) ? null : match;
|
|
5891
|
+
if (!result.nextCursor) return null;
|
|
5892
|
+
cursor = result.nextCursor;
|
|
5893
|
+
}
|
|
5894
|
+
return null;
|
|
5895
|
+
}
|
|
5896
|
+
/** Import states that keep blocking site writes once the import has written. */
|
|
5897
|
+
const BLOCKING_AFTER_WRITE = new Set(["failed", "cancelled"]);
|
|
5898
|
+
function occupiesTarget(operation) {
|
|
5899
|
+
if (!ENDED_WITHOUT_RECEIPT.has(operation.state) && operation.state !== "complete") return true;
|
|
5900
|
+
return operation.mutationStartedAt !== null && BLOCKING_AFTER_WRITE.has(operation.state);
|
|
5901
|
+
}
|
|
5902
|
+
/**
|
|
5903
|
+
* When the site refuses a new import because an earlier import wrote to it
|
|
5904
|
+
* and then stopped, say which import and what to do about it; otherwise
|
|
5905
|
+
* return `error` unchanged.
|
|
5906
|
+
*/
|
|
5907
|
+
async function explainOccupiedTarget(client, error, runtime) {
|
|
5908
|
+
if (!(error instanceof EmDashApiError) || error.code !== "TRANSFER_TARGET_NOT_EMPTY" && error.code !== "TRANSFER_IMPORT_IN_PROGRESS") return error;
|
|
5909
|
+
const { items } = await withRetry(runtime, "Listing imports", () => client.transferImportList({ limit: 100 })).catch(() => ({ items: [] }));
|
|
5910
|
+
const occupying = items.find(occupiesTarget);
|
|
5911
|
+
if (occupying) {
|
|
5912
|
+
if (!BLOCKING_AFTER_WRITE.has(occupying.state)) return error;
|
|
5913
|
+
const ended = occupying.state === "failed" ? "failed" : "was cancelled";
|
|
5914
|
+
return new SiteTransferCliError(error.code, `Import ${occupying.id} ${ended} after it started writing, so this site holds partial data from it and blocks writes. Abandon it with \`emdash site import abandon ${occupying.id}\`, then reset this site or set up a new one before importing again.`, {
|
|
5915
|
+
operationId: occupying.id,
|
|
5916
|
+
state: occupying.state
|
|
5917
|
+
});
|
|
5918
|
+
}
|
|
5919
|
+
const abandoned = items.find((item) => item.state === "abandoned" && item.mutationStartedAt !== null);
|
|
5920
|
+
if (error.code === "TRANSFER_TARGET_NOT_EMPTY" && abandoned) return new SiteTransferCliError(error.code, `Import ${abandoned.id} wrote partial data to this site before it was abandoned. Reset this site or set up a new one before importing again.`, {
|
|
5921
|
+
operationId: abandoned.id,
|
|
5922
|
+
state: abandoned.state
|
|
5923
|
+
});
|
|
5924
|
+
return error;
|
|
5925
|
+
}
|
|
5926
|
+
/**
|
|
5927
|
+
* Find the import of this package on the target, or create it. An earlier
|
|
5928
|
+
* import of the same package that ended without a receipt is left alone and
|
|
5929
|
+
* a new one is started.
|
|
5930
|
+
*/
|
|
5931
|
+
async function openImport(client, scan, runtime) {
|
|
5932
|
+
const existing = await findImportByDigest(client, scan.packageDigest, runtime);
|
|
5933
|
+
if (existing) {
|
|
5934
|
+
runtime.reporter.info(`Resuming import ${existing.id} (${existing.state})`);
|
|
5935
|
+
return {
|
|
5936
|
+
operation: existing,
|
|
5937
|
+
fresh: false
|
|
5938
|
+
};
|
|
5939
|
+
}
|
|
5940
|
+
const create = (idempotencyKey) => withRetry(runtime, "Creating the import", () => client.transferImportCreate(scan.manifestBytes, { idempotencyKey })).catch(async (error) => {
|
|
5941
|
+
throw await explainOccupiedTarget(client, error, runtime);
|
|
5942
|
+
});
|
|
5943
|
+
let created = await create(scan.packageDigest);
|
|
5944
|
+
if (ENDED_WITHOUT_RECEIPT.has(created.operation.state)) {
|
|
5945
|
+
runtime.reporter.warn(`An earlier import of this package (${created.operation.id}) ended as ${created.operation.state}; starting a new one.`);
|
|
5946
|
+
created = await create(`${scan.packageDigest}/${Date.now().toString(36)}`);
|
|
5947
|
+
}
|
|
5948
|
+
runtime.reporter.info(`${created.created ? "Created" : "Resuming"} import ${created.operation.id} (${created.operation.state})`);
|
|
5949
|
+
return {
|
|
5950
|
+
operation: created.operation,
|
|
5951
|
+
fresh: created.created
|
|
5952
|
+
};
|
|
5953
|
+
}
|
|
5954
|
+
async function listMissing(client, operationId, runtime) {
|
|
5955
|
+
const files = [];
|
|
5956
|
+
let cursor;
|
|
5957
|
+
do {
|
|
5958
|
+
const page = await withRetry(runtime, "Listing missing files", () => client.transferImportMissing(operationId, {
|
|
5959
|
+
limit: MISSING_PAGE,
|
|
5960
|
+
cursor
|
|
5961
|
+
}));
|
|
5962
|
+
files.push(...page.items);
|
|
5963
|
+
cursor = page.nextCursor;
|
|
5964
|
+
} while (cursor);
|
|
5965
|
+
return files;
|
|
5966
|
+
}
|
|
5967
|
+
var UploadPool = class {
|
|
5968
|
+
inFlight = /* @__PURE__ */ new Set();
|
|
5969
|
+
bytes = 0;
|
|
5970
|
+
failure;
|
|
5971
|
+
constructor(concurrency, maxBytes) {
|
|
5972
|
+
this.concurrency = concurrency;
|
|
5973
|
+
this.maxBytes = maxBytes;
|
|
5974
|
+
}
|
|
5975
|
+
async add(size, task) {
|
|
5976
|
+
while (this.inFlight.size > 0 && (this.inFlight.size >= this.concurrency || this.bytes + size > this.maxBytes)) await Promise.race(this.inFlight);
|
|
5977
|
+
this.rethrow();
|
|
5978
|
+
this.bytes += size;
|
|
5979
|
+
const promise = task().catch((error) => {
|
|
5980
|
+
this.failure ??= error;
|
|
5981
|
+
}).finally(() => {
|
|
5982
|
+
this.bytes -= size;
|
|
5983
|
+
this.inFlight.delete(promise);
|
|
5984
|
+
});
|
|
5985
|
+
this.inFlight.add(promise);
|
|
5986
|
+
}
|
|
5987
|
+
async drain() {
|
|
5988
|
+
await Promise.all(this.inFlight);
|
|
5989
|
+
this.rethrow();
|
|
5990
|
+
}
|
|
5991
|
+
/** Wait for uploads in flight without surfacing their failures. */
|
|
5992
|
+
async settle() {
|
|
5993
|
+
await Promise.allSettled(this.inFlight);
|
|
5994
|
+
}
|
|
5995
|
+
rethrow() {
|
|
5996
|
+
if (this.failure !== void 0) throw this.failure;
|
|
5997
|
+
}
|
|
5998
|
+
};
|
|
5999
|
+
/**
|
|
6000
|
+
* Upload every package file the import has not verified yet. Index chunks go
|
|
6001
|
+
* first because uploading one declares the files it lists; a file whose
|
|
6002
|
+
* index chunk is not uploaded yet waits for the next pass over the archive.
|
|
6003
|
+
*/
|
|
6004
|
+
async function uploadPackage(client, archivePath, scan, operation, runtime) {
|
|
6005
|
+
const operationId = operation.operation.id;
|
|
6006
|
+
const progress = createProgressLogger(runtime);
|
|
6007
|
+
const summary = {
|
|
6008
|
+
uploaded: 0,
|
|
6009
|
+
bytes: 0
|
|
6010
|
+
};
|
|
6011
|
+
let pending = operation.fresh ? new Set(scan.files.keys()) : null;
|
|
6012
|
+
for (;;) {
|
|
6013
|
+
if (!pending) {
|
|
6014
|
+
const missing = await listMissing(client, operationId, runtime);
|
|
6015
|
+
for (const file of missing) {
|
|
6016
|
+
const local = scan.files.get(file.path);
|
|
6017
|
+
if (!local) throw new SiteTransferCliError("TRANSFER_FILE_MISSING", `The site expects ${file.path}, which is not in this package file`);
|
|
6018
|
+
if (local.bytes !== file.bytes || local.sha256 !== file.sha256) throw new SiteTransferCliError("TRANSFER_FILE_DIGEST_MISMATCH", `The site expects different contents for ${file.path}`);
|
|
6019
|
+
}
|
|
6020
|
+
pending = new Set(missing.map((file) => file.path));
|
|
6021
|
+
for (const file of missing) for (const path of scan.indexEntries.get(file.path) ?? []) pending.add(path);
|
|
6022
|
+
}
|
|
6023
|
+
if (pending.size === 0) return summary;
|
|
6024
|
+
const total = pending.size;
|
|
6025
|
+
const uploadedIndexes = /* @__PURE__ */ new Set();
|
|
6026
|
+
const pool = new UploadPool(UPLOAD_CONCURRENCY, UPLOAD_BUFFER_BYTES);
|
|
6027
|
+
let passUploaded = 0;
|
|
6028
|
+
const upload = async (path, bytes) => {
|
|
6029
|
+
await withRetry(runtime, `Uploading ${path}`, () => client.transferImportUploadFile(operationId, path, bytes, bytes.byteLength));
|
|
6030
|
+
passUploaded++;
|
|
6031
|
+
summary.uploaded++;
|
|
6032
|
+
summary.bytes += bytes.byteLength;
|
|
6033
|
+
progress("Uploading", `${passUploaded}/${total} files (${formatBytes(summary.bytes)} this run)`);
|
|
6034
|
+
};
|
|
6035
|
+
const passPending = pending;
|
|
6036
|
+
try {
|
|
6037
|
+
await unpackSitePackage(openArchive(archivePath), async (file) => {
|
|
6038
|
+
if (!passPending.has(file.path)) return;
|
|
6039
|
+
const index = scan.indexOf.get(file.path);
|
|
6040
|
+
if (index && passPending.has(index) && !uploadedIndexes.has(index)) return;
|
|
6041
|
+
const expected = scan.files.get(file.path);
|
|
6042
|
+
if (!expected) return;
|
|
6043
|
+
const bytes = await readBody(file.body);
|
|
6044
|
+
await assertFileMatches(file.path, bytes, expected);
|
|
6045
|
+
if (file.parsed.type === "index") {
|
|
6046
|
+
await upload(file.path, bytes);
|
|
6047
|
+
uploadedIndexes.add(file.path);
|
|
6048
|
+
return;
|
|
6049
|
+
}
|
|
6050
|
+
await pool.add(bytes.byteLength, () => upload(file.path, bytes));
|
|
6051
|
+
});
|
|
6052
|
+
} catch (error) {
|
|
6053
|
+
await pool.settle();
|
|
6054
|
+
throw error;
|
|
6055
|
+
}
|
|
6056
|
+
await pool.drain();
|
|
6057
|
+
if (passUploaded === 0) throw new SiteTransferCliError("TRANSFER_FILE_MISSING", "The site still expects files that could not be uploaded from this package");
|
|
6058
|
+
pending = null;
|
|
6059
|
+
}
|
|
6060
|
+
}
|
|
6061
|
+
/** Advance analysis until the import is planned. */
|
|
6062
|
+
async function driveAnalysis(client, operation, runtime) {
|
|
6063
|
+
const progress = createProgressLogger(runtime);
|
|
6064
|
+
for (;;) {
|
|
6065
|
+
const step = await withRetry(runtime, "Analysis step", () => client.transferImportAnalyze(operation.id)).catch(async (error) => {
|
|
6066
|
+
if (error instanceof EmDashApiError && error.code === "TRANSFER_INVALID_STATE") {
|
|
6067
|
+
const { operation: current } = await client.transferImportGet(operation.id);
|
|
6068
|
+
if (ENDED_WITHOUT_RECEIPT.has(current.state)) throw operationError(current);
|
|
6069
|
+
}
|
|
6070
|
+
throw error;
|
|
6071
|
+
});
|
|
6072
|
+
const current = step.operation;
|
|
6073
|
+
if (step.nextRequestInMs === null) {
|
|
6074
|
+
if (current.state !== "planned" || !step.plan || !step.planDigest) throw operationError(current);
|
|
6075
|
+
return {
|
|
6076
|
+
operation: current,
|
|
6077
|
+
plan: step.plan,
|
|
6078
|
+
planDigest: step.planDigest
|
|
6079
|
+
};
|
|
6080
|
+
}
|
|
6081
|
+
progress(`Analyzing (${current.stage ?? current.state})`, formatProgress(current.progress));
|
|
6082
|
+
await sleepFor(runtime, step.nextRequestInMs);
|
|
6083
|
+
}
|
|
6084
|
+
}
|
|
6085
|
+
/** Submit decisions for a planned import; returns the resulting plan. */
|
|
6086
|
+
async function applyDecisions(client, operationId, decisions, runtime) {
|
|
6087
|
+
const decided = await withRetry(runtime, "Applying decisions", () => client.transferImportAnalyze(operationId, decisions));
|
|
6088
|
+
if (!decided.plan || !decided.planDigest) throw operationError(decided.operation);
|
|
6089
|
+
return {
|
|
6090
|
+
operation: decided.operation,
|
|
6091
|
+
plan: decided.plan,
|
|
6092
|
+
planDigest: decided.planDigest
|
|
6093
|
+
};
|
|
6094
|
+
}
|
|
6095
|
+
function hasDecisions(flags) {
|
|
6096
|
+
return flags.mapPrincipal.length > 0 || flags.useTargetTitle || flags.useTargetTagline;
|
|
6097
|
+
}
|
|
6098
|
+
const USER_PAGES = 50;
|
|
6099
|
+
async function targetUsersByEmail(client, runtime) {
|
|
6100
|
+
const byEmail = /* @__PURE__ */ new Map();
|
|
6101
|
+
let cursor;
|
|
6102
|
+
for (let page = 0; page < USER_PAGES; page++) {
|
|
6103
|
+
const result = await withRetry(runtime, "Listing users", () => client.users({
|
|
6104
|
+
limit: 100,
|
|
6105
|
+
cursor
|
|
6106
|
+
}));
|
|
6107
|
+
for (const user of result.items) {
|
|
6108
|
+
const key = user.email.toLowerCase();
|
|
6109
|
+
byEmail.set(key, [...byEmail.get(key) ?? [], user.id]);
|
|
6110
|
+
}
|
|
6111
|
+
if (!result.nextCursor) break;
|
|
6112
|
+
cursor = result.nextCursor;
|
|
6113
|
+
}
|
|
6114
|
+
return byEmail;
|
|
6115
|
+
}
|
|
6116
|
+
/**
|
|
6117
|
+
* Turn decision flags into plan decisions. Principals are matched by id, or
|
|
6118
|
+
* by email (case-insensitive); target users by id, by email through the
|
|
6119
|
+
* users API, or `none` to leave the references unassigned.
|
|
6120
|
+
*/
|
|
6121
|
+
async function resolveDecisions(client, plan, flags, runtime) {
|
|
6122
|
+
const decisions = {};
|
|
6123
|
+
if (flags.useTargetTitle) decisions.siteTitle = "target";
|
|
6124
|
+
if (flags.useTargetTagline) decisions.siteTagline = "target";
|
|
6125
|
+
if (flags.mapPrincipal.length === 0) return decisions;
|
|
6126
|
+
let users;
|
|
6127
|
+
const mappings = {};
|
|
6128
|
+
for (const raw of flags.mapPrincipal) {
|
|
6129
|
+
const separator = raw.lastIndexOf("=");
|
|
6130
|
+
const from = separator > 0 ? raw.slice(0, separator).trim() : "";
|
|
6131
|
+
const to = separator > 0 ? raw.slice(separator + 1).trim() : "";
|
|
6132
|
+
if (!from || !to) throw new SiteTransferCliError("INVALID_ARGUMENT", `--map-principal expects <principal id or email>=<user id, email, or none>, got "${raw}"`);
|
|
6133
|
+
const principal = plan.principals.find((candidate) => candidate.id === from) ?? matchOne(plan.principals.filter((candidate) => candidate.email?.toLowerCase() === from.toLowerCase()), `principal ${from}`);
|
|
6134
|
+
if (!principal) throw new SiteTransferCliError("INVALID_ARGUMENT", `The package has no principal ${from}. Principals: ${plan.principals.map((p) => p.id).join(", ") || "none"}`);
|
|
6135
|
+
let target;
|
|
6136
|
+
if (to.toLowerCase() === "none") target = null;
|
|
6137
|
+
else if (to.includes("@")) {
|
|
6138
|
+
users ??= await targetUsersByEmail(client, runtime);
|
|
6139
|
+
const ids = users.get(to.toLowerCase()) ?? [];
|
|
6140
|
+
if (ids.length !== 1) throw new SiteTransferCliError("INVALID_ARGUMENT", ids.length === 0 ? `No user on this site has the email ${to}` : `More than one user on this site has the email ${to}; map by user id instead`);
|
|
6141
|
+
target = ids[0];
|
|
6142
|
+
} else target = to;
|
|
6143
|
+
mappings[principal.id] = target;
|
|
6144
|
+
}
|
|
6145
|
+
decisions.principalMappings = mappings;
|
|
6146
|
+
return decisions;
|
|
6147
|
+
}
|
|
6148
|
+
function matchOne(matches, label) {
|
|
6149
|
+
if (matches.length > 1) throw new SiteTransferCliError("INVALID_ARGUMENT", `More than one ${label} matches; map by principal id instead`);
|
|
6150
|
+
return matches[0];
|
|
6151
|
+
}
|
|
6152
|
+
/** Advance an executing import until it ends; returns the complete operation. */
|
|
6153
|
+
async function driveExecution(client, operation, runtime) {
|
|
6154
|
+
const progress = createProgressLogger(runtime);
|
|
6155
|
+
let current = operation;
|
|
6156
|
+
while (isExecuting(current)) {
|
|
6157
|
+
const step = await withRetry(runtime, "Import step", () => client.transferImportAdvance(current.id));
|
|
6158
|
+
current = step.operation;
|
|
6159
|
+
progress(`Importing (${current.stage ?? current.state})`, formatProgress(current.progress));
|
|
6160
|
+
if (step.nextRequestInMs === null) break;
|
|
6161
|
+
await sleepFor(runtime, step.nextRequestInMs);
|
|
6162
|
+
}
|
|
6163
|
+
if (current.state !== "complete") throw operationError(current);
|
|
6164
|
+
return current;
|
|
6165
|
+
}
|
|
6166
|
+
async function fetchReceipt(client, operationId, runtime) {
|
|
6167
|
+
const { receipt } = await withRetry(runtime, "Reading the receipt", () => client.transferImportReceipt(operationId));
|
|
6168
|
+
return {
|
|
6169
|
+
operationId,
|
|
6170
|
+
state: "complete",
|
|
6171
|
+
receipt,
|
|
6172
|
+
receiptDigestValid: await verifyReceiptDigest(receipt)
|
|
6173
|
+
};
|
|
6174
|
+
}
|
|
6175
|
+
/**
|
|
6176
|
+
* Execute a planned import after checking the reviewed plan digest, then
|
|
6177
|
+
* advance it to completion.
|
|
6178
|
+
*/
|
|
6179
|
+
async function executeImport(client, operation, planDigest, runtime) {
|
|
6180
|
+
let current = operation;
|
|
6181
|
+
if (current.planDigest !== planDigest) throw new SiteTransferCliError("TRANSFER_PLAN_DIGEST_MISMATCH", `The plan changed since it was reviewed: the current plan digest is ${current.planDigest ?? "none"}. Run with --analyze again and confirm the new digest.`);
|
|
6182
|
+
if (current.state === "planned" && current.stage !== "reserve") {
|
|
6183
|
+
if (!current.packageDigest) throw operationError(current);
|
|
6184
|
+
const packageDigest = current.packageDigest;
|
|
6185
|
+
current = (await withRetry(runtime, "Starting the import", () => client.transferImportExecute(current.id, {
|
|
6186
|
+
packageDigest,
|
|
6187
|
+
planDigest
|
|
6188
|
+
}))).operation;
|
|
6189
|
+
runtime.reporter.info(`Executing import ${current.id}`);
|
|
6190
|
+
}
|
|
6191
|
+
return fetchReceipt(client, (await driveExecution(client, current, runtime)).id, runtime);
|
|
6192
|
+
}
|
|
6193
|
+
/** Scan, upload, and analyze a package, applying any decisions. */
|
|
6194
|
+
async function analyzePackage(client, archivePath, flags, runtime) {
|
|
6195
|
+
const { scan, opened } = await prepareImport(client, archivePath, runtime);
|
|
6196
|
+
return continueToPlan(client, archivePath, scan, opened, flags, runtime);
|
|
6197
|
+
}
|
|
6198
|
+
async function prepareImport(client, archivePath, runtime) {
|
|
6199
|
+
runtime.reporter.info(`Verifying ${archivePath}`);
|
|
6200
|
+
const scan = await scanSitePackage(archivePath);
|
|
6201
|
+
runtime.reporter.info(`Package ${scan.packageDigest}: ${scan.files.size + 1} files, ${formatBytes(scan.totalBytes)}`);
|
|
6202
|
+
return {
|
|
6203
|
+
scan,
|
|
6204
|
+
opened: await openImport(client, scan, runtime)
|
|
6205
|
+
};
|
|
6206
|
+
}
|
|
6207
|
+
async function continueToPlan(client, archivePath, scan, opened, flags, runtime) {
|
|
6208
|
+
const operation = opened.operation;
|
|
6209
|
+
if (isExecuting(operation)) return { operation };
|
|
6210
|
+
switch (operation.state) {
|
|
6211
|
+
case "uploading": {
|
|
6212
|
+
if (!archivePath || !scan) throw new SiteTransferCliError("PACKAGE_FILE_REQUIRED", `Import ${operation.id} is still uploading. Pass the package file to resume it: emdash site import resume ${operation.id} <file>`);
|
|
6213
|
+
const uploaded = await uploadPackage(client, archivePath, scan, opened, runtime);
|
|
6214
|
+
runtime.reporter.info(`Uploaded ${uploaded.uploaded} files (${formatBytes(uploaded.bytes)})`);
|
|
6215
|
+
return planWithDecisions(client, operation, flags, runtime);
|
|
6216
|
+
}
|
|
6217
|
+
case "analyzing":
|
|
6218
|
+
case "planned": return planWithDecisions(client, operation, flags, runtime);
|
|
6219
|
+
case "complete":
|
|
6220
|
+
runtime.reporter.info(`Import ${operation.id} is already complete`);
|
|
6221
|
+
return fetchReceipt(client, operation.id, runtime);
|
|
6222
|
+
default: return { operation };
|
|
6223
|
+
}
|
|
6224
|
+
}
|
|
6225
|
+
async function planWithDecisions(client, operation, flags, runtime) {
|
|
6226
|
+
let planned = await driveAnalysis(client, operation, runtime);
|
|
6227
|
+
if (hasDecisions(flags)) {
|
|
6228
|
+
const decisions = await resolveDecisions(client, planned.plan, flags, runtime);
|
|
6229
|
+
planned = await applyDecisions(client, planned.operation.id, decisions, runtime);
|
|
6230
|
+
}
|
|
6231
|
+
return {
|
|
6232
|
+
...planned,
|
|
6233
|
+
packageDigest: planned.plan.packageDigest
|
|
6234
|
+
};
|
|
6235
|
+
}
|
|
6236
|
+
/** Scan, upload, and analyze if needed, then execute the confirmed plan. */
|
|
6237
|
+
async function confirmPackage(client, archivePath, planDigest, runtime) {
|
|
6238
|
+
const { scan, opened } = await prepareImport(client, archivePath, runtime);
|
|
6239
|
+
return confirmOperation(client, archivePath, scan, opened, planDigest, runtime);
|
|
6240
|
+
}
|
|
6241
|
+
async function confirmOperation(client, archivePath, scan, opened, planDigest, runtime) {
|
|
6242
|
+
const operation = opened.operation;
|
|
6243
|
+
if (operation.state === "complete") {
|
|
6244
|
+
if (operation.planDigest !== planDigest) throw new SiteTransferCliError("TRANSFER_PLAN_DIGEST_MISMATCH", `Import ${operation.id} already completed with a different plan (${operation.planDigest ?? "none"})`);
|
|
6245
|
+
return fetchReceipt(client, operation.id, runtime);
|
|
6246
|
+
}
|
|
6247
|
+
if (isExecuting(operation)) return executeImport(client, operation, planDigest, runtime);
|
|
6248
|
+
const outcome = await continueToPlan(client, archivePath, scan, opened, {
|
|
6249
|
+
mapPrincipal: [],
|
|
6250
|
+
useTargetTitle: false,
|
|
6251
|
+
useTargetTagline: false
|
|
6252
|
+
}, runtime);
|
|
6253
|
+
if (!("plan" in outcome)) {
|
|
6254
|
+
if ("receipt" in outcome) return outcome;
|
|
6255
|
+
throw operationError(outcome.operation);
|
|
6256
|
+
}
|
|
6257
|
+
if (outcome.plan.blockers.length > 0) throw new SiteTransferCliError("TRANSFER_PLAN_BLOCKED", `The import plan has ${outcome.plan.blockers.length} blocker(s). Run with --analyze to see them.`);
|
|
6258
|
+
return executeImport(client, outcome.operation, planDigest, runtime);
|
|
6259
|
+
}
|
|
6260
|
+
async function importStatus(client, operationId, runtime) {
|
|
6261
|
+
return withRetry(runtime, "Reading the import", () => client.transferImportGet(operationId));
|
|
6262
|
+
}
|
|
6263
|
+
/**
|
|
6264
|
+
* Continue an import from whatever state it is in: upload what is missing
|
|
6265
|
+
* (needs the package file), finish analysis, or finish execution.
|
|
6266
|
+
*/
|
|
6267
|
+
async function resumeImport(client, operationId, archivePath, runtime) {
|
|
6268
|
+
const { operation } = await importStatus(client, operationId, runtime);
|
|
6269
|
+
if (isExecuting(operation)) return fetchReceipt(client, (await driveExecution(client, operation, runtime)).id, runtime);
|
|
6270
|
+
let scan = null;
|
|
6271
|
+
if (operation.state === "uploading" && archivePath) {
|
|
6272
|
+
runtime.reporter.info(`Verifying ${archivePath}`);
|
|
6273
|
+
scan = await scanSitePackage(archivePath);
|
|
6274
|
+
if (scan.packageDigest !== operation.packageDigest) throw new SiteTransferCliError("TRANSFER_PACKAGE_DIGEST_MISMATCH", `${archivePath} is not the package import ${operation.id} was created from`);
|
|
6275
|
+
}
|
|
6276
|
+
return continueToPlan(client, archivePath, scan, {
|
|
6277
|
+
operation,
|
|
6278
|
+
fresh: false
|
|
6279
|
+
}, {
|
|
6280
|
+
mapPrincipal: [],
|
|
6281
|
+
useTargetTitle: false,
|
|
6282
|
+
useTargetTagline: false
|
|
6283
|
+
}, runtime);
|
|
6284
|
+
}
|
|
6285
|
+
async function importReceipt(client, operationId, runtime) {
|
|
6286
|
+
return fetchReceipt(client, operationId, runtime);
|
|
6287
|
+
}
|
|
6288
|
+
/**
|
|
6289
|
+
* Resolve a refused cancel or abandon: a retry of a request whose response
|
|
6290
|
+
* was lost finds the import already in `state`.
|
|
6291
|
+
*/
|
|
6292
|
+
async function settledAs(client, operationId, error, state, runtime) {
|
|
6293
|
+
if (!(error instanceof EmDashApiError) || error.code !== "TRANSFER_INVALID_STATE") throw error;
|
|
6294
|
+
const { operation } = await importStatus(client, operationId, runtime);
|
|
6295
|
+
if (operation.state === state) return operation;
|
|
6296
|
+
throw new SiteTransferCliError("TRANSFER_INVALID_STATE", state === "abandoned" ? `Only a failed or cancelled import can be abandoned; import ${operationId} is ${operation.state}.` : `Import ${operationId} has already ended as ${operation.state}.`);
|
|
6297
|
+
}
|
|
6298
|
+
/**
|
|
6299
|
+
* Cancel an import. An import no request is working on is cancelled at
|
|
6300
|
+
* once; one mid-step stops after its current batch.
|
|
6301
|
+
*/
|
|
6302
|
+
async function cancelImport(client, operationId, runtime) {
|
|
6303
|
+
return withRetry(runtime, "Cancelling the import", () => client.transferImportCancel(operationId)).then((result) => result.operation, (error) => settledAs(client, operationId, error, "cancelled", runtime));
|
|
6304
|
+
}
|
|
6305
|
+
/** Abandon a failed or cancelled import: lift its write block, keeping what it wrote. */
|
|
6306
|
+
async function abandonImport(client, operationId, runtime) {
|
|
6307
|
+
return withRetry(runtime, "Abandoning the import", () => client.transferImportAbandon(operationId)).then((result) => result.operation, (error) => settledAs(client, operationId, error, "abandoned", runtime));
|
|
6308
|
+
}
|
|
6309
|
+
|
|
6310
|
+
//#endregion
|
|
6311
|
+
//#region src/cli/commands/site.ts
|
|
6312
|
+
/**
|
|
6313
|
+
* emdash site
|
|
6314
|
+
*
|
|
6315
|
+
* Export a whole site to a portable `.emdash` package, and import one into an
|
|
6316
|
+
* empty site.
|
|
6317
|
+
*/
|
|
6318
|
+
/** Exit status when analysis produced a plan with blockers. */
|
|
6319
|
+
const EXIT_PLAN_BLOCKED = 2;
|
|
6320
|
+
const IMPORT_ACTIONS = new Set([
|
|
6321
|
+
"status",
|
|
6322
|
+
"resume",
|
|
6323
|
+
"receipt",
|
|
6324
|
+
"cancel",
|
|
6325
|
+
"abandon"
|
|
6326
|
+
]);
|
|
6327
|
+
/** Import states `import status` reports with exit status 1. */
|
|
6328
|
+
const UNSUCCESSFUL_STATES = new Set([
|
|
6329
|
+
"failed",
|
|
6330
|
+
"cancelled",
|
|
6331
|
+
"abandoned",
|
|
6332
|
+
"expired"
|
|
6333
|
+
]);
|
|
6334
|
+
function wantsJson(args) {
|
|
6335
|
+
return Boolean(args.json) || !process.stdout.isTTY;
|
|
6336
|
+
}
|
|
6337
|
+
function runtimeFor() {
|
|
6338
|
+
const progress = consola$1.create({
|
|
6339
|
+
stdout: process.stderr,
|
|
6340
|
+
stderr: process.stderr
|
|
6341
|
+
});
|
|
6342
|
+
return { reporter: {
|
|
6343
|
+
info: (message) => progress.info(message),
|
|
6344
|
+
warn: (message) => progress.warn(message)
|
|
6345
|
+
} };
|
|
6346
|
+
}
|
|
6347
|
+
async function confirmOnTerminal(question) {
|
|
6348
|
+
const prompt = createInterface({
|
|
6349
|
+
input: process.stdin,
|
|
6350
|
+
output: process.stderr
|
|
6351
|
+
});
|
|
6352
|
+
try {
|
|
6353
|
+
const answer = (await prompt.question(`${question} [y/N] `)).trim().toLowerCase();
|
|
6354
|
+
return answer === "y" || answer === "yes";
|
|
6355
|
+
} finally {
|
|
6356
|
+
prompt.close();
|
|
6357
|
+
}
|
|
6358
|
+
}
|
|
6359
|
+
/**
|
|
6360
|
+
* Ask before a cancel or abandon unless `--yes` or JSON output was chosen.
|
|
6361
|
+
* Without a terminal to ask on, the command needs `--yes`.
|
|
6362
|
+
*/
|
|
6363
|
+
async function confirmed(args, action, operationId, question) {
|
|
6364
|
+
if (args.yes || wantsJson(args)) return true;
|
|
6365
|
+
if (!process.stdin.isTTY) throw new SiteTransferCliError("INVALID_ARGUMENT", `Pass --yes to ${action} import ${operationId} without a confirmation prompt`);
|
|
6366
|
+
return confirmOnTerminal(question);
|
|
6367
|
+
}
|
|
6368
|
+
function fail(error, args) {
|
|
6369
|
+
const info = describeError(error);
|
|
6370
|
+
if (wantsJson(args)) output({ error: info }, args);
|
|
6371
|
+
else consola$1.error(info.message);
|
|
6372
|
+
process.exitCode = 1;
|
|
6373
|
+
}
|
|
6374
|
+
/** Every value of a repeatable string flag, from the raw arguments. */
|
|
6375
|
+
function collectFlag(rawArgs, name) {
|
|
6376
|
+
const values = [];
|
|
6377
|
+
for (let i = 0; i < rawArgs.length; i++) {
|
|
6378
|
+
const arg = rawArgs[i];
|
|
6379
|
+
if (arg === `--${name}`) {
|
|
6380
|
+
const next = rawArgs[i + 1];
|
|
6381
|
+
if (next !== void 0 && !next.startsWith("--")) {
|
|
6382
|
+
values.push(next);
|
|
6383
|
+
i++;
|
|
6384
|
+
} else throw new SiteTransferCliError("INVALID_ARGUMENT", `--${name} needs a value`);
|
|
6385
|
+
} else if (arg.startsWith(`--${name}=`)) values.push(arg.slice(name.length + 3));
|
|
6386
|
+
}
|
|
6387
|
+
return values;
|
|
6388
|
+
}
|
|
6389
|
+
function planJson(outcome) {
|
|
6390
|
+
return {
|
|
6391
|
+
operationId: outcome.operation.id,
|
|
6392
|
+
state: outcome.operation.state,
|
|
6393
|
+
packageDigest: outcome.packageDigest,
|
|
6394
|
+
planDigest: outcome.planDigest,
|
|
6395
|
+
executable: outcome.plan.blockers.length === 0,
|
|
6396
|
+
plan: outcome.plan
|
|
6397
|
+
};
|
|
6398
|
+
}
|
|
6399
|
+
function operationJson(operation) {
|
|
6400
|
+
return {
|
|
6401
|
+
operationId: operation.id,
|
|
6402
|
+
state: operation.state,
|
|
6403
|
+
operation
|
|
6404
|
+
};
|
|
6405
|
+
}
|
|
6406
|
+
function printPlan(outcome, archivePath) {
|
|
6407
|
+
const { plan } = outcome;
|
|
6408
|
+
consola$1.log(`Import ${outcome.operation.id}`);
|
|
6409
|
+
consola$1.log(` Package digest: ${outcome.packageDigest}`);
|
|
6410
|
+
consola$1.log(` Plan digest: ${outcome.planDigest}`);
|
|
6411
|
+
consola$1.log(` Origin: site ${plan.origin.siteId}, exported ${plan.origin.createdAt} by EmDash ${plan.origin.createdByEmDashVersion}`);
|
|
6412
|
+
const counts = Object.entries(plan.counts).map(([kind, count]) => `${kind} ${count}`).join(", ");
|
|
6413
|
+
consola$1.log(` Records: ${counts || "none"}`);
|
|
6414
|
+
consola$1.log(` Size: records ${formatBytes(plan.bytes.records)}, media ${formatBytes(plan.bytes.media)}`);
|
|
6415
|
+
printSetting("Site title", plan.settings.title, plan.decisions.siteTitle);
|
|
6416
|
+
printSetting("Tagline", plan.settings.tagline, plan.decisions.siteTagline);
|
|
6417
|
+
if (plan.principals.length > 0) {
|
|
6418
|
+
consola$1.log(" Principals (package users; map them with --map-principal <id>=<user|none>):");
|
|
6419
|
+
for (const principal of plan.principals) {
|
|
6420
|
+
const mapped = plan.decisions.principalMappings[principal.id];
|
|
6421
|
+
const target = mapped ? `user ${mapped}` : "unassigned";
|
|
6422
|
+
const suggested = principal.suggestedUserId && principal.suggestedUserId !== mapped ? `, suggested user ${principal.suggestedUserId}` : "";
|
|
6423
|
+
const email = principal.email ? ` <${principal.email}>` : "";
|
|
6424
|
+
consola$1.log(` ${principal.id} ${principal.displayName}${email}, ${principal.references} references -> ${target}${suggested}`);
|
|
6425
|
+
}
|
|
6426
|
+
}
|
|
6427
|
+
printTransformations(plan.transformations);
|
|
6428
|
+
printIssues("Warnings", plan.warnings);
|
|
6429
|
+
printIssues("Blockers", plan.blockers);
|
|
6430
|
+
if (plan.blockers.length > 0) {
|
|
6431
|
+
consola$1.error(`The plan has ${plan.blockers.length} blocker(s); it cannot be executed.`);
|
|
6432
|
+
return;
|
|
6433
|
+
}
|
|
6434
|
+
const file = archivePath ?? "<file>";
|
|
6435
|
+
consola$1.success(`Ready. To import, run:\n emdash site import ${file} --plan ${outcome.planDigest} --confirm`);
|
|
6436
|
+
}
|
|
6437
|
+
function printSetting(label, values, choice) {
|
|
6438
|
+
const value = choice === "package" ? values.package : values.target;
|
|
6439
|
+
consola$1.log(` ${`${label}:`.padEnd(16)}${JSON.stringify(value ?? "")} (from the ${choice}; package ${JSON.stringify(values.package ?? "")}, this site ${JSON.stringify(values.target ?? "")})`);
|
|
6440
|
+
}
|
|
6441
|
+
/** Every declared difference from the source site, one line per code. */
|
|
6442
|
+
function printTransformations(transformations) {
|
|
6443
|
+
const groups = /* @__PURE__ */ new Map();
|
|
6444
|
+
for (const transformation of transformations) {
|
|
6445
|
+
const group = groups.get(transformation.code) ?? {
|
|
6446
|
+
count: 0,
|
|
6447
|
+
kinds: /* @__PURE__ */ new Set(),
|
|
6448
|
+
details: []
|
|
6449
|
+
};
|
|
6450
|
+
if ("count" in transformation) group.count += transformation.count;
|
|
6451
|
+
else if ("ids" in transformation) group.count += transformation.ids.length;
|
|
6452
|
+
else group.count += transformation.locales.length;
|
|
6453
|
+
if ("kind" in transformation) group.kinds.add(transformation.kind);
|
|
6454
|
+
if ("locales" in transformation) for (const { from, to } of transformation.locales) group.details.push(`${from} -> ${to}`);
|
|
6455
|
+
if ("items" in transformation) {
|
|
6456
|
+
const types = /* @__PURE__ */ new Map();
|
|
6457
|
+
for (const item of transformation.items) types.set(item.type, (types.get(item.type) ?? 0) + 1);
|
|
6458
|
+
group.details.push(Array.from(types, ([type, count]) => `${type} ${count}`).join(", "));
|
|
6459
|
+
}
|
|
6460
|
+
groups.set(transformation.code, group);
|
|
6461
|
+
}
|
|
6462
|
+
if (groups.size === 0) return;
|
|
6463
|
+
consola$1.log(` Differences from the source site (${groups.size}):`);
|
|
6464
|
+
for (const [code, group] of groups) {
|
|
6465
|
+
const kinds = group.kinds.size > 0 ? ` [${[...group.kinds].join(", ")}]` : "";
|
|
6466
|
+
consola$1.log(` ${code}${kinds} x${group.count}: ${transformationLabel(code)}`);
|
|
6467
|
+
for (const detail of group.details) consola$1.log(` ${detail}`);
|
|
6468
|
+
}
|
|
6469
|
+
}
|
|
6470
|
+
function printIssues(label, issues) {
|
|
6471
|
+
if (issues.length === 0) return;
|
|
6472
|
+
consola$1.log(` ${label} (${issues.length}):`);
|
|
6473
|
+
for (const issue of issues) {
|
|
6474
|
+
const where = issue.kind ? ` [${issue.kind}]` : "";
|
|
6475
|
+
const count = issue.count !== void 0 ? ` x${issue.count}` : "";
|
|
6476
|
+
consola$1.log(` ${issue.code}${where}${count}: ${issue.message}`);
|
|
6477
|
+
}
|
|
6478
|
+
}
|
|
6479
|
+
function printReceipt(result) {
|
|
6480
|
+
const { receipt } = result;
|
|
6481
|
+
consola$1.success(`Import ${result.operationId} is complete and verified.`);
|
|
6482
|
+
consola$1.log(` Receipt digest: ${receipt.receiptDigest}${result.receiptDigestValid ? "" : " (INVALID)"}`);
|
|
6483
|
+
consola$1.log(` Package digest: ${receipt.packageDigest}`);
|
|
6484
|
+
consola$1.log(` Plan digest: ${receipt.planDigest}`);
|
|
6485
|
+
consola$1.log(` Logical digest: ${receipt.logicalDigest}`);
|
|
6486
|
+
consola$1.log(` Completed: ${receipt.completedAt}`);
|
|
6487
|
+
const counts = Object.entries(receipt.counts).map(([kind, count]) => `${kind} ${count}`).join(", ");
|
|
6488
|
+
consola$1.log(` Counts: ${counts || "none"}`);
|
|
6489
|
+
for (const warning of receipt.warnings) consola$1.warn(`${warning.code}: ${warning.message}`);
|
|
6490
|
+
}
|
|
6491
|
+
function printOperation(operation, files) {
|
|
6492
|
+
consola$1.log(`Import ${operation.id}: ${operation.state}${operation.stage ? ` (${operation.stage})` : ""}`);
|
|
6493
|
+
const progress = formatProgress(operation.progress);
|
|
6494
|
+
if (progress) consola$1.log(` Progress: ${progress}`);
|
|
6495
|
+
if (files) consola$1.log(` Files: ${files.verified} uploaded, ${files.declared} still missing`);
|
|
6496
|
+
if (operation.packageDigest) consola$1.log(` Package digest: ${operation.packageDigest}`);
|
|
6497
|
+
if (operation.planDigest) consola$1.log(` Plan digest: ${operation.planDigest}`);
|
|
6498
|
+
if (operation.errorCode) consola$1.warn(` Error: ${operation.errorCode}${operation.errorDetail ? ` ${JSON.stringify(operation.errorDetail)}` : ""}`);
|
|
6499
|
+
if (blocksWritesUntilAbandoned(operation)) consola$1.info(`It wrote to this site before it stopped, so site writes stay blocked until you abandon it: emdash site import abandon ${operation.id}`);
|
|
6500
|
+
}
|
|
6501
|
+
function blocksWritesUntilAbandoned(operation) {
|
|
6502
|
+
return operation.mutationStartedAt !== null && (operation.state === "failed" || operation.state === "cancelled");
|
|
6503
|
+
}
|
|
6504
|
+
function printCancelled(operation) {
|
|
6505
|
+
if (operation.state !== "cancelled") {
|
|
6506
|
+
consola$1.success(`Cancellation requested. Import ${operation.id} stops after its current batch; check it with: emdash site import status ${operation.id}`);
|
|
6507
|
+
return;
|
|
6508
|
+
}
|
|
6509
|
+
consola$1.success(`Import ${operation.id} is cancelled.`);
|
|
6510
|
+
if (blocksWritesUntilAbandoned(operation)) consola$1.info(`It had started writing to this site. The data it wrote stays, and site writes stay blocked until you abandon it: emdash site import abandon ${operation.id}`);
|
|
6511
|
+
else consola$1.info("It had not written anything to this site.");
|
|
6512
|
+
}
|
|
6513
|
+
function printAbandoned(operation) {
|
|
6514
|
+
consola$1.success(`Import ${operation.id} is abandoned. The site accepts writes again.`);
|
|
6515
|
+
if (operation.mutationStartedAt !== null) consola$1.info("Data the import already wrote was not removed. Reset this site or set up a new one before importing again.");
|
|
6516
|
+
}
|
|
6517
|
+
/** Print whatever an import command ended with and set the exit status. */
|
|
6518
|
+
function report(outcome, args, archivePath) {
|
|
6519
|
+
if ("receipt" in outcome) {
|
|
6520
|
+
if (wantsJson(args)) output(outcome, args);
|
|
6521
|
+
else printReceipt(outcome);
|
|
6522
|
+
if (!outcome.receiptDigestValid) process.exitCode = 1;
|
|
6523
|
+
return;
|
|
6524
|
+
}
|
|
6525
|
+
if ("plan" in outcome) {
|
|
6526
|
+
if (wantsJson(args)) output(planJson(outcome), args);
|
|
6527
|
+
else printPlan(outcome, archivePath);
|
|
6528
|
+
if (outcome.plan.blockers.length > 0) process.exitCode = EXIT_PLAN_BLOCKED;
|
|
6529
|
+
return;
|
|
6530
|
+
}
|
|
6531
|
+
if (wantsJson(args)) output(operationJson(outcome.operation), args);
|
|
6532
|
+
else {
|
|
6533
|
+
printOperation(outcome.operation);
|
|
6534
|
+
if (isExecuting(outcome.operation)) consola$1.info(`Continue it with: emdash site import resume ${outcome.operation.id}`);
|
|
6535
|
+
}
|
|
6536
|
+
if (!isExecuting(outcome.operation)) process.exitCode = 1;
|
|
6537
|
+
}
|
|
6538
|
+
const exportCommand = defineCommand({
|
|
6539
|
+
meta: {
|
|
6540
|
+
name: "export",
|
|
6541
|
+
description: "Export the whole site to a .emdash package file"
|
|
6542
|
+
},
|
|
6543
|
+
args: {
|
|
6544
|
+
...connectionArgs,
|
|
6545
|
+
output: {
|
|
6546
|
+
type: "string",
|
|
6547
|
+
alias: "o",
|
|
6548
|
+
description: "Package file to write (e.g. site.emdash)",
|
|
6549
|
+
required: true
|
|
6550
|
+
},
|
|
6551
|
+
comments: {
|
|
6552
|
+
type: "boolean",
|
|
6553
|
+
default: true,
|
|
6554
|
+
description: "Include comments and reactions (--no-comments leaves them out)"
|
|
6555
|
+
}
|
|
6556
|
+
},
|
|
6557
|
+
async run({ args }) {
|
|
6558
|
+
configureOutputMode(args);
|
|
6559
|
+
try {
|
|
6560
|
+
const result = await runSiteExport({
|
|
6561
|
+
client: createClientFromArgs(args),
|
|
6562
|
+
baseUrl: resolveBaseUrl(args),
|
|
6563
|
+
outputPath: resolve(args.output),
|
|
6564
|
+
comments: args.comments !== false
|
|
6565
|
+
}, runtimeFor());
|
|
6566
|
+
if (wantsJson(args)) output(result, args);
|
|
6567
|
+
else {
|
|
6568
|
+
consola$1.success(`Exported ${result.files} files (${formatBytes(result.bytes)}) to ${result.output}`);
|
|
6569
|
+
consola$1.log(` Package digest: ${result.packageDigest}`);
|
|
6570
|
+
}
|
|
6571
|
+
} catch (error) {
|
|
6572
|
+
fail(error, args);
|
|
6573
|
+
}
|
|
6574
|
+
}
|
|
6575
|
+
});
|
|
6576
|
+
const importCommand = defineCommand({
|
|
6577
|
+
meta: {
|
|
6578
|
+
name: "import",
|
|
6579
|
+
description: [
|
|
6580
|
+
"Import a .emdash package into an empty site: `import <file> --analyze`, then `import <file> --plan <digest> --confirm`.",
|
|
6581
|
+
"Manage an import with `import status|resume|receipt|cancel|abandon <operation-id>`. `cancel` stops the import after its current batch. `abandon` lifts the write block that a failed or cancelled import leaves on the site; it does not delete what the import wrote.",
|
|
6582
|
+
"Exit codes: 0 success, and for `status` an import in progress or complete; 1 an error, a declined prompt, or for `status` an import that failed, was cancelled or abandoned, or expired; 2 the import plan has blockers."
|
|
6583
|
+
].join("\n\n")
|
|
6584
|
+
},
|
|
6585
|
+
args: {
|
|
6586
|
+
target: {
|
|
6587
|
+
type: "positional",
|
|
6588
|
+
description: "Package file, or status | resume | receipt | cancel | abandon",
|
|
6589
|
+
required: true
|
|
6590
|
+
},
|
|
6591
|
+
...connectionArgs,
|
|
6592
|
+
analyze: {
|
|
6593
|
+
type: "boolean",
|
|
6594
|
+
description: "Upload and analyze the package, then print the import plan"
|
|
6595
|
+
},
|
|
6596
|
+
"map-principal": {
|
|
6597
|
+
type: "string",
|
|
6598
|
+
description: "With --analyze: map a package user to a site user, <principal id|email>=<user id|email|none> (repeatable)"
|
|
6599
|
+
},
|
|
6600
|
+
"use-target-title": {
|
|
6601
|
+
type: "boolean",
|
|
6602
|
+
description: "With --analyze: keep this site's title instead of the package's"
|
|
6603
|
+
},
|
|
6604
|
+
"use-target-tagline": {
|
|
6605
|
+
type: "boolean",
|
|
6606
|
+
description: "With --analyze: keep this site's tagline instead of the package's"
|
|
6607
|
+
},
|
|
6608
|
+
plan: {
|
|
6609
|
+
type: "string",
|
|
6610
|
+
description: "Plan digest printed by --analyze; required with --confirm"
|
|
6611
|
+
},
|
|
6612
|
+
confirm: {
|
|
6613
|
+
type: "boolean",
|
|
6614
|
+
description: "Execute the import plan given by --plan"
|
|
6615
|
+
},
|
|
6616
|
+
yes: {
|
|
6617
|
+
type: "boolean",
|
|
6618
|
+
alias: "y",
|
|
6619
|
+
description: "With cancel or abandon: skip the confirmation prompt"
|
|
6620
|
+
}
|
|
6621
|
+
},
|
|
6622
|
+
async run({ args, rawArgs }) {
|
|
6623
|
+
configureOutputMode(args);
|
|
6624
|
+
try {
|
|
6625
|
+
const positionals = args._.map(String);
|
|
6626
|
+
const action = IMPORT_ACTIONS.has(args.target) ? args.target : null;
|
|
6627
|
+
const client = createClientFromArgs(args);
|
|
6628
|
+
const runtime = runtimeFor();
|
|
6629
|
+
if (action) {
|
|
6630
|
+
const operationId = positionals[1];
|
|
6631
|
+
if (!operationId) throw new SiteTransferCliError("INVALID_ARGUMENT", `Usage: emdash site import ${action} <operation-id>`);
|
|
6632
|
+
if (action === "status") {
|
|
6633
|
+
const status = await importStatus(client, operationId, runtime);
|
|
6634
|
+
if (wantsJson(args)) output(status, args);
|
|
6635
|
+
else printOperation(status.operation, status.files);
|
|
6636
|
+
if (UNSUCCESSFUL_STATES.has(status.operation.state)) process.exitCode = 1;
|
|
6637
|
+
return;
|
|
6638
|
+
}
|
|
6639
|
+
if (action === "cancel" || action === "abandon") {
|
|
6640
|
+
if (!await confirmed(args, action, operationId, action === "cancel" ? `Cancel import ${operationId}? A running import stops after its current batch. Anything it already wrote stays on the site.` : `Abandon import ${operationId}? Site writes are unblocked, but data the import already wrote is not deleted.`)) {
|
|
6641
|
+
consola$1.info("Nothing was changed.");
|
|
6642
|
+
process.exitCode = 1;
|
|
6643
|
+
return;
|
|
6644
|
+
}
|
|
6645
|
+
const operation = action === "cancel" ? await cancelImport(client, operationId, runtime) : await abandonImport(client, operationId, runtime);
|
|
6646
|
+
if (wantsJson(args)) output(operationJson(operation), args);
|
|
6647
|
+
else if (action === "cancel") printCancelled(operation);
|
|
6648
|
+
else printAbandoned(operation);
|
|
6649
|
+
return;
|
|
6650
|
+
}
|
|
6651
|
+
if (action === "receipt") {
|
|
6652
|
+
report(await importReceipt(client, operationId, runtime), args, null);
|
|
6653
|
+
return;
|
|
6654
|
+
}
|
|
6655
|
+
const archive = positionals[2] ? resolve(positionals[2]) : null;
|
|
6656
|
+
report(await resumeImport(client, operationId, archive, runtime), args, archive);
|
|
6657
|
+
return;
|
|
6658
|
+
}
|
|
6659
|
+
const archivePath = resolve(args.target);
|
|
6660
|
+
const mapPrincipal = collectFlag(rawArgs, "map-principal");
|
|
6661
|
+
const flags = {
|
|
6662
|
+
mapPrincipal,
|
|
6663
|
+
useTargetTitle: Boolean(args["use-target-title"]),
|
|
6664
|
+
useTargetTagline: Boolean(args["use-target-tagline"])
|
|
6665
|
+
};
|
|
6666
|
+
if (args.confirm && !args.plan) throw new SiteTransferCliError("INVALID_ARGUMENT", "--confirm needs --plan <digest>: review the plan with --analyze first");
|
|
6667
|
+
if (args.plan && !args.confirm) throw new SiteTransferCliError("INVALID_ARGUMENT", "--plan executes an import only together with --confirm");
|
|
6668
|
+
if (args.plan && args.analyze) throw new SiteTransferCliError("INVALID_ARGUMENT", "Use either --analyze or --plan <digest> --confirm, not both");
|
|
6669
|
+
if (args.plan) {
|
|
6670
|
+
if (mapPrincipal.length > 0 || flags.useTargetTitle || flags.useTargetTagline) throw new SiteTransferCliError("INVALID_ARGUMENT", "Decisions can only be changed with --analyze; they change the plan digest");
|
|
6671
|
+
report(await confirmPackage(client, archivePath, normalizePlanDigest(args.plan), runtime), args, archivePath);
|
|
6672
|
+
return;
|
|
6673
|
+
}
|
|
6674
|
+
if (!args.analyze) throw new SiteTransferCliError("INVALID_ARGUMENT", "Choose --analyze to review the import plan, or --plan <digest> --confirm to run it");
|
|
6675
|
+
report(await analyzePackage(client, archivePath, flags, runtime), args, archivePath);
|
|
6676
|
+
} catch (error) {
|
|
6677
|
+
fail(error, args);
|
|
6678
|
+
}
|
|
6679
|
+
}
|
|
6680
|
+
});
|
|
6681
|
+
const siteCommand = defineCommand({
|
|
6682
|
+
meta: {
|
|
6683
|
+
name: "site",
|
|
6684
|
+
description: "Export or import a whole site as a .emdash package"
|
|
6685
|
+
},
|
|
6686
|
+
subCommands: {
|
|
6687
|
+
export: exportCommand,
|
|
6688
|
+
import: importCommand
|
|
6689
|
+
}
|
|
6690
|
+
});
|
|
6691
|
+
|
|
5278
6692
|
//#endregion
|
|
5279
6693
|
//#region src/cli/commands/taxonomy.ts
|
|
5280
6694
|
/**
|
|
@@ -5470,7 +6884,8 @@ runMain(defineCommand({
|
|
|
5470
6884
|
search: searchCommand,
|
|
5471
6885
|
taxonomy: taxonomyCommand,
|
|
5472
6886
|
menu: menuCommand,
|
|
5473
|
-
plugin: pluginCommand
|
|
6887
|
+
plugin: pluginCommand,
|
|
6888
|
+
site: siteCommand
|
|
5474
6889
|
}
|
|
5475
6890
|
}));
|
|
5476
6891
|
|