emdash 0.26.0 → 0.28.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-DAAjOID4.d.mts → adapters-hUy8vOB-.d.mts} +1 -1
- package/dist/{adapters-DAAjOID4.d.mts.map → adapters-hUy8vOB-.d.mts.map} +1 -1
- package/dist/{allowed-origins-D5FxMUo8.mjs → allowed-origins-CRsJ6BPM.mjs} +2 -2
- package/dist/{allowed-origins-D5FxMUo8.mjs.map → allowed-origins-CRsJ6BPM.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +17 -16
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/api/schemas/index.mjs +3 -3
- package/dist/{api-BMfveMoB.mjs → api-BFURZn1i.mjs} +104 -38
- package/dist/api-BFURZn1i.mjs.map +1 -0
- package/dist/{api-tokens-D6ppjIVi.mjs → api-tokens-DvqeZmVq.mjs} +2 -2
- package/dist/{api-tokens-D6ppjIVi.mjs.map → api-tokens-DvqeZmVq.mjs.map} +1 -1
- package/dist/{apply--IVNSdXn.mjs → apply-Bu-8nYHL.mjs} +113 -76
- package/dist/apply-Bu-8nYHL.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -11
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +13 -5
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -9
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +52 -12
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +2 -9
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +125 -71
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +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 +4 -4
- 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 +14 -14
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +14 -14
- package/dist/astro/routes/api/admin/bylines/index.mjs +14 -14
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/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 +38 -37
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +38 -37
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +37 -36
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +37 -36
- 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 +36 -35
- 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 +36 -35
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +36 -35
- 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 +37 -36
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +37 -36
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +36 -35
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +36 -35
- 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 +36 -35
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +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 +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- 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 +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +7 -7
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
- 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 +9 -9
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +7 -7
- 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.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/index.mjs +7 -7
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- 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 -11
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -40
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +12 -407
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -9
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +9 -9
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +19 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +97 -79
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +19 -11
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +40 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +519 -39
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.d.mts.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +39 -39
- package/dist/astro/routes/api/media/_id_/confirm.mjs +7 -7
- package/dist/astro/routes/api/media/_id_.mjs +7 -7
- 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 +8 -8
- package/dist/astro/routes/api/media.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/items.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_/translations.mjs +9 -9
- package/dist/astro/routes/api/menus/_name_.mjs +9 -9
- package/dist/astro/routes/api/menus/index.mjs +9 -9
- 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 +4 -4
- 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 +36 -35
- 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 +36 -35
- 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 +36 -35
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +36 -35
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +7 -6
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +36 -35
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +36 -35
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +10 -10
- package/dist/astro/routes/api/search/index.mjs +9 -9
- package/dist/astro/routes/api/search/rebuild.mjs +10 -10
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +9 -9
- package/dist/astro/routes/api/sections/_slug_.mjs +9 -9
- package/dist/astro/routes/api/sections/index.mjs +9 -9
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +28 -25
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +26 -25
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- 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 +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/index.mjs +13 -13
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +5 -5
- package/dist/astro/routes/api/well-known/auth.mjs +1 -1
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +7 -7
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +9 -9
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +9 -9
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/types.d.mts +14 -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-BZnOGJFo.mjs → authorize-Dz88F_Fw.mjs} +2 -2
- package/dist/{authorize-BZnOGJFo.mjs.map → authorize-Dz88F_Fw.mjs.map} +1 -1
- package/dist/{byline-LL8lyqdb.mjs → byline-Bm8ZgUP9.mjs} +6 -6
- package/dist/{byline-LL8lyqdb.mjs.map → byline-Bm8ZgUP9.mjs.map} +1 -1
- package/dist/{byline-fields-eyJMblSr.mjs → byline-fields-2Lp5Hbgf.mjs} +18 -3
- package/dist/byline-fields-2Lp5Hbgf.mjs.map +1 -0
- package/dist/{byline-fields-DaMKzkhO.mjs → byline-fields-CIx_GuN4.mjs} +1 -1
- package/dist/{byline-fields-DaMKzkhO.mjs.map → byline-fields-CIx_GuN4.mjs.map} +1 -1
- package/dist/{byline-fields-KD3JFRuH.d.mts → byline-fields-Cgrt9-aL.d.mts} +18 -3
- package/dist/{byline-fields-KD3JFRuH.d.mts.map → byline-fields-Cgrt9-aL.d.mts.map} +1 -1
- package/dist/{bylines-BmJ7Vg7J.mjs → bylines-6tm9mgQb.mjs} +4 -4
- package/dist/{bylines-BmJ7Vg7J.mjs.map → bylines-6tm9mgQb.mjs.map} +1 -1
- package/dist/{bylines-DE47vP8d.mjs → bylines-Woq87129.mjs} +6 -6
- package/dist/{bylines-DE47vP8d.mjs.map → bylines-Woq87129.mjs.map} +1 -1
- package/dist/{cache-D9jF5bYw.mjs → cache-CEBAZjir.mjs} +2 -2
- package/dist/{cache-D9jF5bYw.mjs.map → cache-CEBAZjir.mjs.map} +1 -1
- package/dist/{challenge-store-LhiqMccz.mjs → challenge-store-anhwVER0.mjs} +1 -1
- package/dist/{challenge-store-LhiqMccz.mjs.map → challenge-store-anhwVER0.mjs.map} +1 -1
- package/dist/{chunks-OCG163rN.mjs → chunks-B2isWQhr.mjs} +2 -2
- package/dist/{chunks-OCG163rN.mjs.map → chunks-B2isWQhr.mjs.map} +1 -1
- package/dist/cli/index.mjs +23 -22
- 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-D9BLDpZI.mjs → comment-CzeatwBV.mjs} +3 -3
- package/dist/{comment-D9BLDpZI.mjs.map → comment-CzeatwBV.mjs.map} +1 -1
- package/dist/{comment-reaction-Drl9SkNu.mjs → comment-reaction-Cj9QJY7I.mjs} +2 -2
- package/dist/{comment-reaction-Drl9SkNu.mjs.map → comment-reaction-Cj9QJY7I.mjs.map} +1 -1
- package/dist/{comments-BjJ9SKGU.mjs → comments-BLE-jv5k.mjs} +3 -3
- package/dist/{comments-BjJ9SKGU.mjs.map → comments-BLE-jv5k.mjs.map} +1 -1
- package/dist/{components-CYt4uVK9.mjs → components-B_sATNUc.mjs} +1 -1
- package/dist/{components-CYt4uVK9.mjs.map → components-B_sATNUc.mjs.map} +1 -1
- package/dist/{content-ncUWWjna.mjs → content-DhgEth4k.mjs} +4 -4
- package/dist/{content-ncUWWjna.mjs.map → content-DhgEth4k.mjs.map} +1 -1
- package/dist/content-refresh-CA4uKwzH.mjs +1531 -0
- package/dist/content-refresh-CA4uKwzH.mjs.map +1 -0
- package/dist/{context-C_g-iJVA.mjs → context-CUsR9dXL.mjs} +76 -54
- package/dist/context-CUsR9dXL.mjs.map +1 -0
- package/dist/{cron-C5LVoNmP.mjs → cron-v4FTEFR_.mjs} +1 -1
- package/dist/{cron-C5LVoNmP.mjs.map → cron-v4FTEFR_.mjs.map} +1 -1
- package/dist/{dashboard-CotyqQrW.mjs → dashboard-EvEKF5en.mjs} +4 -4
- package/dist/{dashboard-CotyqQrW.mjs.map → dashboard-EvEKF5en.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-CeRG-Ot4.mjs → default-CM_D83Mg.mjs} +1 -1
- package/dist/{default-CeRG-Ot4.mjs.map → default-CM_D83Mg.mjs.map} +1 -1
- package/dist/{device-flow-DENDCQ9F.mjs → device-flow-CfGP18Uw.mjs} +4 -4
- package/dist/{device-flow-DENDCQ9F.mjs.map → device-flow-CfGP18Uw.mjs.map} +1 -1
- package/dist/{email-console-DJP32ucW.mjs → email-console-CIf4Lfvv.mjs} +1 -1
- package/dist/{email-console-DJP32ucW.mjs.map → email-console-CIf4Lfvv.mjs.map} +1 -1
- package/dist/{error-rVGiqWDt.mjs → error-CkAseSqZ.mjs} +2 -2
- package/dist/{error-rVGiqWDt.mjs.map → error-CkAseSqZ.mjs.map} +1 -1
- package/dist/{escape-Bjio4ZsM.mjs → escape-DqD0aCKu.mjs} +1 -1
- package/dist/{escape-Bjio4ZsM.mjs.map → escape-DqD0aCKu.mjs.map} +1 -1
- package/dist/{field-defs-cache-ljXzJCfc.mjs → field-defs-cache-WUI88LX5.mjs} +2 -2
- package/dist/{field-defs-cache-ljXzJCfc.mjs.map → field-defs-cache-WUI88LX5.mjs.map} +1 -1
- package/dist/{fts-manager-BbCCbEKA.mjs → fts-manager-BbFaF_V8.mjs} +2 -2
- package/dist/{fts-manager-BbCCbEKA.mjs.map → fts-manager-BbFaF_V8.mjs.map} +1 -1
- package/dist/{import-Bb1T9WJS.mjs → import-fYLf14Co.mjs} +514 -25
- package/dist/import-fYLf14Co.mjs.map +1 -0
- package/dist/{index-BRNabKrx.d.mts → index-B9sIxwe4.d.mts} +2420 -2379
- package/dist/index-B9sIxwe4.d.mts.map +1 -0
- package/dist/{index-Dt0OKJB4.d.mts → index-Bm-Gy8Mh.d.mts} +25 -4
- package/dist/index-Bm-Gy8Mh.d.mts.map +1 -0
- package/dist/index.d.mts +18 -17
- package/dist/index.mjs +54 -53
- package/dist/{load-DMjXghbZ.mjs → load-Djn3HWQS.mjs} +2 -2
- package/dist/{load-DMjXghbZ.mjs.map → load-Djn3HWQS.mjs.map} +1 -1
- package/dist/{loader-BA_zhkS_.mjs → loader-CB6YHeul.mjs} +6 -5
- package/dist/loader-CB6YHeul.mjs.map +1 -0
- package/dist/{manifest-schema-kPGX7VS-.mjs → manifest-schema-BHlgZM1W.mjs} +1 -1
- package/dist/{manifest-schema-kPGX7VS-.mjs.map → manifest-schema-BHlgZM1W.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +12 -11
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +5 -5
- package/dist/{media-C5t_eCnk.mjs → media-BrXIaMFN.mjs} +2 -2
- package/dist/{media-C5t_eCnk.mjs.map → media-BrXIaMFN.mjs.map} +1 -1
- package/dist/{media-allowlist-Du8t1u6a.mjs → media-allowlist-CRHEeJ_i.mjs} +1 -1
- package/dist/{media-allowlist-Du8t1u6a.mjs.map → media-allowlist-CRHEeJ_i.mjs.map} +1 -1
- package/dist/{media-url-O4rm9-SQ.mjs → media-url-CKi5XSw4.mjs} +1 -1
- package/dist/{media-url-O4rm9-SQ.mjs.map → media-url-CKi5XSw4.mjs.map} +1 -1
- package/dist/{menus-CBb6UrMU.mjs → menus-Cfivc2Ad.mjs} +3 -3
- package/dist/{menus-CBb6UrMU.mjs.map → menus-Cfivc2Ad.mjs.map} +1 -1
- package/dist/{menus-CYH09a41.mjs → menus-CsZ2ZEK2.mjs} +16 -12
- package/dist/{menus-CYH09a41.mjs.map → menus-CsZ2ZEK2.mjs.map} +1 -1
- package/dist/{mode-BB0F8xTC.mjs → mode-BM9QgEmt.mjs} +1 -1
- package/dist/{mode-BB0F8xTC.mjs.map → mode-BM9QgEmt.mjs.map} +1 -1
- package/dist/{oauth-authorization-CsvzIp_F.mjs → oauth-authorization-CXWkIGT4.mjs} +4 -4
- package/dist/{oauth-authorization-CsvzIp_F.mjs.map → oauth-authorization-CXWkIGT4.mjs.map} +1 -1
- package/dist/{oauth-clients-C9SYwEbZ.mjs → oauth-clients-BmTI5rsl.mjs} +1 -1
- package/dist/{oauth-clients-C9SYwEbZ.mjs.map → oauth-clients-BmTI5rsl.mjs.map} +1 -1
- package/dist/{oauth-state-store---zrApfB.mjs → oauth-state-store-YLFLcH5F.mjs} +1 -1
- package/dist/{oauth-state-store---zrApfB.mjs.map → oauth-state-store-YLFLcH5F.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-SHsWRlG9.mjs → oauth-user-lookup-Bsc_GsX-.mjs} +1 -1
- package/dist/{oauth-user-lookup-SHsWRlG9.mjs.map → oauth-user-lookup-Bsc_GsX-.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-CHbHv83-.mjs → object-cache-Bok5j2ae.mjs} +43 -3
- package/dist/object-cache-Bok5j2ae.mjs.map +1 -0
- package/dist/{options-41nCWqi9.d.mts → options-iMpRRxIe.d.mts} +3 -3
- package/dist/{options-41nCWqi9.d.mts.map → options-iMpRRxIe.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BwAdS7FZ.mjs → parse-GmjecGct.mjs} +2 -2
- package/dist/{parse-BwAdS7FZ.mjs.map → parse-GmjecGct.mjs.map} +1 -1
- package/dist/{passkey-config-C0YfSBko.mjs → passkey-config-De0ahnRg.mjs} +1 -1
- package/dist/{passkey-config-C0YfSBko.mjs.map → passkey-config-De0ahnRg.mjs.map} +1 -1
- package/dist/{placeholder-Cuce9U-m.d.mts → placeholder-BSKwzRe4.d.mts} +1 -1
- package/dist/{placeholder-Cuce9U-m.d.mts.map → placeholder-BSKwzRe4.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +10 -9
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{portable-text-BICg8bTk.mjs → portable-text-cCa0cGV6.mjs} +1 -1
- package/dist/{portable-text-BICg8bTk.mjs.map → portable-text-cCa0cGV6.mjs.map} +1 -1
- package/dist/{preview-DKGCt2_p.mjs → preview-SSXNVPAC.mjs} +2 -2
- package/dist/{preview-DKGCt2_p.mjs.map → preview-SSXNVPAC.mjs.map} +1 -1
- package/dist/{public-url-CTVqgMmg.mjs → public-url-Danv47cS.mjs} +1 -1
- package/dist/{public-url-CTVqgMmg.mjs.map → public-url-Danv47cS.mjs.map} +1 -1
- package/dist/{query-BpQb-blG.mjs → query-ByGq6ver.mjs} +14 -14
- package/dist/{query-BpQb-blG.mjs.map → query-ByGq6ver.mjs.map} +1 -1
- package/dist/{rate-limit-Dap6HMNM.mjs → rate-limit-C_Lf63Dd.mjs} +2 -2
- package/dist/{rate-limit-Dap6HMNM.mjs.map → rate-limit-C_Lf63Dd.mjs.map} +1 -1
- package/dist/{redirect-CS-PHtNh.mjs → redirect-CoW3G-0U.mjs} +1 -1
- package/dist/{redirect-CS-PHtNh.mjs.map → redirect-CoW3G-0U.mjs.map} +1 -1
- package/dist/{redirect-_M0trWoo.mjs → redirect-IyfNirgS.mjs} +2 -2
- package/dist/{redirect-_M0trWoo.mjs.map → redirect-IyfNirgS.mjs.map} +1 -1
- package/dist/{redirects-w0V9vj_j.mjs → redirects-Bs1g42Ri.mjs} +4 -4
- package/dist/{redirects-w0V9vj_j.mjs.map → redirects-Bs1g42Ri.mjs.map} +1 -1
- package/dist/{redirects-Dcbuisoj.mjs → redirects-DXEXBAII.mjs} +2 -2
- package/dist/{redirects-Dcbuisoj.mjs.map → redirects-DXEXBAII.mjs.map} +1 -1
- package/dist/{registry-g8yYt4cC.mjs → registry-B65mUtPa.mjs} +122 -79
- package/dist/registry-B65mUtPa.mjs.map +1 -0
- package/dist/{request-meta-CmS1tDFf.mjs → request-meta-DbvXaAvU.mjs} +2 -2
- package/dist/{request-meta-CmS1tDFf.mjs.map → request-meta-DbvXaAvU.mjs.map} +1 -1
- package/dist/{resolve-C7I0qiR0.mjs → resolve-DR3wqMTy.mjs} +1 -1
- package/dist/{resolve-C7I0qiR0.mjs.map → resolve-DR3wqMTy.mjs.map} +1 -1
- package/dist/{runner-BbR3DfrL.d.mts → runner-DvFWoz8-.d.mts} +2 -2
- package/dist/{runner-BbR3DfrL.d.mts.map → runner-DvFWoz8-.d.mts.map} +1 -1
- package/dist/{runner-DPdt_Wpa.mjs → runner-K8XK101B.mjs} +351 -199
- package/dist/runner-K8XK101B.mjs.map +1 -0
- package/dist/runtime.d.mts +11 -10
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +2 -2
- package/dist/scheduled-publish-Drffrf2a.d.mts +11 -0
- package/dist/scheduled-publish-Drffrf2a.d.mts.map +1 -0
- package/dist/{schema-DoLd3j2e.mjs → schema-Blhoxp3P.mjs} +5 -5
- package/dist/{schema-DoLd3j2e.mjs.map → schema-Blhoxp3P.mjs.map} +1 -1
- package/dist/{search-BR0ZeZmh.mjs → search-DZN2HZ-V.mjs} +6 -4
- package/dist/search-DZN2HZ-V.mjs.map +1 -0
- package/dist/{secrets-BSf9pRRY.mjs → secrets-kp760LlD.mjs} +2 -2
- package/dist/{secrets-BSf9pRRY.mjs.map → secrets-kp760LlD.mjs.map} +1 -1
- package/dist/{sections-5J2YJPqJ.mjs → sections-CpF5SaGr.mjs} +3 -3
- package/dist/{sections-5J2YJPqJ.mjs.map → sections-CpF5SaGr.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +19 -18
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-BkhuuaaE.mjs → seo-89-53DDs.mjs} +1 -1
- package/dist/{seo-BkhuuaaE.mjs.map → seo-89-53DDs.mjs.map} +1 -1
- package/dist/{seo-DKeXHkzE.mjs → seo-DXu2UQnC.mjs} +3 -3
- package/dist/{seo-DKeXHkzE.mjs.map → seo-DXu2UQnC.mjs.map} +1 -1
- package/dist/{service-BbO2s8gT.mjs → service-DQmiBMzt.mjs} +3 -3
- package/dist/{service-BbO2s8gT.mjs.map → service-DQmiBMzt.mjs.map} +1 -1
- package/dist/{session-user-B8aLtKAH.mjs → session-user-Cascbax7.mjs} +1 -1
- package/dist/{session-user-B8aLtKAH.mjs.map → session-user-Cascbax7.mjs.map} +1 -1
- package/dist/{settings-BMNr9Dmi.mjs → settings-rZyHEcNT.mjs} +3 -3
- package/dist/{settings-BMNr9Dmi.mjs.map → settings-rZyHEcNT.mjs.map} +1 -1
- package/dist/{settings-DJeki-97.mjs → settings-zhmdKyJQ.mjs} +5 -5
- package/dist/{settings-DJeki-97.mjs.map → settings-zhmdKyJQ.mjs.map} +1 -1
- package/dist/{setup-complete-gEiySUc-.mjs → setup-complete-Cb3LRyzy.mjs} +1 -1
- package/dist/{setup-complete-gEiySUc-.mjs.map → setup-complete-Cb3LRyzy.mjs.map} +1 -1
- package/dist/{setup-nonce-DzS50zme.mjs → setup-nonce-Z8x0tHf8.mjs} +1 -1
- package/dist/{setup-nonce-DzS50zme.mjs.map → setup-nonce-Z8x0tHf8.mjs.map} +1 -1
- package/dist/{single-flight-cache-Cdfkic3t.mjs → single-flight-cache-BG3B_GhN.mjs} +1 -1
- package/dist/{single-flight-cache-Cdfkic3t.mjs.map → single-flight-cache-BG3B_GhN.mjs.map} +1 -1
- package/dist/{site-url-BLebyON8.mjs → site-url-BBfDTgZB.mjs} +1 -1
- package/dist/{site-url-BLebyON8.mjs.map → site-url-BBfDTgZB.mjs.map} +1 -1
- package/dist/{ssrf-BRKb343l.mjs → ssrf-1g7usGBg.mjs} +1 -1
- package/dist/{ssrf-BRKb343l.mjs.map → ssrf-1g7usGBg.mjs.map} +1 -1
- package/dist/{status-vUK0SA17.mjs → status-CqJQX1QN.mjs} +1 -1
- package/dist/{status-vUK0SA17.mjs.map → status-CqJQX1QN.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-CM_fUqLU.mjs → taxonomies-BGBd16Eu.mjs} +4 -4
- package/dist/{taxonomies-CM_fUqLU.mjs.map → taxonomies-BGBd16Eu.mjs.map} +1 -1
- package/dist/{taxonomies-D13i2ctt.mjs → taxonomies-Cnb4F-Pb.mjs} +7 -7
- package/dist/{taxonomies-D13i2ctt.mjs.map → taxonomies-Cnb4F-Pb.mjs.map} +1 -1
- package/dist/{taxonomy-BU0LjdVb.mjs → taxonomy-BxGxZZdu.mjs} +4 -4
- package/dist/{taxonomy-BU0LjdVb.mjs.map → taxonomy-BxGxZZdu.mjs.map} +1 -1
- package/dist/{tokens-LeuXF9gG.mjs → tokens-BGT0TUUo.mjs} +1 -1
- package/dist/{tokens-LeuXF9gG.mjs.map → tokens-BGT0TUUo.mjs.map} +1 -1
- package/dist/{transport-BZ-03aFT.d.mts → transport-BMDWHSgZ.d.mts} +1 -1
- package/dist/{transport-BZ-03aFT.d.mts.map → transport-BMDWHSgZ.d.mts.map} +1 -1
- package/dist/{transport-_2nBz7e9.mjs → transport-DPefPMcz.mjs} +1 -1
- package/dist/{transport-_2nBz7e9.mjs.map → transport-DPefPMcz.mjs.map} +1 -1
- package/dist/{trusted-proxy-DZY5WCn2.mjs → trusted-proxy-VTPRiX2s.mjs} +1 -1
- package/dist/{trusted-proxy-DZY5WCn2.mjs.map → trusted-proxy-VTPRiX2s.mjs.map} +1 -1
- package/dist/{types-ETmO_jQr.d.mts → types-BcLUUbbR.d.mts} +2 -2
- package/dist/{types-ETmO_jQr.d.mts.map → types-BcLUUbbR.d.mts.map} +1 -1
- package/dist/{types-BYnDBVwe.d.mts → types-CGbYowGQ.d.mts} +2 -2
- package/dist/{types-BYnDBVwe.d.mts.map → types-CGbYowGQ.d.mts.map} +1 -1
- package/dist/{types-BWqGVhFn.d.mts → types-CgvhU-hF.d.mts} +1 -1
- package/dist/{types-BWqGVhFn.d.mts.map → types-CgvhU-hF.d.mts.map} +1 -1
- package/dist/{types-fS7-VTdR.d.mts → types-ClUkdbWb.d.mts} +1 -1
- package/dist/{types-fS7-VTdR.d.mts.map → types-ClUkdbWb.d.mts.map} +1 -1
- package/dist/{types-CZgK3EMW.mjs → types-CuW0zWDA.mjs} +2 -2
- package/dist/{types-CZgK3EMW.mjs.map → types-CuW0zWDA.mjs.map} +1 -1
- package/dist/{types-BG8_XTLj.d.mts → types-DmHk7vAt.d.mts} +1 -1
- package/dist/{types-BG8_XTLj.d.mts.map → types-DmHk7vAt.d.mts.map} +1 -1
- package/dist/{types-CQAugunJ.mjs → types-Jo3UYd6b.mjs} +1 -1
- package/dist/{types-CQAugunJ.mjs.map → types-Jo3UYd6b.mjs.map} +1 -1
- package/dist/{types-xIfVRNLp.d.mts → types-_HFLRzTn.d.mts} +22 -1
- package/dist/types-_HFLRzTn.d.mts.map +1 -0
- package/dist/{types-DrYMm9s5.d.mts → types-ea9sAPck.d.mts} +1 -1
- package/dist/{types-DrYMm9s5.d.mts.map → types-ea9sAPck.d.mts.map} +1 -1
- package/dist/{types-CNlaBFzx.d.mts → types-g_aFIdW0.d.mts} +1 -1
- package/dist/{types-CNlaBFzx.d.mts.map → types-g_aFIdW0.d.mts.map} +1 -1
- package/dist/{types-CUsXGRVj.d.mts → types-vgEWF18A.d.mts} +19 -1
- package/dist/{types-CUsXGRVj.d.mts.map → types-vgEWF18A.d.mts.map} +1 -1
- package/dist/{user-DkG2jKCp.mjs → user-BjAOvU3Z.mjs} +3 -3
- package/dist/{user-DkG2jKCp.mjs.map → user-BjAOvU3Z.mjs.map} +1 -1
- package/dist/{utils-B7A57fm9.mjs → utils-BJXElxdw.mjs} +156 -7
- package/dist/utils-BJXElxdw.mjs.map +1 -0
- package/dist/{validate-CuJ1Ps9j.mjs → validate-CWSnKVIJ.mjs} +2 -2
- package/dist/{validate-CuJ1Ps9j.mjs.map → validate-CWSnKVIJ.mjs.map} +1 -1
- package/dist/{validate-CG0V0wNR.d.mts → validate-Z1b86_3B.d.mts} +11 -6
- package/dist/{validate-CG0V0wNR.d.mts.map → validate-Z1b86_3B.d.mts.map} +1 -1
- package/dist/{validation-CwUfTdGF.mjs → validation-c8WjhH8z.mjs} +8 -5
- package/dist/{validation-CwUfTdGF.mjs.map → validation-c8WjhH8z.mjs.map} +1 -1
- package/dist/version-CaccU7DM.mjs +7 -0
- package/dist/{version-BoNBItP_.mjs.map → version-CaccU7DM.mjs.map} +1 -1
- package/dist/{widgets-BfOZ-ajY.mjs → widgets-hWcIicX8.mjs} +3 -3
- package/dist/{widgets-BfOZ-ajY.mjs.map → widgets-hWcIicX8.mjs.map} +1 -1
- package/dist/wxr-taxonomies-0_uxSrmf.d.mts +34 -0
- package/dist/wxr-taxonomies-0_uxSrmf.d.mts.map +1 -0
- package/dist/wxr-taxonomies-BC3OYpvx.mjs +425 -0
- package/dist/wxr-taxonomies-BC3OYpvx.mjs.map +1 -0
- package/dist/{zod-generator-gFsRuNNy.mjs → zod-generator-CacrR-i8.mjs} +2 -2
- package/dist/{zod-generator-gFsRuNNy.mjs.map → zod-generator-CacrR-i8.mjs.map} +1 -1
- package/package.json +6 -6
- package/src/api/handlers/content.ts +69 -23
- package/src/api/handlers/plugins.ts +77 -10
- package/src/api/schemas/import.ts +19 -0
- package/src/astro/integration/runtime.ts +3 -6
- package/src/astro/integration/vite-config.ts +19 -1
- package/src/astro/middleware/auth.ts +10 -3
- package/src/astro/middleware/csp.ts +54 -3
- package/src/astro/middleware.ts +1 -0
- package/src/astro/routes/admin.astro +9 -0
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +6 -1
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +6 -1
- package/src/astro/routes/api/admin/plugins/[id]/index.ts +1 -0
- package/src/astro/routes/api/admin/plugins/index.ts +1 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +122 -98
- package/src/astro/routes/api/import/wordpress-plugin/execute.ts +794 -44
- package/src/astro/routes/api/manifest.ts +20 -1
- package/src/astro/routes/api/setup/dev-bypass.ts +7 -2
- package/src/astro/types.ts +4 -0
- package/src/cli/commands/seed.ts +1 -1
- package/src/components/EmDashImage.astro +59 -23
- package/src/components/Image.astro +36 -35
- package/src/components/LiveSearch.astro +40 -4
- package/src/components/live-search-routing.ts +30 -0
- package/src/database/migrations/036_i18n_menus_and_taxonomies.ts +23 -18
- package/src/database/migrations/048_restore_content_taxonomies_term_index.ts +32 -0
- package/src/database/migrations/049_taxonomies_name_locale_index.ts +42 -0
- package/src/database/migrations/050_media_usage_index_status.ts +142 -0
- package/src/database/migrations/runner.ts +6 -0
- package/src/database/repositories/media-usage.ts +932 -58
- package/src/database/types.ts +22 -0
- package/src/emdash-runtime.ts +123 -3
- package/src/import/comments.ts +159 -0
- package/src/import/index.ts +8 -1
- package/src/import/settings.ts +65 -189
- package/src/import/sources/wordpress-plugin.ts +338 -42
- package/src/import/sources/wxr.ts +4 -1
- package/src/import/types.ts +12 -0
- package/src/import/utils.ts +207 -0
- package/src/import/wxr-taxonomies.ts +39 -0
- package/src/loader.ts +13 -2
- package/src/media/usage/content-fields.ts +119 -0
- package/src/media/usage/content-refresh.ts +524 -0
- package/src/media/usage/content-repair.ts +491 -0
- package/src/media/usage/content-snapshots.ts +435 -0
- package/src/media/usage/extractor.ts +4 -4
- package/src/media/usage/source-key.ts +22 -0
- package/src/menus/index.ts +17 -1
- package/src/object-cache/index.ts +82 -7
- package/src/plugins/context.ts +100 -71
- package/src/schema/registry.ts +240 -154
- package/src/search/query.ts +3 -0
- package/src/search/types.ts +2 -0
- package/src/seed/apply.ts +158 -101
- package/src/seed/types.ts +6 -1
- package/dist/api-BMfveMoB.mjs.map +0 -1
- package/dist/apply--IVNSdXn.mjs.map +0 -1
- package/dist/byline-fields-eyJMblSr.mjs.map +0 -1
- package/dist/context-C_g-iJVA.mjs.map +0 -1
- package/dist/import-Bb1T9WJS.mjs.map +0 -1
- package/dist/index-BRNabKrx.d.mts.map +0 -1
- package/dist/index-Dt0OKJB4.d.mts.map +0 -1
- package/dist/loader-BA_zhkS_.mjs.map +0 -1
- package/dist/object-cache-CHbHv83-.mjs.map +0 -1
- package/dist/registry-g8yYt4cC.mjs.map +0 -1
- package/dist/runner-DPdt_Wpa.mjs.map +0 -1
- package/dist/search-BR0ZeZmh.mjs.map +0 -1
- package/dist/types-xIfVRNLp.d.mts.map +0 -1
- package/dist/utils-B7A57fm9.mjs.map +0 -1
- package/dist/version-BoNBItP_.mjs +0 -7
- /package/dist/{api-tokens-B4BQybOp.mjs → api-tokens-DsvvCtdh.mjs} +0 -0
- /package/dist/{ssrf-CcX9zvMK.mjs → ssrf-CmuGgCq3.mjs} +0 -0
- /package/dist/{types-BvbeGEtr.mjs → types-DROWRxYV.mjs} +0 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { sql, type Kysely } from "kysely";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
MediaUsageOccurrenceInput,
|
|
5
|
+
MediaUsageSourceInput,
|
|
6
|
+
} from "../../database/repositories/media-usage.js";
|
|
7
|
+
import type { Database } from "../../database/types.js";
|
|
8
|
+
import { validateIdentifier } from "../../database/validate.js";
|
|
9
|
+
import { hashString } from "../../utils/hash.js";
|
|
10
|
+
import {
|
|
11
|
+
loadContentMediaUsageFields,
|
|
12
|
+
type ContentMediaUsageField,
|
|
13
|
+
type ContentMediaUsageFieldDiscovery,
|
|
14
|
+
} from "./content-fields.js";
|
|
15
|
+
import { extractMediaUsageOccurrences } from "./extractor.js";
|
|
16
|
+
import {
|
|
17
|
+
buildContentMediaUsageSourceKey,
|
|
18
|
+
type MediaUsageContentSourceVariant,
|
|
19
|
+
} from "./source-key.js";
|
|
20
|
+
|
|
21
|
+
export const CONTENT_SOURCE_SCHEMA_VERSION = 1;
|
|
22
|
+
|
|
23
|
+
const CONTENT_SYSTEM_COLUMNS = [
|
|
24
|
+
"id",
|
|
25
|
+
"slug",
|
|
26
|
+
"status",
|
|
27
|
+
"created_at",
|
|
28
|
+
"updated_at",
|
|
29
|
+
"published_at",
|
|
30
|
+
"scheduled_at",
|
|
31
|
+
"deleted_at",
|
|
32
|
+
"version",
|
|
33
|
+
"live_revision_id",
|
|
34
|
+
"draft_revision_id",
|
|
35
|
+
"locale",
|
|
36
|
+
"translation_group",
|
|
37
|
+
] as const;
|
|
38
|
+
|
|
39
|
+
export type LoadContentMediaUsageSnapshotsResult =
|
|
40
|
+
| { success: true; snapshots: ContentMediaUsageSnapshot[] }
|
|
41
|
+
| {
|
|
42
|
+
success: false;
|
|
43
|
+
error:
|
|
44
|
+
| "CONTENT_NOT_FOUND"
|
|
45
|
+
| "DRAFT_REVISION_NOT_FOUND"
|
|
46
|
+
| "DRAFT_REVISION_MISMATCH"
|
|
47
|
+
| "DRAFT_REVISION_INVALID";
|
|
48
|
+
source?: MediaUsageSourceInput;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export interface ContentMediaUsageSnapshot {
|
|
52
|
+
source: MediaUsageSourceInput;
|
|
53
|
+
occurrences: MediaUsageOccurrenceInput[];
|
|
54
|
+
fields: readonly ContentMediaUsageField[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function loadContentMediaUsageSnapshots(
|
|
58
|
+
db: Kysely<Database>,
|
|
59
|
+
collectionSlug: string,
|
|
60
|
+
contentId: string,
|
|
61
|
+
fieldDiscovery?: ContentMediaUsageFieldDiscovery,
|
|
62
|
+
): Promise<LoadContentMediaUsageSnapshotsResult> {
|
|
63
|
+
validateIdentifier(collectionSlug, "collection slug");
|
|
64
|
+
const discovery = fieldDiscovery ?? (await loadContentMediaUsageFields(db, collectionSlug));
|
|
65
|
+
const row = await loadContentRow(db, collectionSlug, contentId, [
|
|
66
|
+
...discovery.extractionFields.map((field) => field.slug),
|
|
67
|
+
...discovery.displayFieldSlugs,
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
if (!row) return { success: false, error: "CONTENT_NOT_FOUND" };
|
|
71
|
+
|
|
72
|
+
const columnsData = projectData(
|
|
73
|
+
row,
|
|
74
|
+
discovery.extractionFields.map((field) => field.slug),
|
|
75
|
+
);
|
|
76
|
+
const displayData = projectRawData(row, discovery.displayFieldSlugs);
|
|
77
|
+
const occurrences = extractMediaUsageOccurrences({
|
|
78
|
+
fields: discovery.extractionFields,
|
|
79
|
+
data: columnsData,
|
|
80
|
+
});
|
|
81
|
+
const columnsRevisionId = readNullableString(row.live_revision_id);
|
|
82
|
+
const columnsFingerprint = await buildSourceFingerprint({
|
|
83
|
+
collectionSlug,
|
|
84
|
+
sourceVariant: "columns",
|
|
85
|
+
revisionId: columnsRevisionId,
|
|
86
|
+
fields: discovery.extractionFields,
|
|
87
|
+
data: columnsData,
|
|
88
|
+
});
|
|
89
|
+
const snapshots: ContentMediaUsageSnapshot[] = [
|
|
90
|
+
{
|
|
91
|
+
source: buildContentSource({
|
|
92
|
+
collectionSlug,
|
|
93
|
+
row,
|
|
94
|
+
displayData,
|
|
95
|
+
sourceVariant: "columns",
|
|
96
|
+
revisionId: columnsRevisionId,
|
|
97
|
+
sourceFingerprint: columnsFingerprint,
|
|
98
|
+
}),
|
|
99
|
+
occurrences,
|
|
100
|
+
fields: discovery.extractionFields,
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
const draftRevisionId = readNullableString(row.draft_revision_id);
|
|
105
|
+
if (draftRevisionId) {
|
|
106
|
+
const attemptedDraftSource = buildContentSource({
|
|
107
|
+
collectionSlug,
|
|
108
|
+
row,
|
|
109
|
+
displayData,
|
|
110
|
+
sourceVariant: "draft_overlay",
|
|
111
|
+
revisionId: draftRevisionId,
|
|
112
|
+
});
|
|
113
|
+
const revisionResult = await loadRevisionRow(db, draftRevisionId);
|
|
114
|
+
if (!revisionResult) {
|
|
115
|
+
return {
|
|
116
|
+
success: false,
|
|
117
|
+
error: "DRAFT_REVISION_NOT_FOUND",
|
|
118
|
+
source: attemptedDraftSource,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
if (!revisionResult.success) {
|
|
122
|
+
return {
|
|
123
|
+
success: false,
|
|
124
|
+
error: "DRAFT_REVISION_INVALID",
|
|
125
|
+
source: attemptedDraftSource,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const revision = revisionResult.revision;
|
|
129
|
+
if (revision.collection !== collectionSlug || revision.entryId !== row.id) {
|
|
130
|
+
return {
|
|
131
|
+
success: false,
|
|
132
|
+
error: "DRAFT_REVISION_MISMATCH",
|
|
133
|
+
source: attemptedDraftSource,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const revisionData = stripRevisionMetadata(revision.data);
|
|
138
|
+
const draftOverlayData = { ...columnsData, ...revisionData };
|
|
139
|
+
const draftDisplayData = {
|
|
140
|
+
...displayData,
|
|
141
|
+
...projectPresentData(revisionData, discovery.displayFieldSlugs),
|
|
142
|
+
};
|
|
143
|
+
const draftContentSlug =
|
|
144
|
+
readNullableString(revision.data._slug) ?? readNullableString(row.slug);
|
|
145
|
+
const draftFingerprint = await buildSourceFingerprint({
|
|
146
|
+
collectionSlug,
|
|
147
|
+
sourceVariant: "draft_overlay",
|
|
148
|
+
revisionId: draftRevisionId,
|
|
149
|
+
fields: discovery.extractionFields,
|
|
150
|
+
data: draftOverlayData,
|
|
151
|
+
});
|
|
152
|
+
snapshots.push({
|
|
153
|
+
source: buildContentSource({
|
|
154
|
+
collectionSlug,
|
|
155
|
+
row,
|
|
156
|
+
displayData: draftDisplayData,
|
|
157
|
+
sourceVariant: "draft_overlay",
|
|
158
|
+
revisionId: draftRevisionId,
|
|
159
|
+
contentSlug: draftContentSlug,
|
|
160
|
+
sourceFingerprint: draftFingerprint,
|
|
161
|
+
}),
|
|
162
|
+
occurrences: extractMediaUsageOccurrences({
|
|
163
|
+
fields: discovery.extractionFields,
|
|
164
|
+
data: draftOverlayData,
|
|
165
|
+
}),
|
|
166
|
+
fields: discovery.extractionFields,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
success: true,
|
|
172
|
+
snapshots,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface RevisionSnapshotRow {
|
|
177
|
+
id: string;
|
|
178
|
+
collection: string;
|
|
179
|
+
entryId: string;
|
|
180
|
+
data: Record<string, unknown>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async function loadContentRow(
|
|
184
|
+
db: Kysely<Database>,
|
|
185
|
+
collectionSlug: string,
|
|
186
|
+
contentId: string,
|
|
187
|
+
fieldSlugs: readonly string[],
|
|
188
|
+
): Promise<Record<string, unknown> | null> {
|
|
189
|
+
const tableName = getContentTableName(collectionSlug);
|
|
190
|
+
const columns = uniqueColumns([...CONTENT_SYSTEM_COLUMNS, ...fieldSlugs]);
|
|
191
|
+
const columnRefs = columns.map((column) => sql.ref(column));
|
|
192
|
+
const result = await sql<Record<string, unknown>>`
|
|
193
|
+
SELECT ${sql.join(columnRefs, sql`, `)}
|
|
194
|
+
FROM ${sql.ref(tableName)}
|
|
195
|
+
WHERE id = ${contentId}
|
|
196
|
+
LIMIT 1
|
|
197
|
+
`.execute(db);
|
|
198
|
+
|
|
199
|
+
return result.rows[0] ?? null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
async function loadRevisionRow(
|
|
203
|
+
db: Kysely<Database>,
|
|
204
|
+
revisionId: string,
|
|
205
|
+
): Promise<{ success: true; revision: RevisionSnapshotRow } | { success: false } | null> {
|
|
206
|
+
const row = await db
|
|
207
|
+
.selectFrom("revisions")
|
|
208
|
+
.select(["id", "collection", "entry_id", "data"])
|
|
209
|
+
.where("id", "=", revisionId)
|
|
210
|
+
.executeTakeFirst();
|
|
211
|
+
if (!row) return null;
|
|
212
|
+
const data = parseRevisionData(row.data);
|
|
213
|
+
if (!data) return { success: false };
|
|
214
|
+
return {
|
|
215
|
+
success: true,
|
|
216
|
+
revision: {
|
|
217
|
+
id: row.id,
|
|
218
|
+
collection: row.collection,
|
|
219
|
+
entryId: row.entry_id,
|
|
220
|
+
data,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function buildContentSource(input: {
|
|
226
|
+
collectionSlug: string;
|
|
227
|
+
row: Record<string, unknown>;
|
|
228
|
+
displayData: Record<string, unknown>;
|
|
229
|
+
sourceVariant: MediaUsageContentSourceVariant;
|
|
230
|
+
revisionId: string | null;
|
|
231
|
+
contentSlug?: string | null;
|
|
232
|
+
sourceFingerprint?: string | null;
|
|
233
|
+
}): MediaUsageSourceInput {
|
|
234
|
+
const { collectionSlug, row, displayData, sourceVariant, revisionId } = input;
|
|
235
|
+
const contentId = readString(row.id) ?? "";
|
|
236
|
+
const contentSlug = input.contentSlug ?? readNullableString(row.slug);
|
|
237
|
+
const source: MediaUsageSourceInput = {
|
|
238
|
+
sourceKey: buildContentMediaUsageSourceKey({
|
|
239
|
+
collectionSlug,
|
|
240
|
+
contentId,
|
|
241
|
+
sourceVariant,
|
|
242
|
+
}),
|
|
243
|
+
sourceType: "content",
|
|
244
|
+
collectionSlug,
|
|
245
|
+
contentId,
|
|
246
|
+
sourceVariant,
|
|
247
|
+
locale: readNullableString(row.locale),
|
|
248
|
+
translationGroup: readNullableString(row.translation_group),
|
|
249
|
+
contentSlug,
|
|
250
|
+
contentTitle: deriveContentTitle(displayData, contentSlug, contentId),
|
|
251
|
+
contentStatus: readNullableString(row.status),
|
|
252
|
+
contentScheduledAt: readNullableString(row.scheduled_at),
|
|
253
|
+
contentDeletedAt: readNullableString(row.deleted_at),
|
|
254
|
+
revisionId,
|
|
255
|
+
schemaVersion: CONTENT_SOURCE_SCHEMA_VERSION,
|
|
256
|
+
sourceUpdatedAt: readNullableString(row.updated_at),
|
|
257
|
+
sourceVersion: readNumber(row.version),
|
|
258
|
+
};
|
|
259
|
+
if (input.sourceFingerprint !== undefined) source.sourceFingerprint = input.sourceFingerprint;
|
|
260
|
+
return source;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
async function buildSourceFingerprint(input: {
|
|
264
|
+
collectionSlug: string;
|
|
265
|
+
sourceVariant: MediaUsageContentSourceVariant;
|
|
266
|
+
revisionId: string | null;
|
|
267
|
+
fields: readonly ContentMediaUsageField[];
|
|
268
|
+
data: Record<string, unknown>;
|
|
269
|
+
}): Promise<string> {
|
|
270
|
+
return hashString(
|
|
271
|
+
canonicalJson({
|
|
272
|
+
schemaVersion: CONTENT_SOURCE_SCHEMA_VERSION,
|
|
273
|
+
collectionSlug: input.collectionSlug,
|
|
274
|
+
sourceVariant: input.sourceVariant,
|
|
275
|
+
fields: normalizeFingerprintFields(input.fields),
|
|
276
|
+
values: projectFingerprintData(input.data, input.fields),
|
|
277
|
+
revisionId: input.sourceVariant === "draft_overlay" ? input.revisionId : null,
|
|
278
|
+
}),
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function normalizeFingerprintFields(
|
|
283
|
+
fields: readonly ContentMediaUsageField[],
|
|
284
|
+
): Record<string, unknown>[] {
|
|
285
|
+
return fields
|
|
286
|
+
.map((field) => {
|
|
287
|
+
if (field.type !== "repeater") return { slug: field.slug, type: field.type };
|
|
288
|
+
return {
|
|
289
|
+
slug: field.slug,
|
|
290
|
+
type: field.type,
|
|
291
|
+
subFields: (field.validation?.subFields ?? [])
|
|
292
|
+
.map((subField) => ({ slug: subField.slug, type: subField.type }))
|
|
293
|
+
.toSorted((a, b) => a.slug.localeCompare(b.slug)),
|
|
294
|
+
};
|
|
295
|
+
})
|
|
296
|
+
.toSorted((a, b) => String(a.slug).localeCompare(String(b.slug)));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function projectFingerprintData(
|
|
300
|
+
data: Record<string, unknown>,
|
|
301
|
+
fields: readonly ContentMediaUsageField[],
|
|
302
|
+
): Record<string, unknown> {
|
|
303
|
+
const projected: Record<string, unknown> = {};
|
|
304
|
+
for (const field of fields) {
|
|
305
|
+
projected[field.slug] = Object.hasOwn(data, field.slug) ? data[field.slug] : null;
|
|
306
|
+
}
|
|
307
|
+
return projected;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function canonicalJson(value: unknown): string {
|
|
311
|
+
return JSON.stringify(canonicalize(value));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function canonicalize(value: unknown): unknown {
|
|
315
|
+
if (value === undefined) return null;
|
|
316
|
+
if (typeof value === "bigint") return value.toString();
|
|
317
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
318
|
+
if (Array.isArray(value)) return value.map((item) => canonicalize(item));
|
|
319
|
+
if (!isRecord(value)) return value;
|
|
320
|
+
|
|
321
|
+
const canonical: Record<string, unknown> = {};
|
|
322
|
+
for (const key of Object.keys(value).toSorted()) {
|
|
323
|
+
canonical[key] = canonicalize(value[key]);
|
|
324
|
+
}
|
|
325
|
+
return canonical;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function projectData(
|
|
329
|
+
row: Record<string, unknown>,
|
|
330
|
+
fieldSlugs: readonly string[],
|
|
331
|
+
): Record<string, unknown> {
|
|
332
|
+
const data: Record<string, unknown> = {};
|
|
333
|
+
for (const fieldSlug of fieldSlugs) {
|
|
334
|
+
data[fieldSlug] = deserializeValue(row[fieldSlug] ?? null);
|
|
335
|
+
}
|
|
336
|
+
return data;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function projectRawData(
|
|
340
|
+
row: Record<string, unknown>,
|
|
341
|
+
fieldSlugs: readonly string[],
|
|
342
|
+
): Record<string, unknown> {
|
|
343
|
+
const data: Record<string, unknown> = {};
|
|
344
|
+
for (const fieldSlug of fieldSlugs) {
|
|
345
|
+
data[fieldSlug] = row[fieldSlug] ?? null;
|
|
346
|
+
}
|
|
347
|
+
return data;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function projectPresentData(
|
|
351
|
+
row: Record<string, unknown>,
|
|
352
|
+
fieldSlugs: readonly string[],
|
|
353
|
+
): Record<string, unknown> {
|
|
354
|
+
const data: Record<string, unknown> = {};
|
|
355
|
+
for (const fieldSlug of fieldSlugs) {
|
|
356
|
+
if (Object.hasOwn(row, fieldSlug)) data[fieldSlug] = row[fieldSlug];
|
|
357
|
+
}
|
|
358
|
+
return data;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function uniqueColumns(columns: readonly string[]): string[] {
|
|
362
|
+
const unique = [...new Set(columns)];
|
|
363
|
+
for (const column of unique) validateIdentifier(column, "content media usage column");
|
|
364
|
+
return unique;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function getContentTableName(collectionSlug: string): string {
|
|
368
|
+
validateIdentifier(collectionSlug, "collection slug");
|
|
369
|
+
return `ec_${collectionSlug}`;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function deserializeValue(value: unknown): unknown {
|
|
373
|
+
if (typeof value === "string" && (value.startsWith("{") || value.startsWith("["))) {
|
|
374
|
+
try {
|
|
375
|
+
return JSON.parse(value);
|
|
376
|
+
} catch {
|
|
377
|
+
return value;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return value;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function parseRevisionData(value: unknown): Record<string, unknown> | null {
|
|
384
|
+
if (typeof value === "string") {
|
|
385
|
+
try {
|
|
386
|
+
const parsed: unknown = JSON.parse(value);
|
|
387
|
+
return isRecord(parsed) ? parsed : null;
|
|
388
|
+
} catch {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return isRecord(value) ? value : null;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function stripRevisionMetadata(data: Record<string, unknown>): Record<string, unknown> {
|
|
396
|
+
const stripped: Record<string, unknown> = {};
|
|
397
|
+
for (const [key, value] of Object.entries(data)) {
|
|
398
|
+
if (!key.startsWith("_")) stripped[key] = value;
|
|
399
|
+
}
|
|
400
|
+
return stripped;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function deriveContentTitle(
|
|
404
|
+
displayData: Record<string, unknown>,
|
|
405
|
+
contentSlug: string | null,
|
|
406
|
+
contentId: string,
|
|
407
|
+
): string | null {
|
|
408
|
+
for (const fieldSlug of ["title", "name"] as const) {
|
|
409
|
+
const value = displayData[fieldSlug];
|
|
410
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
411
|
+
}
|
|
412
|
+
return contentSlug ?? contentId;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function readString(value: unknown): string | null {
|
|
416
|
+
return typeof value === "string" ? value : null;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function readNullableString(value: unknown): string | null {
|
|
420
|
+
return value === null || value === undefined ? null : readString(value);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function readNumber(value: unknown): number | null {
|
|
424
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
425
|
+
if (typeof value === "bigint") return Number(value);
|
|
426
|
+
if (typeof value === "string" && value) {
|
|
427
|
+
const parsed = Number(value);
|
|
428
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
429
|
+
}
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
434
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
435
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeMime } from "../mime.js";
|
|
2
|
+
import { INTERNAL_MEDIA_PREFIX } from "../normalize.js";
|
|
2
3
|
import type {
|
|
3
4
|
ExtractedMediaUsageOccurrence,
|
|
4
5
|
ExtractMediaUsageOccurrencesInput,
|
|
@@ -7,7 +8,6 @@ import type {
|
|
|
7
8
|
MediaUsageReferenceType,
|
|
8
9
|
} from "./types.js";
|
|
9
10
|
|
|
10
|
-
const INTERNAL_MEDIA_PREFIX = "/_emdash/api/media/file/";
|
|
11
11
|
const URL_LIKE_RE = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
12
12
|
|
|
13
13
|
interface MediaRef {
|
|
@@ -84,14 +84,14 @@ function extractRepeaterOccurrences(
|
|
|
84
84
|
if (!isRecord(item)) continue;
|
|
85
85
|
|
|
86
86
|
for (const subField of subFields) {
|
|
87
|
-
if (subField.type !== "image"
|
|
87
|
+
if (subField.type !== "image") continue;
|
|
88
88
|
|
|
89
89
|
addOccurrence(occurrences, seen, {
|
|
90
90
|
fieldSlug,
|
|
91
91
|
fieldPath: `${fieldSlug}[${itemIndex}].${subField.slug}`,
|
|
92
|
-
referenceType:
|
|
92
|
+
referenceType: "image_field",
|
|
93
93
|
value: item[subField.slug],
|
|
94
|
-
fallbackKind:
|
|
94
|
+
fallbackKind: "image",
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const MEDIA_USAGE_CONTENT_SOURCE_VARIANTS = ["columns", "draft_overlay"] as const;
|
|
2
|
+
|
|
3
|
+
export type MediaUsageContentSourceVariant = (typeof MEDIA_USAGE_CONTENT_SOURCE_VARIANTS)[number];
|
|
4
|
+
|
|
5
|
+
export interface ContentMediaUsageSourceKeyInput {
|
|
6
|
+
collectionSlug: string;
|
|
7
|
+
contentId: string;
|
|
8
|
+
sourceVariant: MediaUsageContentSourceVariant;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function isMediaUsageContentSourceVariant(
|
|
12
|
+
value: unknown,
|
|
13
|
+
): value is MediaUsageContentSourceVariant {
|
|
14
|
+
return (
|
|
15
|
+
typeof value === "string" &&
|
|
16
|
+
(MEDIA_USAGE_CONTENT_SOURCE_VARIANTS as readonly string[]).includes(value)
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function buildContentMediaUsageSourceKey(input: ContentMediaUsageSourceKeyInput): string {
|
|
21
|
+
return `content:${input.collectionSlug}:${input.contentId}:${input.sourceVariant}`;
|
|
22
|
+
}
|
package/src/menus/index.ts
CHANGED
|
@@ -235,7 +235,23 @@ async function resolveMenuItem(
|
|
|
235
235
|
break;
|
|
236
236
|
|
|
237
237
|
case "collection":
|
|
238
|
-
|
|
238
|
+
// Two shapes share this type: the admin content picker stores
|
|
239
|
+
// entries from custom collections as "collection" with a
|
|
240
|
+
// reference_id, while archive links carry only the collection
|
|
241
|
+
// slug. Entry references resolve like page/post items.
|
|
242
|
+
if (!item.reference_collection) return null;
|
|
243
|
+
if (item.reference_id) {
|
|
244
|
+
url = await resolveContentUrl(
|
|
245
|
+
item.reference_collection,
|
|
246
|
+
item.reference_id,
|
|
247
|
+
db,
|
|
248
|
+
urlPatterns,
|
|
249
|
+
locale,
|
|
250
|
+
);
|
|
251
|
+
if (url === null) return null;
|
|
252
|
+
} else {
|
|
253
|
+
url = `/${item.reference_collection}/`;
|
|
254
|
+
}
|
|
239
255
|
break;
|
|
240
256
|
|
|
241
257
|
default:
|
|
@@ -77,6 +77,55 @@ interface EpochEntry {
|
|
|
77
77
|
at: number;
|
|
78
78
|
/** In-flight read, so concurrent callers share one backend round-trip. */
|
|
79
79
|
promise?: Promise<number>;
|
|
80
|
+
/**
|
|
81
|
+
* `Date.now()` at which the in-flight read started. Callers use it to
|
|
82
|
+
* decide whether the read's owner can still be alive (see
|
|
83
|
+
* {@link epochReadDeadline}) — past the deadline the promise is presumed
|
|
84
|
+
* dead and the next caller reclaims by starting a fresh read.
|
|
85
|
+
*/
|
|
86
|
+
promiseAt?: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Extra time past the configured read timeout before an in-flight epoch read
|
|
91
|
+
* is presumed dead. A live owner's read settles within `timeout` (enforced by
|
|
92
|
+
* {@link withTimeout}), so the grace only needs to absorb scheduling jitter.
|
|
93
|
+
*/
|
|
94
|
+
const EPOCH_READ_GRACE_MS = 1_000;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* How long an in-flight epoch read may be trusted. A read older than this can
|
|
98
|
+
* only exist because its owning request was cancelled mid-await — on workerd
|
|
99
|
+
* a cancelled request's continuations never run, *including the timeout's own
|
|
100
|
+
* `setTimeout` callback*, so the shared promise never settles and is never
|
|
101
|
+
* replaced. With the timeout disabled (`timeout: 0`) the default is used as
|
|
102
|
+
* the deadline; the worst case of guessing too short is one duplicate
|
|
103
|
+
* backend read.
|
|
104
|
+
*/
|
|
105
|
+
function epochReadDeadline(): number {
|
|
106
|
+
const timeout = holder.config.timeout > 0 ? holder.config.timeout : DEFAULT_TIMEOUT_MS;
|
|
107
|
+
return timeout + EPOCH_READ_GRACE_MS;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Await another request's in-flight epoch read, bounded by the waiter's own
|
|
112
|
+
* timer. The bare promise must never be awaited across requests: if the
|
|
113
|
+
* owning request is cancelled, the promise never settles (see
|
|
114
|
+
* {@link epochReadDeadline}) and an unguarded waiter hangs until the isolate
|
|
115
|
+
* is evicted. The race timer below belongs to the *waiter's* request context
|
|
116
|
+
* and therefore always fires; on timeout the waiter degrades to `fallback`
|
|
117
|
+
* (the last known epoch), the same contract as a failed backend read.
|
|
118
|
+
*/
|
|
119
|
+
function raceInFlightEpochRead(
|
|
120
|
+
promise: Promise<number>,
|
|
121
|
+
ms: number,
|
|
122
|
+
fallback: number,
|
|
123
|
+
): Promise<number> {
|
|
124
|
+
let timer: ReturnType<typeof setTimeout>;
|
|
125
|
+
const timeout = new Promise<number>((resolve) => {
|
|
126
|
+
timer = setTimeout(resolve, Math.max(ms, 1), fallback);
|
|
127
|
+
});
|
|
128
|
+
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
80
129
|
}
|
|
81
130
|
|
|
82
131
|
const BACKEND_KEY = Symbol.for("emdash:object-cache:backend");
|
|
@@ -263,7 +312,17 @@ async function getEpoch(namespace: string, backend: ObjectCacheBackend): Promise
|
|
|
263
312
|
if (cached && now - cached.at < holder.config.revalidate) {
|
|
264
313
|
return cached.value;
|
|
265
314
|
}
|
|
266
|
-
if (cached?.promise)
|
|
315
|
+
if (cached?.promise) {
|
|
316
|
+
// Share the in-flight read only while its owner can still be alive,
|
|
317
|
+
// and never await it bare (a cancelled owner's promise never settles;
|
|
318
|
+
// see epochReadDeadline). Past the deadline, fall through and reclaim
|
|
319
|
+
// with a fresh read — the dead entry is overwritten below.
|
|
320
|
+
const age = now - (cached.promiseAt ?? 0);
|
|
321
|
+
const deadline = epochReadDeadline();
|
|
322
|
+
if (age < deadline) {
|
|
323
|
+
return raceInFlightEpochRead(cached.promise, deadline - age, cached.value);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
267
326
|
|
|
268
327
|
const promise = (async () => {
|
|
269
328
|
let value: number;
|
|
@@ -287,12 +346,28 @@ async function getEpoch(namespace: string, backend: ObjectCacheBackend): Promise
|
|
|
287
346
|
return merged;
|
|
288
347
|
})();
|
|
289
348
|
|
|
290
|
-
//
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
|
|
349
|
+
// Anchor the read on the host's lifetime extender: if the owning request
|
|
350
|
+
// is cancelled mid-await, the anchored copy keeps the read alive so it
|
|
351
|
+
// still settles and its handler replaces this entry with a fresh,
|
|
352
|
+
// promise-free one. Where no extender exists, the deadline reclaim above
|
|
353
|
+
// recovers instead.
|
|
354
|
+
after(() =>
|
|
355
|
+
promise.then(
|
|
356
|
+
() => undefined,
|
|
357
|
+
() => undefined,
|
|
358
|
+
),
|
|
359
|
+
);
|
|
360
|
+
|
|
361
|
+
// Concurrent callers share this in-flight read (dedup) — bounded by their
|
|
362
|
+
// own timers via raceInFlightEpochRead, never awaited bare. The timeout
|
|
363
|
+
// above makes a live owner's read settle; `promiseAt` lets callers detect
|
|
364
|
+
// a dead one (cancelled owner) and reclaim.
|
|
365
|
+
epochCache.set(namespace, {
|
|
366
|
+
value: cached?.value ?? 0,
|
|
367
|
+
at: cached?.at ?? 0,
|
|
368
|
+
promise,
|
|
369
|
+
promiseAt: now,
|
|
370
|
+
});
|
|
296
371
|
return promise;
|
|
297
372
|
}
|
|
298
373
|
|