emdash 0.37.0 → 0.39.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/action-token-On1sot_c.mjs +26 -0
- package/dist/action-token-On1sot_c.mjs.map +1 -0
- package/dist/activation-CaMfdBt1.mjs +382 -0
- package/dist/activation-CaMfdBt1.mjs.map +1 -0
- package/dist/adapters-Cq10K4_c.d.mts +171 -0
- package/dist/adapters-Cq10K4_c.d.mts.map +1 -0
- package/dist/after-PcEvMY_6.mjs +96 -0
- package/dist/after-PcEvMY_6.mjs.map +1 -0
- package/dist/allowed-origins-1Sa-2wZK.mjs +116 -0
- package/dist/allowed-origins-1Sa-2wZK.mjs.map +1 -0
- package/dist/api/route-utils.d.mts +4 -3
- package/dist/api/route-utils.d.mts.map +1 -1
- package/dist/api/route-utils.mjs +45 -29
- package/dist/api/route-utils.mjs.map +1 -1
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +7 -6
- package/dist/api-DmjKxPCY.mjs +4831 -0
- package/dist/api-DmjKxPCY.mjs.map +1 -0
- package/dist/api-tokens-BIXItFKV.mjs +163 -0
- package/dist/api-tokens-BIXItFKV.mjs.map +1 -0
- package/dist/apply-drpfmqrR.mjs +1005 -0
- package/dist/apply-drpfmqrR.mjs.map +1 -0
- package/dist/artifact-fetch-COiMhVgk.mjs +813 -0
- package/dist/artifact-fetch-COiMhVgk.mjs.map +1 -0
- package/dist/astro/index.d.mts +14 -12
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +123 -13
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +12 -10
- package/dist/astro/middleware/auth.d.mts.map +1 -1
- package/dist/astro/middleware/auth.mjs +20 -11
- package/dist/astro/middleware/auth.mjs.map +1 -1
- package/dist/astro/middleware/media-usage-write-fence.mjs +5 -5
- package/dist/astro/middleware/redirect.mjs +11 -9
- package/dist/astro/middleware/redirect.mjs.map +1 -1
- package/dist/astro/middleware/request-context.d.mts +1 -1
- package/dist/astro/middleware/request-context.d.mts.map +1 -1
- package/dist/astro/middleware/request-context.mjs +154 -28
- package/dist/astro/middleware/request-context.mjs.map +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.d.mts +13 -10
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +122 -3041
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +10 -9
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +10 -9
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +6 -6
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +13 -12
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +13 -12
- package/dist/astro/routes/api/admin/byline-fields/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +13 -12
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -21
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -21
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/admin/bylines/index.mjs +22 -21
- package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +21 -54
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/bulk.mjs +15 -14
- package/dist/astro/routes/api/admin/comments/bulk.mjs.map +1 -1
- package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
- package/dist/astro/routes/api/admin/comments/index.mjs +15 -14
- package/dist/astro/routes/api/admin/comments/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +5 -5
- package/dist/astro/routes/api/admin/media-usage/activation.mjs +17 -16
- package/dist/astro/routes/api/admin/media-usage/activation.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +19 -18
- 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 +19 -18
- package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/progress.mjs +17 -17
- package/dist/astro/routes/api/admin/media-usage/repair.mjs +21 -20
- package/dist/astro/routes/api/admin/media-usage/repair.mjs.map +1 -1
- package/dist/astro/routes/api/admin/media-usage/work/index.mjs +19 -18
- 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 +19 -18
- package/dist/astro/routes/api/admin/media-usage/work/retry.mjs.map +1 -1
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
- package/dist/astro/routes/api/admin/plugins/_id_/disable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +9 -66
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +9 -69
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +66 -59
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +65 -59
- package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +70 -61
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +87 -63
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/index.mjs +66 -59
- package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +4 -4
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +65 -59
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +85 -63
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +65 -59
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +70 -61
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
- 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 +90 -66
- 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 +9 -7
- 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 +77 -63
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +67 -61
- package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +66 -60
- package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts +8 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +27 -0
- package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs.map +1 -0
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +65 -59
- 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 +4 -4
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +65 -59
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +4 -4
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +11 -10
- package/dist/astro/routes/api/admin/users/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
- package/dist/astro/routes/api/admin/users/index.mjs +10 -9
- package/dist/astro/routes/api/admin/users/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
- package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/complete.mjs +15 -14
- package/dist/astro/routes/api/auth/invite/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/index.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs.map +1 -1
- package/dist/astro/routes/api/auth/invite/register-options.mjs +14 -13
- package/dist/astro/routes/api/auth/invite/register-options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/logout.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/send.mjs +14 -13
- package/dist/astro/routes/api/auth/magic-link/send.mjs.map +1 -1
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +4 -4
- package/dist/astro/routes/api/auth/me.mjs +11 -10
- package/dist/astro/routes/api/auth/me.mjs.map +1 -1
- package/dist/astro/routes/api/auth/mode.mjs +4 -4
- 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 +10 -9
- package/dist/astro/routes/api/auth/passkey/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/options.mjs +16 -15
- package/dist/astro/routes/api/auth/passkey/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +14 -13
- package/dist/astro/routes/api/auth/passkey/register/options.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +15 -14
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/passkey/verify.mjs +15 -14
- package/dist/astro/routes/api/auth/passkey/verify.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/complete.mjs +15 -14
- package/dist/astro/routes/api/auth/signup/complete.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/request.mjs +14 -13
- package/dist/astro/routes/api/auth/signup/request.mjs.map +1 -1
- package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -211
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs.map +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +18 -17
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
- 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 +17 -11
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts +10 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +67 -0
- package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts +8 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.d.mts.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +35 -0
- package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs.map +1 -0
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +16 -15
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts +9 -2
- package/dist/astro/routes/api/content/_collection_/_id_/publish.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +28 -16
- 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 +27 -23
- 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 +27 -23
- 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 +5 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +27 -12
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +23 -20
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +25 -12
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +27 -14
- package/dist/astro/routes/api/content/_collection_/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +18 -12
- package/dist/astro/routes/api/content/_collection_/index.mjs.map +1 -1
- package/dist/astro/routes/api/content/_collection_/trash.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/trash.mjs.map +1 -1
- package/dist/astro/routes/api/dashboard.mjs +14 -12
- package/dist/astro/routes/api/dashboard.mjs.map +1 -1
- package/dist/astro/routes/api/dev/emails.mjs +4 -4
- package/dist/astro/routes/api/health.d.mts +8 -0
- package/dist/astro/routes/api/health.d.mts.map +1 -0
- package/dist/astro/routes/api/health.mjs +21 -0
- package/dist/astro/routes/api/health.mjs.map +1 -0
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +25 -23
- package/dist/astro/routes/api/import/probe.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +5 -5
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -11
- package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +20 -19
- package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -10
- package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +15 -14
- package/dist/astro/routes/api/import/wordpress/media.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +14 -13
- package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -11
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +18 -17
- 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 +25 -23
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -11
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +36 -33
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
- package/dist/astro/routes/api/manifest.mjs +17 -9
- package/dist/astro/routes/api/manifest.mjs.map +1 -1
- package/dist/astro/routes/api/mcp.d.mts.map +1 -1
- package/dist/astro/routes/api/mcp.mjs +192 -110
- package/dist/astro/routes/api/mcp.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/confirm.mjs +15 -14
- package/dist/astro/routes/api/media/_id_/confirm.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/replace.mjs +12 -11
- package/dist/astro/routes/api/media/_id_/replace.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_/upload.mjs +8 -8
- package/dist/astro/routes/api/media/_id_/usage.mjs +23 -22
- package/dist/astro/routes/api/media/_id_/usage.mjs.map +1 -1
- package/dist/astro/routes/api/media/_id_.mjs +22 -21
- package/dist/astro/routes/api/media/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts +8 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.d.mts.map +1 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +52 -0
- package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs.map +1 -0
- package/dist/astro/routes/api/media/file/_...key_.mjs +3 -3
- package/dist/astro/routes/api/media/folders/_id_.mjs +12 -11
- package/dist/astro/routes/api/media/folders/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/media/folders/index.mjs +12 -11
- package/dist/astro/routes/api/media/folders/index.mjs.map +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
- package/dist/astro/routes/api/media/providers/index.mjs +4 -4
- package/dist/astro/routes/api/media/upload-url.mjs +14 -13
- package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
- package/dist/astro/routes/api/media.mjs +26 -25
- package/dist/astro/routes/api/media.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/items.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_/translations.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/menus/_name_.mjs +15 -14
- package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/menus/index.mjs +15 -14
- 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 +7 -7
- package/dist/astro/routes/api/oauth/device/code.mjs +10 -10
- package/dist/astro/routes/api/oauth/device/token.mjs +9 -9
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
- package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
- package/dist/astro/routes/api/oauth/token.mjs +7 -7
- package/dist/astro/routes/api/openapi.json.mjs +95 -24
- package/dist/astro/routes/api/openapi.json.mjs.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts +2 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.d.mts.map +1 -1
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +22 -40
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/index.mjs +18 -14
- package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/404s/summary.mjs +18 -14
- package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.d.mts.map +1 -1
- package/dist/astro/routes/api/redirects/_id_.mjs +20 -22
- package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/redirects/index.d.mts.map +1 -1
- package/dist/astro/routes/api/redirects/index.mjs +19 -19
- package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/index.mjs +27 -23
- package/dist/astro/routes/api/relations/_id_/index.mjs.map +1 -1
- package/dist/astro/routes/api/relations/_id_/translations.mjs +21 -18
- package/dist/astro/routes/api/relations/_id_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/relations/index.mjs +27 -23
- package/dist/astro/routes/api/relations/index.mjs.map +1 -1
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +5 -5
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +65 -59
- 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 +65 -59
- 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 +65 -59
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +65 -59
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/index.mjs +65 -59
- package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/collections/reorder.mjs +65 -59
- package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/schema/index.mjs +16 -14
- package/dist/astro/routes/api/schema/index.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +65 -59
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/schema/orphans/index.mjs +65 -59
- package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/enable.mjs +16 -14
- package/dist/astro/routes/api/search/enable.mjs.map +1 -1
- package/dist/astro/routes/api/search/index.mjs +17 -14
- package/dist/astro/routes/api/search/index.mjs.map +1 -1
- package/dist/astro/routes/api/search/rebuild.mjs +16 -14
- package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
- package/dist/astro/routes/api/search/stats.mjs +10 -9
- package/dist/astro/routes/api/search/stats.mjs.map +1 -1
- package/dist/astro/routes/api/search/suggest.mjs +15 -13
- package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
- package/dist/astro/routes/api/sections/_slug_.mjs +15 -13
- package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/sections/index.mjs +15 -13
- package/dist/astro/routes/api/sections/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +9 -8
- package/dist/astro/routes/api/settings/backups/archives/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -7
- package/dist/astro/routes/api/settings/backups/archives/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/export.mjs +9 -8
- package/dist/astro/routes/api/settings/backups/export.mjs.map +1 -1
- package/dist/astro/routes/api/settings/backups/index.mjs +10 -9
- package/dist/astro/routes/api/settings/backups/index.mjs.map +1 -1
- package/dist/astro/routes/api/settings/email.mjs +6 -6
- package/dist/astro/routes/api/settings.mjs +22 -20
- package/dist/astro/routes/api/settings.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin-verify.mjs +16 -15
- package/dist/astro/routes/api/setup/admin-verify.mjs.map +1 -1
- package/dist/astro/routes/api/setup/admin.mjs +15 -14
- package/dist/astro/routes/api/setup/admin.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-bypass.mjs +42 -38
- package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
- package/dist/astro/routes/api/setup/dev-reset.mjs +4 -4
- package/dist/astro/routes/api/setup/index.mjs +43 -38
- package/dist/astro/routes/api/setup/index.mjs.map +1 -1
- package/dist/astro/routes/api/setup/status.mjs +5 -5
- package/dist/astro/routes/api/snapshot.mjs +11 -10
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +22 -20
- package/dist/astro/routes/api/taxonomies/_name_/translations.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/_name_.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/index.mjs +23 -21
- package/dist/astro/routes/api/taxonomies/index.mjs.map +1 -1
- package/dist/astro/routes/api/themes/preview.mjs +8 -8
- package/dist/astro/routes/api/typegen.mjs +6 -6
- package/dist/astro/routes/api/visual-editing/action-token.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/action-token.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs +25 -0
- package/dist/astro/routes/api/visual-editing/action-token.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +37 -0
- package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts +8 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.d.mts.map +1 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +20 -0
- package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs.map +1 -0
- 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 +12 -11
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +16 -15
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +16 -15
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
- package/dist/astro/routes/api/widget-areas/_name_.mjs +10 -10
- package/dist/astro/routes/api/widget-areas/index.mjs +16 -15
- package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
- package/dist/astro/routes/api/widget-components.mjs +4 -4
- package/dist/astro/routes/robots.txt.mjs +13 -12
- package/dist/astro/routes/robots.txt.mjs.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +24 -19
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +14 -13
- package/dist/astro/routes/sitemap.xml.mjs.map +1 -1
- package/dist/astro/types.d.mts +79 -26
- 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/authoritative-records-DbqshfKD.mjs +5172 -0
- package/dist/authoritative-records-DbqshfKD.mjs.map +1 -0
- package/dist/authorize-BXpfMpp0.mjs +40 -0
- package/dist/authorize-BXpfMpp0.mjs.map +1 -0
- package/dist/backup-BsPQdwnS.mjs +246 -0
- package/dist/backup-BsPQdwnS.mjs.map +1 -0
- package/dist/base64-DvnNgP7e.mjs +63 -0
- package/dist/base64-DvnNgP7e.mjs.map +1 -0
- package/dist/byline-Doh-wt99.mjs +906 -0
- package/dist/byline-Doh-wt99.mjs.map +1 -0
- package/dist/byline-fields-CsrdvaLV.mjs +123 -0
- package/dist/byline-fields-CsrdvaLV.mjs.map +1 -0
- package/dist/byline-registry-D6lWzXk6.mjs +406 -0
- package/dist/byline-registry-D6lWzXk6.mjs.map +1 -0
- package/dist/bylines-Cop0hkoy.mjs +214 -0
- package/dist/bylines-Cop0hkoy.mjs.map +1 -0
- package/dist/bylines-kpBzHPr8.mjs +232 -0
- package/dist/bylines-kpBzHPr8.mjs.map +1 -0
- package/dist/cache-B0pOlXdM.mjs +108 -0
- package/dist/cache-B0pOlXdM.mjs.map +1 -0
- package/dist/capture-triggers-gxQxnxrJ.mjs +362 -0
- package/dist/capture-triggers-gxQxnxrJ.mjs.map +1 -0
- package/dist/challenge-store-CkRdSdd8.mjs +51 -0
- package/dist/challenge-store-CkRdSdd8.mjs.map +1 -0
- package/dist/checksum-Bsi2D9M1.mjs +162 -0
- package/dist/checksum-Bsi2D9M1.mjs.map +1 -0
- package/dist/chrome-tags-D7LGB91U.mjs +24 -0
- package/dist/chrome-tags-D7LGB91U.mjs.map +1 -0
- package/dist/chunks-BmWyou79.mjs +25 -0
- package/dist/chunks-BmWyou79.mjs.map +1 -0
- package/dist/cli/index.mjs +921 -106
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +17 -7
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs +17 -12
- package/dist/client/index.mjs.map +1 -1
- package/dist/collection-deletion-C3Xixmkx.mjs +436 -0
- package/dist/collection-deletion-C3Xixmkx.mjs.map +1 -0
- package/dist/collection-slugs-cache-D9auiKmI.mjs +85 -0
- package/dist/collection-slugs-cache-D9auiKmI.mjs.map +1 -0
- package/dist/comment-DcT8qdPK.mjs +313 -0
- package/dist/comment-DcT8qdPK.mjs.map +1 -0
- package/dist/comment-reaction-DY5-y8Y5.mjs +85 -0
- package/dist/comment-reaction-DY5-y8Y5.mjs.map +1 -0
- package/dist/comments-B67VRNGw.mjs +204 -0
- package/dist/comments-B67VRNGw.mjs.map +1 -0
- package/dist/comments-BVzzt6x5.mjs +99 -0
- package/dist/comments-BVzzt6x5.mjs.map +1 -0
- package/dist/components-DIl9Qzh6.mjs +108 -0
- package/dist/components-DIl9Qzh6.mjs.map +1 -0
- package/dist/config-B2acLeC5.mjs +242 -0
- package/dist/config-B2acLeC5.mjs.map +1 -0
- package/dist/config-CGVeT8Hc.mjs +73 -0
- package/dist/config-CGVeT8Hc.mjs.map +1 -0
- package/dist/config-D3HhLON3.d.mts +39 -0
- package/dist/config-D3HhLON3.d.mts.map +1 -0
- package/dist/config-DS7e4EZ9.d.mts +6387 -0
- package/dist/config-DS7e4EZ9.d.mts.map +1 -0
- package/dist/content-DZ3B5qtA.mjs +2216 -0
- package/dist/content-DZ3B5qtA.mjs.map +1 -0
- package/dist/content-list-query-CbPdzsna.d.mts +26 -0
- package/dist/content-list-query-CbPdzsna.d.mts.map +1 -0
- package/dist/content-policy-CM4skrNi.mjs +46 -0
- package/dist/content-policy-CM4skrNi.mjs.map +1 -0
- package/dist/content-refresh-BHLHJgyt.mjs +3599 -0
- package/dist/content-refresh-BHLHJgyt.mjs.map +1 -0
- package/dist/content-repair-BVll5WNl.mjs +440 -0
- package/dist/content-repair-BVll5WNl.mjs.map +1 -0
- package/dist/context-B195kjqZ.mjs +1835 -0
- package/dist/context-B195kjqZ.mjs.map +1 -0
- package/dist/cron-BcR3RN4K.mjs +282 -0
- package/dist/cron-BcR3RN4K.mjs.map +1 -0
- package/dist/dashboard-CZD4G7k_.mjs +151 -0
- package/dist/dashboard-CZD4G7k_.mjs.map +1 -0
- package/dist/database/migration-lock.d.mts +37 -0
- package/dist/database/migration-lock.d.mts.map +1 -0
- package/dist/database/migration-lock.mjs +76 -0
- package/dist/database/migration-lock.mjs.map +1 -0
- package/dist/database/pg-migration-lock.d.mts +1 -1
- package/dist/database/pg-migration-lock.mjs +1 -1
- package/dist/database/pg-migration-lock.mjs.map +1 -1
- package/dist/datetime-normalization-PeiEdcRY.mjs +187 -0
- package/dist/datetime-normalization-PeiEdcRY.mjs.map +1 -0
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +4 -3
- package/dist/db/index.mjs.map +1 -1
- package/dist/db/libsql-migrations.d.mts +1 -1
- package/dist/db/libsql-migrations.mjs +7 -6
- package/dist/db/libsql-migrations.mjs.map +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres-migrations.d.mts +1 -1
- package/dist/db/postgres-migrations.mjs +7 -6
- package/dist/db/postgres-migrations.mjs.map +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite-migrations.d.mts +1 -1
- package/dist/db/sqlite-migrations.mjs +7 -6
- package/dist/db/sqlite-migrations.mjs.map +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/db-errors-CBD5yMro.mjs +55 -0
- package/dist/db-errors-CBD5yMro.mjs.map +1 -0
- package/dist/default-BtlxWgh9.mjs +81 -0
- package/dist/default-BtlxWgh9.mjs.map +1 -0
- package/dist/deferred-tasks-Ba9fphlE.d.mts +9 -0
- package/dist/deferred-tasks-Ba9fphlE.d.mts.map +1 -0
- package/dist/dev-typegen-CZaPLl3V.mjs +29 -0
- package/dist/dev-typegen-CZaPLl3V.mjs.map +1 -0
- package/dist/device-flow-3E5l0fpH.mjs +466 -0
- package/dist/device-flow-3E5l0fpH.mjs.map +1 -0
- package/dist/dialect-helpers-CtYdsX4W.mjs +307 -0
- package/dist/dialect-helpers-CtYdsX4W.mjs.map +1 -0
- package/dist/direct-executor-ZI8E01Yt.mjs +104 -0
- package/dist/direct-executor-ZI8E01Yt.mjs.map +1 -0
- package/dist/dist-2hDLsLeq.mjs +810 -0
- package/dist/dist-2hDLsLeq.mjs.map +1 -0
- package/dist/email-console-gc-E3Eqj.mjs +50 -0
- package/dist/email-console-gc-E3Eqj.mjs.map +1 -0
- package/dist/emdash-runtime-DZGinqTL.mjs +4041 -0
- package/dist/emdash-runtime-DZGinqTL.mjs.map +1 -0
- package/dist/enrich-C2Mk0lwE.mjs +194 -0
- package/dist/enrich-C2Mk0lwE.mjs.map +1 -0
- package/dist/entry-lock-D3C99MXS.mjs +1520 -0
- package/dist/entry-lock-D3C99MXS.mjs.map +1 -0
- package/dist/entry-lock-D9rnj2Lu.mjs +163 -0
- package/dist/entry-lock-D9rnj2Lu.mjs.map +1 -0
- package/dist/entry-lock-DX7QkqEg.d.mts +3503 -0
- package/dist/entry-lock-DX7QkqEg.d.mts.map +1 -0
- package/dist/entry-locks-CO_KaoU5.mjs +167 -0
- package/dist/entry-locks-CO_KaoU5.mjs.map +1 -0
- package/dist/error-CCTCskie.mjs +90 -0
- package/dist/error-CCTCskie.mjs.map +1 -0
- package/dist/errors-W3PA8HqB.mjs +447 -0
- package/dist/errors-W3PA8HqB.mjs.map +1 -0
- package/dist/escape-DN4Qmjsl.mjs +9 -0
- package/dist/escape-DN4Qmjsl.mjs.map +1 -0
- package/dist/field-defs-cache-B337z8UJ.mjs +77 -0
- package/dist/field-defs-cache-B337z8UJ.mjs.map +1 -0
- package/dist/focal-point-Gr34o-4o.mjs +23 -0
- package/dist/focal-point-Gr34o-4o.mjs.map +1 -0
- package/dist/fts-manager-DMb0sbIQ.mjs +413 -0
- package/dist/fts-manager-DMb0sbIQ.mjs.map +1 -0
- package/dist/hash-CLVFzWvx.mjs +37 -0
- package/dist/hash-CLVFzWvx.mjs.map +1 -0
- package/dist/hook-result-KY1jq21o.d.mts +31 -0
- package/dist/hook-result-KY1jq21o.d.mts.map +1 -0
- package/dist/hreflang-BgS2FqhH.d.mts +50 -0
- package/dist/hreflang-BgS2FqhH.d.mts.map +1 -0
- package/dist/hreflang-CrJwqoeb.mjs +105 -0
- package/dist/hreflang-CrJwqoeb.mjs.map +1 -0
- package/dist/http-route-dispatch-DAKlanXb.mjs +339 -0
- package/dist/http-route-dispatch-DAKlanXb.mjs.map +1 -0
- package/dist/identity-DRGSHEEr.mjs +35 -0
- package/dist/identity-DRGSHEEr.mjs.map +1 -0
- package/dist/import-DFr5B_hC.mjs +2020 -0
- package/dist/import-DFr5B_hC.mjs.map +1 -0
- package/dist/index-CDwKDkTq.d.mts +623 -0
- package/dist/index-CDwKDkTq.d.mts.map +1 -0
- package/dist/index.d.mts +27 -22
- package/dist/index.mjs +101 -86
- package/dist/init-lock-4eRRB4Le.mjs +56 -0
- package/dist/init-lock-4eRRB4Le.mjs.map +1 -0
- package/dist/install-finalization-5Os-QZ-2.mjs +58 -0
- package/dist/install-finalization-5Os-QZ-2.mjs.map +1 -0
- package/dist/lifecycle-7e-Lt_kX.mjs +25 -0
- package/dist/lifecycle-7e-Lt_kX.mjs.map +1 -0
- package/dist/load-Cu5bvCZh.mjs +28 -0
- package/dist/load-Cu5bvCZh.mjs.map +1 -0
- package/dist/loader-t4TxaFiQ.mjs +1004 -0
- package/dist/loader-t4TxaFiQ.mjs.map +1 -0
- package/dist/manifest-builder-D31UoJCu.mjs +189 -0
- package/dist/manifest-builder-D31UoJCu.mjs.map +1 -0
- package/dist/manifest-schema-Bkh8SeHd.mjs +491 -0
- package/dist/manifest-schema-Bkh8SeHd.mjs.map +1 -0
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +4 -4
- 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 +12 -11
- package/dist/media/local-runtime.mjs.map +1 -1
- package/dist/media-TBlKCwo7.mjs +334 -0
- package/dist/media-TBlKCwo7.mjs.map +1 -0
- package/dist/media-allowlist-s60eAIf6.mjs +44 -0
- package/dist/media-allowlist-s60eAIf6.mjs.map +1 -0
- package/dist/media-folders-ClIRLUQv.mjs +210 -0
- package/dist/media-folders-ClIRLUQv.mjs.map +1 -0
- package/dist/media-url-DY_ijO3B.mjs +43 -0
- package/dist/media-url-DY_ijO3B.mjs.map +1 -0
- package/dist/media-usage-C4NolTpQ.mjs +1833 -0
- package/dist/media-usage-C4NolTpQ.mjs.map +1 -0
- package/dist/media-usage-activation-CAhmb14O.mjs +78 -0
- package/dist/media-usage-activation-CAhmb14O.mjs.map +1 -0
- package/dist/media-usage-work-Cu5DqewW.mjs +586 -0
- package/dist/media-usage-work-Cu5DqewW.mjs.map +1 -0
- package/dist/media-usage-work-DJr3rOEN.mjs +152 -0
- package/dist/media-usage-work-DJr3rOEN.mjs.map +1 -0
- package/dist/media-usage-write-fence-DW5oHT7q.mjs +42 -0
- package/dist/media-usage-write-fence-DW5oHT7q.mjs.map +1 -0
- package/dist/menus-DbgU9z5Q.mjs +3732 -0
- package/dist/menus-DbgU9z5Q.mjs.map +1 -0
- package/dist/menus-Wy8m5NcH.mjs +753 -0
- package/dist/menus-Wy8m5NcH.mjs.map +1 -0
- package/dist/migrations/index.d.mts +2 -2
- package/dist/migrations/index.d.mts.map +1 -1
- package/dist/migrations/index.mjs +6 -5
- package/dist/mime-CCYRC4r1.mjs +36 -0
- package/dist/mime-CCYRC4r1.mjs.map +1 -0
- package/dist/mode-CkmOhFqj.mjs +23 -0
- package/dist/mode-CkmOhFqj.mjs.map +1 -0
- package/dist/node-sqlite-compat-vpVaILnb.mjs +46 -0
- package/dist/node-sqlite-compat-vpVaILnb.mjs.map +1 -0
- package/dist/normalize-dChXQjwS.mjs +191 -0
- package/dist/normalize-dChXQjwS.mjs.map +1 -0
- package/dist/oauth-authorization-DZ-R-hmx.mjs +274 -0
- package/dist/oauth-authorization-DZ-R-hmx.mjs.map +1 -0
- package/dist/oauth-clients-BMPA8vjl.mjs +266 -0
- package/dist/oauth-clients-BMPA8vjl.mjs.map +1 -0
- package/dist/oauth-state-store-0gIdb48-.mjs +50 -0
- package/dist/oauth-state-store-0gIdb48-.mjs.map +1 -0
- package/dist/oauth-user-lookup-ChVW4UWu.mjs +26 -0
- package/dist/oauth-user-lookup-ChVW4UWu.mjs.map +1 -0
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/object-cache-DlSVbn5Y.mjs +534 -0
- package/dist/object-cache-DlSVbn5Y.mjs.map +1 -0
- package/dist/options-D5WcorD5.mjs +200 -0
- package/dist/options-D5WcorD5.mjs.map +1 -0
- package/dist/options-DAknChnw.d.mts +77 -0
- package/dist/options-DAknChnw.d.mts.map +1 -0
- package/dist/page/index.d.mts +2 -2
- package/dist/page/index.d.mts.map +1 -1
- package/dist/page/index.mjs +13 -0
- package/dist/page/index.mjs.map +1 -1
- package/dist/parse-Cr379Av9.mjs +81 -0
- package/dist/parse-Cr379Av9.mjs.map +1 -0
- package/dist/parse-tj9XLNO_.d.mts +165 -0
- package/dist/parse-tj9XLNO_.d.mts.map +1 -0
- package/dist/passkey-config-BD-wMaCf.mjs +46 -0
- package/dist/passkey-config-BD-wMaCf.mjs.map +1 -0
- package/dist/patterns-Do3iqi7N.mjs +145 -0
- package/dist/patterns-Do3iqi7N.mjs.map +1 -0
- package/dist/placeholder-CubPFn_L.d.mts +306 -0
- package/dist/placeholder-CubPFn_L.d.mts.map +1 -0
- package/dist/plugin-test-runtime.d.mts +97 -0
- package/dist/plugin-test-runtime.d.mts.map +1 -0
- package/dist/plugin-test-runtime.mjs +105 -0
- package/dist/plugin-types.d.mts +53 -15
- package/dist/plugin-types.d.mts.map +1 -1
- package/dist/plugin-types.mjs +18 -1
- package/dist/plugin-types.mjs.map +1 -0
- package/dist/plugin-utils.d.mts +12 -10
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +12 -10
- package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.mjs +18 -13
- package/dist/plugins/adapt-sandbox-entry.mjs.map +1 -1
- package/dist/plugins/host.d.mts +7 -0
- package/dist/plugins/host.mjs +45 -0
- package/dist/plugins/http-wire.d.mts +25 -0
- package/dist/plugins/http-wire.d.mts.map +1 -0
- package/dist/plugins/http-wire.mjs +148 -0
- package/dist/plugins/http-wire.mjs.map +1 -0
- package/dist/plugins/secret-redactor.d.mts +9 -0
- package/dist/plugins/secret-redactor.d.mts.map +1 -0
- package/dist/plugins/secret-redactor.mjs +51 -0
- package/dist/plugins/secret-redactor.mjs.map +1 -0
- package/dist/plugins-DHurtdXQ.mjs +277 -0
- package/dist/plugins-DHurtdXQ.mjs.map +1 -0
- package/dist/policy-lyZnjpwz.mjs +45 -0
- package/dist/policy-lyZnjpwz.mjs.map +1 -0
- package/dist/portable-text-oAwodbPS.mjs +286 -0
- package/dist/portable-text-oAwodbPS.mjs.map +1 -0
- package/dist/preview-Cup2bj8c.mjs +107 -0
- package/dist/preview-Cup2bj8c.mjs.map +1 -0
- package/dist/protocol-C1CNiKX4.d.mts +61 -0
- package/dist/protocol-C1CNiKX4.d.mts.map +1 -0
- package/dist/public-submission-Cs-pFMQK.mjs +245 -0
- package/dist/public-submission-Cs-pFMQK.mjs.map +1 -0
- package/dist/public-url-BWVHsfQv.mjs +101 -0
- package/dist/public-url-BWVHsfQv.mjs.map +1 -0
- package/dist/query-D-lxiOgn.mjs +890 -0
- package/dist/query-D-lxiOgn.mjs.map +1 -0
- package/dist/query-D7kHKOws.mjs +41 -0
- package/dist/query-D7kHKOws.mjs.map +1 -0
- package/dist/rate-limit-CqJn-w4h.mjs +120 -0
- package/dist/rate-limit-CqJn-w4h.mjs.map +1 -0
- package/dist/redirect-BrChFPIu.mjs +17 -0
- package/dist/redirect-BrChFPIu.mjs.map +1 -0
- package/dist/redirect-D2Yo-b6S.mjs +415 -0
- package/dist/redirect-D2Yo-b6S.mjs.map +1 -0
- package/dist/redirects-BCiTaIQ-.mjs +146 -0
- package/dist/redirects-BCiTaIQ-.mjs.map +1 -0
- package/dist/redirects-ByItliuu.mjs +644 -0
- package/dist/redirects-ByItliuu.mjs.map +1 -0
- package/dist/registry/testing.d.mts +14 -0
- package/dist/registry/testing.d.mts.map +1 -0
- package/dist/registry/testing.mjs +255 -0
- package/dist/registry/testing.mjs.map +1 -0
- package/dist/registry-CkuPoZs7.mjs +1222 -0
- package/dist/registry-CkuPoZs7.mjs.map +1 -0
- package/dist/relation-XTAtOpJO.mjs +334 -0
- package/dist/relation-XTAtOpJO.mjs.map +1 -0
- package/dist/relations-B4w-G5U9.mjs +309 -0
- package/dist/relations-B4w-G5U9.mjs.map +1 -0
- package/dist/relations-O63JWBRj.mjs +403 -0
- package/dist/relations-O63JWBRj.mjs.map +1 -0
- package/dist/request-cache-DaMhSQdx.mjs +104 -0
- package/dist/request-cache-DaMhSQdx.mjs.map +1 -0
- package/dist/request-context.d.mts +1 -1
- package/dist/request-meta-C8yl_sIs.mjs +141 -0
- package/dist/request-meta-C8yl_sIs.mjs.map +1 -0
- package/dist/resolve-BJIS8wKr.mjs +199 -0
- package/dist/resolve-BJIS8wKr.mjs.map +1 -0
- package/dist/route-wire-D66L2oaZ.mjs +197 -0
- package/dist/route-wire-D66L2oaZ.mjs.map +1 -0
- package/dist/routes-DYsTe-oR.mjs +321 -0
- package/dist/routes-DYsTe-oR.mjs.map +1 -0
- package/dist/runner-3gfxRsJG.d.mts +68 -0
- package/dist/runner-3gfxRsJG.d.mts.map +1 -0
- package/dist/runner-ClrleR8A.mjs +5502 -0
- package/dist/runner-ClrleR8A.mjs.map +1 -0
- package/dist/runtime.d.mts +13 -11
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +6 -5
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema-CPhPM9Do.mjs +420 -0
- package/dist/schema-CPhPM9Do.mjs.map +1 -0
- package/dist/schema-DEERRrKS.mjs +9 -0
- package/dist/schema-DEERRrKS.mjs.map +1 -0
- package/dist/scopes-Bn8_rCSt.mjs +27 -0
- package/dist/scopes-Bn8_rCSt.mjs.map +1 -0
- package/dist/search-lami_Ota.mjs +448 -0
- package/dist/search-lami_Ota.mjs.map +1 -0
- package/dist/secrets-DNgVgz_e.mjs +341 -0
- package/dist/secrets-DNgVgz_e.mjs.map +1 -0
- package/dist/sections-BIpd4Cxf.mjs +346 -0
- package/dist/sections-BIpd4Cxf.mjs.map +1 -0
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +35 -31
- package/dist/seo/index.d.mts +3 -3
- package/dist/seo/index.d.mts.map +1 -1
- package/dist/seo/index.mjs +27 -26
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo-BtU70b7l.mjs +114 -0
- package/dist/seo-BtU70b7l.mjs.map +1 -0
- package/dist/seo-_4qmazxz.mjs +133 -0
- package/dist/seo-_4qmazxz.mjs.map +1 -0
- package/dist/service-Bpy5iTX0.mjs +150 -0
- package/dist/service-Bpy5iTX0.mjs.map +1 -0
- package/dist/session-user-BQeS2Mrb.mjs +51 -0
- package/dist/session-user-BQeS2Mrb.mjs.map +1 -0
- package/dist/settings-DmroR53o.mjs +420 -0
- package/dist/settings-DmroR53o.mjs.map +1 -0
- package/dist/settings-g2F2a3Ub.mjs +51 -0
- package/dist/settings-g2F2a3Ub.mjs.map +1 -0
- package/dist/setup-complete-BrZaXpVV.mjs +26 -0
- package/dist/setup-complete-BrZaXpVV.mjs.map +1 -0
- package/dist/setup-nonce-Cb9-884O.mjs +25 -0
- package/dist/setup-nonce-Cb9-884O.mjs.map +1 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs +104 -0
- package/dist/single-flight-cache-B5O2qhO1.mjs.map +1 -0
- package/dist/site-url-DjhYCaep.mjs +16 -0
- package/dist/site-url-DjhYCaep.mjs.map +1 -0
- package/dist/slugify-T5GHH42D.mjs +17 -0
- package/dist/slugify-T5GHH42D.mjs.map +1 -0
- package/dist/snapshot-C32Xuv3o.mjs +233 -0
- package/dist/snapshot-C32Xuv3o.mjs.map +1 -0
- package/dist/ssrf-Co1GGFZz.mjs +406 -0
- package/dist/ssrf-Co1GGFZz.mjs.map +1 -0
- package/dist/state-C7gCoiHr.mjs +153 -0
- package/dist/state-C7gCoiHr.mjs.map +1 -0
- package/dist/status-DLoBmcDz.mjs +30 -0
- package/dist/status-DLoBmcDz.mjs.map +1 -0
- package/dist/storage/local.d.mts +1 -1
- package/dist/storage/local.mjs +1 -1
- package/dist/storage/s3.d.mts +1 -1
- package/dist/storage/s3.mjs +1 -1
- package/dist/storage-query-CPctdMKX.d.mts +1519 -0
- package/dist/storage-query-CPctdMKX.d.mts.map +1 -0
- package/dist/target-CUKlGrXb.mjs +27 -0
- package/dist/target-CUKlGrXb.mjs.map +1 -0
- package/dist/taxonomies-BpqpXJUE.mjs +707 -0
- package/dist/taxonomies-BpqpXJUE.mjs.map +1 -0
- package/dist/taxonomies-ClCo4IGO.mjs +899 -0
- package/dist/taxonomies-ClCo4IGO.mjs.map +1 -0
- package/dist/taxonomy-Dj1vpw5E.mjs +508 -0
- package/dist/taxonomy-Dj1vpw5E.mjs.map +1 -0
- package/dist/tokens-Ns02GAma.mjs +171 -0
- package/dist/tokens-Ns02GAma.mjs.map +1 -0
- package/dist/transaction-BcJO4Tmc.mjs +29 -0
- package/dist/transaction-BcJO4Tmc.mjs.map +1 -0
- package/dist/transport-B8P1xsqk.mjs +136 -0
- package/dist/transport-B8P1xsqk.mjs.map +1 -0
- package/dist/transport-BLHZZcD_.d.mts +42 -0
- package/dist/transport-BLHZZcD_.d.mts.map +1 -0
- package/dist/trusted-proxy-Cg7SuD15.mjs +51 -0
- package/dist/trusted-proxy-Cg7SuD15.mjs.map +1 -0
- package/dist/turnstile-DWCSh_Qc.mjs +53 -0
- package/dist/turnstile-DWCSh_Qc.mjs.map +1 -0
- package/dist/types-B3RkqvDW.mjs +156 -0
- package/dist/types-B3RkqvDW.mjs.map +1 -0
- package/dist/types-BkUg2yHx.mjs +92 -0
- package/dist/types-BkUg2yHx.mjs.map +1 -0
- package/dist/types-BtuppOTV.mjs +16 -0
- package/dist/types-BtuppOTV.mjs.map +1 -0
- package/dist/types-CCR3ivXE.d.mts +363 -0
- package/dist/types-CCR3ivXE.d.mts.map +1 -0
- package/dist/types-CSHgU_-_.mjs +18 -0
- package/dist/types-CSHgU_-_.mjs.map +1 -0
- package/dist/types-CbwqGOXm.d.mts +766 -0
- package/dist/types-CbwqGOXm.d.mts.map +1 -0
- package/dist/types-D4RGIc2I.d.mts +198 -0
- package/dist/types-D4RGIc2I.d.mts.map +1 -0
- package/dist/types-DEHidMEk.d.mts +1637 -0
- package/dist/types-DEHidMEk.d.mts.map +1 -0
- package/dist/types-DQeU2SR7.d.mts +279 -0
- package/dist/types-DQeU2SR7.d.mts.map +1 -0
- package/dist/types-DxQWoQLA.d.mts +264 -0
- package/dist/types-DxQWoQLA.d.mts.map +1 -0
- package/dist/types-FBBnGZ2Y.d.mts +198 -0
- package/dist/types-FBBnGZ2Y.d.mts.map +1 -0
- package/dist/types-ZCnlropY.mjs +69 -0
- package/dist/types-ZCnlropY.mjs.map +1 -0
- package/dist/types-_Qtyawiy.d.mts +124 -0
- package/dist/types-_Qtyawiy.d.mts.map +1 -0
- package/dist/types-gC6FAoa_.d.mts +75 -0
- package/dist/types-gC6FAoa_.d.mts.map +1 -0
- package/dist/types-k--LneIF.mjs +22 -0
- package/dist/types-k--LneIF.mjs.map +1 -0
- package/dist/upload-attempts-2xdnoKGe.mjs +27 -0
- package/dist/upload-attempts-2xdnoKGe.mjs.map +1 -0
- package/dist/url-pattern-3m3reMzr.mjs +33 -0
- package/dist/url-pattern-3m3reMzr.mjs.map +1 -0
- package/dist/user-DroRntkx.mjs +171 -0
- package/dist/user-DroRntkx.mjs.map +1 -0
- package/dist/utils-CC2oNGV8.mjs +435 -0
- package/dist/utils-CC2oNGV8.mjs.map +1 -0
- package/dist/validate-BCP9HNDn.mjs +384 -0
- package/dist/validate-BCP9HNDn.mjs.map +1 -0
- package/dist/validate-CyQ7I3xF.d.mts +410 -0
- package/dist/validate-CyQ7I3xF.d.mts.map +1 -0
- package/dist/validate-DANX1-Qi.mjs +120 -0
- package/dist/validate-DANX1-Qi.mjs.map +1 -0
- package/dist/validation-DBy6WF94.mjs +216 -0
- package/dist/validation-DBy6WF94.mjs.map +1 -0
- package/dist/version-B57E4Uo7.mjs +7 -0
- package/dist/version-B57E4Uo7.mjs.map +1 -0
- package/dist/widgets-wQ7Xcgq8.mjs +126 -0
- package/dist/widgets-wQ7Xcgq8.mjs.map +1 -0
- package/dist/wxr-taxonomies-DIHfvEDt.mjs +406 -0
- package/dist/wxr-taxonomies-DIHfvEDt.mjs.map +1 -0
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts +34 -0
- package/dist/wxr-taxonomies-DU2ZSiGc.d.mts.map +1 -0
- package/dist/zod-generator-D_yHIWfs.mjs +329 -0
- package/dist/zod-generator-D_yHIWfs.mjs.map +1 -0
- package/package.json +39 -12
- package/src/api/errors.ts +23 -0
- package/src/api/handlers/backup.ts +11 -5
- package/src/api/handlers/content.ts +226 -85
- package/src/api/handlers/dashboard.ts +31 -1
- package/src/api/handlers/entry-lock.ts +206 -0
- package/src/api/handlers/index.ts +3 -0
- package/src/api/handlers/manifest.ts +5 -6
- package/src/api/handlers/marketplace.ts +126 -34
- package/src/api/handlers/media-upload.ts +31 -4
- package/src/api/handlers/menus.ts +9 -0
- package/src/api/handlers/plugin-settings.ts +35 -3
- package/src/api/handlers/redirects.ts +221 -138
- package/src/api/handlers/registry.ts +75 -29
- package/src/api/handlers/revision.ts +16 -27
- package/src/api/handlers/seo.ts +10 -1
- package/src/api/handlers/snapshot.ts +87 -72
- package/src/api/handlers/taxonomies.ts +79 -5
- package/src/api/handlers/validation.ts +120 -19
- package/src/api/openapi/document.ts +133 -11
- package/src/api/schemas/content.ts +32 -12
- package/src/api/schemas/entry-lock.ts +57 -0
- package/src/api/schemas/index.ts +1 -0
- package/src/api/schemas/schema.ts +10 -1
- package/src/api/schemas/search.ts +4 -0
- package/src/api/types.ts +4 -0
- package/src/astro/integration/index.ts +22 -6
- package/src/astro/integration/routes.ts +89 -0
- package/src/astro/integration/runtime.ts +40 -24
- package/src/astro/integration/virtual-modules.ts +4 -0
- package/src/astro/integration/vite-config.ts +31 -0
- package/src/astro/middleware/auth.ts +25 -4
- package/src/astro/middleware/request-context.ts +28 -10
- package/src/astro/middleware.ts +33 -1
- package/src/astro/prefetch.ts +2 -2
- package/src/astro/routes/api/admin/comments/[id]/status.ts +22 -58
- package/src/astro/routes/api/admin/plugins/[id]/disable.ts +2 -15
- package/src/astro/routes/api/admin/plugins/[id]/enable.ts +2 -25
- package/src/astro/routes/api/admin/plugins/[id]/uninstall.ts +1 -0
- package/src/astro/routes/api/admin/plugins/[id]/update.ts +23 -4
- package/src/astro/routes/api/admin/plugins/marketplace/[id]/install.ts +12 -2
- package/src/astro/routes/api/admin/plugins/registry/[id]/uninstall.ts +1 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +29 -10
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +8 -2
- package/src/astro/routes/api/admin/plugins/registry/install.ts +15 -4
- package/src/astro/routes/api/admin/plugins/registry/verify.ts +2 -1
- package/src/astro/routes/api/admin/plugins/updates.ts +6 -1
- package/src/astro/routes/api/admin/scheduled-policy-rejections/[collection]/[id].ts +34 -0
- package/src/astro/routes/api/comments/[collection]/[contentId]/index.ts +4 -259
- package/src/astro/routes/api/content/[collection]/[id]/discard-draft.ts +10 -0
- package/src/astro/routes/api/content/[collection]/[id]/lock.ts +133 -0
- package/src/astro/routes/api/content/[collection]/[id]/plugin-extensions/[pluginId]/[kind]/[extensionId].ts +29 -0
- package/src/astro/routes/api/content/[collection]/[id]/publish.ts +21 -4
- package/src/astro/routes/api/content/[collection]/[id]/schedule.ts +30 -1
- package/src/astro/routes/api/content/[collection]/[id]/unpublish.ts +15 -1
- package/src/astro/routes/api/content/[collection]/[id].ts +27 -2
- package/src/astro/routes/api/content/[collection]/index.ts +3 -0
- package/src/astro/routes/api/health.ts +23 -0
- package/src/astro/routes/api/manifest.ts +14 -4
- package/src/astro/routes/api/mcp.ts +2 -1
- package/src/astro/routes/api/media/asset/[id]/[filename].ts +50 -0
- package/src/astro/routes/api/plugins/[pluginId]/[...path].ts +13 -81
- package/src/astro/routes/api/redirects/[id].ts +0 -3
- package/src/astro/routes/api/redirects/index.ts +0 -2
- package/src/astro/routes/api/search/index.ts +1 -0
- package/src/astro/routes/api/visual-editing/action-token.ts +36 -0
- package/src/astro/routes/api/visual-editing/content/[collection]/[id]/publish.ts +32 -0
- package/src/astro/routes/api/visual-editing/toolbar-labels.ts +16 -0
- package/src/astro/routes/sitemap-[collection].xml.ts +11 -4
- package/src/astro/types.ts +83 -12
- package/src/cli/commands/bundle-utils.ts +19 -19
- package/src/cli/commands/bundle.ts +9 -6
- package/src/cli/commands/content.ts +32 -6
- package/src/cli/commands/doctor.ts +25 -0
- package/src/cli/commands/export-seed.ts +195 -56
- package/src/cli/commands/migrate.ts +71 -23
- package/src/cli/commands/publish.ts +2 -2
- package/src/client/index.ts +34 -7
- package/src/comments/public-submission.ts +246 -0
- package/src/comments/service.ts +59 -12
- package/src/components/EmDashBodyEnd.astro +4 -1
- package/src/components/EmDashBodyStart.astro +4 -1
- package/src/components/EmDashHead.astro +36 -16
- package/src/components/Gallery.astro +18 -4
- package/src/components/InlineEditor.astro +3 -1
- package/src/components/InlinePortableTextEditor.tsx +106 -11
- package/src/components/PortableText.astro +4 -0
- package/src/components/Table.astro +147 -62
- package/src/components/widgets/Archives.astro +6 -5
- package/src/config/errors.ts +13 -0
- package/src/config/secrets.ts +25 -11
- package/src/content/converters/portable-text-to-prosemirror.ts +26 -2
- package/src/content/converters/prosemirror-to-portable-text.ts +35 -6
- package/src/content/converters/types.ts +10 -0
- package/src/content/known-fields.ts +44 -0
- package/src/database/connection.ts +5 -1
- package/src/database/content-datetime.ts +123 -0
- package/src/database/datetime-storage.ts +452 -0
- package/src/database/dialect-helpers.ts +161 -1
- package/src/database/migration-lock.ts +140 -0
- package/src/database/migrations/075_entry_edit_locks.ts +44 -0
- package/src/database/migrations/076_collection_nav_group.ts +22 -0
- package/src/database/migrations/077_plugin_storage_revisions.ts +89 -0
- package/src/database/migrations/078_menu_item_translation_groups.ts +15 -0
- package/src/database/migrations/079_datetime_normalization.ts +13 -0
- package/src/database/migrations/080_content_translation_locale_unique.ts +88 -0
- package/src/database/migrations/081_redirect_write_guards.ts +257 -0
- package/src/database/migrations/082_taxonomy_translation_locale_unique.ts +49 -0
- package/src/database/migrations/runner.ts +63 -15
- package/src/database/pg-migration-lock.ts +2 -2
- package/src/database/repositories/byline.ts +9 -0
- package/src/database/repositories/comment.ts +86 -0
- package/src/database/repositories/content.ts +560 -69
- package/src/database/repositories/entry-locks.ts +257 -0
- package/src/database/repositories/media.ts +35 -4
- package/src/database/repositories/menu.ts +1 -0
- package/src/database/repositories/options.ts +113 -7
- package/src/database/repositories/plugin-storage.ts +159 -0
- package/src/database/repositories/redirect.ts +262 -56
- package/src/database/repositories/revision.ts +116 -17
- package/src/database/repositories/taxonomy.ts +42 -0
- package/src/database/repositories/types.ts +5 -0
- package/src/database/types.ts +26 -1
- package/src/datetime-normalization.ts +311 -0
- package/src/db/node-sqlite-compat.ts +3 -2
- package/src/emdash-runtime.ts +1994 -424
- package/src/fields/image.ts +2 -0
- package/src/i18n/config.ts +6 -6
- package/src/i18n/resolve.ts +98 -15
- package/src/index.ts +101 -0
- package/src/loader.ts +49 -4
- package/src/mcp/server.ts +216 -68
- package/src/media/responsive.ts +23 -0
- package/src/media/usage/content-refresh.ts +2 -1
- package/src/media/usage/extractor.ts +50 -15
- package/src/media/usage/types.ts +1 -1
- package/src/menus/index.ts +64 -35
- package/src/migrations/direct-executor.ts +40 -2
- package/src/migrations/index.ts +1 -0
- package/src/migrations/protocol.ts +11 -1
- package/src/page/seo-contributions.ts +78 -1
- package/src/page/seo-panel.ts +47 -0
- package/src/plugin-test-runtime.ts +17 -0
- package/src/plugin-types.ts +128 -21
- package/src/plugins/adapt-sandbox-entry.ts +34 -27
- package/src/plugins/conditional-storage.ts +30 -0
- package/src/plugins/content-access.ts +170 -0
- package/src/plugins/content-policy.ts +74 -0
- package/src/plugins/context.ts +790 -166
- package/src/plugins/cron.ts +18 -10
- package/src/plugins/define-plugin.ts +55 -54
- package/src/plugins/editor-draft.ts +257 -0
- package/src/plugins/hooks.ts +136 -3
- package/src/plugins/host.ts +29 -0
- package/src/plugins/http-route-dispatch.ts +389 -0
- package/src/plugins/http-wire.ts +180 -0
- package/src/plugins/index.ts +97 -3
- package/src/plugins/install-finalization.ts +77 -0
- package/src/plugins/lifecycle.ts +47 -0
- package/src/plugins/manager.ts +5 -2
- package/src/plugins/manifest-schema.ts +314 -58
- package/src/plugins/media.ts +166 -0
- package/src/plugins/request-meta.ts +12 -2
- package/src/plugins/route-wire.ts +304 -0
- package/src/plugins/routes.ts +38 -5
- package/src/plugins/sandbox/index.ts +4 -0
- package/src/plugins/sandbox/proxy.ts +129 -0
- package/src/plugins/sandbox/types.ts +83 -7
- package/src/plugins/secret-redactor.ts +65 -0
- package/src/plugins/settings.ts +303 -0
- package/src/plugins/state.ts +26 -0
- package/src/plugins/storage-query.ts +45 -0
- package/src/plugins/storage-update.ts +96 -0
- package/src/plugins/types.ts +602 -15
- package/src/query.ts +84 -4
- package/src/registry/authoritative-records.ts +26 -0
- package/src/registry/config.ts +182 -31
- package/src/registry/testing.ts +100 -0
- package/src/registry/types.ts +12 -70
- package/src/scheduled-publish.ts +70 -3
- package/src/schema/collection-slugs-cache.ts +157 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/registry.ts +64 -1
- package/src/schema/types.ts +32 -6
- package/src/schema/zod-generator.ts +5 -13
- package/src/search/fts-manager.ts +3 -3
- package/src/search/query.ts +32 -5
- package/src/search/types.ts +8 -0
- package/src/security/ssrf.ts +167 -141
- package/src/seed/apply.ts +41 -3
- package/src/seed/types.ts +13 -3
- package/src/seed/validate.ts +18 -1
- package/src/seo/hreflang.ts +10 -6
- package/src/seo/index.ts +5 -10
- package/src/seo/media-url.ts +26 -0
- package/src/settings/index.ts +53 -11
- package/src/taxonomies/term-counts.ts +22 -5
- package/src/visual-editing/action-token.ts +31 -0
- package/src/visual-editing/toolbar-bootstrap.ts +31 -6
- package/src/visual-editing/toolbar.ts +103 -12
- package/src/widgets/archives.ts +10 -9
- package/src/widgets/index.ts +11 -1
- package/dist/activation-K0kGBWuJ.mjs +0 -382
- package/dist/activation-K0kGBWuJ.mjs.map +0 -1
- package/dist/adapters-BDQwg236.d.mts +0 -171
- package/dist/adapters-BDQwg236.d.mts.map +0 -1
- package/dist/after-CBU2vkoO.mjs +0 -96
- package/dist/after-CBU2vkoO.mjs.map +0 -1
- package/dist/allowed-origins-BGglilcs.mjs +0 -116
- package/dist/allowed-origins-BGglilcs.mjs.map +0 -1
- package/dist/api-Dz6rgoa3.mjs +0 -10040
- package/dist/api-Dz6rgoa3.mjs.map +0 -1
- package/dist/api-tokens-BSsQACNe.mjs +0 -163
- package/dist/api-tokens-BSsQACNe.mjs.map +0 -1
- package/dist/apply-B4SIOxR1.mjs +0 -980
- package/dist/apply-B4SIOxR1.mjs.map +0 -1
- package/dist/authorize-Bkf_UHhD.mjs +0 -40
- package/dist/authorize-Bkf_UHhD.mjs.map +0 -1
- package/dist/backup-rwVAl9NI.mjs +0 -241
- package/dist/backup-rwVAl9NI.mjs.map +0 -1
- package/dist/base64-CvLhUKQv.mjs +0 -63
- package/dist/base64-CvLhUKQv.mjs.map +0 -1
- package/dist/bundle-C8S2Zl6U.mjs +0 -663
- package/dist/bundle-C8S2Zl6U.mjs.map +0 -1
- package/dist/byline-DuhF7NWl.mjs +0 -902
- package/dist/byline-DuhF7NWl.mjs.map +0 -1
- package/dist/byline-fields-BovY4KYM.mjs +0 -123
- package/dist/byline-fields-BovY4KYM.mjs.map +0 -1
- package/dist/byline-registry-Bpu9-MVs.mjs +0 -406
- package/dist/byline-registry-Bpu9-MVs.mjs.map +0 -1
- package/dist/bylines-CJ5nd6Lw.mjs +0 -232
- package/dist/bylines-CJ5nd6Lw.mjs.map +0 -1
- package/dist/bylines-RwBAeOF1.mjs +0 -214
- package/dist/bylines-RwBAeOF1.mjs.map +0 -1
- package/dist/cache-BF5Kvn59.mjs +0 -108
- package/dist/cache-BF5Kvn59.mjs.map +0 -1
- package/dist/capture-triggers-CNW1q3HK.mjs +0 -362
- package/dist/capture-triggers-CNW1q3HK.mjs.map +0 -1
- package/dist/challenge-store-DQN_Yrck.mjs +0 -51
- package/dist/challenge-store-DQN_Yrck.mjs.map +0 -1
- package/dist/chrome-tags-D8fiZG94.mjs +0 -24
- package/dist/chrome-tags-D8fiZG94.mjs.map +0 -1
- package/dist/chunks-C4szrD8o.mjs +0 -25
- package/dist/chunks-C4szrD8o.mjs.map +0 -1
- package/dist/collection-deletion-Bj07NHbj.mjs +0 -436
- package/dist/collection-deletion-Bj07NHbj.mjs.map +0 -1
- package/dist/comment-reaction-BhrvSHml.mjs +0 -85
- package/dist/comment-reaction-BhrvSHml.mjs.map +0 -1
- package/dist/comment-vxOzWbZN.mjs +0 -255
- package/dist/comment-vxOzWbZN.mjs.map +0 -1
- package/dist/comments-Ct4ensnf.mjs +0 -204
- package/dist/comments-Ct4ensnf.mjs.map +0 -1
- package/dist/components-DJbo1z0S.mjs +0 -108
- package/dist/components-DJbo1z0S.mjs.map +0 -1
- package/dist/config-B9eZ340f.d.mts +0 -34
- package/dist/config-B9eZ340f.d.mts.map +0 -1
- package/dist/config-C3EBstHi.mjs +0 -72
- package/dist/config-C3EBstHi.mjs.map +0 -1
- package/dist/config-it29yDLA.mjs +0 -1163
- package/dist/config-it29yDLA.mjs.map +0 -1
- package/dist/content-DjvM0T92.mjs +0 -1725
- package/dist/content-DjvM0T92.mjs.map +0 -1
- package/dist/content-list-query-Btqd4uV2.d.mts +0 -26
- package/dist/content-list-query-Btqd4uV2.d.mts.map +0 -1
- package/dist/content-refresh-Bwp-8yGy.mjs +0 -3588
- package/dist/content-refresh-Bwp-8yGy.mjs.map +0 -1
- package/dist/content-repair-Czdp7jz5.mjs +0 -440
- package/dist/content-repair-Czdp7jz5.mjs.map +0 -1
- package/dist/context-CX6gxOLW.mjs +0 -1068
- package/dist/context-CX6gxOLW.mjs.map +0 -1
- package/dist/cron-C6o7VppJ.mjs +0 -277
- package/dist/cron-C6o7VppJ.mjs.map +0 -1
- package/dist/dashboard-C2kTeeRI.mjs +0 -140
- package/dist/dashboard-C2kTeeRI.mjs.map +0 -1
- package/dist/db-errors-Cl-sKYTm.mjs +0 -55
- package/dist/db-errors-Cl-sKYTm.mjs.map +0 -1
- package/dist/default-Clra32mw.mjs +0 -81
- package/dist/default-Clra32mw.mjs.map +0 -1
- package/dist/deferred-tasks-CvDETTJO.d.mts +0 -9
- package/dist/deferred-tasks-CvDETTJO.d.mts.map +0 -1
- package/dist/dev-typegen-DzOPfsNj.mjs +0 -29
- package/dist/dev-typegen-DzOPfsNj.mjs.map +0 -1
- package/dist/device-flow-D2oCWvLJ.mjs +0 -466
- package/dist/device-flow-D2oCWvLJ.mjs.map +0 -1
- package/dist/dialect-helpers-BSbfaO3F.mjs +0 -202
- package/dist/dialect-helpers-BSbfaO3F.mjs.map +0 -1
- package/dist/direct-executor-Bfa5_ToE.mjs +0 -85
- package/dist/direct-executor-Bfa5_ToE.mjs.map +0 -1
- package/dist/dist-89xCrGqi.mjs +0 -810
- package/dist/dist-89xCrGqi.mjs.map +0 -1
- package/dist/email-console-Dzb6uGYa.mjs +0 -50
- package/dist/email-console-Dzb6uGYa.mjs.map +0 -1
- package/dist/enrich-BX0IDp4z.mjs +0 -194
- package/dist/enrich-BX0IDp4z.mjs.map +0 -1
- package/dist/error-DFrQjppn.mjs +0 -90
- package/dist/error-DFrQjppn.mjs.map +0 -1
- package/dist/errors-DsVoDUjJ.mjs +0 -427
- package/dist/errors-DsVoDUjJ.mjs.map +0 -1
- package/dist/escape-HmHTC1Is.mjs +0 -9
- package/dist/escape-HmHTC1Is.mjs.map +0 -1
- package/dist/field-defs-cache-BM4SIRqH.mjs +0 -77
- package/dist/field-defs-cache-BM4SIRqH.mjs.map +0 -1
- package/dist/focal-point-BeWFo6Xx.mjs +0 -23
- package/dist/focal-point-BeWFo6Xx.mjs.map +0 -1
- package/dist/fts-manager-Do1BlW2r.mjs +0 -413
- package/dist/fts-manager-Do1BlW2r.mjs.map +0 -1
- package/dist/hash-3JJPlHF2.mjs +0 -37
- package/dist/hash-3JJPlHF2.mjs.map +0 -1
- package/dist/hook-result-DCh2WUpe.d.mts +0 -31
- package/dist/hook-result-DCh2WUpe.d.mts.map +0 -1
- package/dist/hreflang-B6hbAuuO.d.mts +0 -48
- package/dist/hreflang-B6hbAuuO.d.mts.map +0 -1
- package/dist/hreflang-DQbPZliA.mjs +0 -102
- package/dist/hreflang-DQbPZliA.mjs.map +0 -1
- package/dist/identity-DksvEazf.mjs +0 -35
- package/dist/identity-DksvEazf.mjs.map +0 -1
- package/dist/import-CJpaBBBT.mjs +0 -2020
- package/dist/import-CJpaBBBT.mjs.map +0 -1
- package/dist/index-BJNMCWmu.d.mts +0 -6562
- package/dist/index-BJNMCWmu.d.mts.map +0 -1
- package/dist/index-Du8K7bWa.d.mts +0 -278
- package/dist/index-Du8K7bWa.d.mts.map +0 -1
- package/dist/init-lock-DJkX6Hto.mjs +0 -56
- package/dist/init-lock-DJkX6Hto.mjs.map +0 -1
- package/dist/load-CawHjTOH.mjs +0 -28
- package/dist/load-CawHjTOH.mjs.map +0 -1
- package/dist/loader-Z8vl7zTq.mjs +0 -966
- package/dist/loader-Z8vl7zTq.mjs.map +0 -1
- package/dist/manifest-builder-COtzuca2.mjs +0 -189
- package/dist/manifest-builder-COtzuca2.mjs.map +0 -1
- package/dist/manifest-schema-BNWwR8Vd.mjs +0 -301
- package/dist/manifest-schema-BNWwR8Vd.mjs.map +0 -1
- package/dist/media-BBm8Wg3f.mjs +0 -318
- package/dist/media-BBm8Wg3f.mjs.map +0 -1
- package/dist/media-BHjus86Y.mjs +0 -464
- package/dist/media-BHjus86Y.mjs.map +0 -1
- package/dist/media-allowlist-CoTBWoDp.mjs +0 -44
- package/dist/media-allowlist-CoTBWoDp.mjs.map +0 -1
- package/dist/media-folders-BGkATs8n.mjs +0 -210
- package/dist/media-folders-BGkATs8n.mjs.map +0 -1
- package/dist/media-upload-BCidR-EY.mjs +0 -147
- package/dist/media-upload-BCidR-EY.mjs.map +0 -1
- package/dist/media-url-DHoPr0hq.mjs +0 -26
- package/dist/media-url-DHoPr0hq.mjs.map +0 -1
- package/dist/media-usage-CdY5jhSR.mjs +0 -1833
- package/dist/media-usage-CdY5jhSR.mjs.map +0 -1
- package/dist/media-usage-activation-BgeMtK5C.mjs +0 -78
- package/dist/media-usage-activation-BgeMtK5C.mjs.map +0 -1
- package/dist/media-usage-work-CnGCdHxx.mjs +0 -152
- package/dist/media-usage-work-CnGCdHxx.mjs.map +0 -1
- package/dist/media-usage-work-D6D9sMCA.mjs +0 -586
- package/dist/media-usage-work-D6D9sMCA.mjs.map +0 -1
- package/dist/media-usage-write-fence-hjeD4u7s.mjs +0 -42
- package/dist/media-usage-write-fence-hjeD4u7s.mjs.map +0 -1
- package/dist/menus-6qSwTNxG.mjs +0 -4010
- package/dist/menus-6qSwTNxG.mjs.map +0 -1
- package/dist/menus-uvPLXMZf.mjs +0 -744
- package/dist/menus-uvPLXMZf.mjs.map +0 -1
- package/dist/mime-CUIG6x84.mjs +0 -36
- package/dist/mime-CUIG6x84.mjs.map +0 -1
- package/dist/mode-DN_WneRx.mjs +0 -23
- package/dist/mode-DN_WneRx.mjs.map +0 -1
- package/dist/node-sqlite-compat-BuJXIeMz.mjs +0 -46
- package/dist/node-sqlite-compat-BuJXIeMz.mjs.map +0 -1
- package/dist/normalize-C2xNjTSG.mjs +0 -191
- package/dist/normalize-C2xNjTSG.mjs.map +0 -1
- package/dist/oauth-authorization-Dj6Kwc21.mjs +0 -274
- package/dist/oauth-authorization-Dj6Kwc21.mjs.map +0 -1
- package/dist/oauth-clients-FD7I0J8m.mjs +0 -266
- package/dist/oauth-clients-FD7I0J8m.mjs.map +0 -1
- package/dist/oauth-state-store-DkmDOmHs.mjs +0 -50
- package/dist/oauth-state-store-DkmDOmHs.mjs.map +0 -1
- package/dist/oauth-user-lookup-CvIwGpYd.mjs +0 -26
- package/dist/oauth-user-lookup-CvIwGpYd.mjs.map +0 -1
- package/dist/object-cache-DVKnyOfy.mjs +0 -534
- package/dist/object-cache-DVKnyOfy.mjs.map +0 -1
- package/dist/options-BHPeIbBd.mjs +0 -117
- package/dist/options-BHPeIbBd.mjs.map +0 -1
- package/dist/options-CYb4y7hM.d.mts +0 -221
- package/dist/options-CYb4y7hM.d.mts.map +0 -1
- package/dist/parse-Ckpg-Qfp.mjs +0 -81
- package/dist/parse-Ckpg-Qfp.mjs.map +0 -1
- package/dist/passkey-config-O_lj3y0k.mjs +0 -46
- package/dist/passkey-config-O_lj3y0k.mjs.map +0 -1
- package/dist/patterns-D9iDO3j8.mjs +0 -145
- package/dist/patterns-D9iDO3j8.mjs.map +0 -1
- package/dist/placeholder-4X9BrRrp.d.mts +0 -306
- package/dist/placeholder-4X9BrRrp.d.mts.map +0 -1
- package/dist/policy-Dhtwntrt.mjs +0 -45
- package/dist/policy-Dhtwntrt.mjs.map +0 -1
- package/dist/portable-text-U85hOafW.mjs +0 -286
- package/dist/portable-text-U85hOafW.mjs.map +0 -1
- package/dist/preview-B_vJLvf8.mjs +0 -107
- package/dist/preview-B_vJLvf8.mjs.map +0 -1
- package/dist/protocol-JdD2YhY9.d.mts +0 -52
- package/dist/protocol-JdD2YhY9.d.mts.map +0 -1
- package/dist/public-url-CarhZJgf.mjs +0 -101
- package/dist/public-url-CarhZJgf.mjs.map +0 -1
- package/dist/query-BZKZcG5b.mjs +0 -881
- package/dist/query-BZKZcG5b.mjs.map +0 -1
- package/dist/query-BndaFxxp.mjs +0 -41
- package/dist/query-BndaFxxp.mjs.map +0 -1
- package/dist/rate-limit-BZmATC6W.mjs +0 -120
- package/dist/rate-limit-BZmATC6W.mjs.map +0 -1
- package/dist/redirect-CZkbozu9.mjs +0 -313
- package/dist/redirect-CZkbozu9.mjs.map +0 -1
- package/dist/redirect-CzqnLxK-.mjs +0 -17
- package/dist/redirect-CzqnLxK-.mjs.map +0 -1
- package/dist/redirects-BLNOWQTn.mjs +0 -1238
- package/dist/redirects-BLNOWQTn.mjs.map +0 -1
- package/dist/redirects-CqzNM0KM.mjs +0 -579
- package/dist/redirects-CqzNM0KM.mjs.map +0 -1
- package/dist/registry-AZAsRsor.mjs +0 -1179
- package/dist/registry-AZAsRsor.mjs.map +0 -1
- package/dist/relation-04DfKRTO.mjs +0 -334
- package/dist/relation-04DfKRTO.mjs.map +0 -1
- package/dist/relations-C4htk5sb.mjs +0 -309
- package/dist/relations-C4htk5sb.mjs.map +0 -1
- package/dist/relations-CcFwDJdJ.mjs +0 -403
- package/dist/relations-CcFwDJdJ.mjs.map +0 -1
- package/dist/relations-DnRK4YIT.d.mts +0 -3354
- package/dist/relations-DnRK4YIT.d.mts.map +0 -1
- package/dist/request-cache-DH9zdCOD.mjs +0 -104
- package/dist/request-cache-DH9zdCOD.mjs.map +0 -1
- package/dist/request-meta-DYxLlnmz.mjs +0 -140
- package/dist/request-meta-DYxLlnmz.mjs.map +0 -1
- package/dist/resolve-prZ3mP7l.mjs +0 -143
- package/dist/resolve-prZ3mP7l.mjs.map +0 -1
- package/dist/runner-BLIDKpmA.mjs +0 -4676
- package/dist/runner-BLIDKpmA.mjs.map +0 -1
- package/dist/runner-YKfIMnaF.d.mts +0 -67
- package/dist/runner-YKfIMnaF.d.mts.map +0 -1
- package/dist/schema-CGnBeLiW.mjs +0 -9
- package/dist/schema-CGnBeLiW.mjs.map +0 -1
- package/dist/schema-DYr-Vd-L.mjs +0 -420
- package/dist/schema-DYr-Vd-L.mjs.map +0 -1
- package/dist/scopes-BhWvBavj.mjs +0 -27
- package/dist/scopes-BhWvBavj.mjs.map +0 -1
- package/dist/search-C-qDk4kx.mjs +0 -439
- package/dist/search-C-qDk4kx.mjs.map +0 -1
- package/dist/secrets-rEtHt-6z.mjs +0 -330
- package/dist/secrets-rEtHt-6z.mjs.map +0 -1
- package/dist/sections-B_nYvlwn.mjs +0 -346
- package/dist/sections-B_nYvlwn.mjs.map +0 -1
- package/dist/seo-926NRIgt.mjs +0 -133
- package/dist/seo-926NRIgt.mjs.map +0 -1
- package/dist/seo-CVWkdv6x.mjs +0 -113
- package/dist/seo-CVWkdv6x.mjs.map +0 -1
- package/dist/service-CJl3ZAYs.mjs +0 -195
- package/dist/service-CJl3ZAYs.mjs.map +0 -1
- package/dist/session-user-BlMgqCHS.mjs +0 -51
- package/dist/session-user-BlMgqCHS.mjs.map +0 -1
- package/dist/settings--wobrkkC.mjs +0 -258
- package/dist/settings--wobrkkC.mjs.map +0 -1
- package/dist/settings-Cwm6o2jY.mjs +0 -51
- package/dist/settings-Cwm6o2jY.mjs.map +0 -1
- package/dist/setup-complete-DQbClIN2.mjs +0 -26
- package/dist/setup-complete-DQbClIN2.mjs.map +0 -1
- package/dist/setup-nonce-DZCFS2sn.mjs +0 -25
- package/dist/setup-nonce-DZCFS2sn.mjs.map +0 -1
- package/dist/single-flight-cache-BPuGPdcN.mjs +0 -104
- package/dist/single-flight-cache-BPuGPdcN.mjs.map +0 -1
- package/dist/site-url-BrxA_E9H.mjs +0 -16
- package/dist/site-url-BrxA_E9H.mjs.map +0 -1
- package/dist/slugify-B994zkXC.mjs +0 -17
- package/dist/slugify-B994zkXC.mjs.map +0 -1
- package/dist/snapshot--OCDTqdb.mjs +0 -216
- package/dist/snapshot--OCDTqdb.mjs.map +0 -1
- package/dist/ssrf-5sIM5jzl.mjs +0 -349
- package/dist/ssrf-5sIM5jzl.mjs.map +0 -1
- package/dist/state-BpFVsJZB.mjs +0 -136
- package/dist/state-BpFVsJZB.mjs.map +0 -1
- package/dist/status-B777-dXz.mjs +0 -30
- package/dist/status-B777-dXz.mjs.map +0 -1
- package/dist/target-BmR0iTwz.mjs +0 -27
- package/dist/target-BmR0iTwz.mjs.map +0 -1
- package/dist/taxonomies-DkAkMupr.mjs +0 -837
- package/dist/taxonomies-DkAkMupr.mjs.map +0 -1
- package/dist/taxonomies-Wfy_Lg12.mjs +0 -698
- package/dist/taxonomies-Wfy_Lg12.mjs.map +0 -1
- package/dist/taxonomy-tJepplLL.mjs +0 -484
- package/dist/taxonomy-tJepplLL.mjs.map +0 -1
- package/dist/tokens-BCO1oruF.mjs +0 -171
- package/dist/tokens-BCO1oruF.mjs.map +0 -1
- package/dist/transaction-0KOpOyMu.mjs +0 -29
- package/dist/transaction-0KOpOyMu.mjs.map +0 -1
- package/dist/transport-Dr3qtwXC.mjs +0 -136
- package/dist/transport-Dr3qtwXC.mjs.map +0 -1
- package/dist/transport-xh6YKW2G.d.mts +0 -42
- package/dist/transport-xh6YKW2G.d.mts.map +0 -1
- package/dist/trusted-proxy-BR5F1Otp.mjs +0 -51
- package/dist/trusted-proxy-BR5F1Otp.mjs.map +0 -1
- package/dist/types-3qNFPlci.mjs +0 -16
- package/dist/types-3qNFPlci.mjs.map +0 -1
- package/dist/types-75KIqzL9.mjs +0 -142
- package/dist/types-75KIqzL9.mjs.map +0 -1
- package/dist/types-B6GrPic4.d.mts +0 -1335
- package/dist/types-B6GrPic4.d.mts.map +0 -1
- package/dist/types-BuHW4xDE.d.mts +0 -259
- package/dist/types-BuHW4xDE.d.mts.map +0 -1
- package/dist/types-C00oyCZp.d.mts +0 -198
- package/dist/types-C00oyCZp.d.mts.map +0 -1
- package/dist/types-CDtkNSFQ.d.mts +0 -75
- package/dist/types-CDtkNSFQ.d.mts.map +0 -1
- package/dist/types-CPeXo1wF.d.mts +0 -124
- package/dist/types-CPeXo1wF.d.mts.map +0 -1
- package/dist/types-CQPWhPxE.mjs +0 -92
- package/dist/types-CQPWhPxE.mjs.map +0 -1
- package/dist/types-CXFkwEGC.d.mts +0 -198
- package/dist/types-CXFkwEGC.d.mts.map +0 -1
- package/dist/types-DM3vioBY.mjs +0 -18
- package/dist/types-DM3vioBY.mjs.map +0 -1
- package/dist/types-DczELMop.d.mts +0 -363
- package/dist/types-DczELMop.d.mts.map +0 -1
- package/dist/types-DfuTR6dL.mjs +0 -3
- package/dist/types-FV23hEoW.d.mts +0 -743
- package/dist/types-FV23hEoW.d.mts.map +0 -1
- package/dist/types-xDMtUFnO.d.mts +0 -257
- package/dist/types-xDMtUFnO.d.mts.map +0 -1
- package/dist/upload-attempts-BsqoQ1fn.mjs +0 -27
- package/dist/upload-attempts-BsqoQ1fn.mjs.map +0 -1
- package/dist/url-pattern-D4c2czpJ.mjs +0 -33
- package/dist/url-pattern-D4c2czpJ.mjs.map +0 -1
- package/dist/user-BTZ40aq6.mjs +0 -171
- package/dist/user-BTZ40aq6.mjs.map +0 -1
- package/dist/utils-BKvNjjhY.mjs +0 -435
- package/dist/utils-BKvNjjhY.mjs.map +0 -1
- package/dist/validate-BpwoDOgt.mjs +0 -120
- package/dist/validate-BpwoDOgt.mjs.map +0 -1
- package/dist/validate-DE_LRwo9.mjs +0 -379
- package/dist/validate-DE_LRwo9.mjs.map +0 -1
- package/dist/validate-DUP27OYD.d.mts +0 -400
- package/dist/validate-DUP27OYD.d.mts.map +0 -1
- package/dist/validation-BMImFJ11.mjs +0 -153
- package/dist/validation-BMImFJ11.mjs.map +0 -1
- package/dist/version-Bii3suaO.mjs +0 -7
- package/dist/version-Bii3suaO.mjs.map +0 -1
- package/dist/widgets-D3gJ10xU.mjs +0 -122
- package/dist/widgets-D3gJ10xU.mjs.map +0 -1
- package/dist/wxr-taxonomies-B2Og_6rU.d.mts +0 -34
- package/dist/wxr-taxonomies-B2Og_6rU.d.mts.map +0 -1
- package/dist/wxr-taxonomies-Cxngsjwo.mjs +0 -406
- package/dist/wxr-taxonomies-Cxngsjwo.mjs.map +0 -1
- package/dist/zod-generator-BuYSQJB7.mjs +0 -331
- package/dist/zod-generator-BuYSQJB7.mjs.map +0 -1
- /package/dist/{api-tokens-BfYts-sq.mjs → api-tokens-DS1VzN7_.mjs} +0 -0
- /package/dist/{ssrf-Dg3cIT-b.mjs → ssrf-BRpTDMV6.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-types.d.mts","names":[],"sources":["../src/plugin-types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-types.d.mts","names":[],"sources":["../src/plugin-types.ts"],"mappings":";;;;;;;;;;;;;;;UAmHiB,YAAA;EAChB,gBAAA,EAAkB,gBAAA;EAClB,iBAAA,EAAmB,gBAAA;EACnB,mBAAA,EAAqB,gBAAA;EACrB,kBAAA,EAAoB,gBAAA;EACpB,oBAAA,EAAsB,wBAAA;EACtB,mBAAA,EAAqB,uBAAA;EACrB,sBAAA,EAAwB,0BAAA;EACxB,qBAAA,EAAuB,yBAAA;EACvB,uBAAA,EAAyB,2BAAA;EACzB,wBAAA,EAA0B,4BAAA;EAC1B,yBAAA,EAA2B,6BAAA;EAC3B,sBAAA,EAAwB,0BAAA;EACxB,wBAAA,EAA0B,4BAAA;EAC1B,sBAAA,EAAwB,0BAAA;EACxB,uBAAA,EAAyB,2BAAA;EACzB,yBAAA,EAA2B,6BAAA;EAC3B,oBAAA,EAAsB,wBAAA;EACtB,mBAAA,EAAqB,uBAAA;EACrB,IAAA,EAAM,WAAA;EACN,kBAAA,EAAoB,sBAAA;EACpB,eAAA,EAAiB,mBAAA;EACjB,iBAAA,EAAmB,qBAAA;EACnB,sBAAA,EAAwB,0BAAA;EACxB,kBAAA,EAAoB,sBAAA;EACpB,qBAAA,EAAuB,yBAAA;EACvB,uBAAA,EAAyB,2BAAA;EACzB,eAAA,EAAiB,mBAAA;EACjB,gBAAA,EAAkB,mBAAA;AAAA;;;;;;;UASF,UAAA,iBAA2B,YAAA;EAC3C,OAAA,EAAS,YAAA,CAAa,CAAA;EACtB,QAAA;EACA,OAAA;EACA,YAAA;EACA,WAAA;EACA,SAAA;AAAA;;;;;AAND;KAcY,SAAA,iBAA0B,YAAA,IAAgB,YAAA,CAAa,CAAA,IAAK,UAAA,CAAW,CAAA;;;;;;;;;;;;;;;;UAiBlE,gBAAA;EAChB,GAAA;EACA,MAAA;EACA,OAAA,EAAS,MAAA;AAAA;AAAA,KAUE,gBAAA,eAA+B,mBAAA,IAAuB,KAAA,kBAC/D,kBAAA,GACA,KAAA,2BAEC,KAAA,mBACC,UAAA,GACA,KAAA,uBACC,gBAAA;AAAA,KAGM,kBAAA;EACP,IAAA;EAAc,KAAA;AAAA;EACd,IAAA;EAAe,KAAA,EAAO,UAAA;AAAA;AAAA,UAEV,kBAAA;EAChB,MAAA;EACA,OAAA,GAAU,WAAA;EACV,IAAA,GAAO,kBAAA;AAAA;AAAA,UAGS,cAAA;EAAA,SACP,sBAAA;EAAA,SACA,MAAA;EAAA,SACA,OAAA,EAAS,KAAA;EAAA,SACT,IAAA,EAAM,kBAAA;AAAA;AAAA,iBAGA,cAAA,CAAe,IAAA,GAAM,kBAAA,GAA0B,cAAA;;;;;;AA3B/D;;;UA8CiB,qBAAA;EAChB,KAAA;EACA,OAAA,EAAS,gBAAA;EACT,WAAA;EA7CG;EA+CH,EAAA,GAAK,iBAAA;EA7CD;;;;;;EAoDJ,IAAA,GAAO,QAAA;AAAA;;;;;;;;AAhDR;;KA4DY,YAAA;EACX,cAAA,CACC,QAAA,EAAU,IAAA,CAAK,qBAAA;IAAoC,KAAA,EAAO,MAAA;EAAA,GAC1D,GAAA,EAAK,aAAA,GACH,OAAA;AAAA;AAAA,UAGM,eAAA;EACT,MAAA;EACA,YAAA;EACA,KAAA;EACA,UAAA,GAAa,UAAA;EACb,OAAA,GAAU,iBAAA;EACV,QAAA,GAAW,uBAAA;AAAA;AAAA,KAGA,iBAAA,eAAgC,mBAAA,IAAuB,eAAA;EAClE,OAAA,EAAS,kBAAA;IAAuB,IAAA,EAAM,KAAA;EAAA;EACtC,OAAA,EAAS,YAAA,CAAa,gBAAA,CAAiB,KAAA;AAAA;AAAA,iBAGxB,WAAA,eAA0B,mBAAA,CAAA,CACzC,MAAA,EAAQ,iBAAA,CAAkB,KAAA,IACxB,iBAAA,CAAkB,KAAA;AAzErB;;;;AAAA,KAiFY,UAAA,GACT,YAAA,IACC,eAAA;EACD,OAAA,EAAS,YAAA;EACT,OAAA,GAAU,kBAAA;AAAA;AAAA,UAGI,gBAAA;EAChB,WAAA;EACA,KAAA;EACA,KAAA,EAAO,OAAA;EACP,MAAA,GAAS,OAAA;EACT,WAAA;AAAA;;;;;;;AAnED;;;UA+EiB,eAAA;EAChB,KAAA,iBACa,YAAA,IAAgB,CAAA,gCACzB,iCAAA,GAAoC,gCAAA,GACpC,SAAA,CAAU,CAAA;EAEd,MAAA,GAAS,MAAA,SAAe,UAAA;EACxB,GAAA;IAAQ,KAAA,EAAO,MAAA,SAAe,gBAAA;EAAA;AAAA;AAAA,KAGnB,iCAAA,IACX,KAAA,EAAO,gBAAA,EACP,GAAA,EAAK,aAAA,KACD,OAAA,CAAQ,MAAA,oBAA0B,wBAAA;AAAA,UAEtB,gCAAA,SAAyC,IAAA,CACzD,UAAA;EAGA,OAAA,EAAS,iCAAA;AAAA"}
|
package/dist/plugin-types.mjs
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/plugin-types.ts
|
|
2
|
+
function pluginResponse(init = {}) {
|
|
3
|
+
const headers = [];
|
|
4
|
+
new Headers(init.headers).forEach((value, name) => headers.push([name, value]));
|
|
5
|
+
return {
|
|
6
|
+
__emdashPluginResponse: true,
|
|
7
|
+
status: init.status ?? 200,
|
|
8
|
+
headers,
|
|
9
|
+
body: init.body ?? null
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function pluginRoute(config) {
|
|
13
|
+
return config;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { pluginResponse, pluginRoute };
|
|
18
|
+
//# sourceMappingURL=plugin-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-types.mjs","names":[],"sources":["../src/plugin-types.ts"],"sourcesContent":["/**\n * `emdash/plugin` — types and lightweight helpers for authoring sandboxed plugins.\n *\n * Type-only imports erase normally. The value exports are small identity and\n * response-builder helpers that the plugin CLI bundles into the sandbox\n * artifact without pulling in the EmDash runtime.\n *\n * Recommended authoring pattern:\n *\n * ```ts\n * import type { SandboxedPlugin } from \"emdash/plugin\";\n *\n * export default {\n * hooks: {\n * \"content:beforeSave\": async (event, ctx) => {\n * // event: ContentHookEvent, ctx: PluginContext — both inferred.\n * return event.content;\n * },\n * },\n * routes: {\n * health: async (routeCtx, ctx) => ({ ok: true }),\n * },\n * } satisfies SandboxedPlugin;\n * ```\n *\n * The `satisfies SandboxedPlugin` annotation drives full inference on\n * every hook handler. Authors should not need to annotate handler\n * params — TypeScript reads the event type from the hook name. The\n * runtime probe at build time reads `default.hooks` and `default.routes`\n * directly; the shape declared here mirrors what the probe consumes.\n *\n * Return types matter: `content:beforeSave` may return a mutated\n * `content` to override the saved fields; `content:beforeDelete` and\n * `comment:beforeCreate` may return `false` to veto; `page:metadata`\n * returns the metadata contribution. The mapped type captures these\n * per-hook return contracts so misuse fails at compile time.\n */\n\nimport type { Permission } from \"@emdash-cms/auth\";\nimport type { PluginUiContext } from \"@emdash-cms/blocks/server\";\nimport type {\n\tPluginFormData,\n\tPluginRouteBodyMode,\n\tPluginRouteMethod,\n\tPluginRouteQuery,\n\tPluginRouteRequest,\n\tPluginRouteResponseMode,\n} from \"@emdash-cms/plugin-types\";\nimport type { ZodType } from \"zod\";\n\nimport type { SandboxHookErrorEnvelope } from \"./plugins/sandbox/hook-result.js\";\nimport type {\n\tActorInfo,\n\tCommentAfterCreateEvent,\n\tCommentAfterCreateHandler,\n\tCommentAfterModerateEvent,\n\tCommentAfterModerateHandler,\n\tCommentBeforeCreateEvent,\n\tCommentBeforeCreateHandler,\n\tCommentModerateEvent,\n\tCommentModerateHandler,\n\tContentAfterDeleteHandler,\n\tContentAfterPublishHandler,\n\tContentAfterRestoreHandler,\n\tContentAfterSaveHandler,\n\tContentAfterScheduleHandler,\n\tContentAfterUnpublishHandler,\n\tContentAfterUnscheduleHandler,\n\tContentBeforePublishHandler,\n\tContentBeforeScheduleHandler,\n\tContentBeforeUnpublishHandler,\n\tContentBeforeDeleteHandler,\n\tContentBeforeSaveHandler,\n\tContentDeleteEvent,\n\tContentHookEvent,\n\tContentPublishStateChangeEvent,\n\tContentRestoreStateChangeEvent,\n\tContentScheduleStateChangeEvent,\n\tContentStateChangeEvent,\n\tCronEvent,\n\tCronHandler,\n\tEmailAfterSendEvent,\n\tEmailAfterSendHandler,\n\tEmailBeforeSendEvent,\n\tEmailBeforeSendHandler,\n\tEmailDeliverEvent,\n\tEmailDeliverHandler,\n\tLifecycleEvent,\n\tLifecycleHandler,\n\tMediaAfterUploadEvent,\n\tMediaBytes,\n\tMediaItem,\n\tMediaMetadataPatch,\n\tMediaAfterUploadHandler,\n\tMediaBeforeUploadHandler,\n\tMediaUploadEvent,\n\tPageFragmentEvent,\n\tPageFragmentHandler,\n\tPageMetadataEvent,\n\tPageMetadataHandler,\n\tPluginContext,\n\tUninstallEvent,\n\tUninstallHandler,\n\tUserInfo,\n} from \"./plugins/types.js\";\n\nexport type { PluginUiContext } from \"@emdash-cms/blocks/server\";\n\n/**\n * Map from hook name to its handler signature. Adding or changing a\n * hook signature in the runtime means updating this map; the rest of\n * the type story flows from it. Authors writing\n * `\"content:beforeSave\": async (event, ctx) => { ... }` get `event`\n * typed as `ContentHookEvent` and `ctx` as `PluginContext` for free.\n */\nexport interface HookHandlers {\n\t\"plugin:install\": LifecycleHandler;\n\t\"plugin:activate\": LifecycleHandler;\n\t\"plugin:deactivate\": LifecycleHandler;\n\t\"plugin:uninstall\": UninstallHandler;\n\t\"content:beforeSave\": ContentBeforeSaveHandler;\n\t\"content:afterSave\": ContentAfterSaveHandler;\n\t\"content:beforeDelete\": ContentBeforeDeleteHandler;\n\t\"content:afterDelete\": ContentAfterDeleteHandler;\n\t\"content:beforePublish\": ContentBeforePublishHandler;\n\t\"content:beforeSchedule\": ContentBeforeScheduleHandler;\n\t\"content:beforeUnpublish\": ContentBeforeUnpublishHandler;\n\t\"content:afterPublish\": ContentAfterPublishHandler;\n\t\"content:afterUnpublish\": ContentAfterUnpublishHandler;\n\t\"content:afterRestore\": ContentAfterRestoreHandler;\n\t\"content:afterSchedule\": ContentAfterScheduleHandler;\n\t\"content:afterUnschedule\": ContentAfterUnscheduleHandler;\n\t\"media:beforeUpload\": MediaBeforeUploadHandler;\n\t\"media:afterUpload\": MediaAfterUploadHandler;\n\tcron: CronHandler;\n\t\"email:beforeSend\": EmailBeforeSendHandler;\n\t\"email:deliver\": EmailDeliverHandler;\n\t\"email:afterSend\": EmailAfterSendHandler;\n\t\"comment:beforeCreate\": CommentBeforeCreateHandler;\n\t\"comment:moderate\": CommentModerateHandler;\n\t\"comment:afterCreate\": CommentAfterCreateHandler;\n\t\"comment:afterModerate\": CommentAfterModerateHandler;\n\t\"page:metadata\": PageMetadataHandler;\n\t\"page:fragments\": PageFragmentHandler;\n}\n\n/**\n * Hook-handler config form. The bare-function form is also accepted\n * (see `HookEntry`) — this is the long form that lets authors override\n * priority, timeout, exclusivity. `errorPolicy` and `dependencies` are\n * read by the host but rarely set by authors.\n */\nexport interface HookConfig<K extends keyof HookHandlers> {\n\thandler: HookHandlers[K];\n\tpriority?: number;\n\ttimeout?: number;\n\tdependencies?: string[];\n\terrorPolicy?: \"continue\" | \"abort\";\n\texclusive?: boolean;\n}\n\n/**\n * Either a bare handler or the config form. The build probe accepts\n * both shapes and the runtime normalises to the config form before\n * dispatch.\n */\nexport type HookEntry<K extends keyof HookHandlers> = HookHandlers[K] | HookConfig<K>;\n\n/**\n * Request fields a route handler can rely on across both trusted and\n * sandboxed execution. Trusted handlers receive a real `Request`\n * (which is structurally compatible — has `url`, `method`, `headers`);\n * sandboxed handlers receive a serialised `{ url, method, headers }`\n * record because Worker Loader can't pass `Request` objects across\n * the boundary. The shared shape is what's actually portable.\n *\n * `headers` is intentionally `Record<string, string>` rather than\n * `Headers` so the sandboxed serialised form (which is a plain\n * record) typechecks. Trusted handlers receiving a real `Headers`\n * object can still call `.get(...)`, but reading via this type's\n * indexing requires the lookup to be lowercased and exact. Authors\n * iterating headers in a portable way should use `Object.entries`.\n */\nexport interface SandboxedRequest {\n\turl: string;\n\tmethod: string;\n\theaders: Record<string, string>;\n}\n\nexport type {\n\tPluginFormData,\n\tPluginFormDataFileEntry,\n\tPluginFormDataTextEntry,\n\tPluginRouteQuery,\n} from \"@emdash-cms/plugin-types\";\n\nexport type PluginRouteInput<TMode extends PluginRouteBodyMode> = TMode extends \"none\"\n\t? PluginRouteQuery\n\t: TMode extends \"text\"\n\t\t? string\n\t\t: TMode extends \"bytes\"\n\t\t\t? Uint8Array\n\t\t\t: TMode extends \"form-data\"\n\t\t\t\t? PluginFormData\n\t\t\t\t: unknown;\n\nexport type PluginResponseBody =\n\t| { kind: \"text\"; value: string }\n\t| { kind: \"bytes\"; value: Uint8Array };\n\nexport interface PluginResponseInit {\n\tstatus?: number;\n\theaders?: HeadersInit;\n\tbody?: PluginResponseBody | null;\n}\n\nexport interface PluginResponse {\n\treadonly __emdashPluginResponse: true;\n\treadonly status: number;\n\treadonly headers: Array<[string, string]>;\n\treadonly body: PluginResponseBody | null;\n}\n\nexport function pluginResponse(init: PluginResponseInit = {}): PluginResponse {\n\tconst headers: Array<[string, string]> = [];\n\tnew Headers(init.headers).forEach((value, name) => headers.push([name, value]));\n\treturn {\n\t\t__emdashPluginResponse: true,\n\t\tstatus: init.status ?? 200,\n\t\theaders,\n\t\tbody: init.body ?? null,\n\t};\n}\n\n/**\n * Context passed to a route handler. Routes get an extra `routeCtx`\n * argument with the call-site input + the originating request, in\n * addition to the standard `PluginContext`.\n *\n * `input` is `unknown` because plugins validate it themselves — no\n * central schema for route payloads.\n */\nexport interface SandboxedRouteContext {\n\tinput: unknown;\n\trequest: SandboxedRequest;\n\trequestMeta?: unknown;\n\t/** Host-attested context for a validated Block Kit request. */\n\tui?: PluginUiContext;\n\t/**\n\t * Authenticated caller, if the route is private. Resolved and\n\t * authorized by the host before dispatch — trust it over any user id\n\t * in the request body. `undefined` for public routes and for machine\n\t * tokens with no bound user.\n\t */\n\tuser?: UserInfo;\n}\n\n/**\n * Route handler. The two-arg shape (`routeCtx`, `pluginCtx`) matches\n * how the standard-format runtime invokes routes — distinct from\n * native plugins, where routes take a single context with the input\n * merged in.\n *\n * Return type is `unknown` because routes serialise their return value\n * to JSON for the caller; authors define their own response shape.\n */\nexport type RouteHandler<TInput = unknown> = {\n\tbivarianceHack(\n\t\trouteCtx: Omit<SandboxedRouteContext, \"input\"> & { input: TInput },\n\t\tctx: PluginContext,\n\t): Promise<unknown>;\n}[\"bivarianceHack\"];\n\ninterface RouteConfigBase {\n\tpublic?: boolean;\n\tcacheControl?: string;\n\tinput?: unknown;\n\tpermission?: Permission;\n\tmethods?: PluginRouteMethod[];\n\tresponse?: PluginRouteResponseMode;\n}\n\nexport type PluginRouteConfig<TMode extends PluginRouteBodyMode> = RouteConfigBase & {\n\trequest: PluginRouteRequest & { body: TMode };\n\thandler: RouteHandler<PluginRouteInput<TMode>>;\n};\n\nexport function pluginRoute<TMode extends PluginRouteBodyMode>(\n\tconfig: PluginRouteConfig<TMode>,\n): PluginRouteConfig<TMode> {\n\treturn config;\n}\n\n/**\n * Route entry — either a bare handler or the config form with\n * `public`, `input` schema, and so on. The build probe accepts both.\n */\nexport type RouteEntry =\n\t| RouteHandler\n\t| (RouteConfigBase & {\n\t\t\thandler: RouteHandler;\n\t\t\trequest?: PluginRouteRequest;\n\t });\n\nexport interface SandboxedMcpTool {\n\tdescription: string;\n\troute: string;\n\tinput: ZodType;\n\toutput?: ZodType;\n\tdestructive?: boolean;\n}\n\n/**\n * The shape of a sandboxed plugin's default export.\n *\n * Both `hooks` and `routes` are optional — a plugin that only declares\n * one is valid. Hook keys are constrained to the runtime's hook\n * vocabulary so a typo (`\"content:beforSave\"`) is a compile error.\n * Route keys are open because route names are author-chosen URL path\n * segments.\n */\nexport interface SandboxedPlugin {\n\thooks?: {\n\t\t[K in keyof HookHandlers]?: K extends \"content:beforeSave\"\n\t\t\t? SandboxedContentBeforeSaveHandler | SandboxedContentBeforeSaveConfig\n\t\t\t: HookEntry<K>;\n\t};\n\troutes?: Record<string, RouteEntry>;\n\tmcp?: { tools: Record<string, SandboxedMcpTool> };\n}\n\nexport type SandboxedContentBeforeSaveHandler = (\n\tevent: ContentHookEvent,\n\tctx: PluginContext,\n) => Promise<Record<string, unknown> | SandboxHookErrorEnvelope | void>;\n\nexport interface SandboxedContentBeforeSaveConfig extends Omit<\n\tHookConfig<\"content:beforeSave\">,\n\t\"handler\"\n> {\n\thandler: SandboxedContentBeforeSaveHandler;\n}\n\nexport type { SandboxHookErrorEnvelope };\nexport type { NumericDelta, UpdateIfArgs, UpdateIfResult } from \"./plugins/types.js\";\n\n/**\n * Re-export of event types so plugin authors can reference them\n * explicitly when needed (helper functions, type predicates). Most\n * authors won't need these — the mapped type infers them at handler\n * call sites. But the default-export's inferred type also needs them\n * publicly nameable so `satisfies SandboxedPlugin` can produce a\n * portable `.d.mts`.\n */\nexport type {\n\tActorInfo,\n\tCommentAfterCreateEvent,\n\tCommentAfterModerateEvent,\n\tCommentBeforeCreateEvent,\n\tCommentModerateEvent,\n\tContentDeleteEvent,\n\tContentHookEvent,\n\tContentPublishStateChangeEvent,\n\tContentRestoreStateChangeEvent,\n\tContentScheduleStateChangeEvent,\n\tContentStateChangeEvent,\n\tCronEvent,\n\tEmailAfterSendEvent,\n\tEmailBeforeSendEvent,\n\tEmailDeliverEvent,\n\tLifecycleEvent,\n\tMediaAfterUploadEvent,\n\tMediaBytes,\n\tMediaItem,\n\tMediaMetadataPatch,\n\tMediaUploadEvent,\n\tPageFragmentEvent,\n\tPageMetadataEvent,\n\tPluginContext,\n\tUninstallEvent,\n};\n\nexport type {\n\tPaginatedResult,\n\tVersionedValue,\n\tConditionalWriteResult,\n\tConditionalDeleteResult,\n\tSettingsAccess,\n\tRedirectAccess,\n\tRedirectAccessWithWrite,\n\tRedirectCreateInput,\n\tRedirectInfo,\n\tRedirectListOptions,\n\tRedirectStatus,\n\tRedirectUpdateInput,\n\tVersionedRedirect,\n} from \"./plugins/types.js\";\nexport type {\n\tContentActionOrigin,\n\tContentPolicyDecision,\n\tContentPolicyEvent,\n\tContentSchedulePolicyEvent,\n} from \"./plugins/types.js\";\n"],"mappings":";AA+NA,SAAgB,eAAe,OAA2B,EAAE,EAAkB;CAC7E,MAAM,UAAmC,EAAE;AAC3C,KAAI,QAAQ,KAAK,QAAQ,CAAC,SAAS,OAAO,SAAS,QAAQ,KAAK,CAAC,MAAM,MAAM,CAAC,CAAC;AAC/E,QAAO;EACN,wBAAwB;EACxB,QAAQ,KAAK,UAAU;EACvB;EACA,MAAM,KAAK,QAAQ;EACnB;;AAwDF,SAAgB,YACf,QAC2B;AAC3B,QAAO"}
|
package/dist/plugin-utils.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./types-
|
|
3
|
-
import "./types-
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
1
|
+
import "./parse-tj9XLNO_.mjs";
|
|
2
|
+
import "./types-CbwqGOXm.mjs";
|
|
3
|
+
import "./types-DEHidMEk.mjs";
|
|
4
|
+
import "./options-DAknChnw.mjs";
|
|
5
|
+
import "./entry-lock-DX7QkqEg.mjs";
|
|
6
|
+
import "./config-DS7e4EZ9.mjs";
|
|
7
|
+
import "./runner-3gfxRsJG.mjs";
|
|
8
|
+
import "./storage-query-CPctdMKX.mjs";
|
|
9
|
+
import "./index-CDwKDkTq.mjs";
|
|
10
|
+
import "./types-CCR3ivXE.mjs";
|
|
11
|
+
import "./hreflang-BgS2FqhH.mjs";
|
|
12
|
+
import "./validate-CyQ7I3xF.mjs";
|
|
11
13
|
import { EmDashHandlers } from "./astro/types.mjs";
|
|
12
14
|
|
|
13
15
|
//#region src/plugin-utils.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-utils.d.mts","names":[],"sources":["../src/plugin-utils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-utils.d.mts","names":[],"sources":["../src/plugin-utils.ts"],"mappings":";;;;;;;;;;;;;;;KAYY,2BAAA,GAA8B,cAAA;AAAA,UAEzB,yBAAA;EAChB,MAAA;IACC,0BAAA,GAA6B,2BAAA;EAAA;AAAA;;;;;AAF/B;;iBAYgB,QAAA,CAAS,KAAA,WAAgB,GAAA,GAAM,OAAA,EAAS,IAAA,GAAO,WAAA,GAAc,OAAA,CAAQ,QAAA;;;;;;;iBAYrE,8BAAA,CACf,MAAA,EAAQ,yBAAA,sBACN,2BAAA;;;;;;;;;;;;;;;;;iBAqBmB,gBAAA,GAAA,CACrB,QAAA,EAAU,QAAA,EACV,eAAA,YACE,OAAA,CAAQ,CAAA;;AA1BX;;;;;;;;;AAuBA;;;;;;iBA2BsB,eAAA,CAAgB,QAAA,EAAU,QAAA,EAAU,QAAA,WAAmB,OAAA;;;;;;iBAc7D,QAAA,CAAS,KAAA,YAAiB,KAAA,IAAS,MAAA"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../types-
|
|
3
|
-
import {
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
1
|
+
import "../parse-tj9XLNO_.mjs";
|
|
2
|
+
import "../types-CbwqGOXm.mjs";
|
|
3
|
+
import { pn as ResolvedPlugin } from "../types-DEHidMEk.mjs";
|
|
4
|
+
import "../options-DAknChnw.mjs";
|
|
5
|
+
import "../entry-lock-DX7QkqEg.mjs";
|
|
6
|
+
import { xr as PluginDescriptor } from "../config-DS7e4EZ9.mjs";
|
|
7
|
+
import "../runner-3gfxRsJG.mjs";
|
|
8
|
+
import "../storage-query-CPctdMKX.mjs";
|
|
9
|
+
import "../index-CDwKDkTq.mjs";
|
|
8
10
|
import { SandboxedPlugin } from "../plugin-types.mjs";
|
|
9
|
-
import "../types-
|
|
10
|
-
import "../hreflang-
|
|
11
|
-
import "../validate-
|
|
11
|
+
import "../types-CCR3ivXE.mjs";
|
|
12
|
+
import "../hreflang-BgS2FqhH.mjs";
|
|
13
|
+
import "../validate-CyQ7I3xF.mjs";
|
|
12
14
|
|
|
13
15
|
//#region src/plugins/adapt-sandbox-entry.d.ts
|
|
14
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapt-sandbox-entry.d.mts","names":[],"sources":["../../src/plugins/adapt-sandbox-entry.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"adapt-sandbox-entry.d.mts","names":[],"sources":["../../src/plugins/adapt-sandbox-entry.ts"],"mappings":";;;;;;;;;;;;;;;;AAwJA;;;;;;;;;;;;;iBAAgB,iBAAA,CACf,UAAA,EAAY,eAAA,EACZ,UAAA,EAAY,gBAAA,GACV,cAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { n as PLUGIN_CAPABILITIES, t as HOOK_NAMES } from "../manifest-schema-
|
|
2
|
-
import {
|
|
1
|
+
import { n as PLUGIN_CAPABILITIES, t as HOOK_NAMES } from "../manifest-schema-Bkh8SeHd.mjs";
|
|
2
|
+
import { s as normalizePluginCapabilities } from "../types-k--LneIF.mjs";
|
|
3
|
+
import { n as sanitizeHeadersForSandbox } from "../request-meta-C8yl_sIs.mjs";
|
|
3
4
|
|
|
4
5
|
//#region src/plugins/adapt-sandbox-entry.ts
|
|
5
6
|
/**
|
|
@@ -60,6 +61,9 @@ function normalizeRouteEntry(entry) {
|
|
|
60
61
|
public: entry.public,
|
|
61
62
|
permission: entry.permission,
|
|
62
63
|
cacheControl: entry.cacheControl,
|
|
64
|
+
methods: entry.methods,
|
|
65
|
+
request: entry.request,
|
|
66
|
+
response: entry.response,
|
|
63
67
|
input: entry.input
|
|
64
68
|
};
|
|
65
69
|
}
|
|
@@ -94,18 +98,19 @@ function adaptSandboxEntry(definition, descriptor) {
|
|
|
94
98
|
const usesPublicRouteContext = "id" in definition && typeof definition.id === "string";
|
|
95
99
|
const resolvedRoutes = {};
|
|
96
100
|
if (definition.routes) for (const [routeName, rawEntry] of Object.entries(definition.routes)) {
|
|
97
|
-
const { handler, public: publicFlag, cacheControl, input: inputSchema, permission } = normalizeRouteEntry(rawEntry);
|
|
101
|
+
const { handler, public: publicFlag, cacheControl, methods, request, response, input: inputSchema, permission } = normalizeRouteEntry(rawEntry);
|
|
98
102
|
resolvedRoutes[routeName] = {
|
|
99
103
|
input: inputSchema,
|
|
100
104
|
public: publicFlag,
|
|
101
105
|
permission,
|
|
102
106
|
cacheControl,
|
|
107
|
+
methods,
|
|
108
|
+
request,
|
|
109
|
+
response,
|
|
103
110
|
handler: async (ctx) => {
|
|
104
111
|
if (usesPublicRouteContext) return handler(ctx);
|
|
105
|
-
const
|
|
106
|
-
ctx.request.headers
|
|
107
|
-
headers[name] = value;
|
|
108
|
-
});
|
|
112
|
+
const declaredHeaders = request ? request.headers ?? [] : void 0;
|
|
113
|
+
const headers = sanitizeHeadersForSandbox(ctx.request.headers, declaredHeaders);
|
|
109
114
|
const requestShape = {
|
|
110
115
|
url: ctx.request.url,
|
|
111
116
|
method: ctx.request.method,
|
|
@@ -115,20 +120,18 @@ function adaptSandboxEntry(definition, descriptor) {
|
|
|
115
120
|
input: ctx.input,
|
|
116
121
|
request: requestShape,
|
|
117
122
|
requestMeta: ctx.requestMeta,
|
|
118
|
-
user: ctx.user
|
|
123
|
+
user: ctx.user,
|
|
124
|
+
ui: ctx.ui
|
|
119
125
|
};
|
|
120
|
-
const { input: _, request: __, requestMeta: ___, user: ____, ...pluginCtx } = ctx;
|
|
126
|
+
const { input: _, request: __, requestMeta: ___, user: ____, ui: _____, ...pluginCtx } = ctx;
|
|
121
127
|
return handler(routeCtx, pluginCtx);
|
|
122
128
|
}
|
|
123
129
|
};
|
|
124
130
|
}
|
|
125
131
|
const rawCapabilities = descriptor.capabilities ?? [];
|
|
126
132
|
for (const cap of rawCapabilities) if (!VALID_CAPABILITIES_SET.has(cap)) throw new Error(`Invalid capability "${cap}" in plugin "${pluginId}". Valid capabilities: ${[...VALID_CAPABILITIES_SET].join(", ")}`);
|
|
127
|
-
const capabilities =
|
|
133
|
+
const capabilities = normalizePluginCapabilities(rawCapabilities);
|
|
128
134
|
const allowedHosts = descriptor.allowedHosts ?? [];
|
|
129
|
-
if (capabilities.includes("content:write") && !capabilities.includes("content:read")) capabilities.push("content:read");
|
|
130
|
-
if (capabilities.includes("media:write") && !capabilities.includes("media:read")) capabilities.push("media:read");
|
|
131
|
-
if (capabilities.includes("network:request:unrestricted") && !capabilities.includes("network:request")) capabilities.push("network:request");
|
|
132
135
|
const rawStorage = descriptor.storage ?? {};
|
|
133
136
|
const storage = {};
|
|
134
137
|
for (const [name, config] of Object.entries(rawStorage)) storage[name] = {
|
|
@@ -138,6 +141,8 @@ function adaptSandboxEntry(definition, descriptor) {
|
|
|
138
141
|
const admin = {};
|
|
139
142
|
if (descriptor.adminPages) admin.pages = descriptor.adminPages;
|
|
140
143
|
if (descriptor.adminWidgets) admin.widgets = descriptor.adminWidgets;
|
|
144
|
+
if (descriptor.editorPanels) admin.editorPanels = descriptor.editorPanels;
|
|
145
|
+
if (descriptor.editorActions) admin.editorActions = descriptor.editorActions;
|
|
141
146
|
if (descriptor.settingsSchema) admin.settingsSchema = descriptor.settingsSchema;
|
|
142
147
|
if (descriptor.portableTextBlocks) admin.portableTextBlocks = descriptor.portableTextBlocks;
|
|
143
148
|
if (descriptor.fieldWidgets) admin.fieldWidgets = descriptor.fieldWidgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapt-sandbox-entry.mjs","names":[],"sources":["../../src/plugins/adapt-sandbox-entry.ts"],"sourcesContent":["/**\n * In-Process Adapter for Standard-Format Plugins\n *\n * Converts a standard plugin definition ({ hooks, routes }) into a\n * ResolvedPlugin compatible with HookPipeline. This allows standard-format\n * plugins to run in-process when placed in the `plugins: []` config array.\n *\n * The adapter wraps each hook and route handler so that the PluginContextFactory\n * provides the same capability-gated context as the native path.\n *\n */\n\nimport type { PluginDescriptor } from \"../astro/integration/runtime.js\";\nimport type { RouteEntry, RouteHandler, SandboxedPlugin } from \"../plugin-types.js\";\nimport { PLUGIN_CAPABILITIES, HOOK_NAMES } from \"./manifest-schema.js\";\nimport { normalizeCapabilities } from \"./types.js\";\nimport type {\n\tResolvedPlugin,\n\tResolvedPluginHooks,\n\tResolvedHook,\n\tPluginRoute,\n\tPluginCapability,\n\tPluginStorageConfig,\n\tPluginAdminConfig,\n} from \"./types.js\";\n\n/**\n * Loose per-hook entry shape used inside the adapter's iteration loop.\n *\n * `SandboxedPlugin.hooks` is a mapped type keyed by hook name, so each\n * entry's type depends on the key. When the adapter iterates with\n * `Object.entries`, the key is `string` (TypeScript can't see the\n * narrowing), so we need a *union* type that covers every hook entry\n * shape — bare handler or config form. This is that union, kept local\n * because it has no use outside the adapter.\n */\n// eslint-disable-next-line typescript-eslint/no-explicit-any -- must accept handlers with specific event types across all hook names\ntype AnyHookHandler = (...args: any[]) => Promise<any>;\ntype AnyHookEntry =\n\t| AnyHookHandler\n\t| {\n\t\t\thandler: AnyHookHandler;\n\t\t\tpriority?: number;\n\t\t\ttimeout?: number;\n\t\t\tdependencies?: string[];\n\t\t\terrorPolicy?: \"continue\" | \"abort\";\n\t\t\texclusive?: boolean;\n\t };\n\n/**\n * Default hook configuration values\n */\nconst DEFAULT_PRIORITY = 100;\nconst DEFAULT_TIMEOUT = 5000;\nconst DEFAULT_ERROR_POLICY = \"abort\" as const;\n\n/**\n * Check if a hook entry is the config form (has a `handler` property).\n */\nfunction isHookConfig(entry: AnyHookEntry): entry is Exclude<AnyHookEntry, AnyHookHandler> {\n\treturn typeof entry === \"object\" && entry !== null && \"handler\" in entry;\n}\n\n/**\n * Resolve a single hook entry to a ResolvedHook.\n *\n * Sandboxed-format hooks use the standard two-arg convention:\n * handler(event, ctx)\n *\n * The HookPipeline dispatch methods also call handlers with (event, ctx),\n * so the handler is compatible as-is — we just normalise the\n * surrounding config (priority, timeout, etc.) to its defaults.\n */\nfunction resolveSandboxedHook(entry: AnyHookEntry, pluginId: string): ResolvedHook<AnyHookHandler> {\n\tif (isHookConfig(entry)) {\n\t\treturn {\n\t\t\tpriority: entry.priority ?? DEFAULT_PRIORITY,\n\t\t\ttimeout: entry.timeout ?? DEFAULT_TIMEOUT,\n\t\t\tdependencies: entry.dependencies ?? [],\n\t\t\terrorPolicy: entry.errorPolicy ?? DEFAULT_ERROR_POLICY,\n\t\t\texclusive: entry.exclusive ?? false,\n\t\t\thandler: entry.handler,\n\t\t\tpluginId,\n\t\t};\n\t}\n\n\t// Bare function handler\n\treturn {\n\t\tpriority: DEFAULT_PRIORITY,\n\t\ttimeout: DEFAULT_TIMEOUT,\n\t\tdependencies: [],\n\t\terrorPolicy: DEFAULT_ERROR_POLICY,\n\t\texclusive: false,\n\t\thandler: entry,\n\t\tpluginId,\n\t};\n}\n\n/**\n * Normalise a `RouteEntry` (bare handler or `{ handler, public?, input? }`\n * config) to the config form. The `input` schema is intentionally typed\n * `unknown` in `RouteEntry` — sandboxed plugins describe it loosely\n * because the strict `z.ZodType<TInput>` constraint of the runtime's\n * `PluginRoute` only narrows once the route is wired into the router.\n * The wider type flows through to the runtime which validates at\n * invocation time.\n */\nfunction normalizeRouteEntry(entry: RouteEntry): {\n\thandler: RouteHandler;\n\tpublic?: boolean;\n\tcacheControl?: string;\n\tinput?: PluginRoute[\"input\"];\n\tpermission?: PluginRoute[\"permission\"];\n} {\n\tif (typeof entry === \"function\") {\n\t\treturn { handler: entry };\n\t}\n\treturn {\n\t\thandler: entry.handler,\n\t\tpublic: entry.public,\n\t\tpermission: entry.permission,\n\t\tcacheControl: entry.cacheControl,\n\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- RouteEntry.input is intentionally `unknown` (sandboxed plugins) and validated by the runtime at invocation time\n\t\tinput: entry.input as PluginRoute[\"input\"],\n\t};\n}\n\nconst VALID_CAPABILITIES_SET = new Set<string>(PLUGIN_CAPABILITIES);\n\nconst VALID_HOOK_NAMES_SET = new Set<string>(HOOK_NAMES);\n\n/**\n * Adapt a sandboxed plugin's default export into a ResolvedPlugin.\n *\n * This is the in-process side of sandboxed-format plugins: it takes\n * the `{ hooks, routes }` default export of a sandboxed plugin and\n * produces a `ResolvedPlugin` that enters the HookPipeline alongside\n * native plugins. The descriptor supplies identity (id, version) and\n * the trust contract (capabilities, allowedHosts, storage); the\n * definition supplies behaviour.\n *\n * @param definition - The plugin's default export (matching `SandboxedPlugin` from `emdash/plugin`).\n * @param descriptor - The plugin descriptor with id, version, capabilities, etc.\n * @returns A ResolvedPlugin compatible with HookPipeline.\n */\nexport function adaptSandboxEntry(\n\tdefinition: SandboxedPlugin,\n\tdescriptor: PluginDescriptor,\n): ResolvedPlugin {\n\tconst pluginId = descriptor.id;\n\tconst version = descriptor.version;\n\n\t// A null / array / non-object `definition` would throw a generic\n\t// `TypeError: Cannot read properties of null` further down the\n\t// loop without the plugin id; surface a useful error first.\n\tif (typeof definition !== \"object\" || definition === null || Array.isArray(definition)) {\n\t\tthrow new Error(\n\t\t\t`Plugin \"${pluginId}\" default export must be an object with ` +\n\t\t\t\t`\\`hooks\\` and/or \\`routes\\` (got ${\n\t\t\t\t\tArray.isArray(definition) ? \"array\" : typeof definition\n\t\t\t\t}). Did you forget \\`export default {...} satisfies SandboxedPlugin\\`?`,\n\t\t);\n\t}\n\n\t// Resolve hooks. `SandboxedPlugin.hooks` is keyed by hook name with\n\t// per-key entry types; iterating with `Object.entries` collapses\n\t// keys to `string`, so we treat each entry as the union `AnyHookEntry`\n\t// for the duration of the loop. The widening from the strict mapped\n\t// type to a plain record is sound because each entry still matches\n\t// one of the bare-handler / config-object shapes captured by\n\t// `AnyHookEntry`.\n\tconst resolvedHooks: ResolvedPluginHooks = {};\n\tif (definition.hooks) {\n\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- widening the strict mapped type to a string-keyed record for iteration; entries still match AnyHookEntry\n\t\tconst hookMap = definition.hooks as Record<string, AnyHookEntry>;\n\t\tfor (const [hookName, entry] of Object.entries(hookMap)) {\n\t\t\tif (!VALID_HOOK_NAMES_SET.has(hookName)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Plugin \"${pluginId}\" declares unknown hook \"${hookName}\". ` +\n\t\t\t\t\t\t`Valid hooks: ${[...VALID_HOOK_NAMES_SET].join(\", \")}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// The resolved hook has the correct handler type for the hook name.\n\t\t\t// We store it as the generic type and let HookPipeline's typed dispatch\n\t\t\t// methods handle the type narrowing at call time.\n\t\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- bridging untyped map to typed interface\n\t\t\t(resolvedHooks as Record<string, unknown>)[hookName] = resolveSandboxedHook(entry, pluginId);\n\t\t}\n\t}\n\n\t// Resolve routes: sandboxed format uses (routeCtx, pluginCtx) two-arg\n\t// pattern. Standard format (`definePlugin(...)` as the default export)\n\t// uses the public (ctx: RouteContext) single-arg pattern where\n\t// RouteContext extends PluginContext with { input, request, requestMeta }.\n\t//\n\t// The two conventions disagree on the FIRST argument (`request` is a\n\t// flattened plain object for sandboxed, a real WHATWG `Request` for\n\t// standard), so the wrapper must know which contract the handler was\n\t// written against. `definePlugin` requires `id`, and sandbox-format\n\t// default exports never carry one (identity comes from the manifest's\n\t// slug + publisher) — the same \"no id\" signal definePlugin itself\n\t// documents. Calling a single-arg standard handler with the two-arg\n\t// convention silently hands it the bare route context (JS drops the\n\t// extra argument), so `ctx.storage` / `ctx.email` / etc. are all\n\t// undefined at runtime (#2079).\n\t//\n\t// Route entries can be bare functions or `{ handler, public?, input? }`\n\t// config objects; normalise to the config shape inside the loop.\n\tconst usesPublicRouteContext = \"id\" in definition && typeof definition.id === \"string\";\n\tconst resolvedRoutes: Record<string, PluginRoute> = {};\n\tif (definition.routes) {\n\t\tfor (const [routeName, rawEntry] of Object.entries(definition.routes)) {\n\t\t\tconst normalized = normalizeRouteEntry(rawEntry);\n\t\t\tconst {\n\t\t\t\thandler,\n\t\t\t\tpublic: publicFlag,\n\t\t\t\tcacheControl,\n\t\t\t\tinput: inputSchema,\n\t\t\t\tpermission,\n\t\t\t} = normalized;\n\t\t\tresolvedRoutes[routeName] = {\n\t\t\t\tinput: inputSchema,\n\t\t\t\tpublic: publicFlag,\n\t\t\t\tpermission,\n\t\t\t\tcacheControl,\n\t\t\t\thandler: async (ctx) => {\n\t\t\t\t\tif (usesPublicRouteContext) {\n\t\t\t\t\t\t// The incoming ctx already IS the public RouteContext\n\t\t\t\t\t\t// (full PluginContext + input / real Request /\n\t\t\t\t\t\t// requestMeta) — pass it through unchanged.\n\t\t\t\t\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- standard-format handlers are authored against the public single-arg PluginRoute contract; the sandbox RouteHandler type on `normalized` is the wider authoring union\n\t\t\t\t\t\treturn (handler as unknown as PluginRoute[\"handler\"])(ctx);\n\t\t\t\t\t}\n\t\t\t\t\t// `ctx.request` is a real WHATWG `Request` (this is the\n\t\t\t\t\t// in-process adapter; the worker-sandbox adapter handles\n\t\t\t\t\t// the serialised case). Flatten `Headers` to the plain\n\t\t\t\t\t// `Record<string, string>` shape that author-facing\n\t\t\t\t\t// `SandboxedRequest` promises so handler bodies are\n\t\t\t\t\t// identical across both adapters.\n\t\t\t\t\tconst headers: Record<string, string> = {};\n\t\t\t\t\tctx.request.headers.forEach((value, name) => {\n\t\t\t\t\t\theaders[name] = value;\n\t\t\t\t\t});\n\t\t\t\t\tconst requestShape = {\n\t\t\t\t\t\turl: ctx.request.url,\n\t\t\t\t\t\tmethod: ctx.request.method,\n\t\t\t\t\t\theaders,\n\t\t\t\t\t};\n\t\t\t\t\tconst routeCtx = {\n\t\t\t\t\t\tinput: ctx.input,\n\t\t\t\t\t\trequest: requestShape,\n\t\t\t\t\t\trequestMeta: ctx.requestMeta,\n\t\t\t\t\t\tuser: ctx.user,\n\t\t\t\t\t};\n\t\t\t\t\tconst { input: _, request: __, requestMeta: ___, user: ____, ...pluginCtx } = ctx;\n\t\t\t\t\treturn handler(routeCtx, pluginCtx);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\t// Build capabilities from descriptor.\n\t// Validate against the known set (same as defineNativePlugin). Both\n\t// current and deprecated names are accepted; deprecated names are\n\t// silently normalized to current names below so the runtime only ever\n\t// sees the canonical form.\n\tconst rawCapabilities = descriptor.capabilities ?? [];\n\tfor (const cap of rawCapabilities) {\n\t\tif (!VALID_CAPABILITIES_SET.has(cap)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid capability \"${cap}\" in plugin \"${pluginId}\". ` +\n\t\t\t\t\t`Valid capabilities: ${[...VALID_CAPABILITIES_SET].join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\n\t// Silent normalization: rewrite deprecated names to current names.\n\t// Safe assertion — `normalizeCapabilities` only emits validated input\n\t// plus current names from the rename map, all of which are in the union.\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- validated above; normalizeCapabilities only returns capabilities from the union\n\tconst capabilities = normalizeCapabilities(rawCapabilities) as PluginCapability[];\n\tconst allowedHosts = descriptor.allowedHosts ?? [];\n\n\t// Capability implications: broader capabilities imply narrower ones\n\t// (mirrors the normalization in define-plugin.ts for native format).\n\t// Operates on canonical names only.\n\tif (capabilities.includes(\"content:write\") && !capabilities.includes(\"content:read\")) {\n\t\tcapabilities.push(\"content:read\");\n\t}\n\tif (capabilities.includes(\"media:write\") && !capabilities.includes(\"media:read\")) {\n\t\tcapabilities.push(\"media:read\");\n\t}\n\tif (\n\t\tcapabilities.includes(\"network:request:unrestricted\") &&\n\t\t!capabilities.includes(\"network:request\")\n\t) {\n\t\tcapabilities.push(\"network:request\");\n\t}\n\n\t// Build storage config from descriptor.\n\t// StorageCollectionDeclaration uses optional indexes, but PluginStorageConfig\n\t// requires them. Ensure every collection has an indexes array.\n\tconst rawStorage = descriptor.storage ?? {};\n\tconst storage: PluginStorageConfig = {};\n\tfor (const [name, config] of Object.entries(rawStorage)) {\n\t\tstorage[name] = {\n\t\t\tindexes: config.indexes ?? [],\n\t\t\tuniqueIndexes: config.uniqueIndexes,\n\t\t};\n\t}\n\n\t// Build admin config from descriptor.\n\t// Portable Text blocks and field widgets are declarative (Block Kit), so they\n\t// are forwarded for standard/sandboxed plugins just like pages and widgets —\n\t// the admin editor consumes them from the manifest. Only the site-side render\n\t// component (`componentsEntry`) stays native-only.\n\tconst admin: PluginAdminConfig = {};\n\tif (descriptor.adminPages) {\n\t\tadmin.pages = descriptor.adminPages;\n\t}\n\tif (descriptor.adminWidgets) {\n\t\tadmin.widgets = descriptor.adminWidgets;\n\t}\n\tif (descriptor.settingsSchema) {\n\t\tadmin.settingsSchema = descriptor.settingsSchema;\n\t}\n\tif (descriptor.portableTextBlocks) {\n\t\tadmin.portableTextBlocks = descriptor.portableTextBlocks;\n\t}\n\tif (descriptor.fieldWidgets) {\n\t\tadmin.fieldWidgets = descriptor.fieldWidgets;\n\t}\n\n\treturn {\n\t\tid: pluginId,\n\t\tversion,\n\t\tcapabilities,\n\t\tallowedHosts,\n\t\tstorage,\n\t\thooks: resolvedHooks,\n\t\troutes: resolvedRoutes,\n\t\tmcp: {\n\t\t\ttools: Object.fromEntries(\n\t\t\t\tObject.entries(definition.mcp?.tools ?? {}).map(([name, tool]) => [\n\t\t\t\t\tname,\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\troute: tool.route,\n\t\t\t\t\t\tinput: tool.input,\n\t\t\t\t\t\toutput: tool.output,\n\t\t\t\t\t\tdestructive: tool.destructive,\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t),\n\t\t},\n\t\tadmin,\n\t};\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"adapt-sandbox-entry.mjs","names":[],"sources":["../../src/plugins/adapt-sandbox-entry.ts"],"sourcesContent":["/**\n * In-Process Adapter for Standard-Format Plugins\n *\n * Converts a standard plugin definition ({ hooks, routes }) into a\n * ResolvedPlugin compatible with HookPipeline. This allows standard-format\n * plugins to run in-process when placed in the `plugins: []` config array.\n *\n * The adapter wraps each hook and route handler so that the PluginContextFactory\n * provides the same capability-gated context as the native path.\n *\n */\n\nimport type { PluginDescriptor } from \"../astro/integration/runtime.js\";\nimport type { RouteEntry, RouteHandler, SandboxedPlugin } from \"../plugin-types.js\";\nimport { PLUGIN_CAPABILITIES, HOOK_NAMES } from \"./manifest-schema.js\";\nimport { sanitizeHeadersForSandbox } from \"./request-meta.js\";\nimport { normalizePluginCapabilities } from \"./types.js\";\nimport type {\n\tResolvedPlugin,\n\tResolvedPluginHooks,\n\tResolvedHook,\n\tPluginRoute,\n\tPluginCapability,\n\tPluginStorageConfig,\n\tPluginAdminConfig,\n} from \"./types.js\";\n\n/**\n * Loose per-hook entry shape used inside the adapter's iteration loop.\n *\n * `SandboxedPlugin.hooks` is a mapped type keyed by hook name, so each\n * entry's type depends on the key. When the adapter iterates with\n * `Object.entries`, the key is `string` (TypeScript can't see the\n * narrowing), so we need a *union* type that covers every hook entry\n * shape — bare handler or config form. This is that union, kept local\n * because it has no use outside the adapter.\n */\n// eslint-disable-next-line typescript-eslint/no-explicit-any -- must accept handlers with specific event types across all hook names\ntype AnyHookHandler = (...args: any[]) => Promise<any>;\ntype AnyHookEntry =\n\t| AnyHookHandler\n\t| {\n\t\t\thandler: AnyHookHandler;\n\t\t\tpriority?: number;\n\t\t\ttimeout?: number;\n\t\t\tdependencies?: string[];\n\t\t\terrorPolicy?: \"continue\" | \"abort\";\n\t\t\texclusive?: boolean;\n\t };\n\n/**\n * Default hook configuration values\n */\nconst DEFAULT_PRIORITY = 100;\nconst DEFAULT_TIMEOUT = 5000;\nconst DEFAULT_ERROR_POLICY = \"abort\" as const;\n\n/**\n * Check if a hook entry is the config form (has a `handler` property).\n */\nfunction isHookConfig(entry: AnyHookEntry): entry is Exclude<AnyHookEntry, AnyHookHandler> {\n\treturn typeof entry === \"object\" && entry !== null && \"handler\" in entry;\n}\n\n/**\n * Resolve a single hook entry to a ResolvedHook.\n *\n * Sandboxed-format hooks use the standard two-arg convention:\n * handler(event, ctx)\n *\n * The HookPipeline dispatch methods also call handlers with (event, ctx),\n * so the handler is compatible as-is — we just normalise the\n * surrounding config (priority, timeout, etc.) to its defaults.\n */\nfunction resolveSandboxedHook(entry: AnyHookEntry, pluginId: string): ResolvedHook<AnyHookHandler> {\n\tif (isHookConfig(entry)) {\n\t\treturn {\n\t\t\tpriority: entry.priority ?? DEFAULT_PRIORITY,\n\t\t\ttimeout: entry.timeout ?? DEFAULT_TIMEOUT,\n\t\t\tdependencies: entry.dependencies ?? [],\n\t\t\terrorPolicy: entry.errorPolicy ?? DEFAULT_ERROR_POLICY,\n\t\t\texclusive: entry.exclusive ?? false,\n\t\t\thandler: entry.handler,\n\t\t\tpluginId,\n\t\t};\n\t}\n\n\t// Bare function handler\n\treturn {\n\t\tpriority: DEFAULT_PRIORITY,\n\t\ttimeout: DEFAULT_TIMEOUT,\n\t\tdependencies: [],\n\t\terrorPolicy: DEFAULT_ERROR_POLICY,\n\t\texclusive: false,\n\t\thandler: entry,\n\t\tpluginId,\n\t};\n}\n\n/**\n * Normalise a `RouteEntry` (bare handler or `{ handler, public?, input? }`\n * config) to the config form. The `input` schema is intentionally typed\n * `unknown` in `RouteEntry` — sandboxed plugins describe it loosely\n * because the strict `z.ZodType<TInput>` constraint of the runtime's\n * `PluginRoute` only narrows once the route is wired into the router.\n * The wider type flows through to the runtime which validates at\n * invocation time.\n */\nfunction normalizeRouteEntry(entry: RouteEntry): {\n\thandler: RouteHandler;\n\tpublic?: boolean;\n\tcacheControl?: string;\n\tmethods?: PluginRoute[\"methods\"];\n\trequest?: PluginRoute[\"request\"];\n\tresponse?: PluginRoute[\"response\"];\n\tinput?: PluginRoute[\"input\"];\n\tpermission?: PluginRoute[\"permission\"];\n} {\n\tif (typeof entry === \"function\") {\n\t\treturn { handler: entry };\n\t}\n\treturn {\n\t\thandler: entry.handler,\n\t\tpublic: entry.public,\n\t\tpermission: entry.permission,\n\t\tcacheControl: entry.cacheControl,\n\t\tmethods: entry.methods,\n\t\trequest: entry.request,\n\t\tresponse: entry.response,\n\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- RouteEntry.input is intentionally `unknown` (sandboxed plugins) and validated by the runtime at invocation time\n\t\tinput: entry.input as PluginRoute[\"input\"],\n\t};\n}\n\nconst VALID_CAPABILITIES_SET = new Set<string>(PLUGIN_CAPABILITIES);\n\nconst VALID_HOOK_NAMES_SET = new Set<string>(HOOK_NAMES);\n\n/**\n * Adapt a sandboxed plugin's default export into a ResolvedPlugin.\n *\n * This is the in-process side of sandboxed-format plugins: it takes\n * the `{ hooks, routes }` default export of a sandboxed plugin and\n * produces a `ResolvedPlugin` that enters the HookPipeline alongside\n * native plugins. The descriptor supplies identity (id, version) and\n * the trust contract (capabilities, allowedHosts, storage); the\n * definition supplies behaviour.\n *\n * @param definition - The plugin's default export (matching `SandboxedPlugin` from `emdash/plugin`).\n * @param descriptor - The plugin descriptor with id, version, capabilities, etc.\n * @returns A ResolvedPlugin compatible with HookPipeline.\n */\nexport function adaptSandboxEntry(\n\tdefinition: SandboxedPlugin,\n\tdescriptor: PluginDescriptor,\n): ResolvedPlugin {\n\tconst pluginId = descriptor.id;\n\tconst version = descriptor.version;\n\n\t// A null / array / non-object `definition` would throw a generic\n\t// `TypeError: Cannot read properties of null` further down the\n\t// loop without the plugin id; surface a useful error first.\n\tif (typeof definition !== \"object\" || definition === null || Array.isArray(definition)) {\n\t\tthrow new Error(\n\t\t\t`Plugin \"${pluginId}\" default export must be an object with ` +\n\t\t\t\t`\\`hooks\\` and/or \\`routes\\` (got ${\n\t\t\t\t\tArray.isArray(definition) ? \"array\" : typeof definition\n\t\t\t\t}). Did you forget \\`export default {...} satisfies SandboxedPlugin\\`?`,\n\t\t);\n\t}\n\n\t// Resolve hooks. `SandboxedPlugin.hooks` is keyed by hook name with\n\t// per-key entry types; iterating with `Object.entries` collapses\n\t// keys to `string`, so we treat each entry as the union `AnyHookEntry`\n\t// for the duration of the loop. The widening from the strict mapped\n\t// type to a plain record is sound because each entry still matches\n\t// one of the bare-handler / config-object shapes captured by\n\t// `AnyHookEntry`.\n\tconst resolvedHooks: ResolvedPluginHooks = {};\n\tif (definition.hooks) {\n\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- widening the strict mapped type to a string-keyed record for iteration; entries still match AnyHookEntry\n\t\tconst hookMap = definition.hooks as Record<string, AnyHookEntry>;\n\t\tfor (const [hookName, entry] of Object.entries(hookMap)) {\n\t\t\tif (!VALID_HOOK_NAMES_SET.has(hookName)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Plugin \"${pluginId}\" declares unknown hook \"${hookName}\". ` +\n\t\t\t\t\t\t`Valid hooks: ${[...VALID_HOOK_NAMES_SET].join(\", \")}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// The resolved hook has the correct handler type for the hook name.\n\t\t\t// We store it as the generic type and let HookPipeline's typed dispatch\n\t\t\t// methods handle the type narrowing at call time.\n\t\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- bridging untyped map to typed interface\n\t\t\t(resolvedHooks as Record<string, unknown>)[hookName] = resolveSandboxedHook(entry, pluginId);\n\t\t}\n\t}\n\n\t// Resolve routes: sandboxed format uses (routeCtx, pluginCtx) two-arg\n\t// pattern. Standard format (`definePlugin(...)` as the default export)\n\t// uses the public (ctx: RouteContext) single-arg pattern where\n\t// RouteContext extends PluginContext with { input, request, requestMeta }.\n\t//\n\t// The two conventions disagree on the FIRST argument (`request` is a\n\t// flattened plain object for sandboxed, a real WHATWG `Request` for\n\t// standard), so the wrapper must know which contract the handler was\n\t// written against. `definePlugin` requires `id`, and sandbox-format\n\t// default exports never carry one (identity comes from the manifest's\n\t// slug + publisher) — the same \"no id\" signal definePlugin itself\n\t// documents. Calling a single-arg standard handler with the two-arg\n\t// convention silently hands it the bare route context (JS drops the\n\t// extra argument), so `ctx.storage` / `ctx.email` / etc. are all\n\t// undefined at runtime.\n\t//\n\t// Route entries can be bare functions or `{ handler, public?, input? }`\n\t// config objects; normalise to the config shape inside the loop.\n\tconst usesPublicRouteContext = \"id\" in definition && typeof definition.id === \"string\";\n\tconst resolvedRoutes: Record<string, PluginRoute> = {};\n\tif (definition.routes) {\n\t\tfor (const [routeName, rawEntry] of Object.entries(definition.routes)) {\n\t\t\tconst normalized = normalizeRouteEntry(rawEntry);\n\t\t\tconst {\n\t\t\t\thandler,\n\t\t\t\tpublic: publicFlag,\n\t\t\t\tcacheControl,\n\t\t\t\tmethods,\n\t\t\t\trequest,\n\t\t\t\tresponse,\n\t\t\t\tinput: inputSchema,\n\t\t\t\tpermission,\n\t\t\t} = normalized;\n\t\t\tresolvedRoutes[routeName] = {\n\t\t\t\tinput: inputSchema,\n\t\t\t\tpublic: publicFlag,\n\t\t\t\tpermission,\n\t\t\t\tcacheControl,\n\t\t\t\tmethods,\n\t\t\t\trequest,\n\t\t\t\tresponse,\n\t\t\t\thandler: async (ctx) => {\n\t\t\t\t\tif (usesPublicRouteContext) {\n\t\t\t\t\t\t// The incoming ctx already IS the public RouteContext\n\t\t\t\t\t\t// (full PluginContext + input / real Request /\n\t\t\t\t\t\t// requestMeta) — pass it through unchanged.\n\t\t\t\t\t\t// eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- standard-format handlers are authored against the public single-arg PluginRoute contract; the sandbox RouteHandler type on `normalized` is the wider authoring union\n\t\t\t\t\t\treturn (handler as unknown as PluginRoute[\"handler\"])(ctx);\n\t\t\t\t\t}\n\t\t\t\t\t// `ctx.request` is a real WHATWG `Request` (this is the\n\t\t\t\t\t// in-process adapter; the worker-sandbox adapter handles\n\t\t\t\t\t// the serialised case). Flatten `Headers` to the plain\n\t\t\t\t\t// `Record<string, string>` shape that author-facing\n\t\t\t\t\t// `SandboxedRequest` promises so handler bodies are\n\t\t\t\t\t// identical across both adapters.\n\t\t\t\t\tconst declaredHeaders = request ? (request.headers ?? []) : undefined;\n\t\t\t\t\tconst headers = sanitizeHeadersForSandbox(ctx.request.headers, declaredHeaders);\n\t\t\t\t\tconst requestShape = {\n\t\t\t\t\t\turl: ctx.request.url,\n\t\t\t\t\t\tmethod: ctx.request.method,\n\t\t\t\t\t\theaders,\n\t\t\t\t\t};\n\t\t\t\t\tconst routeCtx = {\n\t\t\t\t\t\tinput: ctx.input,\n\t\t\t\t\t\trequest: requestShape,\n\t\t\t\t\t\trequestMeta: ctx.requestMeta,\n\t\t\t\t\t\tuser: ctx.user,\n\t\t\t\t\t\tui: ctx.ui,\n\t\t\t\t\t};\n\t\t\t\t\tconst {\n\t\t\t\t\t\tinput: _,\n\t\t\t\t\t\trequest: __,\n\t\t\t\t\t\trequestMeta: ___,\n\t\t\t\t\t\tuser: ____,\n\t\t\t\t\t\tui: _____,\n\t\t\t\t\t\t...pluginCtx\n\t\t\t\t\t} = ctx;\n\t\t\t\t\treturn handler(routeCtx, pluginCtx);\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\t// Build capabilities from descriptor.\n\t// Validate against the known set (same as defineNativePlugin). Both\n\t// current and deprecated names are accepted; deprecated names are\n\t// silently normalized to current names below so the runtime only ever\n\t// sees the canonical form.\n\tconst rawCapabilities = descriptor.capabilities ?? [];\n\tfor (const cap of rawCapabilities) {\n\t\tif (!VALID_CAPABILITIES_SET.has(cap)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid capability \"${cap}\" in plugin \"${pluginId}\". ` +\n\t\t\t\t\t`Valid capabilities: ${[...VALID_CAPABILITIES_SET].join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\n\t// Silent normalization: rewrite deprecated names to current names.\n\t// eslint-disable-next-line typescript/no-unsafe-type-assertion -- validated above; normalization only returns capabilities from the union\n\tconst capabilities = normalizePluginCapabilities(rawCapabilities as PluginCapability[]);\n\tconst allowedHosts = descriptor.allowedHosts ?? [];\n\n\t// Build storage config from descriptor.\n\t// StorageCollectionDeclaration uses optional indexes, but PluginStorageConfig\n\t// requires them. Ensure every collection has an indexes array.\n\tconst rawStorage = descriptor.storage ?? {};\n\tconst storage: PluginStorageConfig = {};\n\tfor (const [name, config] of Object.entries(rawStorage)) {\n\t\tstorage[name] = {\n\t\t\tindexes: config.indexes ?? [],\n\t\t\tuniqueIndexes: config.uniqueIndexes,\n\t\t};\n\t}\n\n\t// Build admin config from descriptor.\n\t// Portable Text blocks and field widgets are declarative (Block Kit), so they\n\t// are forwarded for standard/sandboxed plugins just like pages and widgets —\n\t// the admin editor consumes them from the manifest. Only the site-side render\n\t// component (`componentsEntry`) stays native-only.\n\tconst admin: PluginAdminConfig = {};\n\tif (descriptor.adminPages) {\n\t\tadmin.pages = descriptor.adminPages;\n\t}\n\tif (descriptor.adminWidgets) {\n\t\tadmin.widgets = descriptor.adminWidgets;\n\t}\n\tif (descriptor.editorPanels) {\n\t\tadmin.editorPanels = descriptor.editorPanels;\n\t}\n\tif (descriptor.editorActions) {\n\t\tadmin.editorActions = descriptor.editorActions;\n\t}\n\tif (descriptor.settingsSchema) {\n\t\tadmin.settingsSchema = descriptor.settingsSchema;\n\t}\n\tif (descriptor.portableTextBlocks) {\n\t\tadmin.portableTextBlocks = descriptor.portableTextBlocks;\n\t}\n\tif (descriptor.fieldWidgets) {\n\t\tadmin.fieldWidgets = descriptor.fieldWidgets;\n\t}\n\n\treturn {\n\t\tid: pluginId,\n\t\tversion,\n\t\tcapabilities,\n\t\tallowedHosts,\n\t\tstorage,\n\t\thooks: resolvedHooks,\n\t\troutes: resolvedRoutes,\n\t\tmcp: {\n\t\t\ttools: Object.fromEntries(\n\t\t\t\tObject.entries(definition.mcp?.tools ?? {}).map(([name, tool]) => [\n\t\t\t\t\tname,\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription: tool.description,\n\t\t\t\t\t\troute: tool.route,\n\t\t\t\t\t\tinput: tool.input,\n\t\t\t\t\t\toutput: tool.output,\n\t\t\t\t\t\tdestructive: tool.destructive,\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t),\n\t\t},\n\t\tadmin,\n\t};\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "../types-CbwqGOXm.mjs";
|
|
2
|
+
import { Ct as MediaMetadataPatch, Ft as PaginatedResult, L as ContentItem, R as ContentListOptions, St as MediaItem, _n as SettingField, xt as MediaBytes } from "../types-DEHidMEk.mjs";
|
|
3
|
+
import { t as OptionsRepository } from "../options-DAknChnw.mjs";
|
|
4
|
+
import { A as RedirectAccessError, D as getSandboxRouteErrorDetails, F as createRedirectAccess, I as createSchemaAccess, P as createMediaAccess, R as createContentAccess, T as createSandboxRouteError, V as createSettingsAccess, Y as PluginStorageRepository, a as readPluginMediaBytes, c as CronAccessImpl, et as ContentRepository, i as parsePluginMediaMetadataPatch, j as createCommentAccess, s as updatePluginMediaMetadata, t as StorageSerializationError, tt as resolvePluginEncryptionKeys } from "../storage-query-CPctdMKX.mjs";
|
|
5
|
+
import { a as resolveContentCreateLocale } from "../config-D3HhLON3.mjs";
|
|
6
|
+
import { ulid } from "ulidx";
|
|
7
|
+
export { type ContentItem, type ContentListOptions, ContentRepository, CronAccessImpl, type MediaBytes, type MediaItem, type MediaMetadataPatch, OptionsRepository, type PaginatedResult, PluginStorageRepository, RedirectAccessError, type SettingField, StorageSerializationError, createCommentAccess, createContentAccess, createMediaAccess, createRedirectAccess, createSandboxRouteError, createSchemaAccess, createSettingsAccess, getSandboxRouteErrorDetails, parsePluginMediaMetadataPatch, readPluginMediaBytes, resolveContentCreateLocale, resolvePluginEncryptionKeys, ulid, updatePluginMediaMetadata };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "../dialect-helpers-CtYdsX4W.mjs";
|
|
2
|
+
import { o as resolveContentCreateLocale } from "../config-CGVeT8Hc.mjs";
|
|
3
|
+
import "../datetime-normalization-PeiEdcRY.mjs";
|
|
4
|
+
import "../after-PcEvMY_6.mjs";
|
|
5
|
+
import { t as OptionsRepository } from "../options-D5WcorD5.mjs";
|
|
6
|
+
import "../base64-DvnNgP7e.mjs";
|
|
7
|
+
import { i as resolvePluginEncryptionKeys } from "../secrets-DNgVgz_e.mjs";
|
|
8
|
+
import { t as ContentRepository } from "../content-DZ3B5qtA.mjs";
|
|
9
|
+
import "../object-cache-DlSVbn5Y.mjs";
|
|
10
|
+
import "../slugify-T5GHH42D.mjs";
|
|
11
|
+
import "../types-BkUg2yHx.mjs";
|
|
12
|
+
import "../media-TBlKCwo7.mjs";
|
|
13
|
+
import "../user-DroRntkx.mjs";
|
|
14
|
+
import "../taxonomy-Dj1vpw5E.mjs";
|
|
15
|
+
import "../comment-DcT8qdPK.mjs";
|
|
16
|
+
import { b as PluginStorageRepository, c as createSchemaAccess, g as readPluginMediaBytes, h as parsePluginMediaMetadataPatch, n as RedirectAccessError, o as createMediaAccess, r as createCommentAccess, s as createRedirectAccess, v as updatePluginMediaMetadata, x as StorageSerializationError, y as createContentAccess } from "../context-B195kjqZ.mjs";
|
|
17
|
+
import "../resolve-BJIS8wKr.mjs";
|
|
18
|
+
import "../redirect-D2Yo-b6S.mjs";
|
|
19
|
+
import "../request-cache-DaMhSQdx.mjs";
|
|
20
|
+
import "../dist-2hDLsLeq.mjs";
|
|
21
|
+
import "../enrich-C2Mk0lwE.mjs";
|
|
22
|
+
import "../entry-locks-CO_KaoU5.mjs";
|
|
23
|
+
import "../seo-_4qmazxz.mjs";
|
|
24
|
+
import "../cache-B0pOlXdM.mjs";
|
|
25
|
+
import "../fts-manager-DMb0sbIQ.mjs";
|
|
26
|
+
import "../loader-t4TxaFiQ.mjs";
|
|
27
|
+
import "../collection-slugs-cache-D9auiKmI.mjs";
|
|
28
|
+
import "../taxonomies-BpqpXJUE.mjs";
|
|
29
|
+
import "../capture-triggers-gxQxnxrJ.mjs";
|
|
30
|
+
import "../activation-CaMfdBt1.mjs";
|
|
31
|
+
import "../collection-deletion-C3Xixmkx.mjs";
|
|
32
|
+
import "../content-refresh-BHLHJgyt.mjs";
|
|
33
|
+
import "../registry-CkuPoZs7.mjs";
|
|
34
|
+
import { u as createSettingsAccess } from "../settings-DmroR53o.mjs";
|
|
35
|
+
import "../taxonomies-ClCo4IGO.mjs";
|
|
36
|
+
import { i as getSandboxRouteErrorDetails, n as createSandboxRouteError } from "../types-ZCnlropY.mjs";
|
|
37
|
+
import "../ssrf-Co1GGFZz.mjs";
|
|
38
|
+
import "../redirects-BCiTaIQ-.mjs";
|
|
39
|
+
import "../status-DLoBmcDz.mjs";
|
|
40
|
+
import "../redirects-ByItliuu.mjs";
|
|
41
|
+
import "../ssrf-BRpTDMV6.mjs";
|
|
42
|
+
import { t as CronAccessImpl } from "../cron-BcR3RN4K.mjs";
|
|
43
|
+
import { ulid } from "ulidx";
|
|
44
|
+
|
|
45
|
+
export { ContentRepository, CronAccessImpl, OptionsRepository, PluginStorageRepository, RedirectAccessError, StorageSerializationError, createCommentAccess, createContentAccess, createMediaAccess, createRedirectAccess, createSandboxRouteError, createSchemaAccess, createSettingsAccess, getSandboxRouteErrorDetails, parsePluginMediaMetadataPatch, readPluginMediaBytes, resolveContentCreateLocale, resolvePluginEncryptionKeys, ulid, updatePluginMediaMetadata };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/plugins/http-wire.d.ts
|
|
2
|
+
declare const PLUGIN_HTTP_MAX_REQUEST_BYTES: number;
|
|
3
|
+
declare const PLUGIN_HTTP_MAX_RESPONSE_BYTES: number;
|
|
4
|
+
type PluginHttpRedirectAction = "return" | "follow" | "error";
|
|
5
|
+
interface PluginHttpResponseWire {
|
|
6
|
+
status: number;
|
|
7
|
+
statusText: string;
|
|
8
|
+
headers: Array<[string, string]>;
|
|
9
|
+
finalUrl: string;
|
|
10
|
+
redirected: boolean;
|
|
11
|
+
body: Uint8Array;
|
|
12
|
+
}
|
|
13
|
+
declare const readPluginHttpBytes: (stream: ReadableStream<Uint8Array> | null, limit: number, label: "request" | "response") => Promise<Uint8Array>, bufferPluginHttpRequest: (init: RequestInit | undefined) => Promise<RequestInit | undefined>, decoratePluginHttpResponse: (response: Response, finalUrl: string, redirected: boolean) => Response, pluginHttpResponseFromWire: (wire: PluginHttpResponseWire) => Response;
|
|
14
|
+
declare function rewritePluginHttpRedirect(status: number, init: RequestInit | undefined): RequestInit | undefined;
|
|
15
|
+
declare function pluginHttpRedirectAction(status: number, hasLocation: boolean, init: RequestInit | undefined): PluginHttpRedirectAction;
|
|
16
|
+
declare function pluginHttpResponseToWire(response: Response, finalUrl: string, redirected: boolean): Promise<PluginHttpResponseWire>;
|
|
17
|
+
/**
|
|
18
|
+
* Generate the dependency-free helper module injected into sandbox wrappers.
|
|
19
|
+
* Generated isolates cannot resolve host package imports, so both runners embed
|
|
20
|
+
* the runtime forms of these canonical functions instead.
|
|
21
|
+
*/
|
|
22
|
+
declare function generatePluginHttpWireRuntimeSource(): string;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { PLUGIN_HTTP_MAX_REQUEST_BYTES, PLUGIN_HTTP_MAX_RESPONSE_BYTES, PluginHttpRedirectAction, PluginHttpResponseWire, bufferPluginHttpRequest, decoratePluginHttpResponse, generatePluginHttpWireRuntimeSource, pluginHttpRedirectAction, pluginHttpResponseFromWire, pluginHttpResponseToWire, readPluginHttpBytes, rewritePluginHttpRedirect };
|
|
25
|
+
//# sourceMappingURL=http-wire.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-wire.d.mts","names":[],"sources":["../../src/plugins/http-wire.ts"],"mappings":";cAAa,6BAAA;AAAA,cACA,8BAAA;AAAA,KAWD,wBAAA;AAAA,UAEK,sBAAA;EAChB,MAAA;EACA,UAAA;EACA,OAAA,EAAS,KAAA;EACT,QAAA;EACA,UAAA;EACA,IAAA,EAAM,UAAA;AAAA;AAAA,cAgGN,mBAAA,GAAmB,MAAA,EA1FV,cAAA,CAAe,UAAA,UAAkB,KAAA,UAC5B,KAAA,6BAEX,OAAA,CAAQ,UAAA,GAAA,uBAAA,GAwFY,IAAA,EAtDhB,WAAA,iBACJ,OAAA,CAAQ,WAAA,eAAA,0BAAA,GAsDe,QAAA,EAtCf,QAAA,EAAQ,QAAA,UACF,UAAA,cAEd,QAAA,EAAA,0BAAA,GAoCuB,IAAA,EAvBgB,sBAAA,KAAyB,QAAA;AAAA,iBA0BpD,yBAAA,CACf,MAAA,UACA,IAAA,EAAM,WAAA,eACJ,WAAA;AAAA,iBAaa,wBAAA,CACf,MAAA,UACA,WAAA,WACA,IAAA,EAAM,WAAA,eACJ,wBAAA;AAAA,iBAQmB,wBAAA,CACrB,QAAA,EAAU,QAAA,EACV,QAAA,UACA,UAAA,YACE,OAAA,CAAQ,sBAAA;;AA5IX;;;;iBA8JgB,mCAAA,CAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
//#region src/plugins/http-wire.ts
|
|
2
|
+
const PLUGIN_HTTP_MAX_REQUEST_BYTES = 8 * 1024 * 1024;
|
|
3
|
+
const PLUGIN_HTTP_MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
|
|
4
|
+
const REDIRECT_BODY_HEADERS = [
|
|
5
|
+
"content-encoding",
|
|
6
|
+
"content-language",
|
|
7
|
+
"content-location",
|
|
8
|
+
"content-type",
|
|
9
|
+
"content-length",
|
|
10
|
+
"transfer-encoding"
|
|
11
|
+
];
|
|
12
|
+
const PLUGIN_HTTP_REDIRECT_STATUSES = new Set([
|
|
13
|
+
301,
|
|
14
|
+
302,
|
|
15
|
+
303,
|
|
16
|
+
307,
|
|
17
|
+
308
|
|
18
|
+
]);
|
|
19
|
+
function createPluginHttpWireRuntime(maxRequestBytes) {
|
|
20
|
+
async function readPluginHttpBytes(stream, limit, label) {
|
|
21
|
+
if (!stream) return new Uint8Array();
|
|
22
|
+
const reader = stream.getReader();
|
|
23
|
+
const chunks = [];
|
|
24
|
+
let total = 0;
|
|
25
|
+
try {
|
|
26
|
+
while (true) {
|
|
27
|
+
const { done, value } = await reader.read();
|
|
28
|
+
if (done) break;
|
|
29
|
+
total += value.byteLength;
|
|
30
|
+
if (total > limit) {
|
|
31
|
+
try {
|
|
32
|
+
await reader.cancel();
|
|
33
|
+
} catch {}
|
|
34
|
+
throw new Error(`Plugin HTTP ${label} body exceeds the ${limit} byte limit`);
|
|
35
|
+
}
|
|
36
|
+
chunks.push(value);
|
|
37
|
+
}
|
|
38
|
+
} finally {
|
|
39
|
+
reader.releaseLock();
|
|
40
|
+
}
|
|
41
|
+
const bytes = new Uint8Array(total);
|
|
42
|
+
let offset = 0;
|
|
43
|
+
for (const chunk of chunks) {
|
|
44
|
+
bytes.set(chunk, offset);
|
|
45
|
+
offset += chunk.byteLength;
|
|
46
|
+
}
|
|
47
|
+
return bytes;
|
|
48
|
+
}
|
|
49
|
+
async function bufferPluginHttpRequest(init) {
|
|
50
|
+
if (init?.body === void 0 || init.body === null) return init;
|
|
51
|
+
const encoded = new Response(init.body);
|
|
52
|
+
const body = await readPluginHttpBytes(encoded.body, maxRequestBytes, "request");
|
|
53
|
+
const headers = new Headers(init.headers);
|
|
54
|
+
if (!headers.has("content-type")) {
|
|
55
|
+
const contentType = encoded.headers.get("content-type");
|
|
56
|
+
if (contentType) headers.set("content-type", contentType);
|
|
57
|
+
}
|
|
58
|
+
const bufferedInit = { ...init };
|
|
59
|
+
Reflect.deleteProperty(bufferedInit, "duplex");
|
|
60
|
+
return {
|
|
61
|
+
...bufferedInit,
|
|
62
|
+
headers,
|
|
63
|
+
body: new Uint8Array(body).buffer
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function decoratePluginHttpResponse(response, finalUrl, redirected) {
|
|
67
|
+
const clone = response.clone.bind(response);
|
|
68
|
+
Object.defineProperties(response, {
|
|
69
|
+
url: {
|
|
70
|
+
configurable: true,
|
|
71
|
+
value: finalUrl
|
|
72
|
+
},
|
|
73
|
+
redirected: {
|
|
74
|
+
configurable: true,
|
|
75
|
+
value: redirected
|
|
76
|
+
},
|
|
77
|
+
clone: {
|
|
78
|
+
configurable: true,
|
|
79
|
+
value: () => decoratePluginHttpResponse(clone(), finalUrl, redirected)
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return response;
|
|
83
|
+
}
|
|
84
|
+
function pluginHttpResponseFromWire(wire) {
|
|
85
|
+
const nullBodyStatus = wire.status === 101 || wire.status === 204 || wire.status === 205 || wire.status === 304;
|
|
86
|
+
return decoratePluginHttpResponse(new Response(nullBodyStatus ? null : new Uint8Array(wire.body).buffer, {
|
|
87
|
+
status: wire.status,
|
|
88
|
+
statusText: wire.statusText,
|
|
89
|
+
headers: wire.headers
|
|
90
|
+
}), wire.finalUrl, wire.redirected);
|
|
91
|
+
}
|
|
92
|
+
return [
|
|
93
|
+
readPluginHttpBytes,
|
|
94
|
+
bufferPluginHttpRequest,
|
|
95
|
+
decoratePluginHttpResponse,
|
|
96
|
+
pluginHttpResponseFromWire
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
const [readPluginHttpBytes, bufferPluginHttpRequest, decoratePluginHttpResponse, pluginHttpResponseFromWire] = createPluginHttpWireRuntime(PLUGIN_HTTP_MAX_REQUEST_BYTES);
|
|
100
|
+
function rewritePluginHttpRedirect(status, init) {
|
|
101
|
+
if (!init) return init;
|
|
102
|
+
const method = (init.method ?? "GET").toUpperCase();
|
|
103
|
+
if (!((status === 301 || status === 302) && method === "POST" || status === 303 && method !== "GET" && method !== "HEAD")) return init;
|
|
104
|
+
const headers = new Headers(init.headers);
|
|
105
|
+
for (const name of REDIRECT_BODY_HEADERS) headers.delete(name);
|
|
106
|
+
return {
|
|
107
|
+
...init,
|
|
108
|
+
method: "GET",
|
|
109
|
+
headers,
|
|
110
|
+
body: void 0
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function pluginHttpRedirectAction(status, hasLocation, init) {
|
|
114
|
+
if (!PLUGIN_HTTP_REDIRECT_STATUSES.has(status) || !hasLocation) return "return";
|
|
115
|
+
const mode = init?.redirect ?? "follow";
|
|
116
|
+
if (mode === "manual") return "return";
|
|
117
|
+
if (mode === "error") return "error";
|
|
118
|
+
return "follow";
|
|
119
|
+
}
|
|
120
|
+
async function pluginHttpResponseToWire(response, finalUrl, redirected) {
|
|
121
|
+
const headers = [];
|
|
122
|
+
response.headers.forEach((value, key) => headers.push([key, value]));
|
|
123
|
+
return {
|
|
124
|
+
status: response.status,
|
|
125
|
+
statusText: response.statusText,
|
|
126
|
+
headers,
|
|
127
|
+
finalUrl: response.url || finalUrl,
|
|
128
|
+
redirected: response.redirected || redirected,
|
|
129
|
+
body: await readPluginHttpBytes(response.body, PLUGIN_HTTP_MAX_RESPONSE_BYTES, "response")
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Generate the dependency-free helper module injected into sandbox wrappers.
|
|
134
|
+
* Generated isolates cannot resolve host package imports, so both runners embed
|
|
135
|
+
* the runtime forms of these canonical functions instead.
|
|
136
|
+
*/
|
|
137
|
+
function generatePluginHttpWireRuntimeSource() {
|
|
138
|
+
return `const [
|
|
139
|
+
readPluginHttpBytes,
|
|
140
|
+
bufferPluginHttpRequest,
|
|
141
|
+
decoratePluginHttpResponse,
|
|
142
|
+
pluginHttpResponseFromWire,
|
|
143
|
+
] = (${createPluginHttpWireRuntime.toString()})(${PLUGIN_HTTP_MAX_REQUEST_BYTES});`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
//#endregion
|
|
147
|
+
export { PLUGIN_HTTP_MAX_REQUEST_BYTES, PLUGIN_HTTP_MAX_RESPONSE_BYTES, bufferPluginHttpRequest, decoratePluginHttpResponse, generatePluginHttpWireRuntimeSource, pluginHttpRedirectAction, pluginHttpResponseFromWire, pluginHttpResponseToWire, readPluginHttpBytes, rewritePluginHttpRedirect };
|
|
148
|
+
//# sourceMappingURL=http-wire.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-wire.mjs","names":[],"sources":["../../src/plugins/http-wire.ts"],"sourcesContent":["export const PLUGIN_HTTP_MAX_REQUEST_BYTES = 8 * 1024 * 1024;\nexport const PLUGIN_HTTP_MAX_RESPONSE_BYTES = 8 * 1024 * 1024;\nconst REDIRECT_BODY_HEADERS = [\n\t\"content-encoding\",\n\t\"content-language\",\n\t\"content-location\",\n\t\"content-type\",\n\t\"content-length\",\n\t\"transfer-encoding\",\n];\nconst PLUGIN_HTTP_REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);\n\nexport type PluginHttpRedirectAction = \"return\" | \"follow\" | \"error\";\n\nexport interface PluginHttpResponseWire {\n\tstatus: number;\n\tstatusText: string;\n\theaders: Array<[string, string]>;\n\tfinalUrl: string;\n\tredirected: boolean;\n\tbody: Uint8Array;\n}\n\nfunction createPluginHttpWireRuntime(maxRequestBytes: number) {\n\t// oxlint-disable-next-line unicorn/consistent-function-scoping -- local declaration keeps the generated factory dependency-free\n\tasync function readPluginHttpBytes(\n\t\tstream: ReadableStream<Uint8Array> | null,\n\t\tlimit: number,\n\t\tlabel: \"request\" | \"response\",\n\t): Promise<Uint8Array> {\n\t\tif (!stream) return new Uint8Array();\n\t\tconst reader = stream.getReader();\n\t\tconst chunks: Uint8Array[] = [];\n\t\tlet total = 0;\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) break;\n\t\t\t\ttotal += value.byteLength;\n\t\t\t\tif (total > limit) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait reader.cancel();\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// The byte limit remains the caller-visible failure.\n\t\t\t\t\t}\n\t\t\t\t\tthrow new Error(`Plugin HTTP ${label} body exceeds the ${limit} byte limit`);\n\t\t\t\t}\n\t\t\t\tchunks.push(value);\n\t\t\t}\n\t\t} finally {\n\t\t\treader.releaseLock();\n\t\t}\n\n\t\tconst bytes = new Uint8Array(total);\n\t\tlet offset = 0;\n\t\tfor (const chunk of chunks) {\n\t\t\tbytes.set(chunk, offset);\n\t\t\toffset += chunk.byteLength;\n\t\t}\n\t\treturn bytes;\n\t}\n\n\tasync function bufferPluginHttpRequest(\n\t\tinit: RequestInit | undefined,\n\t): Promise<RequestInit | undefined> {\n\t\tif (init?.body === undefined || init.body === null) return init;\n\t\tconst encoded = new Response(init.body);\n\t\tconst body = await readPluginHttpBytes(encoded.body, maxRequestBytes, \"request\");\n\t\tconst headers = new Headers(init.headers);\n\t\tif (!headers.has(\"content-type\")) {\n\t\t\tconst contentType = encoded.headers.get(\"content-type\");\n\t\t\tif (contentType) headers.set(\"content-type\", contentType);\n\t\t}\n\t\tconst bufferedInit = { ...init };\n\t\tReflect.deleteProperty(bufferedInit, \"duplex\");\n\t\treturn { ...bufferedInit, headers, body: new Uint8Array(body).buffer };\n\t}\n\n\t// oxlint-disable-next-line unicorn/consistent-function-scoping -- local declaration keeps the generated factory dependency-free\n\tfunction decoratePluginHttpResponse(\n\t\tresponse: Response,\n\t\tfinalUrl: string,\n\t\tredirected: boolean,\n\t): Response {\n\t\tconst clone = response.clone.bind(response);\n\t\tObject.defineProperties(response, {\n\t\t\turl: { configurable: true, value: finalUrl },\n\t\t\tredirected: { configurable: true, value: redirected },\n\t\t\tclone: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue: () => decoratePluginHttpResponse(clone(), finalUrl, redirected),\n\t\t\t},\n\t\t});\n\t\treturn response;\n\t}\n\n\tfunction pluginHttpResponseFromWire(wire: PluginHttpResponseWire): Response {\n\t\tconst nullBodyStatus =\n\t\t\twire.status === 101 || wire.status === 204 || wire.status === 205 || wire.status === 304;\n\t\tconst response = new Response(nullBodyStatus ? null : new Uint8Array(wire.body).buffer, {\n\t\t\tstatus: wire.status,\n\t\t\tstatusText: wire.statusText,\n\t\t\theaders: wire.headers,\n\t\t});\n\t\treturn decoratePluginHttpResponse(response, wire.finalUrl, wire.redirected);\n\t}\n\n\treturn [\n\t\treadPluginHttpBytes,\n\t\tbufferPluginHttpRequest,\n\t\tdecoratePluginHttpResponse,\n\t\tpluginHttpResponseFromWire,\n\t] as const;\n}\n\nexport const [\n\treadPluginHttpBytes,\n\tbufferPluginHttpRequest,\n\tdecoratePluginHttpResponse,\n\tpluginHttpResponseFromWire,\n] = createPluginHttpWireRuntime(PLUGIN_HTTP_MAX_REQUEST_BYTES);\n\nexport function rewritePluginHttpRedirect(\n\tstatus: number,\n\tinit: RequestInit | undefined,\n): RequestInit | undefined {\n\tif (!init) return init;\n\tconst method = (init.method ?? \"GET\").toUpperCase();\n\tconst rewriteToGet =\n\t\t((status === 301 || status === 302) && method === \"POST\") ||\n\t\t(status === 303 && method !== \"GET\" && method !== \"HEAD\");\n\tif (!rewriteToGet) return init;\n\n\tconst headers = new Headers(init.headers);\n\tfor (const name of REDIRECT_BODY_HEADERS) headers.delete(name);\n\treturn { ...init, method: \"GET\", headers, body: undefined };\n}\n\nexport function pluginHttpRedirectAction(\n\tstatus: number,\n\thasLocation: boolean,\n\tinit: RequestInit | undefined,\n): PluginHttpRedirectAction {\n\tif (!PLUGIN_HTTP_REDIRECT_STATUSES.has(status) || !hasLocation) return \"return\";\n\tconst mode = init?.redirect ?? \"follow\";\n\tif (mode === \"manual\") return \"return\";\n\tif (mode === \"error\") return \"error\";\n\treturn \"follow\";\n}\n\nexport async function pluginHttpResponseToWire(\n\tresponse: Response,\n\tfinalUrl: string,\n\tredirected: boolean,\n): Promise<PluginHttpResponseWire> {\n\tconst headers: Array<[string, string]> = [];\n\tresponse.headers.forEach((value, key) => headers.push([key, value]));\n\treturn {\n\t\tstatus: response.status,\n\t\tstatusText: response.statusText,\n\t\theaders,\n\t\tfinalUrl: response.url || finalUrl,\n\t\tredirected: response.redirected || redirected,\n\t\tbody: await readPluginHttpBytes(response.body, PLUGIN_HTTP_MAX_RESPONSE_BYTES, \"response\"),\n\t};\n}\n\n/**\n * Generate the dependency-free helper module injected into sandbox wrappers.\n * Generated isolates cannot resolve host package imports, so both runners embed\n * the runtime forms of these canonical functions instead.\n */\nexport function generatePluginHttpWireRuntimeSource(): string {\n\treturn `const [\n\treadPluginHttpBytes,\n\tbufferPluginHttpRequest,\n\tdecoratePluginHttpResponse,\n\tpluginHttpResponseFromWire,\n] = (${createPluginHttpWireRuntime.toString()})(${PLUGIN_HTTP_MAX_REQUEST_BYTES});`;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/plugins/secret-redactor.d.ts
|
|
2
|
+
interface PluginSecretRedactor {
|
|
3
|
+
add(key: string, value: string): void;
|
|
4
|
+
redact<T>(value: T): T;
|
|
5
|
+
}
|
|
6
|
+
declare function createPluginSecretRedactor(): PluginSecretRedactor;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { PluginSecretRedactor, createPluginSecretRedactor };
|
|
9
|
+
//# sourceMappingURL=secret-redactor.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-redactor.d.mts","names":[],"sources":["../../src/plugins/secret-redactor.ts"],"mappings":";UAAiB,oBAAA;EAChB,GAAA,CAAI,GAAA,UAAa,KAAA;EACjB,MAAA,IAAU,KAAA,EAAO,CAAA,GAAI,CAAA;AAAA;AAAA,iBAGN,0BAAA,CAAA,GAA8B,oBAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/plugins/secret-redactor.ts
|
|
2
|
+
function createPluginSecretRedactor() {
|
|
3
|
+
const secretsByKey = /* @__PURE__ */ new Map();
|
|
4
|
+
const secretValues = () => [...new Set([...secretsByKey.values()].flat().filter((value) => value !== void 0))].toSorted((a, b) => b.length - a.length);
|
|
5
|
+
const redactString = (value) => {
|
|
6
|
+
let redacted = value;
|
|
7
|
+
for (const secret of secretValues()) redacted = redacted.replaceAll(secret, "[REDACTED]");
|
|
8
|
+
return redacted;
|
|
9
|
+
};
|
|
10
|
+
const redactValue = (value, seen) => {
|
|
11
|
+
if (typeof value === "string") return redactString(value);
|
|
12
|
+
if (typeof value !== "object" || value === null) return value;
|
|
13
|
+
const existing = seen.get(value);
|
|
14
|
+
if (existing !== void 0) return existing;
|
|
15
|
+
if (value instanceof Error) {
|
|
16
|
+
const redacted = new Error(redactString(value.message));
|
|
17
|
+
redacted.name = value.name;
|
|
18
|
+
redacted.stack = value.stack ? redactString(value.stack) : void 0;
|
|
19
|
+
seen.set(value, redacted);
|
|
20
|
+
return redacted;
|
|
21
|
+
}
|
|
22
|
+
if (Array.isArray(value)) {
|
|
23
|
+
const redacted = [];
|
|
24
|
+
seen.set(value, redacted);
|
|
25
|
+
for (const entry of value) redacted.push(redactValue(entry, seen));
|
|
26
|
+
return redacted;
|
|
27
|
+
}
|
|
28
|
+
if (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null) {
|
|
29
|
+
const redacted = {};
|
|
30
|
+
seen.set(value, redacted);
|
|
31
|
+
for (const [key, entry] of Object.entries(value)) redacted[redactString(key)] = redactValue(entry, seen);
|
|
32
|
+
return redacted;
|
|
33
|
+
}
|
|
34
|
+
return "[NonPlainObject]";
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
add(key, value) {
|
|
38
|
+
if (value.length === 0) return;
|
|
39
|
+
const current = secretsByKey.get(key)?.[0];
|
|
40
|
+
if (current === value) return;
|
|
41
|
+
secretsByKey.set(key, current ? [value, current] : [value]);
|
|
42
|
+
},
|
|
43
|
+
redact(value) {
|
|
44
|
+
return redactValue(value, /* @__PURE__ */ new WeakMap());
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { createPluginSecretRedactor };
|
|
51
|
+
//# sourceMappingURL=secret-redactor.mjs.map
|