emdash 0.36.0 → 0.37.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-CzL3H752.d.mts → adapters-BDQwg236.d.mts} +4 -2
- package/dist/{adapters-CzL3H752.d.mts.map → adapters-BDQwg236.d.mts.map} +1 -1
- package/dist/{allowed-origins-maylGaHv.mjs → allowed-origins-BGglilcs.mjs} +2 -2
- package/dist/{allowed-origins-maylGaHv.mjs.map → allowed-origins-BGglilcs.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +17 -17
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/api-Dz6rgoa3.mjs +10040 -0
- package/dist/api-Dz6rgoa3.mjs.map +1 -0
- package/dist/{api-tokens-9YrrCoE6.mjs → api-tokens-BSsQACNe.mjs} +2 -2
- package/dist/{api-tokens-9YrrCoE6.mjs.map → api-tokens-BSsQACNe.mjs.map} +1 -1
- package/dist/{apply-B_VMpJ2P.mjs → apply-B4SIOxR1.mjs} +18 -18
- package/dist/{apply-B_VMpJ2P.mjs.map → apply-B4SIOxR1.mjs.map} +1 -1
- package/dist/astro/image-endpoint.mjs +2 -2
- package/dist/astro/image-endpoint.mjs.map +1 -1
- package/dist/astro/index.d.mts +12 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +110 -37
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +6 -6
- package/dist/astro/middleware/media-usage-write-fence.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +3 -3
- package/dist/astro/middleware/request-context.mjs +2 -2
- 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 +157 -195
- 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 +3 -3
- package/dist/astro/routes/api/admin/api-tokens/index.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +3 -3
- 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 +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +3 -3
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +10 -10
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +13 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +13 -13
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +11 -11
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +14 -14
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +13 -13
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +13 -13
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +4 -4
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +49 -49
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +49 -49
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -47
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +48 -48
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +54 -50
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +17 -16
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +93 -0
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -47
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -47
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -47
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- 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 +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +7 -7
- package/dist/astro/routes/api/auth/mode.mjs +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +14 -5
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +13 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +15 -15
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +14 -5
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -7
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +2 -2
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress/execute.mjs +11 -11
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- 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 +11 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +10 -10
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +15 -15
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +22 -22
- package/dist/astro/routes/api/manifest.mjs +3 -3
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +188 -65
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +9 -9
- package/dist/astro/routes/api/media/_id_/replace.d.mts +8 -0
- package/dist/astro/routes/api/media/_id_/replace.d.mts.map +1 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs +91 -0
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -0
- package/dist/astro/routes/api/media/_id_/upload.mjs +5 -5
- package/dist/astro/routes/api/media/_id_/usage.mjs +16 -16
- package/dist/astro/routes/api/media/_id_.mjs +15 -15
- package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -2
- package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/_id_.mjs +8 -8
- package/dist/astro/routes/api/media/folders/index.mjs +8 -8
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +15 -13
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +47 -24
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +20 -13
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +15 -11
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +15 -11
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +16 -12
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +21 -14
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.d.mts.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +15 -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 +5 -5
- package/dist/astro/routes/api/oauth/device/code.mjs +8 -8
- package/dist/astro/routes/api/oauth/device/token.mjs +7 -7
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
- package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
- package/dist/astro/routes/api/oauth/token.mjs +5 -5
- package/dist/astro/routes/api/openapi.json.mjs +104 -38
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
- package/dist/astro/routes/api/redirects/404s/index.mjs +8 -8
- package/dist/astro/routes/api/redirects/404s/summary.mjs +8 -8
- package/dist/astro/routes/api/redirects/_id_.mjs +9 -9
- package/dist/astro/routes/api/redirects/index.mjs +9 -9
- package/dist/astro/routes/api/relations/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/relations/_id_/translations.mjs +10 -10
- package/dist/astro/routes/api/relations/index.mjs +15 -15
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/index.mjs +47 -47
- package/dist/astro/routes/api/schema/collections/reorder.mjs +47 -47
- package/dist/astro/routes/api/schema/index.mjs +8 -8
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -47
- package/dist/astro/routes/api/schema/orphans/index.mjs +47 -47
- 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 +5 -5
- 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/backups/archives/_name_.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +4 -4
- package/dist/astro/routes/api/settings/backups/export.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/index.mjs +6 -6
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings/email.mjs.map +1 -1
- package/dist/astro/routes/api/settings.d.mts.map +1 -1
- package/dist/astro/routes/api/settings.mjs +18 -14
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
- package/dist/astro/routes/api/setup/admin.mjs +10 -10
- package/dist/astro/routes/api/setup/dev-bypass.mjs +25 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
- package/dist/astro/routes/api/setup/index.mjs +25 -25
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/reorder.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +19 -15
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +20 -16
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +24 -17
- 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 +19 -15
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +25 -18
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.d.mts.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +19 -15
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +4 -4
- package/dist/astro/routes/api/typegen.mjs +4 -4
- 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.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +10 -8
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +16 -12
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +14 -11
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +7 -5
- package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.d.mts.map +1 -1
- package/dist/astro/routes/api/widget-areas/index.mjs +14 -11
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +5 -5
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +8 -8
- package/dist/astro/routes/sitemap.xml.mjs +6 -6
- package/dist/astro/types.d.mts +32 -17
- 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-ByYs-Uxs.mjs → authorize-Bkf_UHhD.mjs} +2 -2
- package/dist/{authorize-ByYs-Uxs.mjs.map → authorize-Bkf_UHhD.mjs.map} +1 -1
- package/dist/{backup-ChyHfIoX.mjs → backup-rwVAl9NI.mjs} +4 -4
- package/dist/{backup-ChyHfIoX.mjs.map → backup-rwVAl9NI.mjs.map} +1 -1
- package/dist/{bundle-DZFhFurR.mjs → bundle-C8S2Zl6U.mjs} +3 -3
- package/dist/{bundle-DZFhFurR.mjs.map → bundle-C8S2Zl6U.mjs.map} +1 -1
- package/dist/{byline-Cpnwrje1.mjs → byline-DuhF7NWl.mjs} +25 -12
- package/dist/byline-DuhF7NWl.mjs.map +1 -0
- package/dist/{byline-fields-CAyA_Umd.mjs → byline-fields-BovY4KYM.mjs} +1 -1
- package/dist/{byline-fields-CAyA_Umd.mjs.map → byline-fields-BovY4KYM.mjs.map} +1 -1
- package/dist/{bylines-BSo9B9RX.mjs → bylines-CJ5nd6Lw.mjs} +6 -6
- package/dist/{bylines-BSo9B9RX.mjs.map → bylines-CJ5nd6Lw.mjs.map} +1 -1
- package/dist/{bylines-CHjvehVX.mjs → bylines-RwBAeOF1.mjs} +3 -3
- package/dist/{bylines-CHjvehVX.mjs.map → bylines-RwBAeOF1.mjs.map} +1 -1
- package/dist/{cache-5VirJ2Cn.mjs → cache-BF5Kvn59.mjs} +2 -2
- package/dist/{cache-5VirJ2Cn.mjs.map → cache-BF5Kvn59.mjs.map} +1 -1
- package/dist/{challenge-store-D5pSY2S1.mjs → challenge-store-DQN_Yrck.mjs} +5 -3
- package/dist/challenge-store-DQN_Yrck.mjs.map +1 -0
- package/dist/chrome-tags-D8fiZG94.mjs +24 -0
- package/dist/chrome-tags-D8fiZG94.mjs.map +1 -0
- package/dist/{chunks-bNiX6_DR.mjs → chunks-C4szrD8o.mjs} +2 -2
- package/dist/{chunks-bNiX6_DR.mjs.map → chunks-C4szrD8o.mjs.map} +1 -1
- package/dist/cli/index.mjs +26 -26
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.mjs +2 -2
- package/dist/{collection-deletion-m_oi2c0N.mjs → collection-deletion-Bj07NHbj.mjs} +2 -2
- package/dist/{collection-deletion-m_oi2c0N.mjs.map → collection-deletion-Bj07NHbj.mjs.map} +1 -1
- package/dist/{comment-reaction-CRuItEjt.mjs → comment-reaction-BhrvSHml.mjs} +2 -2
- package/dist/{comment-reaction-CRuItEjt.mjs.map → comment-reaction-BhrvSHml.mjs.map} +1 -1
- package/dist/{comment-DhvLEdhQ.mjs → comment-vxOzWbZN.mjs} +2 -2
- package/dist/{comment-DhvLEdhQ.mjs.map → comment-vxOzWbZN.mjs.map} +1 -1
- package/dist/{comments-CLj4bi8I.mjs → comments-Ct4ensnf.mjs} +2 -2
- package/dist/{comments-CLj4bi8I.mjs.map → comments-Ct4ensnf.mjs.map} +1 -1
- package/dist/{components-v4U4DT2y.mjs → components-DJbo1z0S.mjs} +1 -1
- package/dist/{components-v4U4DT2y.mjs.map → components-DJbo1z0S.mjs.map} +1 -1
- package/dist/{config-DrfghTPe.d.mts → config-B9eZ340f.d.mts} +1 -1
- package/dist/{config-DrfghTPe.d.mts.map → config-B9eZ340f.d.mts.map} +1 -1
- package/dist/config-it29yDLA.mjs +1163 -0
- package/dist/config-it29yDLA.mjs.map +1 -0
- package/dist/{content-CP-SeXNa.mjs → content-DjvM0T92.mjs} +84 -44
- package/dist/content-DjvM0T92.mjs.map +1 -0
- package/dist/{content-list-query-BhejKVqb.d.mts → content-list-query-Btqd4uV2.d.mts} +1 -1
- package/dist/{content-list-query-BhejKVqb.d.mts.map → content-list-query-Btqd4uV2.d.mts.map} +1 -1
- package/dist/{content-refresh-DLOfIhYc.mjs → content-refresh-Bwp-8yGy.mjs} +48 -21
- package/dist/content-refresh-Bwp-8yGy.mjs.map +1 -0
- package/dist/{content-repair-BCxzy0r4.mjs → content-repair-Czdp7jz5.mjs} +4 -4
- package/dist/{content-repair-BCxzy0r4.mjs.map → content-repair-Czdp7jz5.mjs.map} +1 -1
- package/dist/{context-BR5hRWiK.mjs → context-CX6gxOLW.mjs} +52 -17
- package/dist/context-CX6gxOLW.mjs.map +1 -0
- package/dist/{cron-CWfWrWKG.mjs → cron-C6o7VppJ.mjs} +1 -1
- package/dist/{cron-CWfWrWKG.mjs.map → cron-C6o7VppJ.mjs.map} +1 -1
- package/dist/{dashboard-CkIV2rnQ.mjs → dashboard-C2kTeeRI.mjs} +4 -4
- package/dist/{dashboard-CkIV2rnQ.mjs.map → dashboard-C2kTeeRI.mjs.map} +1 -1
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +4 -4
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +4 -4
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/postgres.d.mts.map +1 -1
- package/dist/db/postgres.mjs +19 -3
- package/dist/db/postgres.mjs.map +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +4 -4
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/{default-YMEfcQUx.mjs → default-Clra32mw.mjs} +1 -1
- package/dist/{default-YMEfcQUx.mjs.map → default-Clra32mw.mjs.map} +1 -1
- package/dist/{deferred-tasks-DfqxH5Xf.d.mts → deferred-tasks-CvDETTJO.d.mts} +1 -1
- package/dist/{deferred-tasks-DfqxH5Xf.d.mts.map → deferred-tasks-CvDETTJO.d.mts.map} +1 -1
- package/dist/dev-typegen-DzOPfsNj.mjs +29 -0
- package/dist/dev-typegen-DzOPfsNj.mjs.map +1 -0
- package/dist/{device-flow-CojjSBwb.mjs → device-flow-D2oCWvLJ.mjs} +4 -4
- package/dist/{device-flow-CojjSBwb.mjs.map → device-flow-D2oCWvLJ.mjs.map} +1 -1
- package/dist/{direct-executor-BWeWiRYB.mjs → direct-executor-Bfa5_ToE.mjs} +3 -3
- package/dist/{direct-executor-BWeWiRYB.mjs.map → direct-executor-Bfa5_ToE.mjs.map} +1 -1
- package/dist/{email-console-CEJgR_LB.mjs → email-console-Dzb6uGYa.mjs} +1 -1
- package/dist/{email-console-CEJgR_LB.mjs.map → email-console-Dzb6uGYa.mjs.map} +1 -1
- package/dist/{error-D9w94fjV.mjs → error-DFrQjppn.mjs} +2 -2
- package/dist/{error-D9w94fjV.mjs.map → error-DFrQjppn.mjs.map} +1 -1
- package/dist/{errors-n2j49uNf.mjs → errors-DsVoDUjJ.mjs} +3 -1
- package/dist/errors-DsVoDUjJ.mjs.map +1 -0
- package/dist/{escape-DN4Qmjsl.mjs → escape-HmHTC1Is.mjs} +1 -1
- package/dist/{escape-DN4Qmjsl.mjs.map → escape-HmHTC1Is.mjs.map} +1 -1
- package/dist/{field-defs-cache-Bh4q6oar.mjs → field-defs-cache-BM4SIRqH.mjs} +2 -2
- package/dist/{field-defs-cache-Bh4q6oar.mjs.map → field-defs-cache-BM4SIRqH.mjs.map} +1 -1
- package/dist/{fts-manager-BhOdW0bi.mjs → fts-manager-Do1BlW2r.mjs} +2 -2
- package/dist/{fts-manager-BhOdW0bi.mjs.map → fts-manager-Do1BlW2r.mjs.map} +1 -1
- package/dist/{hash-CTcngWvj.mjs → hash-3JJPlHF2.mjs} +1 -1
- package/dist/{hash-CTcngWvj.mjs.map → hash-3JJPlHF2.mjs.map} +1 -1
- package/dist/hook-result-DCh2WUpe.d.mts +31 -0
- package/dist/hook-result-DCh2WUpe.d.mts.map +1 -0
- package/dist/{hreflang-7pTHsLZJ.d.mts → hreflang-B6hbAuuO.d.mts} +2 -2
- package/dist/{hreflang-7pTHsLZJ.d.mts.map → hreflang-B6hbAuuO.d.mts.map} +1 -1
- package/dist/{hreflang-Huc6O5wa.mjs → hreflang-DQbPZliA.mjs} +6 -6
- package/dist/{hreflang-Huc6O5wa.mjs.map → hreflang-DQbPZliA.mjs.map} +1 -1
- package/dist/{identity-DXmb4aVp.mjs → identity-DksvEazf.mjs} +3 -3
- package/dist/{identity-DXmb4aVp.mjs.map → identity-DksvEazf.mjs.map} +1 -1
- package/dist/{import-C4_O3KXU.mjs → import-CJpaBBBT.mjs} +5 -5
- package/dist/{import-C4_O3KXU.mjs.map → import-CJpaBBBT.mjs.map} +1 -1
- package/dist/{index-DWbJrsAg.d.mts → index-BJNMCWmu.d.mts} +158 -49
- package/dist/index-BJNMCWmu.d.mts.map +1 -0
- package/dist/{index-6bRee8zb.d.mts → index-Du8K7bWa.d.mts} +3 -3
- package/dist/{index-6bRee8zb.d.mts.map → index-Du8K7bWa.d.mts.map} +1 -1
- package/dist/index.d.mts +22 -21
- package/dist/index.mjs +70 -70
- package/dist/{load-Bo7fZAbg.mjs → load-CawHjTOH.mjs} +2 -2
- package/dist/{load-Bo7fZAbg.mjs.map → load-CawHjTOH.mjs.map} +1 -1
- package/dist/{loader-ZsjE4paL.mjs → loader-Z8vl7zTq.mjs} +48 -13
- package/dist/loader-Z8vl7zTq.mjs.map +1 -0
- package/dist/{manifest-builder-QXuqvVMP.mjs → manifest-builder-COtzuca2.mjs} +2 -2
- package/dist/{manifest-builder-QXuqvVMP.mjs.map → manifest-builder-COtzuca2.mjs.map} +1 -1
- package/dist/{manifest-schema-CUYPfCEH.mjs → manifest-schema-BNWwR8Vd.mjs} +5 -5
- package/dist/manifest-schema-BNWwR8Vd.mjs.map +1 -0
- package/dist/media/image-endpoint.d.mts +4 -2
- package/dist/media/image-endpoint.d.mts.map +1 -1
- package/dist/media/image-endpoint.mjs +6 -4
- package/dist/media/image-endpoint.mjs.map +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +1 -1
- package/dist/media/local-runtime.d.mts +12 -12
- package/dist/media/local-runtime.mjs +4 -4
- package/dist/{media-D6SeAfBl.mjs → media-BBm8Wg3f.mjs} +30 -2
- package/dist/media-BBm8Wg3f.mjs.map +1 -0
- package/dist/{media-BjwNuLEu.mjs → media-BHjus86Y.mjs} +35 -5
- package/dist/media-BHjus86Y.mjs.map +1 -0
- package/dist/{media-allowlist-D35v7bmL.mjs → media-allowlist-CoTBWoDp.mjs} +1 -1
- package/dist/{media-allowlist-D35v7bmL.mjs.map → media-allowlist-CoTBWoDp.mjs.map} +1 -1
- package/dist/{media-folders-D-0CmRZj.mjs → media-folders-BGkATs8n.mjs} +1 -1
- package/dist/{media-folders-D-0CmRZj.mjs.map → media-folders-BGkATs8n.mjs.map} +1 -1
- package/dist/{media-upload-C7bLXGcI.mjs → media-upload-BCidR-EY.mjs} +6 -6
- package/dist/{media-upload-C7bLXGcI.mjs.map → media-upload-BCidR-EY.mjs.map} +1 -1
- package/dist/{media-url-DH7giMx_.mjs → media-url-DHoPr0hq.mjs} +1 -1
- package/dist/{media-url-DH7giMx_.mjs.map → media-url-DHoPr0hq.mjs.map} +1 -1
- package/dist/{media-usage-BTRJvS6V.mjs → media-usage-CdY5jhSR.mjs} +8 -8
- package/dist/{media-usage-BTRJvS6V.mjs.map → media-usage-CdY5jhSR.mjs.map} +1 -1
- package/dist/{media-usage-activation-Dx0kPV6b.mjs → media-usage-activation-BgeMtK5C.mjs} +2 -2
- package/dist/{media-usage-activation-Dx0kPV6b.mjs.map → media-usage-activation-BgeMtK5C.mjs.map} +1 -1
- package/dist/{media-usage-work-DWb2XPMI.mjs → media-usage-work-CnGCdHxx.mjs} +4 -4
- package/dist/{media-usage-work-DWb2XPMI.mjs.map → media-usage-work-CnGCdHxx.mjs.map} +1 -1
- package/dist/{media-usage-work-C-fhM30c.mjs → media-usage-work-D6D9sMCA.mjs} +1 -1
- package/dist/{media-usage-work-C-fhM30c.mjs.map → media-usage-work-D6D9sMCA.mjs.map} +1 -1
- package/dist/{media-usage-write-fence-BwoJVRDC.mjs → media-usage-write-fence-hjeD4u7s.mjs} +2 -2
- package/dist/{media-usage-write-fence-BwoJVRDC.mjs.map → media-usage-write-fence-hjeD4u7s.mjs.map} +1 -1
- package/dist/{menus-CNg0QlDt.mjs → menus-6qSwTNxG.mjs} +346 -94
- package/dist/menus-6qSwTNxG.mjs.map +1 -0
- package/dist/{menus-CD7EFLwz.mjs → menus-uvPLXMZf.mjs} +3 -3
- package/dist/{menus-CD7EFLwz.mjs.map → menus-uvPLXMZf.mjs.map} +1 -1
- package/dist/migrations/index.d.mts +1 -1
- package/dist/migrations/index.mjs +3 -3
- package/dist/{mode-DaUM_MB2.mjs → mode-DN_WneRx.mjs} +1 -1
- package/dist/{mode-DaUM_MB2.mjs.map → mode-DN_WneRx.mjs.map} +1 -1
- package/dist/{node-sqlite-compat-Udb4Y-rs.mjs → node-sqlite-compat-BuJXIeMz.mjs} +1 -1
- package/dist/{node-sqlite-compat-Udb4Y-rs.mjs.map → node-sqlite-compat-BuJXIeMz.mjs.map} +1 -1
- package/dist/{normalize-CSxdKBVa.mjs → normalize-C2xNjTSG.mjs} +15 -5
- package/dist/normalize-C2xNjTSG.mjs.map +1 -0
- package/dist/{oauth-authorization-Dpsb-fMJ.mjs → oauth-authorization-Dj6Kwc21.mjs} +4 -4
- package/dist/{oauth-authorization-Dpsb-fMJ.mjs.map → oauth-authorization-Dj6Kwc21.mjs.map} +1 -1
- package/dist/{oauth-clients-Bxnoe_67.mjs → oauth-clients-FD7I0J8m.mjs} +1 -1
- package/dist/{oauth-clients-Bxnoe_67.mjs.map → oauth-clients-FD7I0J8m.mjs.map} +1 -1
- package/dist/{oauth-state-store-0C4s0K6w.mjs → oauth-state-store-DkmDOmHs.mjs} +1 -1
- package/dist/{oauth-state-store-0C4s0K6w.mjs.map → oauth-state-store-DkmDOmHs.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-wlGYSeqX.mjs → oauth-user-lookup-CvIwGpYd.mjs} +1 -1
- package/dist/{oauth-user-lookup-wlGYSeqX.mjs.map → oauth-user-lookup-CvIwGpYd.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{object-cache-71tPfV4A.mjs → object-cache-DVKnyOfy.mjs} +19 -3
- package/dist/object-cache-DVKnyOfy.mjs.map +1 -0
- package/dist/{options-BhZIeFY1.d.mts → options-CYb4y7hM.d.mts} +24 -11
- package/dist/options-CYb4y7hM.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-BRJg1kz8.mjs → parse-Ckpg-Qfp.mjs} +2 -2
- package/dist/{parse-BRJg1kz8.mjs.map → parse-Ckpg-Qfp.mjs.map} +1 -1
- package/dist/{passkey-config-B3P0nHRR.mjs → passkey-config-O_lj3y0k.mjs} +1 -1
- package/dist/{passkey-config-B3P0nHRR.mjs.map → passkey-config-O_lj3y0k.mjs.map} +1 -1
- package/dist/{placeholder-BR4ZhVJl.d.mts → placeholder-4X9BrRrp.d.mts} +1 -1
- package/dist/{placeholder-BR4ZhVJl.d.mts.map → placeholder-4X9BrRrp.d.mts.map} +1 -1
- package/dist/plugin-types.d.mts +8 -3
- package/dist/plugin-types.d.mts.map +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/{policy-BVRganJQ.mjs → policy-Dhtwntrt.mjs} +2 -2
- package/dist/{policy-BVRganJQ.mjs.map → policy-Dhtwntrt.mjs.map} +1 -1
- package/dist/{portable-text-C8Tvp4_g.mjs → portable-text-U85hOafW.mjs} +1 -1
- package/dist/{portable-text-C8Tvp4_g.mjs.map → portable-text-U85hOafW.mjs.map} +1 -1
- package/dist/{preview-dn2dUyM0.mjs → preview-B_vJLvf8.mjs} +2 -2
- package/dist/{preview-dn2dUyM0.mjs.map → preview-B_vJLvf8.mjs.map} +1 -1
- package/dist/{protocol-CuBEsqgE.d.mts → protocol-JdD2YhY9.d.mts} +2 -2
- package/dist/{protocol-CuBEsqgE.d.mts.map → protocol-JdD2YhY9.d.mts.map} +1 -1
- package/dist/{public-url-DRz_AinV.mjs → public-url-CarhZJgf.mjs} +1 -1
- package/dist/{public-url-DRz_AinV.mjs.map → public-url-CarhZJgf.mjs.map} +1 -1
- package/dist/{query-D18vTdha.mjs → query-BZKZcG5b.mjs} +14 -14
- package/dist/{query-D18vTdha.mjs.map → query-BZKZcG5b.mjs.map} +1 -1
- package/dist/{query-tZDEdtCN.mjs → query-BndaFxxp.mjs} +4 -4
- package/dist/{query-tZDEdtCN.mjs.map → query-BndaFxxp.mjs.map} +1 -1
- package/dist/{rate-limit-on7KPo-v.mjs → rate-limit-BZmATC6W.mjs} +2 -2
- package/dist/{rate-limit-on7KPo-v.mjs.map → rate-limit-BZmATC6W.mjs.map} +1 -1
- package/dist/{redirect-DrbEmU9a.mjs → redirect-CzqnLxK-.mjs} +1 -1
- package/dist/{redirect-DrbEmU9a.mjs.map → redirect-CzqnLxK-.mjs.map} +1 -1
- package/dist/{redirects-CRIM55KH.mjs → redirects-BLNOWQTn.mjs} +63 -28
- package/dist/redirects-BLNOWQTn.mjs.map +1 -0
- package/dist/{redirects-BahWiu8Z.mjs → redirects-CqzNM0KM.mjs} +2 -2
- package/dist/{redirects-BahWiu8Z.mjs.map → redirects-CqzNM0KM.mjs.map} +1 -1
- package/dist/{registry-Cx-jEJOS.mjs → registry-AZAsRsor.mjs} +27 -9
- package/dist/registry-AZAsRsor.mjs.map +1 -0
- package/dist/{relation-A6wLF_DS.mjs → relation-04DfKRTO.mjs} +2 -2
- package/dist/{relation-A6wLF_DS.mjs.map → relation-04DfKRTO.mjs.map} +1 -1
- package/dist/{relations-BTPM2saV.mjs → relations-C4htk5sb.mjs} +7 -7
- package/dist/relations-C4htk5sb.mjs.map +1 -0
- package/dist/{relations-Cj5hZ6Zg.mjs → relations-CcFwDJdJ.mjs} +4 -4
- package/dist/{relations-Cj5hZ6Zg.mjs.map → relations-CcFwDJdJ.mjs.map} +1 -1
- package/dist/{relations-C7B46bcU.d.mts → relations-DnRK4YIT.d.mts} +175 -41
- package/dist/relations-DnRK4YIT.d.mts.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-DRp5ENd_.mjs → request-meta-DYxLlnmz.mjs} +2 -2
- package/dist/{request-meta-DRp5ENd_.mjs.map → request-meta-DYxLlnmz.mjs.map} +1 -1
- package/dist/{resolve-DxUpTMmE.mjs → resolve-prZ3mP7l.mjs} +1 -1
- package/dist/{resolve-DxUpTMmE.mjs.map → resolve-prZ3mP7l.mjs.map} +1 -1
- package/dist/{runner-77GOZCnH.mjs → runner-BLIDKpmA.mjs} +351 -294
- package/dist/runner-BLIDKpmA.mjs.map +1 -0
- package/dist/{runner-zgqA_CqP.d.mts → runner-YKfIMnaF.d.mts} +3 -2
- package/dist/runner-YKfIMnaF.d.mts.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-BY-oVntF.mjs → schema-CGnBeLiW.mjs} +3 -3
- package/dist/{schema-BY-oVntF.mjs.map → schema-CGnBeLiW.mjs.map} +1 -1
- package/dist/{schema-Cw9kVK0I.mjs → schema-DYr-Vd-L.mjs} +5 -5
- package/dist/{schema-Cw9kVK0I.mjs.map → schema-DYr-Vd-L.mjs.map} +1 -1
- package/dist/{scopes-vMR1uIbt.mjs → scopes-BhWvBavj.mjs} +3 -3
- package/dist/{scopes-vMR1uIbt.mjs.map → scopes-BhWvBavj.mjs.map} +1 -1
- package/dist/{search-CfT3KxO5.mjs → search-C-qDk4kx.mjs} +4 -4
- package/dist/{search-CfT3KxO5.mjs.map → search-C-qDk4kx.mjs.map} +1 -1
- package/dist/{secrets-BH2Qow1-.mjs → secrets-rEtHt-6z.mjs} +1 -1
- package/dist/{secrets-BH2Qow1-.mjs.map → secrets-rEtHt-6z.mjs.map} +1 -1
- package/dist/{sections-DTfjyf1z.mjs → sections-B_nYvlwn.mjs} +2 -2
- package/dist/{sections-DTfjyf1z.mjs.map → sections-B_nYvlwn.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +18 -18
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +13 -13
- package/dist/{seo-Cm-dtvgk.mjs → seo-926NRIgt.mjs} +3 -3
- package/dist/{seo-Cm-dtvgk.mjs.map → seo-926NRIgt.mjs.map} +1 -1
- package/dist/{seo-BSiTIXzd.mjs → seo-CVWkdv6x.mjs} +1 -1
- package/dist/{seo-BSiTIXzd.mjs.map → seo-CVWkdv6x.mjs.map} +1 -1
- package/dist/{service-DYsDHEKe.mjs → service-CJl3ZAYs.mjs} +3 -3
- package/dist/{service-DYsDHEKe.mjs.map → service-CJl3ZAYs.mjs.map} +1 -1
- package/dist/{session-user-CNAfvsdw.mjs → session-user-BlMgqCHS.mjs} +1 -1
- package/dist/{session-user-CNAfvsdw.mjs.map → session-user-BlMgqCHS.mjs.map} +1 -1
- package/dist/{settings-BgN-0DT-.mjs → settings--wobrkkC.mjs} +18 -5
- package/dist/settings--wobrkkC.mjs.map +1 -0
- package/dist/{settings-DjtkUo__.mjs → settings-Cwm6o2jY.mjs} +3 -3
- package/dist/{settings-DjtkUo__.mjs.map → settings-Cwm6o2jY.mjs.map} +1 -1
- package/dist/{setup-complete-CcpXaPU7.mjs → setup-complete-DQbClIN2.mjs} +1 -1
- package/dist/{setup-complete-CcpXaPU7.mjs.map → setup-complete-DQbClIN2.mjs.map} +1 -1
- package/dist/{setup-nonce-Reyw30jg.mjs → setup-nonce-DZCFS2sn.mjs} +1 -1
- package/dist/{setup-nonce-Reyw30jg.mjs.map → setup-nonce-DZCFS2sn.mjs.map} +1 -1
- package/dist/{site-url-Cs_V9n3V.mjs → site-url-BrxA_E9H.mjs} +2 -2
- package/dist/{site-url-Cs_V9n3V.mjs.map → site-url-BrxA_E9H.mjs.map} +1 -1
- package/dist/{snapshot-DSB8P7Lm.mjs → snapshot--OCDTqdb.mjs} +1 -1
- package/dist/{snapshot-DSB8P7Lm.mjs.map → snapshot--OCDTqdb.mjs.map} +1 -1
- package/dist/{ssrf-DqebVE34.mjs → ssrf-5sIM5jzl.mjs} +4 -3
- package/dist/{ssrf-DqebVE34.mjs.map → ssrf-5sIM5jzl.mjs.map} +1 -1
- package/dist/{state-BJfU9Uzw.mjs → state-BpFVsJZB.mjs} +1 -1
- package/dist/{state-BJfU9Uzw.mjs.map → state-BpFVsJZB.mjs.map} +1 -1
- package/dist/{status-DDu8HIQl.mjs → status-B777-dXz.mjs} +1 -1
- package/dist/{status-DDu8HIQl.mjs.map → status-B777-dXz.mjs.map} +1 -1
- package/dist/storage/local.d.mts +2 -1
- package/dist/storage/local.d.mts.map +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/local.mjs.map +1 -1
- package/dist/storage/s3.d.mts +2 -1
- package/dist/storage/s3.d.mts.map +1 -1
- package/dist/storage/s3.mjs +3 -2
- package/dist/storage/s3.mjs.map +1 -1
- package/dist/{target-D0o26Azo.mjs → target-BmR0iTwz.mjs} +1 -1
- package/dist/{target-D0o26Azo.mjs.map → target-BmR0iTwz.mjs.map} +1 -1
- package/dist/{taxonomies-CPGxo-bn.mjs → taxonomies-DkAkMupr.mjs} +16 -13
- package/dist/taxonomies-DkAkMupr.mjs.map +1 -0
- package/dist/{taxonomies-kmyudNGP.mjs → taxonomies-Wfy_Lg12.mjs} +42 -16
- package/dist/taxonomies-Wfy_Lg12.mjs.map +1 -0
- package/dist/{taxonomy-8X09dLN5.mjs → taxonomy-tJepplLL.mjs} +4 -4
- package/dist/{taxonomy-8X09dLN5.mjs.map → taxonomy-tJepplLL.mjs.map} +1 -1
- package/dist/{tokens-gTS-IVUp.mjs → tokens-BCO1oruF.mjs} +1 -1
- package/dist/{tokens-gTS-IVUp.mjs.map → tokens-BCO1oruF.mjs.map} +1 -1
- package/dist/{transport-fX59xaJz.mjs → transport-Dr3qtwXC.mjs} +1 -1
- package/dist/{transport-fX59xaJz.mjs.map → transport-Dr3qtwXC.mjs.map} +1 -1
- package/dist/{transport-_6R1ub7t.d.mts → transport-xh6YKW2G.d.mts} +1 -1
- package/dist/{transport-_6R1ub7t.d.mts.map → transport-xh6YKW2G.d.mts.map} +1 -1
- package/dist/{trusted-proxy-fe6nEgR4.mjs → trusted-proxy-BR5F1Otp.mjs} +1 -1
- package/dist/{trusted-proxy-fe6nEgR4.mjs.map → trusted-proxy-BR5F1Otp.mjs.map} +1 -1
- package/dist/{types-BXUmsINL.mjs → types-3qNFPlci.mjs} +1 -1
- package/dist/{types-BXUmsINL.mjs.map → types-3qNFPlci.mjs.map} +1 -1
- package/dist/{types-Vg6f5i3s.d.mts → types-B6GrPic4.d.mts} +9 -3
- package/dist/{types-Vg6f5i3s.d.mts.map → types-B6GrPic4.d.mts.map} +1 -1
- package/dist/{types-DJQxln7q.d.mts → types-BuHW4xDE.d.mts} +11 -10
- package/dist/types-BuHW4xDE.d.mts.map +1 -0
- package/dist/{types-BzBd3PeX.d.mts → types-C00oyCZp.d.mts} +1 -1
- package/dist/{types-BzBd3PeX.d.mts.map → types-C00oyCZp.d.mts.map} +1 -1
- package/dist/{types-Blb-MRC3.d.mts → types-CDtkNSFQ.d.mts} +1 -1
- package/dist/{types-Blb-MRC3.d.mts.map → types-CDtkNSFQ.d.mts.map} +1 -1
- package/dist/{types-D5VVLr7J.d.mts → types-CPeXo1wF.d.mts} +1 -1
- package/dist/{types-D5VVLr7J.d.mts.map → types-CPeXo1wF.d.mts.map} +1 -1
- package/dist/types-CQPWhPxE.mjs.map +1 -1
- package/dist/{types-D_DWe7k9.d.mts → types-CXFkwEGC.d.mts} +3 -2
- package/dist/types-CXFkwEGC.d.mts.map +1 -0
- package/dist/{types-CLqvnd05.d.mts → types-DczELMop.d.mts} +1 -1
- package/dist/{types-CLqvnd05.d.mts.map → types-DczELMop.d.mts.map} +1 -1
- package/dist/types-DfuTR6dL.mjs +3 -0
- package/dist/{types-DHxzBjbD.d.mts → types-FV23hEoW.d.mts} +1 -1
- package/dist/{types-DHxzBjbD.d.mts.map → types-FV23hEoW.d.mts.map} +1 -1
- package/dist/{types-Br-ERaxh.d.mts → types-xDMtUFnO.d.mts} +1 -1
- package/dist/{types-Br-ERaxh.d.mts.map → types-xDMtUFnO.d.mts.map} +1 -1
- package/dist/{upload-attempts-CNyGSepg.mjs → upload-attempts-BsqoQ1fn.mjs} +1 -1
- package/dist/{upload-attempts-CNyGSepg.mjs.map → upload-attempts-BsqoQ1fn.mjs.map} +1 -1
- package/dist/{url-pattern-K-KdXcSe.mjs → url-pattern-D4c2czpJ.mjs} +1 -1
- package/dist/{url-pattern-K-KdXcSe.mjs.map → url-pattern-D4c2czpJ.mjs.map} +1 -1
- package/dist/{user-CtYY0tp2.mjs → user-BTZ40aq6.mjs} +2 -2
- package/dist/{user-CtYY0tp2.mjs.map → user-BTZ40aq6.mjs.map} +1 -1
- package/dist/{utils-HztC73hq.mjs → utils-BKvNjjhY.mjs} +1 -1
- package/dist/{utils-HztC73hq.mjs.map → utils-BKvNjjhY.mjs.map} +1 -1
- package/dist/{validate-Dd-IUjnZ.mjs → validate-DE_LRwo9.mjs} +2 -2
- package/dist/{validate-Dd-IUjnZ.mjs.map → validate-DE_LRwo9.mjs.map} +1 -1
- package/dist/{validate-DlqdOZXB.d.mts → validate-DUP27OYD.d.mts} +5 -5
- package/dist/{validate-DlqdOZXB.d.mts.map → validate-DUP27OYD.d.mts.map} +1 -1
- package/dist/{validation-D83n7Npi.mjs → validation-BMImFJ11.mjs} +8 -8
- package/dist/{validation-D83n7Npi.mjs.map → validation-BMImFJ11.mjs.map} +1 -1
- package/dist/version-Bii3suaO.mjs +7 -0
- package/dist/{version-ri-sCyAp.mjs.map → version-Bii3suaO.mjs.map} +1 -1
- package/dist/{widgets-CpmZd9Q-.mjs → widgets-D3gJ10xU.mjs} +17 -4
- package/dist/widgets-D3gJ10xU.mjs.map +1 -0
- package/dist/{wxr-taxonomies-BFd0y72_.d.mts → wxr-taxonomies-B2Og_6rU.d.mts} +1 -1
- package/dist/{wxr-taxonomies-BFd0y72_.d.mts.map → wxr-taxonomies-B2Og_6rU.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-Df4vxWcU.mjs → wxr-taxonomies-Cxngsjwo.mjs} +4 -4
- package/dist/{wxr-taxonomies-Df4vxWcU.mjs.map → wxr-taxonomies-Cxngsjwo.mjs.map} +1 -1
- package/dist/{zod-generator-DylzusHh.mjs → zod-generator-BuYSQJB7.mjs} +11 -7
- package/dist/zod-generator-BuYSQJB7.mjs.map +1 -0
- package/package.json +12 -9
- package/src/api/errors.ts +2 -0
- package/src/api/handlers/content.ts +49 -11
- package/src/api/handlers/index.ts +1 -0
- package/src/api/handlers/manifest.ts +161 -12
- package/src/api/handlers/media.ts +30 -0
- package/src/api/handlers/registry.ts +393 -289
- package/src/api/handlers/taxonomies.ts +16 -9
- package/src/api/openapi/document.ts +85 -5
- package/src/api/parse.ts +1 -1
- package/src/api/schemas/auth.ts +4 -4
- package/src/api/schemas/bylines.ts +3 -3
- package/src/api/schemas/comments.ts +1 -1
- package/src/api/schemas/common.ts +3 -2
- package/src/api/schemas/content.ts +78 -22
- package/src/api/schemas/media.ts +52 -0
- package/src/api/schemas/redirects.ts +6 -1
- package/src/api/schemas/schema.ts +4 -0
- package/src/api/schemas/setup.ts +1 -1
- package/src/api/schemas/taxonomies.ts +2 -2
- package/src/api/schemas/users.ts +1 -1
- package/src/api/types.ts +23 -10
- package/src/astro/dev-typegen.ts +35 -0
- package/src/astro/image-endpoint.ts +2 -2
- package/src/astro/integration/dev-typegen.ts +91 -0
- package/src/astro/integration/index.ts +9 -44
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/vite-config.ts +21 -2
- package/src/astro/middleware.ts +5 -0
- package/src/astro/routes/api/admin/api-tokens/index.ts +4 -1
- package/src/astro/routes/api/admin/oauth-clients/[id].ts +1 -1
- package/src/astro/routes/api/admin/oauth-clients/index.ts +1 -1
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +3 -7
- package/src/astro/routes/api/admin/plugins/registry/install.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/verify.ts +60 -0
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +8 -2
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +2 -1
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +6 -2
- package/src/astro/routes/api/manifest.ts +1 -1
- package/src/astro/routes/api/media/[id]/replace.ts +114 -0
- package/src/astro/routes/api/media/file/[...key].ts +4 -1
- package/src/astro/routes/api/media/upload-url.ts +8 -4
- package/src/astro/routes/api/media.ts +54 -8
- package/src/astro/routes/api/menus/[name]/items/[id].ts +7 -2
- package/src/astro/routes/api/menus/[name]/items.ts +4 -1
- package/src/astro/routes/api/menus/[name]/reorder.ts +4 -1
- package/src/astro/routes/api/menus/[name]/translations.ts +4 -1
- package/src/astro/routes/api/menus/[name].ts +7 -2
- package/src/astro/routes/api/menus/index.ts +4 -1
- package/src/astro/routes/api/settings/email.ts +1 -1
- package/src/astro/routes/api/settings.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name]/reorder.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug]/translations.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name]/terms/[slug].ts +7 -2
- package/src/astro/routes/api/taxonomies/[name]/terms/index.ts +4 -1
- package/src/astro/routes/api/taxonomies/[name].ts +7 -2
- package/src/astro/routes/api/taxonomies/index.ts +4 -1
- package/src/astro/routes/api/widget-areas/[name]/reorder.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +5 -2
- package/src/astro/routes/api/widget-areas/[name]/widgets.ts +3 -1
- package/src/astro/routes/api/widget-areas/[name].ts +3 -1
- package/src/astro/routes/api/widget-areas/index.ts +3 -1
- package/src/astro/types.ts +23 -5
- package/src/auth/challenge-store.ts +3 -1
- package/src/aws-sdk.d.ts +1 -0
- package/src/cache/chrome-tags.ts +24 -0
- package/src/components/EmDashImage.astro +2 -1
- package/src/components/EmDashMedia.astro +2 -1
- package/src/components/InlinePortableTextEditor.tsx +6 -1
- package/src/components/widgets/Archives.astro +2 -37
- package/src/content/converters/index.ts +2 -0
- package/src/content/converters/mark-safety.ts +1 -0
- package/src/content/converters/portable-text-identity.ts +139 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +202 -69
- package/src/content/converters/prosemirror-to-portable-text.ts +96 -25
- package/src/content/converters/types.ts +1 -0
- package/src/database/migrations/017_authorization_codes.ts +14 -4
- package/src/database/migrations/074_content_deleted_scheduled_index.ts +55 -0
- package/src/database/migrations/runner.ts +3 -1
- package/src/database/repositories/byline.ts +32 -16
- package/src/database/repositories/content.ts +114 -47
- package/src/database/repositories/media-usage.ts +66 -37
- package/src/database/repositories/media.ts +60 -1
- package/src/database/repositories/plugin-storage.ts +74 -9
- package/src/database/repositories/types.ts +8 -7
- package/src/db/adapters.ts +8 -1
- package/src/db/postgres.ts +23 -0
- package/src/emdash-runtime.ts +80 -150
- package/src/fields/boolean.ts +1 -1
- package/src/fields/datetime.ts +1 -1
- package/src/fields/file.ts +1 -1
- package/src/fields/integer.ts +1 -1
- package/src/fields/json.ts +1 -1
- package/src/fields/multiselect.ts +1 -1
- package/src/fields/number.ts +1 -1
- package/src/fields/portable-text.ts +1 -1
- package/src/fields/richtext.ts +1 -1
- package/src/fields/select.ts +1 -1
- package/src/fields/slug.ts +1 -1
- package/src/fields/text.ts +1 -1
- package/src/fields/textarea.ts +1 -1
- package/src/fields/types.ts +2 -2
- package/src/index.ts +25 -3
- package/src/loader.ts +63 -10
- package/src/mcp/server.ts +228 -24
- package/src/media/image-endpoint.ts +5 -2
- package/src/media/normalize.ts +15 -4
- package/src/media/usage/cleanup.ts +9 -8
- package/src/menus/index.ts +16 -0
- package/src/object-cache/index.ts +44 -2
- package/src/plugin-types.ts +18 -1
- package/src/plugins/hooks.ts +4 -1
- package/src/plugins/index.ts +6 -0
- package/src/plugins/manager.ts +2 -1
- package/src/plugins/manifest-schema.ts +1 -1
- package/src/plugins/routes.ts +3 -1
- package/src/plugins/sandbox/hook-result.ts +52 -0
- package/src/plugins/sandbox/index.ts +10 -0
- package/src/plugins/types.ts +6 -0
- package/src/registry/artifact-checksum.ts +15 -0
- package/src/registry/artifact-verification.ts +85 -0
- package/src/registry/authoritative-records.ts +180 -0
- package/src/registry/record-labels.ts +28 -0
- package/src/schema/registry.ts +26 -3
- package/src/schema/zod-generator.ts +16 -13
- package/src/security/ssrf.ts +5 -2
- package/src/settings/index.ts +16 -0
- package/src/storage/local.ts +1 -0
- package/src/storage/s3.ts +2 -0
- package/src/storage/types.ts +2 -0
- package/src/taxonomies/index.ts +40 -20
- package/src/widgets/archives.ts +67 -0
- package/src/widgets/index.ts +16 -0
- package/dist/api-B0w3uBiG.mjs +0 -2269
- package/dist/api-B0w3uBiG.mjs.map +0 -1
- package/dist/byline-Cpnwrje1.mjs.map +0 -1
- package/dist/challenge-store-D5pSY2S1.mjs.map +0 -1
- package/dist/content-CP-SeXNa.mjs.map +0 -1
- package/dist/content-refresh-DLOfIhYc.mjs.map +0 -1
- package/dist/context-BR5hRWiK.mjs.map +0 -1
- package/dist/errors-n2j49uNf.mjs.map +0 -1
- package/dist/index-DWbJrsAg.d.mts.map +0 -1
- package/dist/loader-ZsjE4paL.mjs.map +0 -1
- package/dist/manifest-schema-CUYPfCEH.mjs.map +0 -1
- package/dist/media-BjwNuLEu.mjs.map +0 -1
- package/dist/media-D6SeAfBl.mjs.map +0 -1
- package/dist/menus-CNg0QlDt.mjs.map +0 -1
- package/dist/normalize-CSxdKBVa.mjs.map +0 -1
- package/dist/object-cache-71tPfV4A.mjs.map +0 -1
- package/dist/options-BhZIeFY1.d.mts.map +0 -1
- package/dist/redirects-CRIM55KH.mjs.map +0 -1
- package/dist/registry-BiO5WwPq.mjs +0 -2716
- package/dist/registry-BiO5WwPq.mjs.map +0 -1
- package/dist/registry-Cx-jEJOS.mjs.map +0 -1
- package/dist/relations-BTPM2saV.mjs.map +0 -1
- package/dist/relations-C7B46bcU.d.mts.map +0 -1
- package/dist/runner-77GOZCnH.mjs.map +0 -1
- package/dist/runner-zgqA_CqP.d.mts.map +0 -1
- package/dist/settings-BgN-0DT-.mjs.map +0 -1
- package/dist/taxonomies-CPGxo-bn.mjs.map +0 -1
- package/dist/taxonomies-kmyudNGP.mjs.map +0 -1
- package/dist/types-D6OcIp2P.mjs +0 -3
- package/dist/types-DJQxln7q.d.mts.map +0 -1
- package/dist/types-D_DWe7k9.d.mts.map +0 -1
- package/dist/version-ri-sCyAp.mjs +0 -7
- package/dist/widgets-CpmZd9Q-.mjs.map +0 -1
- package/dist/zod-generator-DylzusHh.mjs.map +0 -1
- /package/dist/{api-tokens-B5NHLNUN.mjs → api-tokens-BfYts-sq.mjs} +0 -0
- /package/dist/{ssrf-BPKzkm6O.mjs → ssrf-Dg3cIT-b.mjs} +0 -0
package/src/plugins/index.ts
CHANGED
|
@@ -78,6 +78,9 @@ export {
|
|
|
78
78
|
createSandboxRouteErrorEnvelope,
|
|
79
79
|
getSandboxRouteErrorDetails,
|
|
80
80
|
getSandboxRouteErrorEnvelope,
|
|
81
|
+
MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH,
|
|
82
|
+
SANDBOX_HOOK_RESULT_VERSION,
|
|
83
|
+
inspectSandboxHookResult,
|
|
81
84
|
createNoopSandboxRunner,
|
|
82
85
|
} from "./sandbox/index.js";
|
|
83
86
|
export type {
|
|
@@ -93,6 +96,9 @@ export type {
|
|
|
93
96
|
SandboxRouteErrorCode,
|
|
94
97
|
SandboxRouteErrorDetails,
|
|
95
98
|
SandboxRouteErrorEnvelope,
|
|
99
|
+
SandboxHookErrorEnvelope,
|
|
100
|
+
SandboxHookResultInspection,
|
|
101
|
+
SandboxSaveRejectedError,
|
|
96
102
|
} from "./sandbox/index.js";
|
|
97
103
|
|
|
98
104
|
// Types
|
package/src/plugins/manager.ts
CHANGED
|
@@ -305,12 +305,13 @@ export class PluginManager {
|
|
|
305
305
|
content: Record<string, unknown>,
|
|
306
306
|
collection: string,
|
|
307
307
|
isNew: boolean,
|
|
308
|
+
id?: string,
|
|
308
309
|
): Promise<{
|
|
309
310
|
content: Record<string, unknown>;
|
|
310
311
|
results: HookResult<Record<string, unknown>>[];
|
|
311
312
|
}> {
|
|
312
313
|
this.ensureInitialized();
|
|
313
|
-
return this.hookPipeline!.runContentBeforeSave(content, collection, isNew);
|
|
314
|
+
return this.hookPipeline!.runContentBeforeSave(content, collection, isNew, id);
|
|
314
315
|
}
|
|
315
316
|
|
|
316
317
|
/**
|
package/src/plugins/routes.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
|
|
11
13
|
import { MediaUsageActivationWriteBlockedError } from "../api/media-usage-write-fence.js";
|
|
12
14
|
import { PluginContextFactory, type PluginContextFactoryOptions } from "./context.js";
|
|
13
15
|
import { extractRequestMeta } from "./request-meta.js";
|
|
@@ -215,7 +217,7 @@ export class PluginRouteHandler {
|
|
|
215
217
|
error: {
|
|
216
218
|
code: "VALIDATION_ERROR",
|
|
217
219
|
message: "Invalid request body",
|
|
218
|
-
details: parseResult.error
|
|
220
|
+
details: z.formatError(parseResult.error),
|
|
219
221
|
},
|
|
220
222
|
status: 400,
|
|
221
223
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Current wire-format version for sandbox hook result envelopes. */
|
|
2
|
+
export const SANDBOX_HOOK_RESULT_VERSION = 1 as const;
|
|
3
|
+
|
|
4
|
+
/** Maximum editor-facing rejection reason accepted from a sandboxed plugin. */
|
|
5
|
+
export const MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH = 500;
|
|
6
|
+
|
|
7
|
+
export interface SandboxSaveRejectedError {
|
|
8
|
+
code: "SAVE_REJECTED";
|
|
9
|
+
reason: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returned from a sandboxed `content:beforeSave` hook to reject the save.
|
|
14
|
+
* The host validates every field before exposing the reason to an editor.
|
|
15
|
+
*/
|
|
16
|
+
export interface SandboxHookErrorEnvelope {
|
|
17
|
+
__emdashSandboxHookResult: true;
|
|
18
|
+
version: typeof SANDBOX_HOOK_RESULT_VERSION;
|
|
19
|
+
error: SandboxSaveRejectedError;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type SandboxHookResultInspection =
|
|
23
|
+
| { kind: "value" }
|
|
24
|
+
| { kind: "malformed" }
|
|
25
|
+
| { kind: "error"; error: SandboxSaveRejectedError };
|
|
26
|
+
|
|
27
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
28
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Validate and normalize an untrusted value returned across the sandbox boundary. */
|
|
32
|
+
export function inspectSandboxHookResult(value: unknown): SandboxHookResultInspection {
|
|
33
|
+
if (!isRecord(value) || !Object.hasOwn(value, "__emdashSandboxHookResult")) {
|
|
34
|
+
return { kind: "value" };
|
|
35
|
+
}
|
|
36
|
+
if (
|
|
37
|
+
value.__emdashSandboxHookResult !== true ||
|
|
38
|
+
value.version !== SANDBOX_HOOK_RESULT_VERSION ||
|
|
39
|
+
!isRecord(value.error) ||
|
|
40
|
+
value.error.code !== "SAVE_REJECTED" ||
|
|
41
|
+
typeof value.error.reason !== "string"
|
|
42
|
+
) {
|
|
43
|
+
return { kind: "malformed" };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const reason = value.error.reason.trim();
|
|
47
|
+
if (reason.length === 0 || reason.length > MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH) {
|
|
48
|
+
return { kind: "malformed" };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { kind: "error", error: { code: "SAVE_REJECTED", reason } };
|
|
52
|
+
}
|
|
@@ -11,6 +11,11 @@ export {
|
|
|
11
11
|
getSandboxRouteErrorDetails,
|
|
12
12
|
getSandboxRouteErrorEnvelope,
|
|
13
13
|
} from "./types.js";
|
|
14
|
+
export {
|
|
15
|
+
MAX_SANDBOX_SAVE_REJECTION_REASON_LENGTH,
|
|
16
|
+
SANDBOX_HOOK_RESULT_VERSION,
|
|
17
|
+
inspectSandboxHookResult,
|
|
18
|
+
} from "./hook-result.js";
|
|
14
19
|
|
|
15
20
|
export type {
|
|
16
21
|
SandboxRunner,
|
|
@@ -26,3 +31,8 @@ export type {
|
|
|
26
31
|
SandboxRouteErrorDetails,
|
|
27
32
|
SandboxRouteErrorEnvelope,
|
|
28
33
|
} from "./types.js";
|
|
34
|
+
export type {
|
|
35
|
+
SandboxHookErrorEnvelope,
|
|
36
|
+
SandboxHookResultInspection,
|
|
37
|
+
SandboxSaveRejectedError,
|
|
38
|
+
} from "./hook-result.js";
|
package/src/plugins/types.ts
CHANGED
|
@@ -811,6 +811,12 @@ export interface ContentHookEvent {
|
|
|
811
811
|
content: Record<string, unknown>;
|
|
812
812
|
collection: string;
|
|
813
813
|
isNew: boolean;
|
|
814
|
+
/**
|
|
815
|
+
* ID of the existing item on `content:beforeSave` for an update. Absent on
|
|
816
|
+
* creates, where the ID is assigned when the save completes, and on
|
|
817
|
+
* `content:afterSave`, where `content.id` carries it.
|
|
818
|
+
*/
|
|
819
|
+
id?: string;
|
|
814
820
|
}
|
|
815
821
|
|
|
816
822
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { verifyMultihash } from "@emdash-cms/registry-verification/checksum";
|
|
2
|
+
|
|
3
|
+
const SHA256_HEX_PATTERN = /^[0-9a-fA-F]{64}$/;
|
|
4
|
+
|
|
5
|
+
export async function verifyRegistryArtifactChecksum(
|
|
6
|
+
bytes: Uint8Array,
|
|
7
|
+
checksum: string,
|
|
8
|
+
): Promise<boolean> {
|
|
9
|
+
if (SHA256_HEX_PATTERN.test(checksum)) {
|
|
10
|
+
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", Uint8Array.from(bytes)));
|
|
11
|
+
const actual = Array.from(digest, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
12
|
+
return actual === checksum.toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
return (await verifyMultihash(bytes, checksum)).success;
|
|
15
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { VerificationErrorCode } from "@emdash-cms/registry-verification";
|
|
2
|
+
import { validatePluginBundle } from "@emdash-cms/registry-verification/bundle";
|
|
3
|
+
import {
|
|
4
|
+
computeArtifactDigestCandidates,
|
|
5
|
+
verifyMultihash,
|
|
6
|
+
} from "@emdash-cms/registry-verification/checksum";
|
|
7
|
+
|
|
8
|
+
import { pluginManifestSchema, reconcileManifestAccess } from "../plugins/manifest-schema.js";
|
|
9
|
+
import type { PluginBundle } from "../plugins/marketplace.js";
|
|
10
|
+
|
|
11
|
+
const bundleDecoder = new TextDecoder("utf-8", { fatal: true });
|
|
12
|
+
|
|
13
|
+
export type RegistryArtifactVerificationCode =
|
|
14
|
+
| VerificationErrorCode
|
|
15
|
+
| "BUNDLE_INVALID_CODE_ENCODING"
|
|
16
|
+
| "BUNDLE_RUNTIME_UNSUPPORTED";
|
|
17
|
+
|
|
18
|
+
export type RegistryArtifactVerificationResult =
|
|
19
|
+
| {
|
|
20
|
+
success: true;
|
|
21
|
+
value: {
|
|
22
|
+
bundle: PluginBundle;
|
|
23
|
+
artifactDigest: Uint8Array;
|
|
24
|
+
artifactDigests: readonly Uint8Array[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
| {
|
|
28
|
+
success: false;
|
|
29
|
+
error: { code: RegistryArtifactVerificationCode; message: string };
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export async function validateRegistryArtifact(
|
|
33
|
+
bytes: Uint8Array,
|
|
34
|
+
checksum: string,
|
|
35
|
+
slug: string,
|
|
36
|
+
version: string,
|
|
37
|
+
): Promise<RegistryArtifactVerificationResult> {
|
|
38
|
+
const checksumReport = await verifyMultihash(bytes, checksum);
|
|
39
|
+
if (!checksumReport.success) return checksumReport;
|
|
40
|
+
const [artifactDigest, ...artifactDigests] = await computeArtifactDigestCandidates(bytes);
|
|
41
|
+
|
|
42
|
+
const bundleReport = await validatePluginBundle(bytes, {
|
|
43
|
+
expectedSlug: slug,
|
|
44
|
+
expectedVersion: version,
|
|
45
|
+
});
|
|
46
|
+
if (!bundleReport.success) return bundleReport;
|
|
47
|
+
|
|
48
|
+
const manifest = pluginManifestSchema.safeParse(bundleReport.value.manifest);
|
|
49
|
+
if (!manifest.success) {
|
|
50
|
+
return {
|
|
51
|
+
success: false,
|
|
52
|
+
error: {
|
|
53
|
+
code: "BUNDLE_RUNTIME_UNSUPPORTED",
|
|
54
|
+
message: "The plugin bundle uses manifest features unsupported by this EmDash version.",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
return {
|
|
61
|
+
success: true,
|
|
62
|
+
value: {
|
|
63
|
+
bundle: {
|
|
64
|
+
manifest: reconcileManifestAccess(manifest.data),
|
|
65
|
+
backendCode: bundleDecoder.decode(bundleReport.value.backend),
|
|
66
|
+
adminCode:
|
|
67
|
+
bundleReport.value.admin === undefined
|
|
68
|
+
? undefined
|
|
69
|
+
: bundleDecoder.decode(bundleReport.value.admin),
|
|
70
|
+
checksum,
|
|
71
|
+
},
|
|
72
|
+
artifactDigest,
|
|
73
|
+
artifactDigests,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
} catch {
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
error: {
|
|
80
|
+
code: "BUNDLE_INVALID_CODE_ENCODING",
|
|
81
|
+
message: "Plugin bundle code must be valid UTF-8.",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DirectPdsDidDocumentResolver,
|
|
3
|
+
DirectPdsProfileRecord,
|
|
4
|
+
DirectPdsReadErrorCode,
|
|
5
|
+
DirectPdsReleaseRecord,
|
|
6
|
+
} from "@emdash-cms/registry-client/direct-pds";
|
|
7
|
+
import { DirectPdsClient, DirectPdsReadError } from "@emdash-cms/registry-client/direct-pds";
|
|
8
|
+
import {
|
|
9
|
+
fetchVerifiedResource,
|
|
10
|
+
inspectPackageReleaseRecords,
|
|
11
|
+
verifyMultihash,
|
|
12
|
+
verifyPackageReleaseRecords,
|
|
13
|
+
type FetchImplementation,
|
|
14
|
+
type HostnameResolver,
|
|
15
|
+
type ProvenanceVerifier,
|
|
16
|
+
type RecordInspectionReport,
|
|
17
|
+
type RecordVerificationFailure,
|
|
18
|
+
type RecordVerificationReport,
|
|
19
|
+
type VerificationErrorCode,
|
|
20
|
+
} from "@emdash-cms/registry-verification";
|
|
21
|
+
|
|
22
|
+
import { cloudflareDohResolver, ssrfSafeFetch } from "../security/ssrf.js";
|
|
23
|
+
|
|
24
|
+
const MAX_PROVENANCE_BYTES = 5 * 1024 * 1024;
|
|
25
|
+
|
|
26
|
+
export type AuthoritativeRecordErrorCode =
|
|
27
|
+
| DirectPdsReadErrorCode
|
|
28
|
+
| VerificationErrorCode
|
|
29
|
+
| "AUTHORITATIVE_RECORD_READ_FAILED";
|
|
30
|
+
|
|
31
|
+
export interface AuthoritativeRecordReadOptions {
|
|
32
|
+
fetch?: typeof fetch;
|
|
33
|
+
didDocumentResolver?: DirectPdsDidDocumentResolver;
|
|
34
|
+
provenanceFetch?: FetchImplementation;
|
|
35
|
+
resolveHostname?: HostnameResolver;
|
|
36
|
+
provenanceVerifier?: ProvenanceVerifier;
|
|
37
|
+
artifactDigests?: readonly Uint8Array[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface VerifiedAuthoritativeRecords {
|
|
41
|
+
publisherDid: string;
|
|
42
|
+
packageSlug: string;
|
|
43
|
+
version: string;
|
|
44
|
+
profile: DirectPdsProfileRecord;
|
|
45
|
+
release: DirectPdsReleaseRecord;
|
|
46
|
+
inspection: Extract<RecordInspectionReport, { success: true }>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type VerifiedAuthoritativeReleaseReport = Extract<
|
|
50
|
+
RecordVerificationReport,
|
|
51
|
+
{ success: true }
|
|
52
|
+
>;
|
|
53
|
+
|
|
54
|
+
export type AuthoritativeRecordReadResult =
|
|
55
|
+
| { success: true; value: VerifiedAuthoritativeRecords }
|
|
56
|
+
| {
|
|
57
|
+
success: false;
|
|
58
|
+
error: { code: AuthoritativeRecordErrorCode; message: string };
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type AuthoritativeRecordReader = (
|
|
62
|
+
publisherDid: string,
|
|
63
|
+
packageSlug: string,
|
|
64
|
+
version: string,
|
|
65
|
+
options?: AuthoritativeRecordReadOptions,
|
|
66
|
+
) => Promise<AuthoritativeRecordReadResult>;
|
|
67
|
+
|
|
68
|
+
export async function readAuthoritativePackageRelease(
|
|
69
|
+
publisherDid: string,
|
|
70
|
+
packageSlug: string,
|
|
71
|
+
version: string,
|
|
72
|
+
options: AuthoritativeRecordReadOptions = {},
|
|
73
|
+
): Promise<AuthoritativeRecordReadResult> {
|
|
74
|
+
try {
|
|
75
|
+
const client = new DirectPdsClient({
|
|
76
|
+
did: publisherDid,
|
|
77
|
+
fetch: options.fetch ?? guardedFetch,
|
|
78
|
+
didDocumentResolver: options.didDocumentResolver,
|
|
79
|
+
});
|
|
80
|
+
const [profile, release] = await Promise.all([
|
|
81
|
+
client.getPackageProfile(packageSlug),
|
|
82
|
+
client.getPackageRelease(packageSlug, version),
|
|
83
|
+
]);
|
|
84
|
+
const inspection = await inspectPackageReleaseRecords({
|
|
85
|
+
publisherDid,
|
|
86
|
+
package: packageSlug,
|
|
87
|
+
version,
|
|
88
|
+
rkey: release.rkey,
|
|
89
|
+
profile: profile.value,
|
|
90
|
+
release: release.value,
|
|
91
|
+
});
|
|
92
|
+
if (!inspection.success) {
|
|
93
|
+
return {
|
|
94
|
+
success: false,
|
|
95
|
+
error: {
|
|
96
|
+
code: inspection.code,
|
|
97
|
+
message: inspection.reasons[0]?.message ?? "The signed package records are invalid.",
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
value: { publisherDid, packageSlug, version, profile, release, inspection },
|
|
104
|
+
};
|
|
105
|
+
} catch (error) {
|
|
106
|
+
if (error instanceof DirectPdsReadError) {
|
|
107
|
+
return { success: false, error: { code: error.code, message: error.message } };
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
success: false,
|
|
111
|
+
error: {
|
|
112
|
+
code: "AUTHORITATIVE_RECORD_READ_FAILED",
|
|
113
|
+
message: "The publisher's signed package records could not be verified.",
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export async function verifyAuthoritativePackageRelease(
|
|
120
|
+
records: VerifiedAuthoritativeRecords,
|
|
121
|
+
artifactDigest: Uint8Array,
|
|
122
|
+
options: AuthoritativeRecordReadOptions = {},
|
|
123
|
+
): Promise<RecordVerificationReport> {
|
|
124
|
+
const context = records.inspection.value;
|
|
125
|
+
const provenanceReference = context.releaseExtension.provenance;
|
|
126
|
+
let document: Uint8Array | undefined;
|
|
127
|
+
if (provenanceReference) {
|
|
128
|
+
const fetched = await fetchVerifiedResource(provenanceReference.url, {
|
|
129
|
+
fetch: options.provenanceFetch ?? defaultProvenanceFetch,
|
|
130
|
+
resolveHostname: options.resolveHostname ?? cloudflareDohResolver,
|
|
131
|
+
maxBytes: MAX_PROVENANCE_BYTES,
|
|
132
|
+
});
|
|
133
|
+
if (!fetched.success) {
|
|
134
|
+
return verificationFailure(fetched.error.code, fetched.error.message);
|
|
135
|
+
}
|
|
136
|
+
const checksum = await verifyMultihash(fetched.value.bytes, provenanceReference.checksum);
|
|
137
|
+
if (!checksum.success) {
|
|
138
|
+
return verificationFailure(checksum.error.code, checksum.error.message);
|
|
139
|
+
}
|
|
140
|
+
document = fetched.value.bytes;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return verifyPackageReleaseRecords({
|
|
144
|
+
publisherDid: records.publisherDid,
|
|
145
|
+
package: records.packageSlug,
|
|
146
|
+
version: records.version,
|
|
147
|
+
rkey: records.release.rkey,
|
|
148
|
+
profile: records.profile.value,
|
|
149
|
+
release: records.release.value,
|
|
150
|
+
provenance:
|
|
151
|
+
document === undefined
|
|
152
|
+
? undefined
|
|
153
|
+
: {
|
|
154
|
+
document,
|
|
155
|
+
artifactDigest,
|
|
156
|
+
artifactDigests: options.artifactDigests,
|
|
157
|
+
verifier: options.provenanceVerifier,
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function verificationFailure(
|
|
163
|
+
code: VerificationErrorCode,
|
|
164
|
+
message: string,
|
|
165
|
+
): RecordVerificationFailure {
|
|
166
|
+
return {
|
|
167
|
+
success: false,
|
|
168
|
+
status: "failed",
|
|
169
|
+
code,
|
|
170
|
+
reasons: [{ code, message }],
|
|
171
|
+
provenance: { status: "failed" },
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const guardedFetch: typeof fetch = async (input, init) => {
|
|
176
|
+
const url = input instanceof Request ? input.url : String(input);
|
|
177
|
+
return ssrfSafeFetch(url, init, { httpsOnly: true });
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const defaultProvenanceFetch: FetchImplementation = (input, init) => globalThis.fetch(input, init);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface VersionedRecordLabel {
|
|
2
|
+
val?: string;
|
|
3
|
+
uri?: string;
|
|
4
|
+
cid?: string;
|
|
5
|
+
neg?: boolean;
|
|
6
|
+
exp?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function hasCurrentRecordLabel(
|
|
10
|
+
labels: readonly VersionedRecordLabel[],
|
|
11
|
+
value: string,
|
|
12
|
+
record: { uri: string; cid: string },
|
|
13
|
+
now = Date.now(),
|
|
14
|
+
): boolean {
|
|
15
|
+
return labels.some((label) => {
|
|
16
|
+
if (
|
|
17
|
+
label.val !== value ||
|
|
18
|
+
label.uri !== record.uri ||
|
|
19
|
+
label.cid !== record.cid ||
|
|
20
|
+
label.neg === true
|
|
21
|
+
) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (label.exp === undefined) return true;
|
|
25
|
+
const expiresAt = Date.parse(label.exp);
|
|
26
|
+
return Number.isFinite(expiresAt) && expiresAt > now;
|
|
27
|
+
});
|
|
28
|
+
}
|
package/src/schema/registry.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
import { sql } from "kysely";
|
|
10
10
|
import { ulid } from "ulidx";
|
|
11
11
|
|
|
12
|
+
import { refreshDevTypes } from "../astro/dev-typegen.js";
|
|
12
13
|
import { currentTimestamp, listTablesLike, tableExists } from "../database/dialect-helpers.js";
|
|
13
14
|
import { withTransaction } from "../database/transaction.js";
|
|
14
15
|
import type { CollectionTable, Database, FieldTable } from "../database/types.js";
|
|
@@ -244,6 +245,13 @@ export class SchemaError extends Error {
|
|
|
244
245
|
export class SchemaRegistry {
|
|
245
246
|
constructor(private db: Kysely<Database>) {}
|
|
246
247
|
|
|
248
|
+
/**
|
|
249
|
+
* Notify the dev typegen hook that the schema has changed.
|
|
250
|
+
*/
|
|
251
|
+
private notifyTypegen(): void {
|
|
252
|
+
refreshDevTypes(this.db);
|
|
253
|
+
}
|
|
254
|
+
|
|
247
255
|
// ============================================
|
|
248
256
|
// Collection Operations
|
|
249
257
|
// ============================================
|
|
@@ -496,6 +504,7 @@ export class SchemaRegistry {
|
|
|
496
504
|
throw new SchemaError("Failed to create collection", "CREATE_FAILED");
|
|
497
505
|
}
|
|
498
506
|
|
|
507
|
+
this.notifyTypegen();
|
|
499
508
|
return collection;
|
|
500
509
|
}
|
|
501
510
|
|
|
@@ -671,6 +680,7 @@ export class SchemaRegistry {
|
|
|
671
680
|
}
|
|
672
681
|
throw error;
|
|
673
682
|
}
|
|
683
|
+
this.notifyTypegen();
|
|
674
684
|
}
|
|
675
685
|
|
|
676
686
|
private async assertSeedFieldDefinitions(
|
|
@@ -719,7 +729,7 @@ export class SchemaRegistry {
|
|
|
719
729
|
* Update a collection
|
|
720
730
|
*/
|
|
721
731
|
async updateCollection(slug: string, input: UpdateCollectionInput): Promise<Collection> {
|
|
722
|
-
|
|
732
|
+
const updated = await withTransaction(this.db, async (trx) => {
|
|
723
733
|
const existingRow = await trx
|
|
724
734
|
.selectFrom("_emdash_collections")
|
|
725
735
|
.where("slug", "=", slug)
|
|
@@ -798,6 +808,8 @@ export class SchemaRegistry {
|
|
|
798
808
|
|
|
799
809
|
return this.mapCollectionRow(row);
|
|
800
810
|
});
|
|
811
|
+
this.notifyTypegen();
|
|
812
|
+
return updated;
|
|
801
813
|
}
|
|
802
814
|
|
|
803
815
|
/**
|
|
@@ -852,6 +864,7 @@ export class SchemaRegistry {
|
|
|
852
864
|
}
|
|
853
865
|
throw error;
|
|
854
866
|
}
|
|
867
|
+
this.notifyTypegen();
|
|
855
868
|
}
|
|
856
869
|
|
|
857
870
|
// ============================================
|
|
@@ -1005,6 +1018,7 @@ export class SchemaRegistry {
|
|
|
1005
1018
|
"CONTENT_USAGE_STALE",
|
|
1006
1019
|
);
|
|
1007
1020
|
}
|
|
1021
|
+
this.notifyTypegen();
|
|
1008
1022
|
return created;
|
|
1009
1023
|
} catch (error) {
|
|
1010
1024
|
if (schemaMutated) {
|
|
@@ -1185,6 +1199,7 @@ export class SchemaRegistry {
|
|
|
1185
1199
|
);
|
|
1186
1200
|
}
|
|
1187
1201
|
}
|
|
1202
|
+
this.notifyTypegen();
|
|
1188
1203
|
return updatedField;
|
|
1189
1204
|
} catch (error) {
|
|
1190
1205
|
if (schemaMutated) {
|
|
@@ -1326,6 +1341,7 @@ export class SchemaRegistry {
|
|
|
1326
1341
|
}
|
|
1327
1342
|
throw error;
|
|
1328
1343
|
}
|
|
1344
|
+
this.notifyTypegen();
|
|
1329
1345
|
}
|
|
1330
1346
|
|
|
1331
1347
|
/**
|
|
@@ -1380,6 +1396,7 @@ export class SchemaRegistry {
|
|
|
1380
1396
|
.execute();
|
|
1381
1397
|
}
|
|
1382
1398
|
});
|
|
1399
|
+
this.notifyTypegen();
|
|
1383
1400
|
}
|
|
1384
1401
|
|
|
1385
1402
|
/**
|
|
@@ -1400,6 +1417,7 @@ export class SchemaRegistry {
|
|
|
1400
1417
|
.where("slug", "=", fieldSlugs[i])
|
|
1401
1418
|
.execute();
|
|
1402
1419
|
}
|
|
1420
|
+
this.notifyTypegen();
|
|
1403
1421
|
}
|
|
1404
1422
|
|
|
1405
1423
|
// ============================================
|
|
@@ -1463,9 +1481,13 @@ export class SchemaRegistry {
|
|
|
1463
1481
|
ON ${sql.ref(tableName)} (slug)
|
|
1464
1482
|
`.execute(conn);
|
|
1465
1483
|
|
|
1484
|
+
// Name must stay identical to migration 074. `deleted_at` leads so the
|
|
1485
|
+
// scheduled-publishing sweep can seek it and walk `scheduled_at` for both
|
|
1486
|
+
// its range and its ORDER BY; a `scheduled_at`-only index leaves a
|
|
1487
|
+
// stats-blind planner reading every live row.
|
|
1466
1488
|
await sql`
|
|
1467
|
-
${createIndex} ${sql.ref(`idx_${tableName}
|
|
1468
|
-
ON ${sql.ref(tableName)} (scheduled_at)
|
|
1489
|
+
${createIndex} ${sql.ref(`idx_${tableName}_del_sched`)}
|
|
1490
|
+
ON ${sql.ref(tableName)} (deleted_at, scheduled_at)
|
|
1469
1491
|
WHERE scheduled_at IS NOT NULL
|
|
1470
1492
|
`.execute(conn);
|
|
1471
1493
|
|
|
@@ -1992,6 +2014,7 @@ export class SchemaRegistry {
|
|
|
1992
2014
|
throw new SchemaError("Failed to register orphaned table", "REGISTER_FAILED");
|
|
1993
2015
|
}
|
|
1994
2016
|
await markContentMediaUsageCollectionStaleSafely(this.db, slug, "CONTENT_USAGE_STALE");
|
|
2017
|
+
this.notifyTypegen();
|
|
1995
2018
|
|
|
1996
2019
|
return collection;
|
|
1997
2020
|
} catch (error) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z, type
|
|
1
|
+
import { z, type ZodType } from "zod";
|
|
2
2
|
|
|
3
3
|
import { hashString } from "../utils/hash.js";
|
|
4
4
|
import type { CollectionWithFields, Field, FieldType, RepeaterSubField } from "./types.js";
|
|
@@ -14,8 +14,8 @@ const PASCAL_CASE_SPLIT_PATTERN = /[_\-\s]+/;
|
|
|
14
14
|
*/
|
|
15
15
|
export function generateZodSchema(
|
|
16
16
|
collection: CollectionWithFields,
|
|
17
|
-
): z.ZodObject<Record<string,
|
|
18
|
-
const shape: Record<string,
|
|
17
|
+
): z.ZodObject<Record<string, ZodType>> {
|
|
18
|
+
const shape: Record<string, ZodType> = {};
|
|
19
19
|
|
|
20
20
|
for (const field of collection.fields) {
|
|
21
21
|
shape[field.slug] = generateFieldSchema(field);
|
|
@@ -27,7 +27,7 @@ export function generateZodSchema(
|
|
|
27
27
|
/**
|
|
28
28
|
* Generate Zod schema for a single field
|
|
29
29
|
*/
|
|
30
|
-
export function generateFieldSchema(field: Field):
|
|
30
|
+
export function generateFieldSchema(field: Field): ZodType {
|
|
31
31
|
let schema = getBaseSchema(field.type, field);
|
|
32
32
|
|
|
33
33
|
// Apply validation rules
|
|
@@ -58,10 +58,10 @@ export function generateFieldSchema(field: Field): ZodTypeAny {
|
|
|
58
58
|
/**
|
|
59
59
|
* Get base Zod schema for a field type
|
|
60
60
|
*/
|
|
61
|
-
function getBaseSchema(type: FieldType, field: Pick<Field, "validation">):
|
|
61
|
+
function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodType {
|
|
62
62
|
switch (type) {
|
|
63
63
|
case "url":
|
|
64
|
-
return z.string().url();
|
|
64
|
+
return z.string().check(z.url());
|
|
65
65
|
|
|
66
66
|
case "string":
|
|
67
67
|
case "text":
|
|
@@ -94,7 +94,10 @@ function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodTy
|
|
|
94
94
|
// validate or the entry becomes unsavable through its own editor
|
|
95
95
|
// (#1368; same class as #867). `z.iso.*` retains semantic validation,
|
|
96
96
|
// so impossible dates are still rejected.
|
|
97
|
-
return z.iso
|
|
97
|
+
return z.iso
|
|
98
|
+
.datetime({ offset: true, local: true })
|
|
99
|
+
.or(z.iso.datetime({ offset: true, local: true, precision: -1 }))
|
|
100
|
+
.or(z.iso.date());
|
|
98
101
|
|
|
99
102
|
case "select": {
|
|
100
103
|
const options = field.validation?.options;
|
|
@@ -122,7 +125,7 @@ function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodTy
|
|
|
122
125
|
// renderers dispatch on it, but `_key` is intentionally optional:
|
|
123
126
|
// it's a UI-layer concern that the editor regenerates on every
|
|
124
127
|
// change (see `PortableTextEditor`), and the rest of this schema
|
|
125
|
-
// uses `.
|
|
128
|
+
// uses `.loose()` for everything below the top level. Making
|
|
126
129
|
// `_key` strictly required here was an accidentally tight invariant
|
|
127
130
|
// that rejected any seed/import data not authored against the
|
|
128
131
|
// editor (#867 — autosave failures on seeded template content).
|
|
@@ -132,7 +135,7 @@ function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodTy
|
|
|
132
135
|
_type: z.string(),
|
|
133
136
|
_key: z.string().optional(),
|
|
134
137
|
})
|
|
135
|
-
.
|
|
138
|
+
.loose(),
|
|
136
139
|
);
|
|
137
140
|
|
|
138
141
|
case "image": {
|
|
@@ -186,8 +189,8 @@ function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodTy
|
|
|
186
189
|
|
|
187
190
|
function generateRepeaterRowSchema(
|
|
188
191
|
subFields: readonly RepeaterSubField[],
|
|
189
|
-
): z.ZodObject<Record<string,
|
|
190
|
-
const shape: Record<string,
|
|
192
|
+
): z.ZodObject<Record<string, ZodType>> {
|
|
193
|
+
const shape: Record<string, ZodType> = {};
|
|
191
194
|
|
|
192
195
|
for (const subField of subFields) {
|
|
193
196
|
let schema = getBaseSchema(subField.type, {
|
|
@@ -204,13 +207,13 @@ function generateRepeaterRowSchema(
|
|
|
204
207
|
shape[subField.slug] = schema;
|
|
205
208
|
}
|
|
206
209
|
|
|
207
|
-
return z.object(shape).
|
|
210
|
+
return z.object(shape).loose();
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
/**
|
|
211
214
|
* Apply validation rules to a schema
|
|
212
215
|
*/
|
|
213
|
-
function applyValidation(schema:
|
|
216
|
+
function applyValidation(schema: ZodType, field: Field): ZodType {
|
|
214
217
|
const validation = field.validation;
|
|
215
218
|
if (!validation) return schema;
|
|
216
219
|
|