emdash 0.18.0 → 0.20.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-C5AWLJSD.d.mts → adapters-BzIHV3sw.d.mts} +1 -1
- package/dist/{adapters-C5AWLJSD.d.mts.map → adapters-BzIHV3sw.d.mts.map} +1 -1
- package/dist/{allowed-origins-CyYLEJkp.mjs → allowed-origins-B1u7Qnvg.mjs} +2 -2
- package/dist/{allowed-origins-CyYLEJkp.mjs.map → allowed-origins-B1u7Qnvg.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +15 -15
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +3 -3
- package/dist/{api-Cs7DAACP.mjs → api-DStv36ik.mjs} +123 -20
- package/dist/api-DStv36ik.mjs.map +1 -0
- package/dist/{api-tokens-VrXNiNvV.mjs → api-tokens-DPfhPu5V.mjs} +2 -2
- package/dist/{api-tokens-VrXNiNvV.mjs.map → api-tokens-DPfhPu5V.mjs.map} +1 -1
- package/dist/{apply-BWMV4Zmw.mjs → apply-Dr7snAMT.mjs} +23 -23
- package/dist/apply-Dr7snAMT.mjs.map +1 -0
- package/dist/astro/index.d.mts +10 -10
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +115 -25
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +9 -9
- package/dist/astro/middleware/auth.mjs +6 -6
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +26 -4
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +242 -259
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
- 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 +8 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +8 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +8 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +12 -12
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +12 -12
- package/dist/astro/routes/api/admin/bylines/index.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +11 -11
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +8 -8
- 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/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 +34 -34
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +34 -34
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/index.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +34 -34
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +33 -33
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +34 -34
- package/dist/astro/routes/api/admin/plugins/updates.mjs +33 -33
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +33 -33
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +33 -33
- 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 +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +5 -5
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
- package/dist/astro/routes/api/auth/logout.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -8
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +6 -6
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- 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 +5 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/request.mjs +8 -8
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -8
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +12 -10
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +9 -8
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/authors.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/authors.mjs +19 -0
- package/dist/astro/routes/api/content/_collection_/authors.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/index.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +9 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +9 -9
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +29 -29
- package/dist/astro/routes/api/media/_id_/confirm.mjs +6 -6
- package/dist/astro/routes/api/media/_id_.mjs +6 -6
- 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 +7 -7
- package/dist/astro/routes/api/media.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_/items.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_/translations.mjs +7 -7
- package/dist/astro/routes/api/menus/_name_.mjs +7 -7
- package/dist/astro/routes/api/menus/index.mjs +7 -7
- 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 +8 -8
- package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
- 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 +17 -3
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +9 -9
- package/dist/astro/routes/api/redirects/404s/summary.mjs +9 -9
- package/dist/astro/routes/api/redirects/_id_.mjs +10 -10
- package/dist/astro/routes/api/redirects/index.mjs +10 -10
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +33 -33
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +33 -33
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +33 -33
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +33 -33
- package/dist/astro/routes/api/schema/collections/index.mjs +33 -33
- package/dist/astro/routes/api/schema/index.mjs +9 -14
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +33 -33
- package/dist/astro/routes/api/schema/orphans/index.mjs +33 -33
- package/dist/astro/routes/api/search/enable.mjs +9 -9
- package/dist/astro/routes/api/search/index.mjs +8 -8
- package/dist/astro/routes/api/search/rebuild.mjs +9 -9
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +8 -8
- package/dist/astro/routes/api/sections/_slug_.mjs +8 -8
- package/dist/astro/routes/api/sections/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings.mjs +12 -12
- package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
- package/dist/astro/routes/api/setup/admin.mjs +10 -10
- package/dist/astro/routes/api/setup/dev-bypass.mjs +23 -23
- package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
- package/dist/astro/routes/api/setup/index.mjs +23 -23
- package/dist/astro/routes/api/setup/status.mjs +4 -4
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +11 -11
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +11 -11
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +11 -11
- package/dist/astro/routes/api/taxonomies/index.mjs +11 -11
- package/dist/astro/routes/api/themes/preview.mjs +6 -6
- 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 +6 -6
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +6 -5
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -8
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +7 -7
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +16 -9
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +8 -8
- package/dist/astro/types.d.mts +19 -12
- 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-CotM4Yiu.mjs → authorize-DsMSVSaY.mjs} +2 -2
- package/dist/{authorize-CotM4Yiu.mjs.map → authorize-DsMSVSaY.mjs.map} +1 -1
- package/dist/{byline-CWQ9aSoz.mjs → byline-DUx48sJp.mjs} +6 -6
- package/dist/{byline-CWQ9aSoz.mjs.map → byline-DUx48sJp.mjs.map} +1 -1
- package/dist/{byline-fields-DC3Wkk-U.mjs → byline-fields--WxSNS79.mjs} +2 -2
- package/dist/{byline-fields-DC3Wkk-U.mjs.map → byline-fields--WxSNS79.mjs.map} +1 -1
- package/dist/{byline-fields-Dr-xcb6S.mjs → byline-fields-8TMtkBnH.mjs} +3 -3
- package/dist/{byline-fields-Dr-xcb6S.mjs.map → byline-fields-8TMtkBnH.mjs.map} +1 -1
- package/dist/{byline-fields-BNy7Ng1U.d.mts → byline-fields-DbibsvTl.d.mts} +30 -2
- package/dist/byline-fields-DbibsvTl.d.mts.map +1 -0
- package/dist/{byline-registry-CxK5g559.mjs → byline-registry-CWP7I71B.mjs} +3 -3
- package/dist/{byline-registry-CxK5g559.mjs.map → byline-registry-CWP7I71B.mjs.map} +1 -1
- package/dist/{bylines-LJMgENMI.mjs → bylines-BdxWCnPL.mjs} +3 -3
- package/dist/{bylines-LJMgENMI.mjs.map → bylines-BdxWCnPL.mjs.map} +1 -1
- package/dist/{bylines-BJSva1Un.mjs → bylines-s8c2DXbH.mjs} +50 -6
- package/dist/{bylines-BJSva1Un.mjs.map → bylines-s8c2DXbH.mjs.map} +1 -1
- package/dist/{cache-lZL7SgVb.mjs → cache-B_HzASVT.mjs} +3 -3
- package/dist/{cache-lZL7SgVb.mjs.map → cache-B_HzASVT.mjs.map} +1 -1
- package/dist/{challenge-store-DGwuCc4R.mjs → challenge-store-DXX3rfdI.mjs} +1 -1
- package/dist/{challenge-store-DGwuCc4R.mjs.map → challenge-store-DXX3rfdI.mjs.map} +1 -1
- package/dist/{chunks-BU-vP9Dh.mjs → chunks-BerYVuve.mjs} +2 -2
- package/dist/{chunks-BU-vP9Dh.mjs.map → chunks-BerYVuve.mjs.map} +1 -1
- package/dist/cli/index.mjs +46 -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 +1 -1
- package/dist/{comment-C4jVbCM8.mjs → comment-sqQxNpN3.mjs} +2 -2
- package/dist/{comment-C4jVbCM8.mjs.map → comment-sqQxNpN3.mjs.map} +1 -1
- package/dist/{comments-BTAbC0Ek.mjs → comments-Vkivawyl.mjs} +3 -3
- package/dist/{comments-BTAbC0Ek.mjs.map → comments-Vkivawyl.mjs.map} +1 -1
- package/dist/{components-CTfpu3PZ.mjs → components-CK0cuUoH.mjs} +1 -1
- package/dist/{components-CTfpu3PZ.mjs.map → components-CK0cuUoH.mjs.map} +1 -1
- package/dist/{content-CyqOmOzm.mjs → content-BIlVx-RX.mjs} +132 -43
- package/dist/content-BIlVx-RX.mjs.map +1 -0
- package/dist/{context-DZ7bEh5-.mjs → context-Y7BRkWes.mjs} +10 -10
- package/dist/{context-DZ7bEh5-.mjs.map → context-Y7BRkWes.mjs.map} +1 -1
- package/dist/{cron-DZovZUnC.mjs → cron-BJ2ClIlj.mjs} +4 -3
- package/dist/cron-BJ2ClIlj.mjs.map +1 -0
- package/dist/{dashboard-B5WQpNTP.mjs → dashboard-2JgAMWxK.mjs} +4 -4
- package/dist/{dashboard-B5WQpNTP.mjs.map → dashboard-2JgAMWxK.mjs.map} +1 -1
- package/dist/database/instrumentation.d.mts +10 -1
- package/dist/database/instrumentation.d.mts.map +1 -1
- package/dist/database/instrumentation.mjs +13 -1
- package/dist/database/instrumentation.mjs.map +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +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-xLFNSsZ9.mjs → default-IlBaTFxM.mjs} +1 -1
- package/dist/{default-xLFNSsZ9.mjs.map → default-IlBaTFxM.mjs.map} +1 -1
- package/dist/{device-flow-ptLrVINd.mjs → device-flow-R23SIbQ2.mjs} +5 -5
- package/dist/{device-flow-ptLrVINd.mjs.map → device-flow-R23SIbQ2.mjs.map} +1 -1
- package/dist/{error-DJOsMVSt.mjs → error-RwM4dD35.mjs} +2 -2
- package/dist/{error-DJOsMVSt.mjs.map → error-RwM4dD35.mjs.map} +1 -1
- package/dist/{escape-bIyGoW5W.mjs → escape-Ds07EEyu.mjs} +1 -1
- package/dist/{escape-bIyGoW5W.mjs.map → escape-Ds07EEyu.mjs.map} +1 -1
- package/dist/{fts-manager-DR1ERA0c.mjs → fts-manager-1RgHmopc.mjs} +2 -2
- package/dist/{fts-manager-DR1ERA0c.mjs.map → fts-manager-1RgHmopc.mjs.map} +1 -1
- package/dist/{index-CjKdMZ3U.d.mts → index-B1keaX5Y.d.mts} +237 -24
- package/dist/index-B1keaX5Y.d.mts.map +1 -0
- package/dist/{index-D60_SzHG.d.mts → index-DR56od45.d.mts} +3 -3
- package/dist/{index-D60_SzHG.d.mts.map → index-DR56od45.d.mts.map} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.mjs +46 -46
- package/dist/{load-6ZrRhepW.mjs → load-BBetCvLC.mjs} +2 -2
- package/dist/{load-6ZrRhepW.mjs.map → load-BBetCvLC.mjs.map} +1 -1
- package/dist/{loader-Dyx8dhFV.mjs → loader-ZN1ll-d-.mjs} +36 -37
- package/dist/loader-ZN1ll-d-.mjs.map +1 -0
- package/dist/{manifest-schema-Cj-YrzrF.mjs → manifest-schema-BtwbL_vj.mjs} +55 -2
- package/dist/manifest-schema-BtwbL_vj.mjs.map +1 -0
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +11 -11
- package/dist/media/local-runtime.mjs +6 -6
- package/dist/{media-C-oovGCG.mjs → media-JOf3pNkw.mjs} +2 -2
- package/dist/{media-C-oovGCG.mjs.map → media-JOf3pNkw.mjs.map} +1 -1
- package/dist/{media-allowlist-CMcoYIjQ.mjs → media-allowlist-Dknq-OFY.mjs} +1 -1
- package/dist/{media-allowlist-CMcoYIjQ.mjs.map → media-allowlist-Dknq-OFY.mjs.map} +1 -1
- package/dist/media-url-VClf8glU.mjs +26 -0
- package/dist/media-url-VClf8glU.mjs.map +1 -0
- package/dist/{menus-DugoYwTX.mjs → menus-DX4_E01q.mjs} +3 -3
- package/dist/{menus-DugoYwTX.mjs.map → menus-DX4_E01q.mjs.map} +1 -1
- package/dist/{menus-BKkxXCmd.mjs → menus-DrQLusqj.mjs} +87 -37
- package/dist/menus-DrQLusqj.mjs.map +1 -0
- package/dist/{mode-BjlXswIw.mjs → mode-CO2vQHfq.mjs} +1 -1
- package/dist/{mode-BjlXswIw.mjs.map → mode-CO2vQHfq.mjs.map} +1 -1
- package/dist/{normalize-DVV8nbrL.mjs → normalize-CK5o04zr.mjs} +2 -2
- package/dist/{normalize-DVV8nbrL.mjs.map → normalize-CK5o04zr.mjs.map} +1 -1
- package/dist/{oauth-authorization-DvBAL75d.mjs → oauth-authorization-Bw4NdF_S.mjs} +5 -5
- package/dist/{oauth-authorization-DvBAL75d.mjs.map → oauth-authorization-Bw4NdF_S.mjs.map} +1 -1
- package/dist/{oauth-clients-8mPDStMv.mjs → oauth-clients-BGGFp57s.mjs} +1 -1
- package/dist/{oauth-clients-8mPDStMv.mjs.map → oauth-clients-BGGFp57s.mjs.map} +1 -1
- package/dist/{oauth-state-store-BJ7YtrfD.mjs → oauth-state-store-97x0xtN2.mjs} +1 -1
- package/dist/{oauth-state-store-BJ7YtrfD.mjs.map → oauth-state-store-97x0xtN2.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-BdDSDvjF.mjs → oauth-user-lookup-B_vnZHKO.mjs} +1 -1
- package/dist/{oauth-user-lookup-BdDSDvjF.mjs.map → oauth-user-lookup-B_vnZHKO.mjs.map} +1 -1
- package/dist/{options-BL4X94qY.mjs → options-BPCVnesz.mjs} +1 -1
- package/dist/{options-BL4X94qY.mjs.map → options-BPCVnesz.mjs.map} +1 -1
- package/dist/{options-tb7DJROi.d.mts → options-DyYIYpPd.d.mts} +3 -3
- package/dist/{options-tb7DJROi.d.mts.map → options-DyYIYpPd.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BBkFmLVr.mjs → parse-CrGndy1A.mjs} +2 -2
- package/dist/{parse-BBkFmLVr.mjs.map → parse-CrGndy1A.mjs.map} +1 -1
- package/dist/{passkey-config-BDVM86Tj.mjs → passkey-config-C3QgnQnU.mjs} +1 -1
- package/dist/{passkey-config-BDVM86Tj.mjs.map → passkey-config-C3QgnQnU.mjs.map} +1 -1
- package/dist/{patterns-CqG5Ya3i.mjs → patterns-p-RBdTbM.mjs} +1 -1
- package/dist/{patterns-CqG5Ya3i.mjs.map → patterns-p-RBdTbM.mjs.map} +1 -1
- package/dist/{placeholder-B9lUUEmj.d.mts → placeholder-CVBv5z8k.d.mts} +1 -1
- package/dist/{placeholder-B9lUUEmj.d.mts.map → placeholder-CVBv5z8k.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{public-url-egRHCy1m.mjs → public-url-BFVC2OTJ.mjs} +1 -1
- package/dist/{public-url-egRHCy1m.mjs.map → public-url-BFVC2OTJ.mjs.map} +1 -1
- package/dist/{query-Ctlq1aOk.mjs → query-CbUcI4Xk.mjs} +33 -17
- package/dist/query-CbUcI4Xk.mjs.map +1 -0
- package/dist/{rate-limit-CH6W6ikK.mjs → rate-limit-C7hjdkS5.mjs} +2 -2
- package/dist/{rate-limit-CH6W6ikK.mjs.map → rate-limit-C7hjdkS5.mjs.map} +1 -1
- package/dist/{redirect-Cw3JTlmj.mjs → redirect-B_q19j4v.mjs} +1 -1
- package/dist/{redirect-Cw3JTlmj.mjs.map → redirect-B_q19j4v.mjs.map} +1 -1
- package/dist/{redirect-C6tJA7tk.mjs → redirect-CRWIt8Zj.mjs} +3 -3
- package/dist/{redirect-C6tJA7tk.mjs.map → redirect-CRWIt8Zj.mjs.map} +1 -1
- package/dist/{redirects-C0L9JUk4.mjs → redirects-CCbCqCCd.mjs} +28 -4
- package/dist/redirects-CCbCqCCd.mjs.map +1 -0
- package/dist/{redirects-CacE9eQa.mjs → redirects-DxVoR7PI.mjs} +5 -5
- package/dist/{redirects-CacE9eQa.mjs.map → redirects-DxVoR7PI.mjs.map} +1 -1
- package/dist/{registry-CIDxZbhh.mjs → registry-brYh-rAT.mjs} +6 -6
- package/dist/{registry-CIDxZbhh.mjs.map → registry-brYh-rAT.mjs.map} +1 -1
- package/dist/{request-cache-BYMs-BGX.mjs → request-cache-D32LpnmI.mjs} +1 -1
- package/dist/{request-cache-BYMs-BGX.mjs.map → request-cache-D32LpnmI.mjs.map} +1 -1
- package/dist/request-context.d.mts +7 -0
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs +2 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{runner-pt6Wl-l-.mjs → runner--4wMWwKM.mjs} +217 -166
- package/dist/runner--4wMWwKM.mjs.map +1 -0
- package/dist/{runner-DM1yR5qd.d.mts → runner-DTdhuI9i.d.mts} +2 -2
- package/dist/{runner-DM1yR5qd.d.mts.map → runner-DTdhuI9i.d.mts.map} +1 -1
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +2 -2
- package/dist/{schema-B4tk0HAG.mjs → schema-C1E70ug_.mjs} +5 -5
- package/dist/{schema-B4tk0HAG.mjs.map → schema-C1E70ug_.mjs.map} +1 -1
- package/dist/{search-f-fNfwab.mjs → search-B3SGZw91.mjs} +4 -4
- package/dist/{search-f-fNfwab.mjs.map → search-B3SGZw91.mjs.map} +1 -1
- package/dist/{secrets-YYbTgB1w.mjs → secrets-ChPTmy9x.mjs} +2 -2
- package/dist/{secrets-YYbTgB1w.mjs.map → secrets-ChPTmy9x.mjs.map} +1 -1
- package/dist/{sections-biElLfT9.mjs → sections-D_lVzwRZ.mjs} +3 -3
- package/dist/{sections-biElLfT9.mjs.map → sections-D_lVzwRZ.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +17 -17
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +3 -12
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-BR39kvTF.mjs → seo-B5e6y9Wk.mjs} +2 -2
- package/dist/{seo-BR39kvTF.mjs.map → seo-B5e6y9Wk.mjs.map} +1 -1
- package/dist/{seo-DfjLvu8i.mjs → seo-D_LPkOtu.mjs} +4 -3
- package/dist/seo-D_LPkOtu.mjs.map +1 -0
- package/dist/{service-BhR2acnc.mjs → service-ChDcsTBs.mjs} +3 -3
- package/dist/{service-BhR2acnc.mjs.map → service-ChDcsTBs.mjs.map} +1 -1
- package/dist/{settings-D_NJvjgN.mjs → settings-Cv47v9u8.mjs} +3 -3
- package/dist/{settings-D_NJvjgN.mjs.map → settings-Cv47v9u8.mjs.map} +1 -1
- package/dist/settings-DfxiWY_s.mjs +411 -0
- package/dist/settings-DfxiWY_s.mjs.map +1 -0
- package/dist/{setup-complete-VoEZfasi.mjs → setup-complete-yvPE4OsP.mjs} +2 -2
- package/dist/{setup-complete-VoEZfasi.mjs.map → setup-complete-yvPE4OsP.mjs.map} +1 -1
- package/dist/{setup-nonce-Bm0uKqmf.mjs → setup-nonce-C9aFzb94.mjs} +1 -1
- package/dist/{setup-nonce-Bm0uKqmf.mjs.map → setup-nonce-C9aFzb94.mjs.map} +1 -1
- package/dist/{site-url-Cm8-sJy7.mjs → site-url-CnHlmAs9.mjs} +2 -2
- package/dist/{site-url-Cm8-sJy7.mjs.map → site-url-CnHlmAs9.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/{taxonomies-Mhn9rjTQ.mjs → taxonomies-BILwiyGk.mjs} +4 -4
- package/dist/{taxonomies-Mhn9rjTQ.mjs.map → taxonomies-BILwiyGk.mjs.map} +1 -1
- package/dist/{taxonomies-Crtzy4MT.mjs → taxonomies-BdAmbOwx.mjs} +50 -12
- package/dist/taxonomies-BdAmbOwx.mjs.map +1 -0
- package/dist/{taxonomy-DTZrIQpi.mjs → taxonomy-CdllE4oq.mjs} +3 -3
- package/dist/{taxonomy-DTZrIQpi.mjs.map → taxonomy-CdllE4oq.mjs.map} +1 -1
- package/dist/{transaction-NQj4VJ7Z.mjs → transaction-x2tJQ-A1.mjs} +1 -1
- package/dist/{transaction-NQj4VJ7Z.mjs.map → transaction-x2tJQ-A1.mjs.map} +1 -1
- package/dist/{transport-OnMNbsIA.d.mts → transport-B7PPP2CC.d.mts} +1 -1
- package/dist/{transport-OnMNbsIA.d.mts.map → transport-B7PPP2CC.d.mts.map} +1 -1
- package/dist/{transport--Ck3RBin.mjs → transport-CmpLD7W3.mjs} +1 -1
- package/dist/{transport--Ck3RBin.mjs.map → transport-CmpLD7W3.mjs.map} +1 -1
- package/dist/{types-DWnN7weG.d.mts → types-BFgrqwSk.d.mts} +1 -1
- package/dist/{types-DWnN7weG.d.mts.map → types-BFgrqwSk.d.mts.map} +1 -1
- package/dist/{types-Qa7-HJJC.d.mts → types-BH8-30hc.d.mts} +1 -1
- package/dist/{types-Qa7-HJJC.d.mts.map → types-BH8-30hc.d.mts.map} +1 -1
- package/dist/{types-DawhLFwy.d.mts → types-BPzXTV9x.d.mts} +26 -1
- package/dist/{types-DawhLFwy.d.mts.map → types-BPzXTV9x.d.mts.map} +1 -1
- package/dist/{types-DbCWhHet.d.mts → types-BUUVn1zr.d.mts} +2 -2
- package/dist/types-BUUVn1zr.d.mts.map +1 -0
- package/dist/{types-K3MDsxpy.mjs → types-BXSUSAjt.mjs} +16 -3
- package/dist/{types-K3MDsxpy.mjs.map → types-BXSUSAjt.mjs.map} +1 -1
- package/dist/{types-DMwSpvcw.d.mts → types-CPAPl93j.d.mts} +9 -3
- package/dist/{types-DMwSpvcw.d.mts.map → types-CPAPl93j.d.mts.map} +1 -1
- package/dist/types-CZI4E3qG.mjs +3 -0
- package/dist/{types-kwqCOUxj.d.mts → types-D4kUqbHh.d.mts} +1 -1
- package/dist/{types-kwqCOUxj.d.mts.map → types-D4kUqbHh.d.mts.map} +1 -1
- package/dist/{types-i8_uzhMD.d.mts → types-DTniiNto.d.mts} +19 -4
- package/dist/types-DTniiNto.d.mts.map +1 -0
- package/dist/{types-D8bhH891.mjs → types-DZk_y-MU.mjs} +1 -1
- package/dist/types-DZk_y-MU.mjs.map +1 -0
- package/dist/{types-DX6v9KzJ.d.mts → types-S15DXXNi.d.mts} +1 -1
- package/dist/{types-DX6v9KzJ.d.mts.map → types-S15DXXNi.d.mts.map} +1 -1
- package/dist/{user-DzEUl5zA.mjs → user-C0um7wrg.mjs} +18 -2
- package/dist/user-C0um7wrg.mjs.map +1 -0
- package/dist/{validate-JCXcsqiY.mjs → validate-Bz4vqcX1.mjs} +6 -3
- package/dist/validate-Bz4vqcX1.mjs.map +1 -0
- package/dist/{validate-Dy6nkNls.d.mts → validate-CNwkPWzz.d.mts} +13 -5
- package/dist/validate-CNwkPWzz.d.mts.map +1 -0
- package/dist/{validation-Bq-VyKJg.mjs → validation-DgGTJm3u.mjs} +5 -5
- package/dist/{validation-Bq-VyKJg.mjs.map → validation-DgGTJm3u.mjs.map} +1 -1
- package/dist/version-D-5txk2m.mjs +7 -0
- package/dist/{version-CnS-Cr8A.mjs.map → version-D-5txk2m.mjs.map} +1 -1
- package/dist/{widgets-Bap1eS1X.mjs → widgets-DZfmAbE4.mjs} +47 -44
- package/dist/widgets-DZfmAbE4.mjs.map +1 -0
- package/dist/{zod-generator-BSDpkqSH.mjs → zod-generator-Djo_VHCt.mjs} +2 -2
- package/dist/{zod-generator-BSDpkqSH.mjs.map → zod-generator-Djo_VHCt.mjs.map} +1 -1
- package/package.json +10 -10
- package/src/api/handlers/content.ts +107 -8
- package/src/api/handlers/index.ts +2 -0
- package/src/api/handlers/marketplace.ts +2 -5
- package/src/api/handlers/registry.ts +70 -0
- package/src/api/handlers/seo.ts +9 -1
- package/src/api/openapi/document.ts +25 -0
- package/src/api/schemas/content.ts +33 -0
- package/src/api/schemas/schema.ts +13 -1
- package/src/astro/integration/index.ts +98 -0
- package/src/astro/integration/routes.ts +6 -0
- package/src/astro/integration/virtual-modules.ts +39 -0
- package/src/astro/integration/vite-config.ts +12 -0
- package/src/astro/middleware.ts +48 -6
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +4 -2
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +4 -2
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +8 -4
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +4 -2
- package/src/astro/routes/api/content/[collection]/[id].ts +4 -2
- package/src/astro/routes/api/content/[collection]/authors.ts +34 -0
- package/src/astro/routes/api/schema/index.ts +7 -15
- package/src/astro/routes/sitemap-[collection].xml.ts +13 -2
- package/src/astro/types.ts +8 -1
- package/src/bylines/index.ts +57 -0
- package/src/cli/commands/bundle-utils.ts +2 -0
- package/src/cli/commands/export-seed.ts +28 -12
- package/src/cli/commands/secrets.ts +2 -2
- package/src/components/EmDashImage.astro +22 -4
- package/src/components/Image.astro +20 -3
- package/src/database/instrumentation.ts +13 -0
- package/src/database/migrations/043_content_references.ts +121 -0
- package/src/database/migrations/runner.ts +2 -0
- package/src/database/repositories/content.ts +225 -67
- package/src/database/repositories/index.ts +7 -0
- package/src/database/repositories/relation.ts +467 -0
- package/src/database/repositories/types.ts +31 -0
- package/src/database/repositories/user.ts +18 -0
- package/src/database/types.ts +34 -0
- package/src/emdash-runtime.ts +172 -67
- package/src/index.ts +8 -1
- package/src/loader.ts +81 -39
- package/src/media/responsive.ts +125 -0
- package/src/plugins/cron.ts +3 -2
- package/src/plugins/index.ts +5 -0
- package/src/plugins/manifest-schema.ts +75 -0
- package/src/plugins/marketplace.ts +2 -5
- package/src/plugins/scheduler/node.ts +9 -2
- package/src/plugins/types.ts +12 -0
- package/src/query.ts +45 -7
- package/src/request-context.ts +8 -0
- package/src/scheduled-publish.ts +153 -0
- package/src/schema/types.ts +11 -1
- package/src/seed/apply.ts +16 -6
- package/src/seed/types.ts +9 -0
- package/src/seed/validate.ts +15 -0
- package/src/seo/index.ts +2 -28
- package/src/seo/media-url.ts +32 -0
- package/src/settings/index.ts +32 -40
- package/src/taxonomies/index.ts +79 -12
- package/src/utils/isolate-cache.ts +189 -0
- package/src/virtual-modules.d.ts +11 -0
- package/src/widgets/index.ts +57 -54
- package/dist/api-Cs7DAACP.mjs.map +0 -1
- package/dist/apply-BWMV4Zmw.mjs.map +0 -1
- package/dist/byline-fields-BNy7Ng1U.d.mts.map +0 -1
- package/dist/content-CyqOmOzm.mjs.map +0 -1
- package/dist/cron-DZovZUnC.mjs.map +0 -1
- package/dist/index-CjKdMZ3U.d.mts.map +0 -1
- package/dist/loader-Dyx8dhFV.mjs.map +0 -1
- package/dist/manifest-schema-Cj-YrzrF.mjs.map +0 -1
- package/dist/menus-BKkxXCmd.mjs.map +0 -1
- package/dist/query-Ctlq1aOk.mjs.map +0 -1
- package/dist/redirects-C0L9JUk4.mjs.map +0 -1
- package/dist/runner-pt6Wl-l-.mjs.map +0 -1
- package/dist/seo-DfjLvu8i.mjs.map +0 -1
- package/dist/settings-b5zW1R1T.mjs +0 -235
- package/dist/settings-b5zW1R1T.mjs.map +0 -1
- package/dist/taxonomies-Crtzy4MT.mjs.map +0 -1
- package/dist/types-Cj2S6FuC.mjs +0 -3
- package/dist/types-D8bhH891.mjs.map +0 -1
- package/dist/types-DbCWhHet.d.mts.map +0 -1
- package/dist/types-i8_uzhMD.d.mts.map +0 -1
- package/dist/user-DzEUl5zA.mjs.map +0 -1
- package/dist/validate-Dy6nkNls.d.mts.map +0 -1
- package/dist/validate-JCXcsqiY.mjs.map +0 -1
- package/dist/version-CnS-Cr8A.mjs +0 -7
- package/dist/widgets-Bap1eS1X.mjs.map +0 -1
- package/src/plugins/scheduler/piggyback.ts +0 -71
- /package/dist/{api-tokens-B6VgoE6M.mjs → api-tokens-Oq39ba-Z.mjs} +0 -0
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { i as runMigrations, t as MIGRATION_RACE_WAIT_MS } from "../runner
|
|
1
|
+
import { i as runMigrations, t as MIGRATION_RACE_WAIT_MS } from "../runner--4wMWwKM.mjs";
|
|
2
2
|
import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
|
|
3
3
|
import { o as isSqlite } from "../dialect-helpers-DRI5pyY3.mjs";
|
|
4
4
|
import { i as setI18nConfig } from "../config-CVssduLe.mjs";
|
|
5
|
-
import { _ as
|
|
6
|
-
import { r as RevisionRepository } from "../content-
|
|
5
|
+
import { _ as resolveExclusiveHooks, g as createHookPipeline, m as EmailPipeline, p as PluginRouteRegistry, v as definePlugin } from "../menus-DrQLusqj.mjs";
|
|
6
|
+
import { r as RevisionRepository, t as ContentRepository } from "../content-BIlVx-RX.mjs";
|
|
7
7
|
import "../base64-CqR-7kqF.mjs";
|
|
8
|
-
import "../types-
|
|
9
|
-
import { t as MediaRepository } from "../media-
|
|
10
|
-
import "../user-
|
|
11
|
-
import "../taxonomy-
|
|
12
|
-
import "../comment-
|
|
13
|
-
import { t as OptionsRepository } from "../options-
|
|
14
|
-
import "../context-
|
|
15
|
-
import "../menus-
|
|
16
|
-
import "../redirect-
|
|
8
|
+
import "../types-BXSUSAjt.mjs";
|
|
9
|
+
import { t as MediaRepository } from "../media-JOf3pNkw.mjs";
|
|
10
|
+
import "../user-C0um7wrg.mjs";
|
|
11
|
+
import "../taxonomy-CdllE4oq.mjs";
|
|
12
|
+
import "../comment-sqQxNpN3.mjs";
|
|
13
|
+
import { t as OptionsRepository } from "../options-BPCVnesz.mjs";
|
|
14
|
+
import "../context-Y7BRkWes.mjs";
|
|
15
|
+
import "../menus-DX4_E01q.mjs";
|
|
16
|
+
import "../redirect-CRWIt8Zj.mjs";
|
|
17
17
|
import { createRequestMetrics, getRequestContext, runWithContext } from "../request-context.mjs";
|
|
18
|
-
import { r as requestCached } from "../request-cache-
|
|
19
|
-
import "../byline-registry-
|
|
20
|
-
import "../byline-
|
|
21
|
-
import {
|
|
18
|
+
import { r as requestCached } from "../request-cache-D32LpnmI.mjs";
|
|
19
|
+
import "../byline-registry-CWP7I71B.mjs";
|
|
20
|
+
import "../byline-DUx48sJp.mjs";
|
|
21
|
+
import { n as normalizeMediaValue } from "../normalize-CK5o04zr.mjs";
|
|
22
22
|
import "../placeholder-BZxr8W1j.mjs";
|
|
23
|
-
import "../seo-
|
|
23
|
+
import "../seo-B5e6y9Wk.mjs";
|
|
24
24
|
import { n as isMissingTableError } from "../db-errors-CtzxKBxe.mjs";
|
|
25
|
-
import { $ as
|
|
26
|
-
import "../dashboard-
|
|
25
|
+
import { $ as handleContentGet, B as handleMediaUpdate, G as handleContentAuthors, H as handleRevisionList, I as handleMediaCreate, J as handleContentCountTrashed, K as handleContentCompare, L as handleMediaDelete, Q as handleContentDuplicate, R as handleMediaGet, S as PluginStateRepository, U as handleRevisionRestore, V as handleRevisionGet, X as handleContentDelete, Y as handleContentCreate, Z as handleContentDiscardDraft, _ as loadBundleFromR2, at as handleContentRestore, ct as handleContentUnpublish, dt as validateRev, et as handleContentGetIncludingTrashed, it as handleContentPublish, lt as handleContentUnschedule, nt as handleContentListTrashed, ot as handleContentSchedule, q as handleContentCountScheduled, rt as handleContentPermanentDelete, s as normalizeRegistryConfig, st as handleContentTranslations, tt as handleContentList, ut as handleContentUpdate, z as handleMediaList } from "../api-DStv36ik.mjs";
|
|
26
|
+
import "../dashboard-2JgAMWxK.mjs";
|
|
27
27
|
import { n as hashString } from "../hash-9w3pd3-m.mjs";
|
|
28
|
-
import { t as FTSManager } from "../fts-manager-
|
|
29
|
-
import { n as SchemaRegistry } from "../registry-
|
|
28
|
+
import { t as FTSManager } from "../fts-manager-1RgHmopc.mjs";
|
|
29
|
+
import { n as SchemaRegistry } from "../registry-brYh-rAT.mjs";
|
|
30
30
|
import { createRecorder, flushRecorder, isInstrumentationEnabled, kyselyLogOption } from "../database/instrumentation.mjs";
|
|
31
|
-
import { r as getDb } from "../loader-
|
|
32
|
-
import "../schema-
|
|
33
|
-
import "../zod-generator-
|
|
34
|
-
import "../seo-
|
|
35
|
-
import "../sections-
|
|
36
|
-
import { o as invalidateSiteSettingsCache } from "../settings-
|
|
37
|
-
import "../settings-
|
|
31
|
+
import { r as getDb } from "../loader-ZN1ll-d-.mjs";
|
|
32
|
+
import "../schema-C1E70ug_.mjs";
|
|
33
|
+
import "../zod-generator-Djo_VHCt.mjs";
|
|
34
|
+
import "../seo-D_LPkOtu.mjs";
|
|
35
|
+
import "../sections-D_lVzwRZ.mjs";
|
|
36
|
+
import { c as createIsolateCache, d as initWithLock, f as after, l as isolateCachedAsync, o as invalidateSiteSettingsCache, u as createInitLock } from "../settings-DfxiWY_s.mjs";
|
|
37
|
+
import "../settings-Cv47v9u8.mjs";
|
|
38
38
|
import "../resolve-BqYMVG0D.mjs";
|
|
39
|
-
import "../taxonomies-
|
|
40
|
-
import "../taxonomies-
|
|
41
|
-
import { r as normalizeManifestRoute } from "../manifest-schema-
|
|
42
|
-
import "../types-
|
|
39
|
+
import "../taxonomies-BdAmbOwx.mjs";
|
|
40
|
+
import "../taxonomies-BILwiyGk.mjs";
|
|
41
|
+
import { r as normalizeManifestRoute } from "../manifest-schema-BtwbL_vj.mjs";
|
|
42
|
+
import "../types-CZI4E3qG.mjs";
|
|
43
43
|
import "../ssrf-BsVGIE0Z.mjs";
|
|
44
|
-
import "../error-
|
|
45
|
-
import "../parse-
|
|
46
|
-
import "../redirects-
|
|
47
|
-
import "../byline-fields-
|
|
48
|
-
import { a as invalidateUrlPatternCache } from "../query-
|
|
44
|
+
import "../error-RwM4dD35.mjs";
|
|
45
|
+
import "../parse-CrGndy1A.mjs";
|
|
46
|
+
import "../redirects-CCbCqCCd.mjs";
|
|
47
|
+
import "../byline-fields-8TMtkBnH.mjs";
|
|
48
|
+
import { a as invalidateUrlPatternCache } from "../query-CbUcI4Xk.mjs";
|
|
49
49
|
import "../import-Dh8bWmyq.mjs";
|
|
50
50
|
import { t as getTrustedProxyHeaders } from "../trusted-proxy-B4AfnoAp.mjs";
|
|
51
51
|
import { n as sanitizeHeadersForSandbox, t as extractRequestMeta } from "../request-meta-7ByVLxB-.mjs";
|
|
52
52
|
import "../ssrf-BvgVcfNQ.mjs";
|
|
53
|
-
import { n as CronExecutor } from "../cron-
|
|
53
|
+
import { n as CronExecutor } from "../cron-BJ2ClIlj.mjs";
|
|
54
54
|
import { r as devConsoleEmailDeliver, t as DEV_CONSOLE_EMAIL_PLUGIN_ID } from "../email-console-DHT2Fbpj.mjs";
|
|
55
55
|
import "../utils-C4Ih4DML.mjs";
|
|
56
56
|
import "../tokens-Bx2afeT-.mjs";
|
|
57
57
|
import "../preview-BfuRkVKW.mjs";
|
|
58
|
-
import "../bylines-
|
|
59
|
-
import "../widgets-
|
|
60
|
-
import "../apply-
|
|
61
|
-
import "../load-
|
|
62
|
-
import "../search-
|
|
58
|
+
import "../bylines-s8c2DXbH.mjs";
|
|
59
|
+
import "../widgets-DZfmAbE4.mjs";
|
|
60
|
+
import "../apply-Dr7snAMT.mjs";
|
|
61
|
+
import "../load-BBetCvLC.mjs";
|
|
62
|
+
import "../search-B3SGZw91.mjs";
|
|
63
63
|
import "../index.mjs";
|
|
64
|
-
import { n as VERSION, t as COMMIT } from "../version-
|
|
65
|
-
import { t as getAuthMode } from "../mode-
|
|
66
|
-
import { t as cleanupExpiredChallenges } from "../challenge-store-
|
|
67
|
-
import { a as validateEncryptionKeyAtStartup } from "../secrets-
|
|
64
|
+
import { n as VERSION, t as COMMIT } from "../version-D-5txk2m.mjs";
|
|
65
|
+
import { t as getAuthMode } from "../mode-CO2vQHfq.mjs";
|
|
66
|
+
import { t as cleanupExpiredChallenges } from "../challenge-store-DXX3rfdI.mjs";
|
|
67
|
+
import { a as validateEncryptionKeyAtStartup } from "../secrets-ChPTmy9x.mjs";
|
|
68
68
|
import { Kysely, sql } from "kysely";
|
|
69
69
|
import { defineMiddleware } from "astro:middleware";
|
|
70
70
|
import virtualConfig from "virtual:emdash/config";
|
|
@@ -73,63 +73,10 @@ import { mediaProviders } from "virtual:emdash/media-providers";
|
|
|
73
73
|
import { plugins } from "virtual:emdash/plugins";
|
|
74
74
|
import * as virtualSandboxRunnerModule from "virtual:emdash/sandbox-runner";
|
|
75
75
|
import { sandboxedPlugins } from "virtual:emdash/sandboxed-plugins";
|
|
76
|
+
import { createScheduler } from "virtual:emdash/scheduler";
|
|
76
77
|
import { createStorage } from "virtual:emdash/storage";
|
|
77
78
|
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
|
|
78
79
|
|
|
79
|
-
//#region src/utils/init-lock.ts
|
|
80
|
-
function createInitLock() {
|
|
81
|
-
return {
|
|
82
|
-
ownerStartedAt: null,
|
|
83
|
-
generation: 0
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const DEFAULT_DEADLINE_MS = 15e3;
|
|
87
|
-
const DEFAULT_POLL_MS = 50;
|
|
88
|
-
const MAX_WAIT_HEADROOM_MS = 15e3;
|
|
89
|
-
function sleep(ms) {
|
|
90
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Return the cached value if present, otherwise initialize it under the
|
|
94
|
-
* lock. `init` is responsible for storing the value so that `getCached`
|
|
95
|
-
* returns it on subsequent calls — waiters re-check `getCached` after the
|
|
96
|
-
* owner finishes rather than sharing the owner's promise.
|
|
97
|
-
*
|
|
98
|
-
* `init` receives an `isCurrentClaim` predicate and must gate its cache
|
|
99
|
-
* publication on it: a slow init that was reclaimed past the deadline
|
|
100
|
-
* must not overwrite the value published by the reclaimer (for the
|
|
101
|
-
* runtime singleton that would orphan the reclaimer's active cron
|
|
102
|
-
* scheduler). A losing init should also tear down any side resources it
|
|
103
|
-
* started, since its result will never be published.
|
|
104
|
-
*/
|
|
105
|
-
async function initWithLock(lock, getCached, init, options) {
|
|
106
|
-
const deadlineMs = options?.deadlineMs ?? DEFAULT_DEADLINE_MS;
|
|
107
|
-
const pollMs = options?.pollMs ?? DEFAULT_POLL_MS;
|
|
108
|
-
const maxWaitMs = options?.maxWaitMs ?? deadlineMs + MAX_WAIT_HEADROOM_MS;
|
|
109
|
-
const waitStart = Date.now();
|
|
110
|
-
for (;;) {
|
|
111
|
-
const cached = getCached();
|
|
112
|
-
if (cached !== null && cached !== void 0) return cached;
|
|
113
|
-
const ownerStartedAt = lock.ownerStartedAt;
|
|
114
|
-
if (ownerStartedAt === null || Date.now() - ownerStartedAt > deadlineMs) {
|
|
115
|
-
lock.generation += 1;
|
|
116
|
-
const claim = lock.generation;
|
|
117
|
-
lock.ownerStartedAt = Date.now();
|
|
118
|
-
try {
|
|
119
|
-
const isCurrentClaim = () => lock.generation === claim;
|
|
120
|
-
const initPromise = Promise.resolve().then(() => init(isCurrentClaim));
|
|
121
|
-
options?.anchor?.(initPromise.then(() => void 0, () => void 0));
|
|
122
|
-
return await initPromise;
|
|
123
|
-
} finally {
|
|
124
|
-
if (lock.generation === claim) lock.ownerStartedAt = null;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (Date.now() - waitStart > maxWaitMs) throw new Error(`initWithLock: timed out after ${maxWaitMs}ms waiting for initialization`);
|
|
128
|
-
await sleep(pollMs);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
//#endregion
|
|
133
80
|
//#region src/cleanup.ts
|
|
134
81
|
/**
|
|
135
82
|
* System cleanup
|
|
@@ -249,115 +196,70 @@ async function defaultCommentModerate(event, _ctx) {
|
|
|
249
196
|
}
|
|
250
197
|
|
|
251
198
|
//#endregion
|
|
252
|
-
//#region src/
|
|
253
|
-
/**
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
199
|
+
//#region src/scheduled-publish.ts
|
|
200
|
+
/**
|
|
201
|
+
* Default cap on items promoted per collection in a single sweep. Bounds the
|
|
202
|
+
* publish/webhook fan-out of one tick so a large backlog can't exhaust a Worker
|
|
203
|
+
* invocation's CPU/subrequest budget; the remainder drains on later ticks.
|
|
204
|
+
*/
|
|
205
|
+
const SCHEDULED_PUBLISH_BATCH_LIMIT = 100;
|
|
206
|
+
/**
|
|
207
|
+
* Publish every content item whose `scheduled_at` is in the past.
|
|
208
|
+
*
|
|
209
|
+
* Iterates all collections, finds due items (`findReadyToPublish` returns both
|
|
210
|
+
* scheduled drafts and published entries with pending scheduled changes), and
|
|
211
|
+
* publishes each. `publish()` clears `scheduled_at`, so a second sweep is a
|
|
212
|
+
* no-op — safe to run on every tick.
|
|
213
|
+
*
|
|
214
|
+
* Bounded per collection by `limit` (default `SCHEDULED_PUBLISH_BATCH_LIMIT`):
|
|
215
|
+
* a large backlog drains across successive ticks rather than in one unbounded
|
|
216
|
+
* pass. After each collection's batch, `onPublished` (if given) is awaited so
|
|
217
|
+
* cache-tag invalidation happens incrementally, not just at the very end.
|
|
218
|
+
*
|
|
219
|
+
* Returns every item it promoted so request-less callers (the Cloudflare
|
|
220
|
+
* `scheduled()` handler) can also act on the full set.
|
|
221
|
+
*/
|
|
222
|
+
async function publishDueContent(db, options = {}) {
|
|
223
|
+
const { publish, onPublished, limit = SCHEDULED_PUBLISH_BATCH_LIMIT } = options;
|
|
224
|
+
const published = [];
|
|
225
|
+
let collections;
|
|
226
|
+
try {
|
|
227
|
+
collections = await new SchemaRegistry(db).listCollections();
|
|
228
|
+
} catch (error) {
|
|
229
|
+
console.error("[scheduled-publish] Failed to list collections:", error);
|
|
230
|
+
return published;
|
|
231
|
+
}
|
|
232
|
+
const repo = new ContentRepository(db);
|
|
233
|
+
const doPublish = publish ?? ((collection, id, opts) => handleContentPublish(db, collection, id, opts));
|
|
234
|
+
const batchLimit = limit > 0 ? limit : void 0;
|
|
235
|
+
for (const collection of collections) try {
|
|
236
|
+
const due = await repo.findReadyToPublish(collection.slug, batchLimit);
|
|
237
|
+
const batch = [];
|
|
238
|
+
for (const item of due) {
|
|
239
|
+
const publishedAt = item.publishedAt == null ? item.scheduledAt ?? void 0 : void 0;
|
|
240
|
+
const result = await doPublish(collection.slug, item.id, {
|
|
241
|
+
publishedAt,
|
|
242
|
+
requireScheduledDue: true
|
|
243
|
+
});
|
|
244
|
+
if (result.success) batch.push({
|
|
245
|
+
collection: collection.slug,
|
|
246
|
+
id: item.id
|
|
247
|
+
});
|
|
248
|
+
else if (result.error?.code === "NOT_DUE") {} else console.error(`[scheduled-publish] Failed to publish ${collection.slug}/${item.id}:`, result.error);
|
|
283
249
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
let delayMs;
|
|
291
|
-
if (nextDue) {
|
|
292
|
-
const dueAt = new Date(nextDue).getTime();
|
|
293
|
-
delayMs = Math.max(dueAt - Date.now(), MIN_INTERVAL_MS);
|
|
294
|
-
delayMs = Math.min(delayMs, MAX_INTERVAL_MS);
|
|
295
|
-
} else delayMs = MAX_INTERVAL_MS;
|
|
296
|
-
this.timer = setTimeout(() => {
|
|
297
|
-
if (!this.running) return;
|
|
298
|
-
this.executeTick();
|
|
299
|
-
}, delayMs);
|
|
300
|
-
if (this.timer && typeof this.timer === "object" && "unref" in this.timer) this.timer.unref();
|
|
301
|
-
}).catch((error) => {
|
|
302
|
-
console.error("[cron:node] Failed to get next due time:", error);
|
|
303
|
-
if (this.running) {
|
|
304
|
-
this.timer = setTimeout(() => this.arm(), MAX_INTERVAL_MS);
|
|
305
|
-
if (this.timer && typeof this.timer === "object" && "unref" in this.timer) this.timer.unref();
|
|
250
|
+
if (batch.length > 0) {
|
|
251
|
+
published.push(...batch);
|
|
252
|
+
if (onPublished) try {
|
|
253
|
+
await onPublished(batch);
|
|
254
|
+
} catch (error) {
|
|
255
|
+
console.error(`[scheduled-publish] onPublished failed after "${collection.slug}" batch:`, error);
|
|
306
256
|
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (!this.running) return;
|
|
311
|
-
const tasks = [this.executor.tick(), this.executor.recoverStaleLocks()];
|
|
312
|
-
if (this.systemCleanup) tasks.push(this.systemCleanup());
|
|
313
|
-
Promise.allSettled(tasks).then((results) => {
|
|
314
|
-
for (const r of results) if (r.status === "rejected") console.error("[cron:node] Tick task failed:", r.reason);
|
|
315
|
-
}).finally(() => {
|
|
316
|
-
if (this.running) this.arm();
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
//#endregion
|
|
322
|
-
//#region src/plugins/scheduler/piggyback.ts
|
|
323
|
-
/** Minimum interval between tick attempts (ms) */
|
|
324
|
-
const DEBOUNCE_MS = 60 * 1e3;
|
|
325
|
-
var PiggybackScheduler = class {
|
|
326
|
-
lastTickAt = 0;
|
|
327
|
-
running = false;
|
|
328
|
-
systemCleanup = null;
|
|
329
|
-
constructor(executor) {
|
|
330
|
-
this.executor = executor;
|
|
331
|
-
}
|
|
332
|
-
setSystemCleanup(fn) {
|
|
333
|
-
this.systemCleanup = fn;
|
|
334
|
-
}
|
|
335
|
-
start() {
|
|
336
|
-
this.running = true;
|
|
337
|
-
}
|
|
338
|
-
stop() {
|
|
339
|
-
this.running = false;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* No-op for piggyback — tick happens on next request.
|
|
343
|
-
*/
|
|
344
|
-
reschedule() {}
|
|
345
|
-
/**
|
|
346
|
-
* Call this from middleware on each request.
|
|
347
|
-
* Debounced: only actually ticks if enough time has passed.
|
|
348
|
-
*/
|
|
349
|
-
onRequest() {
|
|
350
|
-
if (!this.running) return;
|
|
351
|
-
const now = Date.now();
|
|
352
|
-
if (now - this.lastTickAt < DEBOUNCE_MS) return;
|
|
353
|
-
this.lastTickAt = now;
|
|
354
|
-
const tasks = [this.executor.tick(), this.executor.recoverStaleLocks()];
|
|
355
|
-
if (this.systemCleanup) tasks.push(this.systemCleanup());
|
|
356
|
-
Promise.allSettled(tasks).then((results) => {
|
|
357
|
-
for (const r of results) if (r.status === "rejected") console.error("[cron:piggyback] Tick task failed:", r.reason);
|
|
358
|
-
});
|
|
257
|
+
}
|
|
258
|
+
} catch (error) {
|
|
259
|
+
console.error(`[scheduled-publish] Sweep failed for "${collection.slug}":`, error);
|
|
359
260
|
}
|
|
360
|
-
|
|
261
|
+
return published;
|
|
262
|
+
}
|
|
361
263
|
|
|
362
264
|
//#endregion
|
|
363
265
|
//#region src/emdash-runtime.ts
|
|
@@ -508,12 +410,12 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
508
410
|
enabledPlugins;
|
|
509
411
|
pluginStates;
|
|
510
412
|
/**
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
413
|
+
* Isolate-lifetime guard so FTS indexes are verified at most once per
|
|
414
|
+
* worker rather than on every admin request. See ensureSearchHealthy().
|
|
415
|
+
* Uses the poison-immune isolate cache (never a shared awaitable promise)
|
|
416
|
+
* so a cancelled first caller can't wedge later ones.
|
|
514
417
|
*/
|
|
515
|
-
|
|
516
|
-
_searchHealthPromise = null;
|
|
418
|
+
_searchHealthCache = createIsolateCache();
|
|
517
419
|
/** Current hook pipeline. Use the `hooks` getter for external access. */
|
|
518
420
|
get hooks() {
|
|
519
421
|
return this._hooks;
|
|
@@ -576,12 +478,54 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
576
478
|
return this.runtimeDeps.sandboxBypassed === true;
|
|
577
479
|
}
|
|
578
480
|
/**
|
|
579
|
-
*
|
|
580
|
-
*
|
|
581
|
-
|
|
481
|
+
* Publish any content whose scheduled time has passed.
|
|
482
|
+
* Returns the items promoted so callers can invalidate their cache tags.
|
|
483
|
+
*/
|
|
484
|
+
async publishScheduled() {
|
|
485
|
+
return publishDueContent(this.db, { publish: (collection, id, options) => this.handleContentPublish(collection, id, options) });
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Run the full scheduled-maintenance batch: cron tasks, scheduled
|
|
489
|
+
* publishing, and system cleanup. For request-less drivers — the
|
|
490
|
+
* Cloudflare `scheduled()` handler invokes this from a Cron Trigger.
|
|
491
|
+
* (On Node the timer-based scheduler drives the same work itself.)
|
|
492
|
+
*
|
|
493
|
+
* Each step is independent and non-fatal. Returns the content promoted
|
|
494
|
+
* by the publishing sweep so the caller can purge edge-cache tags.
|
|
495
|
+
*
|
|
496
|
+
* `onPublished` (optional) is awaited after each collection's batch so a
|
|
497
|
+
* request-less driver can invalidate edge-cache tags incrementally rather
|
|
498
|
+
* than only after the whole sweep — bounding stale-cache exposure if the
|
|
499
|
+
* runtime is killed mid-sweep.
|
|
582
500
|
*/
|
|
583
|
-
|
|
584
|
-
if (this.
|
|
501
|
+
async runScheduledTasks(options = {}) {
|
|
502
|
+
if (this.cronExecutor) {
|
|
503
|
+
try {
|
|
504
|
+
await this.cronExecutor.tick();
|
|
505
|
+
} catch (error) {
|
|
506
|
+
console.error("[cron] Tick failed:", error);
|
|
507
|
+
}
|
|
508
|
+
try {
|
|
509
|
+
await this.cronExecutor.recoverStaleLocks();
|
|
510
|
+
} catch (error) {
|
|
511
|
+
console.error("[cron] Stale lock recovery failed:", error);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
let published = [];
|
|
515
|
+
try {
|
|
516
|
+
published = await publishDueContent(this.db, {
|
|
517
|
+
publish: (collection, id, opts) => this.handleContentPublish(collection, id, opts),
|
|
518
|
+
onPublished: options.onPublished
|
|
519
|
+
});
|
|
520
|
+
} catch (error) {
|
|
521
|
+
console.error("[scheduled-publish] Sweep failed:", error);
|
|
522
|
+
}
|
|
523
|
+
try {
|
|
524
|
+
await runSystemCleanup(this.db, this.storage ?? void 0);
|
|
525
|
+
} catch (error) {
|
|
526
|
+
console.error("[cleanup] System cleanup failed:", error);
|
|
527
|
+
}
|
|
528
|
+
return { published };
|
|
585
529
|
}
|
|
586
530
|
/**
|
|
587
531
|
* Stop the cron scheduler gracefully.
|
|
@@ -991,6 +935,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
991
935
|
});
|
|
992
936
|
let cronExecutor = null;
|
|
993
937
|
let cronScheduler = null;
|
|
938
|
+
const runtimeRef = { current: null };
|
|
994
939
|
await phase("rt.cron", "Cron init (recovery deferred post-response)", async () => {
|
|
995
940
|
try {
|
|
996
941
|
cronExecutor = new CronExecutor(db, invokeCronHook);
|
|
@@ -1003,22 +948,30 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1003
948
|
console.error("[cron] Failed to recover stale task locks:", error);
|
|
1004
949
|
}
|
|
1005
950
|
});
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
951
|
+
if (deps.createScheduler) {
|
|
952
|
+
const scheduler = deps.createScheduler(cronExecutor);
|
|
953
|
+
cronScheduler = scheduler;
|
|
954
|
+
scheduler.setSystemCleanup(async () => {
|
|
955
|
+
try {
|
|
956
|
+
const runtime = runtimeRef.current;
|
|
957
|
+
await publishDueContent(db, { publish: runtime ? (collection, id, options) => runtime.handleContentPublish(collection, id, options) : void 0 });
|
|
958
|
+
} catch (error) {
|
|
959
|
+
console.error("[scheduled-publish] Sweep failed:", error);
|
|
960
|
+
}
|
|
961
|
+
try {
|
|
962
|
+
await runSystemCleanup(db, storage ?? void 0);
|
|
963
|
+
} catch (error) {
|
|
964
|
+
console.error("[cleanup] System cleanup failed:", error);
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
pipeline.setContextFactory({ cronReschedule: () => cronScheduler?.reschedule() });
|
|
968
|
+
scheduler.start();
|
|
969
|
+
}
|
|
1017
970
|
} catch (error) {
|
|
1018
971
|
console.warn("[cron] Failed to initialize cron system:", error);
|
|
1019
972
|
}
|
|
1020
973
|
});
|
|
1021
|
-
|
|
974
|
+
const runtime = new EmDashRuntime({
|
|
1022
975
|
db,
|
|
1023
976
|
storage,
|
|
1024
977
|
configuredPlugins: [...deps.plugins, ...bypassedPluginsList],
|
|
@@ -1038,6 +991,8 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1038
991
|
runtimeDeps: deps,
|
|
1039
992
|
pipelineRef
|
|
1040
993
|
});
|
|
994
|
+
runtimeRef.current = runtime;
|
|
995
|
+
return runtime;
|
|
1041
996
|
}
|
|
1042
997
|
/**
|
|
1043
998
|
* Get a media provider by ID
|
|
@@ -1086,9 +1041,9 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1086
1041
|
}
|
|
1087
1042
|
})();
|
|
1088
1043
|
if (collectionCount.count === 0 && !setupDone) {
|
|
1089
|
-
const { applySeed } = await import("../apply-
|
|
1090
|
-
const { loadSeed } = await import("../load-
|
|
1091
|
-
const { validateSeed } = await import("../validate-
|
|
1044
|
+
const { applySeed } = await import("../apply-Dr7snAMT.mjs").then((n) => n.n);
|
|
1045
|
+
const { loadSeed } = await import("../load-BBetCvLC.mjs").then((n) => n.r);
|
|
1046
|
+
const { validateSeed } = await import("../validate-Bz4vqcX1.mjs").then((n) => n.n);
|
|
1092
1047
|
const seed = await loadSeed();
|
|
1093
1048
|
if (validateSeed(seed).valid) {
|
|
1094
1049
|
await applySeed(db, seed, { onConflict: "skip" });
|
|
@@ -1543,26 +1498,25 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1543
1498
|
* defend against FTS not existing yet (pre-setup).
|
|
1544
1499
|
*/
|
|
1545
1500
|
async ensureSearchHealthy() {
|
|
1546
|
-
if (this.
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
this._searchHealthPromise = null;
|
|
1559
|
-
}
|
|
1560
|
-
})();
|
|
1561
|
-
return this._searchHealthPromise;
|
|
1501
|
+
if (!isSqlite(this._db)) return;
|
|
1502
|
+
try {
|
|
1503
|
+
await isolateCachedAsync(this._searchHealthCache, async () => {
|
|
1504
|
+
try {
|
|
1505
|
+
const repaired = await new FTSManager(this._db).verifyAndRepairAll();
|
|
1506
|
+
if (repaired > 0) console.log(`Repaired ${repaired} corrupted FTS index(es)`);
|
|
1507
|
+
} catch {}
|
|
1508
|
+
}, {
|
|
1509
|
+
anchor: (promise) => after(() => promise),
|
|
1510
|
+
ownerTimeoutMs: 3e4
|
|
1511
|
+
});
|
|
1512
|
+
} catch {}
|
|
1562
1513
|
}
|
|
1563
1514
|
async handleContentList(collection, params) {
|
|
1564
1515
|
return handleContentList(this.db, collection, params);
|
|
1565
1516
|
}
|
|
1517
|
+
async handleContentAuthors(collection) {
|
|
1518
|
+
return handleContentAuthors(this.db, collection);
|
|
1519
|
+
}
|
|
1566
1520
|
async handleContentGet(collection, id, locale) {
|
|
1567
1521
|
const result = await handleContentGet(this.db, collection, id, locale);
|
|
1568
1522
|
return this.hydrateDraftData(result);
|
|
@@ -1619,7 +1573,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1619
1573
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(body.data, collection, true)).content;
|
|
1620
1574
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, true);
|
|
1621
1575
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1622
|
-
const { validateContentData } = await import("../validation-
|
|
1576
|
+
const { validateContentData } = await import("../validation-DgGTJm3u.mjs");
|
|
1623
1577
|
const validation = await validateContentData(this.db, collection, processedData, { partial: false });
|
|
1624
1578
|
if (!validation.ok) return {
|
|
1625
1579
|
success: false,
|
|
@@ -1635,7 +1589,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1635
1589
|
return result;
|
|
1636
1590
|
}
|
|
1637
1591
|
async handleContentUpdate(collection, id, body) {
|
|
1638
|
-
const { ContentRepository } = await import("../content-
|
|
1592
|
+
const { ContentRepository } = await import("../content-BIlVx-RX.mjs").then((n) => n.n);
|
|
1639
1593
|
const repo = new ContentRepository(this.db);
|
|
1640
1594
|
const resolvedItem = await repo.findByIdOrSlug(collection, id, body.locale);
|
|
1641
1595
|
const resolvedId = resolvedItem?.id ?? id;
|
|
@@ -1662,7 +1616,7 @@ var EmDashRuntime = class EmDashRuntime {
|
|
|
1662
1616
|
if (this.hooks.hasHooks("content:beforeSave")) processedData = (await this.hooks.runContentBeforeSave(bodyWithoutRev.data, collection, false)).content;
|
|
1663
1617
|
processedData = await this.runSandboxedBeforeSave(processedData, collection, false);
|
|
1664
1618
|
processedData = await this.normalizeMediaFields(collection, processedData);
|
|
1665
|
-
const { validateContentData } = await import("../validation-
|
|
1619
|
+
const { validateContentData } = await import("../validation-DgGTJm3u.mjs");
|
|
1666
1620
|
const validation = await validateContentData(this.db, collection, processedData, { partial: true });
|
|
1667
1621
|
if (!validation.ok) return {
|
|
1668
1622
|
success: false,
|
|
@@ -2375,6 +2329,7 @@ function buildDependencies(config) {
|
|
|
2375
2329
|
plugins: getPlugins(),
|
|
2376
2330
|
createDialect,
|
|
2377
2331
|
createStorage,
|
|
2332
|
+
createScheduler,
|
|
2378
2333
|
sandboxEnabled: sandboxModule.sandboxEnabled,
|
|
2379
2334
|
sandboxBypassed: sandboxModule.sandboxBypassed ?? false,
|
|
2380
2335
|
sandboxedPluginEntries: sandboxedPlugins || [],
|
|
@@ -2406,6 +2361,25 @@ async function getRuntime(config, initTimings) {
|
|
|
2406
2361
|
});
|
|
2407
2362
|
}
|
|
2408
2363
|
/**
|
|
2364
|
+
* Run scheduled maintenance (cron tasks, scheduled publishing, system cleanup)
|
|
2365
|
+
* outside any request. Resolves the runtime from the build-time virtual config
|
|
2366
|
+
* and the cached singleton — the same instance request handlers use.
|
|
2367
|
+
*
|
|
2368
|
+
* Wired into a platform heartbeat that is not a request: the Cloudflare Worker's
|
|
2369
|
+
* `scheduled()` handler (Cron Trigger) calls this. On Node the runtime's own
|
|
2370
|
+
* timer-based scheduler already drives the same work, so this isn't needed there.
|
|
2371
|
+
*
|
|
2372
|
+
* Returns the content promoted by the publishing sweep so the caller can purge
|
|
2373
|
+
* edge-cache tags for it. `onPublished` (optional) is awaited after each
|
|
2374
|
+
* collection's batch so the caller can invalidate edge-cache tags incrementally
|
|
2375
|
+
* rather than only after the whole sweep.
|
|
2376
|
+
*/
|
|
2377
|
+
async function runScheduledTasks(options = {}) {
|
|
2378
|
+
const config = getConfig();
|
|
2379
|
+
if (!config) return { published: [] };
|
|
2380
|
+
return (await getRuntime(config)).runScheduledTasks(options);
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2409
2383
|
* Astro attaches AstroCookies to outgoing responses via a well-known global
|
|
2410
2384
|
* symbol. Cloning a Response (`new Response(body, init)`) drops non-header
|
|
2411
2385
|
* metadata, so any middleware that wraps the response must explicitly forward
|
|
@@ -2460,6 +2434,11 @@ function pushMetricsTimings(timings, metrics) {
|
|
|
2460
2434
|
desc: "Last query at"
|
|
2461
2435
|
});
|
|
2462
2436
|
}
|
|
2437
|
+
if (metrics.rpcCount > 0) timings.push({
|
|
2438
|
+
name: "rpc.count",
|
|
2439
|
+
dur: metrics.rpcCount,
|
|
2440
|
+
desc: "DB round trips"
|
|
2441
|
+
});
|
|
2463
2442
|
if (metrics.cacheHits + metrics.cacheMisses > 0) {
|
|
2464
2443
|
timings.push({
|
|
2465
2444
|
name: "cache.hit",
|
|
@@ -2509,7 +2488,7 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2509
2488
|
if (!isSetupVerified()) {
|
|
2510
2489
|
const t0 = performance.now();
|
|
2511
2490
|
try {
|
|
2512
|
-
const { getDb } = await import("../loader-
|
|
2491
|
+
const { getDb } = await import("../loader-ZN1ll-d-.mjs").then((n) => n.i);
|
|
2513
2492
|
await (await getDb()).selectFrom("_emdash_migrations").selectAll().limit(1).execute();
|
|
2514
2493
|
markSetupVerified();
|
|
2515
2494
|
} catch (error) {
|
|
@@ -2576,9 +2555,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2576
2555
|
db: anonScoped.db,
|
|
2577
2556
|
metrics
|
|
2578
2557
|
}, async () => {
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2558
|
+
try {
|
|
2559
|
+
return await runAnon();
|
|
2560
|
+
} finally {
|
|
2561
|
+
anonScoped.commit();
|
|
2562
|
+
}
|
|
2582
2563
|
});
|
|
2583
2564
|
}
|
|
2584
2565
|
return runAnon();
|
|
@@ -2690,9 +2671,11 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2690
2671
|
db: scoped.db,
|
|
2691
2672
|
metrics
|
|
2692
2673
|
}, async () => {
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2674
|
+
try {
|
|
2675
|
+
return await renderAndFinalize();
|
|
2676
|
+
} finally {
|
|
2677
|
+
scoped.commit();
|
|
2678
|
+
}
|
|
2696
2679
|
});
|
|
2697
2680
|
}
|
|
2698
2681
|
return renderAndFinalize();
|
|
@@ -2726,5 +2709,5 @@ const onRequest = defineMiddleware(async (context, next) => {
|
|
|
2726
2709
|
});
|
|
2727
2710
|
|
|
2728
2711
|
//#endregion
|
|
2729
|
-
export { onRequest as default, onRequest };
|
|
2712
|
+
export { onRequest as default, onRequest, runScheduledTasks };
|
|
2730
2713
|
//# sourceMappingURL=middleware.mjs.map
|