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/dist/cli/index.mjs
CHANGED
|
@@ -1,57 +1,64 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as getMigrationStatus, c as __exportAll, s as runMigrations } from "../runner-77GOZCnH.mjs";
|
|
3
3
|
import { t as EmDashDatabaseError } from "../errors-9P_FDrJ_.mjs";
|
|
4
4
|
import { t as validateIdentifier } from "../validate-BpwoDOgt.mjs";
|
|
5
5
|
import { u as listTablesLike } from "../dialect-helpers-BSbfaO3F.mjs";
|
|
6
6
|
import { i as isI18nEnabled, r as getI18nConfig } from "../config-C3EBstHi.mjs";
|
|
7
7
|
import "../after-CBU2vkoO.mjs";
|
|
8
8
|
import "../object-cache-71tPfV4A.mjs";
|
|
9
|
-
import { t as ContentRepository } from "../content-
|
|
9
|
+
import { t as ContentRepository } from "../content-CP-SeXNa.mjs";
|
|
10
10
|
import { n as isMissingTableError } from "../db-errors-Cl-sKYTm.mjs";
|
|
11
11
|
import { n as slugify } from "../slugify-B994zkXC.mjs";
|
|
12
12
|
import { a as encodeBase64url } from "../base64-CvLhUKQv.mjs";
|
|
13
13
|
import "../types-CQPWhPxE.mjs";
|
|
14
|
-
import { t as MediaRepository } from "../media-
|
|
15
|
-
import { t as TaxonomyRepository } from "../taxonomy-
|
|
16
|
-
import { t as OptionsRepository } from "../options-
|
|
17
|
-
import "../redirect-
|
|
18
|
-
import "../request-cache-
|
|
19
|
-
import "../byline-registry-
|
|
20
|
-
import "../field-defs-cache-
|
|
21
|
-
import { t as BylineRepository } from "../byline-
|
|
22
|
-
import "../dist-
|
|
23
|
-
import "../fts-manager-
|
|
14
|
+
import { t as MediaRepository } from "../media-D6SeAfBl.mjs";
|
|
15
|
+
import { t as TaxonomyRepository } from "../taxonomy-8X09dLN5.mjs";
|
|
16
|
+
import { t as OptionsRepository } from "../options-BHPeIbBd.mjs";
|
|
17
|
+
import "../redirect-CZkbozu9.mjs";
|
|
18
|
+
import "../request-cache-DH9zdCOD.mjs";
|
|
19
|
+
import "../byline-registry-Bpu9-MVs.mjs";
|
|
20
|
+
import "../field-defs-cache-Bh4q6oar.mjs";
|
|
21
|
+
import { t as BylineRepository } from "../byline-Cpnwrje1.mjs";
|
|
22
|
+
import "../dist-89xCrGqi.mjs";
|
|
23
|
+
import "../fts-manager-BhOdW0bi.mjs";
|
|
24
24
|
import { kyselyLogOption } from "../database/instrumentation.mjs";
|
|
25
|
-
import "../loader-
|
|
26
|
-
import "../
|
|
27
|
-
import "../
|
|
28
|
-
import
|
|
29
|
-
import "../
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import "../
|
|
33
|
-
import "../
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
25
|
+
import "../loader-ZsjE4paL.mjs";
|
|
26
|
+
import "../capture-triggers-CNW1q3HK.mjs";
|
|
27
|
+
import "../activation-K0kGBWuJ.mjs";
|
|
28
|
+
import "../content-refresh-DLOfIhYc.mjs";
|
|
29
|
+
import "../collection-deletion-m_oi2c0N.mjs";
|
|
30
|
+
import { n as SchemaRegistry } from "../registry-Cx-jEJOS.mjs";
|
|
31
|
+
import "../settings-BgN-0DT-.mjs";
|
|
32
|
+
import { i as pluginManifestSchema } from "../manifest-schema-CUYPfCEH.mjs";
|
|
33
|
+
import { i as isDeprecatedCapability, t as CAPABILITY_RENAMES } from "../types-D6OcIp2P.mjs";
|
|
34
|
+
import "../ssrf-DqebVE34.mjs";
|
|
35
|
+
import "../ssrf-BPKzkm6O.mjs";
|
|
36
|
+
import { t as validateSeed } from "../validate-Dd-IUjnZ.mjs";
|
|
37
|
+
import { t as applySeed } from "../apply-B_VMpJ2P.mjs";
|
|
38
|
+
import { a as MigrationManifestValidationError, c as normalizeAstroI18n, i as getMigrationIntegrationMetadata, n as MIGRATION_CONFIG_SYMBOL, s as validateMigrationManifest, t as buildMigrationManifest } from "../manifest-builder-QXuqvVMP.mjs";
|
|
39
|
+
import "../identity-DXmb4aVp.mjs";
|
|
40
|
+
import { n as fingerprintKey, r as generateEncryptionKey, t as EmDashSecretsError } from "../secrets-BH2Qow1-.mjs";
|
|
41
|
+
import { t as openNodeSqliteDatabase } from "../node-sqlite-compat-Udb4Y-rs.mjs";
|
|
37
42
|
import { LocalStorage } from "../storage/local.mjs";
|
|
38
|
-
import { t as convertDataForRead } from "../portable-text-
|
|
43
|
+
import { t as convertDataForRead } from "../portable-text-C8Tvp4_g.mjs";
|
|
39
44
|
import { createHeaderAwareFetch, customHeadersInterceptor, getCachedAccessToken, isAccessRedirect, resolveCustomHeaders, runCloudflaredLogin } from "../client/cf-access.mjs";
|
|
40
45
|
import { EmDashClient } from "../client/index.mjs";
|
|
41
|
-
import { r as fileExists$4, t as bundleCommand } from "../bundle-
|
|
46
|
+
import { r as fileExists$4, t as bundleCommand } from "../bundle-DZFhFurR.mjs";
|
|
47
|
+
import { createRequire } from "node:module";
|
|
42
48
|
import { Kysely, SqliteDialect, sql } from "kysely";
|
|
43
49
|
import { createGzipDecoder, unpackTar } from "modern-tar";
|
|
44
|
-
import {
|
|
45
|
-
import { basename, dirname, join, resolve } from "node:path";
|
|
46
|
-
import BetterSqlite3 from "better-sqlite3";
|
|
50
|
+
import { pathToFileURL } from "node:url";
|
|
47
51
|
import { access, mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
52
|
+
import { basename, dirname, isAbsolute, join, parse, resolve } from "node:path";
|
|
53
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
48
54
|
import { defineCommand, runCommand, runMain } from "citty";
|
|
49
55
|
import consola, { consola as consola$1 } from "consola";
|
|
50
56
|
import pc from "picocolors";
|
|
51
57
|
import { spawn } from "node:child_process";
|
|
52
58
|
import { homedir } from "node:os";
|
|
53
|
-
import { parse, printParseErrorCode } from "jsonc-parser";
|
|
54
|
-
import { parse as parse$
|
|
59
|
+
import { parse as parse$1, printParseErrorCode } from "jsonc-parser";
|
|
60
|
+
import { parse as parse$2 } from "smol-toml";
|
|
61
|
+
import { createInterface } from "node:readline/promises";
|
|
55
62
|
|
|
56
63
|
//#region src/cli/commands/auth.ts
|
|
57
64
|
/**
|
|
@@ -130,7 +137,7 @@ function resolveCredentialKey(baseUrl) {
|
|
|
130
137
|
try {
|
|
131
138
|
const url = new URL(baseUrl);
|
|
132
139
|
if (url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "[::1]") {
|
|
133
|
-
const projectPath = findProjectRoot(process.cwd());
|
|
140
|
+
const projectPath = findProjectRoot$1(process.cwd());
|
|
134
141
|
if (projectPath) return `path:${projectPath}`;
|
|
135
142
|
return url.origin;
|
|
136
143
|
}
|
|
@@ -142,7 +149,7 @@ function resolveCredentialKey(baseUrl) {
|
|
|
142
149
|
/**
|
|
143
150
|
* Walk up from cwd to find the project root (directory containing astro.config.*).
|
|
144
151
|
*/
|
|
145
|
-
function findProjectRoot(from) {
|
|
152
|
+
function findProjectRoot$1(from) {
|
|
146
153
|
let dir = resolve(from);
|
|
147
154
|
const root = resolve("/");
|
|
148
155
|
while (dir !== root) {
|
|
@@ -860,17 +867,6 @@ const contentCommand = defineCommand({
|
|
|
860
867
|
//#endregion
|
|
861
868
|
//#region src/database/connection.ts
|
|
862
869
|
/**
|
|
863
|
-
* Returns a helpful, actionable message when better-sqlite3's native binary
|
|
864
|
-
* was compiled against a different Node.js version than the one running. This
|
|
865
|
-
* happens after upgrading Node without rebuilding native deps.
|
|
866
|
-
*
|
|
867
|
-
* Returns null if the error is not a NODE_MODULE_VERSION mismatch.
|
|
868
|
-
*/
|
|
869
|
-
function formatNativeModuleVersionError(error) {
|
|
870
|
-
if (!(error instanceof Error ? error.message : String(error)).includes("NODE_MODULE_VERSION")) return null;
|
|
871
|
-
return "better-sqlite3's native binary was compiled against a different Node.js version. Rebuild it with `pnpm rebuild better-sqlite3` (or `npm rebuild better-sqlite3`), or reinstall dependencies with your current Node.js version.";
|
|
872
|
-
}
|
|
873
|
-
/**
|
|
874
870
|
* Creates a Kysely database instance
|
|
875
871
|
* Supports:
|
|
876
872
|
* - file:./path/to/db.sqlite (local SQLite)
|
|
@@ -879,15 +875,10 @@ function formatNativeModuleVersionError(error) {
|
|
|
879
875
|
*/
|
|
880
876
|
function createDatabase(config) {
|
|
881
877
|
try {
|
|
882
|
-
if (config.url.startsWith("file:") || config.url === ":memory:") {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
return new Kysely({
|
|
887
|
-
dialect: new SqliteDialect({ database: sqlite }),
|
|
888
|
-
log: kyselyLogOption()
|
|
889
|
-
});
|
|
890
|
-
}
|
|
878
|
+
if (config.url.startsWith("file:") || config.url === ":memory:") return new Kysely({
|
|
879
|
+
dialect: new SqliteDialect({ database: openNodeSqliteDatabase(config.url === ":memory:" ? ":memory:" : config.url.replace("file:", ""), { journalMode: "wal" }) }),
|
|
880
|
+
log: kyselyLogOption()
|
|
881
|
+
});
|
|
891
882
|
if (config.url.startsWith("libsql:")) {
|
|
892
883
|
if (!config.authToken) throw new EmDashDatabaseError("Auth token required for remote libSQL database");
|
|
893
884
|
throw new EmDashDatabaseError("LibSQL not yet implemented");
|
|
@@ -895,8 +886,6 @@ function createDatabase(config) {
|
|
|
895
886
|
throw new EmDashDatabaseError(`Unsupported database URL scheme: ${config.url}`);
|
|
896
887
|
} catch (error) {
|
|
897
888
|
if (error instanceof EmDashDatabaseError) throw error;
|
|
898
|
-
const nativeVersionHint = formatNativeModuleVersionError(error);
|
|
899
|
-
if (nativeVersionHint) throw new EmDashDatabaseError(nativeVersionHint, error);
|
|
900
889
|
throw new EmDashDatabaseError("Failed to create database", error);
|
|
901
890
|
}
|
|
902
891
|
}
|
|
@@ -1080,7 +1069,7 @@ async function fileExists$2(path) {
|
|
|
1080
1069
|
return false;
|
|
1081
1070
|
}
|
|
1082
1071
|
}
|
|
1083
|
-
function isRecord(value) {
|
|
1072
|
+
function isRecord$2(value) {
|
|
1084
1073
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1085
1074
|
}
|
|
1086
1075
|
function sourcePosition(source, offset) {
|
|
@@ -1107,7 +1096,7 @@ async function checkSchedulerWiringAtPath(cwd, configPath) {
|
|
|
1107
1096
|
const configSource = await readFile(configPath, "utf8");
|
|
1108
1097
|
let parsed;
|
|
1109
1098
|
if (configPath.endsWith(".toml")) try {
|
|
1110
|
-
parsed = parse$
|
|
1099
|
+
parsed = parse$2(configSource);
|
|
1111
1100
|
} catch (error) {
|
|
1112
1101
|
return [{
|
|
1113
1102
|
name: "scheduler config",
|
|
@@ -1117,7 +1106,7 @@ async function checkSchedulerWiringAtPath(cwd, configPath) {
|
|
|
1117
1106
|
}
|
|
1118
1107
|
else {
|
|
1119
1108
|
const parseErrors = [];
|
|
1120
|
-
parsed = parse(configSource, parseErrors, {
|
|
1109
|
+
parsed = parse$1(configSource, parseErrors, {
|
|
1121
1110
|
allowTrailingComma: true,
|
|
1122
1111
|
disallowComments: false
|
|
1123
1112
|
});
|
|
@@ -1131,12 +1120,12 @@ async function checkSchedulerWiringAtPath(cwd, configPath) {
|
|
|
1131
1120
|
}];
|
|
1132
1121
|
}
|
|
1133
1122
|
}
|
|
1134
|
-
if (!isRecord(parsed)) return [{
|
|
1123
|
+
if (!isRecord$2(parsed)) return [{
|
|
1135
1124
|
name: "scheduler config",
|
|
1136
1125
|
status: "fail",
|
|
1137
1126
|
message: `could not parse ${configPath}: expected an object — fix the Wrangler configuration syntax`
|
|
1138
1127
|
}];
|
|
1139
|
-
const triggers = isRecord(parsed.triggers) ? parsed.triggers : null;
|
|
1128
|
+
const triggers = isRecord$2(parsed.triggers) ? parsed.triggers : null;
|
|
1140
1129
|
const hasCronTrigger = Array.isArray(triggers?.crons) && triggers.crons.some((cron) => typeof cron === "string" && cron.trim().length > 0);
|
|
1141
1130
|
const main = typeof parsed.main === "string" && parsed.main.trim() ? parsed.main : null;
|
|
1142
1131
|
if (!main) return [{
|
|
@@ -1149,7 +1138,7 @@ async function checkSchedulerWiringAtPath(cwd, configPath) {
|
|
|
1149
1138
|
try {
|
|
1150
1139
|
hasScheduledHandler = workerExportsScheduledMaintenance(await readFile(workerPath, "utf8"));
|
|
1151
1140
|
} catch (error) {
|
|
1152
|
-
if ((isRecord(error) && typeof error.code === "string" ? error.code : null) !== "ENOENT") return [{
|
|
1141
|
+
if ((isRecord$2(error) && typeof error.code === "string" ? error.code : null) !== "ENOENT") return [{
|
|
1153
1142
|
name: "scheduler handler",
|
|
1154
1143
|
status: "fail",
|
|
1155
1144
|
message: `could not read Worker entry ${workerPath}: ${error instanceof Error ? error.message : "unknown I/O error"} — check the file path and permissions`
|
|
@@ -2599,6 +2588,522 @@ const menuCommand = defineCommand({
|
|
|
2599
2588
|
}
|
|
2600
2589
|
});
|
|
2601
2590
|
|
|
2591
|
+
//#endregion
|
|
2592
|
+
//#region src/migrations/config-loader.ts
|
|
2593
|
+
const ASTRO_CONFIG_FILENAMES = [
|
|
2594
|
+
"astro.config.mjs",
|
|
2595
|
+
"astro.config.js",
|
|
2596
|
+
"astro.config.ts",
|
|
2597
|
+
"astro.config.mts"
|
|
2598
|
+
];
|
|
2599
|
+
var MigrationConfigLoaderError = class extends Error {
|
|
2600
|
+
constructor(message, options) {
|
|
2601
|
+
super(message, options);
|
|
2602
|
+
this.name = "MigrationConfigLoaderError";
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
async function isAccessible(path) {
|
|
2606
|
+
try {
|
|
2607
|
+
await access(path);
|
|
2608
|
+
return true;
|
|
2609
|
+
} catch {
|
|
2610
|
+
return false;
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
async function findAstroConfigFile(projectRoot, configFile) {
|
|
2614
|
+
const root = resolve(projectRoot);
|
|
2615
|
+
if (configFile) {
|
|
2616
|
+
const explicitPath = isAbsolute(configFile) ? configFile : resolve(root, configFile);
|
|
2617
|
+
if (await isAccessible(explicitPath)) return explicitPath;
|
|
2618
|
+
throw new MigrationConfigLoaderError(`Astro config file not found: ${explicitPath}`);
|
|
2619
|
+
}
|
|
2620
|
+
for (const filename of ASTRO_CONFIG_FILENAMES) {
|
|
2621
|
+
const candidate = resolve(root, filename);
|
|
2622
|
+
if (await isAccessible(candidate)) return candidate;
|
|
2623
|
+
}
|
|
2624
|
+
throw new MigrationConfigLoaderError(`No Astro config file found in ${root}`);
|
|
2625
|
+
}
|
|
2626
|
+
function projectRequire(projectRoot) {
|
|
2627
|
+
return createRequire(resolve(projectRoot, "package.json"));
|
|
2628
|
+
}
|
|
2629
|
+
async function importModule(path) {
|
|
2630
|
+
return import(pathToFileURL(path).href);
|
|
2631
|
+
}
|
|
2632
|
+
function isRecord$1(value) {
|
|
2633
|
+
return typeof value === "object" && value !== null;
|
|
2634
|
+
}
|
|
2635
|
+
function moduleExport$1(module, name) {
|
|
2636
|
+
if (!isRecord$1(module)) return void 0;
|
|
2637
|
+
const direct = module[name];
|
|
2638
|
+
if (direct !== void 0) return direct;
|
|
2639
|
+
const defaultExport = module.default;
|
|
2640
|
+
return isRecord$1(defaultExport) ? defaultExport[name] : void 0;
|
|
2641
|
+
}
|
|
2642
|
+
function isCoreMigrationIdentity(value) {
|
|
2643
|
+
return isRecord$1(value) && typeof value.emdashVersion === "string" && Array.isArray(value.names) && value.names.every((name) => typeof name === "string") && typeof value.fingerprint === "string";
|
|
2644
|
+
}
|
|
2645
|
+
async function loadProjectConfig(projectRoot, configFile) {
|
|
2646
|
+
let viteEntrypoint;
|
|
2647
|
+
try {
|
|
2648
|
+
viteEntrypoint = createRequire(projectRequire(projectRoot).resolve("astro")).resolve("vite");
|
|
2649
|
+
} catch (error) {
|
|
2650
|
+
throw new MigrationConfigLoaderError("Could not resolve Vite through the project's Astro installation", { cause: error });
|
|
2651
|
+
}
|
|
2652
|
+
const loadConfigFromFile = moduleExport$1(await importModule(viteEntrypoint), "loadConfigFromFile");
|
|
2653
|
+
if (typeof loadConfigFromFile !== "function") throw new MigrationConfigLoaderError("The Vite installation used by project-local Astro does not export loadConfigFromFile");
|
|
2654
|
+
const loaded = await Reflect.apply(loadConfigFromFile, void 0, [
|
|
2655
|
+
{
|
|
2656
|
+
command: "build",
|
|
2657
|
+
mode: "production"
|
|
2658
|
+
},
|
|
2659
|
+
configFile,
|
|
2660
|
+
projectRoot,
|
|
2661
|
+
"silent"
|
|
2662
|
+
]);
|
|
2663
|
+
if (!isRecord$1(loaded) || !Object.hasOwn(loaded, "config")) throw new MigrationConfigLoaderError(`Vite could not load Astro config: ${configFile}`);
|
|
2664
|
+
return loaded.config;
|
|
2665
|
+
}
|
|
2666
|
+
async function loadProjectIdentity(projectRoot) {
|
|
2667
|
+
let identityEntrypoint;
|
|
2668
|
+
try {
|
|
2669
|
+
identityEntrypoint = projectRequire(projectRoot).resolve("emdash/migrations");
|
|
2670
|
+
} catch (error) {
|
|
2671
|
+
throw new MigrationConfigLoaderError("Could not resolve emdash/migrations from the project", { cause: error });
|
|
2672
|
+
}
|
|
2673
|
+
const getIdentity = moduleExport$1(await importModule(identityEntrypoint), "getCoreMigrationIdentity");
|
|
2674
|
+
if (typeof getIdentity !== "function") throw new MigrationConfigLoaderError("The project-local emdash/migrations module does not export getCoreMigrationIdentity");
|
|
2675
|
+
const identity = await Reflect.apply(getIdentity, void 0, []);
|
|
2676
|
+
if (!isCoreMigrationIdentity(identity)) throw new MigrationConfigLoaderError("The project-local emdash/migrations module returned an invalid migration identity");
|
|
2677
|
+
return identity;
|
|
2678
|
+
}
|
|
2679
|
+
const defaultDependencies$1 = {
|
|
2680
|
+
findConfigFile: findAstroConfigFile,
|
|
2681
|
+
loadConfig: loadProjectConfig,
|
|
2682
|
+
loadIdentity: loadProjectIdentity
|
|
2683
|
+
};
|
|
2684
|
+
function asAstroConfig(value) {
|
|
2685
|
+
if (typeof value !== "object" || value === null) throw new MigrationConfigLoaderError("Astro config must export an object");
|
|
2686
|
+
return value;
|
|
2687
|
+
}
|
|
2688
|
+
async function buildMigrationManifestFromConfig(options, dependencies = defaultDependencies$1) {
|
|
2689
|
+
const projectRoot = resolve(options.projectRoot);
|
|
2690
|
+
const configFile = await dependencies.findConfigFile(projectRoot, options.configFile);
|
|
2691
|
+
const config = asAstroConfig(await dependencies.loadConfig(projectRoot, configFile));
|
|
2692
|
+
const matchingIntegrations = (Array.isArray(config.integrations) ? config.integrations : []).filter((integration) => getMigrationIntegrationMetadata(integration) !== void 0);
|
|
2693
|
+
if (matchingIntegrations.length !== 1) throw new MigrationConfigLoaderError(`Expected exactly one EmDash integration with migration metadata (${String(MIGRATION_CONFIG_SYMBOL)}), found ${matchingIntegrations.length}`);
|
|
2694
|
+
const metadata = getMigrationIntegrationMetadata(matchingIntegrations[0]);
|
|
2695
|
+
if (!metadata?.database) throw new MigrationConfigLoaderError("The EmDash integration does not provide database migration metadata");
|
|
2696
|
+
return buildMigrationManifest({
|
|
2697
|
+
identity: await dependencies.loadIdentity(projectRoot),
|
|
2698
|
+
i18n: normalizeAstroI18n(config.i18n),
|
|
2699
|
+
database: metadata.database
|
|
2700
|
+
});
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
//#endregion
|
|
2704
|
+
//#region src/cli/commands/migrate.ts
|
|
2705
|
+
const FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
|
|
2706
|
+
const SAFE_TARGET_KIND_PATTERN = /^[a-z][a-z0-9_-]*$/;
|
|
2707
|
+
const SAFE_MIGRATION_NAME_PATTERN = /^[A-Za-z0-9_.-]+$/;
|
|
2708
|
+
const CREDENTIAL_URL_PATTERN = /:\/\/[^/\s]+@/;
|
|
2709
|
+
const CREDENTIAL_QUERY_PATTERN = /[?&](?:auth|credential|key|password|secret|signature|token)=/i;
|
|
2710
|
+
const MIGRATE_EXIT_CODES = Object.freeze({
|
|
2711
|
+
success: 0,
|
|
2712
|
+
error: 1,
|
|
2713
|
+
pending: 2,
|
|
2714
|
+
unknownApplied: 3,
|
|
2715
|
+
confirmation: 4,
|
|
2716
|
+
interrupted: 130
|
|
2717
|
+
});
|
|
2718
|
+
var MigrateCommandError = class extends Error {
|
|
2719
|
+
constructor(message) {
|
|
2720
|
+
super(message);
|
|
2721
|
+
this.name = "MigrateCommandError";
|
|
2722
|
+
}
|
|
2723
|
+
};
|
|
2724
|
+
function isRecord(value) {
|
|
2725
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2726
|
+
}
|
|
2727
|
+
function moduleExport(module, name) {
|
|
2728
|
+
if (!isRecord(module)) return void 0;
|
|
2729
|
+
const direct = Reflect.get(module, name);
|
|
2730
|
+
if (direct !== void 0) return direct;
|
|
2731
|
+
const defaultExport = Reflect.get(module, "default");
|
|
2732
|
+
return isRecord(defaultExport) ? Reflect.get(defaultExport, name) : void 0;
|
|
2733
|
+
}
|
|
2734
|
+
async function importProjectModule(projectRoot, specifier) {
|
|
2735
|
+
let resolvedEntrypoint;
|
|
2736
|
+
try {
|
|
2737
|
+
resolvedEntrypoint = createRequire(resolve(projectRoot, "package.json")).resolve(specifier);
|
|
2738
|
+
} catch {
|
|
2739
|
+
throw new MigrateCommandError(`Could not resolve ${specifier} from the project.`);
|
|
2740
|
+
}
|
|
2741
|
+
return import(pathToFileURL(resolvedEntrypoint).href);
|
|
2742
|
+
}
|
|
2743
|
+
function validateIdentity(value) {
|
|
2744
|
+
if (!isRecord(value) || typeof value.emdashVersion !== "string" || !Array.isArray(value.names) || !value.names.every((name) => typeof name === "string") || typeof value.fingerprint !== "string" || !FINGERPRINT_PATTERN.test(value.fingerprint)) throw new MigrateCommandError("The project-local emdash/migrations module returned an invalid migration identity.");
|
|
2745
|
+
return {
|
|
2746
|
+
emdashVersion: value.emdashVersion,
|
|
2747
|
+
names: [...value.names],
|
|
2748
|
+
fingerprint: value.fingerprint
|
|
2749
|
+
};
|
|
2750
|
+
}
|
|
2751
|
+
async function loadProjectMigrationIdentity(projectRoot) {
|
|
2752
|
+
const getIdentity = moduleExport(await importProjectModule(projectRoot, "emdash/migrations"), "getCoreMigrationIdentity");
|
|
2753
|
+
if (typeof getIdentity !== "function") throw new MigrateCommandError("The project-local emdash/migrations module does not export getCoreMigrationIdentity.");
|
|
2754
|
+
return validateIdentity(await Reflect.apply(getIdentity, void 0, []));
|
|
2755
|
+
}
|
|
2756
|
+
async function loadProjectMigrationExecutor(projectRoot, entrypoint) {
|
|
2757
|
+
const factory = moduleExport(await importProjectModule(projectRoot, entrypoint), "createMigrationExecutor");
|
|
2758
|
+
if (typeof factory !== "function") throw new MigrateCommandError(`The project-local ${entrypoint} module does not export createMigrationExecutor.`);
|
|
2759
|
+
return (manifestConfig, context) => Reflect.apply(factory, void 0, [manifestConfig, context]);
|
|
2760
|
+
}
|
|
2761
|
+
async function findProjectRoot(start) {
|
|
2762
|
+
let current = resolve(start);
|
|
2763
|
+
const filesystemRoot = parse(current).root;
|
|
2764
|
+
for (;;) {
|
|
2765
|
+
try {
|
|
2766
|
+
await readFile(resolve(current, "package.json"), "utf8");
|
|
2767
|
+
return current;
|
|
2768
|
+
} catch (error) {
|
|
2769
|
+
if (isRecord(error) && error.code !== "ENOENT" && error.code !== "ENOTDIR") throw new MigrateCommandError("Could not read the project package.json.");
|
|
2770
|
+
}
|
|
2771
|
+
if (current === filesystemRoot) break;
|
|
2772
|
+
current = dirname(current);
|
|
2773
|
+
}
|
|
2774
|
+
throw new MigrateCommandError("Could not find a project root containing package.json.");
|
|
2775
|
+
}
|
|
2776
|
+
async function readMigrationManifestFile(path, isDefault) {
|
|
2777
|
+
let source;
|
|
2778
|
+
try {
|
|
2779
|
+
source = await readFile(path, "utf8");
|
|
2780
|
+
} catch (error) {
|
|
2781
|
+
if (isDefault && isRecord(error) && (error.code === "ENOENT" || error.code === "ENOTDIR")) throw new MigrateCommandError(`No migration manifest found at ${path}. Build the project or use --from-config.`);
|
|
2782
|
+
throw new MigrateCommandError(`Could not read migration manifest: ${path}`);
|
|
2783
|
+
}
|
|
2784
|
+
try {
|
|
2785
|
+
return JSON.parse(source);
|
|
2786
|
+
} catch {
|
|
2787
|
+
throw new MigrateCommandError(`Migration manifest is not valid JSON: ${path}`);
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
async function confirmWithReadline(message) {
|
|
2791
|
+
const prompt = createInterface({
|
|
2792
|
+
input: process.stdin,
|
|
2793
|
+
output: process.stderr
|
|
2794
|
+
});
|
|
2795
|
+
try {
|
|
2796
|
+
const answer = await prompt.question(`${message} [y/N] `);
|
|
2797
|
+
return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
|
|
2798
|
+
} finally {
|
|
2799
|
+
prompt.close();
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
function onProcessSignal(signal, handler) {
|
|
2803
|
+
const listener = () => {
|
|
2804
|
+
handler().finally(() => process.exit(MIGRATE_EXIT_CODES.interrupted));
|
|
2805
|
+
};
|
|
2806
|
+
process.once(signal, listener);
|
|
2807
|
+
return () => process.removeListener(signal, listener);
|
|
2808
|
+
}
|
|
2809
|
+
const defaultDependencies = {
|
|
2810
|
+
cwd: process.cwd(),
|
|
2811
|
+
env: process.env,
|
|
2812
|
+
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
2813
|
+
findProjectRoot,
|
|
2814
|
+
readManifest: readMigrationManifestFile,
|
|
2815
|
+
buildManifestFromConfig: (projectRoot, configFile) => buildMigrationManifestFromConfig({
|
|
2816
|
+
projectRoot,
|
|
2817
|
+
configFile
|
|
2818
|
+
}),
|
|
2819
|
+
loadProjectIdentity: loadProjectMigrationIdentity,
|
|
2820
|
+
loadProjectExecutor: loadProjectMigrationExecutor,
|
|
2821
|
+
confirm: confirmWithReadline,
|
|
2822
|
+
writeStdout: (value) => process.stdout.write(`${value}\n`),
|
|
2823
|
+
writeStderr: (value) => process.stderr.write(`${value}\n`),
|
|
2824
|
+
onSignal: onProcessSignal,
|
|
2825
|
+
cleanupTimeoutMs: 2e3
|
|
2826
|
+
};
|
|
2827
|
+
function validateOptions(options) {
|
|
2828
|
+
if (options.manifest && options.fromConfig) throw new MigrateCommandError("--manifest and --from-config cannot be used together.");
|
|
2829
|
+
if (options.config && !options.fromConfig) throw new MigrateCommandError("--config requires --from-config.");
|
|
2830
|
+
if (options.check && options.status) throw new MigrateCommandError("--check and --status cannot be used together.");
|
|
2831
|
+
if (options.expectedTargetFingerprint && !FINGERPRINT_PATTERN.test(options.expectedTargetFingerprint)) throw new MigrateCommandError("--expected-target-fingerprint must be a SHA-256 fingerprint.");
|
|
2832
|
+
}
|
|
2833
|
+
function hasControlCharacter(value) {
|
|
2834
|
+
for (let index = 0; index < value.length; index++) {
|
|
2835
|
+
const code = value.charCodeAt(index);
|
|
2836
|
+
if (code <= 31 || code === 127) return true;
|
|
2837
|
+
}
|
|
2838
|
+
return false;
|
|
2839
|
+
}
|
|
2840
|
+
function targetField(value, name) {
|
|
2841
|
+
if (value === void 0) return void 0;
|
|
2842
|
+
if (typeof value !== "string" || value.length === 0 || hasControlCharacter(value) || CREDENTIAL_URL_PATTERN.test(value) || CREDENTIAL_QUERY_PATTERN.test(value)) throw new MigrateCommandError(`The executor returned an unsafe migration target ${name}.`);
|
|
2843
|
+
return value;
|
|
2844
|
+
}
|
|
2845
|
+
function immutableTarget(value) {
|
|
2846
|
+
if (!isRecord(value)) throw new MigrateCommandError("The executor returned an invalid migration target.");
|
|
2847
|
+
const kind = targetField(value.kind, "kind");
|
|
2848
|
+
const label = targetField(value.label, "label");
|
|
2849
|
+
const fingerprint = targetField(value.fingerprint, "fingerprint");
|
|
2850
|
+
if (!kind || !SAFE_TARGET_KIND_PATTERN.test(kind) || !label || !fingerprint || !FINGERPRINT_PATTERN.test(fingerprint)) throw new MigrateCommandError("The executor returned an invalid migration target.");
|
|
2851
|
+
const target = {
|
|
2852
|
+
kind,
|
|
2853
|
+
label,
|
|
2854
|
+
fingerprint
|
|
2855
|
+
};
|
|
2856
|
+
const accountId = targetField(value.accountId, "accountId");
|
|
2857
|
+
const environment = targetField(value.environment, "environment");
|
|
2858
|
+
const resourceId = targetField(value.resourceId, "resourceId");
|
|
2859
|
+
if (accountId) target.accountId = accountId;
|
|
2860
|
+
if (environment) target.environment = environment;
|
|
2861
|
+
if (resourceId) target.resourceId = resourceId;
|
|
2862
|
+
return Object.freeze(target);
|
|
2863
|
+
}
|
|
2864
|
+
function safeMigrationNames(value, field) {
|
|
2865
|
+
if (!Array.isArray(value) || !value.every((name) => typeof name === "string" && SAFE_MIGRATION_NAME_PATTERN.test(name))) throw new MigrateCommandError(`The migration executor returned an invalid ${field} report.`);
|
|
2866
|
+
return [...value];
|
|
2867
|
+
}
|
|
2868
|
+
function safeReport(value, target) {
|
|
2869
|
+
if (!isRecord(value)) throw new MigrateCommandError("The migration executor returned an invalid report.");
|
|
2870
|
+
const reportTarget = immutableTarget(value.target);
|
|
2871
|
+
if (reportTarget.kind !== target.kind || reportTarget.label !== target.label || reportTarget.fingerprint !== target.fingerprint || reportTarget.accountId !== target.accountId || reportTarget.environment !== target.environment || reportTarget.resourceId !== target.resourceId) throw new MigrateCommandError("The migration executor report target does not match the confirmed target.");
|
|
2872
|
+
return {
|
|
2873
|
+
target: { ...reportTarget },
|
|
2874
|
+
knownApplied: safeMigrationNames(value.knownApplied, "knownApplied"),
|
|
2875
|
+
pending: safeMigrationNames(value.pending, "pending"),
|
|
2876
|
+
unknownApplied: safeMigrationNames(value.unknownApplied, "unknownApplied"),
|
|
2877
|
+
executed: safeMigrationNames(value.executed, "executed")
|
|
2878
|
+
};
|
|
2879
|
+
}
|
|
2880
|
+
function printTarget(target, write) {
|
|
2881
|
+
write(`Migration target: ${target.kind} ${target.label}`);
|
|
2882
|
+
if (target.accountId) write(`Account: ${target.accountId}`);
|
|
2883
|
+
if (target.environment) write(`Environment: ${target.environment}`);
|
|
2884
|
+
if (target.resourceId) write(`Resource: ${target.resourceId}`);
|
|
2885
|
+
write(`Target fingerprint: ${target.fingerprint}`);
|
|
2886
|
+
}
|
|
2887
|
+
function printNameSet(label, names, write) {
|
|
2888
|
+
write(`${label}: ${names.length === 0 ? "none" : names.join(", ")}`);
|
|
2889
|
+
}
|
|
2890
|
+
function printHumanReport(report, write) {
|
|
2891
|
+
printNameSet("Known applied", report.knownApplied, write);
|
|
2892
|
+
printNameSet("Pending", report.pending, write);
|
|
2893
|
+
printNameSet("Unknown applied", report.unknownApplied, write);
|
|
2894
|
+
printNameSet("Executed", report.executed, write);
|
|
2895
|
+
}
|
|
2896
|
+
function reportExitCode(options, report) {
|
|
2897
|
+
if (!options.check) return MIGRATE_EXIT_CODES.success;
|
|
2898
|
+
if (report.unknownApplied.length > 0) return MIGRATE_EXIT_CODES.unknownApplied;
|
|
2899
|
+
if (report.pending.length > 0) return MIGRATE_EXIT_CODES.pending;
|
|
2900
|
+
return MIGRATE_EXIT_CODES.success;
|
|
2901
|
+
}
|
|
2902
|
+
function createOverrides(options) {
|
|
2903
|
+
return {
|
|
2904
|
+
database: options.database,
|
|
2905
|
+
databaseUrlEnv: options.databaseUrlEnv,
|
|
2906
|
+
d1: options.d1,
|
|
2907
|
+
accountId: options.accountId,
|
|
2908
|
+
wranglerConfig: options.wranglerConfig,
|
|
2909
|
+
wranglerEnv: options.wranglerEnv
|
|
2910
|
+
};
|
|
2911
|
+
}
|
|
2912
|
+
function bounded(operation, timeoutMs) {
|
|
2913
|
+
let timer;
|
|
2914
|
+
const timeout = new Promise((resolveTimeout) => {
|
|
2915
|
+
timer = setTimeout(resolveTimeout, timeoutMs, "timeout");
|
|
2916
|
+
});
|
|
2917
|
+
const completion = operation.then(() => "complete", () => "failed");
|
|
2918
|
+
return Promise.race([completion, timeout]).finally(() => clearTimeout(timer));
|
|
2919
|
+
}
|
|
2920
|
+
async function loadManifest(options, projectRoot, dependencies) {
|
|
2921
|
+
if (options.fromConfig) {
|
|
2922
|
+
dependencies.writeStderr(`Using trusted evaluated Astro configuration${options.config ? `: ${options.config}` : "."}`);
|
|
2923
|
+
return dependencies.buildManifestFromConfig(projectRoot, options.config);
|
|
2924
|
+
}
|
|
2925
|
+
const isDefault = !options.manifest;
|
|
2926
|
+
const path = options.manifest ? isAbsolute(options.manifest) ? options.manifest : resolve(projectRoot, options.manifest) : resolve(projectRoot, ".emdash/migrations.json");
|
|
2927
|
+
return dependencies.readManifest(path, isDefault);
|
|
2928
|
+
}
|
|
2929
|
+
function redactExecutorMessage(message, env) {
|
|
2930
|
+
let redacted = message.replace(/[A-Za-z][A-Za-z0-9+.-]*:\/\/\S+/g, "[REDACTED_URL]").replace(/\b(auth|credential|key|password|secret|signature|token)\s*[=:]\s*\S+/gi, "$1=[REDACTED]");
|
|
2931
|
+
for (const value of Object.values(env)) if (value && value.length >= 4) redacted = redacted.replaceAll(value, "[REDACTED]");
|
|
2932
|
+
return redacted.replaceAll(/[\r\n\t]/g, " ").slice(0, 1e3);
|
|
2933
|
+
}
|
|
2934
|
+
function safeCommandMessage(error, env) {
|
|
2935
|
+
if (error instanceof MigrateCommandError || error instanceof MigrationManifestValidationError) return error.message;
|
|
2936
|
+
if (error instanceof Error && error.message) return redactExecutorMessage(error.message, env);
|
|
2937
|
+
return "Migration command failed. Check the project configuration, target, and credentials.";
|
|
2938
|
+
}
|
|
2939
|
+
async function runMigrateCommand(options, dependencies = defaultDependencies) {
|
|
2940
|
+
let executor;
|
|
2941
|
+
let disposePromise;
|
|
2942
|
+
let interrupted = false;
|
|
2943
|
+
let primaryFailure = false;
|
|
2944
|
+
let exitCode = MIGRATE_EXIT_CODES.error;
|
|
2945
|
+
const interruptedResult = Symbol("interrupted");
|
|
2946
|
+
let resolveInterruption;
|
|
2947
|
+
const interruption = new Promise((resolveInterrupted) => {
|
|
2948
|
+
resolveInterruption = () => resolveInterrupted(interruptedResult);
|
|
2949
|
+
});
|
|
2950
|
+
const dispose = () => {
|
|
2951
|
+
disposePromise ??= executor?.dispose?.() ?? Promise.resolve();
|
|
2952
|
+
return disposePromise;
|
|
2953
|
+
};
|
|
2954
|
+
const removeSignalHandlers = [];
|
|
2955
|
+
const execute = async () => {
|
|
2956
|
+
try {
|
|
2957
|
+
validateOptions(options);
|
|
2958
|
+
const projectRoot = await dependencies.findProjectRoot(dependencies.cwd);
|
|
2959
|
+
const manifest = await validateMigrationManifest(await loadManifest(options, projectRoot, dependencies), await dependencies.loadProjectIdentity(projectRoot));
|
|
2960
|
+
executor = await (await dependencies.loadProjectExecutor(projectRoot, manifest.database.executorEntrypoint))(manifest.database.executorConfig, {
|
|
2961
|
+
projectRoot,
|
|
2962
|
+
env: dependencies.env,
|
|
2963
|
+
overrides: createOverrides(options)
|
|
2964
|
+
});
|
|
2965
|
+
const target = immutableTarget(executor.target);
|
|
2966
|
+
printTarget(target, dependencies.writeStderr);
|
|
2967
|
+
const onSignal = async () => {
|
|
2968
|
+
interrupted = true;
|
|
2969
|
+
await bounded(dispose(), dependencies.cleanupTimeoutMs);
|
|
2970
|
+
resolveInterruption?.();
|
|
2971
|
+
};
|
|
2972
|
+
removeSignalHandlers.push(dependencies.onSignal("SIGINT", onSignal), dependencies.onSignal("SIGTERM", onSignal));
|
|
2973
|
+
const applying = !options.check && !options.status;
|
|
2974
|
+
if (applying && target.kind === "d1") dependencies.writeStderr("Warning: D1 migration jobs must be serialized externally by Cloudflare account and database UUID; this command does not coordinate concurrent applies.");
|
|
2975
|
+
if (applying) {
|
|
2976
|
+
if (options.expectedTargetFingerprint) {
|
|
2977
|
+
if (options.expectedTargetFingerprint !== target.fingerprint) {
|
|
2978
|
+
dependencies.writeStderr("Expected target fingerprint does not match the target.");
|
|
2979
|
+
exitCode = MIGRATE_EXIT_CODES.confirmation;
|
|
2980
|
+
return exitCode;
|
|
2981
|
+
}
|
|
2982
|
+
} else if (!dependencies.interactive || options.json) {
|
|
2983
|
+
dependencies.writeStderr("Noninteractive apply requires --expected-target-fingerprint with the displayed fingerprint.");
|
|
2984
|
+
exitCode = MIGRATE_EXIT_CODES.confirmation;
|
|
2985
|
+
return exitCode;
|
|
2986
|
+
} else if (!await dependencies.confirm(`Apply EmDash migrations to ${target.label}?`)) {
|
|
2987
|
+
dependencies.writeStderr("Migration cancelled.");
|
|
2988
|
+
exitCode = MIGRATE_EXIT_CODES.confirmation;
|
|
2989
|
+
return exitCode;
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2992
|
+
const rawReport = await Promise.race([executor.execute({
|
|
2993
|
+
action: applying ? "apply" : "check",
|
|
2994
|
+
i18n: manifest.i18n,
|
|
2995
|
+
artifact: {
|
|
2996
|
+
emdashVersion: manifest.emdashVersion,
|
|
2997
|
+
migrationSetFingerprint: manifest.migrationSet.fingerprint
|
|
2998
|
+
}
|
|
2999
|
+
}), interruption]);
|
|
3000
|
+
if (rawReport === interruptedResult || interrupted) {
|
|
3001
|
+
exitCode = MIGRATE_EXIT_CODES.interrupted;
|
|
3002
|
+
return exitCode;
|
|
3003
|
+
}
|
|
3004
|
+
const report = safeReport(rawReport, target);
|
|
3005
|
+
if (options.json) dependencies.writeStdout(JSON.stringify(report));
|
|
3006
|
+
else printHumanReport(report, dependencies.writeStdout);
|
|
3007
|
+
exitCode = reportExitCode(options, report);
|
|
3008
|
+
return exitCode;
|
|
3009
|
+
} catch (error) {
|
|
3010
|
+
primaryFailure = true;
|
|
3011
|
+
dependencies.writeStderr(safeCommandMessage(error, dependencies.env));
|
|
3012
|
+
exitCode = interrupted ? MIGRATE_EXIT_CODES.interrupted : MIGRATE_EXIT_CODES.error;
|
|
3013
|
+
return exitCode;
|
|
3014
|
+
}
|
|
3015
|
+
};
|
|
3016
|
+
try {
|
|
3017
|
+
exitCode = await execute();
|
|
3018
|
+
} finally {
|
|
3019
|
+
for (const remove of removeSignalHandlers) remove();
|
|
3020
|
+
if (executor) {
|
|
3021
|
+
if (await bounded(dispose(), dependencies.cleanupTimeoutMs) !== "complete" && !primaryFailure && !interrupted) {
|
|
3022
|
+
dependencies.writeStderr("Migration executor cleanup failed.");
|
|
3023
|
+
exitCode = MIGRATE_EXIT_CODES.error;
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
}
|
|
3027
|
+
return exitCode;
|
|
3028
|
+
}
|
|
3029
|
+
const migrateCommand = defineCommand({
|
|
3030
|
+
meta: {
|
|
3031
|
+
name: "migrate",
|
|
3032
|
+
description: "Check or apply deployment-managed EmDash migrations"
|
|
3033
|
+
},
|
|
3034
|
+
args: {
|
|
3035
|
+
manifest: {
|
|
3036
|
+
type: "string",
|
|
3037
|
+
description: "Migration manifest path"
|
|
3038
|
+
},
|
|
3039
|
+
"from-config": {
|
|
3040
|
+
type: "boolean",
|
|
3041
|
+
description: "Build the manifest from Astro config"
|
|
3042
|
+
},
|
|
3043
|
+
config: {
|
|
3044
|
+
type: "string",
|
|
3045
|
+
description: "Astro config path (requires --from-config)"
|
|
3046
|
+
},
|
|
3047
|
+
check: {
|
|
3048
|
+
type: "boolean",
|
|
3049
|
+
description: "Check for pending or unknown migrations"
|
|
3050
|
+
},
|
|
3051
|
+
status: {
|
|
3052
|
+
type: "boolean",
|
|
3053
|
+
description: "Report all migration status sets"
|
|
3054
|
+
},
|
|
3055
|
+
json: {
|
|
3056
|
+
type: "boolean",
|
|
3057
|
+
description: "Print the stable JSON report"
|
|
3058
|
+
},
|
|
3059
|
+
"expected-target-fingerprint": {
|
|
3060
|
+
type: "string",
|
|
3061
|
+
description: "Required target fingerprint for noninteractive apply"
|
|
3062
|
+
},
|
|
3063
|
+
database: {
|
|
3064
|
+
type: "string",
|
|
3065
|
+
description: "Override the SQLite database path"
|
|
3066
|
+
},
|
|
3067
|
+
"database-url-env": {
|
|
3068
|
+
type: "string",
|
|
3069
|
+
description: "Override the database URL environment-variable name"
|
|
3070
|
+
},
|
|
3071
|
+
d1: {
|
|
3072
|
+
type: "string",
|
|
3073
|
+
description: "Override the D1 database UUID or name"
|
|
3074
|
+
},
|
|
3075
|
+
"account-id": {
|
|
3076
|
+
type: "string",
|
|
3077
|
+
description: "Override the Cloudflare account ID"
|
|
3078
|
+
},
|
|
3079
|
+
"wrangler-config": {
|
|
3080
|
+
type: "string",
|
|
3081
|
+
description: "Override the Wrangler config path"
|
|
3082
|
+
},
|
|
3083
|
+
"wrangler-env": {
|
|
3084
|
+
type: "string",
|
|
3085
|
+
description: "Override the Wrangler environment"
|
|
3086
|
+
}
|
|
3087
|
+
},
|
|
3088
|
+
async run({ args }) {
|
|
3089
|
+
process.exitCode = await runMigrateCommand({
|
|
3090
|
+
manifest: args.manifest,
|
|
3091
|
+
fromConfig: args["from-config"],
|
|
3092
|
+
config: args.config,
|
|
3093
|
+
check: args.check,
|
|
3094
|
+
status: args.status,
|
|
3095
|
+
json: args.json,
|
|
3096
|
+
expectedTargetFingerprint: args["expected-target-fingerprint"],
|
|
3097
|
+
database: args.database,
|
|
3098
|
+
databaseUrlEnv: args["database-url-env"],
|
|
3099
|
+
d1: args.d1,
|
|
3100
|
+
accountId: args["account-id"],
|
|
3101
|
+
wranglerConfig: args["wrangler-config"],
|
|
3102
|
+
wranglerEnv: args["wrangler-env"]
|
|
3103
|
+
});
|
|
3104
|
+
}
|
|
3105
|
+
});
|
|
3106
|
+
|
|
2602
3107
|
//#endregion
|
|
2603
3108
|
//#region src/cli/commands/plugin-init.ts
|
|
2604
3109
|
/**
|
|
@@ -3141,7 +3646,7 @@ const publishCommand = defineCommand({
|
|
|
3141
3646
|
const pluginDir = resolve(args.dir);
|
|
3142
3647
|
try {
|
|
3143
3648
|
const { runCommand } = await import("citty");
|
|
3144
|
-
const { bundleCommand } = await import("../bundle-
|
|
3649
|
+
const { bundleCommand } = await import("../bundle-DZFhFurR.mjs").then((n) => n.n);
|
|
3145
3650
|
await runCommand(bundleCommand, { rawArgs: ["--dir", pluginDir] });
|
|
3146
3651
|
} catch {
|
|
3147
3652
|
consola.error("Build failed");
|
|
@@ -4125,28 +4630,6 @@ const typesCommand = defineCommand({
|
|
|
4125
4630
|
|
|
4126
4631
|
//#endregion
|
|
4127
4632
|
//#region src/cli/index.ts
|
|
4128
|
-
/**
|
|
4129
|
-
* EmDash CLI
|
|
4130
|
-
*
|
|
4131
|
-
* Built with citty + clack (same stack as Nuxt CLI)
|
|
4132
|
-
*
|
|
4133
|
-
* Commands:
|
|
4134
|
-
* - init: Bootstrap database from template config, or interactive setup
|
|
4135
|
-
* - types: Generate TypeScript types from schema
|
|
4136
|
-
* - dev: [DEPRECATED, hidden] Run dev server with a local SQLite database
|
|
4137
|
-
* - seed: Apply a seed file to the database
|
|
4138
|
-
* - export-seed: Export database schema and content as a seed file
|
|
4139
|
-
* - secrets: Generate and inspect EmDash secrets (encryption keys, etc.)
|
|
4140
|
-
* - auth: [DEPRECATED] Generate auth secret (use `secrets` instead)
|
|
4141
|
-
* - login/logout/whoami: Session management
|
|
4142
|
-
* - content: Create, read, update, delete content
|
|
4143
|
-
* - schema: Manage collections and fields
|
|
4144
|
-
* - media: Upload and manage media
|
|
4145
|
-
* - search: Full-text search
|
|
4146
|
-
* - taxonomy: Manage taxonomies and terms
|
|
4147
|
-
* - menu: Manage navigation menus
|
|
4148
|
-
* - plugin: Plugin management (init, bundle, validate, publish, login, logout)
|
|
4149
|
-
*/
|
|
4150
4633
|
runMain(defineCommand({
|
|
4151
4634
|
meta: {
|
|
4152
4635
|
name: "emdash",
|
|
@@ -4159,6 +4642,7 @@ runMain(defineCommand({
|
|
|
4159
4642
|
dev: devCommand,
|
|
4160
4643
|
doctor: doctorCommand,
|
|
4161
4644
|
seed: seedCommand,
|
|
4645
|
+
migrate: migrateCommand,
|
|
4162
4646
|
"export-seed": exportSeedCommand,
|
|
4163
4647
|
secrets: secretsCommand,
|
|
4164
4648
|
auth: authCommand,
|