emdash 0.32.0 → 0.33.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-C0ONzkUP.d.mts → adapters-BMyNSSZi.d.mts} +9 -1
- package/dist/adapters-BMyNSSZi.d.mts.map +1 -0
- package/dist/after-CBU2vkoO.mjs +96 -0
- package/dist/after-CBU2vkoO.mjs.map +1 -0
- package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-CG1pACtS.mjs} +2 -2
- package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-CG1pACtS.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +22 -22
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/{api-DgPbMlng.mjs → api-D2hunekQ.mjs} +247 -45
- package/dist/api-D2hunekQ.mjs.map +1 -0
- package/dist/{api-tokens-p-iMzvXR.mjs → api-tokens-CSND0i1z.mjs} +2 -2
- package/dist/{api-tokens-p-iMzvXR.mjs.map → api-tokens-CSND0i1z.mjs.map} +1 -1
- package/dist/{apply-1_6ra7NP.mjs → apply-kwNEJW2l.mjs} +35 -22
- package/dist/apply-kwNEJW2l.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.mjs +13 -3
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +8 -8
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +8 -8
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +4 -4
- 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 +344 -173
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +18 -18
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +18 -18
- package/dist/astro/routes/api/admin/bylines/index.mjs +18 -18
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +16 -16
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/counts.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -12
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +12 -12
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +46 -45
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +46 -45
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +45 -44
- 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 +45 -44
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +45 -44
- 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 +46 -45
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +46 -45
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +45 -44
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +45 -44
- 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 +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +45 -44
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -8
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +7 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs +6 -6
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
- package/dist/astro/routes/api/auth/logout.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -12
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +8 -8
- package/dist/astro/routes/api/auth/mode.mjs +3 -3
- 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 +7 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +13 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +18 -18
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +18 -18
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +18 -18
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -16
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
- package/dist/astro/routes/api/dashboard.mjs +9 -9
- package/dist/astro/routes/api/dev/emails.mjs +3 -3
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +19 -19
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +12 -12
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -19
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +27 -27
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +42 -42
- package/dist/astro/routes/api/media/_id_/confirm.mjs +10 -10
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
- package/dist/astro/routes/api/media/_id_/usage.mjs +14 -14
- package/dist/astro/routes/api/media/_id_.mjs +13 -13
- package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
- package/dist/astro/routes/api/media/providers/index.mjs +3 -3
- package/dist/astro/routes/api/media/upload-url.mjs +9 -9
- package/dist/astro/routes/api/media.mjs +13 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/items.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_/translations.mjs +11 -11
- package/dist/astro/routes/api/menus/_name_.mjs +11 -11
- package/dist/astro/routes/api/menus/index.mjs +11 -11
- package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +36 -5
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -12
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -12
- package/dist/astro/routes/api/redirects/_id_.mjs +14 -13
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +14 -13
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +18 -18
- package/dist/astro/routes/api/relations/_id_/translations.mjs +13 -13
- package/dist/astro/routes/api/relations/index.mjs +18 -18
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +45 -44
- 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 +45 -44
- 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 +45 -44
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +45 -44
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +45 -44
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +66 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +11 -9
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +45 -44
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +45 -44
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.d.mts +1 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +17 -13
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +11 -11
- package/dist/astro/routes/api/search/rebuild.mjs +13 -13
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +11 -11
- package/dist/astro/routes/api/sections/_slug_.mjs +11 -11
- package/dist/astro/routes/api/sections/index.mjs +11 -11
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings.mjs +16 -16
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -12
- package/dist/astro/routes/api/setup/dev-bypass.mjs +30 -30
- package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
- package/dist/astro/routes/api/setup/index.mjs +32 -32
- package/dist/astro/routes/api/setup/status.mjs +4 -4
- package/dist/astro/routes/api/snapshot.mjs +9 -9
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +43 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +16 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +16 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +16 -16
- package/dist/astro/routes/api/taxonomies/index.mjs +16 -16
- package/dist/astro/routes/api/themes/preview.mjs +7 -7
- package/dist/astro/routes/api/typegen.mjs +5 -5
- 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 +8 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_.mjs +6 -6
- package/dist/astro/routes/api/widget-areas/index.mjs +11 -11
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +9 -9
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +12 -12
- package/dist/astro/routes/sitemap.xml.mjs +10 -10
- package/dist/astro/types.d.mts +19 -13
- 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-R5iYYrpa.mjs → authorize-qRhWQnel.mjs} +2 -2
- package/dist/{authorize-R5iYYrpa.mjs.map → authorize-qRhWQnel.mjs.map} +1 -1
- package/dist/{backup-LpQ1V_sR.mjs → backup-CtA6LDNw.mjs} +5 -5
- package/dist/{backup-LpQ1V_sR.mjs.map → backup-CtA6LDNw.mjs.map} +1 -1
- package/dist/{byline-C5TAqs8N.mjs → byline-Cp6csL84.mjs} +9 -9
- package/dist/{byline-C5TAqs8N.mjs.map → byline-Cp6csL84.mjs.map} +1 -1
- package/dist/{byline-fields-T9ZLZMxJ.mjs → byline-fields-CNc0Yq5i.mjs} +2 -2
- package/dist/{byline-fields-T9ZLZMxJ.mjs.map → byline-fields-CNc0Yq5i.mjs.map} +1 -1
- package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-ZkPKqEwC.mjs} +4 -4
- package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-ZkPKqEwC.mjs.map} +1 -1
- package/dist/{bylines-B8-WGdja.mjs → bylines-CEj5CdT4.mjs} +7 -7
- package/dist/{bylines-B8-WGdja.mjs.map → bylines-CEj5CdT4.mjs.map} +1 -1
- package/dist/{bylines-DGuqBLjV.mjs → bylines-cf-C9lmF.mjs} +4 -4
- package/dist/{bylines-DGuqBLjV.mjs.map → bylines-cf-C9lmF.mjs.map} +1 -1
- package/dist/cache-C9FptTFR.mjs +108 -0
- package/dist/cache-C9FptTFR.mjs.map +1 -0
- package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-D9VNKELo.mjs} +1 -1
- package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-D9VNKELo.mjs.map} +1 -1
- package/dist/{chunks-D5dlPeRb.mjs → chunks-DbYzib_k.mjs} +2 -2
- package/dist/{chunks-D5dlPeRb.mjs.map → chunks-DbYzib_k.mjs.map} +1 -1
- package/dist/cli/index.mjs +40 -32
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -2
- package/dist/{comment-DnTxxVHv.mjs → comment-BIkJ6Fil.mjs} +3 -3
- package/dist/{comment-DnTxxVHv.mjs.map → comment-BIkJ6Fil.mjs.map} +1 -1
- package/dist/{comment-reaction-BUlUz2bh.mjs → comment-reaction-D-laEceb.mjs} +2 -2
- package/dist/{comment-reaction-BUlUz2bh.mjs.map → comment-reaction-D-laEceb.mjs.map} +1 -1
- package/dist/{comments-QPKgK3nk.mjs → comments-0_w6KChA.mjs} +3 -3
- package/dist/{comments-QPKgK3nk.mjs.map → comments-0_w6KChA.mjs.map} +1 -1
- package/dist/{components-DZkL4Fx0.mjs → components-BPxrRjpE.mjs} +1 -1
- package/dist/{components-DZkL4Fx0.mjs.map → components-BPxrRjpE.mjs.map} +1 -1
- package/dist/{content-CpfKV9QE.mjs → content-CJ94NEx5.mjs} +165 -112
- package/dist/content-CJ94NEx5.mjs.map +1 -0
- package/dist/{content-refresh-DgqUBeTv.mjs → content-refresh-Xw7aKmou.mjs} +6 -6
- package/dist/{content-refresh-DgqUBeTv.mjs.map → content-refresh-Xw7aKmou.mjs.map} +1 -1
- package/dist/{context-kO4YZB03.mjs → context-C_1nrqnW.mjs} +14 -14
- package/dist/{context-kO4YZB03.mjs.map → context-C_1nrqnW.mjs.map} +1 -1
- package/dist/{cron-BlKIMD_e.mjs → cron-DRV-UC4K.mjs} +1 -1
- package/dist/{cron-BlKIMD_e.mjs.map → cron-DRV-UC4K.mjs.map} +1 -1
- package/dist/{dashboard-DoBwPnON.mjs → dashboard-DINnNVVU.mjs} +5 -5
- package/dist/{dashboard-DoBwPnON.mjs.map → dashboard-DINnNVVU.mjs.map} +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +2 -2
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{default-C4v9KP56.mjs → default-BD2FG0xV.mjs} +1 -1
- package/dist/{default-C4v9KP56.mjs.map → default-BD2FG0xV.mjs.map} +1 -1
- package/dist/deferred-tasks-C-WRCcKo.d.mts +9 -0
- package/dist/deferred-tasks-C-WRCcKo.d.mts.map +1 -0
- package/dist/{device-flow-DhUsyJU6.mjs → device-flow-CTqd8mud.mjs} +5 -5
- package/dist/{device-flow-DhUsyJU6.mjs.map → device-flow-CTqd8mud.mjs.map} +1 -1
- package/dist/{dialect-helpers-DFwyWjTM.mjs → dialect-helpers-BSbfaO3F.mjs} +24 -16
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
- package/dist/{email-console-C-9Ng8DM.mjs → email-console-C6WdcWbL.mjs} +1 -1
- package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-C6WdcWbL.mjs.map} +1 -1
- package/dist/{error-DmmN74gW.mjs → error-oh_9i6bR.mjs} +3 -3
- package/dist/{error-DmmN74gW.mjs.map → error-oh_9i6bR.mjs.map} +1 -1
- package/dist/{errors-DtEXIQQV.mjs → errors-BucQ8VYz.mjs} +2 -1
- package/dist/errors-BucQ8VYz.mjs.map +1 -0
- package/dist/{escape-CdW31WsG.mjs → escape-CXps5F_v.mjs} +1 -1
- package/dist/{escape-CdW31WsG.mjs.map → escape-CXps5F_v.mjs.map} +1 -1
- package/dist/{field-defs-cache-QMVnzTH6.mjs → field-defs-cache-WD82dMQq.mjs} +4 -4
- package/dist/{field-defs-cache-QMVnzTH6.mjs.map → field-defs-cache-WD82dMQq.mjs.map} +1 -1
- package/dist/{fts-manager-vncsZIJm.mjs → fts-manager-BITakW_R.mjs} +37 -13
- package/dist/fts-manager-BITakW_R.mjs.map +1 -0
- package/dist/{hash-Cb7U1b5M.mjs → hash-Cg0TXJPV.mjs} +1 -1
- package/dist/{hash-Cb7U1b5M.mjs.map → hash-Cg0TXJPV.mjs.map} +1 -1
- package/dist/{hreflang-CZbSx6Bg.d.mts → hreflang-BaLCNcDx.d.mts} +2 -2
- package/dist/{hreflang-CZbSx6Bg.d.mts.map → hreflang-BaLCNcDx.d.mts.map} +1 -1
- package/dist/{hreflang-Bg-zMpkr.mjs → hreflang-BdZuVBhL.mjs} +6 -6
- package/dist/{hreflang-Bg-zMpkr.mjs.map → hreflang-BdZuVBhL.mjs.map} +1 -1
- package/dist/{import-PKhLeXvn.mjs → import-C-9uqyT3.mjs} +6 -6
- package/dist/{import-PKhLeXvn.mjs.map → import-C-9uqyT3.mjs.map} +1 -1
- package/dist/{index-j9rTh3cp.d.mts → index-M37iz29I.d.mts} +75 -35
- package/dist/index-M37iz29I.d.mts.map +1 -0
- package/dist/{index-BeNto_Vs.d.mts → index-MGw47uWq.d.mts} +3 -3
- package/dist/{index-BeNto_Vs.d.mts.map → index-MGw47uWq.d.mts.map} +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.mjs +68 -66
- package/dist/{load-BwTdWE8B.mjs → load-DV1DZuUJ.mjs} +2 -2
- package/dist/{load-BwTdWE8B.mjs.map → load-DV1DZuUJ.mjs.map} +1 -1
- package/dist/{loader-C1XOLV5b.mjs → loader-CGugY7Zl.mjs} +29 -15
- package/dist/loader-CGugY7Zl.mjs.map +1 -0
- package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-Da7kj23y.mjs} +1 -1
- package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-Da7kj23y.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +8 -8
- package/dist/{media-tQDZEdu7.mjs → media-BP7S-nHT.mjs} +2 -2
- package/dist/{media-tQDZEdu7.mjs.map → media-BP7S-nHT.mjs.map} +1 -1
- package/dist/{media-DWIzoVFL.mjs → media-OhYL-7Io.mjs} +1 -1
- package/dist/{media-DWIzoVFL.mjs.map → media-OhYL-7Io.mjs.map} +1 -1
- package/dist/{media-allowlist-B7TPD6aq.mjs → media-allowlist-D-peH1H5.mjs} +1 -1
- package/dist/{media-allowlist-B7TPD6aq.mjs.map → media-allowlist-D-peH1H5.mjs.map} +1 -1
- package/dist/{media-upload-Bc9Nc5Zf.mjs → media-upload-DtrwU2B0.mjs} +7 -7
- package/dist/{media-upload-Bc9Nc5Zf.mjs.map → media-upload-DtrwU2B0.mjs.map} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs → media-url-DYs_YLOx.mjs} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs.map → media-url-DYs_YLOx.mjs.map} +1 -1
- package/dist/{media-usage-DPJcNaAq.mjs → media-usage-BlxfTkN0.mjs} +8 -8
- package/dist/{media-usage-DPJcNaAq.mjs.map → media-usage-BlxfTkN0.mjs.map} +1 -1
- package/dist/{menus-BxPLFfIc.mjs → menus-BcQWxeXu.mjs} +4 -4
- package/dist/{menus-BxPLFfIc.mjs.map → menus-BcQWxeXu.mjs.map} +1 -1
- package/dist/{menus-C6qhqP4X.mjs → menus-Y54RDPIN.mjs} +215 -38
- package/dist/menus-Y54RDPIN.mjs.map +1 -0
- package/dist/{mode-fiXRMfeA.mjs → mode-BWyTBe3I.mjs} +1 -1
- package/dist/{mode-fiXRMfeA.mjs.map → mode-BWyTBe3I.mjs.map} +1 -1
- package/dist/{oauth-authorization-C9tFinly.mjs → oauth-authorization-ClvktmrL.mjs} +5 -5
- package/dist/{oauth-authorization-C9tFinly.mjs.map → oauth-authorization-ClvktmrL.mjs.map} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs → oauth-clients-8ao-U66l.mjs} +1 -1
- package/dist/{oauth-clients-BwTxE1aE.mjs.map → oauth-clients-8ao-U66l.mjs.map} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs → oauth-state-store-B1ofdTiQ.mjs} +1 -1
- package/dist/{oauth-state-store-DaRUwPWO.mjs.map → oauth-state-store-B1ofdTiQ.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs → oauth-user-lookup-CscEuIiR.mjs} +1 -1
- package/dist/{oauth-user-lookup-CzuzOSlF.mjs.map → oauth-user-lookup-CscEuIiR.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
- package/dist/object-cache-71tPfV4A.mjs.map +1 -0
- package/dist/{options-aeIs8WFu.d.mts → options-CA4eVX6P.d.mts} +3 -3
- package/dist/{options-aeIs8WFu.d.mts.map → options-CA4eVX6P.d.mts.map} +1 -1
- package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
- package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BL49yb9D.mjs → parse-CJKNuewM.mjs} +2 -2
- package/dist/{parse-BL49yb9D.mjs.map → parse-CJKNuewM.mjs.map} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs → passkey-config-D-zrzMJI.mjs} +1 -1
- package/dist/{passkey-config-KMhgFjdQ.mjs.map → passkey-config-D-zrzMJI.mjs.map} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts → placeholder-DaeNS-VG.d.mts} +1 -1
- package/dist/{placeholder-Dxo5Zt58.d.mts.map → placeholder-DaeNS-VG.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/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{portable-text-CNahFfj6.mjs → portable-text-B_kqBmXB.mjs} +1 -1
- package/dist/{portable-text-CNahFfj6.mjs.map → portable-text-B_kqBmXB.mjs.map} +1 -1
- package/dist/{preview-D4Jnbfx7.mjs → preview-BU6PaLpM.mjs} +2 -2
- package/dist/{preview-D4Jnbfx7.mjs.map → preview-BU6PaLpM.mjs.map} +1 -1
- package/dist/{public-url-DSGTnJFw.mjs → public-url-Ox9oOlgp.mjs} +14 -3
- package/dist/public-url-Ox9oOlgp.mjs.map +1 -0
- package/dist/{query-DCiXI7OZ.mjs → query-C5w7PsRQ.mjs} +20 -41
- package/dist/query-C5w7PsRQ.mjs.map +1 -0
- package/dist/{query-1xOcEy18.mjs → query-rC9HKv1N.mjs} +4 -4
- package/dist/{query-1xOcEy18.mjs.map → query-rC9HKv1N.mjs.map} +1 -1
- package/dist/{rate-limit-Vkp9gQ1Y.mjs → rate-limit-kug6q99V.mjs} +2 -2
- package/dist/{rate-limit-Vkp9gQ1Y.mjs.map → rate-limit-kug6q99V.mjs.map} +1 -1
- package/dist/{redirect-BJ6d1yHh.mjs → redirect-DIJxXKOG.mjs} +3 -3
- package/dist/{redirect-BJ6d1yHh.mjs.map → redirect-DIJxXKOG.mjs.map} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs → redirect-Egf2R9yP.mjs} +1 -1
- package/dist/{redirect-CDgfv9vh.mjs.map → redirect-Egf2R9yP.mjs.map} +1 -1
- package/dist/{redirects-Cwkq2H-G.mjs → redirects-Bzm812bY.mjs} +5 -5
- package/dist/{redirects-Cwkq2H-G.mjs.map → redirects-Bzm812bY.mjs.map} +1 -1
- package/dist/{redirects-BOn2DIUs.mjs → redirects-G8wAhWAf.mjs} +20 -6
- package/dist/redirects-G8wAhWAf.mjs.map +1 -0
- package/dist/{registry-BP1JK2xh.mjs → registry-Dbodb4Uo.mjs} +59 -14
- package/dist/registry-Dbodb4Uo.mjs.map +1 -0
- package/dist/{relation-DJ5DZh7B.mjs → relation-Cbe3Sd3m.mjs} +3 -3
- package/dist/{relation-DJ5DZh7B.mjs.map → relation-Cbe3Sd3m.mjs.map} +1 -1
- package/dist/{relations-C4duJnwI.mjs → relations-Bw_E1TXo.mjs} +3 -3
- package/dist/{relations-C4duJnwI.mjs.map → relations-Bw_E1TXo.mjs.map} +1 -1
- package/dist/{relations-DHFQGX0h.d.mts → relations-G2ta7GIl.d.mts} +36 -9
- package/dist/relations-G2ta7GIl.d.mts.map +1 -0
- package/dist/{relations-DpTjftCl.mjs → relations-qHwpUe66.mjs} +5 -5
- package/dist/{relations-DpTjftCl.mjs.map → relations-qHwpUe66.mjs.map} +1 -1
- package/dist/request-context.d.mts +3 -0
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{request-meta-DzXYYI-n.mjs → request-meta-Df-jFbAd.mjs} +2 -2
- package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-Df-jFbAd.mjs.map} +1 -1
- package/dist/{resolve-BUvFE0Lr.mjs → resolve-DZzG4HqM.mjs} +1 -1
- package/dist/{resolve-BUvFE0Lr.mjs.map → resolve-DZzG4HqM.mjs.map} +1 -1
- package/dist/{runner-BsI18UgP.mjs → runner-BFTrkYhu.mjs} +482 -216
- package/dist/runner-BFTrkYhu.mjs.map +1 -0
- package/dist/{runner-CHdkERbt.d.mts → runner-BaADli8l.d.mts} +2 -2
- package/dist/{runner-CHdkERbt.d.mts.map → runner-BaADli8l.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +3 -3
- package/dist/{schema-eqZhkR0S.mjs → schema-CiQXr6_F.mjs} +3 -3
- package/dist/{schema-eqZhkR0S.mjs.map → schema-CiQXr6_F.mjs.map} +1 -1
- package/dist/{scopes-Be2d8bSb.mjs → scopes-CNJVT5i5.mjs} +3 -3
- package/dist/{scopes-Be2d8bSb.mjs.map → scopes-CNJVT5i5.mjs.map} +1 -1
- package/dist/{search-CeO678cp.mjs → search-FZhx5dDU.mjs} +6 -6
- package/dist/{search-CeO678cp.mjs.map → search-FZhx5dDU.mjs.map} +1 -1
- package/dist/{secrets-870d-7yA.mjs → secrets-DLd8RXee.mjs} +4 -4
- package/dist/{secrets-870d-7yA.mjs.map → secrets-DLd8RXee.mjs.map} +1 -1
- package/dist/{sections-DSuEfirn.mjs → sections-BrIrMUCn.mjs} +3 -3
- package/dist/{sections-DSuEfirn.mjs.map → sections-BrIrMUCn.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +24 -24
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +17 -17
- package/dist/{seo-C3GDfT0V.mjs → seo-CobNfOvb.mjs} +2 -2
- package/dist/{seo-C3GDfT0V.mjs.map → seo-CobNfOvb.mjs.map} +1 -1
- package/dist/{seo-BAPKiED8.mjs → seo-DTHRntNC.mjs} +3 -3
- package/dist/{seo-BAPKiED8.mjs.map → seo-DTHRntNC.mjs.map} +1 -1
- package/dist/{service-DyFT-k-R.mjs → service-B-pYGPgR.mjs} +4 -4
- package/dist/{service-DyFT-k-R.mjs.map → service-B-pYGPgR.mjs.map} +1 -1
- package/dist/{session-user-BrK2zz7S.mjs → session-user-BvM9-zNl.mjs} +2 -2
- package/dist/{session-user-BrK2zz7S.mjs.map → session-user-BvM9-zNl.mjs.map} +1 -1
- package/dist/{settings-CREKyj8I.mjs → settings-DPHau-WH.mjs} +3 -3
- package/dist/{settings-CREKyj8I.mjs.map → settings-DPHau-WH.mjs.map} +1 -1
- package/dist/{settings-DgKouY2S.mjs → settings-kJhGiQ4z.mjs} +7 -7
- package/dist/{settings-DgKouY2S.mjs.map → settings-kJhGiQ4z.mjs.map} +1 -1
- package/dist/{setup-complete-L7bMK2VI.mjs → setup-complete-u50Qm8rY.mjs} +2 -2
- package/dist/{setup-complete-L7bMK2VI.mjs.map → setup-complete-u50Qm8rY.mjs.map} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs → setup-nonce-DCjiiOD2.mjs} +1 -1
- package/dist/{setup-nonce-Ct5tjWcq.mjs.map → setup-nonce-DCjiiOD2.mjs.map} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-DW3w11Pu.mjs} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-DW3w11Pu.mjs.map} +1 -1
- package/dist/site-url-I-lJ5kma.mjs +16 -0
- package/dist/site-url-I-lJ5kma.mjs.map +1 -0
- package/dist/{snapshot-BdpUJKD-.mjs → snapshot-I_fjLDaD.mjs} +2 -2
- package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-I_fjLDaD.mjs.map} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs → ssrf-CTa6v21i.mjs} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-CTa6v21i.mjs.map} +1 -1
- package/dist/{state-xxv6ZTMv.mjs → state-CQvoefYP.mjs} +1 -1
- package/dist/{state-xxv6ZTMv.mjs.map → state-CQvoefYP.mjs.map} +1 -1
- package/dist/{status-COfycGIU.mjs → status-CIsmlC1E.mjs} +1 -1
- package/dist/{status-COfycGIU.mjs.map → status-CIsmlC1E.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/{taxonomies-Dbdki3Un.mjs → taxonomies-CKuaZER5.mjs} +85 -5
- package/dist/taxonomies-CKuaZER5.mjs.map +1 -0
- package/dist/{taxonomies-B61CRSha.mjs → taxonomies-CLN1N92E.mjs} +16 -17
- package/dist/taxonomies-CLN1N92E.mjs.map +1 -0
- package/dist/{taxonomy-DvwWAPvA.mjs → taxonomy-pOrB2kZe.mjs} +142 -15
- package/dist/taxonomy-pOrB2kZe.mjs.map +1 -0
- package/dist/{tokens-DVltpO2D.mjs → tokens-DagaJGK8.mjs} +1 -1
- package/dist/{tokens-DVltpO2D.mjs.map → tokens-DagaJGK8.mjs.map} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
- package/dist/{transport-DokJOScS.d.mts → transport-CAwTaTp_.d.mts} +1 -1
- package/dist/{transport-DokJOScS.d.mts.map → transport-CAwTaTp_.d.mts.map} +1 -1
- package/dist/{transport-BWQo0Foy.mjs → transport-DVsa5YYo.mjs} +1 -1
- package/dist/{transport-BWQo0Foy.mjs.map → transport-DVsa5YYo.mjs.map} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-D20_7fyX.mjs} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-D20_7fyX.mjs.map} +1 -1
- package/dist/{types-DqZVPILm.d.mts → types-BGWPMiBO.d.mts} +2 -2
- package/dist/{types-DqZVPILm.d.mts.map → types-BGWPMiBO.d.mts.map} +1 -1
- package/dist/{types-DsAMyD_o.d.mts → types-BK6U01Ro.d.mts} +1 -1
- package/dist/{types-DsAMyD_o.d.mts.map → types-BK6U01Ro.d.mts.map} +1 -1
- package/dist/{types-BD40g7zz.mjs → types-BjxTKxrZ.mjs} +1 -1
- package/dist/{types-BD40g7zz.mjs.map → types-BjxTKxrZ.mjs.map} +1 -1
- package/dist/{types-jISEalTX.d.mts → types-BnFP1M3J.d.mts} +22 -1
- package/dist/types-BnFP1M3J.d.mts.map +1 -0
- package/dist/{types-Dr2GLlwu.d.mts → types-C8oz_ayJ.d.mts} +1 -1
- package/dist/{types-Dr2GLlwu.d.mts.map → types-C8oz_ayJ.d.mts.map} +1 -1
- package/dist/{types-C9P3ysxq.d.mts → types-CbUcuxxc.d.mts} +1 -1
- package/dist/{types-C9P3ysxq.d.mts.map → types-CbUcuxxc.d.mts.map} +1 -1
- package/dist/{types-XrQQ-Aex.mjs → types-Cd8iuS1J.mjs} +10 -3
- package/dist/{types-XrQQ-Aex.mjs.map → types-Cd8iuS1J.mjs.map} +1 -1
- package/dist/types-CtzytVXn.mjs +18 -0
- package/dist/types-CtzytVXn.mjs.map +1 -0
- package/dist/{types-BQY7VYw6.d.mts → types-Cz8hNch2.d.mts} +5 -5
- package/dist/{types-BQY7VYw6.d.mts.map → types-Cz8hNch2.d.mts.map} +1 -1
- package/dist/{types-CcSZCcF1.d.mts → types-DLG4IFEQ.d.mts} +1 -1
- package/dist/{types-CcSZCcF1.d.mts.map → types-DLG4IFEQ.d.mts.map} +1 -1
- package/dist/{types-84Bque3-.d.mts → types-Dc4ntQjQ.d.mts} +10 -1
- package/dist/types-Dc4ntQjQ.d.mts.map +1 -0
- package/dist/{types-DQLZ58GV.d.mts → types-LoagAGzH.d.mts} +1 -1
- package/dist/{types-DQLZ58GV.d.mts.map → types-LoagAGzH.d.mts.map} +1 -1
- package/dist/{types-o7xo7VgH.mjs → types-NBI3rF-_.mjs} +3 -2
- package/dist/types-NBI3rF-_.mjs.map +1 -0
- package/dist/{upload-attempts-C5yd6Gae.mjs → upload-attempts-D8QAFLUJ.mjs} +1 -1
- package/dist/{upload-attempts-C5yd6Gae.mjs.map → upload-attempts-D8QAFLUJ.mjs.map} +1 -1
- package/dist/{user-BAumEmpA.mjs → user-DBrq4UVq.mjs} +3 -3
- package/dist/{user-BAumEmpA.mjs.map → user-DBrq4UVq.mjs.map} +1 -1
- package/dist/{utils-BbUgmeZG.mjs → utils-hLzi_2Fn.mjs} +2 -2
- package/dist/{utils-BbUgmeZG.mjs.map → utils-hLzi_2Fn.mjs.map} +1 -1
- package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
- package/dist/validate-BpwoDOgt.mjs.map +1 -0
- package/dist/{validate-CdYcY-Ln.d.mts → validate-C3oSmA7F.d.mts} +15 -5
- package/dist/validate-C3oSmA7F.d.mts.map +1 -0
- package/dist/{validate-Bs_wT2ul.mjs → validate-mKo3RxBM.mjs} +3 -3
- package/dist/{validate-Bs_wT2ul.mjs.map → validate-mKo3RxBM.mjs.map} +1 -1
- package/dist/{validation-BngR0nit.mjs → validation-BgpucsvF.mjs} +10 -10
- package/dist/{validation-BngR0nit.mjs.map → validation-BgpucsvF.mjs.map} +1 -1
- package/dist/version-C4PnpmoV.mjs +7 -0
- package/dist/{version-Bdfb34kk.mjs.map → version-C4PnpmoV.mjs.map} +1 -1
- package/dist/{widgets-L-VndTKD.mjs → widgets-CJJtkiKh.mjs} +3 -3
- package/dist/{widgets-L-VndTKD.mjs.map → widgets-CJJtkiKh.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-BexjtNid.mjs → wxr-taxonomies-9PPSy8X6.mjs} +4 -4
- package/dist/{wxr-taxonomies-BexjtNid.mjs.map → wxr-taxonomies-9PPSy8X6.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts → wxr-taxonomies-Bkpp_2tK.d.mts} +1 -1
- package/dist/{wxr-taxonomies-DueaLFd9.d.mts.map → wxr-taxonomies-Bkpp_2tK.d.mts.map} +1 -1
- package/dist/{zod-generator-DMzfga3g.mjs → zod-generator-CG64Hnbh.mjs} +3 -3
- package/dist/{zod-generator-DMzfga3g.mjs.map → zod-generator-CG64Hnbh.mjs.map} +1 -1
- package/package.json +11 -8
- package/src/after.ts +6 -1
- package/src/api/errors.ts +1 -0
- package/src/api/handlers/content.ts +45 -4
- package/src/api/handlers/marketplace.ts +14 -0
- package/src/api/handlers/registry.ts +14 -0
- package/src/api/handlers/revision.ts +19 -5
- package/src/api/handlers/schema.ts +37 -0
- package/src/api/handlers/snapshot.ts +1 -1
- package/src/api/handlers/taxonomies.ts +101 -1
- package/src/api/openapi/document.ts +48 -0
- package/src/api/public-url.ts +14 -2
- package/src/api/schemas/schema.ts +13 -0
- package/src/api/schemas/search.ts +2 -0
- package/src/api/schemas/taxonomies.ts +18 -0
- package/src/api/site-url.ts +16 -6
- package/src/astro/integration/routes.ts +14 -0
- package/src/astro/integration/runtime.ts +13 -0
- package/src/astro/integration/virtual-modules.ts +2 -0
- package/src/astro/middleware/redirect.ts +2 -10
- package/src/astro/middleware/scoped-db.ts +35 -4
- package/src/astro/middleware.ts +56 -22
- package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
- package/src/astro/routes/api/auth/invite/index.ts +2 -2
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
- package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +2 -0
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
- package/src/astro/types.ts +6 -0
- package/src/cleanup.ts +31 -26
- package/src/cli/commands/dev.ts +13 -3
- package/src/cli/commands/export-seed.ts +2 -0
- package/src/cli/index.ts +1 -1
- package/src/components/CommentForm.astro +1 -1
- package/src/components/Comments.astro +1 -1
- package/src/components/InlinePortableTextEditor.tsx +171 -31
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +26 -4
- package/src/components/index.ts +12 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +59 -9
- package/src/content/converters/prosemirror-to-portable-text.ts +23 -12
- package/src/content/converters/types.ts +2 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/database/dialect-helpers.ts +3 -22
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -0
- package/src/database/migrations/runner.ts +10 -0
- package/src/database/repositories/content.ts +191 -178
- package/src/database/repositories/revision.ts +82 -17
- package/src/database/repositories/taxonomy.ts +202 -7
- package/src/database/repositories/types.ts +7 -0
- package/src/database/types.ts +13 -1
- package/src/database/validate.ts +39 -0
- package/src/db/adapters.ts +8 -0
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +268 -92
- package/src/index.ts +2 -0
- package/src/loader.ts +46 -24
- package/src/media/usage/gc.ts +50 -0
- package/src/object-cache/index.ts +160 -3
- package/src/plugins/routes.ts +34 -0
- package/src/plugins/storage-indexes.ts +50 -11
- package/src/query.ts +21 -42
- package/src/redirects/cache.ts +79 -19
- package/src/request-context.ts +3 -0
- package/src/scheduled-publish.ts +6 -1
- package/src/schema/registry.ts +95 -3
- package/src/schema/types.ts +24 -0
- package/src/search/fts-manager.ts +50 -10
- package/src/search/index.ts +2 -0
- package/src/search/types.ts +6 -0
- package/src/seed/apply.ts +22 -2
- package/src/seed/types.ts +10 -0
- package/src/taxonomies/index.ts +11 -7
- package/src/taxonomies/term-counts.ts +2 -4
- package/src/ui-comments.ts +19 -0
- package/src/ui.ts +11 -3
- package/src/virtual-modules.d.ts +8 -0
- package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
- package/dist/after-B1IIdH3Y.mjs +0 -29
- package/dist/after-B1IIdH3Y.mjs.map +0 -1
- package/dist/api-DgPbMlng.mjs.map +0 -1
- package/dist/apply-1_6ra7NP.mjs.map +0 -1
- package/dist/cache-B26cufFd.mjs +0 -65
- package/dist/cache-B26cufFd.mjs.map +0 -1
- package/dist/content-CpfKV9QE.mjs.map +0 -1
- package/dist/dialect-helpers-DFwyWjTM.mjs.map +0 -1
- package/dist/errors-DtEXIQQV.mjs.map +0 -1
- package/dist/fts-manager-vncsZIJm.mjs.map +0 -1
- package/dist/index-j9rTh3cp.d.mts.map +0 -1
- package/dist/loader-C1XOLV5b.mjs.map +0 -1
- package/dist/menus-C6qhqP4X.mjs.map +0 -1
- package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
- package/dist/public-url-DSGTnJFw.mjs.map +0 -1
- package/dist/query-DCiXI7OZ.mjs.map +0 -1
- package/dist/redirects-BOn2DIUs.mjs.map +0 -1
- package/dist/registry-BP1JK2xh.mjs.map +0 -1
- package/dist/relations-DHFQGX0h.d.mts.map +0 -1
- package/dist/runner-BsI18UgP.mjs.map +0 -1
- package/dist/site-url-8N3kSyVZ.mjs +0 -13
- package/dist/site-url-8N3kSyVZ.mjs.map +0 -1
- package/dist/taxonomies-B61CRSha.mjs.map +0 -1
- package/dist/taxonomies-Dbdki3Un.mjs.map +0 -1
- package/dist/taxonomy-DvwWAPvA.mjs.map +0 -1
- package/dist/types-84Bque3-.d.mts.map +0 -1
- package/dist/types-jISEalTX.d.mts.map +0 -1
- package/dist/types-o7xo7VgH.mjs.map +0 -1
- package/dist/validate-CdYcY-Ln.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/version-Bdfb34kk.mjs +0 -7
- /package/dist/{api-tokens-CEsW_jCg.mjs → api-tokens-Dai9dND0.mjs} +0 -0
- /package/dist/{ssrf-BB__xfNM.mjs → ssrf-Cj568Dgs.mjs} +0 -0
- /package/dist/{types-CK0LxPUQ.mjs → types-DKuWPYV5.mjs} +0 -0
|
@@ -1,89 +1,90 @@
|
|
|
1
|
-
import { a as runMigrations, n as MIGRATION_RACE_WAIT_MS, t as ConcurrentMigrationTimeoutError } from "../runner-
|
|
2
|
-
import {
|
|
3
|
-
import { c as isSqlite, l as listTablesLike } from "../dialect-helpers-DFwyWjTM.mjs";
|
|
1
|
+
import { a as runMigrations, n as MIGRATION_RACE_WAIT_MS, t as ConcurrentMigrationTimeoutError } from "../runner-BFTrkYhu.mjs";
|
|
2
|
+
import { c as isSqlite, u as listTablesLike } from "../dialect-helpers-BSbfaO3F.mjs";
|
|
4
3
|
import { a as setI18nConfig, n as getI18nConfig } from "../config-DyF3OKg_.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { t as after } from "../after-
|
|
4
|
+
import { D as AuditRepository, b as definePlugin, g as EmailPipeline, h as parseRouteInput, m as buildRouteMeta, p as PluginRouteRegistry, t as getMenu, v as createHookPipeline, y as resolveExclusiveHooks } from "../menus-Y54RDPIN.mjs";
|
|
5
|
+
import { n as createDeferredTaskTracker, t as after } from "../after-CBU2vkoO.mjs";
|
|
7
6
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
8
|
-
import "../object-cache-
|
|
9
|
-
import { r as RevisionRepository, t as ContentRepository } from "../content-
|
|
7
|
+
import { o as getLastContentWriteAt } from "../object-cache-71tPfV4A.mjs";
|
|
8
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-CJ94NEx5.mjs";
|
|
10
9
|
import { n as isMissingTableError } from "../db-errors-CcWLaRiR.mjs";
|
|
11
10
|
import "../base64-B-PsqheR.mjs";
|
|
12
|
-
import "../types-
|
|
13
|
-
import { t as MediaRepository } from "../media-
|
|
14
|
-
import "../user-
|
|
15
|
-
import "../taxonomy-
|
|
16
|
-
import "../comment-
|
|
17
|
-
import { t as OptionsRepository } from "../options-
|
|
18
|
-
import { r as createSiteInfo } from "../context-
|
|
19
|
-
import "../menus-
|
|
20
|
-
import "../redirect-
|
|
11
|
+
import { t as ContentMutationConflictError } from "../types-Cd8iuS1J.mjs";
|
|
12
|
+
import { t as MediaRepository } from "../media-BP7S-nHT.mjs";
|
|
13
|
+
import "../user-DBrq4UVq.mjs";
|
|
14
|
+
import "../taxonomy-pOrB2kZe.mjs";
|
|
15
|
+
import "../comment-BIkJ6Fil.mjs";
|
|
16
|
+
import { t as OptionsRepository } from "../options-CBXIHUoT.mjs";
|
|
17
|
+
import { r as createSiteInfo } from "../context-C_1nrqnW.mjs";
|
|
18
|
+
import "../menus-BcQWxeXu.mjs";
|
|
19
|
+
import "../redirect-DIJxXKOG.mjs";
|
|
21
20
|
import { i as setRequestCacheEntry, r as requestCached } from "../request-cache-BSUptuJR.mjs";
|
|
22
|
-
import "../byline-registry-
|
|
21
|
+
import "../byline-registry-ZkPKqEwC.mjs";
|
|
23
22
|
import { n as initWithLock, t as createInitLock } from "../init-lock-DJkX6Hto.mjs";
|
|
24
|
-
import "../field-defs-cache-
|
|
25
|
-
import "../byline-
|
|
26
|
-
import "../relation-
|
|
23
|
+
import "../field-defs-cache-WD82dMQq.mjs";
|
|
24
|
+
import "../byline-Cp6csL84.mjs";
|
|
25
|
+
import "../relation-Cbe3Sd3m.mjs";
|
|
27
26
|
import { n as normalizeMediaValue } from "../normalize-C-SHXmra.mjs";
|
|
28
27
|
import "../enrich-CFJJgxs_.mjs";
|
|
29
|
-
import "../seo-
|
|
30
|
-
import { t as
|
|
31
|
-
import "../
|
|
28
|
+
import "../seo-DTHRntNC.mjs";
|
|
29
|
+
import { r as singleFlightCached, t as createSingleFlightCache } from "../single-flight-cache-DW3w11Pu.mjs";
|
|
30
|
+
import "../cache-C9FptTFR.mjs";
|
|
31
|
+
import { t as FTSManager } from "../fts-manager-BITakW_R.mjs";
|
|
32
|
+
import "../resolve-DZzG4HqM.mjs";
|
|
32
33
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
33
|
-
import {
|
|
34
|
-
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-
|
|
35
|
-
import { $ as
|
|
36
|
-
import "../dashboard-
|
|
37
|
-
import { r as hashString } from "../hash-
|
|
38
|
-
import { a as findNonTranslatableSiblingContentIds, c as refreshContentMediaUsageAfterWrite, o as markContentMediaUsageCollectionStale, r as deleteContentMediaUsage } from "../content-refresh-
|
|
39
|
-
import "../media-usage-
|
|
40
|
-
import { n as SchemaRegistry } from "../registry-
|
|
41
|
-
import "../query-
|
|
42
|
-
import "../zod-generator-
|
|
43
|
-
import "../schema-
|
|
44
|
-
import "../seo-
|
|
45
|
-
import { t as PluginStateRepository } from "../state-
|
|
46
|
-
import "../sections-
|
|
47
|
-
import {
|
|
48
|
-
import
|
|
49
|
-
import "../
|
|
50
|
-
import "../
|
|
51
|
-
import
|
|
52
|
-
import "../
|
|
53
|
-
import "../
|
|
54
|
-
import "../
|
|
55
|
-
import "../
|
|
56
|
-
import "../
|
|
57
|
-
import "../
|
|
58
|
-
import "../
|
|
59
|
-
import "../
|
|
60
|
-
import
|
|
61
|
-
import "../
|
|
62
|
-
import { t as
|
|
63
|
-
import
|
|
64
|
-
import "../
|
|
65
|
-
import {
|
|
66
|
-
import
|
|
67
|
-
import "../
|
|
68
|
-
import "../
|
|
69
|
-
import "../
|
|
70
|
-
import "../
|
|
71
|
-
import "../
|
|
72
|
-
import "../
|
|
73
|
-
import
|
|
74
|
-
import "../
|
|
75
|
-
import "../
|
|
76
|
-
import "../
|
|
77
|
-
import "../search-CeO678cp.mjs";
|
|
34
|
+
import { o as getDb } from "../loader-CGugY7Zl.mjs";
|
|
35
|
+
import { a as getTaxonomyDefs, o as getTaxonomyTerms } from "../taxonomies-CLN1N92E.mjs";
|
|
36
|
+
import { $ as handleContentDelete, B as handleMediaDelete, G as handleRevisionList, H as handleMediaList, J as handleContentAuthors, K as handleRevisionRestore, Q as handleContentCreate, U as handleMediaUpdate, V as handleMediaGet, W as handleRevisionGet, X as handleContentCountScheduled, Y as handleContentCompare, Z as handleContentCountTrashed, _ as loadBundleFromR2, at as handleContentListTrashed, ct as handleContentRestore, dt as handleContentUnpublish, et as handleContentDiscardDraft, ft as handleContentUnschedule, it as handleContentList, lt as handleContentSchedule, mt as validateRev, nt as handleContentGet, ot as handleContentPermanentDelete, pt as handleContentUpdate, rt as handleContentGetIncludingTrashed, s as normalizeRegistryConfig, st as handleContentPublish, tt as handleContentDuplicate, ut as handleContentTranslations, v as syncDeclaredStorageIndexes, z as handleMediaCreate } from "../api-D2hunekQ.mjs";
|
|
37
|
+
import "../dashboard-DINnNVVU.mjs";
|
|
38
|
+
import { r as hashString } from "../hash-Cg0TXJPV.mjs";
|
|
39
|
+
import { a as findNonTranslatableSiblingContentIds, c as refreshContentMediaUsageAfterWrite, g as MediaUsageRepository, o as markContentMediaUsageCollectionStale, r as deleteContentMediaUsage } from "../content-refresh-Xw7aKmou.mjs";
|
|
40
|
+
import "../media-usage-BlxfTkN0.mjs";
|
|
41
|
+
import { n as SchemaRegistry } from "../registry-Dbodb4Uo.mjs";
|
|
42
|
+
import "../query-rC9HKv1N.mjs";
|
|
43
|
+
import "../zod-generator-CG64Hnbh.mjs";
|
|
44
|
+
import "../schema-CiQXr6_F.mjs";
|
|
45
|
+
import "../seo-CobNfOvb.mjs";
|
|
46
|
+
import { t as PluginStateRepository } from "../state-CQvoefYP.mjs";
|
|
47
|
+
import "../sections-BrIrMUCn.mjs";
|
|
48
|
+
import { i as getSiteSettings, o as invalidateSiteSettingsCache } from "../settings-kJhGiQ4z.mjs";
|
|
49
|
+
import "../settings-DPHau-WH.mjs";
|
|
50
|
+
import "../taxonomies-CKuaZER5.mjs";
|
|
51
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-Da7kj23y.mjs";
|
|
52
|
+
import "../types-DKuWPYV5.mjs";
|
|
53
|
+
import "../ssrf-CTa6v21i.mjs";
|
|
54
|
+
import "../error-oh_9i6bR.mjs";
|
|
55
|
+
import "../parse-CJKNuewM.mjs";
|
|
56
|
+
import "../media-OhYL-7Io.mjs";
|
|
57
|
+
import "../redirects-G8wAhWAf.mjs";
|
|
58
|
+
import "../relations-Bw_E1TXo.mjs";
|
|
59
|
+
import "../status-CIsmlC1E.mjs";
|
|
60
|
+
import { a as invalidateUrlPatternCache } from "../query-C5w7PsRQ.mjs";
|
|
61
|
+
import "../import-C-9uqyT3.mjs";
|
|
62
|
+
import { t as getTrustedProxyHeaders } from "../trusted-proxy-D20_7fyX.mjs";
|
|
63
|
+
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-Df-jFbAd.mjs";
|
|
64
|
+
import "../ssrf-Cj568Dgs.mjs";
|
|
65
|
+
import { n as CronExecutor } from "../cron-DRV-UC4K.mjs";
|
|
66
|
+
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-C6WdcWbL.mjs";
|
|
67
|
+
import "../utils-hLzi_2Fn.mjs";
|
|
68
|
+
import "../tokens-DagaJGK8.mjs";
|
|
69
|
+
import "../preview-BU6PaLpM.mjs";
|
|
70
|
+
import "../hreflang-BdZuVBhL.mjs";
|
|
71
|
+
import "../comment-reaction-D-laEceb.mjs";
|
|
72
|
+
import "../bylines-CEj5CdT4.mjs";
|
|
73
|
+
import { n as getWidgetAreas } from "../widgets-CJJtkiKh.mjs";
|
|
74
|
+
import "../validate-mKo3RxBM.mjs";
|
|
75
|
+
import "../apply-kwNEJW2l.mjs";
|
|
76
|
+
import "../load-DV1DZuUJ.mjs";
|
|
77
|
+
import "../search-FZhx5dDU.mjs";
|
|
78
78
|
import "../index.mjs";
|
|
79
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
80
|
-
import { t as getAuthMode } from "../mode-
|
|
81
|
-
import "../snapshot-
|
|
82
|
-
import { u as maybeRunScheduledBackup } from "../backup-
|
|
83
|
-
import { t as cleanupExpiredChallenges } from "../challenge-store-
|
|
84
|
-
import { t as removeUploadAttempt } from "../upload-attempts-
|
|
85
|
-
import { a as validateEncryptionKeyAtStartup } from "../secrets-
|
|
86
|
-
import {
|
|
79
|
+
import { n as VERSION, t as COMMIT } from "../version-C4PnpmoV.mjs";
|
|
80
|
+
import { t as getAuthMode } from "../mode-BWyTBe3I.mjs";
|
|
81
|
+
import "../snapshot-I_fjLDaD.mjs";
|
|
82
|
+
import { u as maybeRunScheduledBackup } from "../backup-CtA6LDNw.mjs";
|
|
83
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-D9VNKELo.mjs";
|
|
84
|
+
import { t as removeUploadAttempt } from "../upload-attempts-D8QAFLUJ.mjs";
|
|
85
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-DLd8RXee.mjs";
|
|
86
|
+
import { isRecord } from "../plugin-utils.mjs";
|
|
87
|
+
import { t as resolveSessionUser } from "../session-user-BvM9-zNl.mjs";
|
|
87
88
|
import { Kysely, sql } from "kysely";
|
|
88
89
|
import { z } from "zod";
|
|
89
90
|
import { Permissions } from "@emdash-cms/auth";
|
|
@@ -153,6 +154,34 @@ function createSandboxRunnerOptions(options, siteInfo) {
|
|
|
153
154
|
};
|
|
154
155
|
}
|
|
155
156
|
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/media/usage/gc.ts
|
|
159
|
+
/**
|
|
160
|
+
* Only rows older than this are collected. Guarded writers insert occurrence
|
|
161
|
+
* rows before winning the source CAS, so the window must exceed any plausible
|
|
162
|
+
* in-flight write; mirrors the pending-upload abandonment window.
|
|
163
|
+
*/
|
|
164
|
+
const GC_MAX_AGE_MS = 3600 * 1e3;
|
|
165
|
+
/**
|
|
166
|
+
* Per-tick cap on rows considered by each GC method, so a large backlog is
|
|
167
|
+
* amortized across ticks instead of one oversized batch (D1 bind limits).
|
|
168
|
+
*/
|
|
169
|
+
const GC_BATCH_LIMIT = 500;
|
|
170
|
+
/**
|
|
171
|
+
* Delete media-usage occurrence rows that can no longer be read: superseded
|
|
172
|
+
* generations, generations abandoned by losing CAS writers, and occurrences
|
|
173
|
+
* whose source row is gone.
|
|
174
|
+
*/
|
|
175
|
+
async function cleanupMediaUsageGenerations(db) {
|
|
176
|
+
const cutoff = new Date(Date.now() - GC_MAX_AGE_MS).toISOString();
|
|
177
|
+
const repo = new MediaUsageRepository(db);
|
|
178
|
+
return {
|
|
179
|
+
staleGenerations: await repo.deleteStaleGenerationsOlderThan(cutoff, GC_BATCH_LIMIT),
|
|
180
|
+
abandonedGenerations: await repo.deleteAbandonedGenerationsOlderThan(cutoff, GC_BATCH_LIMIT),
|
|
181
|
+
orphanOccurrences: await repo.deleteOrphanOccurrencesOlderThan(cutoff, GC_BATCH_LIMIT)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
156
185
|
//#endregion
|
|
157
186
|
//#region src/cleanup.ts
|
|
158
187
|
/**
|
|
@@ -165,15 +194,13 @@ function createSandboxRunnerOptions(options, siteInfo) {
|
|
|
165
194
|
* Each subsystem cleanup is independent and non-fatal -- if one fails, the
|
|
166
195
|
* rest still run. Failures are logged but never surface to callers.
|
|
167
196
|
*/
|
|
168
|
-
/** Max revisions to keep per entry during periodic pruning */
|
|
169
197
|
const REVISION_KEEP_COUNT = 50;
|
|
170
|
-
|
|
171
|
-
const REVISION_PRUNE_THRESHOLD = REVISION_KEEP_COUNT;
|
|
198
|
+
const REVISION_PRUNE_BATCH_SIZE = 10;
|
|
172
199
|
/**
|
|
173
200
|
* Run all system cleanup tasks.
|
|
174
201
|
*
|
|
175
|
-
* Safe to call frequently -- each
|
|
176
|
-
*
|
|
202
|
+
* Safe to call frequently -- each subsystem tolerates repeated calls, and
|
|
203
|
+
* repeated calls with nothing to clean are cheap.
|
|
177
204
|
*
|
|
178
205
|
* @param db - The database instance
|
|
179
206
|
* @param storage - Optional storage backend for deleting orphaned files.
|
|
@@ -187,7 +214,10 @@ async function runSystemCleanup(db, storage) {
|
|
|
187
214
|
pendingUploads: -1,
|
|
188
215
|
pendingUploadFiles: -1,
|
|
189
216
|
uploadAttempts: -1,
|
|
190
|
-
revisionsPruned: -1
|
|
217
|
+
revisionsPruned: -1,
|
|
218
|
+
mediaUsageStaleGenerations: -1,
|
|
219
|
+
mediaUsageAbandonedGenerations: -1,
|
|
220
|
+
mediaUsageOrphanOccurrences: -1
|
|
191
221
|
};
|
|
192
222
|
try {
|
|
193
223
|
result.challenges = await cleanupExpiredChallenges(db);
|
|
@@ -230,29 +260,26 @@ async function runSystemCleanup(db, storage) {
|
|
|
230
260
|
console.error("[cleanup] Failed to clean media upload attempts:", error);
|
|
231
261
|
}
|
|
232
262
|
try {
|
|
233
|
-
result.revisionsPruned = await
|
|
263
|
+
result.revisionsPruned = await pruneQueuedRevisions(db);
|
|
234
264
|
} catch (error) {
|
|
235
265
|
console.error("[cleanup] Failed to prune revisions:", error);
|
|
236
266
|
}
|
|
267
|
+
try {
|
|
268
|
+
const usage = await cleanupMediaUsageGenerations(db);
|
|
269
|
+
result.mediaUsageStaleGenerations = usage.staleGenerations;
|
|
270
|
+
result.mediaUsageAbandonedGenerations = usage.abandonedGenerations;
|
|
271
|
+
result.mediaUsageOrphanOccurrences = usage.orphanOccurrences;
|
|
272
|
+
} catch (error) {
|
|
273
|
+
console.error("[cleanup] Failed to clean media-usage generations:", error);
|
|
274
|
+
}
|
|
237
275
|
return result;
|
|
238
276
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
* them down to REVISION_KEEP_COUNT.
|
|
242
|
-
*/
|
|
243
|
-
async function pruneExcessiveRevisions(db) {
|
|
244
|
-
const entries = await sql`
|
|
245
|
-
SELECT collection, entry_id
|
|
246
|
-
FROM revisions
|
|
247
|
-
GROUP BY collection, entry_id
|
|
248
|
-
HAVING COUNT(*) > ${REVISION_PRUNE_THRESHOLD}
|
|
249
|
-
`.execute(db);
|
|
250
|
-
if (entries.rows.length === 0) return 0;
|
|
277
|
+
async function pruneQueuedRevisions(db) {
|
|
278
|
+
const queued = await db.selectFrom("_emdash_revision_prune_queue").selectAll().orderBy("revision_id").limit(REVISION_PRUNE_BATCH_SIZE).execute();
|
|
251
279
|
const revisionRepo = new RevisionRepository(db);
|
|
252
280
|
let totalPruned = 0;
|
|
253
|
-
for (const row of
|
|
254
|
-
|
|
255
|
-
totalPruned += pruned;
|
|
281
|
+
for (const row of queued) try {
|
|
282
|
+
totalPruned += await revisionRepo.pruneQueuedEntry(row.collection, row.entry_id, row.revision_id, REVISION_KEEP_COUNT);
|
|
256
283
|
} catch (error) {
|
|
257
284
|
console.error(`[cleanup] Failed to prune revisions for ${row.collection}/${row.entry_id}:`, error);
|
|
258
285
|
}
|
|
@@ -330,7 +357,8 @@ async function publishDueContent(db, options = {}) {
|
|
|
330
357
|
const publishedAt = item.publishedAt == null ? item.scheduledAt ?? void 0 : void 0;
|
|
331
358
|
const result = await doPublish(collection.slug, item.id, {
|
|
332
359
|
publishedAt,
|
|
333
|
-
requireScheduledDue: true
|
|
360
|
+
requireScheduledDue: true,
|
|
361
|
+
expectedScheduledAt: item.scheduledAt ?? void 0
|
|
334
362
|
});
|
|
335
363
|
if (result.success) batch.push({
|
|
336
364
|
collection: collection.slug,
|
|
@@ -440,6 +468,7 @@ const DRAFT_ONLY_UPDATE_KEYS = new Set([
|
|
|
440
468
|
"locale",
|
|
441
469
|
"skipRevision"
|
|
442
470
|
]);
|
|
471
|
+
const MAX_DRAFT_STAGE_ATTEMPTS = 32;
|
|
443
472
|
/**
|
|
444
473
|
* Convert a ContentItem to Record<string, unknown> for hook consumption.
|
|
445
474
|
* Hooks receive the full item as a flat record.
|
|
@@ -574,6 +603,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
574
603
|
/** All plugins eligible for the hook pipeline (includes built-in plugins).
|
|
575
604
|
* Stored so we can rebuild the pipeline when plugins are enabled/disabled. */
|
|
576
605
|
allPipelinePlugins;
|
|
606
|
+
/** Guards the once-per-process plugin storage-index sync. */
|
|
607
|
+
storageIndexesSynced = false;
|
|
577
608
|
/** Factory options for the hook pipeline context factory */
|
|
578
609
|
pipelineFactoryOptions;
|
|
579
610
|
/** Dependencies needed for exclusive hook resolution */
|
|
@@ -675,10 +706,26 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
675
706
|
} catch (error) {
|
|
676
707
|
console.error("[cleanup] System cleanup failed:", error);
|
|
677
708
|
}
|
|
709
|
+
try {
|
|
710
|
+
await this.syncPluginStorageIndexesOnce();
|
|
711
|
+
} catch (error) {
|
|
712
|
+
console.error("[plugins] Storage index sync failed:", error);
|
|
713
|
+
}
|
|
678
714
|
await maybeRunScheduledBackup(this.db, this.storage ?? void 0);
|
|
679
715
|
return { published };
|
|
680
716
|
}
|
|
681
717
|
/**
|
|
718
|
+
* Materialize plugin-declared storage indexes, once per process.
|
|
719
|
+
*
|
|
720
|
+
* Called from the scheduler path, not from request handlers — configured
|
|
721
|
+
* plugins have no install handler, so the tick is their only sync moment.
|
|
722
|
+
*/
|
|
723
|
+
async syncPluginStorageIndexesOnce() {
|
|
724
|
+
if (this.storageIndexesSynced) return;
|
|
725
|
+
this.storageIndexesSynced = true;
|
|
726
|
+
await syncDeclaredStorageIndexes(this.db, [...this.allPipelinePlugins, ...marketplaceManifestCache.values()]);
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
682
729
|
* Stop the cron scheduler gracefully.
|
|
683
730
|
* Call during worker shutdown or hot-reload.
|
|
684
731
|
*/
|
|
@@ -819,7 +866,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
819
866
|
id: bundle.manifest.id,
|
|
820
867
|
version: bundle.manifest.version,
|
|
821
868
|
admin: bundle.manifest.admin,
|
|
822
|
-
mcp: bundle.manifest.mcp
|
|
869
|
+
mcp: bundle.manifest.mcp,
|
|
870
|
+
storage: bundle.manifest.storage
|
|
823
871
|
});
|
|
824
872
|
if (bundle.manifest.routes.length > 0) {
|
|
825
873
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
@@ -904,7 +952,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
904
952
|
id: bundle.manifest.id,
|
|
905
953
|
version: bundle.manifest.version,
|
|
906
954
|
admin: bundle.manifest.admin,
|
|
907
|
-
mcp: bundle.manifest.mcp
|
|
955
|
+
mcp: bundle.manifest.mcp,
|
|
956
|
+
storage: bundle.manifest.storage
|
|
908
957
|
});
|
|
909
958
|
if (bundle.manifest.routes.length > 0) {
|
|
910
959
|
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
@@ -1047,9 +1096,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1047
1096
|
const seedHolder = getSeedHolder();
|
|
1048
1097
|
try {
|
|
1049
1098
|
await initWithLock(seedHolder.lock, () => seedHolder.done.has(seedKey) ? true : void 0, async () => {
|
|
1050
|
-
const { applySeed } = await import("../apply-
|
|
1051
|
-
const { loadSeed } = await import("../load-
|
|
1052
|
-
const { validateSeed } = await import("../validate-
|
|
1099
|
+
const { applySeed } = await import("../apply-kwNEJW2l.mjs").then((n) => n.n);
|
|
1100
|
+
const { loadSeed } = await import("../load-DV1DZuUJ.mjs").then((n) => n.r);
|
|
1101
|
+
const { validateSeed } = await import("../validate-mKo3RxBM.mjs").then((n) => n.n);
|
|
1053
1102
|
const seed = await loadSeed();
|
|
1054
1103
|
if (validateSeed(seed).valid) {
|
|
1055
1104
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -1192,6 +1241,11 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1192
1241
|
} catch (error) {
|
|
1193
1242
|
console.error("[cleanup] System cleanup failed:", error);
|
|
1194
1243
|
}
|
|
1244
|
+
try {
|
|
1245
|
+
await runtimeRef.current?.syncPluginStorageIndexesOnce();
|
|
1246
|
+
} catch (error) {
|
|
1247
|
+
console.error("[plugins] Storage index sync failed:", error);
|
|
1248
|
+
}
|
|
1195
1249
|
await maybeRunScheduledBackup(db, storage ?? void 0);
|
|
1196
1250
|
});
|
|
1197
1251
|
scheduler.start();
|
|
@@ -1379,14 +1433,22 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1379
1433
|
capabilities: entry.capabilities ?? [],
|
|
1380
1434
|
allowedHosts: entry.allowedHosts ?? [],
|
|
1381
1435
|
storage: entry.storage ?? {},
|
|
1382
|
-
hooks: [],
|
|
1383
|
-
routes: [],
|
|
1436
|
+
hooks: entry.hooks ?? [],
|
|
1437
|
+
routes: entry.routes ?? [],
|
|
1384
1438
|
admin: {},
|
|
1385
1439
|
mcp: entry.mcp
|
|
1386
1440
|
};
|
|
1387
1441
|
const plugin = await sandboxRunner.load(manifest, entry.code);
|
|
1388
1442
|
sandboxedPluginCache.set(pluginKey, plugin);
|
|
1389
1443
|
console.log(`EmDash: Loaded sandboxed plugin ${pluginKey} with capabilities: [${manifest.capabilities.join(", ")}]`);
|
|
1444
|
+
if (manifest.routes.length > 0) {
|
|
1445
|
+
const routeMetaMap = /* @__PURE__ */ new Map();
|
|
1446
|
+
for (const routeEntry of manifest.routes) {
|
|
1447
|
+
const normalized = normalizeManifestRoute(routeEntry);
|
|
1448
|
+
routeMetaMap.set(normalized.name, buildRouteMeta(normalized));
|
|
1449
|
+
}
|
|
1450
|
+
sandboxedRouteMetaCache.set(entry.id, routeMetaMap);
|
|
1451
|
+
} else sandboxedRouteMetaCache.delete(entry.id);
|
|
1390
1452
|
} catch (error) {
|
|
1391
1453
|
console.error(`EmDash: Failed to load sandboxed plugin ${entry.id}:`, error);
|
|
1392
1454
|
}
|
|
@@ -1443,7 +1505,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1443
1505
|
id: bundle.manifest.id,
|
|
1444
1506
|
version: bundle.manifest.version,
|
|
1445
1507
|
admin: bundle.manifest.admin,
|
|
1446
|
-
mcp: bundle.manifest.mcp
|
|
1508
|
+
mcp: bundle.manifest.mcp,
|
|
1509
|
+
storage: bundle.manifest.storage
|
|
1447
1510
|
});
|
|
1448
1511
|
if (bundle.manifest.routes.length > 0) {
|
|
1449
1512
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
@@ -1493,7 +1556,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1493
1556
|
id: bundle.manifest.id,
|
|
1494
1557
|
version: bundle.manifest.version,
|
|
1495
1558
|
admin: bundle.manifest.admin,
|
|
1496
|
-
mcp: bundle.manifest.mcp
|
|
1559
|
+
mcp: bundle.manifest.mcp,
|
|
1560
|
+
storage: bundle.manifest.storage
|
|
1497
1561
|
});
|
|
1498
1562
|
if (bundle.manifest.routes.length > 0) {
|
|
1499
1563
|
const routeMeta = /* @__PURE__ */ new Map();
|
|
@@ -1615,6 +1679,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1615
1679
|
supports: collection.supports || [],
|
|
1616
1680
|
hasSeo: collection.hasSeo,
|
|
1617
1681
|
urlPattern: collection.urlPattern,
|
|
1682
|
+
...collection.hidden ? { hidden: true } : {},
|
|
1618
1683
|
fields
|
|
1619
1684
|
};
|
|
1620
1685
|
}
|
|
@@ -1809,7 +1874,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1809
1874
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1810
1875
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1811
1876
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1812
|
-
const { validateContentData } = await import("../validation-
|
|
1877
|
+
const { validateContentData } = await import("../validation-BgpucsvF.mjs");
|
|
1813
1878
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1814
1879
|
if (!validation.ok) return {
|
|
1815
1880
|
success: false,
|
|
@@ -1826,7 +1891,6 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1826
1891
|
return result;
|
|
1827
1892
|
}
|
|
1828
1893
|
async handleContentUpdate(collection, id, body) {
|
|
1829
|
-
const { ContentRepository } = await import("../content-CpfKV9QE.mjs").then((n) => n.n);
|
|
1830
1894
|
const repo = new ContentRepository(this.db);
|
|
1831
1895
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1832
1896
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1853,7 +1917,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1853
1917
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1854
1918
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1855
1919
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1856
|
-
const { validateContentData } = await import("../validation-
|
|
1920
|
+
const { validateContentData } = await import("../validation-BgpucsvF.mjs");
|
|
1857
1921
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1858
1922
|
if (!validation.ok) return {
|
|
1859
1923
|
success: false,
|
|
@@ -1862,12 +1926,12 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1862
1926
|
}
|
|
1863
1927
|
let usesDraftRevisions = false;
|
|
1864
1928
|
let draftStorageChanged = false;
|
|
1865
|
-
if (processedData)
|
|
1929
|
+
if (processedData) {
|
|
1866
1930
|
if ((await this.schemaRegistry.getCollectionWithFields(collection))?.supports?.includes("revisions")) {
|
|
1867
1931
|
usesDraftRevisions = true;
|
|
1868
1932
|
const revisionRepo = new RevisionRepository(this.db);
|
|
1869
|
-
|
|
1870
|
-
|
|
1933
|
+
let existing = await repo.findById(collection, resolvedId);
|
|
1934
|
+
for (let attempt = 0; existing && attempt < MAX_DRAFT_STAGE_ATTEMPTS; attempt++) {
|
|
1871
1935
|
let baseData;
|
|
1872
1936
|
if (existing.draftRevisionId) baseData = (await revisionRepo.findById(existing.draftRevisionId))?.data ?? existing.data;
|
|
1873
1937
|
else baseData = existing.data;
|
|
@@ -1876,37 +1940,64 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1876
1940
|
...processedData
|
|
1877
1941
|
};
|
|
1878
1942
|
if (bodyWithoutRev.slug !== void 0) mergedData._slug = bodyWithoutRev.slug;
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1943
|
+
const revision = await revisionRepo.create({
|
|
1944
|
+
collection,
|
|
1945
|
+
entryId: resolvedId,
|
|
1946
|
+
data: mergedData,
|
|
1947
|
+
authorId: bodyWithoutRev.authorId ?? void 0
|
|
1948
|
+
});
|
|
1949
|
+
let staged;
|
|
1950
|
+
try {
|
|
1951
|
+
staged = await repo.replaceDraftRevision(collection, resolvedId, revision.id, existing);
|
|
1952
|
+
} catch (error) {
|
|
1953
|
+
try {
|
|
1954
|
+
await revisionRepo.deleteIfUnreferenced(collection, resolvedId, revision.id);
|
|
1955
|
+
} catch (cleanupError) {
|
|
1956
|
+
console.error(`[emdash] Failed to clean up unstaged revision ${revision.id}:`, cleanupError);
|
|
1957
|
+
}
|
|
1958
|
+
throw error;
|
|
1959
|
+
}
|
|
1960
|
+
if (!staged) {
|
|
1961
|
+
try {
|
|
1962
|
+
await revisionRepo.deleteIfUnreferenced(collection, resolvedId, revision.id);
|
|
1963
|
+
} catch (cleanupError) {
|
|
1964
|
+
console.error(`[emdash] Failed to clean up unstaged revision ${revision.id}:`, cleanupError);
|
|
1965
|
+
}
|
|
1966
|
+
if (body._rev || attempt === MAX_DRAFT_STAGE_ATTEMPTS - 1) return {
|
|
1967
|
+
success: false,
|
|
1968
|
+
error: {
|
|
1969
|
+
code: "CONFLICT",
|
|
1970
|
+
message: new ContentMutationConflictError().message
|
|
1971
|
+
}
|
|
1972
|
+
};
|
|
1973
|
+
existing = await repo.findById(collection, resolvedId);
|
|
1974
|
+
continue;
|
|
1898
1975
|
}
|
|
1976
|
+
draftStorageChanged = true;
|
|
1977
|
+
if (bodyWithoutRev.skipRevision && existing.draftRevisionId) try {
|
|
1978
|
+
await revisionRepo.deleteIfUnreferenced(collection, resolvedId, existing.draftRevisionId);
|
|
1979
|
+
} catch (error) {
|
|
1980
|
+
console.error(`[emdash] Failed to clean up superseded revision ${existing.draftRevisionId}:`, error);
|
|
1981
|
+
}
|
|
1982
|
+
else after(async () => {
|
|
1983
|
+
try {
|
|
1984
|
+
await revisionRepo.pruneQueuedEntry(collection, resolvedId, revision.id, 50);
|
|
1985
|
+
} catch (error) {
|
|
1986
|
+
console.error(`[revisions] Failed to prune revisions for ${collection}/${resolvedId}:`, error);
|
|
1987
|
+
}
|
|
1988
|
+
});
|
|
1989
|
+
break;
|
|
1899
1990
|
}
|
|
1900
1991
|
}
|
|
1901
|
-
}
|
|
1902
|
-
const
|
|
1992
|
+
}
|
|
1993
|
+
const liveMetaTouched = Object.entries(bodyWithoutRev).some(([key, value]) => value !== void 0 && !DRAFT_ONLY_UPDATE_KEYS.has(key));
|
|
1994
|
+
const result = usesDraftRevisions && !liveMetaTouched ? await handleContentGet(this.db, collection, resolvedId) : await handleContentUpdate(this.db, collection, resolvedId, {
|
|
1903
1995
|
...bodyWithoutRev,
|
|
1904
1996
|
data: usesDraftRevisions ? void 0 : processedData,
|
|
1905
1997
|
slug: usesDraftRevisions ? void 0 : bodyWithoutRev.slug,
|
|
1906
1998
|
authorId: bodyWithoutRev.authorId,
|
|
1907
1999
|
bylines: bodyWithoutRev.bylines
|
|
1908
2000
|
});
|
|
1909
|
-
const liveMetaTouched = Object.entries(bodyWithoutRev).some(([key, value]) => value !== void 0 && !DRAFT_ONLY_UPDATE_KEYS.has(key));
|
|
1910
2001
|
const liveContentChanged = usesDraftRevisions ? liveMetaTouched : Boolean(processedData || bodyWithoutRev.slug !== void 0 || liveMetaTouched);
|
|
1911
2002
|
const hydrated = await this.hydrateDraftData(result);
|
|
1912
2003
|
if (hydrated.success && hydrated.data) {
|
|
@@ -2086,25 +2177,50 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2086
2177
|
return this.hydrateDraftData(result);
|
|
2087
2178
|
}
|
|
2088
2179
|
try {
|
|
2180
|
+
const contentRepo = new ContentRepository(this.db);
|
|
2181
|
+
const existing = await contentRepo.findById(revision.collection, revision.entryId);
|
|
2182
|
+
if (!existing) return {
|
|
2183
|
+
success: false,
|
|
2184
|
+
error: {
|
|
2185
|
+
code: "NOT_FOUND",
|
|
2186
|
+
message: `Content item not found: ${revision.entryId}`
|
|
2187
|
+
}
|
|
2188
|
+
};
|
|
2089
2189
|
const newDraft = await revisionRepo.create({
|
|
2090
2190
|
collection: revision.collection,
|
|
2091
2191
|
entryId: revision.entryId,
|
|
2092
2192
|
data: revision.data,
|
|
2093
2193
|
authorId: callerUserId
|
|
2094
2194
|
});
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2195
|
+
try {
|
|
2196
|
+
if (!await contentRepo.replaceDraftRevision(revision.collection, revision.entryId, newDraft.id, existing)) throw new ContentMutationConflictError();
|
|
2197
|
+
} catch (error) {
|
|
2198
|
+
try {
|
|
2199
|
+
await revisionRepo.deleteIfUnreferenced(revision.collection, revision.entryId, newDraft.id);
|
|
2200
|
+
} catch (cleanupError) {
|
|
2201
|
+
console.error(`[emdash] Failed to clean up unrestored revision ${newDraft.id}:`, cleanupError);
|
|
2202
|
+
}
|
|
2203
|
+
throw error;
|
|
2204
|
+
}
|
|
2205
|
+
after(async () => {
|
|
2206
|
+
try {
|
|
2207
|
+
await revisionRepo.pruneQueuedEntry(revision.collection, revision.entryId, newDraft.id, 50);
|
|
2208
|
+
} catch (error) {
|
|
2209
|
+
console.error(`[revisions] Failed to prune revisions for ${revision.collection}/${revision.entryId}:`, error);
|
|
2210
|
+
}
|
|
2211
|
+
});
|
|
2103
2212
|
const refetched = await handleContentGet(this.db, revision.collection, revision.entryId);
|
|
2104
2213
|
const hydrated = await this.hydrateDraftData(refetched);
|
|
2105
2214
|
if (hydrated.success) await this.refreshContentUsageAfterSuccessfulWrite(revision.collection, [revision.entryId]);
|
|
2106
2215
|
return hydrated;
|
|
2107
2216
|
} catch (error) {
|
|
2217
|
+
if (error instanceof ContentMutationConflictError) return {
|
|
2218
|
+
success: false,
|
|
2219
|
+
error: {
|
|
2220
|
+
code: "CONFLICT",
|
|
2221
|
+
message: error.message
|
|
2222
|
+
}
|
|
2223
|
+
};
|
|
2108
2224
|
console.error("[emdash] revision restore failed:", error);
|
|
2109
2225
|
return {
|
|
2110
2226
|
success: false,
|
|
@@ -2187,10 +2303,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2187
2303
|
});
|
|
2188
2304
|
routeRegistry.register(trustedPlugin);
|
|
2189
2305
|
const routeKey = path.replace(LEADING_SLASH_PATTERN, "");
|
|
2190
|
-
|
|
2191
|
-
try {
|
|
2192
|
-
body = await request.json();
|
|
2193
|
-
} catch {}
|
|
2306
|
+
const body = await parseRouteInput(request);
|
|
2194
2307
|
return routeRegistry.invoke(pluginId, routeKey, {
|
|
2195
2308
|
request,
|
|
2196
2309
|
body
|
|
@@ -2332,7 +2445,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2332
2445
|
}
|
|
2333
2446
|
if (!collectionInfo?.fields) return data;
|
|
2334
2447
|
const imageFields = collectionInfo.fields.filter((f) => f.type === "image" || f.type === "file");
|
|
2335
|
-
|
|
2448
|
+
const repeaterFields = collectionInfo.fields.filter((f) => f.type === "repeater" && Array.isArray(f.validation?.subFields));
|
|
2449
|
+
if (imageFields.length === 0 && repeaterFields.length === 0) return data;
|
|
2336
2450
|
const getProvider = (id) => this.getMediaProvider(id);
|
|
2337
2451
|
const result = { ...data };
|
|
2338
2452
|
for (const field of imageFields) {
|
|
@@ -2343,6 +2457,26 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2343
2457
|
if (normalized) result[field.slug] = normalized;
|
|
2344
2458
|
} catch {}
|
|
2345
2459
|
}
|
|
2460
|
+
for (const field of repeaterFields) {
|
|
2461
|
+
const value = result[field.slug];
|
|
2462
|
+
if (!Array.isArray(value)) continue;
|
|
2463
|
+
const mediaSubFieldSlugs = (field.validation?.subFields ?? []).filter((sub) => sub.type === "image").map((sub) => sub.slug);
|
|
2464
|
+
if (mediaSubFieldSlugs.length === 0) continue;
|
|
2465
|
+
const items = value;
|
|
2466
|
+
result[field.slug] = await Promise.all(items.map(async (item) => {
|
|
2467
|
+
if (!isRecord(item)) return item;
|
|
2468
|
+
const normalizedItem = { ...item };
|
|
2469
|
+
for (const slug of mediaSubFieldSlugs) {
|
|
2470
|
+
const subValue = normalizedItem[slug];
|
|
2471
|
+
if (subValue == null) continue;
|
|
2472
|
+
try {
|
|
2473
|
+
const normalized = await normalizeMediaValue(subValue, getProvider);
|
|
2474
|
+
if (normalized) normalizedItem[slug] = normalized;
|
|
2475
|
+
} catch {}
|
|
2476
|
+
}
|
|
2477
|
+
return normalizedItem;
|
|
2478
|
+
}));
|
|
2479
|
+
}
|
|
2346
2480
|
return result;
|
|
2347
2481
|
}
|
|
2348
2482
|
async runSandboxedBeforeSave(content, collection, isNew) {
|
|
@@ -2493,10 +2627,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
2493
2627
|
}
|
|
2494
2628
|
async handleSandboxedRoute(plugin, path, request) {
|
|
2495
2629
|
const routeName = path.replace(LEADING_SLASH_PATTERN, "");
|
|
2496
|
-
|
|
2497
|
-
try {
|
|
2498
|
-
body = await request.json();
|
|
2499
|
-
} catch {}
|
|
2630
|
+
const body = await parseRouteInput(request);
|
|
2500
2631
|
try {
|
|
2501
2632
|
const headers = sanitizeHeadersForSandbox(request.headers);
|
|
2502
2633
|
const meta = extractRequestMeta(request, this.config);
|
|
@@ -2629,6 +2760,26 @@ function createPublicMediaUrlResolver(storage) {
|
|
|
2629
2760
|
* middleware.ts.
|
|
2630
2761
|
*/
|
|
2631
2762
|
const ASTRO_COOKIES_SYMBOL = Symbol.for("astro.cookies");
|
|
2763
|
+
/** Hold the real adapter close behind both response and deferred-task completion. */
|
|
2764
|
+
function coordinateScopedDbLifecycle(scoped) {
|
|
2765
|
+
if (!scoped.close) return { lifecycle: scoped };
|
|
2766
|
+
const close = scoped.close;
|
|
2767
|
+
const deferredTasks = createDeferredTaskTracker(() => {
|
|
2768
|
+
try {
|
|
2769
|
+
close();
|
|
2770
|
+
} catch (error) {
|
|
2771
|
+
console.error("[emdash] request-scoped db close failed:", error);
|
|
2772
|
+
}
|
|
2773
|
+
});
|
|
2774
|
+
return {
|
|
2775
|
+
closed: deferredTasks.settled,
|
|
2776
|
+
deferredTasks,
|
|
2777
|
+
lifecycle: {
|
|
2778
|
+
commit: scoped.commit,
|
|
2779
|
+
close: deferredTasks.settle
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2782
|
+
}
|
|
2632
2783
|
/**
|
|
2633
2784
|
* Run a request-scoped db's `close()` once the response body has finished
|
|
2634
2785
|
* streaming. Astro streams HTML and components issue DB queries during that
|
|
@@ -2668,9 +2819,9 @@ function wrapResponseForScopedClose(response, close) {
|
|
|
2668
2819
|
* Run the request body under a request-scoped db, then settle its lifecycle:
|
|
2669
2820
|
* `commit()` runs before the response is returned (so per-request state like a
|
|
2670
2821
|
* D1 bookmark cookie is persisted in the headers, even if render throws), while
|
|
2671
|
-
* `close()` (if any) is deferred to
|
|
2672
|
-
* isn't torn down mid-render. On error
|
|
2673
|
-
* before rethrowing so it never leaks.
|
|
2822
|
+
* `close()` (if any) is deferred to lifecycle settlement so a
|
|
2823
|
+
* connection-backed adapter isn't torn down mid-render or mid-task. On error
|
|
2824
|
+
* the lifecycle is settled before rethrowing so it never leaks.
|
|
2674
2825
|
*
|
|
2675
2826
|
* On the error path both `commit()` and `close()` are defended: a throw from
|
|
2676
2827
|
* either is logged and swallowed so it can't replace the propagating render
|
|
@@ -3079,32 +3230,37 @@ async function runOutsideRequest(config, fn) {
|
|
|
3079
3230
|
config: config.database?.config,
|
|
3080
3231
|
isAuthenticated: false,
|
|
3081
3232
|
isWrite: true,
|
|
3233
|
+
canUseCachedBinding: false,
|
|
3082
3234
|
cookies: NOOP_COOKIE_JAR,
|
|
3083
3235
|
url: CRON_EVENT_URL
|
|
3084
3236
|
});
|
|
3085
3237
|
if (!scoped?.close) return fn(runtime);
|
|
3238
|
+
const { closed, deferredTasks, lifecycle } = coordinateScopedDbLifecycle(scoped);
|
|
3086
3239
|
const parent = getRequestContext();
|
|
3087
3240
|
const ctx = parent ? {
|
|
3088
3241
|
...parent,
|
|
3089
|
-
db: scoped.db
|
|
3242
|
+
db: scoped.db,
|
|
3243
|
+
deferredTasks
|
|
3090
3244
|
} : {
|
|
3091
3245
|
editMode: false,
|
|
3092
3246
|
db: scoped.db,
|
|
3093
|
-
metrics: createRequestMetrics(performance.now())
|
|
3247
|
+
metrics: createRequestMetrics(performance.now()),
|
|
3248
|
+
deferredTasks
|
|
3094
3249
|
};
|
|
3095
3250
|
try {
|
|
3096
3251
|
return await runWithContext(ctx, () => fn(runtime));
|
|
3097
3252
|
} finally {
|
|
3098
3253
|
try {
|
|
3099
|
-
|
|
3254
|
+
lifecycle.commit();
|
|
3100
3255
|
} catch (error) {
|
|
3101
3256
|
console.error("[emdash] event-scoped db commit failed:", error);
|
|
3102
3257
|
}
|
|
3103
3258
|
try {
|
|
3104
|
-
|
|
3259
|
+
lifecycle.close?.();
|
|
3105
3260
|
} catch (error) {
|
|
3106
3261
|
console.error("[emdash] event-scoped db close failed:", error);
|
|
3107
3262
|
}
|
|
3263
|
+
await closed;
|
|
3108
3264
|
}
|
|
3109
3265
|
}
|
|
3110
3266
|
/**
|
|
@@ -3220,6 +3376,9 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3220
3376
|
const hasSessionCookie = cookies.get("astro-session") !== void 0;
|
|
3221
3377
|
const sessionUser = context.isPrerendered || !hasSessionCookie ? null : await resolveSessionUser(context.session);
|
|
3222
3378
|
const hasBearerAuth = (request.headers.get("authorization") ?? "").toLowerCase().startsWith("bearer ");
|
|
3379
|
+
const isWrite = request.method !== "GET" && request.method !== "HEAD";
|
|
3380
|
+
const isAuthenticated = !!sessionUser || hasBearerAuth;
|
|
3381
|
+
const canUseCachedBinding = !isAuthenticated && !isWrite && !playgroundDb && !isEmDashRoute && !hasEditCookie && !hasPreviewToken;
|
|
3223
3382
|
if (!isEmDashRoute && !isPublicRuntimeRoute && !hasEditCookie && !hasPreviewToken) {
|
|
3224
3383
|
if (!sessionUser && !playgroundDb) {
|
|
3225
3384
|
const timings = [];
|
|
@@ -3227,7 +3386,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3227
3386
|
if (!isSetupVerified() && !context.isPrerendered) {
|
|
3228
3387
|
const t0 = performance.now();
|
|
3229
3388
|
try {
|
|
3230
|
-
const { getDb } = await import("../loader-
|
|
3389
|
+
const { getDb } = await import("../loader-CGugY7Zl.mjs").then((n) => n.s);
|
|
3231
3390
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
3232
3391
|
markSetupVerified();
|
|
3233
3392
|
} catch (error) {
|
|
@@ -3267,12 +3426,15 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3267
3426
|
});
|
|
3268
3427
|
for (const sub of initSubTimings) timings.push(sub);
|
|
3269
3428
|
}
|
|
3429
|
+
const lastContentWriteAt = canUseCachedBinding && config?.database?.needsLastContentWriteAt ? await getLastContentWriteAt() : void 0;
|
|
3270
3430
|
const anonScoped = createRequestScopedDb$1({
|
|
3271
3431
|
config: config?.database?.config,
|
|
3272
|
-
isAuthenticated
|
|
3273
|
-
isWrite
|
|
3432
|
+
isAuthenticated,
|
|
3433
|
+
isWrite,
|
|
3434
|
+
canUseCachedBinding,
|
|
3274
3435
|
cookies,
|
|
3275
|
-
url
|
|
3436
|
+
url,
|
|
3437
|
+
lastContentWriteAt
|
|
3276
3438
|
});
|
|
3277
3439
|
const runAnon = async () => {
|
|
3278
3440
|
const t0 = performance.now();
|
|
@@ -3291,19 +3453,22 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3291
3453
|
return wrapBodyForStreamMetrics(finalizeResponse(response, timings));
|
|
3292
3454
|
};
|
|
3293
3455
|
if (anonScoped) {
|
|
3456
|
+
const { deferredTasks, lifecycle } = coordinateScopedDbLifecycle(anonScoped);
|
|
3294
3457
|
const parent = getRequestContext();
|
|
3295
3458
|
const ctx = parent ? {
|
|
3296
3459
|
...parent,
|
|
3297
|
-
db: anonScoped.db
|
|
3460
|
+
db: anonScoped.db,
|
|
3461
|
+
deferredTasks
|
|
3298
3462
|
} : {
|
|
3299
3463
|
editMode: false,
|
|
3300
3464
|
db: anonScoped.db,
|
|
3301
|
-
metrics
|
|
3465
|
+
metrics,
|
|
3466
|
+
deferredTasks
|
|
3302
3467
|
};
|
|
3303
3468
|
const acceptsHtml = (request.headers.get("accept") ?? "").split(",", 1)[0].trim().startsWith("text/html");
|
|
3304
3469
|
return runWithContext(ctx, async () => {
|
|
3305
3470
|
if (acceptsHtml) after(() => prefetchLayoutData());
|
|
3306
|
-
return finishScoped(
|
|
3471
|
+
return finishScoped(lifecycle, runAnon);
|
|
3307
3472
|
});
|
|
3308
3473
|
}
|
|
3309
3474
|
return runAnon();
|
|
@@ -3391,12 +3556,15 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3391
3556
|
} catch (error) {
|
|
3392
3557
|
console.error("EmDash middleware error:", error);
|
|
3393
3558
|
}
|
|
3559
|
+
const lastContentWriteAt = canUseCachedBinding && config?.database?.needsLastContentWriteAt ? await getLastContentWriteAt() : void 0;
|
|
3394
3560
|
const scoped = createRequestScopedDb$1({
|
|
3395
3561
|
config: config?.database?.config,
|
|
3396
|
-
isAuthenticated
|
|
3397
|
-
isWrite
|
|
3562
|
+
isAuthenticated,
|
|
3563
|
+
isWrite,
|
|
3564
|
+
canUseCachedBinding,
|
|
3398
3565
|
cookies: context.cookies,
|
|
3399
|
-
url
|
|
3566
|
+
url,
|
|
3567
|
+
lastContentWriteAt
|
|
3400
3568
|
});
|
|
3401
3569
|
const renderAndFinalize = async () => {
|
|
3402
3570
|
const t0 = performance.now();
|
|
@@ -3415,15 +3583,18 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
3415
3583
|
return wrapBodyForStreamMetrics(finalizeResponse(response, timings));
|
|
3416
3584
|
};
|
|
3417
3585
|
if (scoped) {
|
|
3586
|
+
const { deferredTasks, lifecycle } = coordinateScopedDbLifecycle(scoped);
|
|
3418
3587
|
const parent = getRequestContext();
|
|
3419
3588
|
return runWithContext(parent ? {
|
|
3420
3589
|
...parent,
|
|
3421
|
-
db: scoped.db
|
|
3590
|
+
db: scoped.db,
|
|
3591
|
+
deferredTasks
|
|
3422
3592
|
} : {
|
|
3423
3593
|
editMode: false,
|
|
3424
3594
|
db: scoped.db,
|
|
3425
|
-
metrics
|
|
3426
|
-
|
|
3595
|
+
metrics,
|
|
3596
|
+
deferredTasks
|
|
3597
|
+
}, () => finishScoped(lifecycle, renderAndFinalize));
|
|
3427
3598
|
}
|
|
3428
3599
|
return renderAndFinalize();
|
|
3429
3600
|
};
|