dineway 0.1.48 → 0.2.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/{activity-events-C9u37D5z.mjs → activity-events-y6eT8UW6.mjs} +6 -38
- package/dist/actor-CrObAPV0.mjs +37 -0
- package/dist/after-BfniwgIf.mjs +9 -0
- package/dist/{allowed-origins-DhipQNLb.mjs → allowed-origins-_oeyP6x-.mjs} +1 -1
- package/dist/api/route-utils.d.mts +10 -10
- package/dist/api/route-utils.mjs +17 -14
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -4
- package/dist/{api-Eiy8_zVZ.mjs → api-ByrU2q-Z.mjs} +61 -37
- package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-CjVMQT-X.mjs} +6 -2
- package/dist/{apply-CX3no7XE.mjs → apply-bZswmZPm.mjs} +117 -77
- package/dist/astro/image-endpoint.d.mts +7 -0
- package/dist/astro/image-endpoint.mjs +54 -0
- package/dist/astro/index.d.mts +35 -11
- package/dist/astro/index.mjs +157 -23
- package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
- package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
- package/dist/astro/middleware/auth.d.mts +10 -10
- package/dist/astro/middleware/auth.mjs +42 -24
- package/dist/astro/middleware/redirect.mjs +14 -5
- package/dist/astro/middleware/request-context.mjs +9 -6
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +2 -2
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +334 -193
- package/dist/astro/routes/admin.astro +6 -1
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +22 -18
- package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
- package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +18 -15
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +18 -15
- package/dist/astro/routes/api/admin/bylines/index.mjs +18 -15
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +15 -13
- package/dist/astro/routes/api/admin/comments/_id_.mjs +7 -6
- package/dist/astro/routes/api/admin/comments/bulk.mjs +12 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +7 -6
- package/dist/astro/routes/api/admin/comments/index.mjs +12 -10
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +27 -25
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +27 -25
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +32 -29
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +32 -29
- package/dist/astro/routes/api/admin/context/diff.mjs +31 -28
- package/dist/astro/routes/api/admin/context/index.mjs +32 -29
- package/dist/astro/routes/api/admin/context/stale.mjs +31 -28
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +27 -25
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +31 -28
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +31 -28
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +28 -26
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
- package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
- package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
- package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -52
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -52
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +48 -44
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -50
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -49
- package/dist/astro/routes/api/admin/plugins/index.mjs +48 -44
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -49
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -43
- package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -43
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +6 -6
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +32 -28
- package/dist/astro/routes/api/admin/review-requests/index.mjs +11 -10
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -43
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -43
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
- package/dist/astro/routes/api/admin/users/index.mjs +7 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
- package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
- package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
- package/dist/astro/routes/api/auth/me.mjs +10 -9
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
- package/dist/astro/routes/api/auth/setup-token/index.mjs +6 -6
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
- package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
- package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +16 -14
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +12 -11
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +17 -15
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -6
- package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/index.mjs +11 -10
- package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
- package/dist/astro/routes/api/dashboard.mjs +10 -9
- package/dist/astro/routes/api/dev/emails.mjs +2 -2
- package/dist/astro/routes/api/health.mjs +1 -1
- package/dist/astro/routes/api/import/probe.d.mts +3 -3
- package/dist/astro/routes/api/import/probe.mjs +23 -11
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +19 -1
- package/dist/astro/routes/api/import/wordpress/execute.mjs +85 -38
- package/dist/astro/routes/api/import/wordpress/media.d.mts +13 -1
- package/dist/astro/routes/api/import/wordpress/media.mjs +20 -14
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +36 -33
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +18 -1
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +121 -101
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +25 -13
- package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +56 -2
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +284 -56
- package/dist/astro/routes/api/manifest.mjs +14 -5
- package/dist/astro/routes/api/mcp.mjs +266 -70
- package/dist/astro/routes/api/media/_id_/confirm.mjs +39 -11
- package/dist/astro/routes/api/media/_id_.mjs +11 -7
- package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
- package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
- package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
- package/dist/astro/routes/api/media/providers/index.mjs +2 -2
- package/dist/astro/routes/api/media/upload-url.mjs +12 -11
- package/dist/astro/routes/api/media.mjs +28 -35
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +32 -29
- package/dist/astro/routes/api/menus/_name_/items.mjs +32 -29
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +32 -29
- package/dist/astro/routes/api/menus/_name_/translations.mjs +32 -29
- package/dist/astro/routes/api/menus/_name_.mjs +32 -29
- package/dist/astro/routes/api/menus/index.mjs +32 -29
- package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
- package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
- package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
- package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
- package/dist/astro/routes/api/oauth/register.mjs +4 -4
- package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
- package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
- package/dist/astro/routes/api/oauth/token.mjs +6 -6
- package/dist/astro/routes/api/openapi.json.mjs +4 -3
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +30 -30
- package/dist/astro/routes/api/redirects/404s/index.mjs +12 -11
- package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -11
- package/dist/astro/routes/api/redirects/_id_.mjs +33 -30
- package/dist/astro/routes/api/redirects/index.mjs +33 -30
- package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
- package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
- package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +48 -44
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +48 -44
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +48 -44
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +48 -44
- package/dist/astro/routes/api/schema/collections/index.mjs +48 -44
- package/dist/astro/routes/api/schema/index.mjs +13 -14
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -43
- package/dist/astro/routes/api/schema/orphans/index.mjs +47 -43
- package/dist/astro/routes/api/search/enable.mjs +12 -11
- package/dist/astro/routes/api/search/index.mjs +11 -10
- package/dist/astro/routes/api/search/rebuild.mjs +12 -11
- package/dist/astro/routes/api/search/stats.mjs +7 -7
- package/dist/astro/routes/api/search/suggest.mjs +11 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +32 -29
- package/dist/astro/routes/api/sections/index.mjs +32 -29
- package/dist/astro/routes/api/settings/email.mjs +4 -4
- package/dist/astro/routes/api/settings.mjs +32 -29
- package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
- package/dist/astro/routes/api/setup/admin.mjs +12 -11
- package/dist/astro/routes/api/setup/dev-bypass.mjs +32 -26
- package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
- package/dist/astro/routes/api/setup/index.mjs +30 -26
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +9 -8
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +35 -32
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +35 -32
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +35 -32
- package/dist/astro/routes/api/taxonomies/index.mjs +35 -32
- package/dist/astro/routes/api/themes/preview.mjs +6 -6
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
- package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
- package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +31 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +32 -29
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +32 -29
- package/dist/astro/routes/api/widget-areas/_name_.mjs +29 -27
- package/dist/astro/routes/api/widget-areas/index.mjs +32 -29
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +9 -8
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +24 -15
- package/dist/astro/routes/sitemap.xml.mjs +10 -9
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +3 -3
- package/dist/astro/types.d.mts +21 -13
- package/dist/{audit-D1cbG7xH.mjs → audit-ByVKIwWF.mjs} +1 -1
- package/dist/auth/providers/github.d.mts +1 -1
- package/dist/auth/providers/google.d.mts +1 -1
- package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-CqeUmQsv.mjs} +1 -1
- package/dist/{authorize-BLO0m7fW.mjs → authorize-CcBxcHtz.mjs} +1 -1
- package/dist/{briefing-CObXGOGz.mjs → briefing-BJaJI8dm.mjs} +2 -1
- package/dist/{briefing-gKWiGLt1.mjs → briefing-CawZ59CY.mjs} +90 -28
- package/dist/bundle-7C_DpkEq.mjs +602 -0
- package/dist/{byline-1ntDwv8c.mjs → byline-e51-fWRs.mjs} +30 -62
- package/dist/{byline-fields-BX7rWKNU.d.mts → byline-fields-CUvbslGc.d.mts} +49 -6
- package/dist/{byline-fields-C9_iaPaM.mjs → byline-fields-D-N5qVIG.mjs} +1 -1
- package/dist/{byline-fields-B-ZkoVft.mjs → byline-fields-DOJO16Gm.mjs} +3 -3
- package/dist/{byline-registry-CUSvkasJ.mjs → byline-registry-87nNnYl4.mjs} +2 -2
- package/dist/{bylines-bC15ZqAv.mjs → bylines-CMQNCNFh.mjs} +9 -3
- package/dist/{bylines-DtxChhN_.mjs → bylines-y4LO-dTj.mjs} +5 -5
- package/dist/{cache-DbKyr60Q.mjs → cache-C-FNTFYK.mjs} +2 -2
- package/dist/{chunks-C5zp2xir.mjs → chunks-CxBt-GxR.mjs} +1 -1
- package/dist/cli/index.mjs +820 -1276
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +2 -1
- package/dist/{comment-CXDOQ93N.mjs → comment-DlA4iChg.mjs} +13 -3
- package/dist/comment-reaction-DfFao1ST.mjs +58 -0
- package/dist/{comments-hK-rdzJ9.mjs → comments-DApFGMsP.mjs} +1 -1
- package/dist/{content-QaryevFO.mjs → content-Bh4BDjv8.mjs} +51 -34
- package/dist/content-refresh-CgutSUfO.mjs +1576 -0
- package/dist/{context-CoYb_fvK.mjs → context-C5W3G18y.mjs} +111 -50
- package/dist/{context-DBL1ib4v.mjs → context-CK4ym2Sf.mjs} +2 -2
- package/dist/{context-route-helpers-CYQVmbIm.mjs → context-route-helpers-MASyGgWf.mjs} +2 -1
- package/dist/{cron-DxCAU_Sn.mjs → cron-cKcNTix_.mjs} +7 -3
- package/dist/{dashboard-DNlqsknJ.mjs → dashboard-DQkVT7Ei.mjs} +4 -4
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.mjs +1 -1
- package/dist/db/libsql.d.mts +1 -1
- package/dist/db/postgres.d.mts +1 -1
- package/dist/db/sqlite.d.mts +1 -1
- package/dist/{device-flow-DygsFPGL.mjs → device-flow-BnqRH-T9.mjs} +5 -5
- package/dist/{placeholder-BDo81Is5.mjs → enrich-DIFIFA8O.mjs} +36 -9
- package/dist/{error-DCSuUAZW.mjs → error-CytFlgcd.mjs} +5 -0
- package/dist/field-defs-cache-DRNdhBJv.mjs +49 -0
- package/dist/{fts-manager-CIZlScg5.mjs → fts-manager-Crzypjqu.mjs} +1 -1
- package/dist/hitl-Hw1RmWOq.mjs +677 -0
- package/dist/{hitl-requests-CGQwOEiq.mjs → hitl-requests-B4Vbcmaq.mjs} +2 -2
- package/dist/{hitl-route-helpers-GSDLNPpN.mjs → hitl-route-helpers-hEVzvP8l.mjs} +5 -4
- package/dist/import-Bh9biJfx.mjs +1354 -0
- package/dist/{index-CwRuZ-u8.d.mts → index-D4y6NGiy.d.mts} +75 -3
- package/dist/index.d.mts +17 -16
- package/dist/index.mjs +81 -69
- package/dist/{jsonld-DZ67souc.d.mts → jsonld-Dq0gsnOH.d.mts} +8 -4
- package/dist/{load-xE01Jm0V.mjs → load-DmYeniXl.mjs} +1 -1
- package/dist/{loader-tg63WSY2.mjs → loader-CjWqjweO.mjs} +117 -31
- package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-BxVPYMJR.mjs} +34 -1
- package/dist/mcp-reviewed-executor-TwVbMzG6.mjs +555 -0
- package/dist/media/image-endpoint.d.mts +32 -0
- package/dist/media/image-endpoint.mjs +111 -0
- package/dist/media/index.d.mts +27 -2
- package/dist/media/index.mjs +5 -3
- package/dist/media/local-runtime.d.mts +16 -11
- package/dist/media/local-runtime.mjs +10 -8
- package/dist/{media-DUAjMfvR.mjs → media-DMj0grzC.mjs} +3 -1
- package/dist/{media-allowlist-BsXkT9RK.mjs → media-allowlist-BlVCSzHx.mjs} +1 -1
- package/dist/media-url-lEKSrpr9.mjs +20 -0
- package/dist/{menus-WpFRMXjz.mjs → menus-TaW1gKnk.mjs} +19 -5
- package/dist/{menus-DU1eZqw_.mjs → menus-xvsnVZXw.mjs} +80 -15
- package/dist/{normalize-DUnoXAa9.mjs → normalize-5ek_z7de.mjs} +8 -1
- package/dist/{oauth-authorization-D-1p52Je.mjs → oauth-authorization-DiaGvRVz.mjs} +5 -5
- package/dist/{oauth-clients-CzeMGyUU.mjs → oauth-clients-Dl9E8dEM.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +14 -0
- package/dist/object-cache/memory.mjs +55 -0
- package/dist/object-cache-D51qOseS.mjs +419 -0
- package/dist/page/index.d.mts +4 -3
- package/dist/page/index.mjs +2 -2
- package/dist/{parse-CneSgl7-.mjs → parse-CbymENaR.mjs} +1 -1
- package/dist/{parser-DxfsARXL.mjs → parser-C1nYd-81.mjs} +151 -9
- package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-uvNRZBX9.d.mts} +12 -4
- package/dist/plugin-utils.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +9 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +11 -2
- package/dist/{plugins-C57YQi4l.mjs → plugins-BolVa-tl.mjs} +832 -64
- package/dist/{transport-LSdZVXHF.mjs → portable-text-dA_UlJwW.mjs} +1 -134
- package/dist/{preview-D5rvDhRt.mjs → preview-vSVg6fwG.mjs} +4 -3
- package/dist/process-cache-7xgAO9JY.mjs +106 -0
- package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-MD8zAbnH.d.mts} +1 -1
- package/dist/{public-url-DLUM5OOv.mjs → public-url-BEz_sM9n.mjs} +24 -18
- package/dist/{public-url-B5HaoGzj.d.mts → public-url-gsp3oUbu.d.mts} +5 -4
- package/dist/{query-BYc3oruA.mjs → query-CfRCdaL3.mjs} +281 -76
- package/dist/{query-DKEwzobh.mjs → query-jaAmw8E1.mjs} +11 -6
- package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-ZLdyWoZF.mjs} +2 -2
- package/dist/{redirect-C2zXRj3c.mjs → redirect-BAjt4Z6b.mjs} +2 -2
- package/dist/{redirects-YZo_znWG.mjs → redirects-BTdwpQtE.mjs} +47 -24
- package/dist/{redirects-ocRJmQHP.mjs → redirects-CA-xylPG.mjs} +19 -11
- package/dist/{registry-CTkbIDB9.mjs → registry-CtyVedcN.mjs} +130 -77
- package/dist/request-context.d.mts +2 -0
- package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CUypToDJ.mjs} +1 -1
- package/dist/{review-requests-C0un5kdV.mjs → review-requests-C9Ff11Vq.mjs} +1 -1
- package/dist/{review-requests-gGMyYYhy.mjs → review-requests-DUyEmtmG.mjs} +1 -1
- package/dist/{runner-D4FL9usy.d.mts → runner-1tC2tIRV.d.mts} +1 -1
- package/dist/runner-DB7CRfOF.mjs +6740 -0
- package/dist/{runtime-DEWQpZ-4.d.mts → runtime-BOeiQsCv.d.mts} +2028 -1564
- package/dist/runtime.d.mts +10 -10
- package/dist/runtime.mjs +4 -4
- package/dist/schema-DXdYj4R3.mjs +8 -0
- package/dist/{search-axGQ1KY3.mjs → search-DSaLgEFI.mjs} +5 -3
- package/dist/{secrets-062Izo8i.mjs → secrets-CDZo2k8L.mjs} +15 -12
- package/dist/{sections-OLKgXL10.mjs → sections-PVVXHGfp.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +22 -19
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +3 -12
- package/dist/{seo-Cd45Po8L.mjs → seo-CQG3GCHQ.mjs} +5 -2
- package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-C1EnikHB.mjs} +11 -3
- package/dist/{seo-5lJOtB5J.mjs → seo-qa7Dn0jK.mjs} +22 -4
- package/dist/{service-Bwad8s5h.mjs → service-DiN4ZuPp.mjs} +2 -2
- package/dist/session-user-CAKImna3.mjs +22 -0
- package/dist/{settings-yLjz_I4T.mjs → settings-BbqgHWpU.mjs} +28 -55
- package/dist/{settings-lAHjaUit.mjs → settings-i4VPP8bT.mjs} +2 -2
- package/dist/{setup-complete--PradA4R.mjs → setup-complete-B8fl-mjV.mjs} +1 -1
- package/dist/{site-activity-D7Xyropw.mjs → site-activity-Dy3FROs0.mjs} +1 -1
- package/dist/{site-context-DaN9Z91j.mjs → site-context-DQiL8Fl5.mjs} +23 -652
- package/dist/{site-url-DpGZo9Z6.mjs → site-url-BML3GQYm.mjs} +1 -1
- package/dist/status-DANd8ERo.mjs +21 -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/{taxonomies-uXVEoQso.mjs → taxonomies-9s-v03H-.mjs} +36 -29
- package/dist/taxonomies-DRiixp_E.mjs +443 -0
- package/dist/{taxonomy-CBmkmMuU.mjs → taxonomy-Dvsw6BOs.mjs} +44 -9
- package/dist/{tokens-CjSgb0AC.mjs → tokens-1RK1n6ED.mjs} +1 -1
- package/dist/transport-BNmCqLu7.mjs +134 -0
- package/dist/types-4garmdWa.mjs +66 -0
- package/dist/{types-DSPGWjxO.d.mts → types-C8XW6L19.d.mts} +225 -4
- package/dist/{types-GaCtZ1k9.d.mts → types-CDpH6MA4.d.mts} +18 -0
- package/dist/{types-DRIKLmJI.d.mts → types-C_ly5eTp.d.mts} +17 -2
- package/dist/types-DF7ZuGGk.d.mts +118 -0
- package/dist/types-DU0bU2Wu.d.mts +2392 -0
- package/dist/{types-CwawBUTa.d.mts → types-DW_-sFyz.d.mts} +2 -1
- package/dist/{types-DfuD0Afl.mjs → types-Dq1qT19x.mjs} +2 -2
- package/dist/ui/server-runtime.d.mts +15 -15
- package/dist/ui/server-runtime.mjs +25 -21
- package/dist/url-Cac7a9QZ.mjs +33 -0
- package/dist/{user-DtNmjNYt.mjs → user-BIZPzCb9.mjs} +2 -2
- package/dist/{utils-wv-zvC-Y.mjs → utils-CMDhr5Xd.mjs} +129 -7
- package/dist/{validate-BMs11tan.d.mts → validate-CZvb-BKB.d.mts} +10 -7
- package/dist/{validate-7SYRbz2f.mjs → validate-DNs0pTSc.mjs} +11 -6
- package/dist/version-BTvfRGc6.mjs +6 -0
- package/dist/{widgets-DR8EHuRO.mjs → widgets-f0ibZUIq.mjs} +46 -43
- package/dist/{wordpress-slugs-Dvhxh4cl.mjs → wordpress-slugs-BhHJX8XE.mjs} +1 -1
- package/dist/{zod-generator-BS9-umbk.mjs → zod-generator-B7TMjyFJ.mjs} +41 -13
- package/package.json +31 -8
- package/src/components/Block.astro +50 -0
- package/src/components/Comments.astro +143 -1
- package/src/components/DinewayHead.astro +19 -2
- package/src/components/DinewayImage.astro +66 -33
- package/src/components/DinewayMedia.astro +1 -2
- package/src/components/Image.astro +85 -40
- package/src/components/InlinePortableTextEditor.tsx +12 -2
- package/src/components/JsonLdScript.astro +9 -0
- package/src/components/LiveSearch.astro +40 -4
- package/src/components/index.ts +4 -0
- package/src/components/live-search-routing.ts +30 -0
- package/src/components/portable-text-text-align.ts +15 -0
- package/src/ui.ts +2 -0
- package/dist/entity-aliases-Egjmqc7I.mjs +0 -51
- package/dist/import-CvHY6sf5.mjs +0 -684
- package/dist/runner-B-tbV751.mjs +0 -2741
- package/dist/schema-B6zyB-Xn.mjs +0 -8
- package/dist/taxonomies-CNOGeC-3.mjs +0 -327
- package/dist/types-eu5UDgHN.d.mts +0 -652
- package/dist/version-xlzMSXF2.mjs +0 -6
- /package/dist/{adapters-OQCImOL7.d.mts → adapters-NVSs4UH7.d.mts} +0 -0
- /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-2r7OWi_I.mjs} +0 -0
- /package/dist/{base64-C1Q9yr0B.mjs → base64-F8-DUraK.mjs} +0 -0
- /package/dist/{challenge-store-CRSz-Xim.mjs → challenge-store-Bjlepa2E.mjs} +0 -0
- /package/dist/{components--pg6zBvu.mjs → components-Bclf98Be.mjs} +0 -0
- /package/dist/{context-types-DQh_XKkn.mjs → context-types-DqTo6C79.mjs} +0 -0
- /package/dist/{default-B6iaLvP7.mjs → default--K40jqm0.mjs} +0 -0
- /package/dist/{email-console-BOVqIYpB.mjs → email-console-ChgKFO8-.mjs} +0 -0
- /package/dist/{escape-BDgouFFY.mjs → escape-Bd4P_xKg.mjs} +0 -0
- /package/dist/{experimental-workflows-Dh4DUoD_.mjs → experimental-workflows-BMsUnIAw.mjs} +0 -0
- /package/dist/{mime-8pAB8-77.mjs → mime-CA7Lgovc.mjs} +0 -0
- /package/dist/{mode-CpyEz8pe.mjs → mode-C4CIyjtR.mjs} +0 -0
- /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CNoXafF7.mjs} +0 -0
- /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-Ygw4bNyt.mjs} +0 -0
- /package/dist/{options-BvJoSSJR.mjs → options-DQPTH5n0.mjs} +0 -0
- /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-BUwu8BA3.mjs} +0 -0
- /package/dist/{patterns-r-0n824Y.mjs → patterns-BhAvqO0S.mjs} +0 -0
- /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-D0w9dqjm.mjs} +0 -0
- /package/dist/{redirect-BjIBtDWY.mjs → redirect-wphRBv4y.mjs} +0 -0
- /package/dist/{request-cache-CYMbwZc6.mjs → request-cache-D9GQBxMP.mjs} +0 -0
- /package/dist/{resolve-DTuDyYKs.mjs → resolve-Cb6Dbz-C.mjs} +0 -0
- /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-CoyjILvW.mjs} +0 -0
- /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-C3mqXg4C.mjs} +0 -0
- /package/dist/{slugify-BzGxlOFx.mjs → slugify-KSsVD_D3.mjs} +0 -0
- /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-DWe8jwAp.mjs} +0 -0
- /package/dist/{transaction-CShMWIej.mjs → transaction-C2EOMTJA.mjs} +0 -0
- /package/dist/{transport-BnsNxh2l.d.mts → transport-CcJu3Co8.d.mts} +0 -0
- /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-DTXQ2IMv.mjs} +0 -0
- /package/dist/{types-BO8TGjS8.mjs → types-B3t5cxhU.mjs} +0 -0
- /package/dist/{types-nP9vGUFq.d.mts → types-C46EvNdc.d.mts} +0 -0
- /package/dist/{types-Cg276-3z.mjs → types-C5CVgwsV.mjs} +0 -0
- /package/dist/{types-DZpT-PnG.d.mts → types-POH8PQZh.d.mts} +0 -0
- /package/dist/{types-Dryvv7LH.d.mts → types-Rc3gQqqw.d.mts} +0 -0
- /package/dist/{url-w7Mp5qAD.mjs → url-CpyFDFpO.mjs} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as __exportAll } from "./runner-
|
|
1
|
+
import { a as __exportAll } from "./runner-DB7CRfOF.mjs";
|
|
2
|
+
import { d as invalidateTaxonomyObjectCache } from "./object-cache-D51qOseS.mjs";
|
|
2
3
|
import { ulid } from "ulidx";
|
|
3
4
|
|
|
4
5
|
//#region src/database/repositories/taxonomy.ts
|
|
@@ -25,7 +26,8 @@ var TaxonomyRepository = class {
|
|
|
25
26
|
*/
|
|
26
27
|
async create(input) {
|
|
27
28
|
const id = ulid();
|
|
28
|
-
const
|
|
29
|
+
const parentInput = input.parentId === void 0 || input.parentId === "" ? null : input.parentId;
|
|
30
|
+
const parentId = parentInput ? await this.resolveParentRef(parentInput) : null;
|
|
29
31
|
let translationGroup = id;
|
|
30
32
|
if (input.translationOf) {
|
|
31
33
|
const source = await this.findById(input.translationOf);
|
|
@@ -41,6 +43,7 @@ var TaxonomyRepository = class {
|
|
|
41
43
|
...input.locale !== void 0 ? { locale: input.locale } : {},
|
|
42
44
|
translation_group: translationGroup
|
|
43
45
|
}).execute();
|
|
46
|
+
invalidateTaxonomyObjectCache();
|
|
44
47
|
const taxonomy = await this.findById(id);
|
|
45
48
|
if (!taxonomy) throw new Error("Failed to create taxonomy");
|
|
46
49
|
return taxonomy;
|
|
@@ -74,8 +77,18 @@ var TaxonomyRepository = class {
|
|
|
74
77
|
else query = query.where("parent_id", "=", options.parentId);
|
|
75
78
|
return (await query.execute()).map((row) => this.rowToTaxonomy(row));
|
|
76
79
|
}
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Children of a term. Accepts a term id OR a translation_group and resolves
|
|
82
|
+
* to the group, since `parent_id` stores the parent's translation_group.
|
|
83
|
+
* Pass `locale` to scope to one locale's tree; omit it to find children in
|
|
84
|
+
* every locale, which is used to block deletes that would orphan a subtree.
|
|
85
|
+
*/
|
|
86
|
+
async findChildren(parentIdOrGroup, locale) {
|
|
87
|
+
const group = await this.resolveTranslationGroup(parentIdOrGroup);
|
|
88
|
+
if (!group) return [];
|
|
89
|
+
let query = this.db.selectFrom("taxonomies").selectAll().where("parent_id", "=", group).orderBy("label", "asc").orderBy("id", "asc");
|
|
90
|
+
if (locale !== void 0) query = query.where("locale", "=", locale);
|
|
91
|
+
return (await query.execute()).map((row) => this.rowToTaxonomy(row));
|
|
79
92
|
}
|
|
80
93
|
/**
|
|
81
94
|
* Every translation sibling of a term (including itself), identified by
|
|
@@ -89,9 +102,12 @@ var TaxonomyRepository = class {
|
|
|
89
102
|
const updates = {};
|
|
90
103
|
if (input.slug !== void 0) updates.slug = input.slug;
|
|
91
104
|
if (input.label !== void 0) updates.label = input.label;
|
|
92
|
-
if (input.parentId !== void 0) updates.parent_id = input.parentId === "" ? null : input.parentId;
|
|
105
|
+
if (input.parentId !== void 0) updates.parent_id = input.parentId === "" || input.parentId === null ? null : await this.resolveParentRef(input.parentId);
|
|
93
106
|
if (input.data !== void 0) updates.data = JSON.stringify(input.data);
|
|
94
|
-
if (Object.keys(updates).length > 0)
|
|
107
|
+
if (Object.keys(updates).length > 0) {
|
|
108
|
+
await this.db.updateTable("taxonomies").set(updates).where("id", "=", id).execute();
|
|
109
|
+
invalidateTaxonomyObjectCache();
|
|
110
|
+
}
|
|
95
111
|
return this.findById(id);
|
|
96
112
|
}
|
|
97
113
|
async delete(id) {
|
|
@@ -100,7 +116,9 @@ var TaxonomyRepository = class {
|
|
|
100
116
|
if (term.translationGroup) {
|
|
101
117
|
if ((await this.db.selectFrom("taxonomies").select("id").where("translation_group", "=", term.translationGroup).where("id", "!=", id).execute()).length === 0) await this.db.deleteFrom("content_taxonomies").where("taxonomy_id", "=", term.translationGroup).execute();
|
|
102
118
|
}
|
|
103
|
-
|
|
119
|
+
const deleted = ((await this.db.deleteFrom("taxonomies").where("id", "=", id).executeTakeFirst()).numDeletedRows ?? 0n) > 0n;
|
|
120
|
+
if (deleted) invalidateTaxonomyObjectCache();
|
|
121
|
+
return deleted;
|
|
104
122
|
}
|
|
105
123
|
async attachToEntry(collection, entryId, taxonomyId) {
|
|
106
124
|
const group = await this.resolveTranslationGroup(taxonomyId);
|
|
@@ -111,11 +129,13 @@ var TaxonomyRepository = class {
|
|
|
111
129
|
taxonomy_id: group
|
|
112
130
|
};
|
|
113
131
|
await this.db.insertInto("content_taxonomies").values(row).onConflict((oc) => oc.doNothing()).execute();
|
|
132
|
+
invalidateTaxonomyObjectCache();
|
|
114
133
|
}
|
|
115
134
|
async detachFromEntry(collection, entryId, taxonomyId) {
|
|
116
135
|
const group = await this.resolveTranslationGroup(taxonomyId);
|
|
117
136
|
if (!group) return;
|
|
118
137
|
await this.db.deleteFrom("content_taxonomies").where("collection", "=", collection).where("entry_id", "=", entryId).where("taxonomy_id", "=", group).execute();
|
|
138
|
+
invalidateTaxonomyObjectCache();
|
|
119
139
|
}
|
|
120
140
|
/**
|
|
121
141
|
* Taxonomy terms assigned to a content entry, resolved into a specific locale.
|
|
@@ -149,10 +169,13 @@ var TaxonomyRepository = class {
|
|
|
149
169
|
entry_id: entryId,
|
|
150
170
|
taxonomy_id
|
|
151
171
|
}))).onConflict((oc) => oc.doNothing()).execute();
|
|
172
|
+
if (toRemove.length > 0 || toAdd.length > 0) invalidateTaxonomyObjectCache();
|
|
152
173
|
}
|
|
153
174
|
async clearEntryTerms(collection, entryId) {
|
|
154
175
|
const result = await this.db.deleteFrom("content_taxonomies").where("collection", "=", collection).where("entry_id", "=", entryId).executeTakeFirst();
|
|
155
|
-
|
|
176
|
+
const removed = Number(result.numDeletedRows ?? 0);
|
|
177
|
+
if (removed > 0) invalidateTaxonomyObjectCache();
|
|
178
|
+
return removed;
|
|
156
179
|
}
|
|
157
180
|
/**
|
|
158
181
|
* Copy every term assignment from one content entry to another. Used when
|
|
@@ -167,6 +190,7 @@ var TaxonomyRepository = class {
|
|
|
167
190
|
entry_id: targetEntryId,
|
|
168
191
|
taxonomy_id: r.taxonomy_id
|
|
169
192
|
}))).onConflict((oc) => oc.doNothing()).execute();
|
|
193
|
+
invalidateTaxonomyObjectCache();
|
|
170
194
|
}
|
|
171
195
|
/**
|
|
172
196
|
* Count content entries that use any translation of this term. Accepts
|
|
@@ -178,6 +202,17 @@ var TaxonomyRepository = class {
|
|
|
178
202
|
const result = await this.db.selectFrom("content_taxonomies").select((eb) => eb.fn.count("entry_id").as("count")).where("taxonomy_id", "=", group).executeTakeFirst();
|
|
179
203
|
return Number(result?.count ?? 0);
|
|
180
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Resolve a parent reference to the value stored in `parent_id`: the parent's
|
|
207
|
+
* translation_group. A translation_group normally equals its anchor row's id,
|
|
208
|
+
* which satisfies the self-FK on parent_id. If the anchor row is missing,
|
|
209
|
+
* fall back to the input so we never write a dangling FK value.
|
|
210
|
+
*/
|
|
211
|
+
async resolveParentRef(idOrGroup) {
|
|
212
|
+
const group = await this.resolveTranslationGroup(idOrGroup);
|
|
213
|
+
if (!group) return idOrGroup;
|
|
214
|
+
return await this.db.selectFrom("taxonomies").select("id").where("id", "=", group).executeTakeFirst() ? group : idOrGroup;
|
|
215
|
+
}
|
|
181
216
|
async resolveTranslationGroup(idOrGroup) {
|
|
182
217
|
return (await this.db.selectFrom("taxonomies").select(["translation_group"]).where((eb) => eb.or([eb("id", "=", idOrGroup), eb("translation_group", "=", idOrGroup)])).executeTakeFirst())?.translation_group ?? null;
|
|
183
218
|
}
|
|
@@ -191,7 +226,7 @@ var TaxonomyRepository = class {
|
|
|
191
226
|
*/
|
|
192
227
|
async countEntriesForTerms(translationGroups) {
|
|
193
228
|
if (translationGroups.length === 0) return /* @__PURE__ */ new Map();
|
|
194
|
-
const { chunks, SQL_BATCH_SIZE } = await import("./chunks-
|
|
229
|
+
const { chunks, SQL_BATCH_SIZE } = await import("./chunks-CxBt-GxR.mjs").then((n) => n.r);
|
|
195
230
|
const counts = /* @__PURE__ */ new Map();
|
|
196
231
|
for (const chunk of chunks(translationGroups, SQL_BATCH_SIZE)) {
|
|
197
232
|
const rows = await this.db.selectFrom("content_taxonomies").select(["taxonomy_id", (eb) => eb.fn.count("entry_id").as("count")]).where("taxonomy_id", "in", chunk).groupBy("taxonomy_id").execute();
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
//#region src/client/transport.ts
|
|
2
|
+
/**
|
|
3
|
+
* Transport layer for the Dineway client.
|
|
4
|
+
*
|
|
5
|
+
* Implements a composable interceptor pipeline that modifies requests
|
|
6
|
+
* and responses. The client calls `transport.fetch(request)` — everything
|
|
7
|
+
* else (auth, CSRF, retry) is handled by interceptors.
|
|
8
|
+
*/
|
|
9
|
+
const COOKIE_NAME_VALUE_PATTERN = /^([^;]+)/;
|
|
10
|
+
function baseFetch(request) {
|
|
11
|
+
return globalThis.fetch(request);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a fetch function that runs requests through an interceptor pipeline.
|
|
15
|
+
*/
|
|
16
|
+
function createTransport(options = {}) {
|
|
17
|
+
const interceptors = options.interceptors ?? [];
|
|
18
|
+
let chain = baseFetch;
|
|
19
|
+
for (let i = interceptors.length - 1; i >= 0; i--) {
|
|
20
|
+
const interceptor = interceptors[i];
|
|
21
|
+
const next = chain;
|
|
22
|
+
chain = (req) => interceptor(req, next);
|
|
23
|
+
}
|
|
24
|
+
return { fetch: chain };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds X-Dineway-Request: 1 and Origin headers to mutation requests
|
|
28
|
+
* (POST, PUT, DELETE). The custom header satisfies Dineway's CSRF check;
|
|
29
|
+
* the Origin header satisfies Astro's built-in origin verification which
|
|
30
|
+
* rejects server-side POST requests that lack a matching Origin.
|
|
31
|
+
*/
|
|
32
|
+
function csrfInterceptor() {
|
|
33
|
+
const MUTATION_METHODS = new Set([
|
|
34
|
+
"POST",
|
|
35
|
+
"PUT",
|
|
36
|
+
"DELETE",
|
|
37
|
+
"PATCH"
|
|
38
|
+
]);
|
|
39
|
+
return (request, next) => {
|
|
40
|
+
if (MUTATION_METHODS.has(request.method)) {
|
|
41
|
+
const headers = new Headers(request.headers);
|
|
42
|
+
headers.set("X-Dineway-Request", "1");
|
|
43
|
+
if (!headers.has("Origin")) {
|
|
44
|
+
const url = new URL(request.url);
|
|
45
|
+
headers.set("Origin", url.origin);
|
|
46
|
+
}
|
|
47
|
+
return next(new Request(request, { headers }));
|
|
48
|
+
}
|
|
49
|
+
return next(request);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Adds Authorization: Bearer header from a static token.
|
|
54
|
+
*/
|
|
55
|
+
function tokenInterceptor(token) {
|
|
56
|
+
return (request, next) => {
|
|
57
|
+
const headers = new Headers(request.headers);
|
|
58
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
59
|
+
return next(new Request(request, { headers }));
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Dev bypass interceptor. Calls the dev-bypass endpoint on first request
|
|
64
|
+
* to establish a session, then forwards the session cookie on subsequent
|
|
65
|
+
* requests.
|
|
66
|
+
*/
|
|
67
|
+
function devBypassInterceptor(baseUrl) {
|
|
68
|
+
let sessionCookie = null;
|
|
69
|
+
let initializing = null;
|
|
70
|
+
async function init() {
|
|
71
|
+
const bypassUrl = new URL("/_dineway/api/auth/dev-bypass", baseUrl);
|
|
72
|
+
const res = await globalThis.fetch(bypassUrl, { redirect: "manual" });
|
|
73
|
+
const setCookie = res.headers.get("set-cookie");
|
|
74
|
+
if (setCookie) {
|
|
75
|
+
const match = setCookie.match(COOKIE_NAME_VALUE_PATTERN);
|
|
76
|
+
if (match) sessionCookie = match[1];
|
|
77
|
+
}
|
|
78
|
+
if (res.body) await res.text().catch(() => {});
|
|
79
|
+
}
|
|
80
|
+
return async (request, next) => {
|
|
81
|
+
if (!sessionCookie) {
|
|
82
|
+
if (!initializing) initializing = init();
|
|
83
|
+
await initializing;
|
|
84
|
+
}
|
|
85
|
+
if (sessionCookie) {
|
|
86
|
+
const headers = new Headers(request.headers);
|
|
87
|
+
const existing = headers.get("cookie");
|
|
88
|
+
headers.set("cookie", existing ? `${existing}; ${sessionCookie}` : sessionCookie);
|
|
89
|
+
return next(new Request(request, { headers }));
|
|
90
|
+
}
|
|
91
|
+
return next(request);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Auto-refreshes expired OAuth tokens on 401 responses.
|
|
96
|
+
* Requires a refresh token and the token endpoint URL.
|
|
97
|
+
*/
|
|
98
|
+
function refreshInterceptor(options) {
|
|
99
|
+
let refreshing = null;
|
|
100
|
+
async function refresh() {
|
|
101
|
+
const res = await globalThis.fetch(options.tokenEndpoint, {
|
|
102
|
+
method: "POST",
|
|
103
|
+
headers: { "Content-Type": "application/json" },
|
|
104
|
+
body: JSON.stringify({
|
|
105
|
+
grant_type: "refresh_token",
|
|
106
|
+
refresh_token: options.refreshToken
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
if (!res.ok) return null;
|
|
110
|
+
const json = await res.json();
|
|
111
|
+
const tokenData = json.data && typeof json.data === "object" && "access_token" in json.data ? json.data : json;
|
|
112
|
+
const expiresAt = tokenData.expires_in ? new Date(Date.now() + tokenData.expires_in * 1e3).toISOString() : new Date(Date.now() + 36e5).toISOString();
|
|
113
|
+
if (options.onTokenRefreshed) options.onTokenRefreshed(tokenData.access_token, tokenData.refresh_token ?? options.refreshToken, expiresAt);
|
|
114
|
+
return tokenData.access_token;
|
|
115
|
+
}
|
|
116
|
+
return async (request, next) => {
|
|
117
|
+
const response = await next(request);
|
|
118
|
+
if (response.status === 401) {
|
|
119
|
+
if (!refreshing) refreshing = refresh().finally(() => {
|
|
120
|
+
refreshing = null;
|
|
121
|
+
});
|
|
122
|
+
const newToken = await refreshing;
|
|
123
|
+
if (newToken) {
|
|
124
|
+
const headers = new Headers(request.headers);
|
|
125
|
+
headers.set("Authorization", `Bearer ${newToken}`);
|
|
126
|
+
return next(new Request(request, { headers }));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return response;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
export { tokenInterceptor as a, refreshInterceptor as i, csrfInterceptor as n, devBypassInterceptor as r, createTransport as t };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region src/plugins/types.ts
|
|
2
|
+
function capabilitiesToDeclaredAccess(capabilities, allowedHosts) {
|
|
3
|
+
const caps = new Set(capabilities);
|
|
4
|
+
const out = {};
|
|
5
|
+
if (caps.has("content:read") || caps.has("content:write")) {
|
|
6
|
+
out.content = { read: {} };
|
|
7
|
+
if (caps.has("content:write")) out.content.write = {};
|
|
8
|
+
}
|
|
9
|
+
if (caps.has("media:read") || caps.has("media:write")) {
|
|
10
|
+
out.media = { read: {} };
|
|
11
|
+
if (caps.has("media:write")) out.media.write = {};
|
|
12
|
+
}
|
|
13
|
+
if (caps.has("network:request:unrestricted")) out.network = { request: {} };
|
|
14
|
+
else if (caps.has("network:request")) out.network = { request: { allowedHosts: [...allowedHosts] } };
|
|
15
|
+
if (caps.has("email:send")) (out.email ??= {}).send = {};
|
|
16
|
+
if (caps.has("hooks.email-events:register")) (out.email ??= {}).events = {};
|
|
17
|
+
if (caps.has("hooks.email-transport:register")) (out.email ??= {}).transport = {};
|
|
18
|
+
if (caps.has("hooks.page-fragments:register")) out.page = { fragments: {} };
|
|
19
|
+
if (caps.has("users:read")) out.users = { read: {} };
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
function declaredAccessToCapabilities(declaredAccess) {
|
|
23
|
+
const caps = /* @__PURE__ */ new Set();
|
|
24
|
+
let allowedHosts = [];
|
|
25
|
+
if (declaredAccess.content?.read) caps.add("content:read");
|
|
26
|
+
if (declaredAccess.content?.write) {
|
|
27
|
+
caps.add("content:write");
|
|
28
|
+
caps.add("content:read");
|
|
29
|
+
}
|
|
30
|
+
if (declaredAccess.media?.read) caps.add("media:read");
|
|
31
|
+
if (declaredAccess.media?.write) {
|
|
32
|
+
caps.add("media:write");
|
|
33
|
+
caps.add("media:read");
|
|
34
|
+
}
|
|
35
|
+
if (declaredAccess.network?.request) {
|
|
36
|
+
const hosts = declaredAccess.network.request.allowedHosts;
|
|
37
|
+
if (hosts === void 0) {
|
|
38
|
+
caps.add("network:request:unrestricted");
|
|
39
|
+
caps.add("network:request");
|
|
40
|
+
} else {
|
|
41
|
+
caps.add("network:request");
|
|
42
|
+
allowedHosts = [...hosts];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (declaredAccess.email?.send) caps.add("email:send");
|
|
46
|
+
if (declaredAccess.email?.events) caps.add("hooks.email-events:register");
|
|
47
|
+
if (declaredAccess.email?.transport) caps.add("hooks.email-transport:register");
|
|
48
|
+
if (declaredAccess.page?.fragments) caps.add("hooks.page-fragments:register");
|
|
49
|
+
if (declaredAccess.users?.read) caps.add("users:read");
|
|
50
|
+
return {
|
|
51
|
+
capabilities: [...caps],
|
|
52
|
+
allowedHosts
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check if a value is a StandardPluginDefinition (has hooks/routes but no id/version).
|
|
57
|
+
*/
|
|
58
|
+
function isStandardPluginDefinition(value) {
|
|
59
|
+
if (typeof value !== "object" || value === null) return false;
|
|
60
|
+
const hasPluginShape = "hooks" in value || "routes" in value;
|
|
61
|
+
const hasNativeShape = "id" in value && "version" in value;
|
|
62
|
+
return hasPluginShape && !hasNativeShape;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
export { declaredAccessToCapabilities as n, isStandardPluginDefinition as r, capabilitiesToDeclaredAccess as t };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { d as FieldType } from "./types-
|
|
1
|
+
import { d as FieldType } from "./types-DW_-sFyz.mjs";
|
|
2
|
+
import { t as Database } from "./types-DU0bU2Wu.mjs";
|
|
3
|
+
import { d as Storage } from "./types-POH8PQZh.mjs";
|
|
4
|
+
import { Kysely } from "kysely";
|
|
2
5
|
import { z } from "astro/zod";
|
|
6
|
+
import { Permission, RoleLevel } from "@dineway-ai/auth";
|
|
3
7
|
import "react/jsx-runtime";
|
|
8
|
+
import { AnySchema } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
4
9
|
import { JSX } from "astro/jsx-runtime";
|
|
5
10
|
|
|
6
11
|
//#region ../blocks/dist/validation-b1zbwCOE.d.ts
|
|
@@ -126,6 +131,40 @@ type Element = ButtonElement | TextInputElement | NumberInputElement | SelectEle
|
|
|
126
131
|
* Plugin capabilities determine what APIs are available in context
|
|
127
132
|
*/
|
|
128
133
|
type PluginCapability = "network:request" | "network:request:unrestricted" | "content:read" | "content:write" | "media:read" | "media:write" | "users:read" | "email:send" | "hooks.email-transport:register" | "hooks.email-events:register" | "hooks.page-fragments:register";
|
|
134
|
+
type AccessConstraints = Record<string, unknown>;
|
|
135
|
+
/**
|
|
136
|
+
* Structured plugin trust contract.
|
|
137
|
+
*
|
|
138
|
+
* This is the manifest-facing access shape. `capabilities` and `allowedHosts`
|
|
139
|
+
* remain the runtime enforcement currency and are derived from this at bundle
|
|
140
|
+
* parse boundaries when `declaredAccess` is present.
|
|
141
|
+
*/
|
|
142
|
+
interface DeclaredAccess {
|
|
143
|
+
content?: {
|
|
144
|
+
read?: AccessConstraints;
|
|
145
|
+
write?: AccessConstraints;
|
|
146
|
+
};
|
|
147
|
+
media?: {
|
|
148
|
+
read?: AccessConstraints;
|
|
149
|
+
write?: AccessConstraints;
|
|
150
|
+
};
|
|
151
|
+
network?: {
|
|
152
|
+
request?: {
|
|
153
|
+
allowedHosts?: string[];
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
email?: {
|
|
157
|
+
send?: AccessConstraints;
|
|
158
|
+
events?: AccessConstraints;
|
|
159
|
+
transport?: AccessConstraints;
|
|
160
|
+
};
|
|
161
|
+
page?: {
|
|
162
|
+
fragments?: AccessConstraints;
|
|
163
|
+
};
|
|
164
|
+
users?: {
|
|
165
|
+
read?: AccessConstraints;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
129
168
|
/**
|
|
130
169
|
* Storage collection declaration in plugin definition
|
|
131
170
|
*/
|
|
@@ -701,12 +740,15 @@ interface ContentDeleteEvent {
|
|
|
701
740
|
permanent: boolean;
|
|
702
741
|
}
|
|
703
742
|
/**
|
|
704
|
-
* Content
|
|
743
|
+
* Content state change hook event.
|
|
705
744
|
*/
|
|
706
|
-
interface
|
|
745
|
+
interface ContentStateChangeEvent {
|
|
707
746
|
content: Record<string, unknown>;
|
|
708
747
|
collection: string;
|
|
709
748
|
}
|
|
749
|
+
type ContentPublishStateChangeEvent = ContentStateChangeEvent;
|
|
750
|
+
type ContentRestoreStateChangeEvent = ContentStateChangeEvent;
|
|
751
|
+
type ContentScheduleStateChangeEvent = ContentStateChangeEvent;
|
|
710
752
|
/**
|
|
711
753
|
* Media hook event
|
|
712
754
|
*/
|
|
@@ -739,6 +781,9 @@ type ContentBeforeDeleteHandler = (event: ContentDeleteEvent, ctx: PluginContext
|
|
|
739
781
|
type ContentAfterDeleteHandler = (event: ContentDeleteEvent, ctx: PluginContext) => Promise<void>;
|
|
740
782
|
type ContentAfterPublishHandler = (event: ContentPublishStateChangeEvent, ctx: PluginContext) => Promise<void>;
|
|
741
783
|
type ContentAfterUnpublishHandler = (event: ContentPublishStateChangeEvent, ctx: PluginContext) => Promise<void>;
|
|
784
|
+
type ContentAfterRestoreHandler = (event: ContentRestoreStateChangeEvent, ctx: PluginContext) => Promise<void>;
|
|
785
|
+
type ContentAfterScheduleHandler = (event: ContentScheduleStateChangeEvent, ctx: PluginContext) => Promise<void>;
|
|
786
|
+
type ContentAfterUnscheduleHandler = (event: ContentScheduleStateChangeEvent, ctx: PluginContext) => Promise<void>;
|
|
742
787
|
type MediaBeforeUploadHandler = (event: MediaUploadEvent, ctx: PluginContext) => Promise<{
|
|
743
788
|
name: string;
|
|
744
789
|
type: string;
|
|
@@ -884,6 +929,9 @@ interface PluginHooks {
|
|
|
884
929
|
"content:afterDelete"?: HookConfig<ContentAfterDeleteHandler> | ContentAfterDeleteHandler;
|
|
885
930
|
"content:afterPublish"?: HookConfig<ContentAfterPublishHandler> | ContentAfterPublishHandler;
|
|
886
931
|
"content:afterUnpublish"?: HookConfig<ContentAfterUnpublishHandler> | ContentAfterUnpublishHandler;
|
|
932
|
+
"content:afterRestore"?: HookConfig<ContentAfterRestoreHandler> | ContentAfterRestoreHandler;
|
|
933
|
+
"content:afterSchedule"?: HookConfig<ContentAfterScheduleHandler> | ContentAfterScheduleHandler;
|
|
934
|
+
"content:afterUnschedule"?: HookConfig<ContentAfterUnscheduleHandler> | ContentAfterUnscheduleHandler;
|
|
887
935
|
"media:beforeUpload"?: HookConfig<MediaBeforeUploadHandler> | MediaBeforeUploadHandler;
|
|
888
936
|
"media:afterUpload"?: HookConfig<MediaAfterUploadHandler> | MediaAfterUploadHandler;
|
|
889
937
|
cron?: HookConfig<CronHandler> | CronHandler;
|
|
@@ -952,12 +1000,59 @@ interface RequestMeta {
|
|
|
952
1000
|
referer: string | null;
|
|
953
1001
|
geo: GeoInfo | null;
|
|
954
1002
|
}
|
|
1003
|
+
type PluginRouteBodyMode = "json" | "raw";
|
|
1004
|
+
type PluginRouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
1005
|
+
type PluginActorType = "user" | "api_token" | "system";
|
|
1006
|
+
type PluginAuthMethod = "session" | "api_token" | "oauth_token" | "system";
|
|
1007
|
+
interface PluginActor {
|
|
1008
|
+
type: PluginActorType;
|
|
1009
|
+
id: string;
|
|
1010
|
+
userId: string | null;
|
|
1011
|
+
role: RoleLevel;
|
|
1012
|
+
authMethod: PluginAuthMethod;
|
|
1013
|
+
tokenScopes?: readonly string[];
|
|
1014
|
+
}
|
|
1015
|
+
interface PluginTargetScope {
|
|
1016
|
+
type: "plugin" | "location" | "entity";
|
|
1017
|
+
id: string;
|
|
1018
|
+
/** Canonical Site Context scope used for HITL and activity inheritance. */
|
|
1019
|
+
scope: string;
|
|
1020
|
+
locationId?: string;
|
|
1021
|
+
}
|
|
1022
|
+
interface PluginRouteAuthorization {
|
|
1023
|
+
/** Core RBAC permission checked before route dispatch. */
|
|
1024
|
+
permission: Permission;
|
|
1025
|
+
/** API/OAuth tokens must hold at least one listed scope. */
|
|
1026
|
+
anyOfTokenScopes: string[];
|
|
1027
|
+
/** First-party domain permission checked against the resolved target. */
|
|
1028
|
+
restaurantPermission?: string;
|
|
1029
|
+
}
|
|
1030
|
+
interface PluginRouteTargetContext extends PluginContext {
|
|
1031
|
+
actor: PluginActor;
|
|
1032
|
+
request: Request;
|
|
1033
|
+
requestMeta: RequestMeta;
|
|
1034
|
+
}
|
|
1035
|
+
interface PluginRouteTargetAuthorizationRequest<TInput = unknown> {
|
|
1036
|
+
restaurantPermission: string;
|
|
1037
|
+
target: PluginTargetScope;
|
|
1038
|
+
context: RouteContext<TInput> & {
|
|
1039
|
+
readonly actor: PluginActor;
|
|
1040
|
+
readonly target: PluginTargetScope;
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
type PluginRouteTargetAuthorizer<TInput = unknown> = (request: PluginRouteTargetAuthorizationRequest<TInput>) => Promise<void>;
|
|
955
1044
|
/**
|
|
956
1045
|
* Route handler context extends plugin context with request-specific data
|
|
957
1046
|
*/
|
|
958
1047
|
interface RouteContext<TInput = unknown> extends PluginContext {
|
|
959
1048
|
/** Validated input from request body */
|
|
960
1049
|
input: TInput;
|
|
1050
|
+
/** Exact request bytes for raw-body routes; null for ordinary JSON routes. */
|
|
1051
|
+
readonly rawBody: Uint8Array | null;
|
|
1052
|
+
/** Normalized authenticated actor; null for unauthenticated public routes. */
|
|
1053
|
+
readonly actor: PluginActor | null;
|
|
1054
|
+
/** Server-resolved authorization target when the route declares one. */
|
|
1055
|
+
readonly target: PluginTargetScope | null;
|
|
961
1056
|
/** Original request */
|
|
962
1057
|
request: Request;
|
|
963
1058
|
/** Normalized request metadata (IP, user agent, geo) */
|
|
@@ -967,8 +1062,20 @@ interface RouteContext<TInput = unknown> extends PluginContext {
|
|
|
967
1062
|
* Route definition
|
|
968
1063
|
*/
|
|
969
1064
|
interface PluginRoute<TInput = unknown> {
|
|
1065
|
+
/** Restrict trusted route invocation to these HTTP methods. Omit for legacy all-method behavior. */
|
|
1066
|
+
methods?: readonly PluginRouteMethod[];
|
|
970
1067
|
/** Zod schema for input validation */
|
|
971
1068
|
input?: z.ZodType<TInput>;
|
|
1069
|
+
/** Request-body handling mode. Defaults to JSON. */
|
|
1070
|
+
body?: PluginRouteBodyMode;
|
|
1071
|
+
/** Maximum bytes accepted by a raw-body route. JSON routes cannot set this field. */
|
|
1072
|
+
maxBodyBytes?: number;
|
|
1073
|
+
/** Declarative private-route authorization. */
|
|
1074
|
+
authorization?: PluginRouteAuthorization;
|
|
1075
|
+
/** Resolve the authoritative restaurant target before the handler runs. */
|
|
1076
|
+
resolveTarget?: (input: TInput, context: PluginRouteTargetContext) => PluginTargetScope | Promise<PluginTargetScope>;
|
|
1077
|
+
/** Enforce the declared restaurant permission against the resolved target. */
|
|
1078
|
+
authorizeTarget?: PluginRouteTargetAuthorizer<TInput>;
|
|
972
1079
|
/**
|
|
973
1080
|
* Mark this route as publicly accessible (no authentication required).
|
|
974
1081
|
* Public routes skip session/token auth and CSRF checks.
|
|
@@ -977,6 +1084,113 @@ interface PluginRoute<TInput = unknown> {
|
|
|
977
1084
|
/** Route handler */
|
|
978
1085
|
handler: (ctx: RouteContext<TInput>) => Promise<unknown>;
|
|
979
1086
|
}
|
|
1087
|
+
type PluginMcpPiiClass = "none" | "redacted" | "sensitive";
|
|
1088
|
+
type PluginMcpRiskLevel = "quick_confirmation" | "strong_confirmation";
|
|
1089
|
+
type PluginMcpRiskFactor = "content" | "availability" | "time" | "money" | "allergen" | "pii" | "batch" | "payment" | "destructive" | "external_side_effect";
|
|
1090
|
+
type PluginMcpReversibility = "reversible" | "compensating" | "irreversible";
|
|
1091
|
+
interface PluginMcpExecutionContext {
|
|
1092
|
+
plugin: {
|
|
1093
|
+
id: string;
|
|
1094
|
+
version: string;
|
|
1095
|
+
};
|
|
1096
|
+
actor: PluginActor;
|
|
1097
|
+
db: Kysely<Database>;
|
|
1098
|
+
storage: Storage | null;
|
|
1099
|
+
/** Plugin-scoped outbound HTTP with the plugin's SSRF and capability policy. */
|
|
1100
|
+
http?: HttpAccess;
|
|
1101
|
+
reviewedExecution?: {
|
|
1102
|
+
id: string;
|
|
1103
|
+
hitlRequestId: string | null;
|
|
1104
|
+
actionHash: string;
|
|
1105
|
+
idempotencyKey: string;
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
interface PluginMcpTargetAuthorizationRequest {
|
|
1109
|
+
restaurantPermission: string;
|
|
1110
|
+
target: PluginTargetScope;
|
|
1111
|
+
context: PluginMcpExecutionContext;
|
|
1112
|
+
}
|
|
1113
|
+
type PluginMcpTargetAuthorizer = (request: PluginMcpTargetAuthorizationRequest) => Promise<void>;
|
|
1114
|
+
interface PluginMcpAuthorization {
|
|
1115
|
+
/** Core RBAC permission checked for every request. */
|
|
1116
|
+
permission: Permission;
|
|
1117
|
+
/** Any listed token scope permits the request; `admin` remains a universal scope. */
|
|
1118
|
+
anyOfTokenScopes: string[];
|
|
1119
|
+
/** Optional first-party domain permission checked by the core target authorizer. */
|
|
1120
|
+
restaurantPermission?: string;
|
|
1121
|
+
}
|
|
1122
|
+
interface PluginMcpPiiPolicy {
|
|
1123
|
+
input: PluginMcpPiiClass;
|
|
1124
|
+
output: PluginMcpPiiClass;
|
|
1125
|
+
}
|
|
1126
|
+
interface PluginMcpCommandPreview {
|
|
1127
|
+
summary: string;
|
|
1128
|
+
target: PluginTargetScope;
|
|
1129
|
+
before?: Record<string, unknown>;
|
|
1130
|
+
after?: Record<string, unknown>;
|
|
1131
|
+
metadata?: Record<string, unknown>;
|
|
1132
|
+
}
|
|
1133
|
+
interface PluginMcpToolBase {
|
|
1134
|
+
name: string;
|
|
1135
|
+
title: string;
|
|
1136
|
+
description: string;
|
|
1137
|
+
inputSchema: AnySchema;
|
|
1138
|
+
outputSchema?: AnySchema;
|
|
1139
|
+
authorization: PluginMcpAuthorization;
|
|
1140
|
+
pii: PluginMcpPiiPolicy;
|
|
1141
|
+
resolveTarget?: (input: Record<string, unknown>, context: PluginMcpExecutionContext) => Promise<PluginTargetScope> | PluginTargetScope;
|
|
1142
|
+
handler: (input: Record<string, unknown>, context: PluginMcpExecutionContext) => Promise<Record<string, unknown>>;
|
|
1143
|
+
}
|
|
1144
|
+
interface PluginMcpQueryTool extends PluginMcpToolBase {
|
|
1145
|
+
kind: "query";
|
|
1146
|
+
}
|
|
1147
|
+
interface PluginMcpCommandTool extends PluginMcpToolBase {
|
|
1148
|
+
kind: "command";
|
|
1149
|
+
risk: {
|
|
1150
|
+
level: PluginMcpRiskLevel;
|
|
1151
|
+
mandatory: boolean;
|
|
1152
|
+
reason: string;
|
|
1153
|
+
factors: PluginMcpRiskFactor[];
|
|
1154
|
+
};
|
|
1155
|
+
audit: "best_effort" | "strict";
|
|
1156
|
+
reversibility: PluginMcpReversibility;
|
|
1157
|
+
preview: (input: Record<string, unknown>, context: PluginMcpExecutionContext) => Promise<PluginMcpCommandPreview>;
|
|
1158
|
+
actionFingerprint: (input: Record<string, unknown>, preview: PluginMcpCommandPreview, context: PluginMcpExecutionContext) => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
1159
|
+
idempotency: {
|
|
1160
|
+
required: true;
|
|
1161
|
+
namespace?: string;
|
|
1162
|
+
};
|
|
1163
|
+
redactPreview?: (preview: PluginMcpCommandPreview, context: PluginMcpExecutionContext) => Promise<PluginMcpCommandPreview> | PluginMcpCommandPreview;
|
|
1164
|
+
}
|
|
1165
|
+
type PluginMcpTool = PluginMcpQueryTool | PluginMcpCommandTool;
|
|
1166
|
+
interface PluginMcpResourceContent {
|
|
1167
|
+
text: string;
|
|
1168
|
+
mimeType?: string;
|
|
1169
|
+
}
|
|
1170
|
+
interface PluginMcpResource {
|
|
1171
|
+
name: string;
|
|
1172
|
+
title: string;
|
|
1173
|
+
description: string;
|
|
1174
|
+
uri: string;
|
|
1175
|
+
mimeType?: string;
|
|
1176
|
+
authorization: PluginMcpAuthorization;
|
|
1177
|
+
pii: {
|
|
1178
|
+
output: PluginMcpPiiClass;
|
|
1179
|
+
};
|
|
1180
|
+
target?: PluginTargetScope;
|
|
1181
|
+
handler: (uri: URL, context: PluginMcpExecutionContext) => Promise<PluginMcpResourceContent>;
|
|
1182
|
+
}
|
|
1183
|
+
interface PluginMcpConfig {
|
|
1184
|
+
tools?: PluginMcpTool[];
|
|
1185
|
+
resources?: PluginMcpResource[];
|
|
1186
|
+
/** Trusted first-party domain authorization invoked by the core wrapper. */
|
|
1187
|
+
authorizeTarget?: PluginMcpTargetAuthorizer;
|
|
1188
|
+
}
|
|
1189
|
+
interface ResolvedPluginMcpConfig {
|
|
1190
|
+
tools: PluginMcpTool[];
|
|
1191
|
+
resources: PluginMcpResource[];
|
|
1192
|
+
authorizeTarget?: PluginMcpTargetAuthorizer;
|
|
1193
|
+
}
|
|
980
1194
|
/**
|
|
981
1195
|
* Admin page definition
|
|
982
1196
|
*/
|
|
@@ -1120,6 +1334,8 @@ interface PluginDefinition<TStorage extends PluginStorageConfig = PluginStorageC
|
|
|
1120
1334
|
hooks?: PluginHooks;
|
|
1121
1335
|
/** API routes */
|
|
1122
1336
|
routes?: Record<string, PluginRoute>;
|
|
1337
|
+
/** Native first-party MCP tools and read-only resources. */
|
|
1338
|
+
mcp?: PluginMcpConfig;
|
|
1123
1339
|
/** Admin UI configuration */
|
|
1124
1340
|
admin?: PluginAdminConfig;
|
|
1125
1341
|
}
|
|
@@ -1134,6 +1350,7 @@ interface ResolvedPlugin<TStorage extends PluginStorageConfig = PluginStorageCon
|
|
|
1134
1350
|
storage: TStorage;
|
|
1135
1351
|
hooks: ResolvedPluginHooks;
|
|
1136
1352
|
routes: Record<string, PluginRoute>;
|
|
1353
|
+
mcp: ResolvedPluginMcpConfig;
|
|
1137
1354
|
admin: PluginAdminConfig;
|
|
1138
1355
|
}
|
|
1139
1356
|
/**
|
|
@@ -1150,6 +1367,9 @@ interface ResolvedPluginHooks {
|
|
|
1150
1367
|
"content:afterDelete"?: ResolvedHook<ContentAfterDeleteHandler>;
|
|
1151
1368
|
"content:afterPublish"?: ResolvedHook<ContentAfterPublishHandler>;
|
|
1152
1369
|
"content:afterUnpublish"?: ResolvedHook<ContentAfterUnpublishHandler>;
|
|
1370
|
+
"content:afterRestore"?: ResolvedHook<ContentAfterRestoreHandler>;
|
|
1371
|
+
"content:afterSchedule"?: ResolvedHook<ContentAfterScheduleHandler>;
|
|
1372
|
+
"content:afterUnschedule"?: ResolvedHook<ContentAfterUnscheduleHandler>;
|
|
1153
1373
|
"media:beforeUpload"?: ResolvedHook<MediaBeforeUploadHandler>;
|
|
1154
1374
|
"media:afterUpload"?: ResolvedHook<MediaAfterUploadHandler>;
|
|
1155
1375
|
cron?: ResolvedHook<CronHandler>;
|
|
@@ -1234,6 +1454,7 @@ interface PluginAdminExports {
|
|
|
1234
1454
|
interface PluginManifest {
|
|
1235
1455
|
id: string;
|
|
1236
1456
|
version: string;
|
|
1457
|
+
declaredAccess?: DeclaredAccess;
|
|
1237
1458
|
capabilities: PluginCapability[];
|
|
1238
1459
|
allowedHosts: string[];
|
|
1239
1460
|
storage: PluginStorageConfig;
|
|
@@ -1244,4 +1465,4 @@ interface PluginManifest {
|
|
|
1244
1465
|
admin: PluginAdminConfig;
|
|
1245
1466
|
}
|
|
1246
1467
|
//#endregion
|
|
1247
|
-
export {
|
|
1468
|
+
export { PluginMcpQueryTool as $, PageMetadataContribution as A, StorageCollection as At, PluginAuthMethod as B, MediaAccess as C, ResolvedPluginMcpConfig as Ct, PageFragmentContribution as D, StandardPluginDefinition as Dt, ModerationDecision as E, StandardHookHandler as Et, PluginActor as F, PluginManifest as G, PluginContext as H, PluginActorType as I, PluginMcpCommandTool as J, PluginMcpAuthorization as K, PluginAdminConfig as L, PageMetadataHandler as M, StoredComment as Mt, PageMetadataLinkRel as N, isStandardPluginDefinition as Nt, PageFragmentEvent as O, StandardRouteEntry as Ot, PagePlacement as P, Element as Pt, PluginMcpPiiPolicy as Q, PluginAdminExports as R, LogAccess as S, ResolvedPluginHooks as St, MediaUploadEvent as T, StandardHookEntry as Tt, PluginDefinition as U, PluginCapability as V, PluginHooks as W, PluginMcpExecutionContext as X, PluginMcpConfig as Y, PluginMcpPiiClass as Z, FieldWidgetConfig as _, PortableTextBlockField as _t, CommentAfterModerateEvent as a, PluginMcpTargetAuthorizer as at, HttpAccess as b, ResolvedHook as bt, CommentBeforeCreateHandler as c, PluginRouteAuthorization as ct, ContentAccess as d, PluginRouteTargetAuthorizationRequest as dt, PluginMcpResource as et, ContentDeleteEvent as f, PluginRouteTargetAuthorizer as ft, EmailMessage as g, PortableTextBlockConfig as gt, CronEvent as h, PluginTargetScope as ht, CommentAfterCreateHandler as i, PluginMcpRiskLevel as it, PageMetadataEvent as j, StorageCollectionConfig as jt, PageFragmentHandler as k, StandardRouteHandler as kt, CommentModerateEvent as l, PluginRouteBodyMode as lt, ContentPublishStateChangeEvent as m, PluginStorageConfig as mt, CollectionCommentSettings as n, PluginMcpReversibility as nt, CommentAfterModerateHandler as o, PluginMcpTool as ot, ContentHookEvent as p, PluginRouteTargetContext as pt, PluginMcpCommandPreview as q, CommentAfterCreateEvent as r, PluginMcpRiskFactor as rt, CommentBeforeCreateEvent as s, PluginRoute as st, BreadcrumbItem as t, PluginMcpResourceContent as tt, CommentModerateHandler as u, PluginRouteMethod as ut, HookConfig as v, PublicPageContext as vt, MediaItem as w, RouteContext as wt, KVAccess as x, ResolvedPlugin as xt, HookName as y, RequestMeta as yt, PluginAdminPage as z };
|