emdash 0.15.0 → 0.16.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/api/route-utils.mjs +10 -10
- package/dist/api/schemas/index.d.mts +1 -1
- package/dist/{api-CLwG_3dh.mjs → api-BNKqxyFX.mjs} +54 -14
- package/dist/{api-CLwG_3dh.mjs.map → api-BNKqxyFX.mjs.map} +1 -1
- package/dist/{apply-wJhM_bwU.mjs → apply-BOPaD-s9.mjs} +16 -16
- package/dist/{apply-wJhM_bwU.mjs.map → apply-BOPaD-s9.mjs.map} +1 -1
- package/dist/astro/index.d.mts +3 -3
- package/dist/astro/index.d.mts.map +1 -1
- package/dist/astro/index.mjs +33 -1
- package/dist/astro/index.mjs.map +1 -1
- package/dist/astro/middleware/auth.d.mts +3 -3
- package/dist/astro/middleware/auth.mjs +2 -2
- package/dist/astro/middleware/redirect.mjs +4 -4
- package/dist/astro/middleware/request-context.mjs +1 -1
- package/dist/astro/middleware.d.mts.map +1 -1
- package/dist/astro/middleware.mjs +66 -46
- package/dist/astro/middleware.mjs.map +1 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +3 -3
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +3 -3
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +2 -2
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +3 -3
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +8 -8
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +9 -9
- package/dist/astro/routes/api/admin/bylines/index.mjs +9 -9
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +7 -7
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +6 -6
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +6 -6
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +4 -4
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/index.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +3 -3
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +27 -27
- package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +27 -27
- 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 +41 -28
- 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 +8 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.d.mts.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +301 -0
- package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs.map +1 -0
- package/dist/astro/routes/api/admin/plugins/registry/install.d.mts.map +1 -1
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs +46 -28
- package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
- package/dist/astro/routes/api/admin/plugins/updates.mjs +27 -27
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +27 -27
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +3 -3
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +27 -27
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +3 -3
- package/dist/astro/routes/api/auth/dev-bypass.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/index.mjs +3 -3
- package/dist/astro/routes/api/auth/invite/register-options.mjs +3 -3
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +4 -4
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/index.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/options.mjs +4 -4
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/passkey/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/signup/complete.mjs +3 -3
- package/dist/astro/routes/api/auth/signup/request.mjs +4 -4
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +8 -8
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +3 -3
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/index.mjs +4 -4
- package/dist/astro/routes/api/content/_collection_/trash.mjs +4 -4
- package/dist/astro/routes/api/dashboard.mjs +7 -7
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/import/probe.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +3 -3
- package/dist/astro/routes/api/import/wordpress/execute.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress/media.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +6 -6
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +11 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +17 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +7 -7
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs.map +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +4 -4
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +5 -5
- package/dist/astro/routes/api/manifest.mjs +3 -3
- package/dist/astro/routes/api/mcp.mjs +26 -26
- package/dist/astro/routes/api/media/_id_/confirm.mjs +4 -4
- package/dist/astro/routes/api/media/_id_.mjs +4 -4
- package/dist/astro/routes/api/media/file/_...key_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +3 -3
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +3 -3
- package/dist/astro/routes/api/media/providers/index.mjs +3 -3
- package/dist/astro/routes/api/media/upload-url.mjs +4 -4
- package/dist/astro/routes/api/media.mjs +5 -5
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +5 -5
- package/dist/astro/routes/api/menus/_name_/items.mjs +5 -5
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +5 -5
- package/dist/astro/routes/api/menus/_name_/translations.mjs +5 -5
- package/dist/astro/routes/api/menus/_name_.mjs +5 -5
- package/dist/astro/routes/api/menus/index.mjs +5 -5
- package/dist/astro/routes/api/oauth/device/authorize.mjs +3 -3
- package/dist/astro/routes/api/oauth/device/code.mjs +4 -4
- package/dist/astro/routes/api/oauth/device/token.mjs +4 -4
- package/dist/astro/routes/api/oauth/register.mjs +2 -2
- package/dist/astro/routes/api/oauth/token/refresh.mjs +3 -3
- package/dist/astro/routes/api/oauth/token/revoke.mjs +3 -3
- package/dist/astro/routes/api/oauth/token.mjs +2 -2
- package/dist/astro/routes/api/openapi.json.mjs +2 -2
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
- package/dist/astro/routes/api/redirects/404s/index.mjs +6 -6
- package/dist/astro/routes/api/redirects/404s/summary.mjs +6 -6
- package/dist/astro/routes/api/redirects/_id_.mjs +7 -7
- package/dist/astro/routes/api/redirects/index.mjs +7 -7
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +3 -3
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +3 -3
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +27 -27
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +27 -27
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +27 -27
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +27 -27
- package/dist/astro/routes/api/schema/collections/index.mjs +27 -27
- package/dist/astro/routes/api/schema/index.mjs +6 -6
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +27 -27
- package/dist/astro/routes/api/schema/orphans/index.mjs +27 -27
- package/dist/astro/routes/api/search/enable.mjs +7 -7
- package/dist/astro/routes/api/search/index.mjs +6 -6
- package/dist/astro/routes/api/search/rebuild.mjs +7 -7
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +6 -6
- package/dist/astro/routes/api/sections/_slug_.mjs +6 -6
- package/dist/astro/routes/api/sections/index.mjs +6 -6
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +8 -8
- package/dist/astro/routes/api/setup/admin-verify.mjs +3 -3
- package/dist/astro/routes/api/setup/admin.mjs +3 -3
- package/dist/astro/routes/api/setup/dev-bypass.mjs +15 -15
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +16 -16
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +4 -4
- package/dist/astro/routes/api/snapshot.mjs.map +1 -1
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +9 -9
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +9 -9
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +9 -9
- package/dist/astro/routes/api/taxonomies/index.mjs +9 -9
- package/dist/astro/routes/api/themes/preview.mjs +3 -3
- package/dist/astro/routes/api/typegen.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +4 -4
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +6 -6
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +6 -6
- package/dist/astro/routes/api/widget-areas/_name_.mjs +5 -5
- package/dist/astro/routes/api/widget-areas/index.mjs +6 -6
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +4 -4
- package/dist/astro/routes/sitemap-_collection_.xml.d.mts.map +1 -1
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +58 -13
- package/dist/astro/routes/sitemap-_collection_.xml.mjs.map +1 -1
- package/dist/astro/routes/sitemap.xml.mjs +5 -5
- package/dist/astro/types.d.mts +10 -3
- package/dist/astro/types.d.mts.map +1 -1
- package/dist/{authorize-Bkwe8kuL.mjs → authorize-Bn4S4DUT.mjs} +2 -2
- package/dist/{authorize-Bkwe8kuL.mjs.map → authorize-Bn4S4DUT.mjs.map} +1 -1
- package/dist/{byline-CTaWkMh5.mjs → byline-BDylH_m4.mjs} +3 -3
- package/dist/{byline-CTaWkMh5.mjs.map → byline-BDylH_m4.mjs.map} +1 -1
- package/dist/{bylines-DtDRNF1n.d.mts → bylines-B2_XmnSU.d.mts} +34 -34
- package/dist/{bylines-DtDRNF1n.d.mts.map → bylines-B2_XmnSU.d.mts.map} +1 -1
- package/dist/{bylines-H0Xh5TMy.mjs → bylines-B7TFEvFf.mjs} +2 -2
- package/dist/{bylines-H0Xh5TMy.mjs.map → bylines-B7TFEvFf.mjs.map} +1 -1
- package/dist/{bylines-BYHWU3T7.mjs → bylines-n6nykUyI.mjs} +6 -6
- package/dist/{bylines-BYHWU3T7.mjs.map → bylines-n6nykUyI.mjs.map} +1 -1
- package/dist/{cache-CNk1jIxp.mjs → cache-BcI1yUjR.mjs} +2 -2
- package/dist/{cache-CNk1jIxp.mjs.map → cache-BcI1yUjR.mjs.map} +1 -1
- package/dist/{chunks-BkfVdD-3.mjs → chunks-cYG4SnIP.mjs} +2 -2
- package/dist/{chunks-BkfVdD-3.mjs.map → chunks-cYG4SnIP.mjs.map} +1 -1
- package/dist/cli/index.mjs +61 -15
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/cf-access.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/{comment-_yzlBYPx.mjs → comment-C76G-9tz.mjs} +2 -2
- package/dist/{comment-_yzlBYPx.mjs.map → comment-C76G-9tz.mjs.map} +1 -1
- package/dist/{comments-DxID-rsd.mjs → comments-CCxFFGY1.mjs} +3 -3
- package/dist/{comments-DxID-rsd.mjs.map → comments-CCxFFGY1.mjs.map} +1 -1
- package/dist/{content-C0ooIs-f.mjs → content-8voQNTXX.mjs} +3 -3
- package/dist/{content-C0ooIs-f.mjs.map → content-8voQNTXX.mjs.map} +1 -1
- package/dist/{context-sAnCaUIR.mjs → context-B7qiYrz2.mjs} +7 -7
- package/dist/{context-sAnCaUIR.mjs.map → context-B7qiYrz2.mjs.map} +1 -1
- package/dist/{dashboard-Cqw3ay2X.mjs → dashboard-BeaFSPpx.mjs} +4 -4
- package/dist/{dashboard-Cqw3ay2X.mjs.map → dashboard-BeaFSPpx.mjs.map} +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/db/index.mjs +1 -1
- package/dist/db/sqlite.mjs +1 -1
- package/dist/{db-errors-CGN9kJfo.mjs → db-errors-BiYqoX-n.mjs} +14 -2
- package/dist/db-errors-BiYqoX-n.mjs.map +1 -0
- package/dist/{error-CPh_8eLq.mjs → error-ChfADBuu.mjs} +5 -3
- package/dist/error-ChfADBuu.mjs.map +1 -0
- package/dist/errors-9P_FDrJ_.mjs +17 -0
- package/dist/errors-9P_FDrJ_.mjs.map +1 -0
- package/dist/{fts-manager-Mnrtn-r2.mjs → fts-manager-C_b-4x8u.mjs} +2 -2
- package/dist/{fts-manager-Mnrtn-r2.mjs.map → fts-manager-C_b-4x8u.mjs.map} +1 -1
- package/dist/{index-Bv1Wf1zB.d.mts → index-BPZFAcgE.d.mts} +154 -110
- package/dist/index-BPZFAcgE.d.mts.map +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +38 -38
- package/dist/{load-DmXNVhst.mjs → load-CLFRjk9r.mjs} +2 -2
- package/dist/{load-DmXNVhst.mjs.map → load-CLFRjk9r.mjs.map} +1 -1
- package/dist/{loader-Chm5h7Gr.mjs → loader-D-vIJjfY.mjs} +86 -46
- package/dist/loader-D-vIJjfY.mjs.map +1 -0
- package/dist/media/local-runtime.d.mts +3 -3
- package/dist/media/local-runtime.mjs +4 -4
- package/dist/{media-oqRcNiQf.mjs → media-CKQd8AYU.mjs} +2 -2
- package/dist/{media-oqRcNiQf.mjs.map → media-CKQd8AYU.mjs.map} +1 -1
- package/dist/{menus-C75SSmRy.mjs → menus-C-nWT5Tu.mjs} +17 -11
- package/dist/menus-C-nWT5Tu.mjs.map +1 -0
- package/dist/{menus-Bjf5R1Qq.mjs → menus-arUNspyU.mjs} +2 -2
- package/dist/{menus-Bjf5R1Qq.mjs.map → menus-arUNspyU.mjs.map} +1 -1
- package/dist/{parse-3-caTKgt.mjs → parse-DHbXfvxO.mjs} +2 -2
- package/dist/{parse-3-caTKgt.mjs.map → parse-DHbXfvxO.mjs.map} +1 -1
- package/dist/plugin-utils.d.mts +25 -10
- package/dist/plugin-utils.d.mts.map +1 -1
- package/dist/plugin-utils.mjs +11 -10
- package/dist/plugin-utils.mjs.map +1 -1
- package/dist/plugins/adapt-sandbox-entry.d.mts +3 -3
- package/dist/{query-BJn8TOPk.mjs → query-7m6-l0f_.mjs} +21 -14
- package/dist/query-7m6-l0f_.mjs.map +1 -0
- package/dist/{rate-limit-D_-gAeJ0.mjs → rate-limit-D8RAXN8b.mjs} +2 -2
- package/dist/{rate-limit-D_-gAeJ0.mjs.map → rate-limit-D8RAXN8b.mjs.map} +1 -1
- package/dist/{redirect-CNv4mHX2.mjs → redirect-CjfDGrTd.mjs} +2 -2
- package/dist/{redirect-CNv4mHX2.mjs.map → redirect-CjfDGrTd.mjs.map} +1 -1
- package/dist/{redirects-B-CUZ1Xh.mjs → redirects-CowoEHdE.mjs} +3 -3
- package/dist/{redirects-B-CUZ1Xh.mjs.map → redirects-CowoEHdE.mjs.map} +1 -1
- package/dist/{registry-DqrAQDXH.mjs → registry-Cyp-dx6J.mjs} +4 -4
- package/dist/{registry-DqrAQDXH.mjs.map → registry-Cyp-dx6J.mjs.map} +1 -1
- package/dist/resolve-D6sM-SgF.mjs +143 -0
- package/dist/resolve-D6sM-SgF.mjs.map +1 -0
- package/dist/{runner-CNHRo1mT.d.mts → runner-DSQBurMS.d.mts} +7 -4
- package/dist/runner-DSQBurMS.d.mts.map +1 -0
- package/dist/{runner-CGlojznK.mjs → runner-Drnvs96u.mjs} +20 -24
- package/dist/{runner-CGlojznK.mjs.map → runner-Drnvs96u.mjs.map} +1 -1
- package/dist/runtime.d.mts +3 -3
- package/dist/runtime.mjs +2 -2
- package/dist/{schema-Djdlfi5G.mjs → schema-CI9mYPX3.mjs} +4 -4
- package/dist/{schema-Djdlfi5G.mjs.map → schema-CI9mYPX3.mjs.map} +1 -1
- package/dist/{search-By-NN3da.mjs → search-DKz_mGBP.mjs} +4 -4
- package/dist/{search-By-NN3da.mjs.map → search-DKz_mGBP.mjs.map} +1 -1
- package/dist/{sections-DcBIlOq1.mjs → sections-DBbCDIAT.mjs} +3 -3
- package/dist/{sections-DcBIlOq1.mjs.map → sections-DBbCDIAT.mjs.map} +1 -1
- package/dist/seed/index.mjs +13 -13
- package/dist/{seo-bjDoq9Eg.mjs → seo-BGCyDlkb.mjs} +2 -2
- package/dist/{seo-bjDoq9Eg.mjs.map → seo-BGCyDlkb.mjs.map} +1 -1
- package/dist/{seo-BoR4wCUh.mjs → seo-Dq707mNQ.mjs} +5 -3
- package/dist/seo-Dq707mNQ.mjs.map +1 -0
- package/dist/{service-BuuTdGAT.mjs → service-B0H7U1Y9.mjs} +2 -2
- package/dist/{service-BuuTdGAT.mjs.map → service-B0H7U1Y9.mjs.map} +1 -1
- package/dist/{settings-hcubRfkr.mjs → settings-BSXRtTzk.mjs} +3 -3
- package/dist/{settings-hcubRfkr.mjs.map → settings-BSXRtTzk.mjs.map} +1 -1
- package/dist/{settings-CJnKiWuR.mjs → settings-DfwNyQkf.mjs} +3 -3
- package/dist/{settings-CJnKiWuR.mjs.map → settings-DfwNyQkf.mjs.map} +1 -1
- package/dist/{taxonomies-CLs9HPE2.mjs → taxonomies-4vx0nmMr.mjs} +4 -4
- package/dist/{taxonomies-CLs9HPE2.mjs.map → taxonomies-4vx0nmMr.mjs.map} +1 -1
- package/dist/{taxonomies-WamPVA2x.mjs → taxonomies-CcvrMLbR.mjs} +7 -7
- package/dist/{taxonomies-WamPVA2x.mjs.map → taxonomies-CcvrMLbR.mjs.map} +1 -1
- package/dist/{taxonomy-D4Uc2LsZ.mjs → taxonomy-zqGQUqgu.mjs} +3 -3
- package/dist/{taxonomy-D4Uc2LsZ.mjs.map → taxonomy-zqGQUqgu.mjs.map} +1 -1
- package/dist/{transport-DOxLfUir.d.mts → transport-C2MGqtL6.d.mts} +1 -1
- package/dist/{transport-DOxLfUir.d.mts.map → transport-C2MGqtL6.d.mts.map} +1 -1
- package/dist/{types-ByV5sgsv.mjs → types-B0bmgwMG.mjs} +2 -2
- package/dist/{types-ByV5sgsv.mjs.map → types-B0bmgwMG.mjs.map} +1 -1
- package/dist/{user-D3BD5zdT.mjs → user-hUSOaIJy.mjs} +2 -2
- package/dist/{user-D3BD5zdT.mjs.map → user-hUSOaIJy.mjs.map} +1 -1
- package/dist/{validate-mz87i8_1.mjs → validate-IGltez8n.mjs} +2 -2
- package/dist/{validate-mz87i8_1.mjs.map → validate-IGltez8n.mjs.map} +1 -1
- package/dist/{validation-DKHhXjPr.mjs → validation-Bmymau7y.mjs} +6 -6
- package/dist/{validation-DKHhXjPr.mjs.map → validation-Bmymau7y.mjs.map} +1 -1
- package/dist/version-BTc87L3L.mjs +7 -0
- package/dist/{version-Ct7C6RSo.mjs.map → version-BTc87L3L.mjs.map} +1 -1
- package/dist/{widgets-lShIQXU5.mjs → widgets-yHQa4c6c.mjs} +2 -2
- package/dist/{widgets-lShIQXU5.mjs.map → widgets-yHQa4c6c.mjs.map} +1 -1
- package/dist/{zod-generator-dvxgmd1M.mjs → zod-generator-B80aap1J.mjs} +2 -2
- package/dist/{zod-generator-dvxgmd1M.mjs.map → zod-generator-B80aap1J.mjs.map} +1 -1
- package/package.json +7 -7
- package/src/api/errors.ts +2 -0
- package/src/api/handlers/index.ts +2 -0
- package/src/api/handlers/registry.ts +69 -1
- package/src/api/handlers/seo.ts +16 -1
- package/src/api/handlers/snapshot.ts +1 -1
- package/src/astro/integration/index.ts +26 -0
- package/src/astro/integration/routes.ts +5 -0
- package/src/astro/integration/runtime.ts +8 -0
- package/src/astro/middleware.ts +4 -0
- package/src/astro/public-plugin-api-routes.ts +41 -0
- package/src/astro/routes/api/admin/plugins/registry/[id]/update.ts +4 -0
- package/src/astro/routes/api/admin/plugins/registry/artifact.ts +388 -0
- package/src/astro/routes/api/admin/plugins/registry/install.ts +7 -1
- package/src/astro/routes/api/import/wordpress/rewrite-url-helpers.ts +22 -0
- package/src/astro/routes/api/import/wordpress/rewrite-urls.ts +5 -2
- package/src/astro/routes/sitemap-[collection].xml.ts +114 -14
- package/src/astro/types.ts +14 -0
- package/src/content/converters/portable-text-to-prosemirror.ts +35 -11
- package/src/database/connection.ts +3 -10
- package/src/database/errors.ts +14 -0
- package/src/database/index.ts +3 -1
- package/src/database/migrations/runner.ts +29 -21
- package/src/emdash-runtime.ts +1 -0
- package/src/i18n/resolve.ts +152 -0
- package/src/index.ts +2 -0
- package/src/loader.ts +133 -59
- package/src/plugin-utils.ts +23 -0
- package/src/query.ts +24 -5
- package/src/utils/db-errors.ts +24 -0
- package/dist/connection-2igzM-AT.mjs +0 -57
- package/dist/connection-2igzM-AT.mjs.map +0 -1
- package/dist/db-errors-CGN9kJfo.mjs.map +0 -1
- package/dist/error-CPh_8eLq.mjs.map +0 -1
- package/dist/index-Bv1Wf1zB.d.mts.map +0 -1
- package/dist/loader-Chm5h7Gr.mjs.map +0 -1
- package/dist/menus-C75SSmRy.mjs.map +0 -1
- package/dist/query-BJn8TOPk.mjs.map +0 -1
- package/dist/resolve-Cj98DuqN.mjs +0 -39
- package/dist/resolve-Cj98DuqN.mjs.map +0 -1
- package/dist/runner-CNHRo1mT.d.mts.map +0 -1
- package/dist/seo-BoR4wCUh.mjs.map +0 -1
- package/dist/version-Ct7C6RSo.mjs +0 -7
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import "../../../../../../dialect-helpers-BKCvISIQ.mjs";
|
|
2
|
+
import "../../../../../../content-8voQNTXX.mjs";
|
|
3
|
+
import "../../../../../../base64-CqR-7kqF.mjs";
|
|
4
|
+
import "../../../../../../types-B0bmgwMG.mjs";
|
|
5
|
+
import "../../../../../../media-CKQd8AYU.mjs";
|
|
6
|
+
import "../../../../../../user-hUSOaIJy.mjs";
|
|
7
|
+
import "../../../../../../taxonomy-zqGQUqgu.mjs";
|
|
8
|
+
import "../../../../../../comment-C76G-9tz.mjs";
|
|
9
|
+
import "../../../../../../options-BL4X94qY.mjs";
|
|
10
|
+
import "../../../../../../menus-arUNspyU.mjs";
|
|
11
|
+
import "../../../../../../redirect-CjfDGrTd.mjs";
|
|
12
|
+
import "../../../../../../byline-BDylH_m4.mjs";
|
|
13
|
+
import "../../../../../../seo-BGCyDlkb.mjs";
|
|
14
|
+
import { c as validateAggregatorUrl, o as coerceRegistryConfig, t as assertSafeArtifactUrl } from "../../../../../../api-BNKqxyFX.mjs";
|
|
15
|
+
import "../../../../../../request-cache-dzCt8TZB.mjs";
|
|
16
|
+
import "../../../../../../dashboard-BeaFSPpx.mjs";
|
|
17
|
+
import "../../../../../../fts-manager-C_b-4x8u.mjs";
|
|
18
|
+
import "../../../../../../registry-Cyp-dx6J.mjs";
|
|
19
|
+
import "../../../../../../loader-D-vIJjfY.mjs";
|
|
20
|
+
import "../../../../../../schema-CI9mYPX3.mjs";
|
|
21
|
+
import "../../../../../../zod-generator-B80aap1J.mjs";
|
|
22
|
+
import "../../../../../../seo-Dq707mNQ.mjs";
|
|
23
|
+
import "../../../../../../sections-DBbCDIAT.mjs";
|
|
24
|
+
import "../../../../../../settings-BSXRtTzk.mjs";
|
|
25
|
+
import "../../../../../../settings-DfwNyQkf.mjs";
|
|
26
|
+
import "../../../../../../resolve-D6sM-SgF.mjs";
|
|
27
|
+
import "../../../../../../taxonomies-CcvrMLbR.mjs";
|
|
28
|
+
import "../../../../../../taxonomies-4vx0nmMr.mjs";
|
|
29
|
+
import "../../../../../../manifest-schema-Czqf0TLu.mjs";
|
|
30
|
+
import "../../../../../../types-1NNkmTIn.mjs";
|
|
31
|
+
import "../../../../../../ssrf-MZ-zrG6-.mjs";
|
|
32
|
+
import { t as apiError } from "../../../../../../error-ChfADBuu.mjs";
|
|
33
|
+
import "../../../../../../parse-DHbXfvxO.mjs";
|
|
34
|
+
import "../../../../../../redirects-COMLwsV5.mjs";
|
|
35
|
+
import "../../../../../../setup-Cf_TyOv5.mjs";
|
|
36
|
+
import { n as requirePerm } from "../../../../../../authorize-Bn4S4DUT.mjs";
|
|
37
|
+
|
|
38
|
+
//#region src/astro/routes/api/admin/plugins/registry/artifact.ts
|
|
39
|
+
const prerender = false;
|
|
40
|
+
/**
|
|
41
|
+
* Image content types the proxy will pass through. Anything else is rejected.
|
|
42
|
+
*
|
|
43
|
+
* SVG is deliberately excluded: it is active content (an `<svg><script>`
|
|
44
|
+
* executes when navigated to as a top-level document), and the publisher
|
|
45
|
+
* supplies the bytes. Rather than serve it behind mitigations, we refuse it
|
|
46
|
+
* end-to-end — the publish CLI rejects SVG artifacts too, so a conforming
|
|
47
|
+
* release never references one. AVIF is included.
|
|
48
|
+
*/
|
|
49
|
+
const ALLOWED_IMAGE_TYPES = new Set([
|
|
50
|
+
"image/png",
|
|
51
|
+
"image/jpeg",
|
|
52
|
+
"image/webp",
|
|
53
|
+
"image/gif",
|
|
54
|
+
"image/avif"
|
|
55
|
+
]);
|
|
56
|
+
/** Artifact kinds the proxy can resolve. `screenshot` additionally needs `index`. */
|
|
57
|
+
const ALLOWED_KINDS = new Set([
|
|
58
|
+
"icon",
|
|
59
|
+
"banner",
|
|
60
|
+
"screenshot"
|
|
61
|
+
]);
|
|
62
|
+
/** Loose DID shape (`did:method:id`); the aggregator lexicon is authoritative. */
|
|
63
|
+
const DID_PATTERN = /^did:[a-z]+:.+/;
|
|
64
|
+
/** Slug grammar: ASCII letter then letters / digits / `-` / `_`. Mirrors the install route. */
|
|
65
|
+
const SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
|
|
66
|
+
/** Non-negative integer, for the screenshot index param. */
|
|
67
|
+
const INDEX_PATTERN = /^\d+$/;
|
|
68
|
+
/** Cap proxied images so a hostile host can't stream an unbounded body. */
|
|
69
|
+
const MAX_IMAGE_BYTES = 5 * 1024 * 1024;
|
|
70
|
+
/** Redirect hops to follow, re-validating each target against SSRF rules. */
|
|
71
|
+
const MAX_REDIRECTS = 5;
|
|
72
|
+
/** Wall-clock budget covering connect + headers + body for the artifact fetch. */
|
|
73
|
+
const FETCH_TIMEOUT_MS = 15e3;
|
|
74
|
+
/** Per-aggregator-request timeout and overall budget for release resolution. */
|
|
75
|
+
const AGGREGATOR_REQUEST_TIMEOUT_MS = 15e3;
|
|
76
|
+
const AGGREGATOR_TOTAL_BUDGET_MS = 3e4;
|
|
77
|
+
/** Bound the version search: 20 pages * 50 per page = 1000 releases worth. */
|
|
78
|
+
const MAX_LIST_PAGES = 20;
|
|
79
|
+
/** Build a fetch that enforces a per-request and per-budget timeout. Mirrors the install handler. */
|
|
80
|
+
function timedFetch(totalDeadline) {
|
|
81
|
+
return (input, init) => {
|
|
82
|
+
const now = Date.now();
|
|
83
|
+
const remaining = Math.max(0, totalDeadline - now);
|
|
84
|
+
if (remaining === 0) return Promise.reject(/* @__PURE__ */ new Error("Aggregator request budget exhausted"));
|
|
85
|
+
const timeout = Math.min(AGGREGATOR_REQUEST_TIMEOUT_MS, remaining);
|
|
86
|
+
const controller = new AbortController();
|
|
87
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
88
|
+
const callerSignal = init?.signal;
|
|
89
|
+
if (callerSignal) if (callerSignal.aborted) controller.abort(callerSignal.reason);
|
|
90
|
+
else callerSignal.addEventListener("abort", () => controller.abort(callerSignal.reason));
|
|
91
|
+
return fetch(input, {
|
|
92
|
+
...init,
|
|
93
|
+
signal: controller.signal
|
|
94
|
+
}).finally(() => {
|
|
95
|
+
clearTimeout(timer);
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Narrow one entry of a release's `artifacts` map to a usable image URL.
|
|
101
|
+
*
|
|
102
|
+
* The embedded `release` record is lexicon-validated at the DiscoveryClient
|
|
103
|
+
* boundary, but `artifacts` is an aggregator pass-through typed `unknown`, so
|
|
104
|
+
* the entry's shape is not guaranteed. Returns the `url` string only when the
|
|
105
|
+
* value is an object carrying a non-empty string `url`; everything else
|
|
106
|
+
* (missing key, wrong type, no `url`) yields `null`.
|
|
107
|
+
*/
|
|
108
|
+
function declaredArtifactUrl(value) {
|
|
109
|
+
if (!value || typeof value !== "object") return null;
|
|
110
|
+
const url = value.url;
|
|
111
|
+
if (typeof url !== "string" || url.length === 0) return null;
|
|
112
|
+
return url;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Resolve the declared artifact URL for `(kind, index)` from a release's
|
|
116
|
+
* `artifacts` map. Returns `null` when the requested artifact isn't present
|
|
117
|
+
* or doesn't carry a usable URL.
|
|
118
|
+
*/
|
|
119
|
+
function resolveDeclaredUrl(artifacts, kind, index) {
|
|
120
|
+
if (!artifacts || typeof artifacts !== "object") return null;
|
|
121
|
+
const map = artifacts;
|
|
122
|
+
if (kind === "icon") return declaredArtifactUrl(map.icon);
|
|
123
|
+
if (kind === "banner") return declaredArtifactUrl(map.banner);
|
|
124
|
+
const screenshots = map.screenshots;
|
|
125
|
+
if (!Array.isArray(screenshots)) return null;
|
|
126
|
+
if (index < 0 || index >= screenshots.length) return null;
|
|
127
|
+
return declaredArtifactUrl(screenshots[index]);
|
|
128
|
+
}
|
|
129
|
+
const GET = async ({ url, locals }) => {
|
|
130
|
+
const { emdash, user } = locals;
|
|
131
|
+
if (!emdash?.db) return apiError("NOT_CONFIGURED", "EmDash is not initialized", 500);
|
|
132
|
+
const denied = requirePerm(user, "plugins:read");
|
|
133
|
+
if (denied) return denied;
|
|
134
|
+
const did = url.searchParams.get("did");
|
|
135
|
+
const slug = url.searchParams.get("slug");
|
|
136
|
+
const kind = url.searchParams.get("kind");
|
|
137
|
+
const versionParam = url.searchParams.get("version");
|
|
138
|
+
const indexParam = url.searchParams.get("index");
|
|
139
|
+
if (!did || !slug || !kind) return apiError("INVALID_REQUEST", "Missing did, slug, or kind", 400);
|
|
140
|
+
if (did.length > 256 || !DID_PATTERN.test(did)) return apiError("INVALID_REQUEST", "Invalid did", 400);
|
|
141
|
+
if (slug.length > 64 || !SLUG_PATTERN.test(slug)) return apiError("INVALID_REQUEST", "Invalid slug", 400);
|
|
142
|
+
if (!ALLOWED_KINDS.has(kind)) return apiError("INVALID_REQUEST", "Invalid kind", 400);
|
|
143
|
+
let index = 0;
|
|
144
|
+
if (kind === "screenshot") {
|
|
145
|
+
if (indexParam === null) return apiError("INVALID_REQUEST", "Missing index for screenshot", 400);
|
|
146
|
+
if (!INDEX_PATTERN.test(indexParam)) return apiError("INVALID_REQUEST", "Invalid index", 400);
|
|
147
|
+
index = Number(indexParam);
|
|
148
|
+
if (!Number.isSafeInteger(index)) return apiError("INVALID_REQUEST", "Invalid index", 400);
|
|
149
|
+
}
|
|
150
|
+
let version;
|
|
151
|
+
if (versionParam !== null && versionParam.length > 0) {
|
|
152
|
+
if (versionParam.length > 64) return apiError("INVALID_REQUEST", "Invalid version", 400);
|
|
153
|
+
version = versionParam;
|
|
154
|
+
}
|
|
155
|
+
const registryConfig = coerceRegistryConfig(emdash.config.experimental?.registry);
|
|
156
|
+
if (!registryConfig) return apiError("REGISTRY_NOT_CONFIGURED", "Registry is not configured", 400);
|
|
157
|
+
try {
|
|
158
|
+
validateAggregatorUrl(registryConfig.aggregatorUrl);
|
|
159
|
+
} catch {
|
|
160
|
+
return apiError("REGISTRY_NOT_CONFIGURED", "Registry aggregator URL is invalid", 500);
|
|
161
|
+
}
|
|
162
|
+
let declaredUrl;
|
|
163
|
+
try {
|
|
164
|
+
const resolved = await resolveArtifactUrl(registryConfig, did, slug, version, kind, index);
|
|
165
|
+
if (resolved === null) return apiError("ARTIFACT_NOT_FOUND", "Artifact not found", 404);
|
|
166
|
+
declaredUrl = resolved;
|
|
167
|
+
} catch {
|
|
168
|
+
return apiError("ARTIFACT_RESOLVE_FAILED", "Failed to resolve artifact", 502);
|
|
169
|
+
}
|
|
170
|
+
const controller = new AbortController();
|
|
171
|
+
const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
172
|
+
try {
|
|
173
|
+
let current;
|
|
174
|
+
try {
|
|
175
|
+
current = await assertSafeArtifactUrl(declaredUrl);
|
|
176
|
+
} catch {
|
|
177
|
+
return apiError("ARTIFACT_URL_REJECTED", "Artifact URL is not allowed", 400);
|
|
178
|
+
}
|
|
179
|
+
let response;
|
|
180
|
+
for (let hop = 0;; hop++) {
|
|
181
|
+
response = await fetch(current.href, {
|
|
182
|
+
redirect: "manual",
|
|
183
|
+
signal: controller.signal
|
|
184
|
+
});
|
|
185
|
+
if (response.status < 300 || response.status >= 400) break;
|
|
186
|
+
const location = response.headers.get("location");
|
|
187
|
+
if (!location) break;
|
|
188
|
+
if (hop === MAX_REDIRECTS) return apiError("ARTIFACT_URL_REJECTED", "Too many redirects", 502);
|
|
189
|
+
let next;
|
|
190
|
+
try {
|
|
191
|
+
next = await assertSafeArtifactUrl(new URL(location, current).href);
|
|
192
|
+
} catch {
|
|
193
|
+
return apiError("ARTIFACT_URL_REJECTED", "Redirect target is not allowed", 400);
|
|
194
|
+
}
|
|
195
|
+
current = next;
|
|
196
|
+
}
|
|
197
|
+
if (!response.ok) return apiError("ARTIFACT_FETCH_FAILED", "Failed to fetch artifact", 502);
|
|
198
|
+
const contentType = (response.headers.get("content-type") ?? "").split(";", 1)[0].trim().toLowerCase();
|
|
199
|
+
if (!ALLOWED_IMAGE_TYPES.has(contentType)) return apiError("ARTIFACT_NOT_IMAGE", "Artifact is not an allowed image type", 415);
|
|
200
|
+
const declaredLength = response.headers.get("content-length");
|
|
201
|
+
if (declaredLength) {
|
|
202
|
+
const declared = Number(declaredLength);
|
|
203
|
+
if (Number.isFinite(declared) && declared > MAX_IMAGE_BYTES) return apiError("ARTIFACT_TOO_LARGE", "Artifact exceeds size limit", 413);
|
|
204
|
+
}
|
|
205
|
+
const bytes = await readCapped(response, MAX_IMAGE_BYTES);
|
|
206
|
+
if (bytes === null) return apiError("ARTIFACT_TOO_LARGE", "Artifact exceeds size limit", 413);
|
|
207
|
+
return new Response(bytes, { headers: {
|
|
208
|
+
"Content-Type": contentType,
|
|
209
|
+
"Cache-Control": "private, no-store",
|
|
210
|
+
"X-Content-Type-Options": "nosniff",
|
|
211
|
+
"Content-Disposition": "attachment",
|
|
212
|
+
"Content-Security-Policy": "default-src 'none'; sandbox"
|
|
213
|
+
} });
|
|
214
|
+
} catch {
|
|
215
|
+
return apiError("ARTIFACT_FETCH_FAILED", "Failed to fetch artifact", 502);
|
|
216
|
+
} finally {
|
|
217
|
+
clearTimeout(timer);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Resolve the declared artifact URL for `(did, slug, version, kind, index)`
|
|
222
|
+
* from the aggregator's release record. Mirrors the install handler's release
|
|
223
|
+
* lookup. Returns `null` when the package/release/artifact isn't found.
|
|
224
|
+
*
|
|
225
|
+
* Self-contained to this route: the install/update handlers are intentionally
|
|
226
|
+
* left untouched, so a small amount of resolution-pattern duplication is
|
|
227
|
+
* accepted here.
|
|
228
|
+
*/
|
|
229
|
+
async function resolveArtifactUrl(registryConfig, did, slug, version, kind, index) {
|
|
230
|
+
const { DiscoveryClient } = await import("@emdash-cms/registry-client/discovery");
|
|
231
|
+
const aggregatorDeadline = Date.now() + AGGREGATOR_TOTAL_BUDGET_MS;
|
|
232
|
+
const discovery = new DiscoveryClient({
|
|
233
|
+
aggregatorUrl: registryConfig.aggregatorUrl,
|
|
234
|
+
acceptLabelers: registryConfig.acceptLabelers,
|
|
235
|
+
fetch: timedFetch(aggregatorDeadline)
|
|
236
|
+
});
|
|
237
|
+
const publisherDid = did;
|
|
238
|
+
const releaseView = await (async () => {
|
|
239
|
+
if (!version) return discovery.getLatestRelease({
|
|
240
|
+
did: publisherDid,
|
|
241
|
+
package: slug
|
|
242
|
+
});
|
|
243
|
+
let cursor;
|
|
244
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
245
|
+
for (let page = 0; page < MAX_LIST_PAGES; page++) {
|
|
246
|
+
if (cursor !== void 0) {
|
|
247
|
+
if (seenCursors.has(cursor)) break;
|
|
248
|
+
seenCursors.add(cursor);
|
|
249
|
+
}
|
|
250
|
+
const result = await discovery.listReleases({
|
|
251
|
+
did: publisherDid,
|
|
252
|
+
package: slug,
|
|
253
|
+
cursor,
|
|
254
|
+
limit: 50
|
|
255
|
+
});
|
|
256
|
+
for (const r of result.releases) if (r.version === version) return r;
|
|
257
|
+
if (!result.cursor) break;
|
|
258
|
+
cursor = result.cursor;
|
|
259
|
+
}
|
|
260
|
+
})();
|
|
261
|
+
if (!releaseView?.release) return null;
|
|
262
|
+
return resolveDeclaredUrl(releaseView.release.artifacts, kind, index);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Read a response body into memory, aborting once it exceeds `limit`. Returns
|
|
266
|
+
* `null` when the cap is breached (the streamed body lied about / omitted
|
|
267
|
+
* Content-Length). The cap is the real defence against an unbounded body.
|
|
268
|
+
*/
|
|
269
|
+
async function readCapped(response, limit) {
|
|
270
|
+
const body = response.body;
|
|
271
|
+
if (!body) {
|
|
272
|
+
const buf = new Uint8Array(await response.arrayBuffer());
|
|
273
|
+
return buf.length > limit ? null : buf;
|
|
274
|
+
}
|
|
275
|
+
const reader = body.getReader();
|
|
276
|
+
const chunks = [];
|
|
277
|
+
let total = 0;
|
|
278
|
+
while (true) {
|
|
279
|
+
const { done, value } = await reader.read();
|
|
280
|
+
if (done) break;
|
|
281
|
+
if (value) {
|
|
282
|
+
total += value.length;
|
|
283
|
+
if (total > limit) {
|
|
284
|
+
await reader.cancel();
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
chunks.push(value);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const combined = new Uint8Array(total);
|
|
291
|
+
let offset = 0;
|
|
292
|
+
for (const chunk of chunks) {
|
|
293
|
+
combined.set(chunk, offset);
|
|
294
|
+
offset += chunk.length;
|
|
295
|
+
}
|
|
296
|
+
return combined;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
//#endregion
|
|
300
|
+
export { GET, prerender };
|
|
301
|
+
//# sourceMappingURL=artifact.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/plugins/registry/artifact.ts"],"sourcesContent":["/**\n * Registry artifact proxy\n *\n * GET /_emdash/api/admin/plugins/registry/artifact?did=&slug=&version=&kind=&index=\n *\n * Proxies an icon / screenshot / banner image referenced by a registry\n * release record so the admin UI can display it without cross-origin\n * requests to arbitrary publisher hosting.\n *\n * Trust model (CRITICAL): the proxy never accepts an artifact URL from the\n * client. The caller addresses an artifact by its coordinates\n * `(did, slug, version, kind, index)`; the server resolves the *declared*\n * URL from the validated release record fetched from the configured\n * aggregator. The proxy can therefore only ever fetch a URL the publisher\n * declared in their signed release — not an arbitrary caller-supplied URL.\n *\n * The publisher-declared URL is still untrusted (an attacker who controls a\n * publisher record, or the aggregator, can point it anywhere), so the\n * resolved URL passes through the SSRF defences (`assertSafeArtifactUrl`,\n * re-validated on every redirect hop) before any fetch, and only allowlisted\n * image content types are served back.\n */\n\nimport type { Did } from \"@atcute/lexicons\";\nimport type { APIRoute } from \"astro\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError } from \"#api/error.js\";\nimport { assertSafeArtifactUrl } from \"#api/index.js\";\n\nimport { coerceRegistryConfig, validateAggregatorUrl } from \"../../../../../../registry/config.js\";\n\nexport const prerender = false;\n\n/**\n * Image content types the proxy will pass through. Anything else is rejected.\n *\n * SVG is deliberately excluded: it is active content (an `<svg><script>`\n * executes when navigated to as a top-level document), and the publisher\n * supplies the bytes. Rather than serve it behind mitigations, we refuse it\n * end-to-end — the publish CLI rejects SVG artifacts too, so a conforming\n * release never references one. AVIF is included.\n */\nconst ALLOWED_IMAGE_TYPES = new Set([\n\t\"image/png\",\n\t\"image/jpeg\",\n\t\"image/webp\",\n\t\"image/gif\",\n\t\"image/avif\",\n]);\n\n/** Artifact kinds the proxy can resolve. `screenshot` additionally needs `index`. */\nconst ALLOWED_KINDS = new Set([\"icon\", \"banner\", \"screenshot\"]);\n\n/** Loose DID shape (`did:method:id`); the aggregator lexicon is authoritative. */\nconst DID_PATTERN = /^did:[a-z]+:.+/;\n/** Slug grammar: ASCII letter then letters / digits / `-` / `_`. Mirrors the install route. */\nconst SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;\n/** Non-negative integer, for the screenshot index param. */\nconst INDEX_PATTERN = /^\\d+$/;\n\n/** Cap proxied images so a hostile host can't stream an unbounded body. */\nconst MAX_IMAGE_BYTES = 5 * 1024 * 1024;\n\n/** Redirect hops to follow, re-validating each target against SSRF rules. */\nconst MAX_REDIRECTS = 5;\n\n/** Wall-clock budget covering connect + headers + body for the artifact fetch. */\nconst FETCH_TIMEOUT_MS = 15_000;\n\n/** Per-aggregator-request timeout and overall budget for release resolution. */\nconst AGGREGATOR_REQUEST_TIMEOUT_MS = 15_000;\nconst AGGREGATOR_TOTAL_BUDGET_MS = 30_000;\n\n/** Bound the version search: 20 pages * 50 per page = 1000 releases worth. */\nconst MAX_LIST_PAGES = 20;\n\n/** Build a fetch that enforces a per-request and per-budget timeout. Mirrors the install handler. */\nfunction timedFetch(totalDeadline: number): typeof fetch {\n\treturn (input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]) => {\n\t\tconst now = Date.now();\n\t\tconst remaining = Math.max(0, totalDeadline - now);\n\t\tif (remaining === 0) {\n\t\t\treturn Promise.reject(new Error(\"Aggregator request budget exhausted\"));\n\t\t}\n\t\tconst timeout = Math.min(AGGREGATOR_REQUEST_TIMEOUT_MS, remaining);\n\t\tconst controller = new AbortController();\n\t\tconst timer = setTimeout(() => controller.abort(), timeout);\n\t\tconst callerSignal = init?.signal;\n\t\tif (callerSignal) {\n\t\t\tif (callerSignal.aborted) controller.abort(callerSignal.reason);\n\t\t\telse callerSignal.addEventListener(\"abort\", () => controller.abort(callerSignal.reason));\n\t\t}\n\t\treturn fetch(input, { ...init, signal: controller.signal }).finally(() => {\n\t\t\tclearTimeout(timer);\n\t\t});\n\t};\n}\n\n/**\n * Narrow one entry of a release's `artifacts` map to a usable image URL.\n *\n * The embedded `release` record is lexicon-validated at the DiscoveryClient\n * boundary, but `artifacts` is an aggregator pass-through typed `unknown`, so\n * the entry's shape is not guaranteed. Returns the `url` string only when the\n * value is an object carrying a non-empty string `url`; everything else\n * (missing key, wrong type, no `url`) yields `null`.\n */\nfunction declaredArtifactUrl(value: unknown): string | null {\n\tif (!value || typeof value !== \"object\") return null;\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- narrowed to non-null object above; url checked below\n\tconst entry = value as Record<string, unknown>;\n\tconst url = entry.url;\n\tif (typeof url !== \"string\" || url.length === 0) return null;\n\treturn url;\n}\n\n/**\n * Resolve the declared artifact URL for `(kind, index)` from a release's\n * `artifacts` map. Returns `null` when the requested artifact isn't present\n * or doesn't carry a usable URL.\n */\nfunction resolveDeclaredUrl(artifacts: unknown, kind: string, index: number): string | null {\n\tif (!artifacts || typeof artifacts !== \"object\") return null;\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- narrowed to non-null object above; each entry shape-narrowed by declaredArtifactUrl\n\tconst map = artifacts as Record<string, unknown>;\n\n\tif (kind === \"icon\") return declaredArtifactUrl(map.icon);\n\tif (kind === \"banner\") return declaredArtifactUrl(map.banner);\n\t// kind === \"screenshot\"\n\tconst screenshots = map.screenshots;\n\tif (!Array.isArray(screenshots)) return null;\n\tif (index < 0 || index >= screenshots.length) return null;\n\treturn declaredArtifactUrl(screenshots[index]);\n}\n\nexport const GET: APIRoute = async ({ url, locals }) => {\n\tconst { emdash, user } = locals;\n\n\tif (!emdash?.db) {\n\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t}\n\n\tconst denied = requirePerm(user, \"plugins:read\");\n\tif (denied) return denied;\n\n\tconst did = url.searchParams.get(\"did\");\n\tconst slug = url.searchParams.get(\"slug\");\n\tconst kind = url.searchParams.get(\"kind\");\n\tconst versionParam = url.searchParams.get(\"version\");\n\tconst indexParam = url.searchParams.get(\"index\");\n\n\tif (!did || !slug || !kind) {\n\t\treturn apiError(\"INVALID_REQUEST\", \"Missing did, slug, or kind\", 400);\n\t}\n\tif (did.length > 256 || !DID_PATTERN.test(did)) {\n\t\treturn apiError(\"INVALID_REQUEST\", \"Invalid did\", 400);\n\t}\n\tif (slug.length > 64 || !SLUG_PATTERN.test(slug)) {\n\t\treturn apiError(\"INVALID_REQUEST\", \"Invalid slug\", 400);\n\t}\n\tif (!ALLOWED_KINDS.has(kind)) {\n\t\treturn apiError(\"INVALID_REQUEST\", \"Invalid kind\", 400);\n\t}\n\n\tlet index = 0;\n\tif (kind === \"screenshot\") {\n\t\tif (indexParam === null) {\n\t\t\treturn apiError(\"INVALID_REQUEST\", \"Missing index for screenshot\", 400);\n\t\t}\n\t\tif (!INDEX_PATTERN.test(indexParam)) {\n\t\t\treturn apiError(\"INVALID_REQUEST\", \"Invalid index\", 400);\n\t\t}\n\t\tindex = Number(indexParam);\n\t\tif (!Number.isSafeInteger(index)) {\n\t\t\treturn apiError(\"INVALID_REQUEST\", \"Invalid index\", 400);\n\t\t}\n\t}\n\n\tlet version: string | undefined;\n\tif (versionParam !== null && versionParam.length > 0) {\n\t\tif (versionParam.length > 64) {\n\t\t\treturn apiError(\"INVALID_REQUEST\", \"Invalid version\", 400);\n\t\t}\n\t\tversion = versionParam;\n\t}\n\n\tconst registryConfig = coerceRegistryConfig(emdash.config.experimental?.registry);\n\tif (!registryConfig) {\n\t\treturn apiError(\"REGISTRY_NOT_CONFIGURED\", \"Registry is not configured\", 400);\n\t}\n\ttry {\n\t\tvalidateAggregatorUrl(registryConfig.aggregatorUrl);\n\t} catch {\n\t\treturn apiError(\"REGISTRY_NOT_CONFIGURED\", \"Registry aggregator URL is invalid\", 500);\n\t}\n\n\t// Resolve the publisher-declared artifact URL from the release record.\n\tlet declaredUrl: string;\n\ttry {\n\t\tconst resolved = await resolveArtifactUrl(registryConfig, did, slug, version, kind, index);\n\t\tif (resolved === null) {\n\t\t\treturn apiError(\"ARTIFACT_NOT_FOUND\", \"Artifact not found\", 404);\n\t\t}\n\t\tdeclaredUrl = resolved;\n\t} catch {\n\t\treturn apiError(\"ARTIFACT_RESOLVE_FAILED\", \"Failed to resolve artifact\", 502);\n\t}\n\n\tconst controller = new AbortController();\n\tconst timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);\n\ttry {\n\t\t// `assertSafeArtifactUrl` validates scheme / credentials / loopback +\n\t\t// resolves the hostname and rejects private / link-local / metadata\n\t\t// targets (DNS-rebinding defence). It throws a plain Error on any\n\t\t// block, so a rejection here means the URL is unsafe.\n\t\tlet current: URL;\n\t\ttry {\n\t\t\tcurrent = await assertSafeArtifactUrl(declaredUrl);\n\t\t} catch {\n\t\t\treturn apiError(\"ARTIFACT_URL_REJECTED\", \"Artifact URL is not allowed\", 400);\n\t\t}\n\n\t\tlet response: Response;\n\t\tfor (let hop = 0; ; hop++) {\n\t\t\tresponse = await fetch(current.href, { redirect: \"manual\", signal: controller.signal });\n\t\t\tif (response.status < 300 || response.status >= 400) break;\n\t\t\tconst location = response.headers.get(\"location\");\n\t\t\tif (!location) break;\n\t\t\tif (hop === MAX_REDIRECTS) {\n\t\t\t\treturn apiError(\"ARTIFACT_URL_REJECTED\", \"Too many redirects\", 502);\n\t\t\t}\n\t\t\tlet next: URL;\n\t\t\ttry {\n\t\t\t\tnext = await assertSafeArtifactUrl(new URL(location, current).href);\n\t\t\t} catch {\n\t\t\t\treturn apiError(\"ARTIFACT_URL_REJECTED\", \"Redirect target is not allowed\", 400);\n\t\t\t}\n\t\t\tcurrent = next;\n\t\t}\n\n\t\tif (!response.ok) {\n\t\t\treturn apiError(\"ARTIFACT_FETCH_FAILED\", \"Failed to fetch artifact\", 502);\n\t\t}\n\n\t\t// Content-Type allowlist: only image types are proxied. A non-image\n\t\t// (HTML error page, JSON, octet-stream) is rejected so the admin\n\t\t// never renders publisher-controlled markup from the EmDash origin.\n\t\tconst rawType = response.headers.get(\"content-type\") ?? \"\";\n\t\tconst contentType = rawType.split(\";\", 1)[0]!.trim().toLowerCase();\n\t\tif (!ALLOWED_IMAGE_TYPES.has(contentType)) {\n\t\t\treturn apiError(\"ARTIFACT_NOT_IMAGE\", \"Artifact is not an allowed image type\", 415);\n\t\t}\n\n\t\tconst declaredLength = response.headers.get(\"content-length\");\n\t\tif (declaredLength) {\n\t\t\tconst declared = Number(declaredLength);\n\t\t\tif (Number.isFinite(declared) && declared > MAX_IMAGE_BYTES) {\n\t\t\t\treturn apiError(\"ARTIFACT_TOO_LARGE\", \"Artifact exceeds size limit\", 413);\n\t\t\t}\n\t\t}\n\n\t\tconst bytes = await readCapped(response, MAX_IMAGE_BYTES);\n\t\tif (bytes === null) {\n\t\t\treturn apiError(\"ARTIFACT_TOO_LARGE\", \"Artifact exceeds size limit\", 413);\n\t\t}\n\n\t\t// Only the allowlisted Content-Type is forwarded — never copy other\n\t\t// upstream headers. `private, no-store` keeps publisher images out of\n\t\t// shared caches in the authenticated admin origin.\n\t\t//\n\t\t// SVG is not in the allowlist, so active-content bytes never reach\n\t\t// here. `Content-Disposition: attachment`, the sandbox CSP, and\n\t\t// `nosniff` remain as defence-in-depth: they force a download and\n\t\t// neutralise script/plugins for any image type if a client navigates\n\t\t// directly to the proxy URL.\n\t\treturn new Response(bytes, {\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": contentType,\n\t\t\t\t\"Cache-Control\": \"private, no-store\",\n\t\t\t\t\"X-Content-Type-Options\": \"nosniff\",\n\t\t\t\t\"Content-Disposition\": \"attachment\",\n\t\t\t\t\"Content-Security-Policy\": \"default-src 'none'; sandbox\",\n\t\t\t},\n\t\t});\n\t} catch {\n\t\treturn apiError(\"ARTIFACT_FETCH_FAILED\", \"Failed to fetch artifact\", 502);\n\t} finally {\n\t\tclearTimeout(timer);\n\t}\n};\n\n/**\n * Resolve the declared artifact URL for `(did, slug, version, kind, index)`\n * from the aggregator's release record. Mirrors the install handler's release\n * lookup. Returns `null` when the package/release/artifact isn't found.\n *\n * Self-contained to this route: the install/update handlers are intentionally\n * left untouched, so a small amount of resolution-pattern duplication is\n * accepted here.\n */\nasync function resolveArtifactUrl(\n\tregistryConfig: { aggregatorUrl: string; acceptLabelers?: string },\n\tdid: string,\n\tslug: string,\n\tversion: string | undefined,\n\tkind: string,\n\tindex: number,\n): Promise<string | null> {\n\t// Lazy-load the discovery client so the `@atcute/client` dependency only\n\t// loads when the registry path is exercised.\n\tconst { DiscoveryClient } = await import(\"@emdash-cms/registry-client/discovery\");\n\n\tconst aggregatorDeadline = Date.now() + AGGREGATOR_TOTAL_BUDGET_MS;\n\tconst discovery = new DiscoveryClient({\n\t\taggregatorUrl: registryConfig.aggregatorUrl,\n\t\tacceptLabelers: registryConfig.acceptLabelers,\n\t\tfetch: timedFetch(aggregatorDeadline),\n\t});\n\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- DID shape validated by the route before this call\n\tconst publisherDid = did as Did;\n\n\tconst releaseView = await (async () => {\n\t\tif (!version) {\n\t\t\treturn discovery.getLatestRelease({ did: publisherDid, package: slug });\n\t\t}\n\t\tlet cursor: string | undefined;\n\t\tconst seenCursors = new Set<string>();\n\t\tfor (let page = 0; page < MAX_LIST_PAGES; page++) {\n\t\t\tif (cursor !== undefined) {\n\t\t\t\tif (seenCursors.has(cursor)) break;\n\t\t\t\tseenCursors.add(cursor);\n\t\t\t}\n\t\t\tconst result = await discovery.listReleases({\n\t\t\t\tdid: publisherDid,\n\t\t\t\tpackage: slug,\n\t\t\t\tcursor,\n\t\t\t\tlimit: 50,\n\t\t\t});\n\t\t\tfor (const r of result.releases) {\n\t\t\t\tif (r.version === version) return r;\n\t\t\t}\n\t\t\tif (!result.cursor) break;\n\t\t\tcursor = result.cursor;\n\t\t}\n\t\treturn undefined;\n\t})();\n\n\tif (!releaseView?.release) return null;\n\n\treturn resolveDeclaredUrl(releaseView.release.artifacts, kind, index);\n}\n\n/**\n * Read a response body into memory, aborting once it exceeds `limit`. Returns\n * `null` when the cap is breached (the streamed body lied about / omitted\n * Content-Length). The cap is the real defence against an unbounded body.\n */\nasync function readCapped(response: Response, limit: number): Promise<Uint8Array | null> {\n\tconst body = response.body;\n\tif (!body) {\n\t\tconst buf = new Uint8Array(await response.arrayBuffer());\n\t\treturn buf.length > limit ? null : buf;\n\t}\n\tconst reader = body.getReader();\n\tconst chunks: Uint8Array[] = [];\n\tlet total = 0;\n\twhile (true) {\n\t\tconst { done, value } = await reader.read();\n\t\tif (done) break;\n\t\tif (value) {\n\t\t\ttotal += value.length;\n\t\t\tif (total > limit) {\n\t\t\t\tawait reader.cancel();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tchunks.push(value);\n\t\t}\n\t}\n\tconst combined = new Uint8Array(total);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tcombined.set(chunk, offset);\n\t\toffset += chunk.length;\n\t}\n\treturn combined;\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.mts","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/plugins/registry/install.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"install.d.mts","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/plugins/registry/install.ts"],"mappings":";;;cAyBa,SAAA;AAAA,cAoCA,IAAA,EAAM,QAAA"}
|
|
@@ -1,42 +1,57 @@
|
|
|
1
1
|
import "../../../../../../dialect-helpers-BKCvISIQ.mjs";
|
|
2
|
-
import "../../../../../../content-
|
|
2
|
+
import "../../../../../../content-8voQNTXX.mjs";
|
|
3
3
|
import "../../../../../../base64-CqR-7kqF.mjs";
|
|
4
|
-
import "../../../../../../types-
|
|
5
|
-
import "../../../../../../media-
|
|
6
|
-
import "../../../../../../user-
|
|
7
|
-
import "../../../../../../taxonomy-
|
|
8
|
-
import "../../../../../../comment-
|
|
4
|
+
import "../../../../../../types-B0bmgwMG.mjs";
|
|
5
|
+
import "../../../../../../media-CKQd8AYU.mjs";
|
|
6
|
+
import "../../../../../../user-hUSOaIJy.mjs";
|
|
7
|
+
import "../../../../../../taxonomy-zqGQUqgu.mjs";
|
|
8
|
+
import "../../../../../../comment-C76G-9tz.mjs";
|
|
9
9
|
import "../../../../../../options-BL4X94qY.mjs";
|
|
10
|
-
import "../../../../../../menus-
|
|
11
|
-
import "../../../../../../redirect-
|
|
12
|
-
import "../../../../../../byline-
|
|
13
|
-
import "../../../../../../seo-
|
|
14
|
-
import {
|
|
10
|
+
import "../../../../../../menus-arUNspyU.mjs";
|
|
11
|
+
import "../../../../../../redirect-CjfDGrTd.mjs";
|
|
12
|
+
import "../../../../../../byline-BDylH_m4.mjs";
|
|
13
|
+
import "../../../../../../seo-BGCyDlkb.mjs";
|
|
14
|
+
import { n as handleRegistryInstall } from "../../../../../../api-BNKqxyFX.mjs";
|
|
15
15
|
import "../../../../../../request-cache-dzCt8TZB.mjs";
|
|
16
|
-
import "../../../../../../dashboard-
|
|
17
|
-
import "../../../../../../fts-manager-
|
|
18
|
-
import "../../../../../../registry-
|
|
19
|
-
import "../../../../../../loader-
|
|
20
|
-
import "../../../../../../schema-
|
|
21
|
-
import "../../../../../../zod-generator-
|
|
22
|
-
import "../../../../../../seo-
|
|
23
|
-
import "../../../../../../sections-
|
|
24
|
-
import "../../../../../../settings-
|
|
25
|
-
import "../../../../../../settings-
|
|
26
|
-
import "../../../../../../resolve-
|
|
27
|
-
import "../../../../../../taxonomies-
|
|
28
|
-
import "../../../../../../taxonomies-
|
|
16
|
+
import "../../../../../../dashboard-BeaFSPpx.mjs";
|
|
17
|
+
import "../../../../../../fts-manager-C_b-4x8u.mjs";
|
|
18
|
+
import "../../../../../../registry-Cyp-dx6J.mjs";
|
|
19
|
+
import "../../../../../../loader-D-vIJjfY.mjs";
|
|
20
|
+
import "../../../../../../schema-CI9mYPX3.mjs";
|
|
21
|
+
import "../../../../../../zod-generator-B80aap1J.mjs";
|
|
22
|
+
import "../../../../../../seo-Dq707mNQ.mjs";
|
|
23
|
+
import "../../../../../../sections-DBbCDIAT.mjs";
|
|
24
|
+
import "../../../../../../settings-BSXRtTzk.mjs";
|
|
25
|
+
import "../../../../../../settings-DfwNyQkf.mjs";
|
|
26
|
+
import "../../../../../../resolve-D6sM-SgF.mjs";
|
|
27
|
+
import "../../../../../../taxonomies-CcvrMLbR.mjs";
|
|
28
|
+
import "../../../../../../taxonomies-4vx0nmMr.mjs";
|
|
29
29
|
import "../../../../../../manifest-schema-Czqf0TLu.mjs";
|
|
30
30
|
import "../../../../../../types-1NNkmTIn.mjs";
|
|
31
31
|
import "../../../../../../ssrf-MZ-zrG6-.mjs";
|
|
32
|
-
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../../../error-
|
|
33
|
-
import { n as parseBody, t as isParseError } from "../../../../../../parse-
|
|
32
|
+
import { a as unwrapResult, r as handleError, t as apiError } from "../../../../../../error-ChfADBuu.mjs";
|
|
33
|
+
import { n as parseBody, t as isParseError } from "../../../../../../parse-DHbXfvxO.mjs";
|
|
34
34
|
import "../../../../../../redirects-COMLwsV5.mjs";
|
|
35
35
|
import "../../../../../../setup-Cf_TyOv5.mjs";
|
|
36
|
-
import { n as
|
|
36
|
+
import { n as VERSION } from "../../../../../../version-BTc87L3L.mjs";
|
|
37
|
+
import { n as requirePerm } from "../../../../../../authorize-Bn4S4DUT.mjs";
|
|
37
38
|
import { z } from "zod";
|
|
39
|
+
import { hostEnvFromVersions } from "@emdash-cms/registry-client/env";
|
|
38
40
|
|
|
39
41
|
//#region src/astro/routes/api/admin/plugins/registry/install.ts
|
|
42
|
+
/**
|
|
43
|
+
* Registry plugin install endpoint
|
|
44
|
+
*
|
|
45
|
+
* POST /_emdash/api/admin/plugins/registry/install
|
|
46
|
+
*
|
|
47
|
+
* Installs a plugin from the experimental decentralized plugin registry
|
|
48
|
+
* (see RFC 0001). The browser resolves `(handle, slug) → (did, slug)`
|
|
49
|
+
* via the aggregator before posting and sends the publisher DID
|
|
50
|
+
* directly; the server skips the resolvePackage round-trip and looks
|
|
51
|
+
* up the package by DID. Sending DID rather than handle means installs
|
|
52
|
+
* work for publishers whose handle the aggregator couldn't resolve at
|
|
53
|
+
* view time (handle is best-effort per the lexicon).
|
|
54
|
+
*/
|
|
40
55
|
const prerender = false;
|
|
41
56
|
const installBodySchema = z.object({
|
|
42
57
|
did: z.string().min(1).max(2048).regex(/^did:[a-z]+:/, "Invalid DID"),
|
|
@@ -58,7 +73,10 @@ const POST = async ({ request, locals }) => {
|
|
|
58
73
|
slug: body.slug,
|
|
59
74
|
version: body.version,
|
|
60
75
|
acknowledgedDeclaredAccess: body.acknowledgedDeclaredAccess
|
|
61
|
-
}, {
|
|
76
|
+
}, {
|
|
77
|
+
configuredPluginIds: reservedPluginIds,
|
|
78
|
+
hostEnv: hostEnvFromVersions(VERSION, emdash.config.astroVersion)
|
|
79
|
+
});
|
|
62
80
|
if (!result.success) return unwrapResult(result);
|
|
63
81
|
await emdash.syncRegistryPlugins();
|
|
64
82
|
return unwrapResult(result, 201);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/plugins/registry/install.ts"],"sourcesContent":["/**\n * Registry plugin install endpoint\n *\n * POST /_emdash/api/admin/plugins/registry/install\n *\n * Installs a plugin from the experimental decentralized plugin registry\n * (see RFC 0001). The browser resolves `(handle, slug) → (did, slug)`\n * via the aggregator before posting and sends the publisher DID\n * directly; the server skips the resolvePackage round-trip and looks\n * up the package by DID. Sending DID rather than handle means installs\n * work for publishers whose handle the aggregator couldn't resolve at\n * view time (handle is best-effort per the lexicon).\n */\n\nimport type { APIRoute } from \"astro\";\nimport { z } from \"zod\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, handleError, unwrapResult } from \"#api/error.js\";\nimport { handleRegistryInstall } from \"#api/index.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\n\nexport const prerender = false;\n\nconst installBodySchema = z.object({\n\t/**\n\t * Publisher DID. Required. Browser is expected to resolve\n\t * `(handle, slug) → did` against the aggregator before posting.\n\t */\n\tdid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(2048)\n\t\t// Loose match -- atproto DID specs allow `did:plc:*` and\n\t\t// `did:web:*` plus future methods. Reject anything that\n\t\t// doesn't even start with `did:` rather than enumerating\n\t\t// methods here; downstream lexicon validation tightens.\n\t\t.regex(/^did:[a-z]+:/, \"Invalid DID\"),\n\t/** Package slug. */\n\tslug: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(64)\n\t\t// Mirrors the lexicon's slug grammar: ASCII letter followed by\n\t\t// letters / digits / `-` / `_`. Rejects anything that could\n\t\t// confuse the R2 prefix or the URL.\n\t\t.regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/, \"Invalid slug\"),\n\t/** Optional explicit version. Defaults to the aggregator's latest. */\n\tversion: z.string().min(1).max(64).optional(),\n\t/**\n\t * Capabilities the admin acknowledged in the consent dialog, lifted\n\t * from the release record's declaredAccess block at browse time.\n\t * Compared against the bundle's manifest to detect drift between the\n\t * dialog and the install POST.\n\t */\n\tacknowledgedDeclaredAccess: z.unknown().optional(),\n});\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\ttry {\n\t\tconst { emdash, user } = locals;\n\n\t\tif (!emdash?.db) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t\t}\n\n\t\tconst denied = requirePerm(user, \"plugins:manage\");\n\t\tif (denied) return denied;\n\n\t\tconst body = await parseBody(request, installBodySchema);\n\t\tif (isParseError(body)) return body;\n\n\t\t// Block registry installs whose derived `pluginId` collides with\n\t\t// any build-time-reserved id: configured (in-process) plugins, and\n\t\t// sandboxed plugins declared in `config.sandboxed`. The runtime\n\t\t// caches sandboxed plugins by id; a registry install at the same\n\t\t// id would silently shadow or coexist with the build-time entry.\n\t\tconst reservedPluginIds = new Set<string>([\n\t\t\t...emdash.configuredPlugins.map((p: { id: string }) => p.id),\n\t\t\t...(emdash.config.sandboxed ?? []).map((p: { id: string }) => p.id),\n\t\t]);\n\n\t\tconst result = await handleRegistryInstall(\n\t\t\temdash.db,\n\t\t\temdash.storage,\n\t\t\temdash.getSandboxRunner(),\n\t\t\temdash.config.experimental?.registry,\n\t\t\t{\n\t\t\t\tdid: body.did,\n\t\t\t\tslug: body.slug,\n\t\t\t\tversion: body.version,\n\t\t\t\tacknowledgedDeclaredAccess: body.acknowledgedDeclaredAccess,\n\t\t\t},\n\t\t\t{
|
|
1
|
+
{"version":3,"file":"install.mjs","names":[],"sources":["../../../../../../../src/astro/routes/api/admin/plugins/registry/install.ts"],"sourcesContent":["/**\n * Registry plugin install endpoint\n *\n * POST /_emdash/api/admin/plugins/registry/install\n *\n * Installs a plugin from the experimental decentralized plugin registry\n * (see RFC 0001). The browser resolves `(handle, slug) → (did, slug)`\n * via the aggregator before posting and sends the publisher DID\n * directly; the server skips the resolvePackage round-trip and looks\n * up the package by DID. Sending DID rather than handle means installs\n * work for publishers whose handle the aggregator couldn't resolve at\n * view time (handle is best-effort per the lexicon).\n */\n\nimport { hostEnvFromVersions } from \"@emdash-cms/registry-client/env\";\nimport type { APIRoute } from \"astro\";\nimport { z } from \"zod\";\n\nimport { requirePerm } from \"#api/authorize.js\";\nimport { apiError, handleError, unwrapResult } from \"#api/error.js\";\nimport { handleRegistryInstall } from \"#api/index.js\";\nimport { isParseError, parseBody } from \"#api/parse.js\";\n\nimport { VERSION } from \"../../../../../../version.js\";\n\nexport const prerender = false;\n\nconst installBodySchema = z.object({\n\t/**\n\t * Publisher DID. Required. Browser is expected to resolve\n\t * `(handle, slug) → did` against the aggregator before posting.\n\t */\n\tdid: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(2048)\n\t\t// Loose match -- atproto DID specs allow `did:plc:*` and\n\t\t// `did:web:*` plus future methods. Reject anything that\n\t\t// doesn't even start with `did:` rather than enumerating\n\t\t// methods here; downstream lexicon validation tightens.\n\t\t.regex(/^did:[a-z]+:/, \"Invalid DID\"),\n\t/** Package slug. */\n\tslug: z\n\t\t.string()\n\t\t.min(1)\n\t\t.max(64)\n\t\t// Mirrors the lexicon's slug grammar: ASCII letter followed by\n\t\t// letters / digits / `-` / `_`. Rejects anything that could\n\t\t// confuse the R2 prefix or the URL.\n\t\t.regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/, \"Invalid slug\"),\n\t/** Optional explicit version. Defaults to the aggregator's latest. */\n\tversion: z.string().min(1).max(64).optional(),\n\t/**\n\t * Capabilities the admin acknowledged in the consent dialog, lifted\n\t * from the release record's declaredAccess block at browse time.\n\t * Compared against the bundle's manifest to detect drift between the\n\t * dialog and the install POST.\n\t */\n\tacknowledgedDeclaredAccess: z.unknown().optional(),\n});\n\nexport const POST: APIRoute = async ({ request, locals }) => {\n\ttry {\n\t\tconst { emdash, user } = locals;\n\n\t\tif (!emdash?.db) {\n\t\t\treturn apiError(\"NOT_CONFIGURED\", \"EmDash is not initialized\", 500);\n\t\t}\n\n\t\tconst denied = requirePerm(user, \"plugins:manage\");\n\t\tif (denied) return denied;\n\n\t\tconst body = await parseBody(request, installBodySchema);\n\t\tif (isParseError(body)) return body;\n\n\t\t// Block registry installs whose derived `pluginId` collides with\n\t\t// any build-time-reserved id: configured (in-process) plugins, and\n\t\t// sandboxed plugins declared in `config.sandboxed`. The runtime\n\t\t// caches sandboxed plugins by id; a registry install at the same\n\t\t// id would silently shadow or coexist with the build-time entry.\n\t\tconst reservedPluginIds = new Set<string>([\n\t\t\t...emdash.configuredPlugins.map((p: { id: string }) => p.id),\n\t\t\t...(emdash.config.sandboxed ?? []).map((p: { id: string }) => p.id),\n\t\t]);\n\n\t\tconst result = await handleRegistryInstall(\n\t\t\temdash.db,\n\t\t\temdash.storage,\n\t\t\temdash.getSandboxRunner(),\n\t\t\temdash.config.experimental?.registry,\n\t\t\t{\n\t\t\t\tdid: body.did,\n\t\t\t\tslug: body.slug,\n\t\t\t\tversion: body.version,\n\t\t\t\tacknowledgedDeclaredAccess: body.acknowledgedDeclaredAccess,\n\t\t\t},\n\t\t\t{\n\t\t\t\tconfiguredPluginIds: reservedPluginIds,\n\t\t\t\thostEnv: hostEnvFromVersions(VERSION, emdash.config.astroVersion),\n\t\t\t},\n\t\t);\n\n\t\tif (!result.success) return unwrapResult(result);\n\n\t\t// Sync runtime so the new plugin becomes active without a worker restart.\n\t\tawait emdash.syncRegistryPlugins();\n\n\t\treturn unwrapResult(result, 201);\n\t} catch (error) {\n\t\tconsole.error(\"[registry-install] Unhandled error:\", error);\n\t\treturn handleError(error, \"Failed to install plugin from registry\", \"INSTALL_FAILED\");\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,YAAY;AAEzB,MAAM,oBAAoB,EAAE,OAAO;CAKlC,KAAK,EACH,QAAQ,CACR,IAAI,EAAE,CACN,IAAI,KAAK,CAKT,MAAM,gBAAgB,cAAc;CAEtC,MAAM,EACJ,QAAQ,CACR,IAAI,EAAE,CACN,IAAI,GAAG,CAIP,MAAM,4BAA4B,eAAe;CAEnD,SAAS,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU;CAO7C,4BAA4B,EAAE,SAAS,CAAC,UAAU;CAClD,CAAC;AAEF,MAAa,OAAiB,OAAO,EAAE,SAAS,aAAa;AAC5D,KAAI;EACH,MAAM,EAAE,QAAQ,SAAS;AAEzB,MAAI,CAAC,QAAQ,GACZ,QAAO,SAAS,kBAAkB,6BAA6B,IAAI;EAGpE,MAAM,SAAS,YAAY,MAAM,iBAAiB;AAClD,MAAI,OAAQ,QAAO;EAEnB,MAAM,OAAO,MAAM,UAAU,SAAS,kBAAkB;AACxD,MAAI,aAAa,KAAK,CAAE,QAAO;EAO/B,MAAM,oBAAoB,IAAI,IAAY,CACzC,GAAG,OAAO,kBAAkB,KAAK,MAAsB,EAAE,GAAG,EAC5D,IAAI,OAAO,OAAO,aAAa,EAAE,EAAE,KAAK,MAAsB,EAAE,GAAG,CACnE,CAAC;EAEF,MAAM,SAAS,MAAM,sBACpB,OAAO,IACP,OAAO,SACP,OAAO,kBAAkB,EACzB,OAAO,OAAO,cAAc,UAC5B;GACC,KAAK,KAAK;GACV,MAAM,KAAK;GACX,SAAS,KAAK;GACd,4BAA4B,KAAK;GACjC,EACD;GACC,qBAAqB;GACrB,SAAS,oBAAoB,SAAS,OAAO,OAAO,aAAa;GACjE,CACD;AAED,MAAI,CAAC,OAAO,QAAS,QAAO,aAAa,OAAO;AAGhD,QAAM,OAAO,qBAAqB;AAElC,SAAO,aAAa,QAAQ,IAAI;UACxB,OAAO;AACf,UAAQ,MAAM,uCAAuC,MAAM;AAC3D,SAAO,YAAY,OAAO,0CAA0C,iBAAiB"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import "../../../../../dialect-helpers-BKCvISIQ.mjs";
|
|
2
|
-
import "../../../../../content-
|
|
2
|
+
import "../../../../../content-8voQNTXX.mjs";
|
|
3
3
|
import "../../../../../base64-CqR-7kqF.mjs";
|
|
4
|
-
import "../../../../../types-
|
|
5
|
-
import "../../../../../media-
|
|
6
|
-
import "../../../../../user-
|
|
7
|
-
import "../../../../../taxonomy-
|
|
8
|
-
import "../../../../../comment-
|
|
4
|
+
import "../../../../../types-B0bmgwMG.mjs";
|
|
5
|
+
import "../../../../../media-CKQd8AYU.mjs";
|
|
6
|
+
import "../../../../../user-hUSOaIJy.mjs";
|
|
7
|
+
import "../../../../../taxonomy-zqGQUqgu.mjs";
|
|
8
|
+
import "../../../../../comment-C76G-9tz.mjs";
|
|
9
9
|
import "../../../../../options-BL4X94qY.mjs";
|
|
10
|
-
import "../../../../../menus-
|
|
11
|
-
import "../../../../../redirect-
|
|
12
|
-
import "../../../../../byline-
|
|
13
|
-
import "../../../../../seo-
|
|
14
|
-
import {
|
|
10
|
+
import "../../../../../menus-arUNspyU.mjs";
|
|
11
|
+
import "../../../../../redirect-CjfDGrTd.mjs";
|
|
12
|
+
import "../../../../../byline-BDylH_m4.mjs";
|
|
13
|
+
import "../../../../../seo-BGCyDlkb.mjs";
|
|
14
|
+
import { a as handleRegistryUpdateCheck, m as handleMarketplaceUpdateCheck } from "../../../../../api-BNKqxyFX.mjs";
|
|
15
15
|
import "../../../../../request-cache-dzCt8TZB.mjs";
|
|
16
|
-
import "../../../../../dashboard-
|
|
17
|
-
import "../../../../../fts-manager-
|
|
18
|
-
import "../../../../../registry-
|
|
19
|
-
import "../../../../../loader-
|
|
20
|
-
import "../../../../../schema-
|
|
21
|
-
import "../../../../../zod-generator-
|
|
22
|
-
import "../../../../../seo-
|
|
23
|
-
import "../../../../../sections-
|
|
24
|
-
import "../../../../../settings-
|
|
25
|
-
import "../../../../../settings-
|
|
26
|
-
import "../../../../../resolve-
|
|
27
|
-
import "../../../../../taxonomies-
|
|
28
|
-
import "../../../../../taxonomies-
|
|
16
|
+
import "../../../../../dashboard-BeaFSPpx.mjs";
|
|
17
|
+
import "../../../../../fts-manager-C_b-4x8u.mjs";
|
|
18
|
+
import "../../../../../registry-Cyp-dx6J.mjs";
|
|
19
|
+
import "../../../../../loader-D-vIJjfY.mjs";
|
|
20
|
+
import "../../../../../schema-CI9mYPX3.mjs";
|
|
21
|
+
import "../../../../../zod-generator-B80aap1J.mjs";
|
|
22
|
+
import "../../../../../seo-Dq707mNQ.mjs";
|
|
23
|
+
import "../../../../../sections-DBbCDIAT.mjs";
|
|
24
|
+
import "../../../../../settings-BSXRtTzk.mjs";
|
|
25
|
+
import "../../../../../settings-DfwNyQkf.mjs";
|
|
26
|
+
import "../../../../../resolve-D6sM-SgF.mjs";
|
|
27
|
+
import "../../../../../taxonomies-CcvrMLbR.mjs";
|
|
28
|
+
import "../../../../../taxonomies-4vx0nmMr.mjs";
|
|
29
29
|
import "../../../../../manifest-schema-Czqf0TLu.mjs";
|
|
30
30
|
import "../../../../../types-1NNkmTIn.mjs";
|
|
31
31
|
import "../../../../../ssrf-MZ-zrG6-.mjs";
|
|
32
|
-
import { t as apiError } from "../../../../../error-
|
|
33
|
-
import "../../../../../parse-
|
|
32
|
+
import { t as apiError } from "../../../../../error-ChfADBuu.mjs";
|
|
33
|
+
import "../../../../../parse-DHbXfvxO.mjs";
|
|
34
34
|
import "../../../../../redirects-COMLwsV5.mjs";
|
|
35
35
|
import "../../../../../setup-Cf_TyOv5.mjs";
|
|
36
|
-
import { n as requirePerm } from "../../../../../authorize-
|
|
36
|
+
import { n as requirePerm } from "../../../../../authorize-Bn4S4DUT.mjs";
|
|
37
37
|
|
|
38
38
|
//#region src/astro/routes/api/admin/plugins/updates.ts
|
|
39
39
|
const prerender = false;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import "../../../../../../../dialect-helpers-BKCvISIQ.mjs";
|
|
2
|
-
import "../../../../../../../content-
|
|
2
|
+
import "../../../../../../../content-8voQNTXX.mjs";
|
|
3
3
|
import "../../../../../../../base64-CqR-7kqF.mjs";
|
|
4
|
-
import "../../../../../../../types-
|
|
5
|
-
import "../../../../../../../media-
|
|
6
|
-
import "../../../../../../../user-
|
|
7
|
-
import "../../../../../../../taxonomy-
|
|
8
|
-
import "../../../../../../../comment-
|
|
4
|
+
import "../../../../../../../types-B0bmgwMG.mjs";
|
|
5
|
+
import "../../../../../../../media-CKQd8AYU.mjs";
|
|
6
|
+
import "../../../../../../../user-hUSOaIJy.mjs";
|
|
7
|
+
import "../../../../../../../taxonomy-zqGQUqgu.mjs";
|
|
8
|
+
import "../../../../../../../comment-C76G-9tz.mjs";
|
|
9
9
|
import "../../../../../../../options-BL4X94qY.mjs";
|
|
10
|
-
import "../../../../../../../menus-
|
|
11
|
-
import "../../../../../../../redirect-
|
|
12
|
-
import "../../../../../../../byline-
|
|
13
|
-
import "../../../../../../../seo-
|
|
14
|
-
import {
|
|
10
|
+
import "../../../../../../../menus-arUNspyU.mjs";
|
|
11
|
+
import "../../../../../../../redirect-CjfDGrTd.mjs";
|
|
12
|
+
import "../../../../../../../byline-BDylH_m4.mjs";
|
|
13
|
+
import "../../../../../../../seo-BGCyDlkb.mjs";
|
|
14
|
+
import { h as handleThemeGetDetail } from "../../../../../../../api-BNKqxyFX.mjs";
|
|
15
15
|
import "../../../../../../../request-cache-dzCt8TZB.mjs";
|
|
16
|
-
import "../../../../../../../dashboard-
|
|
17
|
-
import "../../../../../../../fts-manager-
|
|
18
|
-
import "../../../../../../../registry-
|
|
19
|
-
import "../../../../../../../loader-
|
|
20
|
-
import "../../../../../../../schema-
|
|
21
|
-
import "../../../../../../../zod-generator-
|
|
22
|
-
import "../../../../../../../seo-
|
|
23
|
-
import "../../../../../../../sections-
|
|
24
|
-
import "../../../../../../../settings-
|
|
25
|
-
import "../../../../../../../settings-
|
|
26
|
-
import "../../../../../../../resolve-
|
|
27
|
-
import "../../../../../../../taxonomies-
|
|
28
|
-
import "../../../../../../../taxonomies-
|
|
16
|
+
import "../../../../../../../dashboard-BeaFSPpx.mjs";
|
|
17
|
+
import "../../../../../../../fts-manager-C_b-4x8u.mjs";
|
|
18
|
+
import "../../../../../../../registry-Cyp-dx6J.mjs";
|
|
19
|
+
import "../../../../../../../loader-D-vIJjfY.mjs";
|
|
20
|
+
import "../../../../../../../schema-CI9mYPX3.mjs";
|
|
21
|
+
import "../../../../../../../zod-generator-B80aap1J.mjs";
|
|
22
|
+
import "../../../../../../../seo-Dq707mNQ.mjs";
|
|
23
|
+
import "../../../../../../../sections-DBbCDIAT.mjs";
|
|
24
|
+
import "../../../../../../../settings-BSXRtTzk.mjs";
|
|
25
|
+
import "../../../../../../../settings-DfwNyQkf.mjs";
|
|
26
|
+
import "../../../../../../../resolve-D6sM-SgF.mjs";
|
|
27
|
+
import "../../../../../../../taxonomies-CcvrMLbR.mjs";
|
|
28
|
+
import "../../../../../../../taxonomies-4vx0nmMr.mjs";
|
|
29
29
|
import "../../../../../../../manifest-schema-Czqf0TLu.mjs";
|
|
30
30
|
import "../../../../../../../types-1NNkmTIn.mjs";
|
|
31
31
|
import "../../../../../../../ssrf-MZ-zrG6-.mjs";
|
|
32
|
-
import { a as unwrapResult, t as apiError } from "../../../../../../../error-
|
|
33
|
-
import "../../../../../../../parse-
|
|
32
|
+
import { a as unwrapResult, t as apiError } from "../../../../../../../error-ChfADBuu.mjs";
|
|
33
|
+
import "../../../../../../../parse-DHbXfvxO.mjs";
|
|
34
34
|
import "../../../../../../../redirects-COMLwsV5.mjs";
|
|
35
35
|
import "../../../../../../../setup-Cf_TyOv5.mjs";
|
|
36
|
-
import { n as requirePerm } from "../../../../../../../authorize-
|
|
36
|
+
import { n as requirePerm } from "../../../../../../../authorize-Bn4S4DUT.mjs";
|
|
37
37
|
|
|
38
38
|
//#region src/astro/routes/api/admin/themes/marketplace/[id]/index.ts
|
|
39
39
|
const prerender = false;
|