emdash 0.31.1 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapters-C0ONzkUP.d.mts → adapters-BMyNSSZi.d.mts} +9 -1
- package/dist/adapters-BMyNSSZi.d.mts.map +1 -0
- package/dist/after-CBU2vkoO.mjs +96 -0
- package/dist/after-CBU2vkoO.mjs.map +1 -0
- package/dist/{allowed-origins-CCEi9bPI.mjs → allowed-origins-CG1pACtS.mjs} +2 -2
- package/dist/{allowed-origins-CCEi9bPI.mjs.map → allowed-origins-CG1pACtS.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -4
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +23 -21
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/{api-BkqFzIu4.mjs → api-D2hunekQ.mjs} +254 -48
- package/dist/api-D2hunekQ.mjs.map +1 -0
- package/dist/{api-tokens-uPt8UDpx.mjs → api-tokens-CSND0i1z.mjs} +2 -2
- package/dist/{api-tokens-uPt8UDpx.mjs.map → api-tokens-CSND0i1z.mjs.map} +1 -1
- package/dist/{apply-DuXsqll7.mjs → apply-kwNEJW2l.mjs} +36 -23
- package/dist/apply-kwNEJW2l.mjs.map +1 -0
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.mjs +17 -3
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +8 -8
- package/dist/astro/middleware/redirect.d.mts.map +1 -1
- package/dist/astro/middleware/redirect.mjs +8 -8
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.mjs +4 -4
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +10 -10
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +370 -171
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -7
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -7
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -5
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +10 -10
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +10 -10
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +19 -18
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +19 -18
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +19 -19
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +16 -16
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/counts.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -12
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +13 -11
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- 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 +47 -44
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +47 -44
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +46 -43
- 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 +46 -43
- 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 +46 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +46 -43
- 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 +47 -44
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +47 -44
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -43
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -43
- 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 +46 -43
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -8
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/index.mjs +7 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/invite/index.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -11
- package/dist/astro/routes/api/auth/logout.mjs +3 -3
- package/dist/astro/routes/api/auth/magic-link/send.mjs +12 -12
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +8 -8
- package/dist/astro/routes/api/auth/mode.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +4 -4
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +7 -7
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +13 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/verify.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs +12 -12
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +18 -18
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +14 -14
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +19 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +19 -17
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -16
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
- package/dist/astro/routes/api/content/_collection_/trash.mjs +8 -8
- package/dist/astro/routes/api/dashboard.mjs +9 -9
- package/dist/astro/routes/api/dev/emails.mjs +3 -3
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +19 -19
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +16 -15
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +13 -11
- 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 -19
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +28 -27
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +5 -5
- package/dist/astro/routes/api/mcp.mjs +42 -42
- package/dist/astro/routes/api/media/_id_/confirm.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +106 -37
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/upload.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs +168 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/usage.mjs +15 -13
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +22 -15
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/media/upload-url.mjs +35 -24
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +14 -13
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +12 -11
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +12 -11
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +12 -11
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +12 -11
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +12 -11
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +12 -11
- package/dist/astro/routes/api/menus/index.mjs.map +1 -1
- 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 +62 -9
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +5 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -12
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -12
- package/dist/astro/routes/api/redirects/_id_.mjs +14 -13
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +14 -13
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +19 -17
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +14 -12
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +19 -17
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +4 -4
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +46 -43
- 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 +46 -43
- 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 +46 -43
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +46 -43
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +46 -43
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.d.mts +8 -0
- package/dist/astro/routes/api/schema/collections/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs +66 -0
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/schema/index.mjs +12 -8
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -43
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +46 -43
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.d.mts +1 -0
- package/dist/astro/routes/api/search/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +18 -13
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +12 -11
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +14 -13
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +8 -7
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +12 -11
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +11 -11
- package/dist/astro/routes/api/sections/index.mjs +11 -11
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
- package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
- package/dist/astro/routes/api/settings/email.mjs +5 -5
- package/dist/astro/routes/api/settings.mjs +16 -16
- package/dist/astro/routes/api/setup/admin-verify.mjs +13 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -12
- package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -29
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
- package/dist/astro/routes/api/setup/index.mjs +33 -31
- 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 +9 -9
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts +8 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +43 -0
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -0
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +17 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +17 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -18
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +17 -16
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +7 -7
- package/dist/astro/routes/api/typegen.mjs +5 -5
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +11 -11
- package/dist/astro/routes/api/widget-areas/_name_.mjs +6 -6
- package/dist/astro/routes/api/widget-areas/index.mjs +11 -11
- package/dist/astro/routes/api/widget-components.mjs +3 -3
- package/dist/astro/routes/robots.txt.mjs +9 -9
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +13 -13
- package/dist/astro/routes/sitemap.xml.mjs +10 -10
- package/dist/astro/types.d.mts +20 -13
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{authorize-6WPZa1xZ.mjs → authorize-qRhWQnel.mjs} +2 -2
- package/dist/{authorize-6WPZa1xZ.mjs.map → authorize-qRhWQnel.mjs.map} +1 -1
- package/dist/{backup-DoW-H0r4.mjs → backup-CtA6LDNw.mjs} +5 -5
- package/dist/{backup-DoW-H0r4.mjs.map → backup-CtA6LDNw.mjs.map} +1 -1
- package/dist/{byline-BTOxUlFF.mjs → byline-Cp6csL84.mjs} +9 -9
- package/dist/{byline-BTOxUlFF.mjs.map → byline-Cp6csL84.mjs.map} +1 -1
- package/dist/{byline-fields-CdU_LTF1.mjs → byline-fields-CNc0Yq5i.mjs} +2 -2
- package/dist/{byline-fields-CdU_LTF1.mjs.map → byline-fields-CNc0Yq5i.mjs.map} +1 -1
- package/dist/{byline-registry-BCuOp4UF.mjs → byline-registry-ZkPKqEwC.mjs} +4 -4
- package/dist/{byline-registry-BCuOp4UF.mjs.map → byline-registry-ZkPKqEwC.mjs.map} +1 -1
- package/dist/{bylines-Bc-3xtpz.mjs → bylines-CEj5CdT4.mjs} +7 -7
- package/dist/{bylines-Bc-3xtpz.mjs.map → bylines-CEj5CdT4.mjs.map} +1 -1
- package/dist/{bylines-oVN0iPwX.mjs → bylines-cf-C9lmF.mjs} +5 -5
- package/dist/{bylines-oVN0iPwX.mjs.map → bylines-cf-C9lmF.mjs.map} +1 -1
- package/dist/cache-C9FptTFR.mjs +108 -0
- package/dist/cache-C9FptTFR.mjs.map +1 -0
- package/dist/{challenge-store-BFzgFRog.mjs → challenge-store-D9VNKELo.mjs} +1 -1
- package/dist/{challenge-store-BFzgFRog.mjs.map → challenge-store-D9VNKELo.mjs.map} +1 -1
- package/dist/{chunks-Bq-5DPrD.mjs → chunks-DbYzib_k.mjs} +2 -2
- package/dist/{chunks-Bq-5DPrD.mjs.map → chunks-DbYzib_k.mjs.map} +1 -1
- package/dist/cli/index.mjs +41 -32
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -2
- package/dist/{comment-B9cUud8H.mjs → comment-BIkJ6Fil.mjs} +3 -3
- package/dist/{comment-B9cUud8H.mjs.map → comment-BIkJ6Fil.mjs.map} +1 -1
- package/dist/{comment-reaction-VUXO981F.mjs → comment-reaction-D-laEceb.mjs} +2 -2
- package/dist/{comment-reaction-VUXO981F.mjs.map → comment-reaction-D-laEceb.mjs.map} +1 -1
- package/dist/{comments-PXj1E9Si.mjs → comments-0_w6KChA.mjs} +3 -3
- package/dist/{comments-PXj1E9Si.mjs.map → comments-0_w6KChA.mjs.map} +1 -1
- package/dist/{components-DZkL4Fx0.mjs → components-BPxrRjpE.mjs} +1 -1
- package/dist/{components-DZkL4Fx0.mjs.map → components-BPxrRjpE.mjs.map} +1 -1
- package/dist/{config-B6b_BobR.mjs → config-DyF3OKg_.mjs} +15 -10
- package/dist/config-DyF3OKg_.mjs.map +1 -0
- package/dist/{content-BC43pICM.mjs → content-CJ94NEx5.mjs} +170 -117
- package/dist/content-CJ94NEx5.mjs.map +1 -0
- package/dist/{content-refresh-CPMSauD3.mjs → content-refresh-Xw7aKmou.mjs} +7 -7
- package/dist/{content-refresh-CPMSauD3.mjs.map → content-refresh-Xw7aKmou.mjs.map} +1 -1
- package/dist/{context-DOurRIrb.mjs → context-C_1nrqnW.mjs} +14 -14
- package/dist/{context-DOurRIrb.mjs.map → context-C_1nrqnW.mjs.map} +1 -1
- package/dist/{cron-BlKIMD_e.mjs → cron-DRV-UC4K.mjs} +1 -1
- package/dist/{cron-BlKIMD_e.mjs.map → cron-DRV-UC4K.mjs.map} +1 -1
- package/dist/{dashboard-CBm4zhc3.mjs → dashboard-DINnNVVU.mjs} +5 -5
- package/dist/{dashboard-CBm4zhc3.mjs.map → dashboard-DINnNVVU.mjs.map} +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +3 -2
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{default-C4v9KP56.mjs → default-BD2FG0xV.mjs} +1 -1
- package/dist/{default-C4v9KP56.mjs.map → default-BD2FG0xV.mjs.map} +1 -1
- package/dist/deferred-tasks-C-WRCcKo.d.mts +9 -0
- package/dist/deferred-tasks-C-WRCcKo.d.mts.map +1 -0
- package/dist/{device-flow-BeA6lUS1.mjs → device-flow-CTqd8mud.mjs} +5 -5
- package/dist/{device-flow-BeA6lUS1.mjs.map → device-flow-CTqd8mud.mjs.map} +1 -1
- package/dist/{dialect-helpers-BtOwo2us.mjs → dialect-helpers-BSbfaO3F.mjs} +43 -16
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +1 -0
- package/dist/{email-console-C-9Ng8DM.mjs → email-console-C6WdcWbL.mjs} +1 -1
- package/dist/{email-console-C-9Ng8DM.mjs.map → email-console-C6WdcWbL.mjs.map} +1 -1
- package/dist/{error-DJ98TRbQ.mjs → error-oh_9i6bR.mjs} +3 -3
- package/dist/{error-DJ98TRbQ.mjs.map → error-oh_9i6bR.mjs.map} +1 -1
- package/dist/{errors-DtEXIQQV.mjs → errors-BucQ8VYz.mjs} +2 -1
- package/dist/errors-BucQ8VYz.mjs.map +1 -0
- package/dist/{escape-CFedIB1C.mjs → escape-CXps5F_v.mjs} +1 -1
- package/dist/{escape-CFedIB1C.mjs.map → escape-CXps5F_v.mjs.map} +1 -1
- package/dist/{field-defs-cache-KfNJ_qLQ.mjs → field-defs-cache-WD82dMQq.mjs} +4 -4
- package/dist/{field-defs-cache-KfNJ_qLQ.mjs.map → field-defs-cache-WD82dMQq.mjs.map} +1 -1
- package/dist/{fts-manager-hyCU9OOp.mjs → fts-manager-BITakW_R.mjs} +37 -13
- package/dist/fts-manager-BITakW_R.mjs.map +1 -0
- package/dist/{hash-DFFrkivP.mjs → hash-Cg0TXJPV.mjs} +8 -4
- package/dist/hash-Cg0TXJPV.mjs.map +1 -0
- package/dist/{hreflang-CIxH_LKz.d.mts → hreflang-BaLCNcDx.d.mts} +2 -2
- package/dist/{hreflang-CIxH_LKz.d.mts.map → hreflang-BaLCNcDx.d.mts.map} +1 -1
- package/dist/{hreflang-CbYeCzl9.mjs → hreflang-BdZuVBhL.mjs} +7 -7
- package/dist/{hreflang-CbYeCzl9.mjs.map → hreflang-BdZuVBhL.mjs.map} +1 -1
- package/dist/{import-oDYCgNYQ.mjs → import-C-9uqyT3.mjs} +6 -6
- package/dist/{import-oDYCgNYQ.mjs.map → import-C-9uqyT3.mjs.map} +1 -1
- package/dist/{index-BZJ_5FOX.d.mts → index-M37iz29I.d.mts} +112 -37
- package/dist/index-M37iz29I.d.mts.map +1 -0
- package/dist/{index-BEui-cRd.d.mts → index-MGw47uWq.d.mts} +3 -3
- package/dist/{index-BEui-cRd.d.mts.map → index-MGw47uWq.d.mts.map} +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.mjs +69 -67
- package/dist/{load-Dg5gtWma.mjs → load-DV1DZuUJ.mjs} +2 -2
- package/dist/{load-Dg5gtWma.mjs.map → load-DV1DZuUJ.mjs.map} +1 -1
- package/dist/{loader-D4rigvjR.mjs → loader-CGugY7Zl.mjs} +29 -15
- package/dist/loader-CGugY7Zl.mjs.map +1 -0
- package/dist/{manifest-schema-bCq54i7F.mjs → manifest-schema-Da7kj23y.mjs} +1 -1
- package/dist/{manifest-schema-bCq54i7F.mjs.map → manifest-schema-Da7kj23y.mjs.map} +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +8 -8
- package/dist/{media-its1WLYv.mjs → media-BP7S-nHT.mjs} +60 -15
- package/dist/media-BP7S-nHT.mjs.map +1 -0
- package/dist/{media-BJ6SRY3g.mjs → media-OhYL-7Io.mjs} +8 -4
- package/dist/{media-BJ6SRY3g.mjs.map → media-OhYL-7Io.mjs.map} +1 -1
- package/dist/{media-allowlist-jUppPWFy.mjs → media-allowlist-D-peH1H5.mjs} +1 -1
- package/dist/{media-allowlist-jUppPWFy.mjs.map → media-allowlist-D-peH1H5.mjs.map} +1 -1
- package/dist/{media-upload-DNu3QySc.mjs → media-upload-DtrwU2B0.mjs} +7 -7
- package/dist/{media-upload-DNu3QySc.mjs.map → media-upload-DtrwU2B0.mjs.map} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs → media-url-DYs_YLOx.mjs} +1 -1
- package/dist/{media-url-BCm5vBn6.mjs.map → media-url-DYs_YLOx.mjs.map} +1 -1
- package/dist/{media-usage-DPQ3K4xB.mjs → media-usage-BlxfTkN0.mjs} +8 -8
- package/dist/{media-usage-DPQ3K4xB.mjs.map → media-usage-BlxfTkN0.mjs.map} +1 -1
- package/dist/{menus-BMGzWyWH.mjs → menus-BcQWxeXu.mjs} +5 -5
- package/dist/{menus-BMGzWyWH.mjs.map → menus-BcQWxeXu.mjs.map} +1 -1
- package/dist/{menus-CPf_SW7u.mjs → menus-Y54RDPIN.mjs} +215 -38
- package/dist/menus-Y54RDPIN.mjs.map +1 -0
- package/dist/{mode-fiXRMfeA.mjs → mode-BWyTBe3I.mjs} +1 -1
- package/dist/{mode-fiXRMfeA.mjs.map → mode-BWyTBe3I.mjs.map} +1 -1
- package/dist/{oauth-authorization-oqfbBuMH.mjs → oauth-authorization-ClvktmrL.mjs} +5 -5
- package/dist/{oauth-authorization-oqfbBuMH.mjs.map → oauth-authorization-ClvktmrL.mjs.map} +1 -1
- package/dist/{oauth-clients-BlrUHAsf.mjs → oauth-clients-8ao-U66l.mjs} +1 -1
- package/dist/{oauth-clients-BlrUHAsf.mjs.map → oauth-clients-8ao-U66l.mjs.map} +1 -1
- package/dist/{oauth-state-store-DnvjRMy6.mjs → oauth-state-store-B1ofdTiQ.mjs} +1 -1
- package/dist/{oauth-state-store-DnvjRMy6.mjs.map → oauth-state-store-B1ofdTiQ.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-oUllxvAv.mjs → oauth-user-lookup-CscEuIiR.mjs} +1 -1
- package/dist/{oauth-user-lookup-oUllxvAv.mjs.map → oauth-user-lookup-CscEuIiR.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-Bok5j2ae.mjs → object-cache-71tPfV4A.mjs} +106 -5
- package/dist/object-cache-71tPfV4A.mjs.map +1 -0
- package/dist/{options-BqMkWfYa.d.mts → options-CA4eVX6P.d.mts} +3 -3
- package/dist/{options-BqMkWfYa.d.mts.map → options-CA4eVX6P.d.mts.map} +1 -1
- package/dist/{options-BlmBHTvX.mjs → options-CBXIHUoT.mjs} +1 -1
- package/dist/{options-BlmBHTvX.mjs.map → options-CBXIHUoT.mjs.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-53zyxlpv.mjs → parse-CJKNuewM.mjs} +2 -2
- package/dist/{parse-53zyxlpv.mjs.map → parse-CJKNuewM.mjs.map} +1 -1
- package/dist/{passkey-config-C-SKpc0-.mjs → passkey-config-D-zrzMJI.mjs} +1 -1
- package/dist/{passkey-config-C-SKpc0-.mjs.map → passkey-config-D-zrzMJI.mjs.map} +1 -1
- package/dist/{placeholder-Dop47JMM.d.mts → placeholder-DaeNS-VG.d.mts} +1 -1
- package/dist/{placeholder-Dop47JMM.d.mts.map → placeholder-DaeNS-VG.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +1 -1
- package/dist/plugin-utils.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
- package/dist/plugins/adapt-sandbox-entry.mjs +2 -2
- package/dist/{portable-text-sDj92Kxv.mjs → portable-text-B_kqBmXB.mjs} +1 -1
- package/dist/{portable-text-sDj92Kxv.mjs.map → portable-text-B_kqBmXB.mjs.map} +1 -1
- package/dist/{preview-D4Jnbfx7.mjs → preview-BU6PaLpM.mjs} +2 -2
- package/dist/{preview-D4Jnbfx7.mjs.map → preview-BU6PaLpM.mjs.map} +1 -1
- package/dist/{public-url-DSGTnJFw.mjs → public-url-Ox9oOlgp.mjs} +14 -3
- package/dist/public-url-Ox9oOlgp.mjs.map +1 -0
- package/dist/{query-Bz9bWZfm.mjs → query-C5w7PsRQ.mjs} +43 -44
- package/dist/query-C5w7PsRQ.mjs.map +1 -0
- package/dist/{query-DdFGHzQF.mjs → query-rC9HKv1N.mjs} +4 -4
- package/dist/{query-DdFGHzQF.mjs.map → query-rC9HKv1N.mjs.map} +1 -1
- package/dist/{rate-limit-D3IEiUi2.mjs → rate-limit-kug6q99V.mjs} +2 -2
- package/dist/{rate-limit-D3IEiUi2.mjs.map → rate-limit-kug6q99V.mjs.map} +1 -1
- package/dist/{redirect-BoUac4NT.mjs → redirect-DIJxXKOG.mjs} +3 -3
- package/dist/{redirect-BoUac4NT.mjs.map → redirect-DIJxXKOG.mjs.map} +1 -1
- package/dist/{redirect-Botom7X6.mjs → redirect-Egf2R9yP.mjs} +1 -1
- package/dist/{redirect-Botom7X6.mjs.map → redirect-Egf2R9yP.mjs.map} +1 -1
- package/dist/{redirects-ChbpqKiS.mjs → redirects-Bzm812bY.mjs} +5 -5
- package/dist/{redirects-ChbpqKiS.mjs.map → redirects-Bzm812bY.mjs.map} +1 -1
- package/dist/{redirects-D457qwt0.mjs → redirects-G8wAhWAf.mjs} +25 -7
- package/dist/redirects-G8wAhWAf.mjs.map +1 -0
- package/dist/{registry-y21kjhfG.mjs → registry-Dbodb4Uo.mjs} +59 -14
- package/dist/registry-Dbodb4Uo.mjs.map +1 -0
- package/dist/{relation-Du0r04E0.mjs → relation-Cbe3Sd3m.mjs} +3 -3
- package/dist/{relation-Du0r04E0.mjs.map → relation-Cbe3Sd3m.mjs.map} +1 -1
- package/dist/{relations-CZMpBqEd.mjs → relations-Bw_E1TXo.mjs} +3 -3
- package/dist/{relations-CZMpBqEd.mjs.map → relations-Bw_E1TXo.mjs.map} +1 -1
- package/dist/{relations-qKmSj9KM.d.mts → relations-G2ta7GIl.d.mts} +50 -12
- package/dist/relations-G2ta7GIl.d.mts.map +1 -0
- package/dist/{relations-DtX1UMBH.mjs → relations-qHwpUe66.mjs} +6 -6
- package/dist/{relations-DtX1UMBH.mjs.map → relations-qHwpUe66.mjs.map} +1 -1
- package/dist/request-context.d.mts +3 -0
- package/dist/request-context.d.mts.map +1 -1
- package/dist/request-context.mjs.map +1 -1
- package/dist/{request-meta-DzXYYI-n.mjs → request-meta-Df-jFbAd.mjs} +2 -2
- package/dist/{request-meta-DzXYYI-n.mjs.map → request-meta-Df-jFbAd.mjs.map} +1 -1
- package/dist/{resolve-DFr4kq72.mjs → resolve-DZzG4HqM.mjs} +2 -2
- package/dist/{resolve-DFr4kq72.mjs.map → resolve-DZzG4HqM.mjs.map} +1 -1
- package/dist/{runner-BdeLEgad.mjs → runner-BFTrkYhu.mjs} +497 -213
- package/dist/runner-BFTrkYhu.mjs.map +1 -0
- package/dist/{runner-Dd8m8k9F.d.mts → runner-BaADli8l.d.mts} +2 -2
- package/dist/{runner-Dd8m8k9F.d.mts.map → runner-BaADli8l.d.mts.map} +1 -1
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +3 -3
- package/dist/{schema-BH8P8vaC.mjs → schema-CiQXr6_F.mjs} +3 -3
- package/dist/{schema-BH8P8vaC.mjs.map → schema-CiQXr6_F.mjs.map} +1 -1
- package/dist/{scopes-DTIkIaGA.mjs → scopes-CNJVT5i5.mjs} +3 -3
- package/dist/{scopes-DTIkIaGA.mjs.map → scopes-CNJVT5i5.mjs.map} +1 -1
- package/dist/{search-D-Yhpmvs.mjs → search-FZhx5dDU.mjs} +7 -7
- package/dist/{search-D-Yhpmvs.mjs.map → search-FZhx5dDU.mjs.map} +1 -1
- package/dist/{secrets-CQ-69kF9.mjs → secrets-DLd8RXee.mjs} +4 -4
- package/dist/{secrets-CQ-69kF9.mjs.map → secrets-DLd8RXee.mjs.map} +1 -1
- package/dist/{sections-CzVBAKjw.mjs → sections-BrIrMUCn.mjs} +3 -3
- package/dist/{sections-CzVBAKjw.mjs.map → sections-BrIrMUCn.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +25 -23
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +18 -16
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-C3GDfT0V.mjs → seo-CobNfOvb.mjs} +2 -2
- package/dist/{seo-C3GDfT0V.mjs.map → seo-CobNfOvb.mjs.map} +1 -1
- package/dist/{seo-kJzVAmmu.mjs → seo-DTHRntNC.mjs} +3 -3
- package/dist/{seo-kJzVAmmu.mjs.map → seo-DTHRntNC.mjs.map} +1 -1
- package/dist/{service-CQnc276a.mjs → service-B-pYGPgR.mjs} +4 -4
- package/dist/{service-CQnc276a.mjs.map → service-B-pYGPgR.mjs.map} +1 -1
- package/dist/{session-user-DbHqKDKe.mjs → session-user-BvM9-zNl.mjs} +2 -2
- package/dist/{session-user-DbHqKDKe.mjs.map → session-user-BvM9-zNl.mjs.map} +1 -1
- package/dist/{settings-Dtc0DU31.mjs → settings-DPHau-WH.mjs} +3 -3
- package/dist/{settings-Dtc0DU31.mjs.map → settings-DPHau-WH.mjs.map} +1 -1
- package/dist/{settings-C2PaBS49.mjs → settings-kJhGiQ4z.mjs} +7 -7
- package/dist/{settings-C2PaBS49.mjs.map → settings-kJhGiQ4z.mjs.map} +1 -1
- package/dist/{setup-complete-CdIlqloh.mjs → setup-complete-u50Qm8rY.mjs} +2 -2
- package/dist/{setup-complete-CdIlqloh.mjs.map → setup-complete-u50Qm8rY.mjs.map} +1 -1
- package/dist/{setup-nonce-DqiIPr-J.mjs → setup-nonce-DCjiiOD2.mjs} +1 -1
- package/dist/{setup-nonce-DqiIPr-J.mjs.map → setup-nonce-DCjiiOD2.mjs.map} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs → single-flight-cache-DW3w11Pu.mjs} +1 -1
- package/dist/{single-flight-cache-C2exrGAi.mjs.map → single-flight-cache-DW3w11Pu.mjs.map} +1 -1
- package/dist/site-url-I-lJ5kma.mjs +16 -0
- package/dist/site-url-I-lJ5kma.mjs.map +1 -0
- package/dist/{snapshot-BdpUJKD-.mjs → snapshot-I_fjLDaD.mjs} +2 -2
- package/dist/{snapshot-BdpUJKD-.mjs.map → snapshot-I_fjLDaD.mjs.map} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs → ssrf-CTa6v21i.mjs} +1 -1
- package/dist/{ssrf-CviKqWmq.mjs.map → ssrf-CTa6v21i.mjs.map} +1 -1
- package/dist/{state-xxv6ZTMv.mjs → state-CQvoefYP.mjs} +1 -1
- package/dist/{state-xxv6ZTMv.mjs.map → state-CQvoefYP.mjs.map} +1 -1
- package/dist/{status-COfycGIU.mjs → status-CIsmlC1E.mjs} +1 -1
- package/dist/{status-COfycGIU.mjs.map → status-CIsmlC1E.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +2 -2
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/{taxonomies-BN6M9Nrv.mjs → taxonomies-CKuaZER5.mjs} +90 -9
- package/dist/taxonomies-CKuaZER5.mjs.map +1 -0
- package/dist/{taxonomies-r7pqLBCn.mjs → taxonomies-CLN1N92E.mjs} +57 -32
- package/dist/taxonomies-CLN1N92E.mjs.map +1 -0
- package/dist/{taxonomy-0mCI25HN.mjs → taxonomy-pOrB2kZe.mjs} +142 -15
- package/dist/taxonomy-pOrB2kZe.mjs.map +1 -0
- package/dist/{tokens-DVltpO2D.mjs → tokens-DagaJGK8.mjs} +1 -1
- package/dist/{tokens-DVltpO2D.mjs.map → tokens-DagaJGK8.mjs.map} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs → transaction-NQj4VJ7Z.mjs} +1 -1
- package/dist/{transaction-D0FOsb3X.mjs.map → transaction-NQj4VJ7Z.mjs.map} +1 -1
- package/dist/{transport-Vd7VdqHv.d.mts → transport-CAwTaTp_.d.mts} +1 -1
- package/dist/{transport-Vd7VdqHv.d.mts.map → transport-CAwTaTp_.d.mts.map} +1 -1
- package/dist/{transport-CKrlqSpD.mjs → transport-DVsa5YYo.mjs} +1 -1
- package/dist/{transport-CKrlqSpD.mjs.map → transport-DVsa5YYo.mjs.map} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs → trusted-proxy-D20_7fyX.mjs} +1 -1
- package/dist/{trusted-proxy-CwjQj0YG.mjs.map → trusted-proxy-D20_7fyX.mjs.map} +1 -1
- package/dist/{types-BfYUPJdP.d.mts → types-BGWPMiBO.d.mts} +2 -2
- package/dist/{types-BfYUPJdP.d.mts.map → types-BGWPMiBO.d.mts.map} +1 -1
- package/dist/{types-iVeZ5g6N.d.mts → types-BK6U01Ro.d.mts} +1 -1
- package/dist/{types-iVeZ5g6N.d.mts.map → types-BK6U01Ro.d.mts.map} +1 -1
- package/dist/{types-BD40g7zz.mjs → types-BjxTKxrZ.mjs} +1 -1
- package/dist/{types-BD40g7zz.mjs.map → types-BjxTKxrZ.mjs.map} +1 -1
- package/dist/{types-Kmaxdarz.d.mts → types-BnFP1M3J.d.mts} +22 -1
- package/dist/types-BnFP1M3J.d.mts.map +1 -0
- package/dist/{types-C7U0HlEr.d.mts → types-C8oz_ayJ.d.mts} +1 -1
- package/dist/{types-C7U0HlEr.d.mts.map → types-C8oz_ayJ.d.mts.map} +1 -1
- package/dist/{types-B4vm81VH.d.mts → types-CbUcuxxc.d.mts} +1 -1
- package/dist/{types-B4vm81VH.d.mts.map → types-CbUcuxxc.d.mts.map} +1 -1
- package/dist/{types-CrRUFdej.mjs → types-Cd8iuS1J.mjs} +10 -3
- package/dist/{types-CrRUFdej.mjs.map → types-Cd8iuS1J.mjs.map} +1 -1
- package/dist/types-CtzytVXn.mjs +18 -0
- package/dist/types-CtzytVXn.mjs.map +1 -0
- package/dist/{types-BvB7gDOD.d.mts → types-Cz8hNch2.d.mts} +5 -5
- package/dist/{types-BvB7gDOD.d.mts.map → types-Cz8hNch2.d.mts.map} +1 -1
- package/dist/{types-B97jg3aW.d.mts → types-DLG4IFEQ.d.mts} +1 -1
- package/dist/{types-B97jg3aW.d.mts.map → types-DLG4IFEQ.d.mts.map} +1 -1
- package/dist/{types-DPKhI5ib.d.mts → types-Dc4ntQjQ.d.mts} +18 -1
- package/dist/types-Dc4ntQjQ.d.mts.map +1 -0
- package/dist/{types-BNfPHfay.d.mts → types-LoagAGzH.d.mts} +1 -1
- package/dist/{types-BNfPHfay.d.mts.map → types-LoagAGzH.d.mts.map} +1 -1
- package/dist/{types-o7xo7VgH.mjs → types-NBI3rF-_.mjs} +3 -2
- package/dist/types-NBI3rF-_.mjs.map +1 -0
- package/dist/upload-attempts-D8QAFLUJ.mjs +27 -0
- package/dist/upload-attempts-D8QAFLUJ.mjs.map +1 -0
- package/dist/{user-aTXqmXBz.mjs → user-DBrq4UVq.mjs} +3 -3
- package/dist/{user-aTXqmXBz.mjs.map → user-DBrq4UVq.mjs.map} +1 -1
- package/dist/{utils-BbUgmeZG.mjs → utils-hLzi_2Fn.mjs} +2 -2
- package/dist/{utils-BbUgmeZG.mjs.map → utils-hLzi_2Fn.mjs.map} +1 -1
- package/dist/{validate-VPnKoIzW.mjs → validate-BpwoDOgt.mjs} +25 -2
- package/dist/validate-BpwoDOgt.mjs.map +1 -0
- package/dist/{validate-DULfgpJP.d.mts → validate-C3oSmA7F.d.mts} +15 -5
- package/dist/validate-C3oSmA7F.d.mts.map +1 -0
- package/dist/{validate-CDT1jl6_.mjs → validate-mKo3RxBM.mjs} +4 -4
- package/dist/{validate-CDT1jl6_.mjs.map → validate-mKo3RxBM.mjs.map} +1 -1
- package/dist/{validation-DlD0E35W.mjs → validation-BgpucsvF.mjs} +11 -9
- package/dist/{validation-DlD0E35W.mjs.map → validation-BgpucsvF.mjs.map} +1 -1
- package/dist/version-C4PnpmoV.mjs +7 -0
- package/dist/{version-BRMngh9I.mjs.map → version-C4PnpmoV.mjs.map} +1 -1
- package/dist/{widgets-5fipNkMT.mjs → widgets-CJJtkiKh.mjs} +3 -3
- package/dist/{widgets-5fipNkMT.mjs.map → widgets-CJJtkiKh.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-DrihupaC.mjs → wxr-taxonomies-9PPSy8X6.mjs} +4 -4
- package/dist/{wxr-taxonomies-DrihupaC.mjs.map → wxr-taxonomies-9PPSy8X6.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-B4tMuN5T.d.mts → wxr-taxonomies-Bkpp_2tK.d.mts} +1 -1
- package/dist/{wxr-taxonomies-B4tMuN5T.d.mts.map → wxr-taxonomies-Bkpp_2tK.d.mts.map} +1 -1
- package/dist/{zod-generator-CwkHWz4f.mjs → zod-generator-CG64Hnbh.mjs} +3 -3
- package/dist/{zod-generator-CwkHWz4f.mjs.map → zod-generator-CG64Hnbh.mjs.map} +1 -1
- package/package.json +12 -8
- package/src/after.ts +6 -1
- package/src/api/errors.ts +1 -0
- package/src/api/handlers/content.ts +45 -4
- package/src/api/handlers/marketplace.ts +14 -0
- package/src/api/handlers/media.ts +4 -4
- package/src/api/handlers/registry.ts +14 -0
- package/src/api/handlers/revision.ts +19 -5
- package/src/api/handlers/schema.ts +37 -0
- package/src/api/handlers/snapshot.ts +1 -1
- package/src/api/handlers/taxonomies.ts +111 -10
- package/src/api/openapi/document.ts +84 -3
- package/src/api/public-url.ts +14 -2
- package/src/api/schemas/media.ts +9 -2
- package/src/api/schemas/schema.ts +13 -0
- package/src/api/schemas/search.ts +2 -0
- package/src/api/schemas/taxonomies.ts +34 -1
- package/src/api/site-url.ts +16 -6
- package/src/astro/integration/routes.ts +19 -0
- package/src/astro/integration/runtime.ts +13 -0
- package/src/astro/integration/virtual-modules.ts +2 -0
- package/src/astro/middleware/redirect.ts +2 -10
- package/src/astro/middleware/scoped-db.ts +35 -4
- package/src/astro/middleware.ts +56 -22
- package/src/astro/routes/api/admin/comments/[id]/status.ts +1 -1
- package/src/astro/routes/api/admin/users/[id]/send-recovery.ts +2 -2
- package/src/astro/routes/api/auth/invite/index.ts +2 -2
- package/src/astro/routes/api/auth/magic-link/send.ts +2 -2
- package/src/astro/routes/api/auth/signup/request.ts +2 -2
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +1 -1
- package/src/astro/routes/api/content/[collection]/[id].ts +3 -1
- package/src/astro/routes/api/media/[id]/confirm.ts +148 -59
- package/src/astro/routes/api/media/[id]/upload.ts +262 -0
- package/src/astro/routes/api/media/[id].ts +19 -10
- package/src/astro/routes/api/media/upload-url.ts +28 -31
- package/src/astro/routes/api/schema/collections/reorder.ts +31 -0
- package/src/astro/routes/api/schema/index.ts +2 -0
- package/src/astro/routes/api/search/enable.ts +5 -1
- package/src/astro/routes/api/search/rebuild.ts +6 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +41 -0
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +6 -3
- package/src/astro/types.ts +7 -0
- package/src/cleanup.ts +54 -26
- package/src/cli/commands/dev.ts +13 -3
- package/src/cli/commands/export-seed.ts +2 -0
- package/src/cli/index.ts +1 -1
- package/src/components/CommentForm.astro +1 -1
- package/src/components/Comments.astro +1 -1
- package/src/components/InlinePortableTextEditor.tsx +175 -31
- package/src/components/OrderedList.astro +14 -0
- package/src/components/PortableText.astro +26 -4
- package/src/components/code-mark.ts +11 -0
- package/src/components/index.ts +12 -1
- package/src/components/ordered-list.ts +549 -0
- package/src/content/converters/numbered-list.ts +148 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +59 -9
- package/src/content/converters/prosemirror-to-portable-text.ts +23 -12
- package/src/content/converters/types.ts +2 -0
- package/src/content/portable-text-lists.ts +205 -0
- package/src/database/dialect-helpers.ts +41 -22
- package/src/database/migrations/054_media_upload_attempts.ts +41 -0
- package/src/database/migrations/055_content_translation_group_locale_index.ts +67 -0
- package/src/database/migrations/056_taxonomy_term_sort_order.ts +189 -0
- package/src/database/migrations/057_collection_hidden.ts +24 -0
- package/src/database/migrations/058_collection_sort_order.ts +20 -0
- package/src/database/migrations/059_revision_prune_queue.ts +36 -0
- package/src/database/migrations/runner.ts +12 -0
- package/src/database/repositories/content.ts +193 -183
- package/src/database/repositories/media.ts +158 -28
- package/src/database/repositories/revision.ts +82 -17
- package/src/database/repositories/taxonomy.ts +202 -7
- package/src/database/repositories/types.ts +7 -0
- package/src/database/types.ts +23 -1
- package/src/database/validate.ts +39 -0
- package/src/db/adapters.ts +8 -0
- package/src/deferred-tasks.ts +71 -0
- package/src/emdash-runtime.ts +277 -88
- package/src/i18n/config.ts +17 -10
- package/src/index.ts +3 -0
- package/src/loader.ts +46 -24
- package/src/media/upload-attempts.ts +33 -0
- package/src/media/usage/gc.ts +50 -0
- package/src/object-cache/index.ts +160 -3
- package/src/plugins/routes.ts +34 -0
- package/src/plugins/storage-indexes.ts +50 -11
- package/src/query.ts +50 -44
- package/src/redirects/cache.ts +79 -19
- package/src/request-context.ts +3 -0
- package/src/scheduled-publish.ts +6 -1
- package/src/schema/registry.ts +95 -3
- package/src/schema/types.ts +24 -0
- package/src/search/fts-manager.ts +50 -10
- package/src/search/index.ts +2 -0
- package/src/search/types.ts +6 -0
- package/src/seed/apply.ts +22 -2
- package/src/seed/types.ts +10 -0
- package/src/storage/s3.ts +1 -1
- package/src/taxonomies/index.ts +11 -7
- package/src/taxonomies/term-counts.ts +56 -28
- package/src/ui-comments.ts +19 -0
- package/src/ui.ts +11 -3
- package/src/utils/hash.ts +14 -3
- package/src/virtual-modules.d.ts +8 -0
- package/dist/adapters-C0ONzkUP.d.mts.map +0 -1
- package/dist/after-B1IIdH3Y.mjs +0 -29
- package/dist/after-B1IIdH3Y.mjs.map +0 -1
- package/dist/api-BkqFzIu4.mjs.map +0 -1
- package/dist/apply-DuXsqll7.mjs.map +0 -1
- package/dist/cache-DDwy3JDW.mjs +0 -65
- package/dist/cache-DDwy3JDW.mjs.map +0 -1
- package/dist/config-B6b_BobR.mjs.map +0 -1
- package/dist/content-BC43pICM.mjs.map +0 -1
- package/dist/dialect-helpers-BtOwo2us.mjs.map +0 -1
- package/dist/errors-DtEXIQQV.mjs.map +0 -1
- package/dist/fts-manager-hyCU9OOp.mjs.map +0 -1
- package/dist/hash-DFFrkivP.mjs.map +0 -1
- package/dist/index-BZJ_5FOX.d.mts.map +0 -1
- package/dist/loader-D4rigvjR.mjs.map +0 -1
- package/dist/media-its1WLYv.mjs.map +0 -1
- package/dist/menus-CPf_SW7u.mjs.map +0 -1
- package/dist/object-cache-Bok5j2ae.mjs.map +0 -1
- package/dist/public-url-DSGTnJFw.mjs.map +0 -1
- package/dist/query-Bz9bWZfm.mjs.map +0 -1
- package/dist/redirects-D457qwt0.mjs.map +0 -1
- package/dist/registry-y21kjhfG.mjs.map +0 -1
- package/dist/relations-qKmSj9KM.d.mts.map +0 -1
- package/dist/runner-BdeLEgad.mjs.map +0 -1
- package/dist/site-url-NGJT6NTU.mjs +0 -13
- package/dist/site-url-NGJT6NTU.mjs.map +0 -1
- package/dist/taxonomies-BN6M9Nrv.mjs.map +0 -1
- package/dist/taxonomies-r7pqLBCn.mjs.map +0 -1
- package/dist/taxonomy-0mCI25HN.mjs.map +0 -1
- package/dist/types-DPKhI5ib.d.mts.map +0 -1
- package/dist/types-Kmaxdarz.d.mts.map +0 -1
- package/dist/types-o7xo7VgH.mjs.map +0 -1
- package/dist/validate-DULfgpJP.d.mts.map +0 -1
- package/dist/validate-VPnKoIzW.mjs.map +0 -1
- package/dist/version-BRMngh9I.mjs +0 -7
- /package/dist/{api-tokens-Cvmixds7.mjs → api-tokens-Dai9dND0.mjs} +0 -0
- /package/dist/{ssrf-BB__xfNM.mjs → ssrf-Cj568Dgs.mjs} +0 -0
- /package/dist/{types-CK0LxPUQ.mjs → types-DKuWPYV5.mjs} +0 -0
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { sanitizeGalleryImages } from "./gallery.js";
|
|
8
|
+
import {
|
|
9
|
+
deriveLegacyListId,
|
|
10
|
+
normalizeProseMirrorOrderedListJson,
|
|
11
|
+
normalizeListId,
|
|
12
|
+
normalizeListStart,
|
|
13
|
+
} from "./numbered-list.js";
|
|
8
14
|
import type {
|
|
9
15
|
ProseMirrorDocument,
|
|
10
16
|
ProseMirrorNode,
|
|
@@ -48,12 +54,20 @@ export function portableTextToProsemirror(blocks: PortableTextBlock[]): ProseMir
|
|
|
48
54
|
// child).
|
|
49
55
|
const listBlocks: PortableTextTextBlock[] = [];
|
|
50
56
|
const listType = block.listItem;
|
|
57
|
+
const runStart = i;
|
|
58
|
+
const rootId = listType === "number" ? normalizeListId(block.listId) : undefined;
|
|
51
59
|
|
|
52
60
|
while (i < blocks.length) {
|
|
53
61
|
const current = blocks[i];
|
|
54
62
|
if (!isTextBlock(current) || !current.listItem) break;
|
|
55
63
|
const level = current.level || 1;
|
|
56
|
-
|
|
64
|
+
const currentId =
|
|
65
|
+
current.listItem === "number" ? normalizeListId(current.listId) : undefined;
|
|
66
|
+
const sameRootIdentity =
|
|
67
|
+
listType !== "number" ||
|
|
68
|
+
level > 1 ||
|
|
69
|
+
(rootId ? currentId === rootId : currentId === undefined);
|
|
70
|
+
if (level > 1 || (current.listItem === listType && sameRootIdentity)) {
|
|
57
71
|
listBlocks.push(current);
|
|
58
72
|
i++;
|
|
59
73
|
} else {
|
|
@@ -61,14 +75,14 @@ export function portableTextToProsemirror(blocks: PortableTextBlock[]): ProseMir
|
|
|
61
75
|
}
|
|
62
76
|
}
|
|
63
77
|
|
|
64
|
-
content.push(convertList(listBlocks, listType));
|
|
78
|
+
content.push(convertList(listBlocks, listType, `root:${runStart}`));
|
|
65
79
|
} else if (isTextBlock(block) && block.style === "blockquote") {
|
|
66
80
|
// Collect a blockquote "run": Portable Text is flat, so a
|
|
67
81
|
// multi-paragraph quote is stored as consecutive blocks with
|
|
68
82
|
// style "blockquote" (that's what the Gutenberg importer emits
|
|
69
83
|
// and what prosemirrorToPortableText serializes back to).
|
|
70
84
|
// Without this grouping each paragraph became its own quote
|
|
71
|
-
// node, and editor merges reverted on reload
|
|
85
|
+
// node, and editor merges reverted on reload.
|
|
72
86
|
const quoteBlocks: PortableTextTextBlock[] = [];
|
|
73
87
|
while (i < blocks.length) {
|
|
74
88
|
const current = blocks[i];
|
|
@@ -102,12 +116,38 @@ export function portableTextToProsemirror(blocks: PortableTextBlock[]): ProseMir
|
|
|
102
116
|
}
|
|
103
117
|
}
|
|
104
118
|
|
|
105
|
-
return {
|
|
119
|
+
return normalizeProseMirrorOrderedListJson({
|
|
106
120
|
type: "doc",
|
|
107
121
|
content: content.length > 0 ? content : [{ type: "paragraph" }],
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function getListMetadata(
|
|
126
|
+
item: PortableTextTextBlock,
|
|
127
|
+
fallbackSeed: string,
|
|
128
|
+
): { listId: string; listStart?: number } {
|
|
129
|
+
const listId = normalizeListId(item.listId) ?? deriveLegacyListId(fallbackSeed);
|
|
130
|
+
const listStart = normalizeListStart(item.listStart);
|
|
131
|
+
return {
|
|
132
|
+
listId,
|
|
133
|
+
...(listStart === undefined ? {} : { listStart }),
|
|
108
134
|
};
|
|
109
135
|
}
|
|
110
136
|
|
|
137
|
+
function belongsToNestedGroup(
|
|
138
|
+
item: PortableTextTextBlock,
|
|
139
|
+
minLevel: number,
|
|
140
|
+
parentListType: "bullet" | "number",
|
|
141
|
+
anchorType: "bullet" | "number",
|
|
142
|
+
anchorId: string | undefined,
|
|
143
|
+
): boolean {
|
|
144
|
+
if ((item.level || 2) > minLevel) return true;
|
|
145
|
+
if ((item.listItem || parentListType) !== anchorType) return false;
|
|
146
|
+
if (anchorType !== "number") return true;
|
|
147
|
+
const itemId = normalizeListId(item.listId);
|
|
148
|
+
return anchorId ? itemId === anchorId : itemId === undefined;
|
|
149
|
+
}
|
|
150
|
+
|
|
111
151
|
/**
|
|
112
152
|
* Type guard for text blocks
|
|
113
153
|
*/
|
|
@@ -249,6 +289,7 @@ function convertTextBlock(block: PortableTextTextBlock): ProseMirrorNode | null
|
|
|
249
289
|
function convertList(
|
|
250
290
|
items: PortableTextTextBlock[],
|
|
251
291
|
listType: "bullet" | "number",
|
|
292
|
+
context: string,
|
|
252
293
|
): ProseMirrorNode {
|
|
253
294
|
// Group items by level
|
|
254
295
|
const rootItems: ProseMirrorNode[] = [];
|
|
@@ -268,16 +309,22 @@ function convertList(
|
|
|
268
309
|
i++;
|
|
269
310
|
}
|
|
270
311
|
|
|
271
|
-
rootItems.push(
|
|
312
|
+
rootItems.push(
|
|
313
|
+
convertListItem(item, nestedItems, listType, `${context}:${rootItems.length}`),
|
|
314
|
+
);
|
|
272
315
|
} else {
|
|
273
316
|
// Orphan nested item - treat as root
|
|
274
|
-
rootItems.push(convertListItem(item, [], listType));
|
|
317
|
+
rootItems.push(convertListItem(item, [], listType, `${context}:${rootItems.length}`));
|
|
275
318
|
i++;
|
|
276
319
|
}
|
|
277
320
|
}
|
|
278
321
|
|
|
322
|
+
const metadata =
|
|
323
|
+
listType === "number" ? getListMetadata(items[0], `${context}:${items[0]._key}`) : undefined;
|
|
324
|
+
|
|
279
325
|
return {
|
|
280
326
|
type: listType === "bullet" ? "bulletList" : "orderedList",
|
|
327
|
+
attrs: metadata ? { ...metadata, start: metadata.listStart ?? 1 } : undefined,
|
|
281
328
|
content: rootItems,
|
|
282
329
|
};
|
|
283
330
|
}
|
|
@@ -289,6 +336,7 @@ function convertListItem(
|
|
|
289
336
|
item: PortableTextTextBlock,
|
|
290
337
|
nestedItems: PortableTextTextBlock[],
|
|
291
338
|
parentListType: "bullet" | "number",
|
|
339
|
+
context: string,
|
|
292
340
|
): ProseMirrorNode {
|
|
293
341
|
const content: ProseMirrorNode[] = [];
|
|
294
342
|
|
|
@@ -319,6 +367,7 @@ function convertListItem(
|
|
|
319
367
|
let j = 0;
|
|
320
368
|
while (j < nestedItems.length) {
|
|
321
369
|
const anchorType: "bullet" | "number" = nestedItems[j].listItem || parentListType;
|
|
370
|
+
const anchorId = anchorType === "number" ? normalizeListId(nestedItems[j].listId) : undefined;
|
|
322
371
|
const nestedGroup: PortableTextTextBlock[] = [];
|
|
323
372
|
|
|
324
373
|
do {
|
|
@@ -326,8 +375,7 @@ function convertListItem(
|
|
|
326
375
|
j++;
|
|
327
376
|
} while (
|
|
328
377
|
j < nestedItems.length &&
|
|
329
|
-
(
|
|
330
|
-
(nestedItems[j].listItem || parentListType) === anchorType)
|
|
378
|
+
belongsToNestedGroup(nestedItems[j], minLevel, parentListType, anchorType, anchorId)
|
|
331
379
|
);
|
|
332
380
|
|
|
333
381
|
if (nestedGroup.length > 0) {
|
|
@@ -336,7 +384,9 @@ function convertListItem(
|
|
|
336
384
|
...ni,
|
|
337
385
|
level: (ni.level || 2) - 1,
|
|
338
386
|
}));
|
|
339
|
-
content.push(
|
|
387
|
+
content.push(
|
|
388
|
+
convertList(adjustedGroup, anchorType, `${context}:nested:${j - nestedGroup.length}`),
|
|
389
|
+
);
|
|
340
390
|
}
|
|
341
391
|
}
|
|
342
392
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { sanitizeGalleryImages } from "./gallery.js";
|
|
8
|
+
import { readOrderedListMetadata, type OrderedListMetadata } from "./numbered-list.js";
|
|
8
9
|
import type {
|
|
9
10
|
ProseMirrorDocument,
|
|
10
11
|
ProseMirrorNode,
|
|
@@ -36,8 +37,8 @@ export function prosemirrorToPortableText(doc: ProseMirrorDocument): PortableTex
|
|
|
36
37
|
|
|
37
38
|
const blocks: PortableTextBlock[] = [];
|
|
38
39
|
|
|
39
|
-
for (const node of doc.content) {
|
|
40
|
-
const converted = convertNode(node);
|
|
40
|
+
for (const [i, node] of doc.content.entries()) {
|
|
41
|
+
const converted = convertNode(node, `root:${i}`);
|
|
41
42
|
if (converted) {
|
|
42
43
|
if (Array.isArray(converted)) {
|
|
43
44
|
blocks.push(...converted);
|
|
@@ -53,7 +54,10 @@ export function prosemirrorToPortableText(doc: ProseMirrorDocument): PortableTex
|
|
|
53
54
|
/**
|
|
54
55
|
* Convert a single ProseMirror node to Portable Text block(s)
|
|
55
56
|
*/
|
|
56
|
-
function convertNode(
|
|
57
|
+
function convertNode(
|
|
58
|
+
node: ProseMirrorNode,
|
|
59
|
+
path: string,
|
|
60
|
+
): PortableTextBlock | PortableTextBlock[] | null {
|
|
57
61
|
switch (node.type) {
|
|
58
62
|
case "paragraph":
|
|
59
63
|
return convertParagraph(node);
|
|
@@ -62,10 +66,10 @@ function convertNode(node: ProseMirrorNode): PortableTextBlock | PortableTextBlo
|
|
|
62
66
|
return convertHeading(node);
|
|
63
67
|
|
|
64
68
|
case "bulletList":
|
|
65
|
-
return convertList(node, "bullet");
|
|
69
|
+
return convertList(node, "bullet", path);
|
|
66
70
|
|
|
67
71
|
case "orderedList":
|
|
68
|
-
return convertList(node, "number");
|
|
72
|
+
return convertList(node, "number", path);
|
|
69
73
|
|
|
70
74
|
case "blockquote":
|
|
71
75
|
return convertBlockquote(node);
|
|
@@ -175,12 +179,14 @@ function convertHeading(node: ProseMirrorNode): PortableTextTextBlock | null {
|
|
|
175
179
|
function convertList(
|
|
176
180
|
node: ProseMirrorNode,
|
|
177
181
|
listItem: "bullet" | "number",
|
|
182
|
+
path: string,
|
|
178
183
|
): PortableTextTextBlock[] {
|
|
179
184
|
const blocks: PortableTextTextBlock[] = [];
|
|
185
|
+
const metadata = listItem === "number" ? readOrderedListMetadata(node.attrs, path) : undefined;
|
|
180
186
|
|
|
181
|
-
for (const item of node.content
|
|
187
|
+
for (const [i, item] of (node.content ?? []).entries()) {
|
|
182
188
|
if (item.type === "listItem") {
|
|
183
|
-
const itemBlocks = convertListItem(item, listItem, 1);
|
|
189
|
+
const itemBlocks = convertListItem(item, listItem, 1, `${path}:${i}`, metadata);
|
|
184
190
|
blocks.push(...itemBlocks);
|
|
185
191
|
}
|
|
186
192
|
}
|
|
@@ -195,10 +201,12 @@ function convertListItem(
|
|
|
195
201
|
item: ProseMirrorNode,
|
|
196
202
|
listItem: "bullet" | "number",
|
|
197
203
|
level: number,
|
|
204
|
+
path: string,
|
|
205
|
+
metadata?: OrderedListMetadata,
|
|
198
206
|
): PortableTextTextBlock[] {
|
|
199
207
|
const blocks: PortableTextTextBlock[] = [];
|
|
200
208
|
|
|
201
|
-
for (const child of item.content
|
|
209
|
+
for (const [i, child] of (item.content ?? []).entries()) {
|
|
202
210
|
if (child.type === "paragraph") {
|
|
203
211
|
const { children, markDefs } = convertInlineContent(child.content || []);
|
|
204
212
|
|
|
@@ -209,14 +217,15 @@ function convertListItem(
|
|
|
209
217
|
style: "normal",
|
|
210
218
|
listItem,
|
|
211
219
|
level,
|
|
220
|
+
...metadata,
|
|
212
221
|
children,
|
|
213
222
|
markDefs: markDefs.length > 0 ? markDefs : undefined,
|
|
214
223
|
});
|
|
215
224
|
}
|
|
216
225
|
} else if (child.type === "bulletList") {
|
|
217
|
-
blocks.push(...convertListItemNested(child, "bullet", level + 1));
|
|
226
|
+
blocks.push(...convertListItemNested(child, "bullet", level + 1, `${path}:${i}`));
|
|
218
227
|
} else if (child.type === "orderedList") {
|
|
219
|
-
blocks.push(...convertListItemNested(child, "number", level + 1));
|
|
228
|
+
blocks.push(...convertListItemNested(child, "number", level + 1, `${path}:${i}`));
|
|
220
229
|
}
|
|
221
230
|
}
|
|
222
231
|
|
|
@@ -230,12 +239,14 @@ function convertListItemNested(
|
|
|
230
239
|
node: ProseMirrorNode,
|
|
231
240
|
listItem: "bullet" | "number",
|
|
232
241
|
level: number,
|
|
242
|
+
path: string,
|
|
233
243
|
): PortableTextTextBlock[] {
|
|
234
244
|
const blocks: PortableTextTextBlock[] = [];
|
|
245
|
+
const metadata = listItem === "number" ? readOrderedListMetadata(node.attrs, path) : undefined;
|
|
235
246
|
|
|
236
|
-
for (const item of node.content
|
|
247
|
+
for (const [i, item] of (node.content ?? []).entries()) {
|
|
237
248
|
if (item.type === "listItem") {
|
|
238
|
-
blocks.push(...convertListItem(item, listItem, level));
|
|
249
|
+
blocks.push(...convertListItem(item, listItem, level, `${path}:${i}`, metadata));
|
|
239
250
|
}
|
|
240
251
|
}
|
|
241
252
|
|
|
@@ -41,6 +41,8 @@ export interface PortableTextTextBlock {
|
|
|
41
41
|
style?: "normal" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "blockquote";
|
|
42
42
|
listItem?: "bullet" | "number";
|
|
43
43
|
level?: number;
|
|
44
|
+
listId?: string;
|
|
45
|
+
listStart?: number;
|
|
44
46
|
children: PortableTextSpan[];
|
|
45
47
|
markDefs?: PortableTextMarkDef[];
|
|
46
48
|
textAlign?: "left" | "center" | "right" | "justify";
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deriveLegacyListId,
|
|
3
|
+
normalizeListId,
|
|
4
|
+
normalizeListStart,
|
|
5
|
+
} from "./converters/numbered-list.js";
|
|
6
|
+
|
|
7
|
+
type ListNestingMode = "html" | "direct";
|
|
8
|
+
type PortableTextNode = Record<string, unknown>;
|
|
9
|
+
|
|
10
|
+
interface PortableTextListBlock extends PortableTextNode {
|
|
11
|
+
_type: "block";
|
|
12
|
+
children: unknown[];
|
|
13
|
+
level?: number;
|
|
14
|
+
listId?: unknown;
|
|
15
|
+
listItem: string;
|
|
16
|
+
listStart?: unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PortableTextListNode extends PortableTextNode {
|
|
20
|
+
_type: "@list";
|
|
21
|
+
_key: string;
|
|
22
|
+
children: PortableTextNode[];
|
|
23
|
+
level: number;
|
|
24
|
+
listItem: string;
|
|
25
|
+
mode: ListNestingMode;
|
|
26
|
+
start?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface ListDescriptor {
|
|
30
|
+
node: PortableTextListNode;
|
|
31
|
+
directItems: Array<{
|
|
32
|
+
original: PortableTextListBlock;
|
|
33
|
+
rendered: PortableTextListBlock;
|
|
34
|
+
}>;
|
|
35
|
+
level: number;
|
|
36
|
+
parentContext: string;
|
|
37
|
+
sourceId: string | undefined;
|
|
38
|
+
segment: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ParentItem {
|
|
42
|
+
context: string;
|
|
43
|
+
list: ListDescriptor;
|
|
44
|
+
rendered: PortableTextListBlock;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function isListBlock(node: PortableTextNode): node is PortableTextListBlock {
|
|
48
|
+
return (
|
|
49
|
+
node._type === "block" && typeof node.listItem === "string" && Array.isArray(node.children)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function readLevel(value: unknown): number {
|
|
54
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 1 ? value : 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function findParentItem(items: Map<number, ParentItem>, level: number): ParentItem | undefined {
|
|
58
|
+
let nearestLevel = 0;
|
|
59
|
+
let nearest: ParentItem | undefined;
|
|
60
|
+
for (const [candidate, item] of items) {
|
|
61
|
+
if (candidate < level && candidate > nearestLevel) {
|
|
62
|
+
nearestLevel = candidate;
|
|
63
|
+
nearest = item;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return nearest;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function matchesList(
|
|
70
|
+
descriptor: ListDescriptor | undefined,
|
|
71
|
+
listItem: string,
|
|
72
|
+
sourceId: string | undefined,
|
|
73
|
+
parentContext: string,
|
|
74
|
+
): descriptor is ListDescriptor {
|
|
75
|
+
return (
|
|
76
|
+
descriptor !== undefined &&
|
|
77
|
+
descriptor.node.listItem === listItem &&
|
|
78
|
+
descriptor.parentContext === parentContext &&
|
|
79
|
+
(listItem !== "number" || descriptor.sourceId === sourceId)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function buildListTree(
|
|
84
|
+
blocks: PortableTextNode[],
|
|
85
|
+
mode: ListNestingMode,
|
|
86
|
+
): { tree: PortableTextNode[]; descriptors: ListDescriptor[] } {
|
|
87
|
+
const tree: PortableTextNode[] = [];
|
|
88
|
+
const descriptors: ListDescriptor[] = [];
|
|
89
|
+
const activeLists = new Map<number, ListDescriptor>();
|
|
90
|
+
const lastItems = new Map<number, ParentItem>();
|
|
91
|
+
let segment = 0;
|
|
92
|
+
|
|
93
|
+
for (let index = 0; index < blocks.length; index++) {
|
|
94
|
+
const block = blocks[index];
|
|
95
|
+
if (!isListBlock(block)) {
|
|
96
|
+
tree.push(block);
|
|
97
|
+
activeLists.clear();
|
|
98
|
+
lastItems.clear();
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const level = readLevel(block.level);
|
|
103
|
+
for (const activeLevel of activeLists.keys()) {
|
|
104
|
+
if (activeLevel > level) activeLists.delete(activeLevel);
|
|
105
|
+
}
|
|
106
|
+
for (const itemLevel of lastItems.keys()) {
|
|
107
|
+
if (itemLevel > level) lastItems.delete(itemLevel);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const parent = findParentItem(lastItems, level);
|
|
111
|
+
const parentContext = parent?.context ?? "root";
|
|
112
|
+
const sourceId = block.listItem === "number" ? normalizeListId(block.listId) : undefined;
|
|
113
|
+
let descriptor = activeLists.get(level);
|
|
114
|
+
if (!matchesList(descriptor, block.listItem, sourceId, parentContext)) {
|
|
115
|
+
const node: PortableTextListNode = {
|
|
116
|
+
_type: "@list",
|
|
117
|
+
_key: `${typeof block._key === "string" ? block._key : index}-parent`,
|
|
118
|
+
children: [],
|
|
119
|
+
level,
|
|
120
|
+
listItem: block.listItem,
|
|
121
|
+
mode,
|
|
122
|
+
};
|
|
123
|
+
descriptor = {
|
|
124
|
+
node,
|
|
125
|
+
directItems: [],
|
|
126
|
+
level,
|
|
127
|
+
parentContext,
|
|
128
|
+
sourceId,
|
|
129
|
+
segment: segment++,
|
|
130
|
+
};
|
|
131
|
+
descriptors.push(descriptor);
|
|
132
|
+
activeLists.set(level, descriptor);
|
|
133
|
+
if (!parent) {
|
|
134
|
+
tree.push(node);
|
|
135
|
+
} else if (mode === "direct") {
|
|
136
|
+
parent.list.node.children.push(node);
|
|
137
|
+
} else {
|
|
138
|
+
parent.rendered.children.push(node);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const rendered = { ...block, children: [...block.children] };
|
|
143
|
+
descriptor.node.children.push(rendered);
|
|
144
|
+
descriptor.directItems.push({ original: block, rendered });
|
|
145
|
+
lastItems.set(level, {
|
|
146
|
+
context: `${parentContext}/item:${index}`,
|
|
147
|
+
list: descriptor,
|
|
148
|
+
rendered,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return { tree, descriptors };
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function applyNumbering(descriptors: ListDescriptor[]): void {
|
|
156
|
+
const bases = new Map<string, number>();
|
|
157
|
+
const scopeKeys = new Map<ListDescriptor, string>();
|
|
158
|
+
for (const descriptor of descriptors) {
|
|
159
|
+
if (descriptor.node.listItem !== "number") continue;
|
|
160
|
+
const identity =
|
|
161
|
+
descriptor.sourceId ??
|
|
162
|
+
deriveLegacyListId(
|
|
163
|
+
`render:${descriptor.segment}:${descriptor.level}:${descriptor.parentContext}`,
|
|
164
|
+
);
|
|
165
|
+
const scope = JSON.stringify([identity, descriptor.level, descriptor.parentContext]);
|
|
166
|
+
scopeKeys.set(descriptor, scope);
|
|
167
|
+
if (!descriptor.sourceId || bases.has(scope)) continue;
|
|
168
|
+
for (const { original } of descriptor.directItems) {
|
|
169
|
+
const base = normalizeListStart(original.listStart);
|
|
170
|
+
if (base === undefined) continue;
|
|
171
|
+
bases.set(scope, base);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const counts = new Map<string, number>();
|
|
177
|
+
for (const descriptor of descriptors) {
|
|
178
|
+
if (descriptor.node.listItem !== "number") continue;
|
|
179
|
+
const scope = scopeKeys.get(descriptor)!;
|
|
180
|
+
const base = bases.get(scope) ?? 1;
|
|
181
|
+
const count = counts.get(scope) ?? 0;
|
|
182
|
+
descriptor.node.start = normalizeListStart(base + count) ?? 1;
|
|
183
|
+
counts.set(scope, count + descriptor.directItems.length);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function preprocessLists(
|
|
188
|
+
blocks: PortableTextNode[],
|
|
189
|
+
mode: ListNestingMode,
|
|
190
|
+
): { tree: PortableTextNode[]; descriptors: ListDescriptor[] } {
|
|
191
|
+
const result = buildListTree(blocks, mode);
|
|
192
|
+
applyNumbering(result.descriptors);
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function clonePortableTextValue<T>(value: T): T {
|
|
197
|
+
return structuredClone(value);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function buildPortableTextListTree(
|
|
201
|
+
blocks: PortableTextNode[],
|
|
202
|
+
mode: ListNestingMode = "html",
|
|
203
|
+
): PortableTextNode[] {
|
|
204
|
+
return preprocessLists(blocks, mode).tree;
|
|
205
|
+
}
|
|
@@ -37,6 +37,44 @@ export function isPostgres(db: Kysely<any>): boolean {
|
|
|
37
37
|
return detectDialect(db) === "postgres";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Declared by an adapter whose backend caps the number of terms in a compound
|
|
42
|
+
* SELECT (`UNION ALL`, `INTERSECT`, `EXCEPT`). SQLite's own
|
|
43
|
+
* SQLITE_LIMIT_COMPOUND_SELECT default is 500 — high enough that no query
|
|
44
|
+
* EmDash builds approaches it — but Cloudflare D1 sets it to 5 and rejects
|
|
45
|
+
* anything larger with "too many terms in compound SELECT".
|
|
46
|
+
*/
|
|
47
|
+
export interface CompoundSelectLimitedAdapter {
|
|
48
|
+
/** Maximum terms per compound SELECT. Must be a positive integer. */
|
|
49
|
+
readonly compoundSelectLimit: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The backend's compound-SELECT ceiling, or null when it has none worth
|
|
54
|
+
* splitting statements for. Only the adapter knows: the limit is a property of
|
|
55
|
+
* the SQLite build behind the dialect, not of the SQL flavour, so two "sqlite"
|
|
56
|
+
* dialects can answer differently.
|
|
57
|
+
*
|
|
58
|
+
* A declared ceiling must be a positive integer — callers batch by it, and
|
|
59
|
+
* every other value silently misbehaves rather than failing: 0 and negatives
|
|
60
|
+
* never advance the batch cursor, fractions overlap batches and double-count,
|
|
61
|
+
* NaN yields an empty batch. A malformed declaration throws here, where the
|
|
62
|
+
* message can name the adapter.
|
|
63
|
+
*/
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accepts any Kysely instance
|
|
65
|
+
export function compoundSelectLimit(db: Kysely<any>): number | null {
|
|
66
|
+
const adapter: object = db.getExecutor().adapter;
|
|
67
|
+
if (!("compoundSelectLimit" in adapter)) return null;
|
|
68
|
+
|
|
69
|
+
const limit: unknown = adapter.compoundSelectLimit;
|
|
70
|
+
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1) {
|
|
71
|
+
throw new Error(
|
|
72
|
+
`${adapter.constructor.name} declares compoundSelectLimit ${String(limit)}; it must be a positive integer.`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return limit;
|
|
76
|
+
}
|
|
77
|
+
|
|
40
78
|
/**
|
|
41
79
|
* Default timestamp expression for column defaults.
|
|
42
80
|
* Wrapped in parens for use in CREATE TABLE ... DEFAULT (...).
|
|
@@ -69,35 +107,16 @@ export function currentTimestampValue(db: Kysely<any>): RawBuilder<string> {
|
|
|
69
107
|
|
|
70
108
|
/**
|
|
71
109
|
* Build WHERE clause for status filtering on a content table.
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* Visibility is computed, not flipped by cron, so a literal
|
|
76
|
-
* `status = 'published'` comparison undercounts scheduled-and-due entries —
|
|
77
|
-
* every "publicly visible" filter must go through this helper.
|
|
110
|
+
* Scheduled content becomes public only after the publication sweep commits
|
|
111
|
+
* the row with a literal `published` status.
|
|
78
112
|
*/
|
|
79
113
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- accepts any Kysely instance
|
|
80
114
|
export function buildStatusCondition(
|
|
81
|
-
|
|
115
|
+
_db: Kysely<any>,
|
|
82
116
|
status: string,
|
|
83
117
|
tablePrefix?: string,
|
|
84
118
|
): ReturnType<typeof sql> {
|
|
85
119
|
const statusField = tablePrefix ? `${tablePrefix}.status` : "status";
|
|
86
|
-
const scheduledAtField = tablePrefix ? `${tablePrefix}.scheduled_at` : "scheduled_at";
|
|
87
|
-
|
|
88
|
-
if (status === "published") {
|
|
89
|
-
// Include both published content AND scheduled content past its publish time.
|
|
90
|
-
// scheduled_at is stored as text (ISO 8601). On Postgres, we must cast it
|
|
91
|
-
// to timestamptz for the comparison with CURRENT_TIMESTAMP to work.
|
|
92
|
-
const scheduledAtExpr = isPostgres(db)
|
|
93
|
-
? sql`${sql.ref(scheduledAtField)}::timestamptz`
|
|
94
|
-
: sql.ref(scheduledAtField);
|
|
95
|
-
const nowExpr = isPostgres(db)
|
|
96
|
-
? currentTimestampValue(db)
|
|
97
|
-
: sql`strftime('%Y-%m-%dT%H:%M:%fZ', 'now')`;
|
|
98
|
-
return sql`(${sql.ref(statusField)} = 'published' OR (${sql.ref(statusField)} = 'scheduled' AND ${scheduledAtExpr} <= ${nowExpr}))`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
120
|
return sql`${sql.ref(statusField)} = ${status}`;
|
|
102
121
|
}
|
|
103
122
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
|
+
|
|
3
|
+
import { currentTimestamp } from "../dialect-helpers.js";
|
|
4
|
+
|
|
5
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
6
|
+
await db.schema
|
|
7
|
+
.createTable("_emdash_media_upload_attempts")
|
|
8
|
+
.ifNotExists()
|
|
9
|
+
.addColumn("storage_key", "text", (col) => col.primaryKey())
|
|
10
|
+
.addColumn("media_id", "text", (col) => col.notNull())
|
|
11
|
+
.addColumn("status", "text", (col) => col.notNull().defaultTo("active"))
|
|
12
|
+
.addColumn("created_at", "text", (col) => col.notNull().defaultTo(currentTimestamp(db)))
|
|
13
|
+
.addColumn("updated_at", "text", (col) => col.notNull().defaultTo(currentTimestamp(db)))
|
|
14
|
+
.execute();
|
|
15
|
+
|
|
16
|
+
await db.schema
|
|
17
|
+
.createIndex("idx_media_upload_attempts_media_id")
|
|
18
|
+
.ifNotExists()
|
|
19
|
+
.on("_emdash_media_upload_attempts")
|
|
20
|
+
.column("media_id")
|
|
21
|
+
.execute();
|
|
22
|
+
|
|
23
|
+
await db.schema
|
|
24
|
+
.createIndex("idx_media_upload_attempts_status_created_at")
|
|
25
|
+
.ifNotExists()
|
|
26
|
+
.on("_emdash_media_upload_attempts")
|
|
27
|
+
.columns(["status", "created_at"])
|
|
28
|
+
.execute();
|
|
29
|
+
|
|
30
|
+
await db.schema
|
|
31
|
+
.createIndex("idx_media_storage_key")
|
|
32
|
+
.ifNotExists()
|
|
33
|
+
.on("media")
|
|
34
|
+
.column("storage_key")
|
|
35
|
+
.execute();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
39
|
+
await db.schema.dropIndex("idx_media_storage_key").ifExists().execute();
|
|
40
|
+
await db.schema.dropTable("_emdash_media_upload_attempts").ifExists().execute();
|
|
41
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Kysely } from "kysely";
|
|
2
|
+
import { sql } from "kysely";
|
|
3
|
+
|
|
4
|
+
import { listTablesLike } from "../dialect-helpers.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Migration: replace the single-column content `translation_group` index with
|
|
8
|
+
* one index per translation-group read shape.
|
|
9
|
+
*
|
|
10
|
+
* There are two shapes. Translation-group reads filter `deleted_at IS NULL`
|
|
11
|
+
* with `translation_group = ?` / `IN (...)` and order by locale; menu and
|
|
12
|
+
* reference resolution looks a group up by `translation_group` (+ `locale`)
|
|
13
|
+
* alone, with no `deleted_at` term.
|
|
14
|
+
*
|
|
15
|
+
* Neither shape can borrow the other's index. Seeking migration 041's
|
|
16
|
+
* `(deleted_at, locale, ...)` composites on `deleted_at` alone already returns
|
|
17
|
+
* rows in locale order, so a stats-blind planner prefers them over a
|
|
18
|
+
* single-column `translation_group` index and reads every non-deleted row in
|
|
19
|
+
* the table; the batched variant is worse still, because the `IN (...)` list
|
|
20
|
+
* multiplies the planner's row estimate for a `translation_group`-leading index
|
|
21
|
+
* and it falls back to a `deleted_at` composite from a handful of groups
|
|
22
|
+
* onward. Going the other way, an index leading with `deleted_at` cannot seek a
|
|
23
|
+
* lookup that never constrains that column. D1 never has `sqlite_stat1`, so the
|
|
24
|
+
* index shape is the only lever and each shape needs a prefix matching it term
|
|
25
|
+
* for term.
|
|
26
|
+
*
|
|
27
|
+
* Forward-only and idempotent (`IF NOT EXISTS`).
|
|
28
|
+
*
|
|
29
|
+
* Index names use short `tg_locale` / `del_tg_locale` suffixes rather than
|
|
30
|
+
* spelling out `translation_group`: Postgres truncates identifiers to 63 bytes,
|
|
31
|
+
* and the longer forms truncate to the same value for long collection slugs.
|
|
32
|
+
* Keep these identical to the names in `schema/registry.ts`.
|
|
33
|
+
*/
|
|
34
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
35
|
+
const tableNames = await listTablesLike(db, "ec_%");
|
|
36
|
+
|
|
37
|
+
for (const tableName of tableNames) {
|
|
38
|
+
// D1 DDL is non-transactional: create the replacements before dropping the
|
|
39
|
+
// old index so an interrupted migration always leaves a
|
|
40
|
+
// translation_group-leading index in place.
|
|
41
|
+
await sql`
|
|
42
|
+
CREATE INDEX IF NOT EXISTS ${sql.ref(`idx_${tableName}_tg_locale`)}
|
|
43
|
+
ON ${sql.ref(tableName)} (translation_group, locale)
|
|
44
|
+
`.execute(db);
|
|
45
|
+
|
|
46
|
+
await sql`
|
|
47
|
+
CREATE INDEX IF NOT EXISTS ${sql.ref(`idx_${tableName}_del_tg_locale`)}
|
|
48
|
+
ON ${sql.ref(tableName)} (deleted_at, translation_group, locale)
|
|
49
|
+
`.execute(db);
|
|
50
|
+
|
|
51
|
+
await sql`DROP INDEX IF EXISTS ${sql.ref(`idx_${tableName}_translation_group`)}`.execute(db);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
56
|
+
const tableNames = await listTablesLike(db, "ec_%");
|
|
57
|
+
|
|
58
|
+
for (const tableName of tableNames) {
|
|
59
|
+
await sql`
|
|
60
|
+
CREATE INDEX IF NOT EXISTS ${sql.ref(`idx_${tableName}_translation_group`)}
|
|
61
|
+
ON ${sql.ref(tableName)} (translation_group)
|
|
62
|
+
`.execute(db);
|
|
63
|
+
|
|
64
|
+
await sql`DROP INDEX IF EXISTS ${sql.ref(`idx_${tableName}_del_tg_locale`)}`.execute(db);
|
|
65
|
+
await sql`DROP INDEX IF EXISTS ${sql.ref(`idx_${tableName}_tg_locale`)}`.execute(db);
|
|
66
|
+
}
|
|
67
|
+
}
|