emdash 0.34.0 → 0.36.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/activation-K0kGBWuJ.mjs +382 -0
- package/dist/activation-K0kGBWuJ.mjs.map +1 -0
- package/dist/{adapters-34EN2eXO.d.mts → adapters-CzL3H752.d.mts} +10 -3
- package/dist/adapters-CzL3H752.d.mts.map +1 -0
- package/dist/{allowed-origins-DW7sYyqg.mjs → allowed-origins-maylGaHv.mjs} +2 -2
- package/dist/{allowed-origins-DW7sYyqg.mjs.map → allowed-origins-maylGaHv.mjs.map} +1 -1
- package/dist/api/route-utils.d.mts +3 -3
- package/dist/api/route-utils.mjs +22 -20
- 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-B0w3uBiG.mjs +2269 -0
- package/dist/api-B0w3uBiG.mjs.map +1 -0
- package/dist/{api-tokens-CFXu8F_2.mjs → api-tokens-9YrrCoE6.mjs} +2 -2
- package/dist/{api-tokens-CFXu8F_2.mjs.map → api-tokens-9YrrCoE6.mjs.map} +1 -1
- package/dist/{apply-D5zfeD09.mjs → apply-B_VMpJ2P.mjs} +34 -35
- package/dist/{apply-D5zfeD09.mjs.map → apply-B_VMpJ2P.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 +92 -25
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +10 -7
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs +3 -3
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +11 -12
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +255 -1323
- 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.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +15 -15
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +15 -15
- package/dist/astro/routes/api/admin/bylines/index.mjs +15 -15
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/counts.mjs +4 -4
- package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/activation.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +46 -0
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts +9 -0
- package/dist/astro/routes/api/admin/media-usage/progress.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +44 -0
- package/dist/astro/routes/api/admin/media-usage/progress.mjs.map +1 -0
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +16 -11
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +14 -13
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -47
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +52 -46
- 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 +53 -47
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +53 -47
- 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 +54 -48
- package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +172 -133
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +54 -48
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +52 -46
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +52 -46
- 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 +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +52 -46
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +7 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -7
- package/dist/astro/routes/api/auth/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +11 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +8 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +10 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +10 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.d.mts.map +1 -1
- package/dist/astro/routes/api/auth/me.mjs +19 -9
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +2 -2
- 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 +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -12
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/complete.mjs +11 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +10 -10
- 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.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +16 -14
- 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 +16 -14
- 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 +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.mjs +3 -3
- 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 +16 -16
- 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 +12 -12
- package/dist/astro/routes/api/import/wordpress/media.d.mts +10 -10
- package/dist/astro/routes/api/import/wordpress/media.mjs +11 -11
- 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 +12 -10
- 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 +16 -16
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +11 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +26 -26
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +42 -42
- package/dist/astro/routes/api/media/_id_/confirm.mjs +11 -11
- package/dist/astro/routes/api/media/_id_/upload.mjs +6 -6
- package/dist/astro/routes/api/media/_id_/usage.mjs +18 -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 +21 -13
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/folders/_id_.d.mts +10 -0
- package/dist/astro/routes/api/media/folders/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs +52 -0
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/media/folders/index.d.mts +9 -0
- package/dist/astro/routes/api/media/folders/index.d.mts.map +1 -0
- package/dist/astro/routes/api/media/folders/index.mjs +41 -0
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -0
- 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 +9 -9
- package/dist/astro/routes/api/media.d.mts.map +1 -1
- package/dist/astro/routes/api/media.mjs +28 -19
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/items.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_/translations.mjs +8 -8
- package/dist/astro/routes/api/menus/_name_.mjs +8 -8
- package/dist/astro/routes/api/menus/index.mjs +8 -8
- 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 +153 -6
- 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 +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +11 -11
- package/dist/astro/routes/api/redirects/index.mjs +11 -11
- package/dist/astro/routes/api/relations/_id_/index.mjs +16 -14
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +11 -9
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +16 -14
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- 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 +52 -46
- 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 +52 -46
- 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 +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +52 -46
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +10 -8
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +52 -46
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +10 -10
- package/dist/astro/routes/api/search/index.mjs +9 -9
- package/dist/astro/routes/api/search/rebuild.mjs +10 -10
- package/dist/astro/routes/api/search/stats.mjs +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 +6 -6
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +5 -5
- package/dist/astro/routes/api/settings/backups/export.mjs +6 -6
- package/dist/astro/routes/api/settings/backups/index.mjs +7 -7
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +13 -13
- package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
- package/dist/astro/routes/api/setup/admin.mjs +11 -11
- package/dist/astro/routes/api/setup/dev-bypass.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +35 -31
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.d.mts.map +1 -1
- package/dist/astro/routes/api/setup/index.mjs +31 -35
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +7 -7
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/_name_.mjs +13 -13
- package/dist/astro/routes/api/taxonomies/index.mjs +13 -13
- package/dist/astro/routes/api/themes/preview.mjs +5 -5
- package/dist/astro/routes/api/typegen.mjs +4 -4
- 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 +7 -7
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +10 -10
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/types.d.mts +19 -14
- 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-1iFJzPaZ.mjs → authorize-ByYs-Uxs.mjs} +2 -2
- package/dist/{authorize-1iFJzPaZ.mjs.map → authorize-ByYs-Uxs.mjs.map} +1 -1
- package/dist/{backup-LHjIAVNP.mjs → backup-ChyHfIoX.mjs} +5 -5
- package/dist/{backup-LHjIAVNP.mjs.map → backup-ChyHfIoX.mjs.map} +1 -1
- package/dist/{bundle-CBEXrBnb.mjs → bundle-DZFhFurR.mjs} +7 -7
- package/dist/{bundle-CBEXrBnb.mjs.map → bundle-DZFhFurR.mjs.map} +1 -1
- package/dist/{byline-pEcoDps8.mjs → byline-Cpnwrje1.mjs} +6 -6
- package/dist/{byline-pEcoDps8.mjs.map → byline-Cpnwrje1.mjs.map} +1 -1
- package/dist/{byline-fields-C5S8wygO.mjs → byline-fields-CAyA_Umd.mjs} +2 -2
- package/dist/{byline-fields-C5S8wygO.mjs.map → byline-fields-CAyA_Umd.mjs.map} +1 -1
- package/dist/{byline-registry-DDun8sxh.mjs → byline-registry-Bpu9-MVs.mjs} +2 -2
- package/dist/{byline-registry-DDun8sxh.mjs.map → byline-registry-Bpu9-MVs.mjs.map} +1 -1
- package/dist/{bylines-BWemdX2k.mjs → bylines-BSo9B9RX.mjs} +7 -7
- package/dist/{bylines-BWemdX2k.mjs.map → bylines-BSo9B9RX.mjs.map} +1 -1
- package/dist/{bylines-DJfSfXCL.mjs → bylines-CHjvehVX.mjs} +3 -3
- package/dist/{bylines-DJfSfXCL.mjs.map → bylines-CHjvehVX.mjs.map} +1 -1
- package/dist/{cache-CBJaDy_E.mjs → cache-5VirJ2Cn.mjs} +4 -4
- package/dist/{cache-CBJaDy_E.mjs.map → cache-5VirJ2Cn.mjs.map} +1 -1
- package/dist/capture-triggers-CNW1q3HK.mjs +362 -0
- package/dist/capture-triggers-CNW1q3HK.mjs.map +1 -0
- package/dist/{challenge-store-CZyFVaad.mjs → challenge-store-D5pSY2S1.mjs} +1 -1
- package/dist/{challenge-store-CZyFVaad.mjs.map → challenge-store-D5pSY2S1.mjs.map} +1 -1
- package/dist/{chunks-DfPax1I0.mjs → chunks-bNiX6_DR.mjs} +2 -2
- package/dist/{chunks-DfPax1I0.mjs.map → chunks-bNiX6_DR.mjs.map} +1 -1
- package/dist/cli/index.mjs +568 -84
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +74 -4
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +54 -2
- package/dist/client/index.mjs.map +1 -1
- package/dist/{collection-deletion-C8BugSGz.mjs → collection-deletion-m_oi2c0N.mjs} +13 -356
- package/dist/collection-deletion-m_oi2c0N.mjs.map +1 -0
- package/dist/{comment-Dxlep6cE.mjs → comment-DhvLEdhQ.mjs} +1 -1
- package/dist/{comment-Dxlep6cE.mjs.map → comment-DhvLEdhQ.mjs.map} +1 -1
- package/dist/{comment-reaction-D6qfHKBc.mjs → comment-reaction-CRuItEjt.mjs} +2 -2
- package/dist/{comment-reaction-D6qfHKBc.mjs.map → comment-reaction-CRuItEjt.mjs.map} +1 -1
- package/dist/{comments-CTOuhTSX.mjs → comments-CLj4bi8I.mjs} +2 -2
- package/dist/{comments-CTOuhTSX.mjs.map → comments-CLj4bi8I.mjs.map} +1 -1
- package/dist/{components-CQy3lh9x.mjs → components-v4U4DT2y.mjs} +1 -1
- package/dist/{components-CQy3lh9x.mjs.map → components-v4U4DT2y.mjs.map} +1 -1
- package/dist/config-DrfghTPe.d.mts +34 -0
- package/dist/config-DrfghTPe.d.mts.map +1 -0
- package/dist/{content-BNfwh7xX.mjs → content-CP-SeXNa.mjs} +5 -4
- package/dist/content-CP-SeXNa.mjs.map +1 -0
- package/dist/{content-list-query-DhQ84eVV.d.mts → content-list-query-BhejKVqb.d.mts} +1 -1
- package/dist/{content-list-query-DhQ84eVV.d.mts.map → content-list-query-BhejKVqb.d.mts.map} +1 -1
- package/dist/{content-refresh-DNERP4-f.mjs → content-refresh-DLOfIhYc.mjs} +1094 -93
- package/dist/content-refresh-DLOfIhYc.mjs.map +1 -0
- package/dist/{media-usage-De3qvwjc.mjs → content-repair-BCxzy0r4.mjs} +5 -196
- package/dist/content-repair-BCxzy0r4.mjs.map +1 -0
- package/dist/{context-DRgOvSnW.mjs → context-BR5hRWiK.mjs} +13 -13
- package/dist/{context-DRgOvSnW.mjs.map → context-BR5hRWiK.mjs.map} +1 -1
- package/dist/{cron-Y9aLtgrA.mjs → cron-CWfWrWKG.mjs} +1 -1
- package/dist/{cron-Y9aLtgrA.mjs.map → cron-CWfWrWKG.mjs.map} +1 -1
- package/dist/{dashboard-CB8J89rJ.mjs → dashboard-CkIV2rnQ.mjs} +5 -5
- package/dist/{dashboard-CB8J89rJ.mjs.map → dashboard-CkIV2rnQ.mjs.map} +1 -1
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.mjs +32 -9
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +11 -0
- package/dist/db/libsql-migrations.d.mts.map +1 -0
- package/dist/db/libsql-migrations.mjs +57 -0
- package/dist/db/libsql-migrations.mjs.map +1 -0
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +10 -0
- package/dist/db/postgres-migrations.d.mts.map +1 -0
- package/dist/db/postgres-migrations.mjs +47 -0
- package/dist/db/postgres-migrations.mjs.map +1 -0
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +10 -0
- package/dist/db/sqlite-migrations.d.mts.map +1 -0
- package/dist/db/sqlite-migrations.mjs +28 -0
- package/dist/db/sqlite-migrations.mjs.map +1 -0
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +3 -3
- package/dist/db/sqlite.mjs.map +1 -1
- package/dist/{default-DdDl3fxv.mjs → default-YMEfcQUx.mjs} +1 -1
- package/dist/{default-DdDl3fxv.mjs.map → default-YMEfcQUx.mjs.map} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts → deferred-tasks-DfqxH5Xf.d.mts} +1 -1
- package/dist/{deferred-tasks-BMsa9F64.d.mts.map → deferred-tasks-DfqxH5Xf.d.mts.map} +1 -1
- package/dist/{device-flow-CaioYGK3.mjs → device-flow-CojjSBwb.mjs} +5 -5
- package/dist/{device-flow-CaioYGK3.mjs.map → device-flow-CojjSBwb.mjs.map} +1 -1
- package/dist/direct-executor-BWeWiRYB.mjs +85 -0
- package/dist/direct-executor-BWeWiRYB.mjs.map +1 -0
- package/dist/{dist-D_6CKR8z.mjs → dist-89xCrGqi.mjs} +1 -1
- package/dist/{dist-D_6CKR8z.mjs.map → dist-89xCrGqi.mjs.map} +1 -1
- package/dist/{email-console-BHNjIwiB.mjs → email-console-CEJgR_LB.mjs} +1 -1
- package/dist/{email-console-BHNjIwiB.mjs.map → email-console-CEJgR_LB.mjs.map} +1 -1
- package/dist/{enrich-_ySMEvEE.mjs → enrich-BX0IDp4z.mjs} +3 -3
- package/dist/{enrich-_ySMEvEE.mjs.map → enrich-BX0IDp4z.mjs.map} +1 -1
- package/dist/{error-DupyJZE2.mjs → error-D9w94fjV.mjs} +2 -2
- package/dist/{error-DupyJZE2.mjs.map → error-D9w94fjV.mjs.map} +1 -1
- package/dist/{errors-CLUPm7aD.mjs → errors-n2j49uNf.mjs} +22 -2
- package/dist/errors-n2j49uNf.mjs.map +1 -0
- package/dist/{escape-C_aLKP3H.mjs → escape-DN4Qmjsl.mjs} +1 -1
- package/dist/{escape-C_aLKP3H.mjs.map → escape-DN4Qmjsl.mjs.map} +1 -1
- package/dist/{field-defs-cache-hg6QkjV9.mjs → field-defs-cache-Bh4q6oar.mjs} +5 -5
- package/dist/{field-defs-cache-hg6QkjV9.mjs.map → field-defs-cache-Bh4q6oar.mjs.map} +1 -1
- package/dist/focal-point-BeWFo6Xx.mjs +23 -0
- package/dist/focal-point-BeWFo6Xx.mjs.map +1 -0
- package/dist/{fts-manager-CZ-5dVwJ.mjs → fts-manager-BhOdW0bi.mjs} +3 -3
- package/dist/{fts-manager-CZ-5dVwJ.mjs.map → fts-manager-BhOdW0bi.mjs.map} +1 -1
- package/dist/{hash-Cg0TXJPV.mjs → hash-CTcngWvj.mjs} +1 -1
- package/dist/{hash-Cg0TXJPV.mjs.map → hash-CTcngWvj.mjs.map} +1 -1
- package/dist/{hreflang-D3Uehfv2.d.mts → hreflang-7pTHsLZJ.d.mts} +2 -2
- package/dist/{hreflang-D3Uehfv2.d.mts.map → hreflang-7pTHsLZJ.d.mts.map} +1 -1
- package/dist/{hreflang-DNswoYsi.mjs → hreflang-Huc6O5wa.mjs} +7 -7
- package/dist/{hreflang-DNswoYsi.mjs.map → hreflang-Huc6O5wa.mjs.map} +1 -1
- package/dist/identity-DXmb4aVp.mjs +35 -0
- package/dist/identity-DXmb4aVp.mjs.map +1 -0
- package/dist/{import-B41u8Rot.mjs → import-C4_O3KXU.mjs} +5 -5
- package/dist/{import-B41u8Rot.mjs.map → import-C4_O3KXU.mjs.map} +1 -1
- package/dist/{index-Cof4-Fab.d.mts → index-6bRee8zb.d.mts} +3 -3
- package/dist/{index-Cof4-Fab.d.mts.map → index-6bRee8zb.d.mts.map} +1 -1
- package/dist/{index-C3Y-rsyN.d.mts → index-DWbJrsAg.d.mts} +138 -83
- package/dist/index-DWbJrsAg.d.mts.map +1 -0
- package/dist/index.d.mts +21 -20
- package/dist/index.mjs +78 -72
- package/dist/{init-lock-6b309ZrF.mjs → init-lock-DJkX6Hto.mjs} +1 -1
- package/dist/{init-lock-6b309ZrF.mjs.map → init-lock-DJkX6Hto.mjs.map} +1 -1
- package/dist/{load-DmvJrtxS.mjs → load-Bo7fZAbg.mjs} +2 -2
- package/dist/{load-DmvJrtxS.mjs.map → load-Bo7fZAbg.mjs.map} +1 -1
- package/dist/{loader-DLBqRiGP.mjs → loader-ZsjE4paL.mjs} +2 -2
- package/dist/{loader-DLBqRiGP.mjs.map → loader-ZsjE4paL.mjs.map} +1 -1
- package/dist/manifest-builder-QXuqvVMP.mjs +189 -0
- package/dist/manifest-builder-QXuqvVMP.mjs.map +1 -0
- package/dist/{manifest-schema-BXbUAHod.mjs → manifest-schema-CUYPfCEH.mjs} +1 -1
- package/dist/{manifest-schema-BXbUAHod.mjs.map → manifest-schema-CUYPfCEH.mjs.map} +1 -1
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +13 -3
- package/dist/media/index.mjs.map +1 -1
- package/dist/media/local-runtime.d.mts +14 -12
- package/dist/media/local-runtime.d.mts.map +1 -1
- package/dist/media/local-runtime.mjs +11 -5
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/{media-BWWWb8kg.mjs → media-BjwNuLEu.mjs} +100 -6
- package/dist/media-BjwNuLEu.mjs.map +1 -0
- package/dist/{media-CzhAn2--.mjs → media-D6SeAfBl.mjs} +41 -12
- package/dist/media-D6SeAfBl.mjs.map +1 -0
- package/dist/{media-allowlist-BD6HhgXA.mjs → media-allowlist-D35v7bmL.mjs} +3 -2
- package/dist/media-allowlist-D35v7bmL.mjs.map +1 -0
- package/dist/media-folders-D-0CmRZj.mjs +210 -0
- package/dist/media-folders-D-0CmRZj.mjs.map +1 -0
- package/dist/{media-upload-9yas9zGH.mjs → media-upload-C7bLXGcI.mjs} +9 -9
- package/dist/{media-upload-9yas9zGH.mjs.map → media-upload-C7bLXGcI.mjs.map} +1 -1
- package/dist/{media-url-BvoX88FA.mjs → media-url-DH7giMx_.mjs} +1 -1
- package/dist/{media-url-BvoX88FA.mjs.map → media-url-DH7giMx_.mjs.map} +1 -1
- package/dist/media-usage-BTRJvS6V.mjs +1833 -0
- package/dist/media-usage-BTRJvS6V.mjs.map +1 -0
- package/dist/media-usage-activation-Dx0kPV6b.mjs +78 -0
- package/dist/media-usage-activation-Dx0kPV6b.mjs.map +1 -0
- package/dist/{media-usage-work-DrCbqBcl.mjs → media-usage-work-C-fhM30c.mjs} +221 -59
- package/dist/media-usage-work-C-fhM30c.mjs.map +1 -0
- package/dist/{media-usage-work-B9Bksh_b.mjs → media-usage-work-DWb2XPMI.mjs} +4 -4
- package/dist/{media-usage-work-B9Bksh_b.mjs.map → media-usage-work-DWb2XPMI.mjs.map} +1 -1
- package/dist/{media-usage-write-fence-aHEgN1zB.mjs → media-usage-write-fence-BwoJVRDC.mjs} +2 -2
- package/dist/{media-usage-write-fence-aHEgN1zB.mjs.map → media-usage-write-fence-BwoJVRDC.mjs.map} +1 -1
- package/dist/{menus-fxvEDYE6.mjs → menus-CD7EFLwz.mjs} +3 -3
- package/dist/{menus-fxvEDYE6.mjs.map → menus-CD7EFLwz.mjs.map} +1 -1
- package/dist/{menus-CC-yn1F9.mjs → menus-CNg0QlDt.mjs} +42 -26
- package/dist/menus-CNg0QlDt.mjs.map +1 -0
- package/dist/migrations/index.d.mts +22 -0
- package/dist/migrations/index.d.mts.map +1 -0
- package/dist/migrations/index.mjs +7 -0
- package/dist/{mime-DfIVjNkr.mjs → mime-CUIG6x84.mjs} +1 -1
- package/dist/mime-CUIG6x84.mjs.map +1 -0
- package/dist/{mode-Bpe-tNNy.mjs → mode-DaUM_MB2.mjs} +1 -1
- package/dist/{mode-Bpe-tNNy.mjs.map → mode-DaUM_MB2.mjs.map} +1 -1
- package/dist/node-sqlite-compat-Udb4Y-rs.mjs +46 -0
- package/dist/node-sqlite-compat-Udb4Y-rs.mjs.map +1 -0
- package/dist/{normalize-Bc-s_r-a.mjs → normalize-CSxdKBVa.mjs} +22 -1
- package/dist/normalize-CSxdKBVa.mjs.map +1 -0
- package/dist/{oauth-authorization-BXO1MKej.mjs → oauth-authorization-Dpsb-fMJ.mjs} +5 -5
- package/dist/{oauth-authorization-BXO1MKej.mjs.map → oauth-authorization-Dpsb-fMJ.mjs.map} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs → oauth-clients-Bxnoe_67.mjs} +1 -1
- package/dist/{oauth-clients-C_DNqtRu.mjs.map → oauth-clients-Bxnoe_67.mjs.map} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs → oauth-state-store-0C4s0K6w.mjs} +1 -1
- package/dist/{oauth-state-store-DwAxMtk4.mjs.map → oauth-state-store-0C4s0K6w.mjs.map} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs → oauth-user-lookup-wlGYSeqX.mjs} +1 -1
- package/dist/{oauth-user-lookup-BxfZizdk.mjs.map → oauth-user-lookup-wlGYSeqX.mjs.map} +1 -1
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/{options-CBXIHUoT.mjs → options-BHPeIbBd.mjs} +1 -1
- package/dist/{options-CBXIHUoT.mjs.map → options-BHPeIbBd.mjs.map} +1 -1
- package/dist/{options-DRe1pIBL.d.mts → options-BhZIeFY1.d.mts} +3 -3
- package/dist/{options-DRe1pIBL.d.mts.map → options-BhZIeFY1.d.mts.map} +1 -1
- package/dist/page/index.d.mts +2 -2
- package/dist/{parse-DFbuc-Fh.mjs → parse-BRJg1kz8.mjs} +2 -2
- package/dist/{parse-DFbuc-Fh.mjs.map → parse-BRJg1kz8.mjs.map} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs → passkey-config-B3P0nHRR.mjs} +1 -1
- package/dist/{passkey-config-_2GOwwK8.mjs.map → passkey-config-B3P0nHRR.mjs.map} +1 -1
- package/dist/{patterns-CiyXeDgr.mjs → patterns-D9iDO3j8.mjs} +1 -1
- package/dist/{patterns-CiyXeDgr.mjs.map → patterns-D9iDO3j8.mjs.map} +1 -1
- package/dist/{placeholder-CzW7Lshs.d.mts → placeholder-BR4ZhVJl.d.mts} +7 -1
- package/dist/placeholder-BR4ZhVJl.d.mts.map +1 -0
- 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/policy-BVRganJQ.mjs +45 -0
- package/dist/policy-BVRganJQ.mjs.map +1 -0
- package/dist/{portable-text-DhKbDAGr.mjs → portable-text-C8Tvp4_g.mjs} +1 -1
- package/dist/{portable-text-DhKbDAGr.mjs.map → portable-text-C8Tvp4_g.mjs.map} +1 -1
- package/dist/{preview-PW-nOnq4.mjs → preview-dn2dUyM0.mjs} +2 -2
- package/dist/{preview-PW-nOnq4.mjs.map → preview-dn2dUyM0.mjs.map} +1 -1
- package/dist/protocol-CuBEsqgE.d.mts +52 -0
- package/dist/protocol-CuBEsqgE.d.mts.map +1 -0
- package/dist/{public-url-CWoFhQT8.mjs → public-url-DRz_AinV.mjs} +1 -1
- package/dist/{public-url-CWoFhQT8.mjs.map → public-url-DRz_AinV.mjs.map} +1 -1
- package/dist/{query-BgjfiLUQ.mjs → query-D18vTdha.mjs} +14 -14
- package/dist/{query-BgjfiLUQ.mjs.map → query-D18vTdha.mjs.map} +1 -1
- package/dist/{query-vgZNwIhh.mjs → query-tZDEdtCN.mjs} +4 -4
- package/dist/{query-vgZNwIhh.mjs.map → query-tZDEdtCN.mjs.map} +1 -1
- package/dist/{rate-limit-L5anykgo.mjs → rate-limit-on7KPo-v.mjs} +2 -2
- package/dist/{rate-limit-L5anykgo.mjs.map → rate-limit-on7KPo-v.mjs.map} +1 -1
- package/dist/{redirect-COsS6SWJ.mjs → redirect-CZkbozu9.mjs} +2 -2
- package/dist/{redirect-COsS6SWJ.mjs.map → redirect-CZkbozu9.mjs.map} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs → redirect-DrbEmU9a.mjs} +1 -1
- package/dist/{redirect-KBNE3UEs.mjs.map → redirect-DrbEmU9a.mjs.map} +1 -1
- package/dist/{redirects-CufRQt0Q.mjs → redirects-BahWiu8Z.mjs} +5 -5
- package/dist/{redirects-CufRQt0Q.mjs.map → redirects-BahWiu8Z.mjs.map} +1 -1
- package/dist/{redirects-cV9g7V-0.mjs → redirects-CRIM55KH.mjs} +6 -6
- package/dist/{redirects-cV9g7V-0.mjs.map → redirects-CRIM55KH.mjs.map} +1 -1
- package/dist/{api-DdAsirBe.mjs → registry-BiO5WwPq.mjs} +483 -2462
- package/dist/registry-BiO5WwPq.mjs.map +1 -0
- package/dist/{registry-C581V4TP.mjs → registry-Cx-jEJOS.mjs} +9 -123
- package/dist/registry-Cx-jEJOS.mjs.map +1 -0
- package/dist/{relation-DtmAQH7s.mjs → relation-A6wLF_DS.mjs} +2 -2
- package/dist/{relation-DtmAQH7s.mjs.map → relation-A6wLF_DS.mjs.map} +1 -1
- package/dist/{relations-BBApI4e2.mjs → relations-BTPM2saV.mjs} +2 -2
- package/dist/{relations-BBApI4e2.mjs.map → relations-BTPM2saV.mjs.map} +1 -1
- package/dist/{relations-DItI3MN9.d.mts → relations-C7B46bcU.d.mts} +189 -30
- package/dist/relations-C7B46bcU.d.mts.map +1 -0
- package/dist/{relations-DICSyfsh.mjs → relations-Cj5hZ6Zg.mjs} +4 -4
- package/dist/{relations-DICSyfsh.mjs.map → relations-Cj5hZ6Zg.mjs.map} +1 -1
- package/dist/{request-cache-BSUptuJR.mjs → request-cache-DH9zdCOD.mjs} +1 -1
- package/dist/{request-cache-BSUptuJR.mjs.map → request-cache-DH9zdCOD.mjs.map} +1 -1
- package/dist/request-context.d.mts +1 -1
- package/dist/{request-meta-DgZJh3zG.mjs → request-meta-DRp5ENd_.mjs} +2 -2
- package/dist/{request-meta-DgZJh3zG.mjs.map → request-meta-DRp5ENd_.mjs.map} +1 -1
- package/dist/{resolve-DOhVEvty.mjs → resolve-DxUpTMmE.mjs} +1 -1
- package/dist/{resolve-DOhVEvty.mjs.map → resolve-DxUpTMmE.mjs.map} +1 -1
- package/dist/{runner-BiDvq5dv.mjs → runner-77GOZCnH.mjs} +443 -289
- package/dist/runner-77GOZCnH.mjs.map +1 -0
- package/dist/{runner-CgQbELYC.d.mts → runner-zgqA_CqP.d.mts} +16 -3
- package/dist/runner-zgqA_CqP.d.mts.map +1 -0
- package/dist/runtime.d.mts +11 -11
- package/dist/runtime.mjs +1 -1
- package/dist/{schema-BFyTg38T.mjs → schema-BY-oVntF.mjs} +3 -3
- package/dist/{schema-BFyTg38T.mjs.map → schema-BY-oVntF.mjs.map} +1 -1
- package/dist/{schema-CeQSNwB3.mjs → schema-Cw9kVK0I.mjs} +35 -5
- package/dist/{schema-CeQSNwB3.mjs.map → schema-Cw9kVK0I.mjs.map} +1 -1
- package/dist/{scopes-BVeuhGBE.mjs → scopes-vMR1uIbt.mjs} +3 -3
- package/dist/{scopes-BVeuhGBE.mjs.map → scopes-vMR1uIbt.mjs.map} +1 -1
- package/dist/{search-BpuPKZb0.mjs → search-CfT3KxO5.mjs} +4 -4
- package/dist/{search-BpuPKZb0.mjs.map → search-CfT3KxO5.mjs.map} +1 -1
- package/dist/{secrets-dtYs2hDo.mjs → secrets-BH2Qow1-.mjs} +3 -3
- package/dist/{secrets-dtYs2hDo.mjs.map → secrets-BH2Qow1-.mjs.map} +1 -1
- package/dist/{sections-COctk6hf.mjs → sections-DTfjyf1z.mjs} +2 -2
- package/dist/{sections-COctk6hf.mjs.map → sections-DTfjyf1z.mjs.map} +1 -1
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +24 -22
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.mjs +16 -14
- package/dist/seo/index.mjs.map +1 -1
- package/dist/{seo-AFpVvTqr.mjs → seo-BSiTIXzd.mjs} +1 -1
- package/dist/{seo-AFpVvTqr.mjs.map → seo-BSiTIXzd.mjs.map} +1 -1
- package/dist/{seo-CvDxfvFb.mjs → seo-Cm-dtvgk.mjs} +2 -2
- package/dist/{seo-CvDxfvFb.mjs.map → seo-Cm-dtvgk.mjs.map} +1 -1
- package/dist/{service-xMiMSTsR.mjs → service-DYsDHEKe.mjs} +3 -3
- package/dist/{service-xMiMSTsR.mjs.map → service-DYsDHEKe.mjs.map} +1 -1
- package/dist/{session-user-BzVemLkw.mjs → session-user-CNAfvsdw.mjs} +1 -1
- package/dist/{session-user-BzVemLkw.mjs.map → session-user-CNAfvsdw.mjs.map} +1 -1
- package/dist/{settings-B372MV0p.mjs → settings-BgN-0DT-.mjs} +6 -6
- package/dist/{settings-B372MV0p.mjs.map → settings-BgN-0DT-.mjs.map} +1 -1
- package/dist/{settings-BE9aqn_9.mjs → settings-DjtkUo__.mjs} +3 -3
- package/dist/{settings-BE9aqn_9.mjs.map → settings-DjtkUo__.mjs.map} +1 -1
- package/dist/{setup-complete-DF7TAfD5.mjs → setup-complete-CcpXaPU7.mjs} +2 -2
- package/dist/{setup-complete-DF7TAfD5.mjs.map → setup-complete-CcpXaPU7.mjs.map} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs → setup-nonce-Reyw30jg.mjs} +1 -1
- package/dist/{setup-nonce-Do-U_cg9.mjs.map → setup-nonce-Reyw30jg.mjs.map} +1 -1
- package/dist/{single-flight-cache-B0eLKS6K.mjs → single-flight-cache-BPuGPdcN.mjs} +2 -2
- package/dist/{single-flight-cache-B0eLKS6K.mjs.map → single-flight-cache-BPuGPdcN.mjs.map} +1 -1
- package/dist/{site-url-Bowsi9T-.mjs → site-url-Cs_V9n3V.mjs} +3 -3
- package/dist/{site-url-Bowsi9T-.mjs.map → site-url-Cs_V9n3V.mjs.map} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs → snapshot-DSB8P7Lm.mjs} +1 -1
- package/dist/{snapshot-B5h6aPMh.mjs.map → snapshot-DSB8P7Lm.mjs.map} +1 -1
- package/dist/{ssrf-Cpvg_n3A.mjs → ssrf-DqebVE34.mjs} +21 -5
- package/dist/{ssrf-Cpvg_n3A.mjs.map → ssrf-DqebVE34.mjs.map} +1 -1
- package/dist/{state-DYwPue40.mjs → state-BJfU9Uzw.mjs} +12 -4
- package/dist/state-BJfU9Uzw.mjs.map +1 -0
- package/dist/{status-CWVYpbD8.mjs → status-DDu8HIQl.mjs} +1 -1
- package/dist/{status-CWVYpbD8.mjs.map → status-DDu8HIQl.mjs.map} +1 -1
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +3 -3
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/target-D0o26Azo.mjs +27 -0
- package/dist/target-D0o26Azo.mjs.map +1 -0
- package/dist/{taxonomies-Dk3MAklL.mjs → taxonomies-CPGxo-bn.mjs} +5 -5
- package/dist/{taxonomies-Dk3MAklL.mjs.map → taxonomies-CPGxo-bn.mjs.map} +1 -1
- package/dist/{taxonomies-B0o9ExNV.mjs → taxonomies-kmyudNGP.mjs} +7 -7
- package/dist/{taxonomies-B0o9ExNV.mjs.map → taxonomies-kmyudNGP.mjs.map} +1 -1
- package/dist/{taxonomy-CPeM8d2o.mjs → taxonomy-8X09dLN5.mjs} +4 -4
- package/dist/{taxonomy-CPeM8d2o.mjs.map → taxonomy-8X09dLN5.mjs.map} +1 -1
- package/dist/{tokens-C39klX8R.mjs → tokens-gTS-IVUp.mjs} +1 -1
- package/dist/{tokens-C39klX8R.mjs.map → tokens-gTS-IVUp.mjs.map} +1 -1
- package/dist/{transaction-NQj4VJ7Z.mjs → transaction-0KOpOyMu.mjs} +2 -1
- package/dist/{transaction-NQj4VJ7Z.mjs.map → transaction-0KOpOyMu.mjs.map} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts → transport-_6R1ub7t.d.mts} +1 -1
- package/dist/{transport-B_rfeU-a.d.mts.map → transport-_6R1ub7t.d.mts.map} +1 -1
- package/dist/{transport--CfOflrp.mjs → transport-fX59xaJz.mjs} +4 -3
- package/dist/{transport--CfOflrp.mjs.map → transport-fX59xaJz.mjs.map} +1 -1
- package/dist/{trusted-proxy-CEVekpby.mjs → trusted-proxy-fe6nEgR4.mjs} +1 -1
- package/dist/{trusted-proxy-CEVekpby.mjs.map → trusted-proxy-fe6nEgR4.mjs.map} +1 -1
- package/dist/types-75KIqzL9.mjs.map +1 -1
- package/dist/{types-BW1syrlw.mjs → types-BXUmsINL.mjs} +1 -1
- package/dist/{types-BW1syrlw.mjs.map → types-BXUmsINL.mjs.map} +1 -1
- package/dist/{types-CPx2lIGo.d.mts → types-Blb-MRC3.d.mts} +1 -1
- package/dist/{types-CPx2lIGo.d.mts.map → types-Blb-MRC3.d.mts.map} +1 -1
- package/dist/{types-C3_AbkDP.d.mts → types-Br-ERaxh.d.mts} +2 -1
- package/dist/types-Br-ERaxh.d.mts.map +1 -0
- package/dist/{types-BPuloofb.d.mts → types-BzBd3PeX.d.mts} +1 -1
- package/dist/{types-BPuloofb.d.mts.map → types-BzBd3PeX.d.mts.map} +1 -1
- package/dist/{types-DefV3OiO.d.mts → types-CLqvnd05.d.mts} +1 -1
- package/dist/{types-DefV3OiO.d.mts.map → types-CLqvnd05.d.mts.map} +1 -1
- package/dist/{types-X0MThr7x.d.mts → types-D5VVLr7J.d.mts} +1 -1
- package/dist/{types-X0MThr7x.d.mts.map → types-D5VVLr7J.d.mts.map} +1 -1
- package/dist/{types-CAGdePf3.d.mts → types-DHxzBjbD.d.mts} +10 -1
- package/dist/types-DHxzBjbD.d.mts.map +1 -0
- package/dist/{types-D4_1Ga4L.d.mts → types-DJQxln7q.d.mts} +3 -3
- package/dist/{types-D4_1Ga4L.d.mts.map → types-DJQxln7q.d.mts.map} +1 -1
- package/dist/{types-CtzytVXn.mjs → types-DM3vioBY.mjs} +1 -1
- package/dist/{types-CtzytVXn.mjs.map → types-DM3vioBY.mjs.map} +1 -1
- package/dist/{types-CFUfyt1s.d.mts → types-D_DWe7k9.d.mts} +1 -1
- package/dist/{types-CFUfyt1s.d.mts.map → types-D_DWe7k9.d.mts.map} +1 -1
- package/dist/{types-Cs-TFLNf.d.mts → types-Vg6f5i3s.d.mts} +3 -3
- package/dist/{types-Cs-TFLNf.d.mts.map → types-Vg6f5i3s.d.mts.map} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs → upload-attempts-CNyGSepg.mjs} +1 -1
- package/dist/{upload-attempts-hlne3iA1.mjs.map → upload-attempts-CNyGSepg.mjs.map} +1 -1
- package/dist/{url-pattern-BHS0V5Ng.mjs → url-pattern-K-KdXcSe.mjs} +1 -1
- package/dist/{url-pattern-BHS0V5Ng.mjs.map → url-pattern-K-KdXcSe.mjs.map} +1 -1
- package/dist/{user-sHgJ62SP.mjs → user-CtYY0tp2.mjs} +2 -2
- package/dist/{user-sHgJ62SP.mjs.map → user-CtYY0tp2.mjs.map} +1 -1
- package/dist/{utils-D4vD_Y98.mjs → utils-HztC73hq.mjs} +1 -1
- package/dist/{utils-D4vD_Y98.mjs.map → utils-HztC73hq.mjs.map} +1 -1
- package/dist/{validate-BkqIG_Uj.mjs → validate-Dd-IUjnZ.mjs} +2 -2
- package/dist/{validate-BkqIG_Uj.mjs.map → validate-Dd-IUjnZ.mjs.map} +1 -1
- package/dist/{validate-DeGtBN84.d.mts → validate-DlqdOZXB.d.mts} +5 -5
- package/dist/{validate-DeGtBN84.d.mts.map → validate-DlqdOZXB.d.mts.map} +1 -1
- package/dist/{validation-CiJb_X5o.mjs → validation-D83n7Npi.mjs} +10 -8
- package/dist/{validation-CiJb_X5o.mjs.map → validation-D83n7Npi.mjs.map} +1 -1
- package/dist/version-ri-sCyAp.mjs +7 -0
- package/dist/{version-x0NjTScG.mjs.map → version-ri-sCyAp.mjs.map} +1 -1
- package/dist/{widgets-Cwzvww0W.mjs → widgets-CpmZd9Q-.mjs} +4 -4
- package/dist/{widgets-Cwzvww0W.mjs.map → widgets-CpmZd9Q-.mjs.map} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts → wxr-taxonomies-BFd0y72_.d.mts} +1 -1
- package/dist/{wxr-taxonomies-CmC0ZsDr.d.mts.map → wxr-taxonomies-BFd0y72_.d.mts.map} +1 -1
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs → wxr-taxonomies-Df4vxWcU.mjs} +4 -4
- package/dist/{wxr-taxonomies-QZjWxjyk.mjs.map → wxr-taxonomies-Df4vxWcU.mjs.map} +1 -1
- package/dist/{zod-generator-D11MhxG4.mjs → zod-generator-DylzusHh.mjs} +24 -18
- package/dist/zod-generator-DylzusHh.mjs.map +1 -0
- package/package.json +32 -8
- package/src/api/errors.ts +20 -0
- package/src/api/handlers/index.ts +17 -0
- package/src/api/handlers/media-allowlist.ts +1 -0
- package/src/api/handlers/media-folders.ts +130 -0
- package/src/api/handlers/media-usage-activation.ts +102 -0
- package/src/api/handlers/media-usage.ts +108 -0
- package/src/api/handlers/media.ts +62 -2
- package/src/api/handlers/registry.ts +134 -316
- package/src/api/openapi/document.ts +192 -2
- package/src/api/schemas/media-usage.ts +77 -0
- package/src/api/schemas/media.ts +69 -0
- package/src/astro/integration/index.ts +46 -14
- package/src/astro/integration/routes.ts +18 -0
- package/src/astro/integration/runtime.ts +3 -0
- package/src/astro/integration/vite-config.ts +2 -7
- package/src/astro/middleware/auth.ts +4 -0
- package/src/astro/middleware/scoped-db.ts +21 -0
- package/src/astro/middleware.ts +67 -17
- package/src/astro/routes/api/admin/media-usage/activation.ts +42 -0
- package/src/astro/routes/api/admin/media-usage/progress.ts +37 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +246 -96
- package/src/astro/routes/api/auth/dev-bypass.ts +0 -4
- package/src/astro/routes/api/auth/me.ts +14 -2
- package/src/astro/routes/api/media/[id].ts +3 -0
- package/src/astro/routes/api/media/folders/[id].ts +55 -0
- package/src/astro/routes/api/media/folders/index.ts +37 -0
- package/src/astro/routes/api/media.ts +12 -2
- package/src/astro/routes/api/setup/dev-bypass.ts +14 -7
- package/src/astro/routes/api/setup/index.ts +5 -13
- package/src/astro/types.ts +11 -1
- package/src/cli/commands/migrate.ts +593 -0
- package/src/cli/index.ts +2 -23
- package/src/client/index.ts +140 -2
- package/src/client/transport.ts +6 -2
- package/src/components/EmDashImage.astro +154 -50
- package/src/components/Gallery.astro +7 -0
- package/src/components/InlinePortableTextEditor.tsx +130 -1
- package/src/components/LiveSearch.astro +23 -0
- package/src/components/inline-code-block.tsx +180 -49
- package/src/content/converters/gallery.ts +2 -0
- package/src/content/converters/types.ts +2 -0
- package/src/database/connection.ts +2 -31
- package/src/database/index.ts +9 -3
- package/src/database/json-recordset.ts +16 -0
- package/src/database/migrations/019_i18n.ts +1 -1
- package/src/database/migrations/071_restore_content_bylines_table.ts +43 -0
- package/src/database/migrations/072_media_folders.ts +72 -0
- package/src/database/migrations/073_media_focal_point.ts +57 -0
- package/src/database/migrations/policy.ts +70 -0
- package/src/database/migrations/runner.ts +57 -5
- package/src/database/repositories/content.ts +5 -4
- package/src/database/repositories/media-folders.ts +115 -0
- package/src/database/repositories/media-usage-work.ts +395 -111
- package/src/database/repositories/media-usage.ts +1038 -10
- package/src/database/repositories/media.ts +97 -29
- package/src/database/transaction.ts +1 -0
- package/src/database/types.ts +13 -0
- package/src/db/adapters.ts +52 -4
- package/src/db/index.ts +3 -1
- package/src/db/libsql-migrations.ts +72 -0
- package/src/db/node-sqlite-compat.ts +78 -0
- package/src/db/postgres-migrations.ts +59 -0
- package/src/db/sqlite-migrations.ts +37 -0
- package/src/db/sqlite.ts +3 -3
- package/src/emdash-runtime.ts +154 -120
- package/src/fields/image.ts +7 -1
- package/src/fields/types.ts +6 -2
- package/src/i18n/normalize.ts +31 -0
- package/src/index.ts +12 -1
- package/src/media/focal-point.ts +37 -0
- package/src/media/local-runtime.ts +8 -0
- package/src/media/mime.ts +1 -0
- package/src/media/normalize.ts +10 -0
- package/src/media/types.ts +10 -0
- package/src/media/usage/activation.ts +162 -35
- package/src/media/usage/capture-triggers.ts +19 -3
- package/src/media/usage/collection-deletion-processor.ts +7 -3
- package/src/media/usage/collection-deletion.ts +10 -0
- package/src/media/usage/content-refresh.ts +258 -39
- package/src/media/usage/content-snapshots.ts +128 -31
- package/src/media/usage/extractor.ts +32 -13
- package/src/media/usage/maintenance-engine.ts +166 -0
- package/src/media/usage/reconciliation-processor.ts +106 -29
- package/src/media/usage/reconciliation.ts +90 -7
- package/src/media/usage/work-processor.ts +342 -101
- package/src/migrations/config-loader.ts +205 -0
- package/src/migrations/direct-executor.ts +141 -0
- package/src/migrations/identity.ts +46 -0
- package/src/migrations/index.ts +19 -0
- package/src/migrations/integration-metadata.ts +67 -0
- package/src/migrations/manifest-builder.ts +55 -0
- package/src/migrations/manifest-writer.ts +63 -0
- package/src/migrations/manifest.ts +197 -0
- package/src/migrations/protocol.ts +59 -0
- package/src/migrations/target.ts +35 -0
- package/src/plugins/index.ts +1 -0
- package/src/plugins/save-rejection.ts +20 -0
- package/src/plugins/scheduler/node.ts +1 -13
- package/src/plugins/scheduler/types.ts +0 -2
- package/src/plugins/state.ts +13 -3
- package/src/registry/artifact-fetch.ts +530 -0
- package/src/registry/config.ts +24 -6
- package/src/registry/types.ts +12 -15
- package/src/schema/types.ts +1 -0
- package/src/schema/zod-generator.ts +12 -4
- package/src/security/ssrf.ts +21 -2
- package/src/seed/apply.ts +4 -4
- package/src/ui.ts +2 -0
- package/src/virtual-modules.d.ts +8 -0
- package/dist/adapters-34EN2eXO.d.mts.map +0 -1
- package/dist/api-DdAsirBe.mjs.map +0 -1
- package/dist/collection-deletion-C8BugSGz.mjs.map +0 -1
- package/dist/content-BNfwh7xX.mjs.map +0 -1
- package/dist/content-refresh-DNERP4-f.mjs.map +0 -1
- package/dist/errors-CLUPm7aD.mjs.map +0 -1
- package/dist/index-C3Y-rsyN.d.mts.map +0 -1
- package/dist/media-BWWWb8kg.mjs.map +0 -1
- package/dist/media-CzhAn2--.mjs.map +0 -1
- package/dist/media-allowlist-BD6HhgXA.mjs.map +0 -1
- package/dist/media-usage-De3qvwjc.mjs.map +0 -1
- package/dist/media-usage-work-DrCbqBcl.mjs.map +0 -1
- package/dist/menus-CC-yn1F9.mjs.map +0 -1
- package/dist/mime-DfIVjNkr.mjs.map +0 -1
- package/dist/normalize-Bc-s_r-a.mjs.map +0 -1
- package/dist/placeholder-CzW7Lshs.d.mts.map +0 -1
- package/dist/registry-C581V4TP.mjs.map +0 -1
- package/dist/relations-DItI3MN9.d.mts.map +0 -1
- package/dist/runner-BiDvq5dv.mjs.map +0 -1
- package/dist/runner-CgQbELYC.d.mts.map +0 -1
- package/dist/state-DYwPue40.mjs.map +0 -1
- package/dist/types-C3_AbkDP.d.mts.map +0 -1
- package/dist/types-CAGdePf3.d.mts.map +0 -1
- package/dist/version-x0NjTScG.mjs +0 -7
- package/dist/zod-generator-D11MhxG4.mjs.map +0 -1
- /package/dist/{api-tokens-CyTsLszZ.mjs → api-tokens-B5NHLNUN.mjs} +0 -0
- /package/dist/{ssrf-DpXgKsna.mjs → ssrf-BPKzkm6O.mjs} +0 -0
- /package/dist/{types-CP1CflWf.mjs → types-D6OcIp2P.mjs} +0 -0
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import { resolveAndValidateExternalUrlTarget, SsrfError } from "../security/ssrf.js";
|
|
2
|
+
|
|
3
|
+
const TRAILING_DOT = /\.+$/;
|
|
4
|
+
const HEADER_END = new Uint8Array([13, 10, 13, 10]);
|
|
5
|
+
const CRLF = new Uint8Array([13, 10]);
|
|
6
|
+
const STATUS_LINE_RE = /^HTTP\/1\.[01] ([2-5][0-9]{2})(?: .*)?$/;
|
|
7
|
+
const HEADER_NAME_RE = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
8
|
+
const FOLDED_HEADER_RE = /^[ \t]/;
|
|
9
|
+
const CONTENT_LENGTH_RE = /^(0|[1-9][0-9]*)$/;
|
|
10
|
+
const CHUNK_SIZE_RE = /^[0-9A-Fa-f]+$/;
|
|
11
|
+
const MAX_HEADER_BYTES = 32 * 1024;
|
|
12
|
+
const LOCALHOST_HOSTNAMES = new Set([
|
|
13
|
+
"localhost",
|
|
14
|
+
"localhost.localdomain",
|
|
15
|
+
"ip6-localhost",
|
|
16
|
+
"ip6-loopback",
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
export interface RegistryArtifactTransportInput {
|
|
20
|
+
url: URL;
|
|
21
|
+
allowedAddresses: readonly string[];
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
maxResponseBytes: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface RegistryArtifactTransport {
|
|
27
|
+
fetch(input: RegistryArtifactTransportInput): Promise<{
|
|
28
|
+
response: Response;
|
|
29
|
+
connectedAddress: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface RegistryArtifactFetchOptions {
|
|
34
|
+
signal: AbortSignal;
|
|
35
|
+
maxResponseBytes: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let defaultTransport: RegistryArtifactTransport | null = null;
|
|
39
|
+
|
|
40
|
+
export function setDefaultRegistryArtifactTransport(
|
|
41
|
+
transport: RegistryArtifactTransport | null,
|
|
42
|
+
): RegistryArtifactTransport | null {
|
|
43
|
+
const previous = defaultTransport;
|
|
44
|
+
defaultTransport = transport;
|
|
45
|
+
return previous;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function isLocalhostHostname(hostname: string): boolean {
|
|
49
|
+
const normalized = hostname.toLowerCase().replace(TRAILING_DOT, "");
|
|
50
|
+
return (
|
|
51
|
+
LOCALHOST_HOSTNAMES.has(normalized) ||
|
|
52
|
+
normalized.endsWith(".localhost") ||
|
|
53
|
+
normalized === "127.0.0.1" ||
|
|
54
|
+
normalized === "::1" ||
|
|
55
|
+
normalized === "[::1]" ||
|
|
56
|
+
normalized.startsWith("::ffff:127.") ||
|
|
57
|
+
normalized.startsWith("::ffff:7f00:")
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function resolveSafeArtifactTarget(urlString: string): Promise<{
|
|
62
|
+
url: URL;
|
|
63
|
+
addresses: readonly string[];
|
|
64
|
+
}> {
|
|
65
|
+
let url: URL;
|
|
66
|
+
try {
|
|
67
|
+
url = new URL(urlString);
|
|
68
|
+
} catch {
|
|
69
|
+
throw new Error(`Invalid artifact URL: ${urlString}`);
|
|
70
|
+
}
|
|
71
|
+
if (url.protocol !== "https:" && url.protocol !== "http:") {
|
|
72
|
+
throw new Error(`Artifact URL protocol not allowed: ${url.protocol}`);
|
|
73
|
+
}
|
|
74
|
+
if (url.username || url.password) {
|
|
75
|
+
throw new Error("Artifact URL must not contain embedded credentials");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const rawHostname = url.hostname.toLowerCase().replace(TRAILING_DOT, "");
|
|
79
|
+
const hostname = stripIpv6Brackets(rawHostname);
|
|
80
|
+
const localhost = isLocalhostHostname(hostname);
|
|
81
|
+
|
|
82
|
+
if (!import.meta.env.DEV) {
|
|
83
|
+
if (url.protocol === "http:") {
|
|
84
|
+
throw new Error("Artifact URL must use https");
|
|
85
|
+
}
|
|
86
|
+
if (localhost) {
|
|
87
|
+
throw new Error(`Artifact URL points to localhost: ${hostname}`);
|
|
88
|
+
}
|
|
89
|
+
} else if (url.protocol === "http:" && !localhost) {
|
|
90
|
+
throw new Error("Artifact URL must use https (http allowed only for localhost in dev)");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (localhost) {
|
|
94
|
+
return { url, addresses: [] };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
return await resolveAndValidateExternalUrlTarget(url.href);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
if (error instanceof SsrfError) {
|
|
101
|
+
throw new Error(`Artifact URL rejected: ${error.message}`, { cause: error });
|
|
102
|
+
}
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export async function assertSafeArtifactUrl(urlString: string): Promise<URL> {
|
|
108
|
+
return (await resolveSafeArtifactTarget(urlString)).url;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export async function fetchRegistryArtifactUrl(
|
|
112
|
+
urlString: string,
|
|
113
|
+
options: RegistryArtifactFetchOptions,
|
|
114
|
+
): Promise<Response> {
|
|
115
|
+
if (!Number.isSafeInteger(options.maxResponseBytes) || options.maxResponseBytes < 0) {
|
|
116
|
+
throw new TypeError("Registry artifact response limit is invalid");
|
|
117
|
+
}
|
|
118
|
+
const target = await resolveSafeArtifactTarget(urlString);
|
|
119
|
+
if (target.addresses.length === 0) {
|
|
120
|
+
return globalThis.fetch(target.url, { redirect: "manual", signal: options.signal });
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const transport = defaultTransport ?? (await createRuntimeRegistryArtifactTransport());
|
|
124
|
+
const result = await transport.fetch({
|
|
125
|
+
url: target.url,
|
|
126
|
+
allowedAddresses: target.addresses,
|
|
127
|
+
signal: options.signal,
|
|
128
|
+
maxResponseBytes: options.maxResponseBytes,
|
|
129
|
+
});
|
|
130
|
+
if (!target.addresses.includes(result.connectedAddress)) {
|
|
131
|
+
await result.response.body?.cancel().catch(() => undefined);
|
|
132
|
+
throw new Error("Registry artifact transport connected outside the validated address set");
|
|
133
|
+
}
|
|
134
|
+
return result.response;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async function createRuntimeRegistryArtifactTransport(): Promise<RegistryArtifactTransport> {
|
|
138
|
+
try {
|
|
139
|
+
// @ts-ignore - virtual module
|
|
140
|
+
const sockets: unknown = await import("cloudflare:sockets");
|
|
141
|
+
const connect = objectProperty(sockets, "connect");
|
|
142
|
+
if (!isWorkerSocketConnect(connect)) throw new TypeError("Workers socket binding is invalid");
|
|
143
|
+
return createWorkersRegistryArtifactTransport(connect);
|
|
144
|
+
} catch {
|
|
145
|
+
return createNodeRegistryArtifactTransport();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface RegistryArtifactWorkerSocket {
|
|
150
|
+
readonly opened: Promise<unknown>;
|
|
151
|
+
readonly readable: ReadableStream<Uint8Array>;
|
|
152
|
+
readonly writable: WritableStream<Uint8Array>;
|
|
153
|
+
startTls(options: { expectedServerHostname: string }): RegistryArtifactWorkerSocket;
|
|
154
|
+
close(): Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type RegistryArtifactWorkerSocketConnect = (
|
|
158
|
+
address: { hostname: string; port: number },
|
|
159
|
+
options: { secureTransport: "starttls"; allowHalfOpen: false },
|
|
160
|
+
) => RegistryArtifactWorkerSocket;
|
|
161
|
+
|
|
162
|
+
export function createWorkersRegistryArtifactTransport(
|
|
163
|
+
connect: RegistryArtifactWorkerSocketConnect,
|
|
164
|
+
): RegistryArtifactTransport {
|
|
165
|
+
return {
|
|
166
|
+
async fetch(input) {
|
|
167
|
+
let lastError: unknown;
|
|
168
|
+
for (const address of input.allowedAddresses) {
|
|
169
|
+
if (input.signal.aborted) throw new Error("Registry artifact request was aborted");
|
|
170
|
+
let socket: RegistryArtifactWorkerSocket | undefined;
|
|
171
|
+
let tls: RegistryArtifactWorkerSocket | undefined;
|
|
172
|
+
try {
|
|
173
|
+
socket = connect(
|
|
174
|
+
{ hostname: address, port: parseHttpsPort(input.url) },
|
|
175
|
+
{ secureTransport: "starttls", allowHalfOpen: false },
|
|
176
|
+
);
|
|
177
|
+
await abortable(socket.opened, input.signal, () => socket?.close());
|
|
178
|
+
tls = socket.startTls({
|
|
179
|
+
expectedServerHostname: stripIpv6Brackets(input.url.hostname),
|
|
180
|
+
});
|
|
181
|
+
await abortable(tls.opened, input.signal, () => tls?.close());
|
|
182
|
+
const writer = tls.writable.getWriter();
|
|
183
|
+
try {
|
|
184
|
+
await abortable(writer.write(buildHttpRequest(input.url)), input.signal, () =>
|
|
185
|
+
tls?.close(),
|
|
186
|
+
);
|
|
187
|
+
} finally {
|
|
188
|
+
writer.releaseLock();
|
|
189
|
+
}
|
|
190
|
+
const bytes = await readWorkerSocketResponse(
|
|
191
|
+
tls,
|
|
192
|
+
input.maxResponseBytes + MAX_HEADER_BYTES,
|
|
193
|
+
input.signal,
|
|
194
|
+
);
|
|
195
|
+
await tls.close().catch(() => undefined);
|
|
196
|
+
return {
|
|
197
|
+
response: parsedResponseToWebResponse(
|
|
198
|
+
parsePinnedHttpResponse(bytes, input.maxResponseBytes),
|
|
199
|
+
),
|
|
200
|
+
connectedAddress: address,
|
|
201
|
+
};
|
|
202
|
+
} catch (error) {
|
|
203
|
+
await Promise.all([
|
|
204
|
+
tls?.close().catch(() => undefined),
|
|
205
|
+
socket?.close().catch(() => undefined),
|
|
206
|
+
]);
|
|
207
|
+
if (input.signal.aborted) throw error;
|
|
208
|
+
lastError = error;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
throw new Error("Registry artifact transport could not connect to an approved address", {
|
|
212
|
+
cause: lastError,
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function createNodeRegistryArtifactTransport(): Promise<RegistryArtifactTransport> {
|
|
219
|
+
const { request } = await import("node:https");
|
|
220
|
+
return {
|
|
221
|
+
async fetch(input) {
|
|
222
|
+
let lastError: unknown;
|
|
223
|
+
for (const address of input.allowedAddresses) {
|
|
224
|
+
try {
|
|
225
|
+
const response = await new Promise<Response>((resolve, reject) => {
|
|
226
|
+
const chunks: Uint8Array[] = [];
|
|
227
|
+
let total = 0;
|
|
228
|
+
const req = request(
|
|
229
|
+
{
|
|
230
|
+
protocol: "https:",
|
|
231
|
+
hostname: stripIpv6Brackets(input.url.hostname),
|
|
232
|
+
port: parseHttpsPort(input.url),
|
|
233
|
+
path: `${input.url.pathname}${input.url.search}`,
|
|
234
|
+
method: "GET",
|
|
235
|
+
// A pooled socket may have been opened for the same hostname
|
|
236
|
+
// before this address set was resolved.
|
|
237
|
+
agent: false,
|
|
238
|
+
headers: {
|
|
239
|
+
Host: input.url.host,
|
|
240
|
+
Connection: "close",
|
|
241
|
+
"Accept-Encoding": "identity",
|
|
242
|
+
},
|
|
243
|
+
lookup: (_hostname, _options, callback) => {
|
|
244
|
+
callback(null, address, address.includes(":") ? 6 : 4);
|
|
245
|
+
},
|
|
246
|
+
signal: input.signal,
|
|
247
|
+
},
|
|
248
|
+
(upstream) => {
|
|
249
|
+
const contentEncoding = upstream.headers["content-encoding"];
|
|
250
|
+
if (contentEncoding && contentEncoding.toLowerCase() !== "identity") {
|
|
251
|
+
upstream.destroy(
|
|
252
|
+
new Error("Registry artifact response content encoding is unsupported"),
|
|
253
|
+
);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
upstream.on("data", (chunk: Uint8Array) => {
|
|
257
|
+
total += chunk.byteLength;
|
|
258
|
+
if (total > input.maxResponseBytes) {
|
|
259
|
+
upstream.destroy(
|
|
260
|
+
new RangeError("Registry artifact response exceeds its byte limit"),
|
|
261
|
+
);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
chunks.push(new Uint8Array(chunk));
|
|
265
|
+
});
|
|
266
|
+
upstream.once("error", reject);
|
|
267
|
+
upstream.once("end", () => {
|
|
268
|
+
const bytes = concatBytes(chunks, total);
|
|
269
|
+
const headers = new Headers();
|
|
270
|
+
for (let index = 0; index < upstream.rawHeaders.length; index += 2) {
|
|
271
|
+
headers.append(upstream.rawHeaders[index], upstream.rawHeaders[index + 1]);
|
|
272
|
+
}
|
|
273
|
+
resolve(
|
|
274
|
+
parsedResponseToWebResponse({
|
|
275
|
+
status: upstream.statusCode ?? 502,
|
|
276
|
+
headers,
|
|
277
|
+
body: bytes,
|
|
278
|
+
}),
|
|
279
|
+
);
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
);
|
|
283
|
+
req.once("error", reject);
|
|
284
|
+
req.end();
|
|
285
|
+
});
|
|
286
|
+
return { response, connectedAddress: address };
|
|
287
|
+
} catch (error) {
|
|
288
|
+
if (input.signal.aborted) throw error;
|
|
289
|
+
lastError = error;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
throw new Error("Registry artifact transport could not connect to an approved address", {
|
|
293
|
+
cause: lastError,
|
|
294
|
+
});
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface ParsedHttpResponse {
|
|
300
|
+
status: number;
|
|
301
|
+
headers: Headers;
|
|
302
|
+
body: Uint8Array;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function parsePinnedHttpResponse(bytes: Uint8Array, maxResponseBytes: number): ParsedHttpResponse {
|
|
306
|
+
const headerEnd = findSequence(bytes, HEADER_END, 0);
|
|
307
|
+
if (headerEnd === -1 || headerEnd > MAX_HEADER_BYTES) {
|
|
308
|
+
throw new Error("Registry artifact response headers are invalid or too large");
|
|
309
|
+
}
|
|
310
|
+
const headerText = new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(0, headerEnd));
|
|
311
|
+
const lines = headerText.split("\r\n");
|
|
312
|
+
const statusMatch = STATUS_LINE_RE.exec(lines.shift() ?? "");
|
|
313
|
+
if (!statusMatch) throw new Error("Registry artifact response status line is invalid");
|
|
314
|
+
const headers = new Headers();
|
|
315
|
+
const rawHeaders = new Map<string, string[]>();
|
|
316
|
+
for (const line of lines) {
|
|
317
|
+
if (FOLDED_HEADER_RE.test(line)) {
|
|
318
|
+
throw new Error("Registry artifact response uses folded headers");
|
|
319
|
+
}
|
|
320
|
+
const separator = line.indexOf(":");
|
|
321
|
+
if (separator < 1) throw new Error("Registry artifact response header is invalid");
|
|
322
|
+
const name = line.slice(0, separator);
|
|
323
|
+
const value = line.slice(separator + 1).trim();
|
|
324
|
+
if (!HEADER_NAME_RE.test(name) || containsInvalidHeaderValue(value)) {
|
|
325
|
+
throw new Error("Registry artifact response header is invalid");
|
|
326
|
+
}
|
|
327
|
+
const normalized = name.toLowerCase();
|
|
328
|
+
const values = rawHeaders.get(normalized) ?? [];
|
|
329
|
+
values.push(value);
|
|
330
|
+
rawHeaders.set(normalized, values);
|
|
331
|
+
headers.append(name, value);
|
|
332
|
+
}
|
|
333
|
+
const contentEncoding = rawHeaders.get("content-encoding");
|
|
334
|
+
if (
|
|
335
|
+
contentEncoding &&
|
|
336
|
+
(contentEncoding.length !== 1 || contentEncoding[0]?.toLowerCase() !== "identity")
|
|
337
|
+
) {
|
|
338
|
+
throw new Error("Registry artifact response content encoding is unsupported");
|
|
339
|
+
}
|
|
340
|
+
const contentLength = rawHeaders.get("content-length");
|
|
341
|
+
const transferEncoding = rawHeaders.get("transfer-encoding");
|
|
342
|
+
if (contentLength && transferEncoding) {
|
|
343
|
+
throw new Error("Registry artifact response framing is ambiguous");
|
|
344
|
+
}
|
|
345
|
+
const bodyBytes = bytes.subarray(headerEnd + HEADER_END.length);
|
|
346
|
+
let body: Uint8Array;
|
|
347
|
+
if (transferEncoding) {
|
|
348
|
+
if (transferEncoding.length !== 1 || transferEncoding[0]?.toLowerCase() !== "chunked") {
|
|
349
|
+
throw new Error("Registry artifact response transfer encoding is unsupported");
|
|
350
|
+
}
|
|
351
|
+
body = decodeChunkedBody(bodyBytes, maxResponseBytes);
|
|
352
|
+
} else if (contentLength) {
|
|
353
|
+
if (contentLength.length !== 1 || !CONTENT_LENGTH_RE.test(contentLength[0])) {
|
|
354
|
+
throw new Error("Registry artifact response content length is invalid");
|
|
355
|
+
}
|
|
356
|
+
const length = Number(contentLength[0]);
|
|
357
|
+
if (!Number.isSafeInteger(length) || length !== bodyBytes.byteLength) {
|
|
358
|
+
throw new Error("Registry artifact response body length does not match its framing");
|
|
359
|
+
}
|
|
360
|
+
body = new Uint8Array(bodyBytes);
|
|
361
|
+
} else {
|
|
362
|
+
body = new Uint8Array(bodyBytes);
|
|
363
|
+
}
|
|
364
|
+
if (body.byteLength > maxResponseBytes) {
|
|
365
|
+
throw new RangeError("Registry artifact response exceeds its byte limit");
|
|
366
|
+
}
|
|
367
|
+
return { status: Number(statusMatch[1]), headers, body };
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function parsedResponseToWebResponse(parsed: ParsedHttpResponse): Response {
|
|
371
|
+
const bodyAllowed = ![204, 205, 304].includes(parsed.status);
|
|
372
|
+
let body: ArrayBuffer | null = null;
|
|
373
|
+
if (bodyAllowed) {
|
|
374
|
+
body = new ArrayBuffer(parsed.body.byteLength);
|
|
375
|
+
new Uint8Array(body).set(parsed.body);
|
|
376
|
+
}
|
|
377
|
+
return new Response(body, {
|
|
378
|
+
status: parsed.status,
|
|
379
|
+
headers: parsed.headers,
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function buildHttpRequest(url: URL): Uint8Array {
|
|
384
|
+
return new TextEncoder().encode(
|
|
385
|
+
[
|
|
386
|
+
`GET ${url.pathname}${url.search} HTTP/1.1`,
|
|
387
|
+
`Host: ${url.host}`,
|
|
388
|
+
"Connection: close",
|
|
389
|
+
"Accept-Encoding: identity",
|
|
390
|
+
"",
|
|
391
|
+
"",
|
|
392
|
+
].join("\r\n"),
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async function readWorkerSocketResponse(
|
|
397
|
+
socket: RegistryArtifactWorkerSocket,
|
|
398
|
+
maximumBytes: number,
|
|
399
|
+
signal: AbortSignal,
|
|
400
|
+
): Promise<Uint8Array> {
|
|
401
|
+
const reader = socket.readable.getReader();
|
|
402
|
+
const chunks: Uint8Array[] = [];
|
|
403
|
+
let total = 0;
|
|
404
|
+
try {
|
|
405
|
+
for (;;) {
|
|
406
|
+
const next = await abortable(reader.read(), signal, () => socket.close());
|
|
407
|
+
if (next.done) break;
|
|
408
|
+
total += next.value.byteLength;
|
|
409
|
+
if (total > maximumBytes) {
|
|
410
|
+
throw new RangeError("Registry artifact response exceeds its byte limit");
|
|
411
|
+
}
|
|
412
|
+
chunks.push(next.value);
|
|
413
|
+
}
|
|
414
|
+
} finally {
|
|
415
|
+
reader.releaseLock();
|
|
416
|
+
}
|
|
417
|
+
return concatBytes(chunks, total);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function decodeChunkedBody(bytes: Uint8Array, maximumBytes: number): Uint8Array {
|
|
421
|
+
const chunks: Uint8Array[] = [];
|
|
422
|
+
let offset = 0;
|
|
423
|
+
let total = 0;
|
|
424
|
+
for (;;) {
|
|
425
|
+
const lineEnd = findSequence(bytes, CRLF, offset);
|
|
426
|
+
if (lineEnd === -1 || lineEnd - offset > 128) {
|
|
427
|
+
throw new Error("Registry artifact chunk size line is invalid");
|
|
428
|
+
}
|
|
429
|
+
const sizeText = new TextDecoder().decode(bytes.subarray(offset, lineEnd)).split(";", 1)[0];
|
|
430
|
+
if (!sizeText || !CHUNK_SIZE_RE.test(sizeText)) {
|
|
431
|
+
throw new Error("Registry artifact chunk size is invalid");
|
|
432
|
+
}
|
|
433
|
+
const size = Number.parseInt(sizeText, 16);
|
|
434
|
+
if (!Number.isSafeInteger(size)) throw new Error("Registry artifact chunk size is invalid");
|
|
435
|
+
offset = lineEnd + CRLF.length;
|
|
436
|
+
if (size === 0) {
|
|
437
|
+
if (
|
|
438
|
+
offset + CRLF.length !== bytes.length ||
|
|
439
|
+
bytes[offset] !== 13 ||
|
|
440
|
+
bytes[offset + 1] !== 10
|
|
441
|
+
) {
|
|
442
|
+
throw new Error("Registry artifact chunk trailer is invalid");
|
|
443
|
+
}
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
if (offset + size + CRLF.length > bytes.length) {
|
|
447
|
+
throw new Error("Registry artifact chunk body is truncated");
|
|
448
|
+
}
|
|
449
|
+
if (bytes[offset + size] !== 13 || bytes[offset + size + 1] !== 10) {
|
|
450
|
+
throw new Error("Registry artifact chunk delimiter is invalid");
|
|
451
|
+
}
|
|
452
|
+
total += size;
|
|
453
|
+
if (total > maximumBytes) {
|
|
454
|
+
throw new RangeError("Registry artifact response exceeds its byte limit");
|
|
455
|
+
}
|
|
456
|
+
chunks.push(new Uint8Array(bytes.subarray(offset, offset + size)));
|
|
457
|
+
offset += size + CRLF.length;
|
|
458
|
+
}
|
|
459
|
+
return concatBytes(chunks, total);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function findSequence(bytes: Uint8Array, sequence: Uint8Array, start: number): number {
|
|
463
|
+
outer: for (let offset = start; offset <= bytes.length - sequence.length; offset += 1) {
|
|
464
|
+
for (let index = 0; index < sequence.length; index += 1) {
|
|
465
|
+
if (bytes[offset + index] !== sequence[index]) continue outer;
|
|
466
|
+
}
|
|
467
|
+
return offset;
|
|
468
|
+
}
|
|
469
|
+
return -1;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function concatBytes(chunks: readonly Uint8Array[], total: number): Uint8Array {
|
|
473
|
+
const bytes = new Uint8Array(total);
|
|
474
|
+
let offset = 0;
|
|
475
|
+
for (const chunk of chunks) {
|
|
476
|
+
bytes.set(chunk, offset);
|
|
477
|
+
offset += chunk.byteLength;
|
|
478
|
+
}
|
|
479
|
+
return bytes;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function containsInvalidHeaderValue(value: string): boolean {
|
|
483
|
+
for (const character of value) {
|
|
484
|
+
const code = character.codePointAt(0)!;
|
|
485
|
+
if (code === 0 || code === 10 || code === 13) return true;
|
|
486
|
+
}
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function parseHttpsPort(url: URL): number {
|
|
491
|
+
const port = url.port === "" ? 443 : Number(url.port);
|
|
492
|
+
if (!Number.isSafeInteger(port) || port < 1 || port > 65_535) {
|
|
493
|
+
throw new TypeError("Registry artifact HTTPS port is invalid");
|
|
494
|
+
}
|
|
495
|
+
return port;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function stripIpv6Brackets(hostname: string): string {
|
|
499
|
+
return hostname.startsWith("[") && hostname.endsWith("]") ? hostname.slice(1, -1) : hostname;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function objectProperty(value: unknown, key: string): unknown {
|
|
503
|
+
if (typeof value !== "object" || value === null) return undefined;
|
|
504
|
+
return Object.getOwnPropertyDescriptor(value, key)?.value;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
function isWorkerSocketConnect(value: unknown): value is RegistryArtifactWorkerSocketConnect {
|
|
508
|
+
return typeof value === "function";
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
async function abortable<T>(
|
|
512
|
+
operation: Promise<T>,
|
|
513
|
+
signal: AbortSignal,
|
|
514
|
+
onAbort: () => void | Promise<void>,
|
|
515
|
+
): Promise<T> {
|
|
516
|
+
if (signal.aborted) throw new Error("Registry artifact request was aborted");
|
|
517
|
+
let abort: (() => void) | undefined;
|
|
518
|
+
const aborted = new Promise<never>((_resolve, reject) => {
|
|
519
|
+
abort = () => {
|
|
520
|
+
void onAbort();
|
|
521
|
+
reject(new Error("Registry artifact request was aborted"));
|
|
522
|
+
};
|
|
523
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
524
|
+
});
|
|
525
|
+
try {
|
|
526
|
+
return await Promise.race([operation, aborted]);
|
|
527
|
+
} finally {
|
|
528
|
+
if (abort) signal.removeEventListener("abort", abort);
|
|
529
|
+
}
|
|
530
|
+
}
|
package/src/registry/config.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* seconds so the browser doesn't need a duration parser.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import { isDid } from "@atcute/lexicons/syntax";
|
|
12
|
+
|
|
11
13
|
import type { RegistryConfig, RegistryConfigInput } from "./types.js";
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -24,10 +26,12 @@ export interface ManifestRegistryConfig {
|
|
|
24
26
|
* Allowlist of publishers / packages exempt from the
|
|
25
27
|
* {@link minimumReleaseAgeSeconds} holdback. Each entry is either:
|
|
26
28
|
*
|
|
27
|
-
* - A bare publisher
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* - A bare publisher DID: `"did:plc:abc123"`. Every package from
|
|
30
|
+
* that publisher is exempt.
|
|
31
|
+
* - A `<did>/<slug>` pair: only that specific package is exempt.
|
|
32
|
+
*
|
|
33
|
+
* Handles are not accepted because they are mutable
|
|
34
|
+
* aggregator-supplied envelope data.
|
|
31
35
|
*
|
|
32
36
|
* Normalized to lowercase strings at config load time so the
|
|
33
37
|
* browser does case-insensitive comparison. See
|
|
@@ -110,6 +114,8 @@ const TRAILING_SLASHES = /\/+$/;
|
|
|
110
114
|
/** Trailing dot on a hostname, stripped before URL host comparisons. */
|
|
111
115
|
const TRAILING_DOT = /\.$/;
|
|
112
116
|
|
|
117
|
+
const REGISTRY_PACKAGE_SLUG_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
118
|
+
|
|
113
119
|
/**
|
|
114
120
|
* Parse a duration string or raw second count into a non-negative
|
|
115
121
|
* integer count of seconds. Throws on unrecognised input so config
|
|
@@ -157,7 +163,7 @@ export function parseDurationSeconds(duration: string | number): number {
|
|
|
157
163
|
* required in production; `http://localhost` allowed only in dev.
|
|
158
164
|
*
|
|
159
165
|
* The aggregator's responses are the trust source for release records,
|
|
160
|
-
* checksums, labels,
|
|
166
|
+
* checksums, labels, artifact cache descriptors, and `indexedAt` (until full MST
|
|
161
167
|
* verification lands). Allowing plain HTTP here would let a network
|
|
162
168
|
* attacker swap a release record and point the artifact URL at their
|
|
163
169
|
* own HTTPS bundle, defeating the checksum trust chain because the
|
|
@@ -295,7 +301,19 @@ export function normalizeRegistryConfig(
|
|
|
295
301
|
if (!trimmed) {
|
|
296
302
|
throw new Error("registry.policy.minimumReleaseAgeExclude entries cannot be empty");
|
|
297
303
|
}
|
|
298
|
-
|
|
304
|
+
const lower = trimmed.toLowerCase();
|
|
305
|
+
const [did, slug, ...extra] = lower.split("/");
|
|
306
|
+
if (
|
|
307
|
+
!did ||
|
|
308
|
+
!isDid(did) ||
|
|
309
|
+
extra.length > 0 ||
|
|
310
|
+
(slug !== undefined && !REGISTRY_PACKAGE_SLUG_PATTERN.test(slug))
|
|
311
|
+
) {
|
|
312
|
+
throw new Error(
|
|
313
|
+
`registry.policy.minimumReleaseAgeExclude entry must be a DID or <did>/<slug>: ${trimmed}`,
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
return lower;
|
|
299
317
|
});
|
|
300
318
|
if (list.length > 0) {
|
|
301
319
|
policy.minimumReleaseAgeExclude = list;
|
package/src/registry/types.ts
CHANGED
|
@@ -29,15 +29,13 @@ export interface RegistryConfig {
|
|
|
29
29
|
aggregatorUrl: string;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Optional comma-separated list of labeller DIDs forwarded as the
|
|
33
|
-
* `atproto-accept-labelers` header on every aggregator request.
|
|
32
|
+
* Optional comma-separated list of bare labeller DIDs forwarded as the
|
|
33
|
+
* `atproto-accept-labelers` header on every aggregator request. The
|
|
34
|
+
* declaration contributes to the client's cache identity.
|
|
34
35
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* When unset, the aggregator applies its operator-default labeller set
|
|
39
|
-
* (typically the EmDash publisher-verification labeller and any
|
|
40
|
-
* additional trusted labellers the aggregator operator configured).
|
|
36
|
+
* The aggregator validates the declaration and rejects unknown sources or
|
|
37
|
+
* a list that omits a required source. It does not let the declaration
|
|
38
|
+
* override its configured approval, block, takedown, or withdrawal policy.
|
|
41
39
|
*/
|
|
42
40
|
acceptLabelers?: string;
|
|
43
41
|
|
|
@@ -157,8 +155,8 @@ export interface ExperimentalConfig {
|
|
|
157
155
|
* release:
|
|
158
156
|
*
|
|
159
157
|
* - The publisher DID associated with a `(did, slug)` pair.
|
|
160
|
-
* - The artifact
|
|
161
|
-
*
|
|
158
|
+
* - The artifact source fields, checksum, and cache services returned for
|
|
159
|
+
* a release.
|
|
162
160
|
* - The published handle for a DID (used for display only;
|
|
163
161
|
* EmDash separately verifies the DID->handle round-trip in the
|
|
164
162
|
* admin UI before treating a handle as confirmed).
|
|
@@ -167,7 +165,7 @@ export interface ExperimentalConfig {
|
|
|
167
165
|
* installed plugin:
|
|
168
166
|
*
|
|
169
167
|
* - The artifact bytes hash to the checksum the aggregator
|
|
170
|
-
* returned (so a malicious
|
|
168
|
+
* returned (so a malicious cache or in-transit tamper can't
|
|
171
169
|
* swap the bundle).
|
|
172
170
|
* - The bundle's `manifest.id` matches the requested slug, and
|
|
173
171
|
* its `manifest.version` matches the release version (so an
|
|
@@ -190,10 +188,9 @@ export interface ExperimentalConfig {
|
|
|
190
188
|
* **Recommendation.** Until full signature verification lands,
|
|
191
189
|
* point `aggregatorUrl` only at an aggregator you operate
|
|
192
190
|
* yourself or one you trust with the same level of authority as
|
|
193
|
-
* a centralized plugin source.
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* system is operating.
|
|
191
|
+
* a centralized plugin source. `policy.minimumReleaseAge` widens
|
|
192
|
+
* the detection window for takedowns. `acceptLabelers` declares a
|
|
193
|
+
* request and cache identity; it does not change aggregator policy.
|
|
197
194
|
*
|
|
198
195
|
* Requires `sandboxRunner` to be configured -- registry plugins
|
|
199
196
|
* always run sandboxed.
|
package/src/schema/types.ts
CHANGED
|
@@ -167,6 +167,7 @@ export interface FieldValidation {
|
|
|
167
167
|
export interface FieldWidgetOptions {
|
|
168
168
|
rows?: number; // For textarea
|
|
169
169
|
showPreview?: boolean; // For image/file
|
|
170
|
+
darkVariant?: boolean; // For image: offer a second slot for a dark-color-scheme counterpart
|
|
170
171
|
collection?: string; // For reference - which collection to reference
|
|
171
172
|
allowMultiple?: boolean; // For reference
|
|
172
173
|
[key: string]: unknown;
|
|
@@ -135,8 +135,8 @@ function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodTy
|
|
|
135
135
|
.passthrough(),
|
|
136
136
|
);
|
|
137
137
|
|
|
138
|
-
case "image":
|
|
139
|
-
|
|
138
|
+
case "image": {
|
|
139
|
+
const mediaSchema = z.object({
|
|
140
140
|
id: z.string(),
|
|
141
141
|
src: z.string().optional(),
|
|
142
142
|
alt: z.string().optional(),
|
|
@@ -153,6 +153,11 @@ function getBaseSchema(type: FieldType, field: Pick<Field, "validation">): ZodTy
|
|
|
153
153
|
/** Provider-specific metadata; for local media this carries storageKey */
|
|
154
154
|
meta: z.record(z.string(), z.unknown()).optional(),
|
|
155
155
|
});
|
|
156
|
+
return mediaSchema.extend({
|
|
157
|
+
/** Counterpart shown when the page renders in a dark color scheme */
|
|
158
|
+
darkVariant: mediaSchema.optional(),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
156
161
|
|
|
157
162
|
case "file":
|
|
158
163
|
return z.object({
|
|
@@ -483,8 +488,11 @@ function fieldTypeToTypeScript(field: {
|
|
|
483
488
|
case "portableText":
|
|
484
489
|
return "PortableTextBlock[]";
|
|
485
490
|
|
|
486
|
-
case "image":
|
|
487
|
-
|
|
491
|
+
case "image": {
|
|
492
|
+
const media =
|
|
493
|
+
"{ id: string; src?: string; alt?: string; width?: number; height?: number; filename?: string; mimeType?: string; blurhash?: string; dominantColor?: string; provider?: string; previewUrl?: string; meta?: Record<string, unknown> }";
|
|
494
|
+
return `${media.slice(0, -2)}; darkVariant?: ${media} }`;
|
|
495
|
+
}
|
|
488
496
|
|
|
489
497
|
case "file":
|
|
490
498
|
return "{ id: string; url?: string; src?: string; filename?: string; mimeType?: string; size?: number; provider?: string; meta?: Record<string, unknown> }";
|