emdash 0.34.0 → 0.36.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/activation-K0kGBWuJ.mjs +382 -0
- package/dist/activation-K0kGBWuJ.mjs.map +1 -0
- package/dist/{adapters-34EN2eXO.d.mts → adapters-CzL3H752.d.mts} +10 -3
- package/dist/adapters-CzL3H752.d.mts.map +1 -0
- package/dist/{allowed-origins-DW7sYyqg.mjs → allowed-origins-maylGaHv.mjs} +2 -2
- package/dist/{allowed-origins-DW7sYyqg.mjs.map → allowed-origins-maylGaHv.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +22 -20
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/api-B0w3uBiG.mjs +2269 -0
- package/dist/api-B0w3uBiG.mjs.map +1 -0
- package/dist/{api-tokens-CFXu8F_2.mjs → api-tokens-9YrrCoE6.mjs} +2 -2
- package/dist/{api-tokens-CFXu8F_2.mjs.map → api-tokens-9YrrCoE6.mjs.map} +1 -1
- package/dist/{apply-D5zfeD09.mjs → apply-B_VMpJ2P.mjs} +34 -35
- package/dist/{apply-D5zfeD09.mjs.map → apply-B_VMpJ2P.mjs.map} +1 -1
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +92 -25
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +10 -7
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs +3 -3
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +11 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +255 -1323
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +15 -15
- package/dist/astro/routes/api/admin/bylines/index.mjs +15 -15
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +4 -4
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +14 -13
- 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 +14 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +44 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +16 -11
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +14 -13
- 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 +14 -13
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +54 -48
- 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 +172 -133
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
- 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 +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +7 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +11 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +8 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +10 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +10 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +19 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +2 -2
- 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 +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/complete.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +16 -14
- 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 +16 -14
- 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 +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +16 -16
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +2 -2
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +12 -12
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -10
- 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 +16 -16
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +26 -26
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +42 -42
- package/dist/astro/routes/api/media/_id_/confirm.mjs +11 -11
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
- package/dist/astro/routes/api/media/_id_/usage.mjs +18 -13
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +21 -13
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/folders/_id_.d.mts +10 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs +52 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/index.d.mts +9 -0
- package/dist/astro/routes/api/media/folders/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/index.mjs +41 -0
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -0
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +9 -9
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +28 -19
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/translations.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_.mjs +8 -8
- package/dist/astro/routes/api/menus/index.mjs +8 -8
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
- package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
- package/dist/astro/routes/api/oauth/token.mjs +5 -5
- package/dist/astro/routes/api/openapi.json.mjs +153 -6
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +11 -11
- package/dist/astro/routes/api/redirects/index.mjs +11 -11
- package/dist/astro/routes/api/relations/_id_/index.mjs +16 -14
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +11 -9
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +16 -14
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +52 -46
- 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 +52 -46
- 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 +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +10 -8
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +10 -10
- package/dist/astro/routes/api/search/index.mjs +9 -9
- package/dist/astro/routes/api/search/rebuild.mjs +10 -10
- package/dist/astro/routes/api/search/stats.mjs +5 -5
- package/dist/astro/routes/api/search/suggest.mjs +9 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +9 -9
- package/dist/astro/routes/api/sections/index.mjs +9 -9
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/export.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/index.mjs +7 -7
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +13 -13
- package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
- package/dist/astro/routes/api/setup/admin.mjs +11 -11
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -31
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +31 -35
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +7 -7
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/index.mjs +13 -13
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +4 -4
- 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 +7 -7
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +10 -10
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/types.d.mts +19 -14
- 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/{authorize-1iFJzPaZ.mjs → authorize-ByYs-Uxs.mjs} +2 -2
- package/dist/{authorize-1iFJzPaZ.mjs.map → authorize-ByYs-Uxs.mjs.map} +1 -1
- package/dist/{backup-LHjIAVNP.mjs → backup-ChyHfIoX.mjs} +5 -5
- package/dist/{backup-LHjIAVNP.mjs.map → backup-ChyHfIoX.mjs.map} +1 -1
- package/dist/{bundle-CBEXrBnb.mjs → bundle-DZFhFurR.mjs} +7 -7
- package/dist/{bundle-CBEXrBnb.mjs.map → bundle-DZFhFurR.mjs.map} +1 -1
- package/dist/{byline-pEcoDps8.mjs → byline-Cpnwrje1.mjs} +6 -6
- package/dist/{byline-pEcoDps8.mjs.map → byline-Cpnwrje1.mjs.map} +1 -1
- package/dist/{byline-fields-C5S8wygO.mjs → byline-fields-CAyA_Umd.mjs} +2 -2
- package/dist/{byline-fields-C5S8wygO.mjs.map → byline-fields-CAyA_Umd.mjs.map} +1 -1
- package/dist/{byline-registry-DDun8sxh.mjs → byline-registry-Bpu9-MVs.mjs} +2 -2
- package/dist/{byline-registry-DDun8sxh.mjs.map → byline-registry-Bpu9-MVs.mjs.map} +1 -1
- package/dist/{bylines-BWemdX2k.mjs → bylines-BSo9B9RX.mjs} +7 -7
- package/dist/{bylines-BWemdX2k.mjs.map → bylines-BSo9B9RX.mjs.map} +1 -1
- package/dist/{bylines-DJfSfXCL.mjs → bylines-CHjvehVX.mjs} +3 -3
- package/dist/{bylines-DJfSfXCL.mjs.map → bylines-CHjvehVX.mjs.map} +1 -1
- package/dist/{cache-CBJaDy_E.mjs → cache-5VirJ2Cn.mjs} +4 -4
- package/dist/{cache-CBJaDy_E.mjs.map → cache-5VirJ2Cn.mjs.map} +1 -1
- package/dist/capture-triggers-CNW1q3HK.mjs +362 -0
- package/dist/capture-triggers-CNW1q3HK.mjs.map +1 -0
- package/dist/{challenge-store-CZyFVaad.mjs → challenge-store-D5pSY2S1.mjs} +1 -1
- package/dist/{challenge-store-CZyFVaad.mjs.map → challenge-store-D5pSY2S1.mjs.map} +1 -1
- package/dist/{chunks-DfPax1I0.mjs → chunks-bNiX6_DR.mjs} +2 -2
- package/dist/{chunks-DfPax1I0.mjs.map → chunks-bNiX6_DR.mjs.map} +1 -1
- package/dist/cli/index.mjs +568 -84
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +74 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +54 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/{collection-deletion-C8BugSGz.mjs → collection-deletion-m_oi2c0N.mjs} +13 -356
- package/dist/collection-deletion-m_oi2c0N.mjs.map +1 -0
- package/dist/{comment-Dxlep6cE.mjs → comment-DhvLEdhQ.mjs} +1 -1
- package/dist/{comment-Dxlep6cE.mjs.map → comment-DhvLEdhQ.mjs.map} +1 -1
- package/dist/{comment-reaction-D6qfHKBc.mjs → comment-reaction-CRuItEjt.mjs} +2 -2
- package/dist/{comment-reaction-D6qfHKBc.mjs.map → comment-reaction-CRuItEjt.mjs.map} +1 -1
- package/dist/{comments-CTOuhTSX.mjs → comments-CLj4bi8I.mjs} +2 -2
- package/dist/{comments-CTOuhTSX.mjs.map → comments-CLj4bi8I.mjs.map} +1 -1
- package/dist/{components-CQy3lh9x.mjs → components-v4U4DT2y.mjs} +1 -1
- package/dist/{components-CQy3lh9x.mjs.map → components-v4U4DT2y.mjs.map} +1 -1
- package/dist/config-DrfghTPe.d.mts +34 -0
- package/dist/config-DrfghTPe.d.mts.map +1 -0
- package/dist/{content-BNfwh7xX.mjs → content-CP-SeXNa.mjs} +5 -4
- package/dist/content-CP-SeXNa.mjs.map +1 -0
- package/dist/{content-list-query-DhQ84eVV.d.mts → content-list-query-BhejKVqb.d.mts} +1 -1
- package/dist/{content-list-query-DhQ84eVV.d.mts.map → content-list-query-BhejKVqb.d.mts.map} +1 -1
- package/dist/{content-refresh-DNERP4-f.mjs → content-refresh-DLOfIhYc.mjs} +1094 -93
- package/dist/content-refresh-DLOfIhYc.mjs.map +1 -0
- package/dist/{media-usage-De3qvwjc.mjs → content-repair-BCxzy0r4.mjs} +5 -196
- package/dist/content-repair-BCxzy0r4.mjs.map +1 -0
- package/dist/{context-DRgOvSnW.mjs → context-BR5hRWiK.mjs} +13 -13
- package/dist/{context-DRgOvSnW.mjs.map → context-BR5hRWiK.mjs.map} +1 -1
- package/dist/{cron-Y9aLtgrA.mjs → cron-CWfWrWKG.mjs} +1 -1
- package/dist/{cron-Y9aLtgrA.mjs.map → cron-CWfWrWKG.mjs.map} +1 -1
- package/dist/{dashboard-CB8J89rJ.mjs → dashboard-CkIV2rnQ.mjs} +5 -5
- package/dist/{dashboard-CB8J89rJ.mjs.map → dashboard-CkIV2rnQ.mjs.map} +1 -1
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +32 -9
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +11 -0
- package/dist/db/libsql-migrations.d.mts.map +1 -0
- package/dist/db/libsql-migrations.mjs +57 -0
- package/dist/db/libsql-migrations.mjs.map +1 -0
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +10 -0
- package/dist/db/postgres-migrations.d.mts.map +1 -0
- package/dist/db/postgres-migrations.mjs +47 -0
- package/dist/db/postgres-migrations.mjs.map +1 -0
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +10 -0
- package/dist/db/sqlite-migrations.d.mts.map +1 -0
- package/dist/db/sqlite-migrations.mjs +28 -0
- package/dist/db/sqlite-migrations.mjs.map +1 -0
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +3 -3
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/{default-DdDl3fxv.mjs → default-YMEfcQUx.mjs} +1 -1
- package/dist/{default-DdDl3fxv.mjs.map → default-YMEfcQUx.mjs.map} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts → deferred-tasks-DfqxH5Xf.d.mts} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts.map → deferred-tasks-DfqxH5Xf.d.mts.map} +1 -1
- package/dist/{device-flow-CaioYGK3.mjs → device-flow-CojjSBwb.mjs} +5 -5
- package/dist/{device-flow-CaioYGK3.mjs.map → device-flow-CojjSBwb.mjs.map} +1 -1
- package/dist/direct-executor-BWeWiRYB.mjs +85 -0
- package/dist/direct-executor-BWeWiRYB.mjs.map +1 -0
- package/dist/{dist-D_6CKR8z.mjs → dist-89xCrGqi.mjs} +1 -1
- package/dist/{dist-D_6CKR8z.mjs.map → dist-89xCrGqi.mjs.map} +1 -1
- package/dist/{email-console-BHNjIwiB.mjs → email-console-CEJgR_LB.mjs} +1 -1
- package/dist/{email-console-BHNjIwiB.mjs.map → email-console-CEJgR_LB.mjs.map} +1 -1
- package/dist/{enrich-_ySMEvEE.mjs → enrich-BX0IDp4z.mjs} +3 -3
- package/dist/{enrich-_ySMEvEE.mjs.map → enrich-BX0IDp4z.mjs.map} +1 -1
- package/dist/{error-DupyJZE2.mjs → error-D9w94fjV.mjs} +2 -2
- package/dist/{error-DupyJZE2.mjs.map → error-D9w94fjV.mjs.map} +1 -1
- package/dist/{errors-CLUPm7aD.mjs → errors-n2j49uNf.mjs} +22 -2
- package/dist/errors-n2j49uNf.mjs.map +1 -0
- package/dist/{escape-C_aLKP3H.mjs → escape-DN4Qmjsl.mjs} +1 -1
- package/dist/{escape-C_aLKP3H.mjs.map → escape-DN4Qmjsl.mjs.map} +1 -1
- package/dist/{field-defs-cache-hg6QkjV9.mjs → field-defs-cache-Bh4q6oar.mjs} +5 -5
- package/dist/{field-defs-cache-hg6QkjV9.mjs.map → field-defs-cache-Bh4q6oar.mjs.map} +1 -1
- package/dist/focal-point-BeWFo6Xx.mjs +23 -0
- package/dist/focal-point-BeWFo6Xx.mjs.map +1 -0
- package/dist/{fts-manager-CZ-5dVwJ.mjs → fts-manager-BhOdW0bi.mjs} +3 -3
- package/dist/{fts-manager-CZ-5dVwJ.mjs.map → fts-manager-BhOdW0bi.mjs.map} +1 -1
- package/dist/{hash-Cg0TXJPV.mjs → hash-CTcngWvj.mjs} +1 -1
- package/dist/{hash-Cg0TXJPV.mjs.map → hash-CTcngWvj.mjs.map} +1 -1
- package/dist/{hreflang-D3Uehfv2.d.mts → hreflang-7pTHsLZJ.d.mts} +2 -2
- package/dist/{hreflang-D3Uehfv2.d.mts.map → hreflang-7pTHsLZJ.d.mts.map} +1 -1
- package/dist/{hreflang-DNswoYsi.mjs → hreflang-Huc6O5wa.mjs} +7 -7
- package/dist/{hreflang-DNswoYsi.mjs.map → hreflang-Huc6O5wa.mjs.map} +1 -1
- package/dist/identity-DXmb4aVp.mjs +35 -0
- package/dist/identity-DXmb4aVp.mjs.map +1 -0
- package/dist/{import-B41u8Rot.mjs → import-C4_O3KXU.mjs} +5 -5
- package/dist/{import-B41u8Rot.mjs.map → import-C4_O3KXU.mjs.map} +1 -1
- package/dist/{index-Cof4-Fab.d.mts → index-6bRee8zb.d.mts} +3 -3
- package/dist/{index-Cof4-Fab.d.mts.map → index-6bRee8zb.d.mts.map} +1 -1
- package/dist/{index-C3Y-rsyN.d.mts → index-DWbJrsAg.d.mts} +138 -83
- package/dist/index-DWbJrsAg.d.mts.map +1 -0
- package/dist/index.d.mts +21 -20
- package/dist/index.mjs +78 -72
- package/dist/{init-lock-6b309ZrF.mjs → init-lock-DJkX6Hto.mjs} +1 -1
- package/dist/{init-lock-6b309ZrF.mjs.map → init-lock-DJkX6Hto.mjs.map} +1 -1
- package/dist/{load-DmvJrtxS.mjs → load-Bo7fZAbg.mjs} +2 -2
- package/dist/{load-DmvJrtxS.mjs.map → load-Bo7fZAbg.mjs.map} +1 -1
- package/dist/{loader-DLBqRiGP.mjs → loader-ZsjE4paL.mjs} +2 -2
- package/dist/{loader-DLBqRiGP.mjs.map → loader-ZsjE4paL.mjs.map} +1 -1
- package/dist/manifest-builder-QXuqvVMP.mjs +189 -0
- package/dist/manifest-builder-QXuqvVMP.mjs.map +1 -0
- package/dist/{manifest-schema-BXbUAHod.mjs → manifest-schema-CUYPfCEH.mjs} +1 -1
- package/dist/{manifest-schema-BXbUAHod.mjs.map → manifest-schema-CUYPfCEH.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +13 -3
- package/dist/media/index.mjs.map +1 -1
- 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 +11 -5
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-BWWWb8kg.mjs → media-BjwNuLEu.mjs} +100 -6
- package/dist/media-BjwNuLEu.mjs.map +1 -0
- package/dist/{media-CzhAn2--.mjs → media-D6SeAfBl.mjs} +41 -12
- package/dist/media-D6SeAfBl.mjs.map +1 -0
- package/dist/{media-allowlist-BD6HhgXA.mjs → media-allowlist-D35v7bmL.mjs} +3 -2
- package/dist/media-allowlist-D35v7bmL.mjs.map +1 -0
- package/dist/media-folders-D-0CmRZj.mjs +210 -0
- package/dist/media-folders-D-0CmRZj.mjs.map +1 -0
- package/dist/{media-upload-9yas9zGH.mjs → media-upload-C7bLXGcI.mjs} +9 -9
- package/dist/{media-upload-9yas9zGH.mjs.map → media-upload-C7bLXGcI.mjs.map} +1 -1
- package/dist/{media-url-BvoX88FA.mjs → media-url-DH7giMx_.mjs} +1 -1
- package/dist/{media-url-BvoX88FA.mjs.map → media-url-DH7giMx_.mjs.map} +1 -1
- package/dist/media-usage-BTRJvS6V.mjs +1833 -0
- package/dist/media-usage-BTRJvS6V.mjs.map +1 -0
- package/dist/media-usage-activation-Dx0kPV6b.mjs +78 -0
- package/dist/media-usage-activation-Dx0kPV6b.mjs.map +1 -0
- package/dist/{media-usage-work-DrCbqBcl.mjs → media-usage-work-C-fhM30c.mjs} +221 -59
- package/dist/media-usage-work-C-fhM30c.mjs.map +1 -0
- package/dist/{media-usage-work-B9Bksh_b.mjs → media-usage-work-DWb2XPMI.mjs} +4 -4
- package/dist/{media-usage-work-B9Bksh_b.mjs.map → media-usage-work-DWb2XPMI.mjs.map} +1 -1
- package/dist/{media-usage-write-fence-aHEgN1zB.mjs → media-usage-write-fence-BwoJVRDC.mjs} +2 -2
- package/dist/{media-usage-write-fence-aHEgN1zB.mjs.map → media-usage-write-fence-BwoJVRDC.mjs.map} +1 -1
- package/dist/{menus-fxvEDYE6.mjs → menus-CD7EFLwz.mjs} +3 -3
- package/dist/{menus-fxvEDYE6.mjs.map → menus-CD7EFLwz.mjs.map} +1 -1
- package/dist/{menus-CC-yn1F9.mjs → menus-CNg0QlDt.mjs} +42 -26
- package/dist/menus-CNg0QlDt.mjs.map +1 -0
- package/dist/migrations/index.d.mts +22 -0
- package/dist/migrations/index.d.mts.map +1 -0
- package/dist/migrations/index.mjs +7 -0
- package/dist/{mime-DfIVjNkr.mjs → mime-CUIG6x84.mjs} +1 -1
- package/dist/mime-CUIG6x84.mjs.map +1 -0
- package/dist/{mode-Bpe-tNNy.mjs → mode-DaUM_MB2.mjs} +1 -1
- package/dist/{mode-Bpe-tNNy.mjs.map → mode-DaUM_MB2.mjs.map} +1 -1
- package/dist/node-sqlite-compat-Udb4Y-rs.mjs +46 -0
- package/dist/node-sqlite-compat-Udb4Y-rs.mjs.map +1 -0
- package/dist/{normalize-Bc-s_r-a.mjs → normalize-CSxdKBVa.mjs} +22 -1
- package/dist/normalize-CSxdKBVa.mjs.map +1 -0
- package/dist/{oauth-authorization-BXO1MKej.mjs → oauth-authorization-Dpsb-fMJ.mjs} +5 -5
- package/dist/{oauth-authorization-BXO1MKej.mjs.map → oauth-authorization-Dpsb-fMJ.mjs.map} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs → oauth-clients-Bxnoe_67.mjs} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs.map → oauth-clients-Bxnoe_67.mjs.map} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs → oauth-state-store-0C4s0K6w.mjs} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs.map → oauth-state-store-0C4s0K6w.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs → oauth-user-lookup-wlGYSeqX.mjs} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs.map → oauth-user-lookup-wlGYSeqX.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-CBXIHUoT.mjs → options-BHPeIbBd.mjs} +1 -1
- package/dist/{options-CBXIHUoT.mjs.map → options-BHPeIbBd.mjs.map} +1 -1
- package/dist/{options-DRe1pIBL.d.mts → options-BhZIeFY1.d.mts} +3 -3
- package/dist/{options-DRe1pIBL.d.mts.map → options-BhZIeFY1.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-DFbuc-Fh.mjs → parse-BRJg1kz8.mjs} +2 -2
- package/dist/{parse-DFbuc-Fh.mjs.map → parse-BRJg1kz8.mjs.map} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs → passkey-config-B3P0nHRR.mjs} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs.map → passkey-config-B3P0nHRR.mjs.map} +1 -1
- package/dist/{patterns-CiyXeDgr.mjs → patterns-D9iDO3j8.mjs} +1 -1
- package/dist/{patterns-CiyXeDgr.mjs.map → patterns-D9iDO3j8.mjs.map} +1 -1
- package/dist/{placeholder-CzW7Lshs.d.mts → placeholder-BR4ZhVJl.d.mts} +7 -1
- package/dist/placeholder-BR4ZhVJl.d.mts.map +1 -0
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/policy-BVRganJQ.mjs +45 -0
- package/dist/policy-BVRganJQ.mjs.map +1 -0
- package/dist/{portable-text-DhKbDAGr.mjs → portable-text-C8Tvp4_g.mjs} +1 -1
- package/dist/{portable-text-DhKbDAGr.mjs.map → portable-text-C8Tvp4_g.mjs.map} +1 -1
- package/dist/{preview-PW-nOnq4.mjs → preview-dn2dUyM0.mjs} +2 -2
- package/dist/{preview-PW-nOnq4.mjs.map → preview-dn2dUyM0.mjs.map} +1 -1
- package/dist/protocol-CuBEsqgE.d.mts +52 -0
- package/dist/protocol-CuBEsqgE.d.mts.map +1 -0
- package/dist/{public-url-CWoFhQT8.mjs → public-url-DRz_AinV.mjs} +1 -1
- package/dist/{public-url-CWoFhQT8.mjs.map → public-url-DRz_AinV.mjs.map} +1 -1
- package/dist/{query-BgjfiLUQ.mjs → query-D18vTdha.mjs} +14 -14
- package/dist/{query-BgjfiLUQ.mjs.map → query-D18vTdha.mjs.map} +1 -1
- package/dist/{query-vgZNwIhh.mjs → query-tZDEdtCN.mjs} +4 -4
- package/dist/{query-vgZNwIhh.mjs.map → query-tZDEdtCN.mjs.map} +1 -1
- package/dist/{rate-limit-L5anykgo.mjs → rate-limit-on7KPo-v.mjs} +2 -2
- package/dist/{rate-limit-L5anykgo.mjs.map → rate-limit-on7KPo-v.mjs.map} +1 -1
- package/dist/{redirect-COsS6SWJ.mjs → redirect-CZkbozu9.mjs} +2 -2
- package/dist/{redirect-COsS6SWJ.mjs.map → redirect-CZkbozu9.mjs.map} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs → redirect-DrbEmU9a.mjs} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs.map → redirect-DrbEmU9a.mjs.map} +1 -1
- package/dist/{redirects-CufRQt0Q.mjs → redirects-BahWiu8Z.mjs} +5 -5
- package/dist/{redirects-CufRQt0Q.mjs.map → redirects-BahWiu8Z.mjs.map} +1 -1
- package/dist/{redirects-cV9g7V-0.mjs → redirects-CRIM55KH.mjs} +6 -6
- package/dist/{redirects-cV9g7V-0.mjs.map → redirects-CRIM55KH.mjs.map} +1 -1
- package/dist/{api-DdAsirBe.mjs → registry-BiO5WwPq.mjs} +483 -2462
- package/dist/registry-BiO5WwPq.mjs.map +1 -0
- package/dist/{registry-C581V4TP.mjs → registry-Cx-jEJOS.mjs} +9 -123
- package/dist/registry-Cx-jEJOS.mjs.map +1 -0
- package/dist/{relation-DtmAQH7s.mjs → relation-A6wLF_DS.mjs} +2 -2
- package/dist/{relation-DtmAQH7s.mjs.map → relation-A6wLF_DS.mjs.map} +1 -1
- package/dist/{relations-BBApI4e2.mjs → relations-BTPM2saV.mjs} +2 -2
- package/dist/{relations-BBApI4e2.mjs.map → relations-BTPM2saV.mjs.map} +1 -1
- package/dist/{relations-DItI3MN9.d.mts → relations-C7B46bcU.d.mts} +189 -30
- package/dist/relations-C7B46bcU.d.mts.map +1 -0
- package/dist/{relations-DICSyfsh.mjs → relations-Cj5hZ6Zg.mjs} +4 -4
- package/dist/{relations-DICSyfsh.mjs.map → relations-Cj5hZ6Zg.mjs.map} +1 -1
- package/dist/{request-cache-BSUptuJR.mjs → request-cache-DH9zdCOD.mjs} +1 -1
- package/dist/{request-cache-BSUptuJR.mjs.map → request-cache-DH9zdCOD.mjs.map} +1 -1
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-DgZJh3zG.mjs → request-meta-DRp5ENd_.mjs} +2 -2
- package/dist/{request-meta-DgZJh3zG.mjs.map → request-meta-DRp5ENd_.mjs.map} +1 -1
- package/dist/{resolve-DOhVEvty.mjs → resolve-DxUpTMmE.mjs} +1 -1
- package/dist/{resolve-DOhVEvty.mjs.map → resolve-DxUpTMmE.mjs.map} +1 -1
- package/dist/{runner-BiDvq5dv.mjs → runner-77GOZCnH.mjs} +443 -289
- package/dist/runner-77GOZCnH.mjs.map +1 -0
- package/dist/{runner-CgQbELYC.d.mts → runner-zgqA_CqP.d.mts} +16 -3
- package/dist/runner-zgqA_CqP.d.mts.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-BFyTg38T.mjs → schema-BY-oVntF.mjs} +3 -3
- package/dist/{schema-BFyTg38T.mjs.map → schema-BY-oVntF.mjs.map} +1 -1
- package/dist/{schema-CeQSNwB3.mjs → schema-Cw9kVK0I.mjs} +35 -5
- package/dist/{schema-CeQSNwB3.mjs.map → schema-Cw9kVK0I.mjs.map} +1 -1
- package/dist/{scopes-BVeuhGBE.mjs → scopes-vMR1uIbt.mjs} +3 -3
- package/dist/{scopes-BVeuhGBE.mjs.map → scopes-vMR1uIbt.mjs.map} +1 -1
- package/dist/{search-BpuPKZb0.mjs → search-CfT3KxO5.mjs} +4 -4
- package/dist/{search-BpuPKZb0.mjs.map → search-CfT3KxO5.mjs.map} +1 -1
- package/dist/{secrets-dtYs2hDo.mjs → secrets-BH2Qow1-.mjs} +3 -3
- package/dist/{secrets-dtYs2hDo.mjs.map → secrets-BH2Qow1-.mjs.map} +1 -1
- package/dist/{sections-COctk6hf.mjs → sections-DTfjyf1z.mjs} +2 -2
- package/dist/{sections-COctk6hf.mjs.map → sections-DTfjyf1z.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +24 -22
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +16 -14
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-AFpVvTqr.mjs → seo-BSiTIXzd.mjs} +1 -1
- package/dist/{seo-AFpVvTqr.mjs.map → seo-BSiTIXzd.mjs.map} +1 -1
- package/dist/{seo-CvDxfvFb.mjs → seo-Cm-dtvgk.mjs} +2 -2
- package/dist/{seo-CvDxfvFb.mjs.map → seo-Cm-dtvgk.mjs.map} +1 -1
- package/dist/{service-xMiMSTsR.mjs → service-DYsDHEKe.mjs} +3 -3
- package/dist/{service-xMiMSTsR.mjs.map → service-DYsDHEKe.mjs.map} +1 -1
- package/dist/{session-user-BzVemLkw.mjs → session-user-CNAfvsdw.mjs} +1 -1
- package/dist/{session-user-BzVemLkw.mjs.map → session-user-CNAfvsdw.mjs.map} +1 -1
- package/dist/{settings-B372MV0p.mjs → settings-BgN-0DT-.mjs} +6 -6
- package/dist/{settings-B372MV0p.mjs.map → settings-BgN-0DT-.mjs.map} +1 -1
- package/dist/{settings-BE9aqn_9.mjs → settings-DjtkUo__.mjs} +3 -3
- package/dist/{settings-BE9aqn_9.mjs.map → settings-DjtkUo__.mjs.map} +1 -1
- package/dist/{setup-complete-DF7TAfD5.mjs → setup-complete-CcpXaPU7.mjs} +2 -2
- package/dist/{setup-complete-DF7TAfD5.mjs.map → setup-complete-CcpXaPU7.mjs.map} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs → setup-nonce-Reyw30jg.mjs} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs.map → setup-nonce-Reyw30jg.mjs.map} +1 -1
- package/dist/{single-flight-cache-B0eLKS6K.mjs → single-flight-cache-BPuGPdcN.mjs} +2 -2
- package/dist/{single-flight-cache-B0eLKS6K.mjs.map → single-flight-cache-BPuGPdcN.mjs.map} +1 -1
- package/dist/{site-url-Bowsi9T-.mjs → site-url-Cs_V9n3V.mjs} +3 -3
- package/dist/{site-url-Bowsi9T-.mjs.map → site-url-Cs_V9n3V.mjs.map} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs → snapshot-DSB8P7Lm.mjs} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs.map → snapshot-DSB8P7Lm.mjs.map} +1 -1
- package/dist/{ssrf-Cpvg_n3A.mjs → ssrf-DqebVE34.mjs} +21 -5
- package/dist/{ssrf-Cpvg_n3A.mjs.map → ssrf-DqebVE34.mjs.map} +1 -1
- package/dist/{state-DYwPue40.mjs → state-BJfU9Uzw.mjs} +12 -4
- package/dist/state-BJfU9Uzw.mjs.map +1 -0
- package/dist/{status-CWVYpbD8.mjs → status-DDu8HIQl.mjs} +1 -1
- package/dist/{status-CWVYpbD8.mjs.map → status-DDu8HIQl.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +3 -3
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/target-D0o26Azo.mjs +27 -0
- package/dist/target-D0o26Azo.mjs.map +1 -0
- package/dist/{taxonomies-Dk3MAklL.mjs → taxonomies-CPGxo-bn.mjs} +5 -5
- package/dist/{taxonomies-Dk3MAklL.mjs.map → taxonomies-CPGxo-bn.mjs.map} +1 -1
- package/dist/{taxonomies-B0o9ExNV.mjs → taxonomies-kmyudNGP.mjs} +7 -7
- package/dist/{taxonomies-B0o9ExNV.mjs.map → taxonomies-kmyudNGP.mjs.map} +1 -1
- package/dist/{taxonomy-CPeM8d2o.mjs → taxonomy-8X09dLN5.mjs} +4 -4
- package/dist/{taxonomy-CPeM8d2o.mjs.map → taxonomy-8X09dLN5.mjs.map} +1 -1
- package/dist/{tokens-C39klX8R.mjs → tokens-gTS-IVUp.mjs} +1 -1
- package/dist/{tokens-C39klX8R.mjs.map → tokens-gTS-IVUp.mjs.map} +1 -1
- package/dist/{transaction-NQj4VJ7Z.mjs → transaction-0KOpOyMu.mjs} +2 -1
- package/dist/{transaction-NQj4VJ7Z.mjs.map → transaction-0KOpOyMu.mjs.map} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts → transport-_6R1ub7t.d.mts} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts.map → transport-_6R1ub7t.d.mts.map} +1 -1
- package/dist/{transport--CfOflrp.mjs → transport-fX59xaJz.mjs} +4 -3
- package/dist/{transport--CfOflrp.mjs.map → transport-fX59xaJz.mjs.map} +1 -1
- package/dist/{trusted-proxy-CEVekpby.mjs → trusted-proxy-fe6nEgR4.mjs} +1 -1
- package/dist/{trusted-proxy-CEVekpby.mjs.map → trusted-proxy-fe6nEgR4.mjs.map} +1 -1
- package/dist/types-75KIqzL9.mjs.map +1 -1
- package/dist/{types-BW1syrlw.mjs → types-BXUmsINL.mjs} +1 -1
- package/dist/{types-BW1syrlw.mjs.map → types-BXUmsINL.mjs.map} +1 -1
- package/dist/{types-CPx2lIGo.d.mts → types-Blb-MRC3.d.mts} +1 -1
- package/dist/{types-CPx2lIGo.d.mts.map → types-Blb-MRC3.d.mts.map} +1 -1
- package/dist/{types-C3_AbkDP.d.mts → types-Br-ERaxh.d.mts} +2 -1
- package/dist/types-Br-ERaxh.d.mts.map +1 -0
- package/dist/{types-BPuloofb.d.mts → types-BzBd3PeX.d.mts} +1 -1
- package/dist/{types-BPuloofb.d.mts.map → types-BzBd3PeX.d.mts.map} +1 -1
- package/dist/{types-DefV3OiO.d.mts → types-CLqvnd05.d.mts} +1 -1
- package/dist/{types-DefV3OiO.d.mts.map → types-CLqvnd05.d.mts.map} +1 -1
- package/dist/{types-X0MThr7x.d.mts → types-D5VVLr7J.d.mts} +1 -1
- package/dist/{types-X0MThr7x.d.mts.map → types-D5VVLr7J.d.mts.map} +1 -1
- package/dist/{types-CAGdePf3.d.mts → types-DHxzBjbD.d.mts} +10 -1
- package/dist/types-DHxzBjbD.d.mts.map +1 -0
- package/dist/{types-D4_1Ga4L.d.mts → types-DJQxln7q.d.mts} +3 -3
- package/dist/{types-D4_1Ga4L.d.mts.map → types-DJQxln7q.d.mts.map} +1 -1
- package/dist/{types-CtzytVXn.mjs → types-DM3vioBY.mjs} +1 -1
- package/dist/{types-CtzytVXn.mjs.map → types-DM3vioBY.mjs.map} +1 -1
- package/dist/{types-CFUfyt1s.d.mts → types-D_DWe7k9.d.mts} +1 -1
- package/dist/{types-CFUfyt1s.d.mts.map → types-D_DWe7k9.d.mts.map} +1 -1
- package/dist/{types-Cs-TFLNf.d.mts → types-Vg6f5i3s.d.mts} +3 -3
- package/dist/{types-Cs-TFLNf.d.mts.map → types-Vg6f5i3s.d.mts.map} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs → upload-attempts-CNyGSepg.mjs} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs.map → upload-attempts-CNyGSepg.mjs.map} +1 -1
- package/dist/{url-pattern-BHS0V5Ng.mjs → url-pattern-K-KdXcSe.mjs} +1 -1
- package/dist/{url-pattern-BHS0V5Ng.mjs.map → url-pattern-K-KdXcSe.mjs.map} +1 -1
- package/dist/{user-sHgJ62SP.mjs → user-CtYY0tp2.mjs} +2 -2
- package/dist/{user-sHgJ62SP.mjs.map → user-CtYY0tp2.mjs.map} +1 -1
- package/dist/{utils-D4vD_Y98.mjs → utils-HztC73hq.mjs} +1 -1
- package/dist/{utils-D4vD_Y98.mjs.map → utils-HztC73hq.mjs.map} +1 -1
- package/dist/{validate-BkqIG_Uj.mjs → validate-Dd-IUjnZ.mjs} +2 -2
- package/dist/{validate-BkqIG_Uj.mjs.map → validate-Dd-IUjnZ.mjs.map} +1 -1
- package/dist/{validate-DeGtBN84.d.mts → validate-DlqdOZXB.d.mts} +5 -5
- package/dist/{validate-DeGtBN84.d.mts.map → validate-DlqdOZXB.d.mts.map} +1 -1
- package/dist/{validation-CiJb_X5o.mjs → validation-D83n7Npi.mjs} +10 -8
- package/dist/{validation-CiJb_X5o.mjs.map → validation-D83n7Npi.mjs.map} +1 -1
- package/dist/version-ri-sCyAp.mjs +7 -0
- package/dist/{version-x0NjTScG.mjs.map → version-ri-sCyAp.mjs.map} +1 -1
- package/dist/{widgets-Cwzvww0W.mjs → widgets-CpmZd9Q-.mjs} +4 -4
- package/dist/{widgets-Cwzvww0W.mjs.map → widgets-CpmZd9Q-.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts → wxr-taxonomies-BFd0y72_.d.mts} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts.map → wxr-taxonomies-BFd0y72_.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs → wxr-taxonomies-Df4vxWcU.mjs} +4 -4
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs.map → wxr-taxonomies-Df4vxWcU.mjs.map} +1 -1
- package/dist/{zod-generator-D11MhxG4.mjs → zod-generator-DylzusHh.mjs} +24 -18
- package/dist/zod-generator-DylzusHh.mjs.map +1 -0
- package/package.json +32 -8
- package/src/api/errors.ts +20 -0
- package/src/api/handlers/index.ts +17 -0
- package/src/api/handlers/media-allowlist.ts +1 -0
- package/src/api/handlers/media-folders.ts +130 -0
- package/src/api/handlers/media-usage-activation.ts +102 -0
- package/src/api/handlers/media-usage.ts +108 -0
- package/src/api/handlers/media.ts +62 -2
- package/src/api/handlers/registry.ts +134 -316
- package/src/api/openapi/document.ts +192 -2
- package/src/api/schemas/media-usage.ts +77 -0
- package/src/api/schemas/media.ts +69 -0
- package/src/astro/integration/index.ts +46 -14
- package/src/astro/integration/routes.ts +18 -0
- package/src/astro/integration/runtime.ts +3 -0
- package/src/astro/integration/vite-config.ts +2 -7
- package/src/astro/middleware/auth.ts +4 -0
- package/src/astro/middleware/scoped-db.ts +21 -0
- package/src/astro/middleware.ts +67 -17
- package/src/astro/routes/api/admin/media-usage/activation.ts +42 -0
- package/src/astro/routes/api/admin/media-usage/progress.ts +37 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +246 -96
- package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
- package/src/astro/routes/api/auth/me.ts +14 -2
- package/src/astro/routes/api/media/[id].ts +3 -0
- package/src/astro/routes/api/media/folders/[id].ts +55 -0
- package/src/astro/routes/api/media/folders/index.ts +37 -0
- package/src/astro/routes/api/media.ts +12 -2
- package/src/astro/routes/api/setup/dev-bypass.ts +14 -7
- package/src/astro/routes/api/setup/index.ts +5 -13
- package/src/astro/types.ts +11 -1
- package/src/cli/commands/migrate.ts +593 -0
- package/src/cli/index.ts +2 -23
- package/src/client/index.ts +140 -2
- package/src/client/transport.ts +6 -2
- package/src/components/EmDashImage.astro +154 -50
- package/src/components/Gallery.astro +7 -0
- package/src/components/InlinePortableTextEditor.tsx +130 -1
- package/src/components/LiveSearch.astro +23 -0
- package/src/components/inline-code-block.tsx +180 -49
- package/src/content/converters/gallery.ts +2 -0
- package/src/content/converters/types.ts +2 -0
- package/src/database/connection.ts +2 -31
- package/src/database/index.ts +9 -3
- package/src/database/json-recordset.ts +16 -0
- package/src/database/migrations/019_i18n.ts +1 -1
- package/src/database/migrations/071_restore_content_bylines_table.ts +43 -0
- package/src/database/migrations/072_media_folders.ts +72 -0
- package/src/database/migrations/073_media_focal_point.ts +57 -0
- package/src/database/migrations/policy.ts +70 -0
- package/src/database/migrations/runner.ts +57 -5
- package/src/database/repositories/content.ts +5 -4
- package/src/database/repositories/media-folders.ts +115 -0
- package/src/database/repositories/media-usage-work.ts +395 -111
- package/src/database/repositories/media-usage.ts +1038 -10
- package/src/database/repositories/media.ts +97 -29
- package/src/database/transaction.ts +1 -0
- package/src/database/types.ts +13 -0
- package/src/db/adapters.ts +52 -4
- package/src/db/index.ts +3 -1
- package/src/db/libsql-migrations.ts +72 -0
- package/src/db/node-sqlite-compat.ts +78 -0
- package/src/db/postgres-migrations.ts +59 -0
- package/src/db/sqlite-migrations.ts +37 -0
- package/src/db/sqlite.ts +3 -3
- package/src/emdash-runtime.ts +154 -120
- package/src/fields/image.ts +7 -1
- package/src/fields/types.ts +6 -2
- package/src/i18n/normalize.ts +31 -0
- package/src/index.ts +12 -1
- package/src/media/focal-point.ts +37 -0
- package/src/media/local-runtime.ts +8 -0
- package/src/media/mime.ts +1 -0
- package/src/media/normalize.ts +10 -0
- package/src/media/types.ts +10 -0
- package/src/media/usage/activation.ts +162 -35
- package/src/media/usage/capture-triggers.ts +19 -3
- package/src/media/usage/collection-deletion-processor.ts +7 -3
- package/src/media/usage/collection-deletion.ts +10 -0
- package/src/media/usage/content-refresh.ts +258 -39
- package/src/media/usage/content-snapshots.ts +128 -31
- package/src/media/usage/extractor.ts +32 -13
- package/src/media/usage/maintenance-engine.ts +166 -0
- package/src/media/usage/reconciliation-processor.ts +106 -29
- package/src/media/usage/reconciliation.ts +90 -7
- package/src/media/usage/work-processor.ts +342 -101
- package/src/migrations/config-loader.ts +205 -0
- package/src/migrations/direct-executor.ts +141 -0
- package/src/migrations/identity.ts +46 -0
- package/src/migrations/index.ts +19 -0
- package/src/migrations/integration-metadata.ts +67 -0
- package/src/migrations/manifest-builder.ts +55 -0
- package/src/migrations/manifest-writer.ts +63 -0
- package/src/migrations/manifest.ts +197 -0
- package/src/migrations/protocol.ts +59 -0
- package/src/migrations/target.ts +35 -0
- package/src/plugins/index.ts +1 -0
- package/src/plugins/save-rejection.ts +20 -0
- package/src/plugins/scheduler/node.ts +1 -13
- package/src/plugins/scheduler/types.ts +0 -2
- package/src/plugins/state.ts +13 -3
- package/src/registry/artifact-fetch.ts +530 -0
- package/src/registry/config.ts +24 -6
- package/src/registry/types.ts +12 -15
- package/src/schema/types.ts +1 -0
- package/src/schema/zod-generator.ts +12 -4
- package/src/security/ssrf.ts +21 -2
- package/src/seed/apply.ts +4 -4
- package/src/ui.ts +2 -0
- package/src/virtual-modules.d.ts +8 -0
- package/dist/adapters-34EN2eXO.d.mts.map +0 -1
- package/dist/api-DdAsirBe.mjs.map +0 -1
- package/dist/collection-deletion-C8BugSGz.mjs.map +0 -1
- package/dist/content-BNfwh7xX.mjs.map +0 -1
- package/dist/content-refresh-DNERP4-f.mjs.map +0 -1
- package/dist/errors-CLUPm7aD.mjs.map +0 -1
- package/dist/index-C3Y-rsyN.d.mts.map +0 -1
- package/dist/media-BWWWb8kg.mjs.map +0 -1
- package/dist/media-CzhAn2--.mjs.map +0 -1
- package/dist/media-allowlist-BD6HhgXA.mjs.map +0 -1
- package/dist/media-usage-De3qvwjc.mjs.map +0 -1
- package/dist/media-usage-work-DrCbqBcl.mjs.map +0 -1
- package/dist/menus-CC-yn1F9.mjs.map +0 -1
- package/dist/mime-DfIVjNkr.mjs.map +0 -1
- package/dist/normalize-Bc-s_r-a.mjs.map +0 -1
- package/dist/placeholder-CzW7Lshs.d.mts.map +0 -1
- package/dist/registry-C581V4TP.mjs.map +0 -1
- package/dist/relations-DItI3MN9.d.mts.map +0 -1
- package/dist/runner-BiDvq5dv.mjs.map +0 -1
- package/dist/runner-CgQbELYC.d.mts.map +0 -1
- package/dist/state-DYwPue40.mjs.map +0 -1
- package/dist/types-C3_AbkDP.d.mts.map +0 -1
- package/dist/types-CAGdePf3.d.mts.map +0 -1
- package/dist/version-x0NjTScG.mjs +0 -7
- package/dist/zod-generator-D11MhxG4.mjs.map +0 -1
- /package/dist/{api-tokens-CyTsLszZ.mjs → api-tokens-B5NHLNUN.mjs} +0 -0
- /package/dist/{ssrf-DpXgKsna.mjs → ssrf-BPKzkm6O.mjs} +0 -0
- /package/dist/{types-CP1CflWf.mjs → types-D6OcIp2P.mjs} +0 -0
package/src/emdash-runtime.ts
CHANGED
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
import { Permissions } from "@emdash-cms/auth";
|
|
11
11
|
import type { Element } from "@emdash-cms/blocks";
|
|
12
|
-
import { Kysely,
|
|
12
|
+
import { Kysely, type Dialect } from "kysely";
|
|
13
13
|
import virtualConfig from "virtual:emdash/config";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
|
+
import { ErrorCode } from "./api/errors.js";
|
|
16
17
|
import { assertMediaUsageActivationWriteAllowed } from "./api/media-usage-write-fence.js";
|
|
17
18
|
import { validateRev } from "./api/rev.js";
|
|
18
19
|
import type {
|
|
@@ -26,10 +27,14 @@ import { getTrustedProxyHeaders } from "./auth/trusted-proxy.js";
|
|
|
26
27
|
import type { ContentFieldFilters } from "./content-list-query.js";
|
|
27
28
|
import { isSqlite } from "./database/dialect-helpers.js";
|
|
28
29
|
import { kyselyLogOption } from "./database/instrumentation.js";
|
|
30
|
+
import {
|
|
31
|
+
enforceRuntimeMigrationPolicy,
|
|
32
|
+
PendingMigrationsError,
|
|
33
|
+
type RuntimeMigrationMode,
|
|
34
|
+
} from "./database/migrations/policy.js";
|
|
29
35
|
import {
|
|
30
36
|
ConcurrentMigrationTimeoutError,
|
|
31
37
|
MIGRATION_RACE_WAIT_MS,
|
|
32
|
-
runMigrations,
|
|
33
38
|
} from "./database/migrations/runner.js";
|
|
34
39
|
import { AuditRepository } from "./database/repositories/audit.js";
|
|
35
40
|
import { ContentRepository } from "./database/repositories/content.js";
|
|
@@ -39,30 +44,20 @@ import type {
|
|
|
39
44
|
ContentItem as ContentItemInternal,
|
|
40
45
|
ContentDateField,
|
|
41
46
|
} from "./database/repositories/types.js";
|
|
47
|
+
import type { ImageValue } from "./fields/types.js";
|
|
42
48
|
import { getI18nConfig } from "./i18n/config.js";
|
|
43
49
|
import { repairLocaleCasing } from "./i18n/repair-locale-casing.js";
|
|
44
50
|
import { warnAboutUnconfiguredTaxonomyLocales } from "./i18n/taxonomy-locale-diagnostic.js";
|
|
45
51
|
import { normalizeMediaValue } from "./media/normalize.js";
|
|
46
52
|
import type { MediaProvider, MediaProviderCapabilities } from "./media/types.js";
|
|
47
|
-
import {
|
|
48
|
-
MEDIA_USAGE_COLLECTION_DELETION_LIMITS,
|
|
49
|
-
processDueMediaUsageCollectionDeletions,
|
|
50
|
-
} from "./media/usage/collection-deletion-processor.js";
|
|
53
|
+
import { activateMediaUsageCapture } from "./media/usage/activation.js";
|
|
51
54
|
import {
|
|
52
55
|
deleteContentMediaUsage,
|
|
53
56
|
findNonTranslatableSiblingContentIds,
|
|
54
57
|
markContentMediaUsageCollectionStale,
|
|
55
58
|
refreshContentMediaUsageAfterWrite,
|
|
56
59
|
} from "./media/usage/content-refresh.js";
|
|
57
|
-
import {
|
|
58
|
-
MEDIA_USAGE_RECONCILIATION_LIMITS,
|
|
59
|
-
processDueMediaUsageReconciliation,
|
|
60
|
-
} from "./media/usage/reconciliation-processor.js";
|
|
61
|
-
import {
|
|
62
|
-
MEDIA_USAGE_WORK_PROCESSING_LIMITS,
|
|
63
|
-
processDueMediaUsageWork,
|
|
64
|
-
processMediaUsageWorkAfterWrite,
|
|
65
|
-
} from "./media/usage/work-processor.js";
|
|
60
|
+
import { processMediaUsageWorkAfterWrite } from "./media/usage/work-processor.js";
|
|
66
61
|
import { createSandboxRunnerOptions } from "./plugins/sandbox/runner-options.js";
|
|
67
62
|
import { getSandboxRouteErrorDetails } from "./plugins/sandbox/types.js";
|
|
68
63
|
import type {
|
|
@@ -87,6 +82,7 @@ import type {
|
|
|
87
82
|
} from "./plugins/types.js";
|
|
88
83
|
import { recordSchedulerHeartbeatSafely } from "./scheduler-health.js";
|
|
89
84
|
import { MAX_COLLECTION_LIST_COLUMNS, type FieldType } from "./schema/types.js";
|
|
85
|
+
import { isMissingTableError } from "./utils/db-errors.js";
|
|
90
86
|
import { hashString } from "./utils/hash.js";
|
|
91
87
|
import { createInitLock, type InitLock, initWithLock } from "./utils/init-lock.js";
|
|
92
88
|
import { createSingleFlightCache, singleFlightCached } from "./utils/single-flight-cache.js";
|
|
@@ -222,6 +218,7 @@ import {
|
|
|
222
218
|
type RouteCallerInput,
|
|
223
219
|
type RouteMeta,
|
|
224
220
|
} from "./plugins/routes.js";
|
|
221
|
+
import { isContentSaveRejection } from "./plugins/save-rejection.js";
|
|
225
222
|
import type { CronScheduler } from "./plugins/scheduler/types.js";
|
|
226
223
|
import { PluginStateRepository } from "./plugins/state.js";
|
|
227
224
|
import { syncDeclaredStorageIndexes } from "./plugins/storage-indexes.js";
|
|
@@ -347,6 +344,8 @@ export type CreateSchedulerFn = (executor: CronExecutor) => CronScheduler;
|
|
|
347
344
|
*/
|
|
348
345
|
export interface RuntimeDependencies {
|
|
349
346
|
config: EmDashConfig;
|
|
347
|
+
/** Effective migration mode, resolved once by the runtime entrypoint. */
|
|
348
|
+
migrationMode?: RuntimeMigrationMode;
|
|
350
349
|
plugins: ResolvedPlugin[];
|
|
351
350
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
352
351
|
createDialect: (config: any) => Dialect;
|
|
@@ -427,6 +426,28 @@ export interface EmDashRuntimeParts {
|
|
|
427
426
|
pipelineRef: { current: HookPipeline };
|
|
428
427
|
}
|
|
429
428
|
|
|
429
|
+
/**
|
|
430
|
+
* A `ContentSaveRejectedError` carries a message the plugin wrote for the
|
|
431
|
+
* editor; every other exception stays internal and is replaced by a generic
|
|
432
|
+
* message so hook internals cannot leak through the API.
|
|
433
|
+
*/
|
|
434
|
+
function beforeSaveFailure(error: unknown) {
|
|
435
|
+
if (isContentSaveRejection(error)) {
|
|
436
|
+
return {
|
|
437
|
+
success: false as const,
|
|
438
|
+
error: { code: ErrorCode.SAVE_REJECTED, message: error.message },
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
console.error("EmDash: content:beforeSave hook failed:", error);
|
|
442
|
+
return {
|
|
443
|
+
success: false as const,
|
|
444
|
+
error: {
|
|
445
|
+
code: ErrorCode.CONTENT_HOOK_ERROR,
|
|
446
|
+
message: "A plugin hook failed while saving content",
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
|
|
430
451
|
/**
|
|
431
452
|
* Convert a ContentItem to Record<string, unknown> for hook consumption.
|
|
432
453
|
* Hooks receive the full item as a flat record.
|
|
@@ -546,62 +567,6 @@ const marketplaceManifestCache = new Map<
|
|
|
546
567
|
const sandboxedRouteMetaCache = new Map<string, Map<string, RouteMeta>>();
|
|
547
568
|
let sandboxRunner: SandboxRunner | null = null;
|
|
548
569
|
|
|
549
|
-
export const MEDIA_USAGE_MAINTENANCE_QUERY_RESERVATIONS = Object.freeze({
|
|
550
|
-
entryWork: MEDIA_USAGE_WORK_PROCESSING_LIMITS.ordinaryStatementsPerJob,
|
|
551
|
-
collectionDeletion: MEDIA_USAGE_COLLECTION_DELETION_LIMITS.maxQueriesPerTick,
|
|
552
|
-
reconciliation: MEDIA_USAGE_RECONCILIATION_LIMITS.maxQueriesPerTick,
|
|
553
|
-
maxClassQueries: Math.max(
|
|
554
|
-
MEDIA_USAGE_WORK_PROCESSING_LIMITS.ordinaryStatementsPerJob,
|
|
555
|
-
MEDIA_USAGE_COLLECTION_DELETION_LIMITS.maxQueriesPerTick,
|
|
556
|
-
MEDIA_USAGE_RECONCILIATION_LIMITS.maxQueriesPerTick,
|
|
557
|
-
),
|
|
558
|
-
eventCeiling: 40,
|
|
559
|
-
});
|
|
560
|
-
|
|
561
|
-
export type MediaUsageMaintenanceTaskClass =
|
|
562
|
-
| "entry_work"
|
|
563
|
-
| "collection_deletion"
|
|
564
|
-
| "reconciliation";
|
|
565
|
-
|
|
566
|
-
export type MediaUsageMaintenanceResult =
|
|
567
|
-
| { outcome: "inactive" | "admission_closed"; taskClass: null; turn: null }
|
|
568
|
-
| { outcome: "processed"; taskClass: MediaUsageMaintenanceTaskClass; turn: number };
|
|
569
|
-
|
|
570
|
-
async function runScheduledMediaUsageLane(
|
|
571
|
-
db: Kysely<Database>,
|
|
572
|
-
): Promise<MediaUsageMaintenanceResult> {
|
|
573
|
-
const queriesAlreadySpent = getRequestContext()?.metrics?.dbCount ?? 0;
|
|
574
|
-
if (
|
|
575
|
-
queriesAlreadySpent + 1 + MEDIA_USAGE_MAINTENANCE_QUERY_RESERVATIONS.maxClassQueries >
|
|
576
|
-
MEDIA_USAGE_MAINTENANCE_QUERY_RESERVATIONS.eventCeiling
|
|
577
|
-
) {
|
|
578
|
-
return { outcome: "admission_closed", taskClass: null, turn: null };
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
const activation = await db
|
|
582
|
-
.updateTable("_emdash_media_usage_activation")
|
|
583
|
-
.set({
|
|
584
|
-
media_usage_maintenance_turn: sql<number>`(media_usage_maintenance_turn + 1) % 3`,
|
|
585
|
-
})
|
|
586
|
-
.where("task_key", "=", "incremental_capture")
|
|
587
|
-
.where("state", "=", "active")
|
|
588
|
-
.returning("media_usage_maintenance_turn")
|
|
589
|
-
.executeTakeFirst();
|
|
590
|
-
if (!activation) return { outcome: "inactive", taskClass: null, turn: null };
|
|
591
|
-
|
|
592
|
-
const turn = activation.media_usage_maintenance_turn;
|
|
593
|
-
if (turn === 0) {
|
|
594
|
-
await processDueMediaUsageWork(db);
|
|
595
|
-
return { outcome: "processed", taskClass: "entry_work", turn };
|
|
596
|
-
}
|
|
597
|
-
if (turn === 1) {
|
|
598
|
-
await processDueMediaUsageCollectionDeletions(db);
|
|
599
|
-
return { outcome: "processed", taskClass: "collection_deletion", turn };
|
|
600
|
-
}
|
|
601
|
-
await processDueMediaUsageReconciliation(db);
|
|
602
|
-
return { outcome: "processed", taskClass: "reconciliation", turn };
|
|
603
|
-
}
|
|
604
|
-
|
|
605
570
|
/**
|
|
606
571
|
* EmDashRuntime - singleton per worker
|
|
607
572
|
*/
|
|
@@ -807,10 +772,6 @@ export class EmDashRuntime {
|
|
|
807
772
|
return { published };
|
|
808
773
|
}
|
|
809
774
|
|
|
810
|
-
async runScheduledMediaUsageTasks(): Promise<MediaUsageMaintenanceResult> {
|
|
811
|
-
return runScheduledMediaUsageLane(this.db);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
775
|
/**
|
|
815
776
|
* Materialize plugin-declared storage indexes, once per process.
|
|
816
777
|
*
|
|
@@ -1247,8 +1208,10 @@ export class EmDashRuntime {
|
|
|
1247
1208
|
}
|
|
1248
1209
|
};
|
|
1249
1210
|
|
|
1250
|
-
// Initialize database
|
|
1251
|
-
const db = await phase("rt.db", "DB init +
|
|
1211
|
+
// Initialize the database and enforce its configured migration policy.
|
|
1212
|
+
const db = await phase("rt.db", "DB init + migration policy", () =>
|
|
1213
|
+
EmDashRuntime.getDatabase(deps),
|
|
1214
|
+
);
|
|
1252
1215
|
|
|
1253
1216
|
// Resolver for the live connection, mirroring the `get db()` getter
|
|
1254
1217
|
// below (which can't be used here — the runtime instance doesn't exist
|
|
@@ -1311,6 +1274,16 @@ export class EmDashRuntime {
|
|
|
1311
1274
|
// fall back to the singleton, where serialization costs nothing.
|
|
1312
1275
|
let readDb = db;
|
|
1313
1276
|
let readDbDisposable: Kysely<Database> | undefined;
|
|
1277
|
+
const disposeReadDb = async () => {
|
|
1278
|
+
const disposable = readDbDisposable;
|
|
1279
|
+
readDbDisposable = undefined;
|
|
1280
|
+
if (!disposable) return;
|
|
1281
|
+
try {
|
|
1282
|
+
await disposable.destroy();
|
|
1283
|
+
} catch {
|
|
1284
|
+
// Non-fatal — the underlying binding is shared and needs no teardown.
|
|
1285
|
+
}
|
|
1286
|
+
};
|
|
1314
1287
|
if (ownsConfiguredDb && deps.createCoalescingDialect && deps.config.database) {
|
|
1315
1288
|
try {
|
|
1316
1289
|
const dialect = deps.createCoalescingDialect(deps.config.database.config);
|
|
@@ -1323,6 +1296,12 @@ export class EmDashRuntime {
|
|
|
1323
1296
|
}
|
|
1324
1297
|
}
|
|
1325
1298
|
const optionsRepo = new OptionsRepository(readDb);
|
|
1299
|
+
let missingManualSchemaError: unknown;
|
|
1300
|
+
const captureMissingManualSchema = (error: unknown) => {
|
|
1301
|
+
if ((deps.migrationMode ?? "auto") === "manual" && isMissingTableError(error)) {
|
|
1302
|
+
missingManualSchemaError ??= error;
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1326
1305
|
|
|
1327
1306
|
const readSiteInfo = async () => {
|
|
1328
1307
|
const siteOpts = await optionsRepo.getMany<string>([
|
|
@@ -1351,14 +1330,16 @@ export class EmDashRuntime {
|
|
|
1351
1330
|
.select(["plugin_id", "status"])
|
|
1352
1331
|
.execute();
|
|
1353
1332
|
pluginStates = new Map(states.map((s) => [s.plugin_id, s.status]));
|
|
1354
|
-
} catch {
|
|
1333
|
+
} catch (error) {
|
|
1334
|
+
captureMissingManualSchema(error);
|
|
1355
1335
|
// _plugin_state may not exist yet on a pre-migration db.
|
|
1356
1336
|
}
|
|
1357
1337
|
}),
|
|
1358
1338
|
phase("rt.site", "Site info options", async () => {
|
|
1359
1339
|
try {
|
|
1360
1340
|
siteInfo = await readSiteInfo();
|
|
1361
|
-
} catch {
|
|
1341
|
+
} catch (error) {
|
|
1342
|
+
captureMissingManualSchema(error);
|
|
1362
1343
|
// options may not exist yet on a pre-migration db.
|
|
1363
1344
|
}
|
|
1364
1345
|
}),
|
|
@@ -1387,7 +1368,8 @@ export class EmDashRuntime {
|
|
|
1387
1368
|
}
|
|
1388
1369
|
})();
|
|
1389
1370
|
seedGate = { collectionCount: collectionCount.count, setupDone };
|
|
1390
|
-
} catch {
|
|
1371
|
+
} catch (error) {
|
|
1372
|
+
captureMissingManualSchema(error);
|
|
1391
1373
|
// Leave the "already set up" default so a read failure never
|
|
1392
1374
|
// triggers a seed onto a half-built db.
|
|
1393
1375
|
}
|
|
@@ -1396,6 +1378,10 @@ export class EmDashRuntime {
|
|
|
1396
1378
|
}
|
|
1397
1379
|
|
|
1398
1380
|
await Promise.all(coldStartReads);
|
|
1381
|
+
if (missingManualSchemaError) {
|
|
1382
|
+
await disposeReadDb();
|
|
1383
|
+
throw missingManualSchemaError;
|
|
1384
|
+
}
|
|
1399
1385
|
|
|
1400
1386
|
if (
|
|
1401
1387
|
localeCasingRepairVersion &&
|
|
@@ -1416,6 +1402,15 @@ export class EmDashRuntime {
|
|
|
1416
1402
|
// per-isolate lock keyed by the configured db so a reclaimed-and-rerun
|
|
1417
1403
|
// create() can't apply the seed a second time concurrently.
|
|
1418
1404
|
if (seedGate.collectionCount === 0 && !seedGate.setupDone) {
|
|
1405
|
+
try {
|
|
1406
|
+
const activation = await activateMediaUsageCapture(db, { writersDrained: true });
|
|
1407
|
+
if (activation.outcome !== "active") {
|
|
1408
|
+
throw new Error("Fresh-site media usage activation did not complete");
|
|
1409
|
+
}
|
|
1410
|
+
} catch (error) {
|
|
1411
|
+
await disposeReadDb();
|
|
1412
|
+
throw error;
|
|
1413
|
+
}
|
|
1419
1414
|
const seedKey = deps.config.database?.entrypoint ?? "default";
|
|
1420
1415
|
const seedHolder = getSeedHolder();
|
|
1421
1416
|
try {
|
|
@@ -1452,13 +1447,7 @@ export class EmDashRuntime {
|
|
|
1452
1447
|
}
|
|
1453
1448
|
|
|
1454
1449
|
// The read connection is single-use; everything below uses the singleton.
|
|
1455
|
-
|
|
1456
|
-
try {
|
|
1457
|
-
await readDbDisposable.destroy();
|
|
1458
|
-
} catch {
|
|
1459
|
-
// Non-fatal — the underlying binding is shared and needs no teardown.
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1450
|
+
await disposeReadDb();
|
|
1462
1451
|
|
|
1463
1452
|
const enabledPlugins = new Set<string>();
|
|
1464
1453
|
for (const plugin of deps.plugins) {
|
|
@@ -1730,14 +1719,6 @@ export class EmDashRuntime {
|
|
|
1730
1719
|
if (deps.createScheduler) {
|
|
1731
1720
|
const scheduler = deps.createScheduler(cronExecutor);
|
|
1732
1721
|
cronScheduler = scheduler;
|
|
1733
|
-
const runMediaUsageMaintenance = async () => {
|
|
1734
|
-
const runtime = runtimeRef.current;
|
|
1735
|
-
if (runtime) {
|
|
1736
|
-
await runtime.runScheduledMediaUsageTasks();
|
|
1737
|
-
} else {
|
|
1738
|
-
await runScheduledMediaUsageLane(db);
|
|
1739
|
-
}
|
|
1740
|
-
};
|
|
1741
1722
|
|
|
1742
1723
|
// Run scheduled publishing and system cleanup alongside each tick.
|
|
1743
1724
|
// Pass storage so cleanupPendingUploads can delete orphaned files.
|
|
@@ -1771,16 +1752,7 @@ export class EmDashRuntime {
|
|
|
1771
1752
|
// Never throws; no-op unless scheduled backups are enabled and due.
|
|
1772
1753
|
await maybeRunScheduledBackup(db, storage ?? undefined);
|
|
1773
1754
|
await recordSchedulerHeartbeatSafely(db);
|
|
1774
|
-
if (!scheduler.setMediaUsageMaintenance) {
|
|
1775
|
-
try {
|
|
1776
|
-
await runMediaUsageMaintenance();
|
|
1777
|
-
} catch (error) {
|
|
1778
|
-
console.error("[media-usage] Scheduled maintenance failed:", error);
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
1755
|
});
|
|
1782
|
-
scheduler.setMediaUsageMaintenance?.(runMediaUsageMaintenance);
|
|
1783
|
-
|
|
1784
1756
|
// start() is void on the timer scheduler but the interface
|
|
1785
1757
|
// allows a promise (alarm-backed schedulers); we don't block on it.
|
|
1786
1758
|
void scheduler.start();
|
|
@@ -1911,13 +1883,16 @@ export class EmDashRuntime {
|
|
|
1911
1883
|
const db = new Kysely<Database>({ dialect, log: kyselyLogOption() });
|
|
1912
1884
|
|
|
1913
1885
|
try {
|
|
1914
|
-
await
|
|
1886
|
+
await enforceRuntimeMigrationPolicy(db, deps.migrationMode ?? "auto");
|
|
1915
1887
|
} catch (error) {
|
|
1916
1888
|
// Timing out behind another instance's in-flight migrations
|
|
1917
1889
|
// is not a failure of OUR migration — the holder may just be
|
|
1918
1890
|
// slow. Don't back off for it: the next request waits again
|
|
1919
1891
|
// and init recovers the moment the holder finishes.
|
|
1920
|
-
if (
|
|
1892
|
+
if (
|
|
1893
|
+
!(error instanceof ConcurrentMigrationTimeoutError) &&
|
|
1894
|
+
!(error instanceof PendingMigrationsError)
|
|
1895
|
+
) {
|
|
1921
1896
|
holder.failures.set(cacheKey, {
|
|
1922
1897
|
at: Date.now(),
|
|
1923
1898
|
message: error instanceof Error ? error.message : String(error),
|
|
@@ -2940,8 +2915,12 @@ export class EmDashRuntime {
|
|
|
2940
2915
|
// Run beforeSave hooks (trusted plugins)
|
|
2941
2916
|
let processedData = body.data;
|
|
2942
2917
|
if (this.hooks.hasHooks("content:beforeSave")) {
|
|
2943
|
-
|
|
2944
|
-
|
|
2918
|
+
try {
|
|
2919
|
+
const hookResult = await this.hooks.runContentBeforeSave(body.data, collection, true);
|
|
2920
|
+
processedData = hookResult.content;
|
|
2921
|
+
} catch (error) {
|
|
2922
|
+
return beforeSaveFailure(error);
|
|
2923
|
+
}
|
|
2945
2924
|
}
|
|
2946
2925
|
|
|
2947
2926
|
// Run beforeSave hooks (sandboxed plugins)
|
|
@@ -3036,12 +3015,16 @@ export class EmDashRuntime {
|
|
|
3036
3015
|
let processedData = bodyWithoutRev.data;
|
|
3037
3016
|
if (bodyWithoutRev.data) {
|
|
3038
3017
|
if (this.hooks.hasHooks("content:beforeSave")) {
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3018
|
+
try {
|
|
3019
|
+
const hookResult = await this.hooks.runContentBeforeSave(
|
|
3020
|
+
bodyWithoutRev.data,
|
|
3021
|
+
collection,
|
|
3022
|
+
false,
|
|
3023
|
+
);
|
|
3024
|
+
processedData = hookResult.content;
|
|
3025
|
+
} catch (error) {
|
|
3026
|
+
return beforeSaveFailure(error);
|
|
3027
|
+
}
|
|
3045
3028
|
}
|
|
3046
3029
|
|
|
3047
3030
|
// Run sandboxed beforeSave hooks
|
|
@@ -3427,9 +3410,11 @@ export class EmDashRuntime {
|
|
|
3427
3410
|
|
|
3428
3411
|
async handleMediaList(params: {
|
|
3429
3412
|
cursor?: string;
|
|
3413
|
+
page?: number;
|
|
3430
3414
|
limit?: number;
|
|
3431
3415
|
mimeType?: string | readonly string[];
|
|
3432
3416
|
q?: string;
|
|
3417
|
+
folderId?: string | null;
|
|
3433
3418
|
}) {
|
|
3434
3419
|
return handleMediaList(this.db, params);
|
|
3435
3420
|
}
|
|
@@ -3490,7 +3475,15 @@ export class EmDashRuntime {
|
|
|
3490
3475
|
|
|
3491
3476
|
async handleMediaUpdate(
|
|
3492
3477
|
id: string,
|
|
3493
|
-
input: {
|
|
3478
|
+
input: {
|
|
3479
|
+
alt?: string;
|
|
3480
|
+
caption?: string;
|
|
3481
|
+
width?: number;
|
|
3482
|
+
height?: number;
|
|
3483
|
+
folderId?: string | null;
|
|
3484
|
+
focalX?: number | null;
|
|
3485
|
+
focalY?: number | null;
|
|
3486
|
+
},
|
|
3494
3487
|
) {
|
|
3495
3488
|
const result = await handleMediaUpdate(this.db, id, input);
|
|
3496
3489
|
// Resolved media references in site settings (`logo`, `favicon`,
|
|
@@ -3661,14 +3654,14 @@ export class EmDashRuntime {
|
|
|
3661
3654
|
for (const contentId of new Set(contentIds)) {
|
|
3662
3655
|
try {
|
|
3663
3656
|
const work = await processMediaUsageWorkAfterWrite(this.db, collection, contentId);
|
|
3664
|
-
if (work.outcome !== "inactive")
|
|
3657
|
+
if (work.outcome !== "inactive") continue;
|
|
3665
3658
|
await refreshContentMediaUsageAfterWrite(this.db, collection, contentId);
|
|
3666
3659
|
} catch (error) {
|
|
3667
3660
|
console.error(
|
|
3668
3661
|
`[media-usage] Failed after content write ${collection}/${contentId}:`,
|
|
3669
3662
|
error,
|
|
3670
3663
|
);
|
|
3671
|
-
|
|
3664
|
+
continue;
|
|
3672
3665
|
}
|
|
3673
3666
|
}
|
|
3674
3667
|
}
|
|
@@ -4027,7 +4020,11 @@ export class EmDashRuntime {
|
|
|
4027
4020
|
if (value == null) continue;
|
|
4028
4021
|
|
|
4029
4022
|
try {
|
|
4030
|
-
|
|
4023
|
+
// Only image fields carry a dark variant.
|
|
4024
|
+
const normalized =
|
|
4025
|
+
field.type === "image"
|
|
4026
|
+
? await normalizeImageValue(value, getProvider)
|
|
4027
|
+
: await normalizeMediaValue(value, getProvider);
|
|
4031
4028
|
if (normalized) {
|
|
4032
4029
|
result[field.slug] = normalized;
|
|
4033
4030
|
}
|
|
@@ -4054,7 +4051,7 @@ export class EmDashRuntime {
|
|
|
4054
4051
|
const subValue = normalizedItem[slug];
|
|
4055
4052
|
if (subValue == null) continue;
|
|
4056
4053
|
try {
|
|
4057
|
-
const normalized = await
|
|
4054
|
+
const normalized = await normalizeImageValue(subValue, getProvider);
|
|
4058
4055
|
if (normalized) {
|
|
4059
4056
|
normalizedItem[slug] = normalized;
|
|
4060
4057
|
}
|
|
@@ -4096,7 +4093,10 @@ export class EmDashRuntime {
|
|
|
4096
4093
|
result = record;
|
|
4097
4094
|
}
|
|
4098
4095
|
} catch (error) {
|
|
4099
|
-
console.error(
|
|
4096
|
+
console.error(
|
|
4097
|
+
`EmDash: Sandboxed plugin ${id} beforeSave hook threw; a sandboxed plugin cannot cancel a save, so the save continues:`,
|
|
4098
|
+
error,
|
|
4099
|
+
);
|
|
4100
4100
|
}
|
|
4101
4101
|
}
|
|
4102
4102
|
|
|
@@ -4408,3 +4408,37 @@ export class EmDashRuntime {
|
|
|
4408
4408
|
return status === undefined || status === "active";
|
|
4409
4409
|
}
|
|
4410
4410
|
}
|
|
4411
|
+
|
|
4412
|
+
/**
|
|
4413
|
+
* Normalize an image field value together with its `darkVariant`. The media
|
|
4414
|
+
* normalizer only keeps the media item's own keys, so the variant is normalized
|
|
4415
|
+
* separately and reattached.
|
|
4416
|
+
*/
|
|
4417
|
+
async function normalizeImageValue(
|
|
4418
|
+
value: unknown,
|
|
4419
|
+
getProvider: (id: string) => MediaProvider | undefined,
|
|
4420
|
+
): Promise<ImageValue | null> {
|
|
4421
|
+
const primary = await normalizePrimaryImageValue(value, getProvider);
|
|
4422
|
+
if (!primary || !isRecord(value) || value.darkVariant == null) return primary;
|
|
4423
|
+
const darkVariant = await normalizeMediaValue(value.darkVariant, getProvider);
|
|
4424
|
+
return darkVariant ? { ...primary, darkVariant } : primary;
|
|
4425
|
+
}
|
|
4426
|
+
|
|
4427
|
+
/**
|
|
4428
|
+
* Normalize the primary image of an image field value.
|
|
4429
|
+
*
|
|
4430
|
+
* A legacy string URL that the admin upgraded to `{ id: "", src: url }` so it
|
|
4431
|
+
* can carry a dark variant still has to normalize as a string: as an object it
|
|
4432
|
+
* counts as local media, which strips `src` and leaves nothing behind. The
|
|
4433
|
+
* upgrade outlives the variant — an editor can add one and remove it again —
|
|
4434
|
+
* so the shape decides, not the presence of `darkVariant`.
|
|
4435
|
+
*/
|
|
4436
|
+
async function normalizePrimaryImageValue(
|
|
4437
|
+
value: unknown,
|
|
4438
|
+
getProvider: (id: string) => MediaProvider | undefined,
|
|
4439
|
+
): Promise<ImageValue | null> {
|
|
4440
|
+
if (isRecord(value) && !value.id && typeof value.src === "string" && !value.provider) {
|
|
4441
|
+
return normalizeMediaValue(value.src, getProvider);
|
|
4442
|
+
}
|
|
4443
|
+
return normalizeMediaValue(value, getProvider);
|
|
4444
|
+
}
|
package/src/fields/image.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "astro/zod";
|
|
|
2
2
|
|
|
3
3
|
import type { FieldDefinition, ImageValue } from "./types.js";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const mediaSchema = z.object({
|
|
6
6
|
id: z.string(),
|
|
7
7
|
src: z.string().optional(),
|
|
8
8
|
alt: z.string().optional(),
|
|
@@ -17,10 +17,16 @@ const imageSchema = z.object({
|
|
|
17
17
|
meta: z.record(z.string(), z.unknown()).optional(),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
const imageSchema = mediaSchema.extend({
|
|
21
|
+
darkVariant: mediaSchema.optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
20
24
|
export interface ImageOptions {
|
|
21
25
|
required?: boolean;
|
|
22
26
|
maxSize?: number; // in bytes
|
|
23
27
|
allowedTypes?: string[]; // MIME types — exact or prefix
|
|
28
|
+
/** Offer editors a second slot for a dark-color-scheme counterpart of the image. */
|
|
29
|
+
darkVariant?: boolean;
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
export function image(options: ImageOptions = {}): FieldDefinition<ImageValue | undefined> {
|
package/src/fields/types.ts
CHANGED
|
@@ -51,9 +51,13 @@ export type { MediaValue } from "../media/types.js";
|
|
|
51
51
|
import type { MediaValue } from "../media/types.js";
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Persisted image field value: the media item shown by default, plus an
|
|
55
|
+
* optional counterpart for dark color schemes.
|
|
55
56
|
*/
|
|
56
|
-
export
|
|
57
|
+
export interface ImageValue extends MediaValue {
|
|
58
|
+
/** Media item shown instead of the primary one when the page renders in a dark color scheme. */
|
|
59
|
+
darkVariant?: MediaValue;
|
|
60
|
+
}
|
|
57
61
|
|
|
58
62
|
/**
|
|
59
63
|
* Persisted file field value.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { I18nConfig } from "./config.js";
|
|
2
|
+
|
|
3
|
+
export interface AstroLocaleObject {
|
|
4
|
+
path: string;
|
|
5
|
+
codes: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AstroI18nInput {
|
|
9
|
+
defaultLocale: string;
|
|
10
|
+
locales: readonly (string | AstroLocaleObject)[];
|
|
11
|
+
fallback?: Readonly<Record<string, string | undefined>>;
|
|
12
|
+
routing?: string | { prefixDefaultLocale?: boolean };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function normalizeAstroI18n(config: AstroI18nInput | null | undefined): I18nConfig | null {
|
|
16
|
+
if (!config) return null;
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
defaultLocale: config.defaultLocale,
|
|
20
|
+
locales: config.locales.map((locale) => (typeof locale === "string" ? locale : locale.path)),
|
|
21
|
+
fallback: config.fallback
|
|
22
|
+
? Object.fromEntries(
|
|
23
|
+
Object.entries(config.fallback).filter(
|
|
24
|
+
(entry): entry is [string, string] => entry[1] !== undefined,
|
|
25
|
+
),
|
|
26
|
+
)
|
|
27
|
+
: undefined,
|
|
28
|
+
prefixDefaultLocale:
|
|
29
|
+
typeof config.routing === "object" ? (config.routing.prefixDefaultLocale ?? false) : false,
|
|
30
|
+
};
|
|
31
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
// Database (only types and utilities - internal functions not exported)
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
EmDashDatabaseError,
|
|
4
|
+
getMigrationStatus,
|
|
5
|
+
getExactMigrationStatus,
|
|
6
|
+
MIGRATION_NAMES,
|
|
7
|
+
} from "./database/index.js";
|
|
3
8
|
export type {
|
|
4
9
|
DatabaseConfig,
|
|
5
10
|
MigrationStatus,
|
|
11
|
+
ExactMigrationStatus,
|
|
6
12
|
Database,
|
|
7
13
|
UserTable,
|
|
8
14
|
MediaTable,
|
|
@@ -78,6 +84,9 @@ export {
|
|
|
78
84
|
handleMediaCreate,
|
|
79
85
|
handleMediaUpdate,
|
|
80
86
|
handleMediaDelete,
|
|
87
|
+
handleMediaUsageActivationAdvance,
|
|
88
|
+
handleMediaUsageProgress,
|
|
89
|
+
handleMediaUsageRepair,
|
|
81
90
|
handleRevisionList,
|
|
82
91
|
handleRevisionGet,
|
|
83
92
|
handleRevisionRestore,
|
|
@@ -237,6 +246,8 @@ export {
|
|
|
237
246
|
PluginManager,
|
|
238
247
|
createPluginManager,
|
|
239
248
|
PluginRouteError,
|
|
249
|
+
ContentSaveRejectedError,
|
|
250
|
+
isContentSaveRejection,
|
|
240
251
|
// Scheduler (Node timer heartbeat — used by virtual:emdash/scheduler)
|
|
241
252
|
NodeCronScheduler,
|
|
242
253
|
// Sandbox
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface FocalPoint {
|
|
2
|
+
focalX: number;
|
|
3
|
+
focalY: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface FocalPointUpdate {
|
|
7
|
+
focalX?: number | null;
|
|
8
|
+
focalY?: number | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function isFocalCoordinate(value: unknown): value is number {
|
|
12
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 && value <= 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function normalizeFocalPoint(focalX: unknown, focalY: unknown): FocalPoint | null {
|
|
16
|
+
if (!isFocalCoordinate(focalX) || !isFocalCoordinate(focalY)) return null;
|
|
17
|
+
return { focalX, focalY };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function isValidFocalPointUpdate(input: FocalPointUpdate): boolean {
|
|
21
|
+
const hasX = input.focalX !== undefined;
|
|
22
|
+
const hasY = input.focalY !== undefined;
|
|
23
|
+
if (!hasX && !hasY) return true;
|
|
24
|
+
if (!hasX || !hasY) return false;
|
|
25
|
+
if (input.focalX === null || input.focalY === null) {
|
|
26
|
+
return input.focalX === null && input.focalY === null;
|
|
27
|
+
}
|
|
28
|
+
return normalizeFocalPoint(input.focalX, input.focalY) !== null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function focalPointToObjectPosition(focalX: unknown, focalY: unknown): string | undefined {
|
|
32
|
+
const point = normalizeFocalPoint(focalX, focalY);
|
|
33
|
+
if (!point) return undefined;
|
|
34
|
+
const x = Math.round(point.focalX * 10_000) / 100;
|
|
35
|
+
const y = Math.round(point.focalY * 10_000) / 100;
|
|
36
|
+
return `${x}% ${y}%`;
|
|
37
|
+
}
|
|
@@ -73,6 +73,8 @@ export const createMediaProvider: CreateMediaProviderFn<LocalMediaRuntimeConfig>
|
|
|
73
73
|
size: item.size ?? undefined,
|
|
74
74
|
width: item.width ?? undefined,
|
|
75
75
|
height: item.height ?? undefined,
|
|
76
|
+
focalX: item.focalX ?? undefined,
|
|
77
|
+
focalY: item.focalY ?? undefined,
|
|
76
78
|
blurhash: item.blurhash ?? undefined,
|
|
77
79
|
dominantColor: item.dominantColor ?? undefined,
|
|
78
80
|
alt: item.alt ?? undefined,
|
|
@@ -99,6 +101,8 @@ export const createMediaProvider: CreateMediaProviderFn<LocalMediaRuntimeConfig>
|
|
|
99
101
|
size: item.size ?? undefined,
|
|
100
102
|
width: item.width ?? undefined,
|
|
101
103
|
height: item.height ?? undefined,
|
|
104
|
+
focalX: item.focalX ?? undefined,
|
|
105
|
+
focalY: item.focalY ?? undefined,
|
|
102
106
|
blurhash: item.blurhash ?? undefined,
|
|
103
107
|
dominantColor: item.dominantColor ?? undefined,
|
|
104
108
|
alt: item.alt ?? undefined,
|
|
@@ -225,6 +229,8 @@ export function repoItemToProviderItem(item: {
|
|
|
225
229
|
size: number | null;
|
|
226
230
|
width: number | null;
|
|
227
231
|
height: number | null;
|
|
232
|
+
focalX?: number | null;
|
|
233
|
+
focalY?: number | null;
|
|
228
234
|
alt: string | null;
|
|
229
235
|
caption: string | null;
|
|
230
236
|
storageKey: string;
|
|
@@ -238,6 +244,8 @@ export function repoItemToProviderItem(item: {
|
|
|
238
244
|
size: item.size ?? undefined,
|
|
239
245
|
width: item.width ?? undefined,
|
|
240
246
|
height: item.height ?? undefined,
|
|
247
|
+
focalX: item.focalX ?? undefined,
|
|
248
|
+
focalY: item.focalY ?? undefined,
|
|
241
249
|
blurhash: item.blurhash ?? undefined,
|
|
242
250
|
dominantColor: item.dominantColor ?? undefined,
|
|
243
251
|
alt: item.alt ?? undefined,
|