emdash 0.37.0 → 0.39.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-On1sot_c.mjs +26 -0
- package/dist/action-token-On1sot_c.mjs.map +1 -0
- package/dist/activation-CaMfdBt1.mjs +382 -0
- package/dist/activation-CaMfdBt1.mjs.map +1 -0
- package/dist/adapters-Cq10K4_c.d.mts +171 -0
- package/dist/adapters-Cq10K4_c.d.mts.map +1 -0
- package/dist/after-PcEvMY_6.mjs +96 -0
- package/dist/after-PcEvMY_6.mjs.map +1 -0
- package/dist/allowed-origins-1Sa-2wZK.mjs +116 -0
- package/dist/allowed-origins-1Sa-2wZK.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -3
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +45 -29
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +7 -6
- package/dist/api-DmjKxPCY.mjs +4831 -0
- package/dist/api-DmjKxPCY.mjs.map +1 -0
- package/dist/api-tokens-BIXItFKV.mjs +163 -0
- package/dist/api-tokens-BIXItFKV.mjs.map +1 -0
- package/dist/apply-drpfmqrR.mjs +1005 -0
- package/dist/apply-drpfmqrR.mjs.map +1 -0
- package/dist/artifact-fetch-COiMhVgk.mjs +813 -0
- package/dist/artifact-fetch-COiMhVgk.mjs.map +1 -0
- package/dist/astro/index.d.mts +14 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +123 -13
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +12 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +20 -11
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +11 -9
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts +1 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +154 -28
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +13 -10
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +122 -3041
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +10 -9
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +10 -9
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +13 -12
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +13 -12
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +13 -12
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -21
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -21
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +22 -21
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +21 -54
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/bulk.mjs +15 -14
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/index.mjs +15 -14
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +17 -16
- 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 +19 -18
- 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 +19 -18
- 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 +17 -17
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +21 -20
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +19 -18
- 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 +19 -18
- 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 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +9 -66
- 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 +9 -69
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +66 -59
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +65 -59
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +70 -61
- 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 +87 -63
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +66 -59
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +65 -59
- 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 +85 -63
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +65 -59
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +70 -61
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +90 -66
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +9 -7
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +77 -63
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +67 -61
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +66 -60
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts +8 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +27 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +65 -59
- 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 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +65 -59
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +11 -10
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/index.mjs +10 -9
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +15 -14
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +14 -13
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +14 -13
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +11 -10
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -4
- 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 +10 -9
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +16 -15
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +15 -14
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +15 -14
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +15 -14
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -211
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +18 -17
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +17 -11
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +67 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +35 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +16 -15
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts +9 -2
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +28 -16
- 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 +27 -23
- 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 +27 -23
- 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 +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +27 -12
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +23 -20
- 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 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +25 -12
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +27 -14
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +18 -12
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +14 -12
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/health.d.mts +8 -0
- package/dist/astro/routes/api/health.d.mts.map +1 -0
- package/dist/astro/routes/api/health.mjs +21 -0
- package/dist/astro/routes/api/health.mjs.map +1 -0
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +25 -23
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -11
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +20 -19
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -10
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +15 -14
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +14 -13
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +18 -17
- 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 +25 -23
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +36 -33
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +17 -9
- 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 +192 -110
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +15 -14
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/replace.mjs +12 -11
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +8 -8
- package/dist/astro/routes/api/media/_id_/usage.mjs +23 -22
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +22 -21
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts +8 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +52 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/folders/_id_.mjs +12 -11
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/index.mjs +12 -11
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +14 -13
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +26 -25
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +15 -14
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +95 -24
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts +2 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +22 -40
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +18 -14
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +18 -14
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +20 -22
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.d.mts.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +19 -19
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +27 -23
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +21 -18
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +27 -23
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +65 -59
- 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 +65 -59
- 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 +65 -59
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +65 -59
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +65 -59
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +65 -59
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +16 -14
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +65 -59
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +65 -59
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +16 -14
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +17 -14
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +16 -14
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +10 -9
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +15 -13
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +15 -13
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +15 -13
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +9 -8
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/export.mjs +9 -8
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/index.mjs +10 -9
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +22 -20
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +16 -15
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +15 -14
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +42 -38
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +43 -38
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.mjs +11 -10
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +22 -20
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/visual-editing/action-token.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/action-token.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs +25 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +37 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +20 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -0
- 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 +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +16 -15
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +16 -15
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/index.mjs +16 -15
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +13 -12
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +24 -19
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +14 -13
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +79 -26
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/authoritative-records-DbqshfKD.mjs +5172 -0
- package/dist/authoritative-records-DbqshfKD.mjs.map +1 -0
- package/dist/authorize-BXpfMpp0.mjs +40 -0
- package/dist/authorize-BXpfMpp0.mjs.map +1 -0
- package/dist/backup-BsPQdwnS.mjs +246 -0
- package/dist/backup-BsPQdwnS.mjs.map +1 -0
- package/dist/base64-DvnNgP7e.mjs +63 -0
- package/dist/base64-DvnNgP7e.mjs.map +1 -0
- package/dist/byline-Doh-wt99.mjs +906 -0
- package/dist/byline-Doh-wt99.mjs.map +1 -0
- package/dist/byline-fields-CsrdvaLV.mjs +123 -0
- package/dist/byline-fields-CsrdvaLV.mjs.map +1 -0
- package/dist/byline-registry-D6lWzXk6.mjs +406 -0
- package/dist/byline-registry-D6lWzXk6.mjs.map +1 -0
- package/dist/bylines-Cop0hkoy.mjs +214 -0
- package/dist/bylines-Cop0hkoy.mjs.map +1 -0
- package/dist/bylines-kpBzHPr8.mjs +232 -0
- package/dist/bylines-kpBzHPr8.mjs.map +1 -0
- package/dist/cache-B0pOlXdM.mjs +108 -0
- package/dist/cache-B0pOlXdM.mjs.map +1 -0
- package/dist/capture-triggers-gxQxnxrJ.mjs +362 -0
- package/dist/capture-triggers-gxQxnxrJ.mjs.map +1 -0
- package/dist/challenge-store-CkRdSdd8.mjs +51 -0
- package/dist/challenge-store-CkRdSdd8.mjs.map +1 -0
- package/dist/checksum-Bsi2D9M1.mjs +162 -0
- package/dist/checksum-Bsi2D9M1.mjs.map +1 -0
- package/dist/chrome-tags-D7LGB91U.mjs +24 -0
- package/dist/chrome-tags-D7LGB91U.mjs.map +1 -0
- package/dist/chunks-BmWyou79.mjs +25 -0
- package/dist/chunks-BmWyou79.mjs.map +1 -0
- package/dist/cli/index.mjs +921 -106
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +17 -7
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +17 -12
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-C3Xixmkx.mjs +436 -0
- package/dist/collection-deletion-C3Xixmkx.mjs.map +1 -0
- package/dist/collection-slugs-cache-D9auiKmI.mjs +85 -0
- package/dist/collection-slugs-cache-D9auiKmI.mjs.map +1 -0
- package/dist/comment-DcT8qdPK.mjs +313 -0
- package/dist/comment-DcT8qdPK.mjs.map +1 -0
- package/dist/comment-reaction-DY5-y8Y5.mjs +85 -0
- package/dist/comment-reaction-DY5-y8Y5.mjs.map +1 -0
- package/dist/comments-B67VRNGw.mjs +204 -0
- package/dist/comments-B67VRNGw.mjs.map +1 -0
- package/dist/comments-BVzzt6x5.mjs +99 -0
- package/dist/comments-BVzzt6x5.mjs.map +1 -0
- package/dist/components-DIl9Qzh6.mjs +108 -0
- package/dist/components-DIl9Qzh6.mjs.map +1 -0
- package/dist/config-B2acLeC5.mjs +242 -0
- package/dist/config-B2acLeC5.mjs.map +1 -0
- package/dist/config-CGVeT8Hc.mjs +73 -0
- package/dist/config-CGVeT8Hc.mjs.map +1 -0
- package/dist/config-D3HhLON3.d.mts +39 -0
- package/dist/config-D3HhLON3.d.mts.map +1 -0
- package/dist/config-DS7e4EZ9.d.mts +6387 -0
- package/dist/config-DS7e4EZ9.d.mts.map +1 -0
- package/dist/content-DZ3B5qtA.mjs +2216 -0
- package/dist/content-DZ3B5qtA.mjs.map +1 -0
- package/dist/content-list-query-CbPdzsna.d.mts +26 -0
- package/dist/content-list-query-CbPdzsna.d.mts.map +1 -0
- package/dist/content-policy-CM4skrNi.mjs +46 -0
- package/dist/content-policy-CM4skrNi.mjs.map +1 -0
- package/dist/content-refresh-BHLHJgyt.mjs +3599 -0
- package/dist/content-refresh-BHLHJgyt.mjs.map +1 -0
- package/dist/content-repair-BVll5WNl.mjs +440 -0
- package/dist/content-repair-BVll5WNl.mjs.map +1 -0
- package/dist/context-B195kjqZ.mjs +1835 -0
- package/dist/context-B195kjqZ.mjs.map +1 -0
- package/dist/cron-BcR3RN4K.mjs +282 -0
- package/dist/cron-BcR3RN4K.mjs.map +1 -0
- package/dist/dashboard-CZD4G7k_.mjs +151 -0
- package/dist/dashboard-CZD4G7k_.mjs.map +1 -0
- package/dist/database/migration-lock.d.mts +37 -0
- package/dist/database/migration-lock.d.mts.map +1 -0
- package/dist/database/migration-lock.mjs +76 -0
- package/dist/database/migration-lock.mjs.map +1 -0
- package/dist/database/pg-migration-lock.d.mts +1 -1
- package/dist/database/pg-migration-lock.mjs +1 -1
- package/dist/database/pg-migration-lock.mjs.map +1 -1
- package/dist/datetime-normalization-PeiEdcRY.mjs +187 -0
- package/dist/datetime-normalization-PeiEdcRY.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +4 -3
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +7 -6
- package/dist/db/libsql-migrations.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +7 -6
- package/dist/db/postgres-migrations.mjs.map +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +7 -6
- package/dist/db/sqlite-migrations.mjs.map +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/db-errors-CBD5yMro.mjs +55 -0
- package/dist/db-errors-CBD5yMro.mjs.map +1 -0
- package/dist/default-BtlxWgh9.mjs +81 -0
- package/dist/default-BtlxWgh9.mjs.map +1 -0
- package/dist/deferred-tasks-Ba9fphlE.d.mts +9 -0
- package/dist/deferred-tasks-Ba9fphlE.d.mts.map +1 -0
- package/dist/dev-typegen-CZaPLl3V.mjs +29 -0
- package/dist/dev-typegen-CZaPLl3V.mjs.map +1 -0
- package/dist/device-flow-3E5l0fpH.mjs +466 -0
- package/dist/device-flow-3E5l0fpH.mjs.map +1 -0
- package/dist/dialect-helpers-CtYdsX4W.mjs +307 -0
- package/dist/dialect-helpers-CtYdsX4W.mjs.map +1 -0
- package/dist/direct-executor-ZI8E01Yt.mjs +104 -0
- package/dist/direct-executor-ZI8E01Yt.mjs.map +1 -0
- package/dist/dist-2hDLsLeq.mjs +810 -0
- package/dist/dist-2hDLsLeq.mjs.map +1 -0
- package/dist/email-console-gc-E3Eqj.mjs +50 -0
- package/dist/email-console-gc-E3Eqj.mjs.map +1 -0
- package/dist/emdash-runtime-DZGinqTL.mjs +4041 -0
- package/dist/emdash-runtime-DZGinqTL.mjs.map +1 -0
- package/dist/enrich-C2Mk0lwE.mjs +194 -0
- package/dist/enrich-C2Mk0lwE.mjs.map +1 -0
- package/dist/entry-lock-D3C99MXS.mjs +1520 -0
- package/dist/entry-lock-D3C99MXS.mjs.map +1 -0
- package/dist/entry-lock-D9rnj2Lu.mjs +163 -0
- package/dist/entry-lock-D9rnj2Lu.mjs.map +1 -0
- package/dist/entry-lock-DX7QkqEg.d.mts +3503 -0
- package/dist/entry-lock-DX7QkqEg.d.mts.map +1 -0
- package/dist/entry-locks-CO_KaoU5.mjs +167 -0
- package/dist/entry-locks-CO_KaoU5.mjs.map +1 -0
- package/dist/error-CCTCskie.mjs +90 -0
- package/dist/error-CCTCskie.mjs.map +1 -0
- package/dist/errors-W3PA8HqB.mjs +447 -0
- package/dist/errors-W3PA8HqB.mjs.map +1 -0
- package/dist/escape-DN4Qmjsl.mjs +9 -0
- package/dist/escape-DN4Qmjsl.mjs.map +1 -0
- package/dist/field-defs-cache-B337z8UJ.mjs +77 -0
- package/dist/field-defs-cache-B337z8UJ.mjs.map +1 -0
- package/dist/focal-point-Gr34o-4o.mjs +23 -0
- package/dist/focal-point-Gr34o-4o.mjs.map +1 -0
- package/dist/fts-manager-DMb0sbIQ.mjs +413 -0
- package/dist/fts-manager-DMb0sbIQ.mjs.map +1 -0
- package/dist/hash-CLVFzWvx.mjs +37 -0
- package/dist/hash-CLVFzWvx.mjs.map +1 -0
- package/dist/hook-result-KY1jq21o.d.mts +31 -0
- package/dist/hook-result-KY1jq21o.d.mts.map +1 -0
- package/dist/hreflang-BgS2FqhH.d.mts +50 -0
- package/dist/hreflang-BgS2FqhH.d.mts.map +1 -0
- package/dist/hreflang-CrJwqoeb.mjs +105 -0
- package/dist/hreflang-CrJwqoeb.mjs.map +1 -0
- package/dist/http-route-dispatch-DAKlanXb.mjs +339 -0
- package/dist/http-route-dispatch-DAKlanXb.mjs.map +1 -0
- package/dist/identity-DRGSHEEr.mjs +35 -0
- package/dist/identity-DRGSHEEr.mjs.map +1 -0
- package/dist/import-DFr5B_hC.mjs +2020 -0
- package/dist/import-DFr5B_hC.mjs.map +1 -0
- package/dist/index-CDwKDkTq.d.mts +623 -0
- package/dist/index-CDwKDkTq.d.mts.map +1 -0
- package/dist/index.d.mts +27 -22
- package/dist/index.mjs +101 -86
- package/dist/init-lock-4eRRB4Le.mjs +56 -0
- package/dist/init-lock-4eRRB4Le.mjs.map +1 -0
- package/dist/install-finalization-5Os-QZ-2.mjs +58 -0
- package/dist/install-finalization-5Os-QZ-2.mjs.map +1 -0
- package/dist/lifecycle-7e-Lt_kX.mjs +25 -0
- package/dist/lifecycle-7e-Lt_kX.mjs.map +1 -0
- package/dist/load-Cu5bvCZh.mjs +28 -0
- package/dist/load-Cu5bvCZh.mjs.map +1 -0
- package/dist/loader-t4TxaFiQ.mjs +1004 -0
- package/dist/loader-t4TxaFiQ.mjs.map +1 -0
- package/dist/manifest-builder-D31UoJCu.mjs +189 -0
- package/dist/manifest-builder-D31UoJCu.mjs.map +1 -0
- package/dist/manifest-schema-Bkh8SeHd.mjs +491 -0
- package/dist/manifest-schema-Bkh8SeHd.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 +4 -4
- package/dist/media/local-runtime.d.mts +14 -12
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +12 -11
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-TBlKCwo7.mjs +334 -0
- package/dist/media-TBlKCwo7.mjs.map +1 -0
- package/dist/media-allowlist-s60eAIf6.mjs +44 -0
- package/dist/media-allowlist-s60eAIf6.mjs.map +1 -0
- package/dist/media-folders-ClIRLUQv.mjs +210 -0
- package/dist/media-folders-ClIRLUQv.mjs.map +1 -0
- package/dist/media-url-DY_ijO3B.mjs +43 -0
- package/dist/media-url-DY_ijO3B.mjs.map +1 -0
- package/dist/media-usage-C4NolTpQ.mjs +1833 -0
- package/dist/media-usage-C4NolTpQ.mjs.map +1 -0
- package/dist/media-usage-activation-CAhmb14O.mjs +78 -0
- package/dist/media-usage-activation-CAhmb14O.mjs.map +1 -0
- package/dist/media-usage-work-Cu5DqewW.mjs +586 -0
- package/dist/media-usage-work-Cu5DqewW.mjs.map +1 -0
- package/dist/media-usage-work-DJr3rOEN.mjs +152 -0
- package/dist/media-usage-work-DJr3rOEN.mjs.map +1 -0
- package/dist/media-usage-write-fence-DW5oHT7q.mjs +42 -0
- package/dist/media-usage-write-fence-DW5oHT7q.mjs.map +1 -0
- package/dist/menus-DbgU9z5Q.mjs +3732 -0
- package/dist/menus-DbgU9z5Q.mjs.map +1 -0
- package/dist/menus-Wy8m5NcH.mjs +753 -0
- package/dist/menus-Wy8m5NcH.mjs.map +1 -0
- package/dist/migrations/index.d.mts +2 -2
- package/dist/migrations/index.d.mts.map +1 -1
- package/dist/migrations/index.mjs +6 -5
- package/dist/mime-CCYRC4r1.mjs +36 -0
- package/dist/mime-CCYRC4r1.mjs.map +1 -0
- package/dist/mode-CkmOhFqj.mjs +23 -0
- package/dist/mode-CkmOhFqj.mjs.map +1 -0
- package/dist/node-sqlite-compat-vpVaILnb.mjs +46 -0
- package/dist/node-sqlite-compat-vpVaILnb.mjs.map +1 -0
- package/dist/normalize-dChXQjwS.mjs +191 -0
- package/dist/normalize-dChXQjwS.mjs.map +1 -0
- package/dist/oauth-authorization-DZ-R-hmx.mjs +274 -0
- package/dist/oauth-authorization-DZ-R-hmx.mjs.map +1 -0
- package/dist/oauth-clients-BMPA8vjl.mjs +266 -0
- package/dist/oauth-clients-BMPA8vjl.mjs.map +1 -0
- package/dist/oauth-state-store-0gIdb48-.mjs +50 -0
- package/dist/oauth-state-store-0gIdb48-.mjs.map +1 -0
- package/dist/oauth-user-lookup-ChVW4UWu.mjs +26 -0
- package/dist/oauth-user-lookup-ChVW4UWu.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/object-cache-DlSVbn5Y.mjs +534 -0
- package/dist/object-cache-DlSVbn5Y.mjs.map +1 -0
- package/dist/options-D5WcorD5.mjs +200 -0
- package/dist/options-D5WcorD5.mjs.map +1 -0
- package/dist/options-DAknChnw.d.mts +77 -0
- package/dist/options-DAknChnw.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +13 -0
- package/dist/page/index.mjs.map +1 -1
- package/dist/parse-Cr379Av9.mjs +81 -0
- package/dist/parse-Cr379Av9.mjs.map +1 -0
- package/dist/parse-tj9XLNO_.d.mts +165 -0
- package/dist/parse-tj9XLNO_.d.mts.map +1 -0
- package/dist/passkey-config-BD-wMaCf.mjs +46 -0
- package/dist/passkey-config-BD-wMaCf.mjs.map +1 -0
- package/dist/patterns-Do3iqi7N.mjs +145 -0
- package/dist/patterns-Do3iqi7N.mjs.map +1 -0
- package/dist/placeholder-CubPFn_L.d.mts +306 -0
- package/dist/placeholder-CubPFn_L.d.mts.map +1 -0
- package/dist/plugin-test-runtime.d.mts +97 -0
- package/dist/plugin-test-runtime.d.mts.map +1 -0
- package/dist/plugin-test-runtime.mjs +105 -0
- package/dist/plugin-types.d.mts +53 -15
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-types.mjs +18 -1
- package/dist/plugin-types.mjs.map +1 -0
- package/dist/plugin-utils.d.mts +12 -10
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +12 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +18 -13
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/plugins/host.d.mts +7 -0
- package/dist/plugins/host.mjs +45 -0
- package/dist/plugins/http-wire.d.mts +25 -0
- package/dist/plugins/http-wire.d.mts.map +1 -0
- package/dist/plugins/http-wire.mjs +148 -0
- package/dist/plugins/http-wire.mjs.map +1 -0
- package/dist/plugins/secret-redactor.d.mts +9 -0
- package/dist/plugins/secret-redactor.d.mts.map +1 -0
- package/dist/plugins/secret-redactor.mjs +51 -0
- package/dist/plugins/secret-redactor.mjs.map +1 -0
- package/dist/plugins-DHurtdXQ.mjs +277 -0
- package/dist/plugins-DHurtdXQ.mjs.map +1 -0
- package/dist/policy-lyZnjpwz.mjs +45 -0
- package/dist/policy-lyZnjpwz.mjs.map +1 -0
- package/dist/portable-text-oAwodbPS.mjs +286 -0
- package/dist/portable-text-oAwodbPS.mjs.map +1 -0
- package/dist/preview-Cup2bj8c.mjs +107 -0
- package/dist/preview-Cup2bj8c.mjs.map +1 -0
- package/dist/protocol-C1CNiKX4.d.mts +61 -0
- package/dist/protocol-C1CNiKX4.d.mts.map +1 -0
- package/dist/public-submission-Cs-pFMQK.mjs +245 -0
- package/dist/public-submission-Cs-pFMQK.mjs.map +1 -0
- package/dist/public-url-BWVHsfQv.mjs +101 -0
- package/dist/public-url-BWVHsfQv.mjs.map +1 -0
- package/dist/query-D-lxiOgn.mjs +890 -0
- package/dist/query-D-lxiOgn.mjs.map +1 -0
- package/dist/query-D7kHKOws.mjs +41 -0
- package/dist/query-D7kHKOws.mjs.map +1 -0
- package/dist/rate-limit-CqJn-w4h.mjs +120 -0
- package/dist/rate-limit-CqJn-w4h.mjs.map +1 -0
- package/dist/redirect-BrChFPIu.mjs +17 -0
- package/dist/redirect-BrChFPIu.mjs.map +1 -0
- package/dist/redirect-D2Yo-b6S.mjs +415 -0
- package/dist/redirect-D2Yo-b6S.mjs.map +1 -0
- package/dist/redirects-BCiTaIQ-.mjs +146 -0
- package/dist/redirects-BCiTaIQ-.mjs.map +1 -0
- package/dist/redirects-ByItliuu.mjs +644 -0
- package/dist/redirects-ByItliuu.mjs.map +1 -0
- package/dist/registry/testing.d.mts +14 -0
- package/dist/registry/testing.d.mts.map +1 -0
- package/dist/registry/testing.mjs +255 -0
- package/dist/registry/testing.mjs.map +1 -0
- package/dist/registry-CkuPoZs7.mjs +1222 -0
- package/dist/registry-CkuPoZs7.mjs.map +1 -0
- package/dist/relation-XTAtOpJO.mjs +334 -0
- package/dist/relation-XTAtOpJO.mjs.map +1 -0
- package/dist/relations-B4w-G5U9.mjs +309 -0
- package/dist/relations-B4w-G5U9.mjs.map +1 -0
- package/dist/relations-O63JWBRj.mjs +403 -0
- package/dist/relations-O63JWBRj.mjs.map +1 -0
- package/dist/request-cache-DaMhSQdx.mjs +104 -0
- package/dist/request-cache-DaMhSQdx.mjs.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/request-meta-C8yl_sIs.mjs +141 -0
- package/dist/request-meta-C8yl_sIs.mjs.map +1 -0
- package/dist/resolve-BJIS8wKr.mjs +199 -0
- package/dist/resolve-BJIS8wKr.mjs.map +1 -0
- package/dist/route-wire-D66L2oaZ.mjs +197 -0
- package/dist/route-wire-D66L2oaZ.mjs.map +1 -0
- package/dist/routes-DYsTe-oR.mjs +321 -0
- package/dist/routes-DYsTe-oR.mjs.map +1 -0
- package/dist/runner-3gfxRsJG.d.mts +68 -0
- package/dist/runner-3gfxRsJG.d.mts.map +1 -0
- package/dist/runner-ClrleR8A.mjs +5502 -0
- package/dist/runner-ClrleR8A.mjs.map +1 -0
- package/dist/runtime.d.mts +13 -11
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +6 -5
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema-CPhPM9Do.mjs +420 -0
- package/dist/schema-CPhPM9Do.mjs.map +1 -0
- package/dist/schema-DEERRrKS.mjs +9 -0
- package/dist/schema-DEERRrKS.mjs.map +1 -0
- package/dist/scopes-Bn8_rCSt.mjs +27 -0
- package/dist/scopes-Bn8_rCSt.mjs.map +1 -0
- package/dist/search-lami_Ota.mjs +448 -0
- package/dist/search-lami_Ota.mjs.map +1 -0
- package/dist/secrets-DNgVgz_e.mjs +341 -0
- package/dist/secrets-DNgVgz_e.mjs.map +1 -0
- package/dist/sections-BIpd4Cxf.mjs +346 -0
- package/dist/sections-BIpd4Cxf.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +35 -31
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +27 -26
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-BtU70b7l.mjs +114 -0
- package/dist/seo-BtU70b7l.mjs.map +1 -0
- package/dist/seo-_4qmazxz.mjs +133 -0
- package/dist/seo-_4qmazxz.mjs.map +1 -0
- package/dist/service-Bpy5iTX0.mjs +150 -0
- package/dist/service-Bpy5iTX0.mjs.map +1 -0
- package/dist/session-user-BQeS2Mrb.mjs +51 -0
- package/dist/session-user-BQeS2Mrb.mjs.map +1 -0
- package/dist/settings-DmroR53o.mjs +420 -0
- package/dist/settings-DmroR53o.mjs.map +1 -0
- package/dist/settings-g2F2a3Ub.mjs +51 -0
- package/dist/settings-g2F2a3Ub.mjs.map +1 -0
- package/dist/setup-complete-BrZaXpVV.mjs +26 -0
- package/dist/setup-complete-BrZaXpVV.mjs.map +1 -0
- package/dist/setup-nonce-Cb9-884O.mjs +25 -0
- package/dist/setup-nonce-Cb9-884O.mjs.map +1 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs +104 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs.map +1 -0
- package/dist/site-url-DjhYCaep.mjs +16 -0
- package/dist/site-url-DjhYCaep.mjs.map +1 -0
- package/dist/slugify-T5GHH42D.mjs +17 -0
- package/dist/slugify-T5GHH42D.mjs.map +1 -0
- package/dist/snapshot-C32Xuv3o.mjs +233 -0
- package/dist/snapshot-C32Xuv3o.mjs.map +1 -0
- package/dist/ssrf-Co1GGFZz.mjs +406 -0
- package/dist/ssrf-Co1GGFZz.mjs.map +1 -0
- package/dist/state-C7gCoiHr.mjs +153 -0
- package/dist/state-C7gCoiHr.mjs.map +1 -0
- package/dist/status-DLoBmcDz.mjs +30 -0
- package/dist/status-DLoBmcDz.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-CPctdMKX.d.mts +1519 -0
- package/dist/storage-query-CPctdMKX.d.mts.map +1 -0
- package/dist/target-CUKlGrXb.mjs +27 -0
- package/dist/target-CUKlGrXb.mjs.map +1 -0
- package/dist/taxonomies-BpqpXJUE.mjs +707 -0
- package/dist/taxonomies-BpqpXJUE.mjs.map +1 -0
- package/dist/taxonomies-ClCo4IGO.mjs +899 -0
- package/dist/taxonomies-ClCo4IGO.mjs.map +1 -0
- package/dist/taxonomy-Dj1vpw5E.mjs +508 -0
- package/dist/taxonomy-Dj1vpw5E.mjs.map +1 -0
- package/dist/tokens-Ns02GAma.mjs +171 -0
- package/dist/tokens-Ns02GAma.mjs.map +1 -0
- package/dist/transaction-BcJO4Tmc.mjs +29 -0
- package/dist/transaction-BcJO4Tmc.mjs.map +1 -0
- package/dist/transport-B8P1xsqk.mjs +136 -0
- package/dist/transport-B8P1xsqk.mjs.map +1 -0
- package/dist/transport-BLHZZcD_.d.mts +42 -0
- package/dist/transport-BLHZZcD_.d.mts.map +1 -0
- package/dist/trusted-proxy-Cg7SuD15.mjs +51 -0
- package/dist/trusted-proxy-Cg7SuD15.mjs.map +1 -0
- package/dist/turnstile-DWCSh_Qc.mjs +53 -0
- package/dist/turnstile-DWCSh_Qc.mjs.map +1 -0
- package/dist/types-B3RkqvDW.mjs +156 -0
- package/dist/types-B3RkqvDW.mjs.map +1 -0
- package/dist/types-BkUg2yHx.mjs +92 -0
- package/dist/types-BkUg2yHx.mjs.map +1 -0
- package/dist/types-BtuppOTV.mjs +16 -0
- package/dist/types-BtuppOTV.mjs.map +1 -0
- package/dist/types-CCR3ivXE.d.mts +363 -0
- package/dist/types-CCR3ivXE.d.mts.map +1 -0
- package/dist/types-CSHgU_-_.mjs +18 -0
- package/dist/types-CSHgU_-_.mjs.map +1 -0
- package/dist/types-CbwqGOXm.d.mts +766 -0
- package/dist/types-CbwqGOXm.d.mts.map +1 -0
- package/dist/types-D4RGIc2I.d.mts +198 -0
- package/dist/types-D4RGIc2I.d.mts.map +1 -0
- package/dist/types-DEHidMEk.d.mts +1637 -0
- package/dist/types-DEHidMEk.d.mts.map +1 -0
- package/dist/types-DQeU2SR7.d.mts +279 -0
- package/dist/types-DQeU2SR7.d.mts.map +1 -0
- package/dist/types-DxQWoQLA.d.mts +264 -0
- package/dist/types-DxQWoQLA.d.mts.map +1 -0
- package/dist/types-FBBnGZ2Y.d.mts +198 -0
- package/dist/types-FBBnGZ2Y.d.mts.map +1 -0
- package/dist/types-ZCnlropY.mjs +69 -0
- package/dist/types-ZCnlropY.mjs.map +1 -0
- package/dist/types-_Qtyawiy.d.mts +124 -0
- package/dist/types-_Qtyawiy.d.mts.map +1 -0
- package/dist/types-gC6FAoa_.d.mts +75 -0
- package/dist/types-gC6FAoa_.d.mts.map +1 -0
- package/dist/types-k--LneIF.mjs +22 -0
- package/dist/types-k--LneIF.mjs.map +1 -0
- package/dist/upload-attempts-2xdnoKGe.mjs +27 -0
- package/dist/upload-attempts-2xdnoKGe.mjs.map +1 -0
- package/dist/url-pattern-3m3reMzr.mjs +33 -0
- package/dist/url-pattern-3m3reMzr.mjs.map +1 -0
- package/dist/user-DroRntkx.mjs +171 -0
- package/dist/user-DroRntkx.mjs.map +1 -0
- package/dist/utils-CC2oNGV8.mjs +435 -0
- package/dist/utils-CC2oNGV8.mjs.map +1 -0
- package/dist/validate-BCP9HNDn.mjs +384 -0
- package/dist/validate-BCP9HNDn.mjs.map +1 -0
- package/dist/validate-CyQ7I3xF.d.mts +410 -0
- package/dist/validate-CyQ7I3xF.d.mts.map +1 -0
- package/dist/validate-DANX1-Qi.mjs +120 -0
- package/dist/validate-DANX1-Qi.mjs.map +1 -0
- package/dist/validation-DBy6WF94.mjs +216 -0
- package/dist/validation-DBy6WF94.mjs.map +1 -0
- package/dist/version-B57E4Uo7.mjs +7 -0
- package/dist/version-B57E4Uo7.mjs.map +1 -0
- package/dist/widgets-wQ7Xcgq8.mjs +126 -0
- package/dist/widgets-wQ7Xcgq8.mjs.map +1 -0
- package/dist/wxr-taxonomies-DIHfvEDt.mjs +406 -0
- package/dist/wxr-taxonomies-DIHfvEDt.mjs.map +1 -0
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts +34 -0
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts.map +1 -0
- package/dist/zod-generator-D_yHIWfs.mjs +329 -0
- package/dist/zod-generator-D_yHIWfs.mjs.map +1 -0
- package/package.json +39 -12
- package/src/api/errors.ts +23 -0
- package/src/api/handlers/backup.ts +11 -5
- package/src/api/handlers/content.ts +226 -85
- package/src/api/handlers/dashboard.ts +31 -1
- package/src/api/handlers/entry-lock.ts +206 -0
- package/src/api/handlers/index.ts +3 -0
- package/src/api/handlers/manifest.ts +5 -6
- package/src/api/handlers/marketplace.ts +126 -34
- package/src/api/handlers/media-upload.ts +31 -4
- package/src/api/handlers/menus.ts +9 -0
- package/src/api/handlers/plugin-settings.ts +35 -3
- package/src/api/handlers/redirects.ts +221 -138
- package/src/api/handlers/registry.ts +75 -29
- package/src/api/handlers/revision.ts +16 -27
- package/src/api/handlers/seo.ts +10 -1
- package/src/api/handlers/snapshot.ts +87 -72
- package/src/api/handlers/taxonomies.ts +79 -5
- package/src/api/handlers/validation.ts +120 -19
- package/src/api/openapi/document.ts +133 -11
- package/src/api/schemas/content.ts +32 -12
- package/src/api/schemas/entry-lock.ts +57 -0
- package/src/api/schemas/index.ts +1 -0
- package/src/api/schemas/schema.ts +10 -1
- package/src/api/schemas/search.ts +4 -0
- package/src/api/types.ts +4 -0
- package/src/astro/integration/index.ts +22 -6
- package/src/astro/integration/routes.ts +89 -0
- package/src/astro/integration/runtime.ts +40 -24
- package/src/astro/integration/virtual-modules.ts +4 -0
- package/src/astro/integration/vite-config.ts +31 -0
- package/src/astro/middleware/auth.ts +25 -4
- package/src/astro/middleware/request-context.ts +28 -10
- package/src/astro/middleware.ts +33 -1
- package/src/astro/prefetch.ts +2 -2
- package/src/astro/routes/api/admin/comments/[id]/status.ts +22 -58
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +2 -15
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +2 -25
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +1 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +23 -4
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +12 -2
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +1 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +29 -10
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +8 -2
- package/src/astro/routes/api/admin/plugins/registry/install.ts +15 -4
- package/src/astro/routes/api/admin/plugins/registry/verify.ts +2 -1
- package/src/astro/routes/api/admin/plugins/updates.ts +6 -1
- package/src/astro/routes/api/admin/scheduled-policy-rejections/[collection]/[id].ts +34 -0
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +4 -259
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +10 -0
- package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
- package/src/astro/routes/api/content/[collection]/[id]/plugin-extensions/[pluginId]/[kind]/[extensionId].ts +29 -0
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +21 -4
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +30 -1
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +15 -1
- package/src/astro/routes/api/content/[collection]/[id].ts +27 -2
- package/src/astro/routes/api/content/[collection]/index.ts +3 -0
- package/src/astro/routes/api/health.ts +23 -0
- package/src/astro/routes/api/manifest.ts +14 -4
- package/src/astro/routes/api/mcp.ts +2 -1
- package/src/astro/routes/api/media/asset/[id]/[filename].ts +50 -0
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +13 -81
- package/src/astro/routes/api/redirects/[id].ts +0 -3
- package/src/astro/routes/api/redirects/index.ts +0 -2
- package/src/astro/routes/api/search/index.ts +1 -0
- package/src/astro/routes/api/visual-editing/action-token.ts +36 -0
- package/src/astro/routes/api/visual-editing/content/[collection]/[id]/publish.ts +32 -0
- package/src/astro/routes/api/visual-editing/toolbar-labels.ts +16 -0
- package/src/astro/routes/sitemap-[collection].xml.ts +11 -4
- package/src/astro/types.ts +83 -12
- package/src/cli/commands/bundle-utils.ts +19 -19
- package/src/cli/commands/bundle.ts +9 -6
- package/src/cli/commands/content.ts +32 -6
- package/src/cli/commands/doctor.ts +25 -0
- package/src/cli/commands/export-seed.ts +195 -56
- package/src/cli/commands/migrate.ts +71 -23
- package/src/cli/commands/publish.ts +2 -2
- package/src/client/index.ts +34 -7
- package/src/comments/public-submission.ts +246 -0
- package/src/comments/service.ts +59 -12
- package/src/components/EmDashBodyEnd.astro +4 -1
- package/src/components/EmDashBodyStart.astro +4 -1
- package/src/components/EmDashHead.astro +36 -16
- package/src/components/Gallery.astro +18 -4
- package/src/components/InlineEditor.astro +3 -1
- package/src/components/InlinePortableTextEditor.tsx +106 -11
- package/src/components/PortableText.astro +4 -0
- package/src/components/Table.astro +147 -62
- package/src/components/widgets/Archives.astro +6 -5
- package/src/config/errors.ts +13 -0
- package/src/config/secrets.ts +25 -11
- package/src/content/converters/portable-text-to-prosemirror.ts +26 -2
- package/src/content/converters/prosemirror-to-portable-text.ts +35 -6
- package/src/content/converters/types.ts +10 -0
- package/src/content/known-fields.ts +44 -0
- package/src/database/connection.ts +5 -1
- package/src/database/content-datetime.ts +123 -0
- package/src/database/datetime-storage.ts +452 -0
- package/src/database/dialect-helpers.ts +161 -1
- package/src/database/migration-lock.ts +140 -0
- package/src/database/migrations/075_entry_edit_locks.ts +44 -0
- package/src/database/migrations/076_collection_nav_group.ts +22 -0
- package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
- package/src/database/migrations/078_menu_item_translation_groups.ts +15 -0
- package/src/database/migrations/079_datetime_normalization.ts +13 -0
- package/src/database/migrations/080_content_translation_locale_unique.ts +88 -0
- package/src/database/migrations/081_redirect_write_guards.ts +257 -0
- package/src/database/migrations/082_taxonomy_translation_locale_unique.ts +49 -0
- package/src/database/migrations/runner.ts +63 -15
- package/src/database/pg-migration-lock.ts +2 -2
- package/src/database/repositories/byline.ts +9 -0
- package/src/database/repositories/comment.ts +86 -0
- package/src/database/repositories/content.ts +560 -69
- package/src/database/repositories/entry-locks.ts +257 -0
- package/src/database/repositories/media.ts +35 -4
- package/src/database/repositories/menu.ts +1 -0
- package/src/database/repositories/options.ts +113 -7
- package/src/database/repositories/plugin-storage.ts +159 -0
- package/src/database/repositories/redirect.ts +262 -56
- package/src/database/repositories/revision.ts +116 -17
- package/src/database/repositories/taxonomy.ts +42 -0
- package/src/database/repositories/types.ts +5 -0
- package/src/database/types.ts +26 -1
- package/src/datetime-normalization.ts +311 -0
- package/src/db/node-sqlite-compat.ts +3 -2
- package/src/emdash-runtime.ts +1994 -424
- package/src/fields/image.ts +2 -0
- package/src/i18n/config.ts +6 -6
- package/src/i18n/resolve.ts +98 -15
- package/src/index.ts +101 -0
- package/src/loader.ts +49 -4
- package/src/mcp/server.ts +216 -68
- package/src/media/responsive.ts +23 -0
- package/src/media/usage/content-refresh.ts +2 -1
- package/src/media/usage/extractor.ts +50 -15
- package/src/media/usage/types.ts +1 -1
- package/src/menus/index.ts +64 -35
- package/src/migrations/direct-executor.ts +40 -2
- package/src/migrations/index.ts +1 -0
- package/src/migrations/protocol.ts +11 -1
- package/src/page/seo-contributions.ts +78 -1
- package/src/page/seo-panel.ts +47 -0
- package/src/plugin-test-runtime.ts +17 -0
- package/src/plugin-types.ts +128 -21
- package/src/plugins/adapt-sandbox-entry.ts +34 -27
- package/src/plugins/conditional-storage.ts +30 -0
- package/src/plugins/content-access.ts +170 -0
- package/src/plugins/content-policy.ts +74 -0
- package/src/plugins/context.ts +790 -166
- package/src/plugins/cron.ts +18 -10
- package/src/plugins/define-plugin.ts +55 -54
- package/src/plugins/editor-draft.ts +257 -0
- package/src/plugins/hooks.ts +136 -3
- package/src/plugins/host.ts +29 -0
- package/src/plugins/http-route-dispatch.ts +389 -0
- package/src/plugins/http-wire.ts +180 -0
- package/src/plugins/index.ts +97 -3
- package/src/plugins/install-finalization.ts +77 -0
- package/src/plugins/lifecycle.ts +47 -0
- package/src/plugins/manager.ts +5 -2
- package/src/plugins/manifest-schema.ts +314 -58
- package/src/plugins/media.ts +166 -0
- package/src/plugins/request-meta.ts +12 -2
- package/src/plugins/route-wire.ts +304 -0
- package/src/plugins/routes.ts +38 -5
- package/src/plugins/sandbox/index.ts +4 -0
- package/src/plugins/sandbox/proxy.ts +129 -0
- package/src/plugins/sandbox/types.ts +83 -7
- package/src/plugins/secret-redactor.ts +65 -0
- package/src/plugins/settings.ts +303 -0
- package/src/plugins/state.ts +26 -0
- package/src/plugins/storage-query.ts +45 -0
- package/src/plugins/storage-update.ts +96 -0
- package/src/plugins/types.ts +602 -15
- package/src/query.ts +84 -4
- package/src/registry/authoritative-records.ts +26 -0
- package/src/registry/config.ts +182 -31
- package/src/registry/testing.ts +100 -0
- package/src/registry/types.ts +12 -70
- package/src/scheduled-publish.ts +70 -3
- package/src/schema/collection-slugs-cache.ts +157 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/registry.ts +64 -1
- package/src/schema/types.ts +32 -6
- package/src/schema/zod-generator.ts +5 -13
- package/src/search/fts-manager.ts +3 -3
- package/src/search/query.ts +32 -5
- package/src/search/types.ts +8 -0
- package/src/security/ssrf.ts +167 -141
- package/src/seed/apply.ts +41 -3
- package/src/seed/types.ts +13 -3
- package/src/seed/validate.ts +18 -1
- package/src/seo/hreflang.ts +10 -6
- package/src/seo/index.ts +5 -10
- package/src/seo/media-url.ts +26 -0
- package/src/settings/index.ts +53 -11
- package/src/taxonomies/term-counts.ts +22 -5
- package/src/visual-editing/action-token.ts +31 -0
- package/src/visual-editing/toolbar-bootstrap.ts +31 -6
- package/src/visual-editing/toolbar.ts +103 -12
- package/src/widgets/archives.ts +10 -9
- package/src/widgets/index.ts +11 -1
- package/dist/activation-K0kGBWuJ.mjs +0 -382
- package/dist/activation-K0kGBWuJ.mjs.map +0 -1
- package/dist/adapters-BDQwg236.d.mts +0 -171
- package/dist/adapters-BDQwg236.d.mts.map +0 -1
- package/dist/after-CBU2vkoO.mjs +0 -96
- package/dist/after-CBU2vkoO.mjs.map +0 -1
- package/dist/allowed-origins-BGglilcs.mjs +0 -116
- package/dist/allowed-origins-BGglilcs.mjs.map +0 -1
- package/dist/api-Dz6rgoa3.mjs +0 -10040
- package/dist/api-Dz6rgoa3.mjs.map +0 -1
- package/dist/api-tokens-BSsQACNe.mjs +0 -163
- package/dist/api-tokens-BSsQACNe.mjs.map +0 -1
- package/dist/apply-B4SIOxR1.mjs +0 -980
- package/dist/apply-B4SIOxR1.mjs.map +0 -1
- package/dist/authorize-Bkf_UHhD.mjs +0 -40
- package/dist/authorize-Bkf_UHhD.mjs.map +0 -1
- package/dist/backup-rwVAl9NI.mjs +0 -241
- package/dist/backup-rwVAl9NI.mjs.map +0 -1
- package/dist/base64-CvLhUKQv.mjs +0 -63
- package/dist/base64-CvLhUKQv.mjs.map +0 -1
- package/dist/bundle-C8S2Zl6U.mjs +0 -663
- package/dist/bundle-C8S2Zl6U.mjs.map +0 -1
- package/dist/byline-DuhF7NWl.mjs +0 -902
- package/dist/byline-DuhF7NWl.mjs.map +0 -1
- package/dist/byline-fields-BovY4KYM.mjs +0 -123
- package/dist/byline-fields-BovY4KYM.mjs.map +0 -1
- package/dist/byline-registry-Bpu9-MVs.mjs +0 -406
- package/dist/byline-registry-Bpu9-MVs.mjs.map +0 -1
- package/dist/bylines-CJ5nd6Lw.mjs +0 -232
- package/dist/bylines-CJ5nd6Lw.mjs.map +0 -1
- package/dist/bylines-RwBAeOF1.mjs +0 -214
- package/dist/bylines-RwBAeOF1.mjs.map +0 -1
- package/dist/cache-BF5Kvn59.mjs +0 -108
- package/dist/cache-BF5Kvn59.mjs.map +0 -1
- package/dist/capture-triggers-CNW1q3HK.mjs +0 -362
- package/dist/capture-triggers-CNW1q3HK.mjs.map +0 -1
- package/dist/challenge-store-DQN_Yrck.mjs +0 -51
- package/dist/challenge-store-DQN_Yrck.mjs.map +0 -1
- package/dist/chrome-tags-D8fiZG94.mjs +0 -24
- package/dist/chrome-tags-D8fiZG94.mjs.map +0 -1
- package/dist/chunks-C4szrD8o.mjs +0 -25
- package/dist/chunks-C4szrD8o.mjs.map +0 -1
- package/dist/collection-deletion-Bj07NHbj.mjs +0 -436
- package/dist/collection-deletion-Bj07NHbj.mjs.map +0 -1
- package/dist/comment-reaction-BhrvSHml.mjs +0 -85
- package/dist/comment-reaction-BhrvSHml.mjs.map +0 -1
- package/dist/comment-vxOzWbZN.mjs +0 -255
- package/dist/comment-vxOzWbZN.mjs.map +0 -1
- package/dist/comments-Ct4ensnf.mjs +0 -204
- package/dist/comments-Ct4ensnf.mjs.map +0 -1
- package/dist/components-DJbo1z0S.mjs +0 -108
- package/dist/components-DJbo1z0S.mjs.map +0 -1
- package/dist/config-B9eZ340f.d.mts +0 -34
- package/dist/config-B9eZ340f.d.mts.map +0 -1
- package/dist/config-C3EBstHi.mjs +0 -72
- package/dist/config-C3EBstHi.mjs.map +0 -1
- package/dist/config-it29yDLA.mjs +0 -1163
- package/dist/config-it29yDLA.mjs.map +0 -1
- package/dist/content-DjvM0T92.mjs +0 -1725
- package/dist/content-DjvM0T92.mjs.map +0 -1
- package/dist/content-list-query-Btqd4uV2.d.mts +0 -26
- package/dist/content-list-query-Btqd4uV2.d.mts.map +0 -1
- package/dist/content-refresh-Bwp-8yGy.mjs +0 -3588
- package/dist/content-refresh-Bwp-8yGy.mjs.map +0 -1
- package/dist/content-repair-Czdp7jz5.mjs +0 -440
- package/dist/content-repair-Czdp7jz5.mjs.map +0 -1
- package/dist/context-CX6gxOLW.mjs +0 -1068
- package/dist/context-CX6gxOLW.mjs.map +0 -1
- package/dist/cron-C6o7VppJ.mjs +0 -277
- package/dist/cron-C6o7VppJ.mjs.map +0 -1
- package/dist/dashboard-C2kTeeRI.mjs +0 -140
- package/dist/dashboard-C2kTeeRI.mjs.map +0 -1
- package/dist/db-errors-Cl-sKYTm.mjs +0 -55
- package/dist/db-errors-Cl-sKYTm.mjs.map +0 -1
- package/dist/default-Clra32mw.mjs +0 -81
- package/dist/default-Clra32mw.mjs.map +0 -1
- package/dist/deferred-tasks-CvDETTJO.d.mts +0 -9
- package/dist/deferred-tasks-CvDETTJO.d.mts.map +0 -1
- package/dist/dev-typegen-DzOPfsNj.mjs +0 -29
- package/dist/dev-typegen-DzOPfsNj.mjs.map +0 -1
- package/dist/device-flow-D2oCWvLJ.mjs +0 -466
- package/dist/device-flow-D2oCWvLJ.mjs.map +0 -1
- package/dist/dialect-helpers-BSbfaO3F.mjs +0 -202
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +0 -1
- package/dist/direct-executor-Bfa5_ToE.mjs +0 -85
- package/dist/direct-executor-Bfa5_ToE.mjs.map +0 -1
- package/dist/dist-89xCrGqi.mjs +0 -810
- package/dist/dist-89xCrGqi.mjs.map +0 -1
- package/dist/email-console-Dzb6uGYa.mjs +0 -50
- package/dist/email-console-Dzb6uGYa.mjs.map +0 -1
- package/dist/enrich-BX0IDp4z.mjs +0 -194
- package/dist/enrich-BX0IDp4z.mjs.map +0 -1
- package/dist/error-DFrQjppn.mjs +0 -90
- package/dist/error-DFrQjppn.mjs.map +0 -1
- package/dist/errors-DsVoDUjJ.mjs +0 -427
- package/dist/errors-DsVoDUjJ.mjs.map +0 -1
- package/dist/escape-HmHTC1Is.mjs +0 -9
- package/dist/escape-HmHTC1Is.mjs.map +0 -1
- package/dist/field-defs-cache-BM4SIRqH.mjs +0 -77
- package/dist/field-defs-cache-BM4SIRqH.mjs.map +0 -1
- package/dist/focal-point-BeWFo6Xx.mjs +0 -23
- package/dist/focal-point-BeWFo6Xx.mjs.map +0 -1
- package/dist/fts-manager-Do1BlW2r.mjs +0 -413
- package/dist/fts-manager-Do1BlW2r.mjs.map +0 -1
- package/dist/hash-3JJPlHF2.mjs +0 -37
- package/dist/hash-3JJPlHF2.mjs.map +0 -1
- package/dist/hook-result-DCh2WUpe.d.mts +0 -31
- package/dist/hook-result-DCh2WUpe.d.mts.map +0 -1
- package/dist/hreflang-B6hbAuuO.d.mts +0 -48
- package/dist/hreflang-B6hbAuuO.d.mts.map +0 -1
- package/dist/hreflang-DQbPZliA.mjs +0 -102
- package/dist/hreflang-DQbPZliA.mjs.map +0 -1
- package/dist/identity-DksvEazf.mjs +0 -35
- package/dist/identity-DksvEazf.mjs.map +0 -1
- package/dist/import-CJpaBBBT.mjs +0 -2020
- package/dist/import-CJpaBBBT.mjs.map +0 -1
- package/dist/index-BJNMCWmu.d.mts +0 -6562
- package/dist/index-BJNMCWmu.d.mts.map +0 -1
- package/dist/index-Du8K7bWa.d.mts +0 -278
- package/dist/index-Du8K7bWa.d.mts.map +0 -1
- package/dist/init-lock-DJkX6Hto.mjs +0 -56
- package/dist/init-lock-DJkX6Hto.mjs.map +0 -1
- package/dist/load-CawHjTOH.mjs +0 -28
- package/dist/load-CawHjTOH.mjs.map +0 -1
- package/dist/loader-Z8vl7zTq.mjs +0 -966
- package/dist/loader-Z8vl7zTq.mjs.map +0 -1
- package/dist/manifest-builder-COtzuca2.mjs +0 -189
- package/dist/manifest-builder-COtzuca2.mjs.map +0 -1
- package/dist/manifest-schema-BNWwR8Vd.mjs +0 -301
- package/dist/manifest-schema-BNWwR8Vd.mjs.map +0 -1
- package/dist/media-BBm8Wg3f.mjs +0 -318
- package/dist/media-BBm8Wg3f.mjs.map +0 -1
- package/dist/media-BHjus86Y.mjs +0 -464
- package/dist/media-BHjus86Y.mjs.map +0 -1
- package/dist/media-allowlist-CoTBWoDp.mjs +0 -44
- package/dist/media-allowlist-CoTBWoDp.mjs.map +0 -1
- package/dist/media-folders-BGkATs8n.mjs +0 -210
- package/dist/media-folders-BGkATs8n.mjs.map +0 -1
- package/dist/media-upload-BCidR-EY.mjs +0 -147
- package/dist/media-upload-BCidR-EY.mjs.map +0 -1
- package/dist/media-url-DHoPr0hq.mjs +0 -26
- package/dist/media-url-DHoPr0hq.mjs.map +0 -1
- package/dist/media-usage-CdY5jhSR.mjs +0 -1833
- package/dist/media-usage-CdY5jhSR.mjs.map +0 -1
- package/dist/media-usage-activation-BgeMtK5C.mjs +0 -78
- package/dist/media-usage-activation-BgeMtK5C.mjs.map +0 -1
- package/dist/media-usage-work-CnGCdHxx.mjs +0 -152
- package/dist/media-usage-work-CnGCdHxx.mjs.map +0 -1
- package/dist/media-usage-work-D6D9sMCA.mjs +0 -586
- package/dist/media-usage-work-D6D9sMCA.mjs.map +0 -1
- package/dist/media-usage-write-fence-hjeD4u7s.mjs +0 -42
- package/dist/media-usage-write-fence-hjeD4u7s.mjs.map +0 -1
- package/dist/menus-6qSwTNxG.mjs +0 -4010
- package/dist/menus-6qSwTNxG.mjs.map +0 -1
- package/dist/menus-uvPLXMZf.mjs +0 -744
- package/dist/menus-uvPLXMZf.mjs.map +0 -1
- package/dist/mime-CUIG6x84.mjs +0 -36
- package/dist/mime-CUIG6x84.mjs.map +0 -1
- package/dist/mode-DN_WneRx.mjs +0 -23
- package/dist/mode-DN_WneRx.mjs.map +0 -1
- package/dist/node-sqlite-compat-BuJXIeMz.mjs +0 -46
- package/dist/node-sqlite-compat-BuJXIeMz.mjs.map +0 -1
- package/dist/normalize-C2xNjTSG.mjs +0 -191
- package/dist/normalize-C2xNjTSG.mjs.map +0 -1
- package/dist/oauth-authorization-Dj6Kwc21.mjs +0 -274
- package/dist/oauth-authorization-Dj6Kwc21.mjs.map +0 -1
- package/dist/oauth-clients-FD7I0J8m.mjs +0 -266
- package/dist/oauth-clients-FD7I0J8m.mjs.map +0 -1
- package/dist/oauth-state-store-DkmDOmHs.mjs +0 -50
- package/dist/oauth-state-store-DkmDOmHs.mjs.map +0 -1
- package/dist/oauth-user-lookup-CvIwGpYd.mjs +0 -26
- package/dist/oauth-user-lookup-CvIwGpYd.mjs.map +0 -1
- package/dist/object-cache-DVKnyOfy.mjs +0 -534
- package/dist/object-cache-DVKnyOfy.mjs.map +0 -1
- package/dist/options-BHPeIbBd.mjs +0 -117
- package/dist/options-BHPeIbBd.mjs.map +0 -1
- package/dist/options-CYb4y7hM.d.mts +0 -221
- package/dist/options-CYb4y7hM.d.mts.map +0 -1
- package/dist/parse-Ckpg-Qfp.mjs +0 -81
- package/dist/parse-Ckpg-Qfp.mjs.map +0 -1
- package/dist/passkey-config-O_lj3y0k.mjs +0 -46
- package/dist/passkey-config-O_lj3y0k.mjs.map +0 -1
- package/dist/patterns-D9iDO3j8.mjs +0 -145
- package/dist/patterns-D9iDO3j8.mjs.map +0 -1
- package/dist/placeholder-4X9BrRrp.d.mts +0 -306
- package/dist/placeholder-4X9BrRrp.d.mts.map +0 -1
- package/dist/policy-Dhtwntrt.mjs +0 -45
- package/dist/policy-Dhtwntrt.mjs.map +0 -1
- package/dist/portable-text-U85hOafW.mjs +0 -286
- package/dist/portable-text-U85hOafW.mjs.map +0 -1
- package/dist/preview-B_vJLvf8.mjs +0 -107
- package/dist/preview-B_vJLvf8.mjs.map +0 -1
- package/dist/protocol-JdD2YhY9.d.mts +0 -52
- package/dist/protocol-JdD2YhY9.d.mts.map +0 -1
- package/dist/public-url-CarhZJgf.mjs +0 -101
- package/dist/public-url-CarhZJgf.mjs.map +0 -1
- package/dist/query-BZKZcG5b.mjs +0 -881
- package/dist/query-BZKZcG5b.mjs.map +0 -1
- package/dist/query-BndaFxxp.mjs +0 -41
- package/dist/query-BndaFxxp.mjs.map +0 -1
- package/dist/rate-limit-BZmATC6W.mjs +0 -120
- package/dist/rate-limit-BZmATC6W.mjs.map +0 -1
- package/dist/redirect-CZkbozu9.mjs +0 -313
- package/dist/redirect-CZkbozu9.mjs.map +0 -1
- package/dist/redirect-CzqnLxK-.mjs +0 -17
- package/dist/redirect-CzqnLxK-.mjs.map +0 -1
- package/dist/redirects-BLNOWQTn.mjs +0 -1238
- package/dist/redirects-BLNOWQTn.mjs.map +0 -1
- package/dist/redirects-CqzNM0KM.mjs +0 -579
- package/dist/redirects-CqzNM0KM.mjs.map +0 -1
- package/dist/registry-AZAsRsor.mjs +0 -1179
- package/dist/registry-AZAsRsor.mjs.map +0 -1
- package/dist/relation-04DfKRTO.mjs +0 -334
- package/dist/relation-04DfKRTO.mjs.map +0 -1
- package/dist/relations-C4htk5sb.mjs +0 -309
- package/dist/relations-C4htk5sb.mjs.map +0 -1
- package/dist/relations-CcFwDJdJ.mjs +0 -403
- package/dist/relations-CcFwDJdJ.mjs.map +0 -1
- package/dist/relations-DnRK4YIT.d.mts +0 -3354
- package/dist/relations-DnRK4YIT.d.mts.map +0 -1
- package/dist/request-cache-DH9zdCOD.mjs +0 -104
- package/dist/request-cache-DH9zdCOD.mjs.map +0 -1
- package/dist/request-meta-DYxLlnmz.mjs +0 -140
- package/dist/request-meta-DYxLlnmz.mjs.map +0 -1
- package/dist/resolve-prZ3mP7l.mjs +0 -143
- package/dist/resolve-prZ3mP7l.mjs.map +0 -1
- package/dist/runner-BLIDKpmA.mjs +0 -4676
- package/dist/runner-BLIDKpmA.mjs.map +0 -1
- package/dist/runner-YKfIMnaF.d.mts +0 -67
- package/dist/runner-YKfIMnaF.d.mts.map +0 -1
- package/dist/schema-CGnBeLiW.mjs +0 -9
- package/dist/schema-CGnBeLiW.mjs.map +0 -1
- package/dist/schema-DYr-Vd-L.mjs +0 -420
- package/dist/schema-DYr-Vd-L.mjs.map +0 -1
- package/dist/scopes-BhWvBavj.mjs +0 -27
- package/dist/scopes-BhWvBavj.mjs.map +0 -1
- package/dist/search-C-qDk4kx.mjs +0 -439
- package/dist/search-C-qDk4kx.mjs.map +0 -1
- package/dist/secrets-rEtHt-6z.mjs +0 -330
- package/dist/secrets-rEtHt-6z.mjs.map +0 -1
- package/dist/sections-B_nYvlwn.mjs +0 -346
- package/dist/sections-B_nYvlwn.mjs.map +0 -1
- package/dist/seo-926NRIgt.mjs +0 -133
- package/dist/seo-926NRIgt.mjs.map +0 -1
- package/dist/seo-CVWkdv6x.mjs +0 -113
- package/dist/seo-CVWkdv6x.mjs.map +0 -1
- package/dist/service-CJl3ZAYs.mjs +0 -195
- package/dist/service-CJl3ZAYs.mjs.map +0 -1
- package/dist/session-user-BlMgqCHS.mjs +0 -51
- package/dist/session-user-BlMgqCHS.mjs.map +0 -1
- package/dist/settings--wobrkkC.mjs +0 -258
- package/dist/settings--wobrkkC.mjs.map +0 -1
- package/dist/settings-Cwm6o2jY.mjs +0 -51
- package/dist/settings-Cwm6o2jY.mjs.map +0 -1
- package/dist/setup-complete-DQbClIN2.mjs +0 -26
- package/dist/setup-complete-DQbClIN2.mjs.map +0 -1
- package/dist/setup-nonce-DZCFS2sn.mjs +0 -25
- package/dist/setup-nonce-DZCFS2sn.mjs.map +0 -1
- package/dist/single-flight-cache-BPuGPdcN.mjs +0 -104
- package/dist/single-flight-cache-BPuGPdcN.mjs.map +0 -1
- package/dist/site-url-BrxA_E9H.mjs +0 -16
- package/dist/site-url-BrxA_E9H.mjs.map +0 -1
- package/dist/slugify-B994zkXC.mjs +0 -17
- package/dist/slugify-B994zkXC.mjs.map +0 -1
- package/dist/snapshot--OCDTqdb.mjs +0 -216
- package/dist/snapshot--OCDTqdb.mjs.map +0 -1
- package/dist/ssrf-5sIM5jzl.mjs +0 -349
- package/dist/ssrf-5sIM5jzl.mjs.map +0 -1
- package/dist/state-BpFVsJZB.mjs +0 -136
- package/dist/state-BpFVsJZB.mjs.map +0 -1
- package/dist/status-B777-dXz.mjs +0 -30
- package/dist/status-B777-dXz.mjs.map +0 -1
- package/dist/target-BmR0iTwz.mjs +0 -27
- package/dist/target-BmR0iTwz.mjs.map +0 -1
- package/dist/taxonomies-DkAkMupr.mjs +0 -837
- package/dist/taxonomies-DkAkMupr.mjs.map +0 -1
- package/dist/taxonomies-Wfy_Lg12.mjs +0 -698
- package/dist/taxonomies-Wfy_Lg12.mjs.map +0 -1
- package/dist/taxonomy-tJepplLL.mjs +0 -484
- package/dist/taxonomy-tJepplLL.mjs.map +0 -1
- package/dist/tokens-BCO1oruF.mjs +0 -171
- package/dist/tokens-BCO1oruF.mjs.map +0 -1
- package/dist/transaction-0KOpOyMu.mjs +0 -29
- package/dist/transaction-0KOpOyMu.mjs.map +0 -1
- package/dist/transport-Dr3qtwXC.mjs +0 -136
- package/dist/transport-Dr3qtwXC.mjs.map +0 -1
- package/dist/transport-xh6YKW2G.d.mts +0 -42
- package/dist/transport-xh6YKW2G.d.mts.map +0 -1
- package/dist/trusted-proxy-BR5F1Otp.mjs +0 -51
- package/dist/trusted-proxy-BR5F1Otp.mjs.map +0 -1
- package/dist/types-3qNFPlci.mjs +0 -16
- package/dist/types-3qNFPlci.mjs.map +0 -1
- package/dist/types-75KIqzL9.mjs +0 -142
- package/dist/types-75KIqzL9.mjs.map +0 -1
- package/dist/types-B6GrPic4.d.mts +0 -1335
- package/dist/types-B6GrPic4.d.mts.map +0 -1
- package/dist/types-BuHW4xDE.d.mts +0 -259
- package/dist/types-BuHW4xDE.d.mts.map +0 -1
- package/dist/types-C00oyCZp.d.mts +0 -198
- package/dist/types-C00oyCZp.d.mts.map +0 -1
- package/dist/types-CDtkNSFQ.d.mts +0 -75
- package/dist/types-CDtkNSFQ.d.mts.map +0 -1
- package/dist/types-CPeXo1wF.d.mts +0 -124
- package/dist/types-CPeXo1wF.d.mts.map +0 -1
- package/dist/types-CQPWhPxE.mjs +0 -92
- package/dist/types-CQPWhPxE.mjs.map +0 -1
- package/dist/types-CXFkwEGC.d.mts +0 -198
- package/dist/types-CXFkwEGC.d.mts.map +0 -1
- package/dist/types-DM3vioBY.mjs +0 -18
- package/dist/types-DM3vioBY.mjs.map +0 -1
- package/dist/types-DczELMop.d.mts +0 -363
- package/dist/types-DczELMop.d.mts.map +0 -1
- package/dist/types-DfuTR6dL.mjs +0 -3
- package/dist/types-FV23hEoW.d.mts +0 -743
- package/dist/types-FV23hEoW.d.mts.map +0 -1
- package/dist/types-xDMtUFnO.d.mts +0 -257
- package/dist/types-xDMtUFnO.d.mts.map +0 -1
- package/dist/upload-attempts-BsqoQ1fn.mjs +0 -27
- package/dist/upload-attempts-BsqoQ1fn.mjs.map +0 -1
- package/dist/url-pattern-D4c2czpJ.mjs +0 -33
- package/dist/url-pattern-D4c2czpJ.mjs.map +0 -1
- package/dist/user-BTZ40aq6.mjs +0 -171
- package/dist/user-BTZ40aq6.mjs.map +0 -1
- package/dist/utils-BKvNjjhY.mjs +0 -435
- package/dist/utils-BKvNjjhY.mjs.map +0 -1
- package/dist/validate-BpwoDOgt.mjs +0 -120
- package/dist/validate-BpwoDOgt.mjs.map +0 -1
- package/dist/validate-DE_LRwo9.mjs +0 -379
- package/dist/validate-DE_LRwo9.mjs.map +0 -1
- package/dist/validate-DUP27OYD.d.mts +0 -400
- package/dist/validate-DUP27OYD.d.mts.map +0 -1
- package/dist/validation-BMImFJ11.mjs +0 -153
- package/dist/validation-BMImFJ11.mjs.map +0 -1
- package/dist/version-Bii3suaO.mjs +0 -7
- package/dist/version-Bii3suaO.mjs.map +0 -1
- package/dist/widgets-D3gJ10xU.mjs +0 -122
- package/dist/widgets-D3gJ10xU.mjs.map +0 -1
- package/dist/wxr-taxonomies-B2Og_6rU.d.mts +0 -34
- package/dist/wxr-taxonomies-B2Og_6rU.d.mts.map +0 -1
- package/dist/wxr-taxonomies-Cxngsjwo.mjs +0 -406
- package/dist/wxr-taxonomies-Cxngsjwo.mjs.map +0 -1
- package/dist/zod-generator-BuYSQJB7.mjs +0 -331
- package/dist/zod-generator-BuYSQJB7.mjs.map +0 -1
- /package/dist/{api-tokens-BfYts-sq.mjs → api-tokens-DS1VzN7_.mjs} +0 -0
- /package/dist/{ssrf-Dg3cIT-b.mjs → ssrf-BRpTDMV6.mjs} +0 -0
|
@@ -0,0 +1,1005 @@
|
|
|
1
|
+
import { u as __exportAll } from "./runner-ClrleR8A.mjs";
|
|
2
|
+
import { a as resolveConfiguredLocale, r as getI18nConfig } from "./config-CGVeT8Hc.mjs";
|
|
3
|
+
import { t as OptionsRepository } from "./options-D5WcorD5.mjs";
|
|
4
|
+
import { i as RevisionRepository, t as ContentRepository } from "./content-DZ3B5qtA.mjs";
|
|
5
|
+
import { t as withTransaction } from "./transaction-BcJO4Tmc.mjs";
|
|
6
|
+
import { t as MediaRepository } from "./media-TBlKCwo7.mjs";
|
|
7
|
+
import { t as TaxonomyRepository } from "./taxonomy-Dj1vpw5E.mjs";
|
|
8
|
+
import { t as RedirectRepository } from "./redirect-D2Yo-b6S.mjs";
|
|
9
|
+
import { t as BylineRepository } from "./byline-Doh-wt99.mjs";
|
|
10
|
+
import { t as imageSize } from "./dist-2hDLsLeq.mjs";
|
|
11
|
+
import { t as FTSManager } from "./fts-manager-DMb0sbIQ.mjs";
|
|
12
|
+
import { l as markContentMediaUsageCollectionStaleSafely } from "./content-refresh-BHLHJgyt.mjs";
|
|
13
|
+
import { n as SchemaRegistry } from "./registry-CkuPoZs7.mjs";
|
|
14
|
+
import { c as setSiteSettings, s as invalidateSiteSettingsCache } from "./settings-DmroR53o.mjs";
|
|
15
|
+
import { a as ssrfSafeFetch, s as validateExternalUrl } from "./ssrf-Co1GGFZz.mjs";
|
|
16
|
+
import { t as validateSeed } from "./validate-BCP9HNDn.mjs";
|
|
17
|
+
import { ulid } from "ulidx";
|
|
18
|
+
import mime from "mime/lite";
|
|
19
|
+
|
|
20
|
+
//#region src/seed/apply.ts
|
|
21
|
+
/**
|
|
22
|
+
* Seed engine - applies seed files to database
|
|
23
|
+
*
|
|
24
|
+
* This is the core implementation that bootstraps an EmDash site from a seed file.
|
|
25
|
+
* Apply order is critical for foreign keys and references.
|
|
26
|
+
*/
|
|
27
|
+
var apply_exports = /* @__PURE__ */ __exportAll({ applySeed: () => applySeed });
|
|
28
|
+
async function applySiteSettings(db, settings, onConflict, result) {
|
|
29
|
+
const entries = Object.entries(settings).filter(([, value]) => value !== void 0);
|
|
30
|
+
if (entries.length === 0) return;
|
|
31
|
+
if (onConflict === "update") {
|
|
32
|
+
await setSiteSettings(settings, db);
|
|
33
|
+
result.settings.applied += entries.length;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const options = new OptionsRepository(db);
|
|
37
|
+
let applied = 0;
|
|
38
|
+
try {
|
|
39
|
+
for (const [key, value] of entries) {
|
|
40
|
+
const write = await options.compareAndSet(`site:${key}`, null, value);
|
|
41
|
+
if (!write.applied && onConflict === "error") throw new Error(`Conflict: site setting "site:${key}" already exists`);
|
|
42
|
+
if (write.applied) applied++;
|
|
43
|
+
}
|
|
44
|
+
} finally {
|
|
45
|
+
if (applied > 0) {
|
|
46
|
+
result.settings.applied += applied;
|
|
47
|
+
invalidateSiteSettingsCache();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set a collection's `titleField`/`dateField`: a separate write run after the
|
|
53
|
+
* fields exist, so `updateCollection` can validate them. No-op when neither is set.
|
|
54
|
+
*/
|
|
55
|
+
async function applyDisplayDateFields(registry, collection) {
|
|
56
|
+
if (collection.titleField === void 0 && collection.dateField === void 0) return;
|
|
57
|
+
await registry.updateCollection(collection.slug, {
|
|
58
|
+
titleField: collection.titleField,
|
|
59
|
+
dateField: collection.dateField
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const FILE_EXTENSION_PATTERN = /\.([a-z0-9]+)(?:\?|$)/i;
|
|
63
|
+
/** Pattern to remove file extensions */
|
|
64
|
+
const EXTENSION_PATTERN = /\.[^.]+$/;
|
|
65
|
+
/** Pattern to remove query parameters */
|
|
66
|
+
const QUERY_PARAM_PATTERN = /\?.*$/;
|
|
67
|
+
/** Pattern to remove non-alphanumeric characters (except dash and underscore) */
|
|
68
|
+
const SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
|
|
69
|
+
/** Pattern to collapse multiple hyphens */
|
|
70
|
+
const MULTIPLE_HYPHENS_PATTERN = /-+/g;
|
|
71
|
+
/**
|
|
72
|
+
* Apply a seed file to the database
|
|
73
|
+
*
|
|
74
|
+
* This function is idempotent - safe to run multiple times.
|
|
75
|
+
*
|
|
76
|
+
* @param db - Kysely database instance
|
|
77
|
+
* @param seed - Seed file to apply
|
|
78
|
+
* @param options - Application options
|
|
79
|
+
* @returns Result summary
|
|
80
|
+
*/
|
|
81
|
+
async function applySeed(db, seed, options = {}) {
|
|
82
|
+
const validation = validateSeed(seed);
|
|
83
|
+
if (!validation.valid) throw new Error(`Invalid seed file:\n${validation.errors.join("\n")}`);
|
|
84
|
+
const { includeContent = false, storage, skipMediaDownload = false, onConflict = "skip" } = options;
|
|
85
|
+
const result = {
|
|
86
|
+
collections: {
|
|
87
|
+
created: 0,
|
|
88
|
+
skipped: 0,
|
|
89
|
+
updated: 0
|
|
90
|
+
},
|
|
91
|
+
fields: {
|
|
92
|
+
created: 0,
|
|
93
|
+
skipped: 0,
|
|
94
|
+
updated: 0
|
|
95
|
+
},
|
|
96
|
+
taxonomies: {
|
|
97
|
+
created: 0,
|
|
98
|
+
terms: 0
|
|
99
|
+
},
|
|
100
|
+
bylines: {
|
|
101
|
+
created: 0,
|
|
102
|
+
skipped: 0,
|
|
103
|
+
updated: 0
|
|
104
|
+
},
|
|
105
|
+
menus: {
|
|
106
|
+
created: 0,
|
|
107
|
+
items: 0
|
|
108
|
+
},
|
|
109
|
+
redirects: {
|
|
110
|
+
created: 0,
|
|
111
|
+
skipped: 0,
|
|
112
|
+
updated: 0
|
|
113
|
+
},
|
|
114
|
+
widgetAreas: {
|
|
115
|
+
created: 0,
|
|
116
|
+
widgets: 0
|
|
117
|
+
},
|
|
118
|
+
sections: {
|
|
119
|
+
created: 0,
|
|
120
|
+
skipped: 0,
|
|
121
|
+
updated: 0
|
|
122
|
+
},
|
|
123
|
+
settings: { applied: 0 },
|
|
124
|
+
content: {
|
|
125
|
+
created: 0,
|
|
126
|
+
skipped: 0,
|
|
127
|
+
updated: 0
|
|
128
|
+
},
|
|
129
|
+
media: {
|
|
130
|
+
created: 0,
|
|
131
|
+
skipped: 0
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const mediaContext = {
|
|
135
|
+
db,
|
|
136
|
+
storage: storage ?? null,
|
|
137
|
+
skipMediaDownload,
|
|
138
|
+
mediaCache: /* @__PURE__ */ new Map()
|
|
139
|
+
};
|
|
140
|
+
const seedIdMap = /* @__PURE__ */ new Map();
|
|
141
|
+
const seedBylineIdMap = /* @__PURE__ */ new Map();
|
|
142
|
+
const staleMarkedContentCollections = /* @__PURE__ */ new Set();
|
|
143
|
+
const failedStaleContentCollections = /* @__PURE__ */ new Set();
|
|
144
|
+
const defaultLocale = getI18nConfig()?.defaultLocale ?? seed.defaultLocale ?? "en";
|
|
145
|
+
const markSeedContentCollectionStale = async (collectionSlug) => {
|
|
146
|
+
if (staleMarkedContentCollections.has(collectionSlug)) return;
|
|
147
|
+
if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
|
|
148
|
+
staleMarkedContentCollections.add(collectionSlug);
|
|
149
|
+
failedStaleContentCollections.delete(collectionSlug);
|
|
150
|
+
} else failedStaleContentCollections.add(collectionSlug);
|
|
151
|
+
};
|
|
152
|
+
const retryFailedSeedContentStaleMarks = async () => {
|
|
153
|
+
for (const collectionSlug of failedStaleContentCollections) if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
|
|
154
|
+
staleMarkedContentCollections.add(collectionSlug);
|
|
155
|
+
failedStaleContentCollections.delete(collectionSlug);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
if (seed.settings) await applySiteSettings(db, seed.settings, onConflict, result);
|
|
159
|
+
if (seed.collections) {
|
|
160
|
+
const registry = new SchemaRegistry(db);
|
|
161
|
+
for (const collection of seed.collections) {
|
|
162
|
+
if (await registry.getCollection(collection.slug)) {
|
|
163
|
+
if (onConflict === "error") throw new Error(`Conflict: collection "${collection.slug}" already exists`);
|
|
164
|
+
if (onConflict === "update") {
|
|
165
|
+
await registry.updateCollection(collection.slug, {
|
|
166
|
+
label: collection.label,
|
|
167
|
+
labelSingular: collection.labelSingular,
|
|
168
|
+
description: collection.description,
|
|
169
|
+
icon: collection.icon,
|
|
170
|
+
admin: collection.admin,
|
|
171
|
+
supports: collection.supports || [],
|
|
172
|
+
urlPattern: collection.urlPattern,
|
|
173
|
+
routable: collection.routable,
|
|
174
|
+
hidden: collection.hidden,
|
|
175
|
+
sortOrder: collection.sortOrder,
|
|
176
|
+
group: collection.group,
|
|
177
|
+
commentsEnabled: collection.commentsEnabled,
|
|
178
|
+
editLocking: collection.editLocking
|
|
179
|
+
});
|
|
180
|
+
result.collections.updated++;
|
|
181
|
+
for (const field of collection.fields) if (await registry.getField(collection.slug, field.slug)) {
|
|
182
|
+
await registry.updateField(collection.slug, field.slug, {
|
|
183
|
+
label: field.label,
|
|
184
|
+
type: field.type,
|
|
185
|
+
required: field.required || false,
|
|
186
|
+
unique: field.unique || false,
|
|
187
|
+
searchable: field.searchable || false,
|
|
188
|
+
indexed: field.indexed || false,
|
|
189
|
+
defaultValue: field.defaultValue,
|
|
190
|
+
validation: field.validation,
|
|
191
|
+
widget: field.widget,
|
|
192
|
+
options: field.options
|
|
193
|
+
});
|
|
194
|
+
result.fields.updated++;
|
|
195
|
+
} else {
|
|
196
|
+
await registry.createField(collection.slug, {
|
|
197
|
+
slug: field.slug,
|
|
198
|
+
label: field.label,
|
|
199
|
+
type: field.type,
|
|
200
|
+
required: field.required || false,
|
|
201
|
+
unique: field.unique || false,
|
|
202
|
+
searchable: field.searchable || false,
|
|
203
|
+
indexed: field.indexed || false,
|
|
204
|
+
defaultValue: field.defaultValue,
|
|
205
|
+
validation: field.validation,
|
|
206
|
+
widget: field.widget,
|
|
207
|
+
options: field.options
|
|
208
|
+
});
|
|
209
|
+
result.fields.created++;
|
|
210
|
+
}
|
|
211
|
+
await applyDisplayDateFields(registry, collection);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
result.collections.skipped++;
|
|
215
|
+
result.fields.skipped += collection.fields.length;
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const fields = collection.fields.map((field) => ({
|
|
219
|
+
slug: field.slug,
|
|
220
|
+
label: field.label,
|
|
221
|
+
type: field.type,
|
|
222
|
+
required: field.required || false,
|
|
223
|
+
unique: field.unique || false,
|
|
224
|
+
searchable: field.searchable || false,
|
|
225
|
+
indexed: field.indexed || false,
|
|
226
|
+
defaultValue: field.defaultValue,
|
|
227
|
+
validation: field.validation,
|
|
228
|
+
widget: field.widget,
|
|
229
|
+
options: field.options
|
|
230
|
+
}));
|
|
231
|
+
await registry.createSeedCollection({
|
|
232
|
+
slug: collection.slug,
|
|
233
|
+
label: collection.label,
|
|
234
|
+
labelSingular: collection.labelSingular,
|
|
235
|
+
description: collection.description,
|
|
236
|
+
icon: collection.icon,
|
|
237
|
+
admin: collection.admin,
|
|
238
|
+
supports: collection.supports || [],
|
|
239
|
+
urlPattern: collection.urlPattern,
|
|
240
|
+
routable: collection.routable,
|
|
241
|
+
hidden: collection.hidden,
|
|
242
|
+
sortOrder: collection.sortOrder,
|
|
243
|
+
group: collection.group,
|
|
244
|
+
commentsEnabled: collection.commentsEnabled,
|
|
245
|
+
editLocking: collection.editLocking
|
|
246
|
+
}, fields);
|
|
247
|
+
await applyDisplayDateFields(registry, collection);
|
|
248
|
+
result.collections.created++;
|
|
249
|
+
result.fields.created += fields.length;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (seed.taxonomies) {
|
|
253
|
+
const defSeedIdMap = /* @__PURE__ */ new Map();
|
|
254
|
+
const termSeedIdMap = /* @__PURE__ */ new Map();
|
|
255
|
+
for (const taxonomy of seed.taxonomies) {
|
|
256
|
+
const defLocale = resolveConfiguredLocale(taxonomy.locale ?? defaultLocale);
|
|
257
|
+
const existingDef = await db.selectFrom("_emdash_taxonomy_defs").selectAll().where("name", "=", taxonomy.name).where("locale", "=", defLocale).executeTakeFirst();
|
|
258
|
+
let defId;
|
|
259
|
+
let defTranslationGroup;
|
|
260
|
+
if (existingDef) {
|
|
261
|
+
defId = existingDef.id;
|
|
262
|
+
defTranslationGroup = existingDef.translation_group ?? existingDef.id;
|
|
263
|
+
if (onConflict === "error") throw new Error(`Conflict: taxonomy "${taxonomy.name}" (${defLocale}) already exists`);
|
|
264
|
+
if (onConflict === "update") await db.updateTable("_emdash_taxonomy_defs").set({
|
|
265
|
+
label: taxonomy.label,
|
|
266
|
+
label_singular: taxonomy.labelSingular ?? null,
|
|
267
|
+
hierarchical: taxonomy.hierarchical ? 1 : 0,
|
|
268
|
+
collections: JSON.stringify(taxonomy.collections)
|
|
269
|
+
}).where("id", "=", existingDef.id).execute();
|
|
270
|
+
} else {
|
|
271
|
+
defId = ulid();
|
|
272
|
+
defTranslationGroup = defId;
|
|
273
|
+
if (taxonomy.translationOf) {
|
|
274
|
+
const source = defSeedIdMap.get(taxonomy.translationOf);
|
|
275
|
+
if (source) defTranslationGroup = source.translationGroup;
|
|
276
|
+
else console.warn(`taxonomy "${taxonomy.name}" (${defLocale}): translationOf "${taxonomy.translationOf}" not found yet; minting a fresh group.`);
|
|
277
|
+
}
|
|
278
|
+
await db.insertInto("_emdash_taxonomy_defs").values({
|
|
279
|
+
id: defId,
|
|
280
|
+
name: taxonomy.name,
|
|
281
|
+
label: taxonomy.label,
|
|
282
|
+
label_singular: taxonomy.labelSingular ?? null,
|
|
283
|
+
hierarchical: taxonomy.hierarchical ? 1 : 0,
|
|
284
|
+
collections: JSON.stringify(taxonomy.collections),
|
|
285
|
+
locale: defLocale,
|
|
286
|
+
translation_group: defTranslationGroup
|
|
287
|
+
}).execute();
|
|
288
|
+
result.taxonomies.created++;
|
|
289
|
+
}
|
|
290
|
+
if (taxonomy.id) defSeedIdMap.set(taxonomy.id, {
|
|
291
|
+
id: defId,
|
|
292
|
+
translationGroup: defTranslationGroup
|
|
293
|
+
});
|
|
294
|
+
if (includeContent && taxonomy.terms && taxonomy.terms.length > 0) {
|
|
295
|
+
const termRepo = new TaxonomyRepository(db);
|
|
296
|
+
if (taxonomy.hierarchical) await applyHierarchicalTerms(termRepo, taxonomy.name, defLocale, taxonomy.terms, termSeedIdMap, result, onConflict);
|
|
297
|
+
else for (const term of taxonomy.terms) {
|
|
298
|
+
const termLocale = resolveConfiguredLocale(term.locale ?? defLocale);
|
|
299
|
+
const existing = await termRepo.findBySlug(taxonomy.name, term.slug, termLocale);
|
|
300
|
+
if (existing) {
|
|
301
|
+
if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomy.name}" (${termLocale}) already exists`);
|
|
302
|
+
if (onConflict === "update") {
|
|
303
|
+
await termRepo.update(existing.id, {
|
|
304
|
+
label: term.label,
|
|
305
|
+
data: term.description ? { description: term.description } : {}
|
|
306
|
+
});
|
|
307
|
+
result.taxonomies.terms++;
|
|
308
|
+
}
|
|
309
|
+
if (term.id) termSeedIdMap.set(term.id, existing.id);
|
|
310
|
+
} else {
|
|
311
|
+
const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
|
|
312
|
+
const created = await termRepo.create({
|
|
313
|
+
name: taxonomy.name,
|
|
314
|
+
slug: term.slug,
|
|
315
|
+
label: term.label,
|
|
316
|
+
data: term.description ? { description: term.description } : void 0,
|
|
317
|
+
locale: termLocale,
|
|
318
|
+
translationOf
|
|
319
|
+
});
|
|
320
|
+
if (term.id) termSeedIdMap.set(term.id, created.id);
|
|
321
|
+
result.taxonomies.terms++;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
const { invalidateTaxonomyDefsCache } = await import("./taxonomies-BpqpXJUE.mjs").then((n) => n.f);
|
|
327
|
+
invalidateTaxonomyDefsCache();
|
|
328
|
+
}
|
|
329
|
+
if (includeContent && seed.bylines) {
|
|
330
|
+
const bylineRepo = new BylineRepository(db);
|
|
331
|
+
for (const byline of seed.bylines) {
|
|
332
|
+
const existing = await bylineRepo.findBySlug(byline.slug);
|
|
333
|
+
if (existing) {
|
|
334
|
+
if (onConflict === "error") throw new Error(`Conflict: byline "${byline.slug}" already exists`);
|
|
335
|
+
if (onConflict === "update") {
|
|
336
|
+
const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
|
|
337
|
+
try {
|
|
338
|
+
if (!await bylineRepo.update(existing.id, {
|
|
339
|
+
displayName: byline.displayName,
|
|
340
|
+
bio: byline.bio ?? null,
|
|
341
|
+
websiteUrl: byline.websiteUrl ?? null,
|
|
342
|
+
isGuest: byline.isGuest,
|
|
343
|
+
...avatar ? { avatarMediaId: avatar.id } : {}
|
|
344
|
+
})) throw new Error(`Byline "${byline.slug}" disappeared during update`);
|
|
345
|
+
} catch (error) {
|
|
346
|
+
if (avatar?.created) await deleteMediaRow(db, avatar.id);
|
|
347
|
+
throw error;
|
|
348
|
+
}
|
|
349
|
+
seedBylineIdMap.set(byline.id, existing.id);
|
|
350
|
+
result.bylines.updated++;
|
|
351
|
+
if (avatar?.created) result.media.created++;
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
seedBylineIdMap.set(byline.id, existing.id);
|
|
355
|
+
result.bylines.skipped++;
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
|
|
359
|
+
let createdId;
|
|
360
|
+
try {
|
|
361
|
+
createdId = (await bylineRepo.create({
|
|
362
|
+
slug: byline.slug,
|
|
363
|
+
displayName: byline.displayName,
|
|
364
|
+
bio: byline.bio ?? null,
|
|
365
|
+
websiteUrl: byline.websiteUrl ?? null,
|
|
366
|
+
isGuest: byline.isGuest,
|
|
367
|
+
avatarMediaId: avatar?.id ?? null
|
|
368
|
+
})).id;
|
|
369
|
+
} catch (error) {
|
|
370
|
+
if (avatar?.created) await deleteMediaRow(db, avatar.id);
|
|
371
|
+
throw error;
|
|
372
|
+
}
|
|
373
|
+
seedBylineIdMap.set(byline.id, createdId);
|
|
374
|
+
result.bylines.created++;
|
|
375
|
+
if (avatar?.created) result.media.created++;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (includeContent && seed.content) {
|
|
379
|
+
const contentRepo = new ContentRepository(db);
|
|
380
|
+
const schemaRegistry = new SchemaRegistry(db);
|
|
381
|
+
try {
|
|
382
|
+
for (const [collectionSlug, entries] of Object.entries(seed.content)) {
|
|
383
|
+
const collectionRoutable = (await schemaRegistry.getCollection(collectionSlug))?.routable !== false;
|
|
384
|
+
for (const entry of entries) {
|
|
385
|
+
const entrySlug = typeof entry.slug === "string" && entry.slug.trim().length > 0 ? entry.slug : null;
|
|
386
|
+
const entryLocale = resolveConfiguredLocale(entry.locale ?? defaultLocale);
|
|
387
|
+
const existing = entrySlug ? await contentRepo.findBySlug(collectionSlug, entrySlug, entryLocale) : await contentRepo.findById(collectionSlug, entry.id);
|
|
388
|
+
if (existing) {
|
|
389
|
+
if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists`);
|
|
390
|
+
if (onConflict === "update") {
|
|
391
|
+
const resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
|
|
392
|
+
const status = entry.status || "published";
|
|
393
|
+
let contentMutated = false;
|
|
394
|
+
try {
|
|
395
|
+
await withTransaction(db, async (trx) => {
|
|
396
|
+
const trxContentRepo = new ContentRepository(trx);
|
|
397
|
+
const trxBylineRepo = new BylineRepository(trx);
|
|
398
|
+
const trxRevisionRepo = new RevisionRepository(trx);
|
|
399
|
+
await trxContentRepo.update(collectionSlug, existing.id, {
|
|
400
|
+
status,
|
|
401
|
+
data: resolvedData
|
|
402
|
+
});
|
|
403
|
+
contentMutated = true;
|
|
404
|
+
await applyContentBylines(trxBylineRepo, collectionSlug, existing.id, entry, seedBylineIdMap, true);
|
|
405
|
+
await applyContentTaxonomies(trx, collectionSlug, existing.id, entry, true);
|
|
406
|
+
if (status === "published") {
|
|
407
|
+
const draft = await trxRevisionRepo.create({
|
|
408
|
+
collection: collectionSlug,
|
|
409
|
+
entryId: existing.id,
|
|
410
|
+
data: resolvedData
|
|
411
|
+
});
|
|
412
|
+
try {
|
|
413
|
+
await trxContentRepo.setDraftRevision(collectionSlug, existing.id, draft.id);
|
|
414
|
+
await trxContentRepo.publish(collectionSlug, existing.id, void 0, false, void 0, true, collectionRoutable);
|
|
415
|
+
} catch (error) {
|
|
416
|
+
try {
|
|
417
|
+
await trxRevisionRepo.deleteIfUnreferenced(collectionSlug, existing.id, draft.id);
|
|
418
|
+
} catch (cleanupError) {
|
|
419
|
+
console.error(`[seed] Failed to clean up unstaged revision ${draft.id}:`, cleanupError);
|
|
420
|
+
}
|
|
421
|
+
throw error;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
} catch (error) {
|
|
426
|
+
if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
|
|
427
|
+
throw error;
|
|
428
|
+
}
|
|
429
|
+
seedIdMap.set(entry.id, existing.id);
|
|
430
|
+
result.content.updated++;
|
|
431
|
+
await markSeedContentCollectionStale(collectionSlug);
|
|
432
|
+
continue;
|
|
433
|
+
}
|
|
434
|
+
result.content.skipped++;
|
|
435
|
+
seedIdMap.set(entry.id, existing.id);
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
const resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
|
|
439
|
+
let translationOf;
|
|
440
|
+
if (entry.translationOf) {
|
|
441
|
+
const sourceId = seedIdMap.get(entry.translationOf);
|
|
442
|
+
if (!sourceId) console.warn(`content.${collectionSlug}: translationOf "${entry.translationOf}" not found (not yet created or missing). Skipping translation link.`);
|
|
443
|
+
else translationOf = sourceId;
|
|
444
|
+
}
|
|
445
|
+
const status = entry.status || "published";
|
|
446
|
+
let contentMutated = false;
|
|
447
|
+
let created;
|
|
448
|
+
try {
|
|
449
|
+
created = await withTransaction(db, async (trx) => {
|
|
450
|
+
const trxContentRepo = new ContentRepository(trx);
|
|
451
|
+
const trxBylineRepo = new BylineRepository(trx);
|
|
452
|
+
const item = await trxContentRepo.create({
|
|
453
|
+
...entrySlug ? {} : { id: entry.id },
|
|
454
|
+
type: collectionSlug,
|
|
455
|
+
slug: entrySlug,
|
|
456
|
+
status,
|
|
457
|
+
data: resolvedData,
|
|
458
|
+
locale: entryLocale,
|
|
459
|
+
translationOf,
|
|
460
|
+
publishedAt: status === "published" ? (/* @__PURE__ */ new Date()).toISOString() : null
|
|
461
|
+
});
|
|
462
|
+
contentMutated = true;
|
|
463
|
+
await applyContentBylines(trxBylineRepo, collectionSlug, item.id, entry, seedBylineIdMap);
|
|
464
|
+
await applyContentTaxonomies(trx, collectionSlug, item.id, entry, false);
|
|
465
|
+
if (status === "published") await trxContentRepo.publish(collectionSlug, item.id, void 0, false, void 0, true, collectionRoutable);
|
|
466
|
+
return item;
|
|
467
|
+
});
|
|
468
|
+
} catch (error) {
|
|
469
|
+
if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
|
|
470
|
+
throw error;
|
|
471
|
+
}
|
|
472
|
+
seedIdMap.set(entry.id, created.id);
|
|
473
|
+
result.content.created++;
|
|
474
|
+
await markSeedContentCollectionStale(collectionSlug);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
} finally {
|
|
478
|
+
await retryFailedSeedContentStaleMarks();
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
if (seed.menus) {
|
|
482
|
+
const menuSeedIdMap = /* @__PURE__ */ new Map();
|
|
483
|
+
const itemSeedIdMap = /* @__PURE__ */ new Map();
|
|
484
|
+
for (const menu of seed.menus) {
|
|
485
|
+
const locale = resolveConfiguredLocale(menu.locale ?? defaultLocale);
|
|
486
|
+
const existingMenu = await db.selectFrom("_emdash_menus").selectAll().where("name", "=", menu.name).where("locale", "=", locale).executeTakeFirst();
|
|
487
|
+
let menuId;
|
|
488
|
+
let translationGroup;
|
|
489
|
+
if (existingMenu) {
|
|
490
|
+
menuId = existingMenu.id;
|
|
491
|
+
translationGroup = existingMenu.translation_group ?? existingMenu.id;
|
|
492
|
+
await db.deleteFrom("_emdash_menu_items").where("menu_id", "=", menuId).execute();
|
|
493
|
+
} else {
|
|
494
|
+
menuId = ulid();
|
|
495
|
+
translationGroup = menuId;
|
|
496
|
+
if (menu.translationOf) {
|
|
497
|
+
const source = menuSeedIdMap.get(menu.translationOf);
|
|
498
|
+
if (source) translationGroup = source.translationGroup;
|
|
499
|
+
else console.warn(`menu "${menu.name}" (${locale}): translationOf "${menu.translationOf}" not found yet; minting a fresh group.`);
|
|
500
|
+
}
|
|
501
|
+
await db.insertInto("_emdash_menus").values({
|
|
502
|
+
id: menuId,
|
|
503
|
+
name: menu.name,
|
|
504
|
+
label: menu.label,
|
|
505
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
506
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
507
|
+
locale,
|
|
508
|
+
translation_group: translationGroup
|
|
509
|
+
}).execute();
|
|
510
|
+
result.menus.created++;
|
|
511
|
+
}
|
|
512
|
+
if (menu.id) menuSeedIdMap.set(menu.id, {
|
|
513
|
+
id: menuId,
|
|
514
|
+
translationGroup
|
|
515
|
+
});
|
|
516
|
+
const itemCount = await applyMenuItems(db, menuId, locale, menu.items, null, 0, seedIdMap, itemSeedIdMap);
|
|
517
|
+
result.menus.items += itemCount;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (seed.redirects) {
|
|
521
|
+
const redirectRepo = new RedirectRepository(db);
|
|
522
|
+
for (const redirect of seed.redirects) {
|
|
523
|
+
const existing = await redirectRepo.findBySource(redirect.source);
|
|
524
|
+
if (existing) {
|
|
525
|
+
if (onConflict === "error") throw new Error(`Conflict: redirect "${redirect.source}" already exists`);
|
|
526
|
+
if (onConflict === "update") {
|
|
527
|
+
await redirectRepo.update(existing.id, {
|
|
528
|
+
destination: redirect.destination,
|
|
529
|
+
type: redirect.type,
|
|
530
|
+
enabled: redirect.enabled,
|
|
531
|
+
groupName: redirect.groupName
|
|
532
|
+
});
|
|
533
|
+
result.redirects.updated++;
|
|
534
|
+
continue;
|
|
535
|
+
}
|
|
536
|
+
result.redirects.skipped++;
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
await redirectRepo.create({
|
|
540
|
+
source: redirect.source,
|
|
541
|
+
destination: redirect.destination,
|
|
542
|
+
type: redirect.type,
|
|
543
|
+
enabled: redirect.enabled,
|
|
544
|
+
groupName: redirect.groupName
|
|
545
|
+
});
|
|
546
|
+
result.redirects.created++;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
if (seed.widgetAreas) for (const area of seed.widgetAreas) {
|
|
550
|
+
const existingArea = await db.selectFrom("_emdash_widget_areas").selectAll().where("name", "=", area.name).executeTakeFirst();
|
|
551
|
+
let areaId;
|
|
552
|
+
if (existingArea) {
|
|
553
|
+
areaId = existingArea.id;
|
|
554
|
+
await db.deleteFrom("_emdash_widgets").where("area_id", "=", areaId).execute();
|
|
555
|
+
} else {
|
|
556
|
+
areaId = ulid();
|
|
557
|
+
await db.insertInto("_emdash_widget_areas").values({
|
|
558
|
+
id: areaId,
|
|
559
|
+
name: area.name,
|
|
560
|
+
label: area.label,
|
|
561
|
+
description: area.description ?? null
|
|
562
|
+
}).execute();
|
|
563
|
+
result.widgetAreas.created++;
|
|
564
|
+
}
|
|
565
|
+
for (let i = 0; i < area.widgets.length; i++) {
|
|
566
|
+
const widget = area.widgets[i];
|
|
567
|
+
await applyWidget(db, areaId, widget, i);
|
|
568
|
+
result.widgetAreas.widgets++;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if (seed.sections) for (const section of seed.sections) {
|
|
572
|
+
const existing = await db.selectFrom("_emdash_sections").select("id").where("slug", "=", section.slug).executeTakeFirst();
|
|
573
|
+
if (existing) {
|
|
574
|
+
if (onConflict === "error") throw new Error(`Conflict: section "${section.slug}" already exists`);
|
|
575
|
+
if (onConflict === "update") {
|
|
576
|
+
await db.updateTable("_emdash_sections").set({
|
|
577
|
+
title: section.title,
|
|
578
|
+
description: section.description ?? null,
|
|
579
|
+
keywords: section.keywords ? JSON.stringify(section.keywords) : null,
|
|
580
|
+
content: JSON.stringify(section.content),
|
|
581
|
+
source: section.source || "theme",
|
|
582
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
583
|
+
}).where("id", "=", existing.id).execute();
|
|
584
|
+
result.sections.updated++;
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
result.sections.skipped++;
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
const id = ulid();
|
|
591
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
592
|
+
await db.insertInto("_emdash_sections").values({
|
|
593
|
+
id,
|
|
594
|
+
slug: section.slug,
|
|
595
|
+
title: section.title,
|
|
596
|
+
description: section.description ?? null,
|
|
597
|
+
keywords: section.keywords ? JSON.stringify(section.keywords) : null,
|
|
598
|
+
content: JSON.stringify(section.content),
|
|
599
|
+
preview_media_id: null,
|
|
600
|
+
source: section.source || "theme",
|
|
601
|
+
theme_id: section.source === "theme" ? section.slug : null,
|
|
602
|
+
created_at: now,
|
|
603
|
+
updated_at: now
|
|
604
|
+
}).execute();
|
|
605
|
+
result.sections.created++;
|
|
606
|
+
}
|
|
607
|
+
if (seed.collections) {
|
|
608
|
+
const ftsManager = new FTSManager(db);
|
|
609
|
+
for (const collection of seed.collections) if (collection.supports?.includes("search")) {
|
|
610
|
+
if ((await ftsManager.getSearchableFields(collection.slug)).length > 0) try {
|
|
611
|
+
await ftsManager.enableSearch(collection.slug);
|
|
612
|
+
} catch (err) {
|
|
613
|
+
console.warn(`Failed to enable search for ${collection.slug}:`, err);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
const { invalidateBylineCache } = await import("./bylines-kpBzHPr8.mjs").then((n) => n.t);
|
|
618
|
+
const { invalidateRedirectCache } = await import("./cache-B0pOlXdM.mjs").then((n) => n.t);
|
|
619
|
+
const { invalidateUrlPatternCache } = await import("./query-D-lxiOgn.mjs").then((n) => n.o);
|
|
620
|
+
invalidateBylineCache();
|
|
621
|
+
invalidateRedirectCache();
|
|
622
|
+
invalidateUrlPatternCache();
|
|
623
|
+
return result;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Apply hierarchical taxonomy terms (parents before children)
|
|
627
|
+
*/
|
|
628
|
+
async function applyHierarchicalTerms(termRepo, taxonomyName, defLocale, terms, termSeedIdMap, result, onConflict = "skip") {
|
|
629
|
+
const slugToId = /* @__PURE__ */ new Map();
|
|
630
|
+
const resolveTermLocale = (term) => resolveConfiguredLocale(term.locale ?? defLocale);
|
|
631
|
+
let remaining = [...terms];
|
|
632
|
+
let maxPasses = 10;
|
|
633
|
+
while (remaining.length > 0 && maxPasses > 0) {
|
|
634
|
+
const processedThisPass = [];
|
|
635
|
+
for (const term of remaining) {
|
|
636
|
+
const termLocale = resolveTermLocale(term);
|
|
637
|
+
const parentReady = !term.parent || slugToId.has(`${termLocale}::${term.parent}`);
|
|
638
|
+
const translationReady = !term.translationOf || termSeedIdMap.has(term.translationOf);
|
|
639
|
+
if (!parentReady || !translationReady) continue;
|
|
640
|
+
const parentId = term.parent ? slugToId.get(`${termLocale}::${term.parent}`) : void 0;
|
|
641
|
+
const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
|
|
642
|
+
const existing = await termRepo.findBySlug(taxonomyName, term.slug, termLocale);
|
|
643
|
+
if (existing) {
|
|
644
|
+
if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomyName}" (${termLocale}) already exists`);
|
|
645
|
+
if (onConflict === "update") {
|
|
646
|
+
await termRepo.update(existing.id, {
|
|
647
|
+
label: term.label,
|
|
648
|
+
parentId,
|
|
649
|
+
data: term.description ? { description: term.description } : {}
|
|
650
|
+
});
|
|
651
|
+
result.taxonomies.terms++;
|
|
652
|
+
}
|
|
653
|
+
slugToId.set(`${termLocale}::${term.slug}`, existing.id);
|
|
654
|
+
if (term.id) termSeedIdMap.set(term.id, existing.id);
|
|
655
|
+
} else {
|
|
656
|
+
const created = await termRepo.create({
|
|
657
|
+
name: taxonomyName,
|
|
658
|
+
slug: term.slug,
|
|
659
|
+
label: term.label,
|
|
660
|
+
parentId,
|
|
661
|
+
data: term.description ? { description: term.description } : void 0,
|
|
662
|
+
locale: termLocale,
|
|
663
|
+
translationOf
|
|
664
|
+
});
|
|
665
|
+
slugToId.set(`${termLocale}::${term.slug}`, created.id);
|
|
666
|
+
if (term.id) termSeedIdMap.set(term.id, created.id);
|
|
667
|
+
result.taxonomies.terms++;
|
|
668
|
+
}
|
|
669
|
+
processedThisPass.push(term.slug + "::" + termLocale);
|
|
670
|
+
}
|
|
671
|
+
remaining = remaining.filter((term) => !processedThisPass.includes(term.slug + "::" + resolveTermLocale(term)));
|
|
672
|
+
maxPasses--;
|
|
673
|
+
}
|
|
674
|
+
if (remaining.length > 0) console.warn(`Could not process ${remaining.length} terms due to missing parents/translations`);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Apply byline credits to a content entry.
|
|
678
|
+
* In update mode, clears existing credits even if the seed has none.
|
|
679
|
+
*/
|
|
680
|
+
async function applyContentBylines(bylineRepo, collectionSlug, contentId, entry, seedBylineIdMap, isUpdate = false) {
|
|
681
|
+
if (!entry.bylines || entry.bylines.length === 0) {
|
|
682
|
+
if (isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, []);
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
const credits = entry.bylines.map((credit) => {
|
|
686
|
+
const bylineId = seedBylineIdMap.get(credit.byline);
|
|
687
|
+
if (!bylineId) return null;
|
|
688
|
+
return {
|
|
689
|
+
bylineId,
|
|
690
|
+
roleLabel: credit.roleLabel ?? null
|
|
691
|
+
};
|
|
692
|
+
}).filter((credit) => Boolean(credit));
|
|
693
|
+
if (credits.length !== entry.bylines.length) console.warn(`content.${collectionSlug}.${entry.slug ?? entry.id}: one or more byline refs could not be resolved`);
|
|
694
|
+
if (credits.length > 0 || isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, credits);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Apply taxonomy term assignments to a content entry.
|
|
698
|
+
* In update mode, clears existing assignments before re-attaching.
|
|
699
|
+
*/
|
|
700
|
+
async function applyContentTaxonomies(db, collectionSlug, contentId, entry, isUpdate) {
|
|
701
|
+
const termRepo = new TaxonomyRepository(db);
|
|
702
|
+
if (isUpdate) await termRepo.clearEntryTerms(collectionSlug, contentId);
|
|
703
|
+
if (!entry.taxonomies) {
|
|
704
|
+
if (isUpdate) {
|
|
705
|
+
const { invalidateTermCache } = await import("./taxonomies-BpqpXJUE.mjs").then((n) => n.f);
|
|
706
|
+
invalidateTermCache();
|
|
707
|
+
}
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
for (const [taxonomyName, termSlugs] of Object.entries(entry.taxonomies)) for (const termSlug of termSlugs) {
|
|
711
|
+
const term = await termRepo.findBySlug(taxonomyName, termSlug);
|
|
712
|
+
if (term) await termRepo.attachToEntry(collectionSlug, contentId, term.id);
|
|
713
|
+
}
|
|
714
|
+
const { invalidateTermCache } = await import("./taxonomies-BpqpXJUE.mjs").then((n) => n.f);
|
|
715
|
+
invalidateTermCache();
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Apply menu items recursively.
|
|
719
|
+
*
|
|
720
|
+
* When a `SeedMenuItem` carries `id`/`translationOf`, the import resolves the
|
|
721
|
+
* source item's `translation_group` so cross-locale "same nav entry" links
|
|
722
|
+
* survive export → apply. Items without `translationOf` get a fresh group
|
|
723
|
+
* (= their own id).
|
|
724
|
+
*/
|
|
725
|
+
async function applyMenuItems(db, menuId, locale, items, parentId, startOrder, seedIdMap, itemSeedIdMap) {
|
|
726
|
+
let count = 0;
|
|
727
|
+
let order = startOrder;
|
|
728
|
+
for (const item of items) {
|
|
729
|
+
const itemId = ulid();
|
|
730
|
+
const itemLocale = item.locale ?? locale;
|
|
731
|
+
let referenceId = null;
|
|
732
|
+
let referenceCollection = null;
|
|
733
|
+
if (item.type === "page" || item.type === "post") {
|
|
734
|
+
if (item.ref && seedIdMap.has(item.ref)) {
|
|
735
|
+
referenceId = seedIdMap.get(item.ref);
|
|
736
|
+
referenceCollection = item.collection || `${item.type}s`;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
let translationGroup = itemId;
|
|
740
|
+
if (item.translationOf) {
|
|
741
|
+
const source = itemSeedIdMap.get(item.translationOf);
|
|
742
|
+
if (source) translationGroup = source.translationGroup;
|
|
743
|
+
else console.warn(`menu item "${item.label ?? item.url ?? item.ref ?? "(unlabeled)"}" (${itemLocale}): translationOf "${item.translationOf}" not found yet; minting a fresh group.`);
|
|
744
|
+
}
|
|
745
|
+
await db.insertInto("_emdash_menu_items").values({
|
|
746
|
+
id: itemId,
|
|
747
|
+
menu_id: menuId,
|
|
748
|
+
parent_id: parentId,
|
|
749
|
+
sort_order: order,
|
|
750
|
+
type: item.type,
|
|
751
|
+
reference_collection: referenceCollection,
|
|
752
|
+
reference_id: referenceId,
|
|
753
|
+
custom_url: item.url ?? null,
|
|
754
|
+
label: item.label || "",
|
|
755
|
+
title_attr: item.titleAttr ?? null,
|
|
756
|
+
target: item.target ?? null,
|
|
757
|
+
css_classes: item.cssClasses ?? null,
|
|
758
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
759
|
+
locale: itemLocale,
|
|
760
|
+
translation_group: translationGroup
|
|
761
|
+
}).execute();
|
|
762
|
+
if (item.id) itemSeedIdMap.set(item.id, {
|
|
763
|
+
id: itemId,
|
|
764
|
+
translationGroup
|
|
765
|
+
});
|
|
766
|
+
count++;
|
|
767
|
+
order++;
|
|
768
|
+
if (item.children && item.children.length > 0) {
|
|
769
|
+
const childCount = await applyMenuItems(db, menuId, itemLocale, item.children, itemId, 0, seedIdMap, itemSeedIdMap);
|
|
770
|
+
count += childCount;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return count;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Apply a widget
|
|
777
|
+
*/
|
|
778
|
+
async function applyWidget(db, areaId, widget, sortOrder) {
|
|
779
|
+
await db.insertInto("_emdash_widgets").values({
|
|
780
|
+
id: ulid(),
|
|
781
|
+
area_id: areaId,
|
|
782
|
+
sort_order: sortOrder,
|
|
783
|
+
type: widget.type,
|
|
784
|
+
title: widget.title ?? null,
|
|
785
|
+
content: widget.content ? JSON.stringify(widget.content) : null,
|
|
786
|
+
menu_name: widget.menuName ?? null,
|
|
787
|
+
component_id: widget.componentId ?? null,
|
|
788
|
+
component_props: widget.props ? JSON.stringify(widget.props) : null
|
|
789
|
+
}).execute();
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Type guard for $media reference
|
|
793
|
+
*/
|
|
794
|
+
function isSeedMediaReference(value) {
|
|
795
|
+
if (typeof value !== "object" || value === null || !("$media" in value)) return false;
|
|
796
|
+
const media = value.$media;
|
|
797
|
+
return typeof media === "object" && media !== null && "url" in media && typeof media.url === "string";
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Resolve $ref: and $media references in content data
|
|
801
|
+
*/
|
|
802
|
+
async function resolveReferences(data, seedIdMap, mediaContext, result) {
|
|
803
|
+
const resolved = {};
|
|
804
|
+
for (const [key, value] of Object.entries(data)) resolved[key] = await resolveValue(value, seedIdMap, mediaContext, result);
|
|
805
|
+
return resolved;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Resolve a single value recursively
|
|
809
|
+
*/
|
|
810
|
+
async function resolveValue(value, seedIdMap, mediaContext, result) {
|
|
811
|
+
if (typeof value === "string" && value.startsWith("$ref:")) {
|
|
812
|
+
const seedId = value.slice(5);
|
|
813
|
+
return seedIdMap.get(seedId) ?? value;
|
|
814
|
+
}
|
|
815
|
+
if (isSeedMediaReference(value)) return resolveMedia(value, mediaContext, result);
|
|
816
|
+
if (Array.isArray(value)) return Promise.all(value.map((item) => resolveValue(item, seedIdMap, mediaContext, result)));
|
|
817
|
+
if (typeof value === "object" && value !== null) {
|
|
818
|
+
const resolved = {};
|
|
819
|
+
for (const [k, v] of Object.entries(value)) resolved[k] = await resolveValue(v, seedIdMap, mediaContext, result);
|
|
820
|
+
return resolved;
|
|
821
|
+
}
|
|
822
|
+
return value;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Resolve a seeded byline avatar to a `media` row id. The file is assumed to
|
|
826
|
+
* already exist in storage (the caller supplies its `storageKey`), so nothing
|
|
827
|
+
* is downloaded or uploaded.
|
|
828
|
+
*
|
|
829
|
+
* Idempotent: if a media row with the same `storageKey` already exists it is
|
|
830
|
+
* reused rather than duplicated, so re-applying a seed in `update` mode does
|
|
831
|
+
* not leak rows. `created` reports whether a new row was inserted, so the
|
|
832
|
+
* caller can both account for it and delete it if the subsequent byline write
|
|
833
|
+
* fails (the only cross-dialect way to avoid an orphan — `withTransaction`
|
|
834
|
+
* is a no-op on D1).
|
|
835
|
+
*/
|
|
836
|
+
async function resolveSeedBylineAvatar(db, avatar) {
|
|
837
|
+
const existing = await db.selectFrom("media").select("id").where("storage_key", "=", avatar.storageKey).orderBy("id", "asc").executeTakeFirst();
|
|
838
|
+
if (existing) return {
|
|
839
|
+
id: existing.id,
|
|
840
|
+
created: false
|
|
841
|
+
};
|
|
842
|
+
const basename = avatar.storageKey.split("/").pop();
|
|
843
|
+
const filename = avatar.filename ?? (basename && basename.length > 0 ? basename : avatar.storageKey);
|
|
844
|
+
return {
|
|
845
|
+
id: (await new MediaRepository(db).create({
|
|
846
|
+
filename,
|
|
847
|
+
mimeType: avatar.mimeType ?? "image/jpeg",
|
|
848
|
+
storageKey: avatar.storageKey,
|
|
849
|
+
alt: avatar.alt,
|
|
850
|
+
width: avatar.width,
|
|
851
|
+
height: avatar.height,
|
|
852
|
+
status: "ready"
|
|
853
|
+
})).id,
|
|
854
|
+
created: true
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Delete a media row by id. Best-effort cleanup for a failed byline write: a
|
|
859
|
+
* failure here must not mask the original error that triggered the cleanup, so
|
|
860
|
+
* it is logged and swallowed rather than thrown.
|
|
861
|
+
*/
|
|
862
|
+
async function deleteMediaRow(db, id) {
|
|
863
|
+
try {
|
|
864
|
+
await db.deleteFrom("media").where("id", "=", id).execute();
|
|
865
|
+
} catch (error) {
|
|
866
|
+
console.warn(`[seed] failed to clean up orphaned avatar media ${id}:`, error);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Resolve a $media reference by downloading and uploading the media
|
|
871
|
+
*/
|
|
872
|
+
async function resolveMedia(ref, ctx, result) {
|
|
873
|
+
const { url, alt, filename, caption } = ref.$media;
|
|
874
|
+
const cached = ctx.mediaCache.get(url);
|
|
875
|
+
if (cached) {
|
|
876
|
+
result.media.skipped++;
|
|
877
|
+
return {
|
|
878
|
+
...cached,
|
|
879
|
+
alt: alt ?? cached.alt
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
if (ctx.skipMediaDownload) {
|
|
883
|
+
const mediaValue = {
|
|
884
|
+
provider: "external",
|
|
885
|
+
id: ulid(),
|
|
886
|
+
src: url,
|
|
887
|
+
alt: alt ?? void 0,
|
|
888
|
+
filename: filename ?? void 0
|
|
889
|
+
};
|
|
890
|
+
ctx.mediaCache.set(url, mediaValue);
|
|
891
|
+
result.media.created++;
|
|
892
|
+
return mediaValue;
|
|
893
|
+
}
|
|
894
|
+
if (!ctx.storage) {
|
|
895
|
+
console.warn(`Skipping $media reference (no storage configured): ${url}`);
|
|
896
|
+
result.media.skipped++;
|
|
897
|
+
return null;
|
|
898
|
+
}
|
|
899
|
+
try {
|
|
900
|
+
validateExternalUrl(url);
|
|
901
|
+
console.log(` 📥 Downloading: ${url}`);
|
|
902
|
+
const response = await ssrfSafeFetch(url, { headers: { "User-Agent": "EmDash-CMS/1.0" } });
|
|
903
|
+
if (!response.ok) {
|
|
904
|
+
console.warn(` ⚠️ Failed to download ${url}: ${response.status}`);
|
|
905
|
+
result.media.skipped++;
|
|
906
|
+
return null;
|
|
907
|
+
}
|
|
908
|
+
const contentType = response.headers.get("content-type") || "application/octet-stream";
|
|
909
|
+
const ext = getExtensionFromContentType(contentType) || getExtensionFromUrl(url) || ".bin";
|
|
910
|
+
const storageId = ulid();
|
|
911
|
+
const finalFilename = filename || generateFilename(url, ext);
|
|
912
|
+
const storageKey = `${storageId}${ext}`;
|
|
913
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
914
|
+
const body = new Uint8Array(arrayBuffer);
|
|
915
|
+
let width;
|
|
916
|
+
let height;
|
|
917
|
+
if (contentType.startsWith("image/")) {
|
|
918
|
+
const dimensions = getImageDimensions(body);
|
|
919
|
+
width = dimensions?.width;
|
|
920
|
+
height = dimensions?.height;
|
|
921
|
+
}
|
|
922
|
+
await ctx.storage.upload({
|
|
923
|
+
key: storageKey,
|
|
924
|
+
body,
|
|
925
|
+
contentType
|
|
926
|
+
});
|
|
927
|
+
const mediaValue = {
|
|
928
|
+
provider: "local",
|
|
929
|
+
id: (await new MediaRepository(ctx.db).create({
|
|
930
|
+
filename: finalFilename,
|
|
931
|
+
mimeType: contentType,
|
|
932
|
+
size: body.length,
|
|
933
|
+
width,
|
|
934
|
+
height,
|
|
935
|
+
alt,
|
|
936
|
+
caption,
|
|
937
|
+
storageKey,
|
|
938
|
+
status: "ready"
|
|
939
|
+
})).id,
|
|
940
|
+
alt: alt ?? void 0,
|
|
941
|
+
width,
|
|
942
|
+
height,
|
|
943
|
+
mimeType: contentType,
|
|
944
|
+
filename: finalFilename,
|
|
945
|
+
meta: { storageKey }
|
|
946
|
+
};
|
|
947
|
+
ctx.mediaCache.set(url, mediaValue);
|
|
948
|
+
result.media.created++;
|
|
949
|
+
console.log(` ✅ Uploaded: ${finalFilename}`);
|
|
950
|
+
return mediaValue;
|
|
951
|
+
} catch (error) {
|
|
952
|
+
console.warn(` ⚠️ Error processing $media ${url}:`, error instanceof Error ? error.message : error);
|
|
953
|
+
result.media.skipped++;
|
|
954
|
+
return null;
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Get file extension from content type
|
|
959
|
+
*/
|
|
960
|
+
function getExtensionFromContentType(contentType) {
|
|
961
|
+
const baseMime = contentType.split(";")[0].trim();
|
|
962
|
+
const ext = mime.getExtension(baseMime);
|
|
963
|
+
return ext ? `.${ext}` : null;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Get file extension from URL
|
|
967
|
+
*/
|
|
968
|
+
function getExtensionFromUrl(url) {
|
|
969
|
+
try {
|
|
970
|
+
const match = new URL(url).pathname.match(FILE_EXTENSION_PATTERN);
|
|
971
|
+
return match ? `.${match[1]}` : null;
|
|
972
|
+
} catch {
|
|
973
|
+
return null;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* Generate a filename from URL
|
|
978
|
+
*/
|
|
979
|
+
function generateFilename(url, ext) {
|
|
980
|
+
try {
|
|
981
|
+
return `${(new URL(url).pathname.split("/").pop() || "media").replace(EXTENSION_PATTERN, "").replace(QUERY_PARAM_PATTERN, "").replace(SANITIZE_PATTERN, "-").replace(MULTIPLE_HYPHENS_PATTERN, "-") || "media"}${ext}`;
|
|
982
|
+
} catch {
|
|
983
|
+
return `media${ext}`;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Get image dimensions from buffer using image-size.
|
|
988
|
+
* Supports PNG, JPEG, GIF, WebP, AVIF, SVG, TIFF, and more.
|
|
989
|
+
*/
|
|
990
|
+
function getImageDimensions(buffer) {
|
|
991
|
+
try {
|
|
992
|
+
const result = imageSize(buffer);
|
|
993
|
+
if (result.width != null && result.height != null) return {
|
|
994
|
+
width: result.width,
|
|
995
|
+
height: result.height
|
|
996
|
+
};
|
|
997
|
+
return null;
|
|
998
|
+
} catch {
|
|
999
|
+
return null;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
//#endregion
|
|
1004
|
+
export { apply_exports as n, applySeed as t };
|
|
1005
|
+
//# sourceMappingURL=apply-drpfmqrR.mjs.map
|