emdash 0.34.0 → 0.35.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/{adapters-34EN2eXO.d.mts → adapters-Bb1vG41D.d.mts} +8 -1
- package/dist/adapters-Bb1vG41D.d.mts.map +1 -0
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +9 -9
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +1 -1
- package/dist/{api-DdAsirBe.mjs → api-BeBglVxU.mjs} +10 -10
- package/dist/{api-DdAsirBe.mjs.map → api-BeBglVxU.mjs.map} +1 -1
- package/dist/{api-tokens-CFXu8F_2.mjs → api-tokens-KO24G1Fd.mjs} +2 -2
- package/dist/{api-tokens-CFXu8F_2.mjs.map → api-tokens-KO24G1Fd.mjs.map} +1 -1
- package/dist/{apply-D5zfeD09.mjs → apply-kUDt80-G.mjs} +16 -16
- package/dist/{apply-D5zfeD09.mjs.map → apply-kUDt80-G.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 +71 -15
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +4 -4
- package/dist/astro/middleware/redirect.mjs +2 -2
- package/dist/astro/middleware/request-context.mjs +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +10 -10
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +143 -74
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -2
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +2 -2
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +2 -2
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +3 -3
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +3 -3
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +3 -3
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +7 -7
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +7 -7
- package/dist/astro/routes/api/admin/bylines/index.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/_id_.mjs +2 -2
- package/dist/astro/routes/api/admin/comments/bulk.mjs +3 -3
- package/dist/astro/routes/api/admin/comments/counts.mjs +2 -2
- package/dist/astro/routes/api/admin/comments/index.mjs +3 -3
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +7 -7
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +7 -7
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +4 -4
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +7 -7
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +7 -7
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/index.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +29 -29
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +28 -28
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +29 -29
- package/dist/astro/routes/api/admin/plugins/updates.mjs +28 -28
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +28 -28
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +28 -28
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +2 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/index.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/register-options.mjs +3 -3
- package/dist/astro/routes/api/auth/logout.mjs +1 -1
- package/dist/astro/routes/api/auth/magic-link/send.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +1 -1
- package/dist/astro/routes/api/auth/me.mjs +2 -2
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +4 -4
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/signup/complete.mjs +3 -3
- package/dist/astro/routes/api/auth/signup/request.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +5 -5
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/authors.mjs +1 -1
- package/dist/astro/routes/api/content/_collection_/index.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/trash.mjs +2 -2
- package/dist/astro/routes/api/dashboard.mjs +4 -4
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +7 -7
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +2 -2
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +11 -11
- package/dist/astro/routes/api/manifest.mjs +2 -2
- package/dist/astro/routes/api/mcp.mjs +38 -38
- package/dist/astro/routes/api/media/_id_/confirm.mjs +2 -2
- package/dist/astro/routes/api/media/_id_/upload.mjs +2 -2
- package/dist/astro/routes/api/media/_id_/usage.mjs +6 -6
- package/dist/astro/routes/api/media/_id_.mjs +5 -5
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +1 -1
- package/dist/astro/routes/api/media/providers/index.mjs +1 -1
- package/dist/astro/routes/api/media/upload-url.mjs +3 -3
- package/dist/astro/routes/api/media.mjs +5 -5
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +3 -3
- package/dist/astro/routes/api/menus/_name_/items.mjs +3 -3
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +3 -3
- package/dist/astro/routes/api/menus/_name_/translations.mjs +3 -3
- package/dist/astro/routes/api/menus/_name_.mjs +3 -3
- package/dist/astro/routes/api/menus/index.mjs +3 -3
- package/dist/astro/routes/api/oauth/authorize.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -3
- package/dist/astro/routes/api/oauth/device/code.mjs +4 -4
- package/dist/astro/routes/api/oauth/device/token.mjs +4 -4
- package/dist/astro/routes/api/oauth/register.mjs +1 -1
- package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -3
- package/dist/astro/routes/api/oauth/token.mjs +4 -4
- package/dist/astro/routes/api/openapi.json.mjs +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/summary.mjs +3 -3
- package/dist/astro/routes/api/redirects/_id_.mjs +4 -4
- package/dist/astro/routes/api/redirects/index.mjs +4 -4
- package/dist/astro/routes/api/relations/_id_/index.mjs +9 -9
- package/dist/astro/routes/api/relations/_id_/translations.mjs +8 -8
- package/dist/astro/routes/api/relations/index.mjs +9 -9
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +28 -28
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +28 -28
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +28 -28
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +28 -28
- package/dist/astro/routes/api/schema/collections/index.mjs +28 -28
- package/dist/astro/routes/api/schema/collections/reorder.mjs +28 -28
- package/dist/astro/routes/api/schema/index.mjs +6 -6
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +28 -28
- package/dist/astro/routes/api/schema/orphans/index.mjs +28 -28
- package/dist/astro/routes/api/search/enable.mjs +5 -5
- package/dist/astro/routes/api/search/index.mjs +4 -4
- package/dist/astro/routes/api/search/rebuild.mjs +5 -5
- package/dist/astro/routes/api/search/stats.mjs +4 -4
- package/dist/astro/routes/api/search/suggest.mjs +4 -4
- package/dist/astro/routes/api/sections/_slug_.mjs +4 -4
- package/dist/astro/routes/api/sections/index.mjs +4 -4
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +3 -3
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +3 -3
- package/dist/astro/routes/api/settings/backups/export.mjs +3 -3
- package/dist/astro/routes/api/settings/backups/index.mjs +3 -3
- package/dist/astro/routes/api/settings/email.mjs +1 -1
- package/dist/astro/routes/api/settings.mjs +5 -5
- package/dist/astro/routes/api/setup/admin-verify.mjs +4 -4
- package/dist/astro/routes/api/setup/admin.mjs +4 -4
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +18 -21
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +15 -21
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +2 -2
- package/dist/astro/routes/api/snapshot.mjs +4 -4
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/index.mjs +6 -6
- package/dist/astro/routes/api/themes/preview.mjs +2 -2
- package/dist/astro/routes/api/typegen.mjs +3 -3
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +4 -4
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +4 -4
- package/dist/astro/routes/api/widget-areas/_name_.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/index.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +2 -2
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +2 -2
- package/dist/astro/routes/sitemap.xml.mjs +2 -2
- package/dist/astro/types.d.mts +14 -14
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-1iFJzPaZ.mjs → authorize-DUElxgOQ.mjs} +1 -1
- package/dist/{authorize-1iFJzPaZ.mjs.map → authorize-DUElxgOQ.mjs.map} +1 -1
- package/dist/{backup-LHjIAVNP.mjs → backup-DWYpJlLj.mjs} +3 -3
- package/dist/{backup-LHjIAVNP.mjs.map → backup-DWYpJlLj.mjs.map} +1 -1
- package/dist/{bundle-CBEXrBnb.mjs → bundle-vn56sLos.mjs} +5 -5
- package/dist/{bundle-CBEXrBnb.mjs.map → bundle-vn56sLos.mjs.map} +1 -1
- package/dist/{byline-fields-C5S8wygO.mjs → byline-fields-txaLGoME.mjs} +1 -1
- package/dist/{byline-fields-C5S8wygO.mjs.map → byline-fields-txaLGoME.mjs.map} +1 -1
- package/dist/{byline-pEcoDps8.mjs → byline-yjvWq4ip.mjs} +4 -4
- package/dist/{byline-pEcoDps8.mjs.map → byline-yjvWq4ip.mjs.map} +1 -1
- package/dist/{bylines-DJfSfXCL.mjs → bylines-Bu7pchQ4.mjs} +3 -3
- package/dist/{bylines-DJfSfXCL.mjs.map → bylines-Bu7pchQ4.mjs.map} +1 -1
- package/dist/{bylines-BWemdX2k.mjs → bylines-DjXS5p0P.mjs} +5 -5
- package/dist/{bylines-BWemdX2k.mjs.map → bylines-DjXS5p0P.mjs.map} +1 -1
- package/dist/{cache-CBJaDy_E.mjs → cache-C46-3Irl.mjs} +2 -2
- package/dist/{cache-CBJaDy_E.mjs.map → cache-C46-3Irl.mjs.map} +1 -1
- package/dist/{challenge-store-CZyFVaad.mjs → challenge-store-SIL5DsF2.mjs} +1 -1
- package/dist/{challenge-store-CZyFVaad.mjs.map → challenge-store-SIL5DsF2.mjs.map} +1 -1
- package/dist/{chunks-DfPax1I0.mjs → chunks-fiZ8G9RJ.mjs} +2 -2
- package/dist/{chunks-DfPax1I0.mjs.map → chunks-fiZ8G9RJ.mjs.map} +1 -1
- package/dist/cli/index.mjs +551 -51
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.mjs +2 -2
- package/dist/{collection-deletion-C8BugSGz.mjs → collection-deletion-DQPvMD8R.mjs} +2 -2
- package/dist/{collection-deletion-C8BugSGz.mjs.map → collection-deletion-DQPvMD8R.mjs.map} +1 -1
- package/dist/{comment-reaction-D6qfHKBc.mjs → comment-reaction-D-2J84UE.mjs} +2 -2
- package/dist/{comment-reaction-D6qfHKBc.mjs.map → comment-reaction-D-2J84UE.mjs.map} +1 -1
- package/dist/{comments-CTOuhTSX.mjs → comments-CTfZtLmM.mjs} +1 -1
- package/dist/{comments-CTOuhTSX.mjs.map → comments-CTfZtLmM.mjs.map} +1 -1
- package/dist/config-COQzTe5Q.d.mts +34 -0
- package/dist/config-COQzTe5Q.d.mts.map +1 -0
- package/dist/{content-BNfwh7xX.mjs → content-ZHCc1ngN.mjs} +3 -3
- package/dist/{content-BNfwh7xX.mjs.map → content-ZHCc1ngN.mjs.map} +1 -1
- package/dist/{content-list-query-DhQ84eVV.d.mts → content-list-query-wJ2WN8Vp.d.mts} +1 -1
- package/dist/{content-list-query-DhQ84eVV.d.mts.map → content-list-query-wJ2WN8Vp.d.mts.map} +1 -1
- package/dist/{content-refresh-DNERP4-f.mjs → content-refresh-B_8SJzuU.mjs} +2 -2
- package/dist/{content-refresh-DNERP4-f.mjs.map → content-refresh-B_8SJzuU.mjs.map} +1 -1
- package/dist/{context-DRgOvSnW.mjs → context-ZldbZcle.mjs} +7 -7
- package/dist/{context-DRgOvSnW.mjs.map → context-ZldbZcle.mjs.map} +1 -1
- package/dist/{dashboard-CB8J89rJ.mjs → dashboard-DvHbk_cv.mjs} +3 -3
- package/dist/{dashboard-CB8J89rJ.mjs.map → dashboard-DvHbk_cv.mjs.map} +1 -1
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +30 -7
- 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/{deferred-tasks-BMsa9F64.d.mts → deferred-tasks-SDWxrgzJ.d.mts} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts.map → deferred-tasks-SDWxrgzJ.d.mts.map} +1 -1
- package/dist/{device-flow-CaioYGK3.mjs → device-flow-C0GdD_z8.mjs} +4 -4
- package/dist/{device-flow-CaioYGK3.mjs.map → device-flow-C0GdD_z8.mjs.map} +1 -1
- package/dist/direct-executor-CDXeJCSs.mjs +85 -0
- package/dist/direct-executor-CDXeJCSs.mjs.map +1 -0
- package/dist/{escape-C_aLKP3H.mjs → escape-DUY2r2Zs.mjs} +1 -1
- package/dist/{escape-C_aLKP3H.mjs.map → escape-DUY2r2Zs.mjs.map} +1 -1
- package/dist/{field-defs-cache-hg6QkjV9.mjs → field-defs-cache-BzwBlJrR.mjs} +2 -2
- package/dist/{field-defs-cache-hg6QkjV9.mjs.map → field-defs-cache-BzwBlJrR.mjs.map} +1 -1
- package/dist/{fts-manager-CZ-5dVwJ.mjs → fts-manager-DyZEohZC.mjs} +2 -2
- package/dist/{fts-manager-CZ-5dVwJ.mjs.map → fts-manager-DyZEohZC.mjs.map} +1 -1
- package/dist/{hreflang-DNswoYsi.mjs → hreflang-BBe83kKa.mjs} +5 -5
- package/dist/{hreflang-DNswoYsi.mjs.map → hreflang-BBe83kKa.mjs.map} +1 -1
- package/dist/{hreflang-D3Uehfv2.d.mts → hreflang-DwT2E0Sa.d.mts} +2 -2
- package/dist/{hreflang-D3Uehfv2.d.mts.map → hreflang-DwT2E0Sa.d.mts.map} +1 -1
- package/dist/identity-Ys6Dlc9C.mjs +35 -0
- package/dist/identity-Ys6Dlc9C.mjs.map +1 -0
- package/dist/{import-B41u8Rot.mjs → import-DPkLmeXO.mjs} +2 -2
- package/dist/{import-B41u8Rot.mjs.map → import-DPkLmeXO.mjs.map} +1 -1
- package/dist/{index-C3Y-rsyN.d.mts → index-BVBZj4-7.d.mts} +28 -49
- package/dist/index-BVBZj4-7.d.mts.map +1 -0
- package/dist/{index-Cof4-Fab.d.mts → index-C9KuQyO-.d.mts} +3 -3
- package/dist/{index-Cof4-Fab.d.mts.map → index-C9KuQyO-.d.mts.map} +1 -1
- package/dist/index.d.mts +21 -20
- package/dist/index.mjs +42 -42
- package/dist/{load-DmvJrtxS.mjs → load-YJ2xl3ra.mjs} +2 -2
- package/dist/{load-DmvJrtxS.mjs.map → load-YJ2xl3ra.mjs.map} +1 -1
- package/dist/{loader-DLBqRiGP.mjs → loader-CdG_Ci3H.mjs} +2 -2
- package/dist/{loader-DLBqRiGP.mjs.map → loader-CdG_Ci3H.mjs.map} +1 -1
- package/dist/manifest-builder-B252yQUf.mjs +189 -0
- package/dist/manifest-builder-B252yQUf.mjs.map +1 -0
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +2 -2
- package/dist/{media-allowlist-BD6HhgXA.mjs → media-allowlist-D6x-Us02.mjs} +1 -1
- package/dist/{media-allowlist-BD6HhgXA.mjs.map → media-allowlist-D6x-Us02.mjs.map} +1 -1
- package/dist/{media-upload-9yas9zGH.mjs → media-upload-CHBVn6m-.mjs} +2 -2
- package/dist/{media-upload-9yas9zGH.mjs.map → media-upload-CHBVn6m-.mjs.map} +1 -1
- package/dist/{media-usage-De3qvwjc.mjs → media-usage-BZCydfvu.mjs} +4 -4
- package/dist/{media-usage-De3qvwjc.mjs.map → media-usage-BZCydfvu.mjs.map} +1 -1
- package/dist/{media-usage-work-B9Bksh_b.mjs → media-usage-work-CLo_6tct.mjs} +2 -2
- package/dist/{media-usage-work-B9Bksh_b.mjs.map → media-usage-work-CLo_6tct.mjs.map} +1 -1
- package/dist/{menus-CC-yn1F9.mjs → menus-DSo5QeW0.mjs} +6 -6
- package/dist/{menus-CC-yn1F9.mjs.map → menus-DSo5QeW0.mjs.map} +1 -1
- package/dist/{menus-fxvEDYE6.mjs → menus-TCNSd2vp.mjs} +2 -2
- package/dist/{menus-fxvEDYE6.mjs.map → menus-TCNSd2vp.mjs.map} +1 -1
- 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/{mode-Bpe-tNNy.mjs → mode-BDoH_WcF.mjs} +1 -1
- package/dist/{mode-Bpe-tNNy.mjs.map → mode-BDoH_WcF.mjs.map} +1 -1
- package/dist/{oauth-authorization-BXO1MKej.mjs → oauth-authorization-iOikmrJd.mjs} +4 -4
- package/dist/{oauth-authorization-BXO1MKej.mjs.map → oauth-authorization-iOikmrJd.mjs.map} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs → oauth-clients-CvI0nHMJ.mjs} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs.map → oauth-clients-CvI0nHMJ.mjs.map} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs → oauth-state-store-Ba8KZlwW.mjs} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs.map → oauth-state-store-Ba8KZlwW.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs → oauth-user-lookup-C5SQwGYC.mjs} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs.map → oauth-user-lookup-C5SQwGYC.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-DRe1pIBL.d.mts → options--hhz-jZ1.d.mts} +3 -3
- package/dist/{options-DRe1pIBL.d.mts.map → options--hhz-jZ1.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{passkey-config-_2GOwwK8.mjs → passkey-config-DFAmUyuE.mjs} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs.map → passkey-config-DFAmUyuE.mjs.map} +1 -1
- package/dist/{placeholder-CzW7Lshs.d.mts → placeholder-Dp0K3RkD.d.mts} +1 -1
- package/dist/{placeholder-CzW7Lshs.d.mts.map → placeholder-Dp0K3RkD.d.mts.map} +1 -1
- 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/policy-TluUIxuu.mjs +45 -0
- package/dist/policy-TluUIxuu.mjs.map +1 -0
- package/dist/{portable-text-DhKbDAGr.mjs → portable-text-imBW5cHK.mjs} +1 -1
- package/dist/{portable-text-DhKbDAGr.mjs.map → portable-text-imBW5cHK.mjs.map} +1 -1
- package/dist/protocol-DjsJHTlK.d.mts +52 -0
- package/dist/protocol-DjsJHTlK.d.mts.map +1 -0
- package/dist/{query-vgZNwIhh.mjs → query-BWs7O5Il.mjs} +3 -3
- package/dist/{query-vgZNwIhh.mjs.map → query-BWs7O5Il.mjs.map} +1 -1
- package/dist/{query-BgjfiLUQ.mjs → query-zTVAR1Sl.mjs} +12 -12
- package/dist/{query-BgjfiLUQ.mjs.map → query-zTVAR1Sl.mjs.map} +1 -1
- package/dist/{rate-limit-L5anykgo.mjs → rate-limit-Bx4g9m3p.mjs} +1 -1
- package/dist/{rate-limit-L5anykgo.mjs.map → rate-limit-Bx4g9m3p.mjs.map} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs → redirect-BgAOGHDq.mjs} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs.map → redirect-BgAOGHDq.mjs.map} +1 -1
- package/dist/{redirects-cV9g7V-0.mjs → redirects-DTDHWH31.mjs} +2 -2
- package/dist/{redirects-cV9g7V-0.mjs.map → redirects-DTDHWH31.mjs.map} +1 -1
- package/dist/{redirects-CufRQt0Q.mjs → redirects-DyChwDkG.mjs} +1 -1
- package/dist/{redirects-CufRQt0Q.mjs.map → redirects-DyChwDkG.mjs.map} +1 -1
- package/dist/{registry-C581V4TP.mjs → registry-Cqa2I749.mjs} +6 -6
- package/dist/{registry-C581V4TP.mjs.map → registry-Cqa2I749.mjs.map} +1 -1
- package/dist/{relation-DtmAQH7s.mjs → relation-BnHB0T4J.mjs} +2 -2
- package/dist/{relation-DtmAQH7s.mjs.map → relation-BnHB0T4J.mjs.map} +1 -1
- package/dist/{relations-DItI3MN9.d.mts → relations-BHo5A8Zf.d.mts} +35 -35
- package/dist/{relations-DItI3MN9.d.mts.map → relations-BHo5A8Zf.d.mts.map} +1 -1
- package/dist/{relations-DICSyfsh.mjs → relations-D5sM5fW0.mjs} +4 -4
- package/dist/{relations-DICSyfsh.mjs.map → relations-D5sM5fW0.mjs.map} +1 -1
- package/dist/request-context.d.mts +1 -1
- package/dist/{runner-CgQbELYC.d.mts → runner-BYHZn3Jy.d.mts} +16 -3
- package/dist/runner-BYHZn3Jy.d.mts.map +1 -0
- package/dist/{runner-BiDvq5dv.mjs → runner-C1T11CfC.mjs} +34 -4
- package/dist/{runner-BiDvq5dv.mjs.map → runner-C1T11CfC.mjs.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-CeQSNwB3.mjs → schema-2AOsSn2v.mjs} +4 -4
- package/dist/{schema-CeQSNwB3.mjs.map → schema-2AOsSn2v.mjs.map} +1 -1
- package/dist/{schema-BFyTg38T.mjs → schema-DZ5YVVZj.mjs} +3 -3
- package/dist/{schema-BFyTg38T.mjs.map → schema-DZ5YVVZj.mjs.map} +1 -1
- package/dist/{scopes-BVeuhGBE.mjs → scopes-8ClPF2bC.mjs} +2 -2
- package/dist/{scopes-BVeuhGBE.mjs.map → scopes-8ClPF2bC.mjs.map} +1 -1
- package/dist/{search-BpuPKZb0.mjs → search-u1QYdOCG.mjs} +4 -4
- package/dist/{search-BpuPKZb0.mjs.map → search-u1QYdOCG.mjs.map} +1 -1
- package/dist/{secrets-dtYs2hDo.mjs → secrets-BEgsAQEU.mjs} +1 -1
- package/dist/{secrets-dtYs2hDo.mjs.map → secrets-BEgsAQEU.mjs.map} +1 -1
- package/dist/{sections-COctk6hf.mjs → sections-DmHviGyM.mjs} +2 -2
- package/dist/{sections-COctk6hf.mjs.map → sections-DmHviGyM.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +13 -13
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +9 -9
- package/dist/{seo-CvDxfvFb.mjs → seo-Dq4G-RrO.mjs} +2 -2
- package/dist/{seo-CvDxfvFb.mjs.map → seo-Dq4G-RrO.mjs.map} +1 -1
- package/dist/{service-xMiMSTsR.mjs → service-BpArayPr.mjs} +2 -2
- package/dist/{service-xMiMSTsR.mjs.map → service-BpArayPr.mjs.map} +1 -1
- package/dist/{session-user-BzVemLkw.mjs → session-user-BEorKVT-.mjs} +1 -1
- package/dist/{session-user-BzVemLkw.mjs.map → session-user-BEorKVT-.mjs.map} +1 -1
- package/dist/{settings-BE9aqn_9.mjs → settings-DE9xtzqd.mjs} +3 -3
- package/dist/{settings-BE9aqn_9.mjs.map → settings-DE9xtzqd.mjs.map} +1 -1
- package/dist/{settings-B372MV0p.mjs → settings-xRdoUZr0.mjs} +2 -2
- package/dist/{settings-B372MV0p.mjs.map → settings-xRdoUZr0.mjs.map} +1 -1
- package/dist/{setup-complete-DF7TAfD5.mjs → setup-complete-BnT8pq_C.mjs} +1 -1
- package/dist/{setup-complete-DF7TAfD5.mjs.map → setup-complete-BnT8pq_C.mjs.map} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs → setup-nonce-CBitf_oQ.mjs} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs.map → setup-nonce-CBitf_oQ.mjs.map} +1 -1
- package/dist/{site-url-Bowsi9T-.mjs → site-url-DjpIXMXJ.mjs} +1 -1
- package/dist/{site-url-Bowsi9T-.mjs.map → site-url-DjpIXMXJ.mjs.map} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs → snapshot-BBlGkb2q.mjs} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs.map → snapshot-BBlGkb2q.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +2 -2
- package/dist/storage/s3.d.mts +1 -1
- package/dist/target-DixqqV5i.mjs +27 -0
- package/dist/target-DixqqV5i.mjs.map +1 -0
- package/dist/{taxonomies-B0o9ExNV.mjs → taxonomies-BlrncHi9.mjs} +5 -5
- package/dist/{taxonomies-B0o9ExNV.mjs.map → taxonomies-BlrncHi9.mjs.map} +1 -1
- package/dist/{taxonomies-Dk3MAklL.mjs → taxonomies-OHUIiIpI.mjs} +4 -4
- package/dist/{taxonomies-Dk3MAklL.mjs.map → taxonomies-OHUIiIpI.mjs.map} +1 -1
- package/dist/{taxonomy-CPeM8d2o.mjs → taxonomy-BqCZ1TdU.mjs} +3 -3
- package/dist/{taxonomy-CPeM8d2o.mjs.map → taxonomy-BqCZ1TdU.mjs.map} +1 -1
- package/dist/{transport--CfOflrp.mjs → transport-DBJwa-Si.mjs} +1 -1
- package/dist/{transport--CfOflrp.mjs.map → transport-DBJwa-Si.mjs.map} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts → transport-RQE36APG.d.mts} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts.map → transport-RQE36APG.d.mts.map} +1 -1
- package/dist/{types-CFUfyt1s.d.mts → types-BcqdcT-r.d.mts} +1 -1
- package/dist/{types-CFUfyt1s.d.mts.map → types-BcqdcT-r.d.mts.map} +1 -1
- package/dist/{types-CPx2lIGo.d.mts → types-BntycPTF.d.mts} +1 -1
- package/dist/{types-CPx2lIGo.d.mts.map → types-BntycPTF.d.mts.map} +1 -1
- package/dist/{types-C3_AbkDP.d.mts → types-C2pMvO62.d.mts} +1 -1
- package/dist/{types-C3_AbkDP.d.mts.map → types-C2pMvO62.d.mts.map} +1 -1
- package/dist/{types-DefV3OiO.d.mts → types-CXnOzDe1.d.mts} +1 -1
- package/dist/{types-DefV3OiO.d.mts.map → types-CXnOzDe1.d.mts.map} +1 -1
- package/dist/{types-D4_1Ga4L.d.mts → types-DN64_zzZ.d.mts} +3 -3
- package/dist/{types-D4_1Ga4L.d.mts.map → types-DN64_zzZ.d.mts.map} +1 -1
- package/dist/{types-CAGdePf3.d.mts → types-DQIDRKF2.d.mts} +1 -1
- package/dist/{types-CAGdePf3.d.mts.map → types-DQIDRKF2.d.mts.map} +1 -1
- package/dist/{types-BPuloofb.d.mts → types-DWRhk9xZ.d.mts} +1 -1
- package/dist/{types-BPuloofb.d.mts.map → types-DWRhk9xZ.d.mts.map} +1 -1
- package/dist/{types-X0MThr7x.d.mts → types-Dfk8KI5R.d.mts} +1 -1
- package/dist/{types-X0MThr7x.d.mts.map → types-Dfk8KI5R.d.mts.map} +1 -1
- package/dist/{types-Cs-TFLNf.d.mts → types-DrJrVCT1.d.mts} +3 -3
- package/dist/{types-Cs-TFLNf.d.mts.map → types-DrJrVCT1.d.mts.map} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs → upload-attempts-D4FS8LT6.mjs} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs.map → upload-attempts-D4FS8LT6.mjs.map} +1 -1
- package/dist/{user-sHgJ62SP.mjs → user-DJZfUJVE.mjs} +2 -2
- package/dist/{user-sHgJ62SP.mjs.map → user-DJZfUJVE.mjs.map} +1 -1
- package/dist/{validate-BkqIG_Uj.mjs → validate-BMLBvxOC.mjs} +2 -2
- package/dist/{validate-BkqIG_Uj.mjs.map → validate-BMLBvxOC.mjs.map} +1 -1
- package/dist/{validate-DeGtBN84.d.mts → validate-CTqt5nuE.d.mts} +5 -5
- package/dist/{validate-DeGtBN84.d.mts.map → validate-CTqt5nuE.d.mts.map} +1 -1
- package/dist/{validation-CiJb_X5o.mjs → validation-npvENUCB.mjs} +7 -7
- package/dist/{validation-CiJb_X5o.mjs.map → validation-npvENUCB.mjs.map} +1 -1
- package/dist/version-DB_fqCSI.mjs +7 -0
- package/dist/{version-x0NjTScG.mjs.map → version-DB_fqCSI.mjs.map} +1 -1
- package/dist/{widgets-Cwzvww0W.mjs → widgets-BD3ho7Rq.mjs} +2 -2
- package/dist/{widgets-Cwzvww0W.mjs.map → widgets-BD3ho7Rq.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs → wxr-taxonomies-B1R3vBoD.mjs} +3 -3
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs.map → wxr-taxonomies-B1R3vBoD.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts → wxr-taxonomies-Ca68766D.d.mts} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts.map → wxr-taxonomies-Ca68766D.d.mts.map} +1 -1
- package/dist/{zod-generator-D11MhxG4.mjs → zod-generator-LC-on_Vb.mjs} +2 -2
- package/dist/{zod-generator-D11MhxG4.mjs.map → zod-generator-LC-on_Vb.mjs.map} +1 -1
- package/package.json +21 -5
- package/src/astro/integration/index.ts +46 -14
- package/src/astro/integration/runtime.ts +3 -0
- package/src/astro/middleware/scoped-db.ts +21 -0
- package/src/astro/middleware.ts +67 -10
- package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
- package/src/astro/routes/api/setup/dev-bypass.ts +2 -7
- package/src/astro/routes/api/setup/index.ts +5 -13
- package/src/cli/commands/migrate.ts +593 -0
- package/src/cli/index.ts +2 -23
- package/src/database/index.ts +8 -2
- package/src/database/migrations/policy.ts +70 -0
- package/src/database/migrations/runner.ts +49 -3
- package/src/db/adapters.ts +50 -2
- package/src/db/index.ts +3 -1
- package/src/db/libsql-migrations.ts +72 -0
- package/src/db/postgres-migrations.ts +59 -0
- package/src/db/sqlite-migrations.ts +37 -0
- package/src/emdash-runtime.ts +44 -15
- package/src/i18n/normalize.ts +31 -0
- package/src/index.ts +7 -1
- 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/virtual-modules.d.ts +8 -0
- package/dist/adapters-34EN2eXO.d.mts.map +0 -1
- package/dist/index-C3Y-rsyN.d.mts.map +0 -1
- package/dist/runner-CgQbELYC.d.mts.map +0 -1
- package/dist/version-x0NjTScG.mjs +0 -7
- /package/dist/{api-tokens-CyTsLszZ.mjs → api-tokens-rIXC6LdE.mjs} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../../options-
|
|
2
|
-
import "../../types-
|
|
3
|
-
import "../../types-
|
|
4
|
-
import "../../relations-
|
|
5
|
-
import "../../index-
|
|
6
|
-
import "../../runner-
|
|
7
|
-
import "../../index-
|
|
8
|
-
import "../../types-
|
|
9
|
-
import "../../hreflang-
|
|
10
|
-
import "../../validate-
|
|
1
|
+
import "../../options--hhz-jZ1.mjs";
|
|
2
|
+
import "../../types-DQIDRKF2.mjs";
|
|
3
|
+
import "../../types-DrJrVCT1.mjs";
|
|
4
|
+
import "../../relations-BHo5A8Zf.mjs";
|
|
5
|
+
import "../../index-BVBZj4-7.mjs";
|
|
6
|
+
import "../../runner-BYHZn3Jy.mjs";
|
|
7
|
+
import "../../index-C9KuQyO-.mjs";
|
|
8
|
+
import "../../types-CXnOzDe1.mjs";
|
|
9
|
+
import "../../hreflang-DwT2E0Sa.mjs";
|
|
10
|
+
import "../../validate-CTqt5nuE.mjs";
|
|
11
11
|
import { EmDashHandlers } from "../types.mjs";
|
|
12
12
|
import { User } from "@emdash-cms/auth";
|
|
13
13
|
import * as astro from "astro";
|
|
@@ -3,10 +3,10 @@ import "../../base64-CvLhUKQv.mjs";
|
|
|
3
3
|
import "../../types-CQPWhPxE.mjs";
|
|
4
4
|
import { t as apiError } from "../../error-DupyJZE2.mjs";
|
|
5
5
|
import { r as getPublicOrigin } from "../../public-url-CWoFhQT8.mjs";
|
|
6
|
-
import { t as getAuthMode } from "../../mode-
|
|
7
|
-
import { t as resolveSessionUser } from "../../session-user-
|
|
8
|
-
import { i as hasScope } from "../../api-tokens-
|
|
9
|
-
import { a as resolveApiToken, o as resolveOAuthToken } from "../../api-tokens-
|
|
6
|
+
import { t as getAuthMode } from "../../mode-BDoH_WcF.mjs";
|
|
7
|
+
import { t as resolveSessionUser } from "../../session-user-BEorKVT-.mjs";
|
|
8
|
+
import { i as hasScope } from "../../api-tokens-rIXC6LdE.mjs";
|
|
9
|
+
import { a as resolveApiToken, o as resolveOAuthToken } from "../../api-tokens-KO24G1Fd.mjs";
|
|
10
10
|
import { ulid } from "ulidx";
|
|
11
11
|
import { defineMiddleware } from "astro:middleware";
|
|
12
12
|
import virtualConfig from "virtual:emdash/config";
|
|
@@ -4,8 +4,8 @@ import "../../after-CBU2vkoO.mjs";
|
|
|
4
4
|
import "../../base64-CvLhUKQv.mjs";
|
|
5
5
|
import "../../types-CQPWhPxE.mjs";
|
|
6
6
|
import { t as RedirectRepository } from "../../redirect-COsS6SWJ.mjs";
|
|
7
|
-
import { i as matchCachedPatterns, r as loadCachedRedirects } from "../../cache-
|
|
8
|
-
import { s as getDb } from "../../loader-
|
|
7
|
+
import { i as matchCachedPatterns, r as loadCachedRedirects } from "../../cache-C46-3Irl.mjs";
|
|
8
|
+
import { s as getDb } from "../../loader-CdG_Ci3H.mjs";
|
|
9
9
|
import { n as isTerminalStatus } from "../../status-CWVYpbD8.mjs";
|
|
10
10
|
import { defineMiddleware } from "astro:middleware";
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@ import { getRequestContext, runWithContext } from "../../request-context.mjs";
|
|
|
3
3
|
import "../../base64-CvLhUKQv.mjs";
|
|
4
4
|
import "../../options-CBXIHUoT.mjs";
|
|
5
5
|
import { n as parseContentId, r as verifyPreviewToken } from "../../tokens-C39klX8R.mjs";
|
|
6
|
-
import { i as resolveSecretsCached } from "../../secrets-
|
|
6
|
+
import { i as resolveSecretsCached } from "../../secrets-BEgsAQEU.mjs";
|
|
7
7
|
import { defineMiddleware } from "astro:middleware";
|
|
8
8
|
import virtualConfig from "virtual:emdash/config";
|
|
9
9
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../options-
|
|
2
|
-
import "../types-
|
|
3
|
-
import "../types-
|
|
4
|
-
import "../relations-
|
|
5
|
-
import {
|
|
6
|
-
import "../runner-
|
|
7
|
-
import "../index-
|
|
8
|
-
import "../types-
|
|
9
|
-
import "../hreflang-
|
|
10
|
-
import "../validate-
|
|
1
|
+
import "../options--hhz-jZ1.mjs";
|
|
2
|
+
import "../types-DQIDRKF2.mjs";
|
|
3
|
+
import "../types-DrJrVCT1.mjs";
|
|
4
|
+
import "../relations-BHo5A8Zf.mjs";
|
|
5
|
+
import { Kn as EmDashRuntime, Yn as PublishedRef, qn as MediaUsageMaintenanceResult } from "../index-BVBZj4-7.mjs";
|
|
6
|
+
import "../runner-BYHZn3Jy.mjs";
|
|
7
|
+
import "../index-C9KuQyO-.mjs";
|
|
8
|
+
import "../types-CXnOzDe1.mjs";
|
|
9
|
+
import "../hreflang-DwT2E0Sa.mjs";
|
|
10
|
+
import "../validate-CTqt5nuE.mjs";
|
|
11
11
|
import * as astro from "astro";
|
|
12
12
|
|
|
13
13
|
//#region src/astro/middleware.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.mts","names":[],"sources":["../../src/astro/middleware.ts"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"middleware.d.mts","names":[],"sources":["../../src/astro/middleware.ts"],"mappings":";;;;;;;;;;;;;;;;;AAsSA;;;;;;;;;;iBAAsB,iBAAA,CACrB,OAAA;EAAW,WAAA,IAAe,IAAA,EAAM,YAAA,OAAmB,OAAA;AAAA,IACjD,OAAA;EAAU,SAAA,EAAW,YAAA;AAAA;AAAA,iBAMF,2BAAA,CAAA,GAA+B,OAAA,CAAQ,2BAAA;;;;AAA7D;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;AA8QA;;;;;iBA9QsB,iBAAA,GAAA,CACrB,GAAA,GAAM,OAAA,EAAS,aAAA,KAAkB,CAAA,GAAI,OAAA,CAAQ,CAAA,IAC3C,OAAA,CAAQ,CAAA;AAAA,cA4QE,SAAA,EAgdX,KAAA,CAhdoB,iBAAA"}
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as MIGRATION_RACE_WAIT_MS, t as ConcurrentMigrationTimeoutError } from "../runner-C1T11CfC.mjs";
|
|
2
2
|
import { t as validateIdentifier } from "../validate-BpwoDOgt.mjs";
|
|
3
3
|
import { c as isSqlite, p as tableExists, s as isPostgres, u as listTablesLike } from "../dialect-helpers-BSbfaO3F.mjs";
|
|
4
4
|
import { r as getI18nConfig, s as setI18nConfig } from "../config-C3EBstHi.mjs";
|
|
5
|
-
import { C as createHookPipeline, M as AuditRepository, T as definePlugin, _ as PluginRouteRegistry, b as toRouteCallerInfo, c as getSandboxRouteErrorDetails, t as getMenu, v as buildRouteMeta, w as resolveExclusiveHooks, x as EmailPipeline, y as parseRouteInput } from "../menus-
|
|
5
|
+
import { C as createHookPipeline, M as AuditRepository, T as definePlugin, _ as PluginRouteRegistry, b as toRouteCallerInfo, c as getSandboxRouteErrorDetails, t as getMenu, v as buildRouteMeta, w as resolveExclusiveHooks, x as EmailPipeline, y as parseRouteInput } from "../menus-DSo5QeW0.mjs";
|
|
6
6
|
import { n as createDeferredTaskTracker, t as after } from "../after-CBU2vkoO.mjs";
|
|
7
7
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
8
8
|
import { o as getLastContentWriteAt } from "../object-cache-71tPfV4A.mjs";
|
|
9
9
|
import { i as MAX_COLLECTION_LIST_COLUMNS } from "../types-75KIqzL9.mjs";
|
|
10
|
-
import { i as RevisionRepository, t as ContentRepository } from "../content-
|
|
10
|
+
import { i as RevisionRepository, t as ContentRepository } from "../content-ZHCc1ngN.mjs";
|
|
11
11
|
import { n as isMissingTableError } from "../db-errors-Cl-sKYTm.mjs";
|
|
12
12
|
import "../slugify-B994zkXC.mjs";
|
|
13
13
|
import "../base64-CvLhUKQv.mjs";
|
|
14
14
|
import { n as ContentMutationConflictError } from "../types-CQPWhPxE.mjs";
|
|
15
15
|
import { t as MediaRepository } from "../media-CzhAn2--.mjs";
|
|
16
|
-
import "../user-
|
|
16
|
+
import "../user-DJZfUJVE.mjs";
|
|
17
17
|
import { t as withTransaction } from "../transaction-NQj4VJ7Z.mjs";
|
|
18
|
-
import "../taxonomy-
|
|
18
|
+
import "../taxonomy-BqCZ1TdU.mjs";
|
|
19
19
|
import "../comment-Dxlep6cE.mjs";
|
|
20
20
|
import { t as OptionsRepository } from "../options-CBXIHUoT.mjs";
|
|
21
|
-
import { r as createSiteInfo } from "../context-
|
|
22
|
-
import "../menus-
|
|
21
|
+
import { r as createSiteInfo } from "../context-ZldbZcle.mjs";
|
|
22
|
+
import "../menus-TCNSd2vp.mjs";
|
|
23
23
|
import "../redirect-COsS6SWJ.mjs";
|
|
24
24
|
import { i as setRequestCacheEntry, r as requestCached } from "../request-cache-BSUptuJR.mjs";
|
|
25
25
|
import "../byline-registry-DDun8sxh.mjs";
|
|
26
26
|
import { n as initWithLock, t as createInitLock } from "../init-lock-6b309ZrF.mjs";
|
|
27
|
-
import "../field-defs-cache-
|
|
28
|
-
import "../byline-
|
|
29
|
-
import "../relation-
|
|
27
|
+
import "../field-defs-cache-BzwBlJrR.mjs";
|
|
28
|
+
import "../byline-yjvWq4ip.mjs";
|
|
29
|
+
import "../relation-BnHB0T4J.mjs";
|
|
30
30
|
import { n as normalizeMediaValue } from "../normalize-Bc-s_r-a.mjs";
|
|
31
31
|
import "../dist-D_6CKR8z.mjs";
|
|
32
32
|
import "../enrich-_ySMEvEE.mjs";
|
|
33
|
-
import "../seo-
|
|
33
|
+
import "../seo-Dq4G-RrO.mjs";
|
|
34
34
|
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-B0eLKS6K.mjs";
|
|
35
|
-
import "../cache-
|
|
36
|
-
import { t as FTSManager } from "../fts-manager-
|
|
35
|
+
import "../cache-C46-3Irl.mjs";
|
|
36
|
+
import { t as FTSManager } from "../fts-manager-DyZEohZC.mjs";
|
|
37
37
|
import "../resolve-DOhVEvty.mjs";
|
|
38
38
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
39
|
-
import { s as getDb } from "../loader-
|
|
40
|
-
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-
|
|
41
|
-
import { $ as handleContentUnschedule, A as handleMediaUpdate, B as handleContentDelete, D as handleMediaDelete, E as handleMediaCreate, F as handleContentAuthors, G as handleContentList, H as handleContentDuplicate, I as handleContentCompare, J as handleContentPublish, K as handleContentListTrashed, L as handleContentCountScheduled, M as handleRevisionList, N as handleRevisionRestore, O as handleMediaGet, Q as handleContentUnpublish, R as handleContentCountTrashed, U as handleContentGet, V as handleContentDiscardDraft, W as handleContentGetIncludingTrashed, X as handleContentSchedule, Y as handleContentRestore, Z as handleContentTranslations, _ as loadBundleFromR2, et as handleContentUpdate, j as handleRevisionGet, k as handleMediaList, q as handleContentPermanentDelete, s as normalizeRegistryConfig, tt as validateRev, v as syncDeclaredStorageIndexes, z as handleContentCreate } from "../api-
|
|
42
|
-
import { n as recordSchedulerHeartbeatSafely } from "../dashboard-
|
|
39
|
+
import { s as getDb } from "../loader-CdG_Ci3H.mjs";
|
|
40
|
+
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-BlrncHi9.mjs";
|
|
41
|
+
import { $ as handleContentUnschedule, A as handleMediaUpdate, B as handleContentDelete, D as handleMediaDelete, E as handleMediaCreate, F as handleContentAuthors, G as handleContentList, H as handleContentDuplicate, I as handleContentCompare, J as handleContentPublish, K as handleContentListTrashed, L as handleContentCountScheduled, M as handleRevisionList, N as handleRevisionRestore, O as handleMediaGet, Q as handleContentUnpublish, R as handleContentCountTrashed, U as handleContentGet, V as handleContentDiscardDraft, W as handleContentGetIncludingTrashed, X as handleContentSchedule, Y as handleContentRestore, Z as handleContentTranslations, _ as loadBundleFromR2, et as handleContentUpdate, j as handleRevisionGet, k as handleMediaList, q as handleContentPermanentDelete, s as normalizeRegistryConfig, tt as validateRev, v as syncDeclaredStorageIndexes, z as handleContentCreate } from "../api-BeBglVxU.mjs";
|
|
42
|
+
import { n as recordSchedulerHeartbeatSafely } from "../dashboard-DvHbk_cv.mjs";
|
|
43
43
|
import { r as hashString } from "../hash-Cg0TXJPV.mjs";
|
|
44
|
-
import { _ as loadContentMediaUsageFields, a as findNonTranslatableSiblingContentIds, g as buildContentMediaUsageFieldFingerprint, l as refreshContentMediaUsageAfterWrite, r as deleteContentMediaUsage, s as markContentMediaUsageCollectionStale, u as refreshContentMediaUsageForWork, v as CONTENT_SOURCE_SCHEMA_VERSION, y as MediaUsageRepository } from "../content-refresh-
|
|
44
|
+
import { _ as loadContentMediaUsageFields, a as findNonTranslatableSiblingContentIds, g as buildContentMediaUsageFieldFingerprint, l as refreshContentMediaUsageAfterWrite, r as deleteContentMediaUsage, s as markContentMediaUsageCollectionStale, u as refreshContentMediaUsageForWork, v as CONTENT_SOURCE_SCHEMA_VERSION, y as MediaUsageRepository } from "../content-refresh-B_8SJzuU.mjs";
|
|
45
45
|
import { t as MediaUsageWorkRepository } from "../media-usage-work-DrCbqBcl.mjs";
|
|
46
|
-
import "../media-usage-
|
|
47
|
-
import { n as collectionDeletionCurrentTimestamp, r as deleteActivatedMediaUsageCollection, t as MediaUsageCollectionDeletionRepository } from "../collection-deletion-
|
|
48
|
-
import "../media-usage-work-
|
|
49
|
-
import { n as SchemaRegistry } from "../registry-
|
|
50
|
-
import "../query-
|
|
51
|
-
import "../zod-generator-
|
|
52
|
-
import "../schema-
|
|
53
|
-
import "../schema-
|
|
46
|
+
import "../media-usage-BZCydfvu.mjs";
|
|
47
|
+
import { n as collectionDeletionCurrentTimestamp, r as deleteActivatedMediaUsageCollection, t as MediaUsageCollectionDeletionRepository } from "../collection-deletion-DQPvMD8R.mjs";
|
|
48
|
+
import "../media-usage-work-CLo_6tct.mjs";
|
|
49
|
+
import { n as SchemaRegistry } from "../registry-Cqa2I749.mjs";
|
|
50
|
+
import "../query-BWs7O5Il.mjs";
|
|
51
|
+
import "../zod-generator-LC-on_Vb.mjs";
|
|
52
|
+
import "../schema-DZ5YVVZj.mjs";
|
|
53
|
+
import "../schema-2AOsSn2v.mjs";
|
|
54
54
|
import "../seo-AFpVvTqr.mjs";
|
|
55
55
|
import { t as PluginStateRepository } from "../state-DYwPue40.mjs";
|
|
56
|
-
import "../sections-
|
|
57
|
-
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-
|
|
58
|
-
import "../settings-
|
|
59
|
-
import "../taxonomies-
|
|
56
|
+
import "../sections-DmHviGyM.mjs";
|
|
57
|
+
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-xRdoUZr0.mjs";
|
|
58
|
+
import "../settings-DE9xtzqd.mjs";
|
|
59
|
+
import "../taxonomies-OHUIiIpI.mjs";
|
|
60
60
|
import { r as normalizeManifestRoute } from "../manifest-schema-BXbUAHod.mjs";
|
|
61
61
|
import "../types-CP1CflWf.mjs";
|
|
62
62
|
import "../ssrf-Cpvg_n3A.mjs";
|
|
63
63
|
import "../error-DupyJZE2.mjs";
|
|
64
64
|
import "../parse-DFbuc-Fh.mjs";
|
|
65
65
|
import "../media-BWWWb8kg.mjs";
|
|
66
|
-
import "../redirects-
|
|
66
|
+
import "../redirects-DTDHWH31.mjs";
|
|
67
67
|
import "../relations-BBApI4e2.mjs";
|
|
68
68
|
import "../status-CWVYpbD8.mjs";
|
|
69
|
-
import { a as invalidateUrlPatternCache } from "../query-
|
|
70
|
-
import "../import-
|
|
69
|
+
import { a as invalidateUrlPatternCache } from "../query-zTVAR1Sl.mjs";
|
|
70
|
+
import "../import-DPkLmeXO.mjs";
|
|
71
71
|
import { t as getTrustedProxyHeaders } from "../trusted-proxy-CEVekpby.mjs";
|
|
72
72
|
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-DgZJh3zG.mjs";
|
|
73
73
|
import "../ssrf-DpXgKsna.mjs";
|
|
@@ -77,24 +77,25 @@ import { n as assertMediaUsageActivationWriteAllowed } from "../media-usage-writ
|
|
|
77
77
|
import "../utils-D4vD_Y98.mjs";
|
|
78
78
|
import "../tokens-C39klX8R.mjs";
|
|
79
79
|
import "../preview-PW-nOnq4.mjs";
|
|
80
|
-
import "../hreflang-
|
|
81
|
-
import "../comment-reaction-
|
|
82
|
-
import "../bylines-
|
|
83
|
-
import { n as getWidgetAreas } from "../widgets-
|
|
84
|
-
import "../validate-
|
|
85
|
-
import "../apply-
|
|
86
|
-
import "../load-
|
|
87
|
-
import "../search-
|
|
80
|
+
import "../hreflang-BBe83kKa.mjs";
|
|
81
|
+
import "../comment-reaction-D-2J84UE.mjs";
|
|
82
|
+
import "../bylines-DjXS5p0P.mjs";
|
|
83
|
+
import { n as getWidgetAreas } from "../widgets-BD3ho7Rq.mjs";
|
|
84
|
+
import "../validate-BMLBvxOC.mjs";
|
|
85
|
+
import "../apply-kUDt80-G.mjs";
|
|
86
|
+
import "../load-YJ2xl3ra.mjs";
|
|
87
|
+
import "../search-u1QYdOCG.mjs";
|
|
88
88
|
import "../index.mjs";
|
|
89
|
-
import { n as
|
|
90
|
-
import { t as
|
|
91
|
-
import "../
|
|
92
|
-
import
|
|
93
|
-
import {
|
|
94
|
-
import { t as
|
|
95
|
-
import {
|
|
89
|
+
import { i as resolveRuntimeMigrationMode, n as enforceRuntimeMigrationPolicy, t as PendingMigrationsError } from "../policy-TluUIxuu.mjs";
|
|
90
|
+
import { n as VERSION, t as COMMIT } from "../version-DB_fqCSI.mjs";
|
|
91
|
+
import { t as getAuthMode } from "../mode-BDoH_WcF.mjs";
|
|
92
|
+
import "../snapshot-BBlGkb2q.mjs";
|
|
93
|
+
import { u as maybeRunScheduledBackup } from "../backup-DWYpJlLj.mjs";
|
|
94
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-SIL5DsF2.mjs";
|
|
95
|
+
import { t as removeUploadAttempt } from "../upload-attempts-D4FS8LT6.mjs";
|
|
96
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-BEgsAQEU.mjs";
|
|
96
97
|
import { isRecord } from "../plugin-utils.mjs";
|
|
97
|
-
import { t as resolveSessionUser } from "../session-user-
|
|
98
|
+
import { t as resolveSessionUser } from "../session-user-BEorKVT-.mjs";
|
|
98
99
|
import { Kysely, sql } from "kysely";
|
|
99
100
|
import { ulid } from "ulidx";
|
|
100
101
|
import { z } from "zod";
|
|
@@ -2417,7 +2418,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2417
2418
|
});
|
|
2418
2419
|
}
|
|
2419
2420
|
};
|
|
2420
|
-
const db = await phase("rt.db", "DB init +
|
|
2421
|
+
const db = await phase("rt.db", "DB init + migration policy", () => EmDashRuntime.getDatabase(deps));
|
|
2421
2422
|
const resolveDb = () => {
|
|
2422
2423
|
return getRequestContext()?.db ?? db;
|
|
2423
2424
|
};
|
|
@@ -2436,6 +2437,14 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2436
2437
|
const ownsConfiguredDb = !!deps.config.database && !(reqCtx?.dbIsIsolated && reqCtx.db);
|
|
2437
2438
|
let readDb = db;
|
|
2438
2439
|
let readDbDisposable;
|
|
2440
|
+
const disposeReadDb = async () => {
|
|
2441
|
+
const disposable = readDbDisposable;
|
|
2442
|
+
readDbDisposable = void 0;
|
|
2443
|
+
if (!disposable) return;
|
|
2444
|
+
try {
|
|
2445
|
+
await disposable.destroy();
|
|
2446
|
+
} catch {}
|
|
2447
|
+
};
|
|
2439
2448
|
if (ownsConfiguredDb && deps.createCoalescingDialect && deps.config.database) try {
|
|
2440
2449
|
const dialect = deps.createCoalescingDialect(deps.config.database.config);
|
|
2441
2450
|
if (dialect) {
|
|
@@ -2449,6 +2458,10 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2449
2458
|
readDb = db;
|
|
2450
2459
|
}
|
|
2451
2460
|
const optionsRepo = new OptionsRepository(readDb);
|
|
2461
|
+
let missingManualSchemaError;
|
|
2462
|
+
const captureMissingManualSchema = (error) => {
|
|
2463
|
+
if ((deps.migrationMode ?? "auto") === "manual" && isMissingTableError(error)) missingManualSchemaError ??= error;
|
|
2464
|
+
};
|
|
2452
2465
|
const readSiteInfo = async () => {
|
|
2453
2466
|
const siteOpts = await optionsRepo.getMany([
|
|
2454
2467
|
"emdash:site_title",
|
|
@@ -2468,11 +2481,15 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2468
2481
|
try {
|
|
2469
2482
|
const states = await readDb.selectFrom("_plugin_state").select(["plugin_id", "status"]).execute();
|
|
2470
2483
|
pluginStates = new Map(states.map((s) => [s.plugin_id, s.status]));
|
|
2471
|
-
} catch {
|
|
2484
|
+
} catch (error) {
|
|
2485
|
+
captureMissingManualSchema(error);
|
|
2486
|
+
}
|
|
2472
2487
|
}), phase("rt.site", "Site info options", async () => {
|
|
2473
2488
|
try {
|
|
2474
2489
|
siteInfo = await readSiteInfo();
|
|
2475
|
-
} catch {
|
|
2490
|
+
} catch (error) {
|
|
2491
|
+
captureMissingManualSchema(error);
|
|
2492
|
+
}
|
|
2476
2493
|
})];
|
|
2477
2494
|
if (ownsConfiguredDb) coldStartReads.push(phase("rt.seedcheck", "Auto-seed gate", async () => {
|
|
2478
2495
|
try {
|
|
@@ -2488,9 +2505,15 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2488
2505
|
collectionCount: collectionCount.count,
|
|
2489
2506
|
setupDone
|
|
2490
2507
|
};
|
|
2491
|
-
} catch {
|
|
2508
|
+
} catch (error) {
|
|
2509
|
+
captureMissingManualSchema(error);
|
|
2510
|
+
}
|
|
2492
2511
|
}));
|
|
2493
2512
|
await Promise.all(coldStartReads);
|
|
2513
|
+
if (missingManualSchemaError) {
|
|
2514
|
+
await disposeReadDb();
|
|
2515
|
+
throw missingManualSchemaError;
|
|
2516
|
+
}
|
|
2494
2517
|
if (localeCasingRepairVersion && (configuredLocales.some((locale) => locale.includes("-") || locale !== locale.toLowerCase()) || storedLocaleCasingRepairVersion !== void 0) && storedLocaleCasingRepairVersion !== localeCasingRepairVersion) await phase("rt.locale", "Repair locale casing", async () => {
|
|
2495
2518
|
await repairLocaleCasing(db, configuredLocales);
|
|
2496
2519
|
await new OptionsRepository(db).set(LOCALE_CASING_REPAIR_OPTION, localeCasingRepairVersion);
|
|
@@ -2500,9 +2523,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2500
2523
|
const seedHolder = getSeedHolder();
|
|
2501
2524
|
try {
|
|
2502
2525
|
await initWithLock(seedHolder.lock, () => seedHolder.done.has(seedKey) ? true : void 0, async () => {
|
|
2503
|
-
const { applySeed } = await import("../apply-
|
|
2504
|
-
const { loadSeed } = await import("../load-
|
|
2505
|
-
const { validateSeed } = await import("../validate-
|
|
2526
|
+
const { applySeed } = await import("../apply-kUDt80-G.mjs").then((n) => n.n);
|
|
2527
|
+
const { loadSeed } = await import("../load-YJ2xl3ra.mjs").then((n) => n.r);
|
|
2528
|
+
const { validateSeed } = await import("../validate-BMLBvxOC.mjs").then((n) => n.n);
|
|
2506
2529
|
const seed = await loadSeed();
|
|
2507
2530
|
if (validateSeed(seed).valid) {
|
|
2508
2531
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -2519,9 +2542,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2519
2542
|
} catch {}
|
|
2520
2543
|
} catch {}
|
|
2521
2544
|
}
|
|
2522
|
-
|
|
2523
|
-
await readDbDisposable.destroy();
|
|
2524
|
-
} catch {}
|
|
2545
|
+
await disposeReadDb();
|
|
2525
2546
|
const enabledPlugins = /* @__PURE__ */ new Set();
|
|
2526
2547
|
for (const plugin of deps.plugins) {
|
|
2527
2548
|
const status = pluginStates.get(plugin.id);
|
|
@@ -2743,9 +2764,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2743
2764
|
log: kyselyLogOption()
|
|
2744
2765
|
});
|
|
2745
2766
|
try {
|
|
2746
|
-
await
|
|
2767
|
+
await enforceRuntimeMigrationPolicy(db, deps.migrationMode ?? "auto");
|
|
2747
2768
|
} catch (error) {
|
|
2748
|
-
if (!(error instanceof ConcurrentMigrationTimeoutError)) holder.failures.set(cacheKey, {
|
|
2769
|
+
if (!(error instanceof ConcurrentMigrationTimeoutError) && !(error instanceof PendingMigrationsError)) holder.failures.set(cacheKey, {
|
|
2749
2770
|
at: Date.now(),
|
|
2750
2771
|
message: error instanceof Error ? error.message : String(error)
|
|
2751
2772
|
});
|
|
@@ -3333,7 +3354,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
3333
3354
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
3334
3355
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
3335
3356
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
3336
|
-
const { validateContentData } = await import("../validation-
|
|
3357
|
+
const { validateContentData } = await import("../validation-npvENUCB.mjs");
|
|
3337
3358
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
3338
3359
|
if (!validation.ok) return {
|
|
3339
3360
|
success: false,
|
|
@@ -3376,7 +3397,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
3376
3397
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
3377
3398
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
3378
3399
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
3379
|
-
const { validateContentData } = await import("../validation-
|
|
3400
|
+
const { validateContentData } = await import("../validation-npvENUCB.mjs");
|
|
3380
3401
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
3381
3402
|
if (!validation.ok) return {
|
|
3382
3403
|
success: false,
|
|
@@ -4234,6 +4255,21 @@ function createPublicMediaUrlResolver(storage) {
|
|
|
4234
4255
|
* middleware.ts.
|
|
4235
4256
|
*/
|
|
4236
4257
|
const ASTRO_COOKIES_SYMBOL = Symbol.for("astro.cookies");
|
|
4258
|
+
/**
|
|
4259
|
+
* Whether the request ended authenticated, for the db adapter's `commit()`.
|
|
4260
|
+
* `isAuthenticated` is captured before the route runs, so it misses
|
|
4261
|
+
* login/signup/invite requests that create the Astro session mid-request;
|
|
4262
|
+
* `session.set()` writes the `astro-session` cookie into the jar synchronously,
|
|
4263
|
+
* so scanning the outgoing cookies detects them. Only outgoing cookies count —
|
|
4264
|
+
* a stale `astro-session` cookie arriving on an anonymous render must not
|
|
4265
|
+
* qualify, or its replica-read bookmark would overwrite a fresher one from an
|
|
4266
|
+
* earlier authenticated write.
|
|
4267
|
+
*/
|
|
4268
|
+
function requestEndedAuthenticated(isAuthenticated, cookies) {
|
|
4269
|
+
if (isAuthenticated) return true;
|
|
4270
|
+
for (const header of cookies.headers()) if (header.startsWith("astro-session=")) return true;
|
|
4271
|
+
return false;
|
|
4272
|
+
}
|
|
4237
4273
|
/** Hold the real adapter close behind both response and deferred-task completion. */
|
|
4238
4274
|
function coordinateScopedDbLifecycle(scoped) {
|
|
4239
4275
|
if (!scoped.close) return { lifecycle: scoped };
|
|
@@ -4580,10 +4616,11 @@ function getPlugins() {
|
|
|
4580
4616
|
/**
|
|
4581
4617
|
* Build runtime dependencies from virtual modules
|
|
4582
4618
|
*/
|
|
4583
|
-
function buildDependencies(config) {
|
|
4619
|
+
function buildDependencies(config, migrationMode) {
|
|
4584
4620
|
const sandboxModule = virtualSandboxRunnerModule;
|
|
4585
4621
|
return {
|
|
4586
4622
|
config,
|
|
4623
|
+
migrationMode,
|
|
4587
4624
|
plugins: getPlugins(),
|
|
4588
4625
|
createDialect,
|
|
4589
4626
|
createCoalescingDialect,
|
|
@@ -4604,10 +4641,10 @@ function buildDependencies(config) {
|
|
|
4604
4641
|
* cached instance) push nothing — callers should treat an empty array
|
|
4605
4642
|
* as "warm, nothing to report".
|
|
4606
4643
|
*/
|
|
4607
|
-
async function getRuntime(config, initTimings) {
|
|
4644
|
+
async function getRuntime(config, migrationMode, initTimings) {
|
|
4608
4645
|
const holder = getRuntimeHolder();
|
|
4609
4646
|
return initWithLock(holder.lock, () => holder.instance, async (isCurrentClaim) => {
|
|
4610
|
-
const deps = buildDependencies(config);
|
|
4647
|
+
const deps = buildDependencies(config, migrationMode);
|
|
4611
4648
|
const runtime = await EmDashRuntime.create(deps, initTimings);
|
|
4612
4649
|
if (isCurrentClaim()) holder.instance = runtime;
|
|
4613
4650
|
else runtime.stopCron().catch((error) => {
|
|
@@ -4702,7 +4739,8 @@ async function withEmDashRuntime(run) {
|
|
|
4702
4739
|
* event scoping return null and keep using the singleton.
|
|
4703
4740
|
*/
|
|
4704
4741
|
async function runOutsideRequest(config, fn) {
|
|
4705
|
-
|
|
4742
|
+
const migrationMode = resolveConfiguredMigrationMode(config);
|
|
4743
|
+
if (getRequestContext()) return runOutsideRequestWithRuntime(config, await getRuntime(config, migrationMode), fn);
|
|
4706
4744
|
const deferredTasks = createDeferredTaskTracker(() => {});
|
|
4707
4745
|
return runWithContext({
|
|
4708
4746
|
editMode: false,
|
|
@@ -4711,7 +4749,7 @@ async function runOutsideRequest(config, fn) {
|
|
|
4711
4749
|
}, async () => {
|
|
4712
4750
|
return runOutsideRequestWithRuntime(config, await (async () => {
|
|
4713
4751
|
try {
|
|
4714
|
-
return await getRuntime(config);
|
|
4752
|
+
return await getRuntime(config, migrationMode);
|
|
4715
4753
|
} finally {
|
|
4716
4754
|
deferredTasks.settle();
|
|
4717
4755
|
await deferredTasks.settled;
|
|
@@ -4774,6 +4812,24 @@ const NOOP_COOKIE_JAR = {
|
|
|
4774
4812
|
* that path, so the value is never used — it exists to satisfy the contract.
|
|
4775
4813
|
*/
|
|
4776
4814
|
const CRON_EVENT_URL = new URL("https://cron.emdash.internal/");
|
|
4815
|
+
function resolveConfiguredMigrationMode(config) {
|
|
4816
|
+
const processOverride = typeof process !== "undefined" && process.env ? process.env.EMDASH_MIGRATIONS_MODE : void 0;
|
|
4817
|
+
const importMetaOverride = import.meta.env.EMDASH_MIGRATIONS_MODE;
|
|
4818
|
+
return resolveRuntimeMigrationMode(config.migrations, {
|
|
4819
|
+
dev: import.meta.env.DEV,
|
|
4820
|
+
override: processOverride ?? importMetaOverride
|
|
4821
|
+
});
|
|
4822
|
+
}
|
|
4823
|
+
function pendingMigrationsResponse(error) {
|
|
4824
|
+
console.error("[emdash] database migrations are pending:", error.pending.join(", "));
|
|
4825
|
+
return migrationRequiredResponse();
|
|
4826
|
+
}
|
|
4827
|
+
function migrationRequiredResponse() {
|
|
4828
|
+
return new Response("Database migrations are required. Apply the deployment migration manifest and retry.", {
|
|
4829
|
+
status: 503,
|
|
4830
|
+
headers: { "Retry-After": "60" }
|
|
4831
|
+
});
|
|
4832
|
+
}
|
|
4777
4833
|
/**
|
|
4778
4834
|
* Baseline security headers applied to all responses.
|
|
4779
4835
|
* Admin routes get additional headers (strict CSP) from auth middleware.
|
|
@@ -4889,6 +4945,8 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
4889
4945
|
const queryRecorder = isInstrumentationEnabled() ? createRecorder(url.pathname, request.method, request.headers.get("x-perf-phase") ?? "default") : void 0;
|
|
4890
4946
|
const metrics = createRequestMetrics(performance.now());
|
|
4891
4947
|
const run = async () => {
|
|
4948
|
+
const config = getConfig();
|
|
4949
|
+
const migrationMode = config ? resolveConfiguredMigrationMode(config) : "auto";
|
|
4892
4950
|
const isEmDashRoute = url.pathname.startsWith("/_emdash");
|
|
4893
4951
|
const isPublicRuntimeRoute = PUBLIC_RUNTIME_ROUTES.has(url.pathname) || SITEMAP_COLLECTION_RE.test(url.pathname);
|
|
4894
4952
|
const hasEditCookie = cookies.get("emdash-edit-mode")?.value === "true";
|
|
@@ -4899,15 +4957,16 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
4899
4957
|
const hasBearerAuth = (request.headers.get("authorization") ?? "").toLowerCase().startsWith("bearer ");
|
|
4900
4958
|
const isWrite = request.method !== "GET" && request.method !== "HEAD";
|
|
4901
4959
|
const isAuthenticated = !!sessionUser || hasBearerAuth;
|
|
4960
|
+
const endedAuthenticated = () => requestEndedAuthenticated(isAuthenticated, cookies);
|
|
4902
4961
|
const canUseCachedBinding = !isAuthenticated && !isWrite && !playgroundDb && !isEmDashRoute && !hasEditCookie && !hasPreviewToken;
|
|
4903
4962
|
if (!isEmDashRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
|
|
4904
4963
|
if (!sessionUser && !playgroundDb) {
|
|
4905
4964
|
const timings = [];
|
|
4906
4965
|
const mwStart = performance.now();
|
|
4907
|
-
if (!isSetupVerified() && !context.isPrerendered) {
|
|
4966
|
+
if (migrationMode === "auto" && !isSetupVerified() && !context.isPrerendered) {
|
|
4908
4967
|
const t0 = performance.now();
|
|
4909
4968
|
try {
|
|
4910
|
-
const { getDb } = await import("../loader-
|
|
4969
|
+
const { getDb } = await import("../loader-CdG_Ci3H.mjs").then((n) => n.c);
|
|
4911
4970
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
4912
4971
|
markSetupVerified();
|
|
4913
4972
|
} catch (error) {
|
|
@@ -4920,12 +4979,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
4920
4979
|
desc: "Setup probe"
|
|
4921
4980
|
});
|
|
4922
4981
|
}
|
|
4923
|
-
const config = getConfig();
|
|
4924
4982
|
if (config) {
|
|
4925
4983
|
const initSubTimings = [];
|
|
4926
4984
|
const t0 = performance.now();
|
|
4927
4985
|
try {
|
|
4928
|
-
const runtime = await getRuntime(config, initSubTimings);
|
|
4986
|
+
const runtime = await getRuntime(config, migrationMode, initSubTimings);
|
|
4929
4987
|
markSetupVerified();
|
|
4930
4988
|
locals.emdash = {
|
|
4931
4989
|
handlePublicPluginApiRoute: createPublicPluginApiRouteHandler(runtime),
|
|
@@ -4935,6 +4993,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
4935
4993
|
storage: runtime.storage
|
|
4936
4994
|
};
|
|
4937
4995
|
} catch (error) {
|
|
4996
|
+
if (error instanceof PendingMigrationsError) return pendingMigrationsResponse(error);
|
|
4997
|
+
if (migrationMode === "manual" && isMissingTableError(error)) {
|
|
4998
|
+
console.error("[emdash] database schema is unavailable in manual migration mode:", error);
|
|
4999
|
+
return migrationRequiredResponse();
|
|
5000
|
+
}
|
|
4938
5001
|
if (Date.now() - lastRuntimeInitErrorLogAt >= RUNTIME_INIT_ERROR_LOG_INTERVAL_MS) {
|
|
4939
5002
|
lastRuntimeInitErrorLogAt = Date.now();
|
|
4940
5003
|
console.error("[emdash] runtime init failed (page renders without CMS data):", error);
|
|
@@ -4951,6 +5014,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
4951
5014
|
const anonScoped = createRequestScopedDb$1({
|
|
4952
5015
|
config: config?.database?.config,
|
|
4953
5016
|
isAuthenticated,
|
|
5017
|
+
endedAuthenticated,
|
|
4954
5018
|
isWrite,
|
|
4955
5019
|
canUseCachedBinding,
|
|
4956
5020
|
cookies,
|
|
@@ -4995,7 +5059,6 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
4995
5059
|
return runAnon();
|
|
4996
5060
|
}
|
|
4997
5061
|
}
|
|
4998
|
-
const config = getConfig();
|
|
4999
5062
|
if (!config) {
|
|
5000
5063
|
console.error("EmDash: No configuration found");
|
|
5001
5064
|
return finalizeResponse(await next());
|
|
@@ -5006,7 +5069,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
5006
5069
|
try {
|
|
5007
5070
|
const initSubTimings = [];
|
|
5008
5071
|
let t0 = performance.now();
|
|
5009
|
-
const runtime = await getRuntime(config, initSubTimings);
|
|
5072
|
+
const runtime = await getRuntime(config, migrationMode, initSubTimings);
|
|
5010
5073
|
timings.push({
|
|
5011
5074
|
name: "rt",
|
|
5012
5075
|
dur: performance.now() - t0,
|
|
@@ -5075,12 +5138,18 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
5075
5138
|
setPluginStatus: runtime.setPluginStatus.bind(runtime)
|
|
5076
5139
|
};
|
|
5077
5140
|
} catch (error) {
|
|
5141
|
+
if (error instanceof PendingMigrationsError) return pendingMigrationsResponse(error);
|
|
5142
|
+
if (migrationMode === "manual" && isMissingTableError(error)) {
|
|
5143
|
+
console.error("[emdash] database schema is unavailable in manual migration mode:", error);
|
|
5144
|
+
return migrationRequiredResponse();
|
|
5145
|
+
}
|
|
5078
5146
|
console.error("EmDash middleware error:", error);
|
|
5079
5147
|
}
|
|
5080
5148
|
const lastContentWriteAt = canUseCachedBinding && config?.database?.needsLastContentWriteAt ? await getLastContentWriteAt() : void 0;
|
|
5081
5149
|
const scoped = createRequestScopedDb$1({
|
|
5082
5150
|
config: config?.database?.config,
|
|
5083
5151
|
isAuthenticated,
|
|
5152
|
+
endedAuthenticated,
|
|
5084
5153
|
isWrite,
|
|
5085
5154
|
canUseCachedBinding,
|
|
5086
5155
|
cookies: context.cookies,
|