dineway 0.2.0 → 0.2.2
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/README.md +17 -17
- package/dist/activity-BDMlkpYY.mjs +79 -0
- package/dist/{activity-events-y6eT8UW6.mjs → activity-events-DEYmJhWd.mjs} +1 -77
- package/dist/{actor-CrObAPV0.mjs → actor-DA7yL9Yp.mjs} +1 -1
- package/dist/{allowed-origins-_oeyP6x-.mjs → allowed-origins-VLgv2PL1.mjs} +1 -1
- package/dist/api/route-utils.d.mts +9 -10
- package/dist/api/route-utils.mjs +14 -14
- package/dist/api/schemas/index.d.mts +2 -2
- package/dist/api/schemas/index.mjs +5 -5
- package/dist/{api-ByrU2q-Z.mjs → api-DsO87Qak.mjs} +51 -23
- package/dist/{api-tokens-CjVMQT-X.mjs → api-tokens-C4K9eocv.mjs} +1 -1
- package/dist/{apply-bZswmZPm.mjs → apply-DHT0l398.mjs} +19 -19
- package/dist/astro/index.d.mts +10 -11
- package/dist/astro/index.mjs +18 -5
- package/dist/astro/middleware/auth.d.mts +9 -19
- package/dist/astro/middleware/auth.mjs +6 -6
- package/dist/astro/middleware/redirect.mjs +5 -5
- package/dist/astro/middleware/request-context.mjs +2 -2
- package/dist/astro/middleware/seed.d.mts +1 -1
- package/dist/astro/middleware/seed.mjs +1 -1
- package/dist/astro/middleware/setup.mjs +1 -1
- package/dist/astro/middleware.mjs +142 -98
- package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +6 -6
- package/dist/astro/routes/api/admin/allowed-domains/index.mjs +6 -6
- package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
- package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
- package/dist/astro/routes/api/admin/briefing.mjs +18 -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 -9
- package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -9
- package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -9
- package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +16 -16
- package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +16 -16
- package/dist/astro/routes/api/admin/bylines/index.mjs +16 -16
- package/dist/astro/routes/api/admin/comments/_id_/status.mjs +12 -12
- package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
- package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
- package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
- package/dist/astro/routes/api/admin/context/_id_/history.mjs +25 -24
- package/dist/astro/routes/api/admin/context/_id_/index.mjs +25 -24
- package/dist/astro/routes/api/admin/context/_id_/review.mjs +30 -29
- package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +30 -29
- package/dist/astro/routes/api/admin/context/diff.mjs +29 -28
- package/dist/astro/routes/api/admin/context/index.mjs +30 -29
- package/dist/astro/routes/api/admin/context/stale.mjs +29 -28
- package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +25 -24
- package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +29 -28
- package/dist/astro/routes/api/admin/hitl-requests/index.mjs +29 -28
- package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +26 -25
- package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
- 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 +55 -51
- package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +55 -51
- package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -44
- package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -50
- package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +54 -50
- package/dist/astro/routes/api/admin/plugins/index.mjs +47 -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 -44
- package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +54 -50
- package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +47 -44
- package/dist/astro/routes/api/admin/plugins/updates.mjs +47 -44
- package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
- package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +30 -65
- package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
- package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -11
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +47 -44
- package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
- package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +47 -44
- package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
- package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
- package/dist/astro/routes/api/admin/users/_id_/index.mjs +7 -7
- package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
- package/dist/astro/routes/api/admin/users/index.mjs +6 -6
- package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
- package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
- package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
- package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
- package/dist/astro/routes/api/auth/logout.mjs +2 -2
- package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
- package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/me.mjs +8 -8
- package/dist/astro/routes/api/auth/mode.mjs +1 -1
- package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
- package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
- package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -6
- package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
- package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
- package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
- package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
- package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
- package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
- package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
- package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
- package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
- package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +13 -13
- package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +12 -12
- package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +10 -10
- package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -21
- package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
- package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -33
- package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +14 -14
- package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
- package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
- 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 -7
- package/dist/astro/routes/api/dashboard.mjs +8 -8
- 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 +19 -19
- package/dist/astro/routes/api/import/wordpress/analyze.mjs +8 -8
- package/dist/astro/routes/api/import/wordpress/execute.d.mts +8 -9
- package/dist/astro/routes/api/import/wordpress/execute.mjs +35 -34
- package/dist/astro/routes/api/import/wordpress/media.d.mts +8 -9
- package/dist/astro/routes/api/import/wordpress/media.mjs +12 -12
- package/dist/astro/routes/api/import/wordpress/prepare.mjs +34 -33
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +9 -10
- package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +31 -30
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
- package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +22 -22
- package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +8 -9
- package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +40 -39
- package/dist/astro/routes/api/integrations/_provider_.d.mts +8 -0
- package/dist/astro/routes/api/integrations/_provider_.mjs +51 -0
- package/dist/astro/routes/api/integrations/index.d.mts +7 -0
- package/dist/astro/routes/api/integrations/index.mjs +24 -0
- package/dist/astro/routes/api/manifest.mjs +4 -4
- package/dist/astro/routes/api/mcp.mjs +474 -167
- package/dist/astro/routes/api/media/_id_/confirm.mjs +10 -10
- package/dist/astro/routes/api/media/_id_.mjs +8 -8
- 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 +11 -11
- package/dist/astro/routes/api/media.mjs +14 -14
- package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_/items.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_/reorder.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_/translations.mjs +30 -29
- package/dist/astro/routes/api/menus/_name_.mjs +30 -29
- package/dist/astro/routes/api/menus/index.mjs +30 -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 -4
- package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +20 -5
- package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
- package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
- package/dist/astro/routes/api/redirects/_id_.mjs +31 -30
- package/dist/astro/routes/api/redirects/index.mjs +31 -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 +49 -45
- package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +49 -45
- package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +49 -45
- package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +49 -45
- package/dist/astro/routes/api/schema/collections/index.mjs +49 -45
- package/dist/astro/routes/api/schema/index.mjs +8 -8
- package/dist/astro/routes/api/schema/orphans/_slug_.mjs +47 -44
- package/dist/astro/routes/api/schema/orphans/index.mjs +47 -44
- package/dist/astro/routes/api/search/enable.mjs +11 -11
- package/dist/astro/routes/api/search/index.mjs +10 -10
- package/dist/astro/routes/api/search/rebuild.mjs +11 -11
- package/dist/astro/routes/api/search/stats.mjs +6 -6
- package/dist/astro/routes/api/search/suggest.mjs +10 -10
- package/dist/astro/routes/api/sections/_slug_.mjs +30 -29
- package/dist/astro/routes/api/sections/index.mjs +30 -29
- package/dist/astro/routes/api/settings/email.mjs +3 -3
- package/dist/astro/routes/api/settings.mjs +30 -29
- package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
- package/dist/astro/routes/api/setup/admin.mjs +10 -10
- package/dist/astro/routes/api/setup/dev-bypass.mjs +25 -25
- package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
- package/dist/astro/routes/api/setup/index.mjs +27 -27
- package/dist/astro/routes/api/setup/status.mjs +3 -3
- package/dist/astro/routes/api/snapshot.mjs +6 -6
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +33 -32
- package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +33 -32
- package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +33 -32
- package/dist/astro/routes/api/taxonomies/index.mjs +33 -32
- package/dist/astro/routes/api/themes/preview.mjs +4 -4
- package/dist/astro/routes/api/typegen.mjs +4 -4
- package/dist/astro/routes/api/well-known/auth.mjs +2 -2
- 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 +29 -28
- package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +30 -29
- package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +30 -29
- package/dist/astro/routes/api/widget-areas/_name_.mjs +27 -26
- package/dist/astro/routes/api/widget-areas/index.mjs +30 -29
- package/dist/astro/routes/api/widget-components.mjs +2 -2
- package/dist/astro/routes/robots.txt.mjs +6 -6
- package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
- package/dist/astro/routes/sitemap.xml.mjs +7 -7
- package/dist/astro/session-driver.d.mts +1 -1
- package/dist/astro/session-driver.mjs +2 -2
- package/dist/astro/types.d.mts +13 -12
- package/dist/{audit-ByVKIwWF.mjs → audit-BzhwRVym.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-CqeUmQsv.mjs → auth-control-guard-B_Dx-epW.mjs} +1 -1
- package/dist/{authorize-CcBxcHtz.mjs → authorize-D6MkRtPw.mjs} +1 -1
- package/dist/{briefing-BJaJI8dm.mjs → briefing-Cl70iEH5.mjs} +1 -1
- package/dist/{briefing-CawZ59CY.mjs → briefing-GFhLTLJo.mjs} +7 -7
- package/dist/{bundle-7C_DpkEq.mjs → bundle-CIrUlrkQ.mjs} +2 -2
- package/dist/{byline-e51-fWRs.mjs → byline-BJa1MyKB.mjs} +6 -6
- package/dist/{byline-fields-D-N5qVIG.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
- package/dist/{byline-fields-CUvbslGc.d.mts → byline-fields-DxMpdtsZ.d.mts} +57 -47
- package/dist/{byline-fields-DOJO16Gm.mjs → byline-fields-yT4herdN.mjs} +10 -4
- package/dist/{byline-registry-87nNnYl4.mjs → byline-registry-Ba54M74c.mjs} +2 -2
- package/dist/{bylines-CMQNCNFh.mjs → bylines-B53Saxdb.mjs} +3 -3
- package/dist/{bylines-y4LO-dTj.mjs → bylines-kixFoaRV.mjs} +5 -5
- package/dist/{cache-C-FNTFYK.mjs → cache-fpisdt5Q.mjs} +2 -2
- package/dist/{chunks-CxBt-GxR.mjs → chunks-DX_b8_4Z.mjs} +1 -1
- package/dist/cli/index.d.mts +29 -1
- package/dist/cli/index.mjs +1527 -1222
- package/dist/cli/plugin-kit.d.mts +75 -0
- package/dist/cli/plugin-kit.mjs +4 -0
- package/dist/client/external-auth-headers.d.mts +1 -1
- package/dist/client/index.d.mts +27 -52
- package/dist/client/index.mjs +34 -7
- package/dist/client-factory-DEtHApCc.mjs +323 -0
- package/dist/{comment-DlA4iChg.mjs → comment-B88XcvU1.mjs} +1 -1
- package/dist/{comment-reaction-DfFao1ST.mjs → comment-reaction-Ckn6vCmB.mjs} +1 -1
- package/dist/{comments-DApFGMsP.mjs → comments-BDXsbL7z.mjs} +1 -1
- package/dist/{content-Bh4BDjv8.mjs → content-Cbl8HbIR.mjs} +2 -2
- package/dist/{content-refresh-CgutSUfO.mjs → content-refresh-BmkilU5M.mjs} +5 -5
- package/dist/{context-CK4ym2Sf.mjs → context-AJNd0tcG.mjs} +2 -2
- package/dist/{context-C5W3G18y.mjs → context-DT0tIsfw.mjs} +24 -13
- package/dist/{context-route-helpers-MASyGgWf.mjs → context-route-helpers-DhP--tTq.mjs} +2 -2
- package/dist/{dashboard-DQkVT7Ei.mjs → dashboard-YvDEYbS3.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-BnqRH-T9.mjs → device-flow-BKKeobcV.mjs} +5 -5
- package/dist/{enrich-DIFIFA8O.mjs → enrich-Ck9tfMqe.mjs} +1 -1
- package/dist/{error-CytFlgcd.mjs → error-BW9f_ynq.mjs} +16 -2
- package/dist/{experimental-workflows-BMsUnIAw.mjs → experimental-workflows-CgO73K4e.mjs} +1 -1
- package/dist/{field-defs-cache-DRNdhBJv.mjs → field-defs-cache-CiXP3eO3.mjs} +4 -4
- package/dist/{fts-manager-Crzypjqu.mjs → fts-manager-Zo9uhGel.mjs} +1 -1
- package/dist/{hitl-requests-B4Vbcmaq.mjs → hitl-requests-Bee8Cjj8.mjs} +2 -2
- package/dist/{hitl-route-helpers-hEVzvP8l.mjs → hitl-route-helpers-DtHaKGgm.mjs} +5 -5
- package/dist/{import-Bh9biJfx.mjs → import-C-zxnT89.mjs} +7 -7
- package/dist/{index-D4y6NGiy.d.mts → index-DybFmYtZ.d.mts} +79 -3
- package/dist/index.d.mts +15 -17
- package/dist/index.mjs +83 -78
- package/dist/integration-credentials-D3ZneN0L.mjs +49 -0
- package/dist/{jsonld-Dq0gsnOH.d.mts → jsonld-CoTa8I1a.d.mts} +2 -2
- package/dist/{load-DmYeniXl.mjs → load-Cuiyh8LT.mjs} +1 -1
- package/dist/{loader-CjWqjweO.mjs → loader-WHf22FwU.mjs} +2 -2
- package/dist/{manifest-schema-BxVPYMJR.mjs → manifest-schema-DKa3ZaJL.mjs} +6 -2
- package/dist/{mcp-reviewed-executor-TwVbMzG6.mjs → mcp-reviewed-executor-DnlF7mIL.mjs} +6 -3
- package/dist/media/image-endpoint.mjs +1 -1
- package/dist/media/index.d.mts +1 -1
- package/dist/media/index.mjs +2 -2
- package/dist/media/local-runtime.d.mts +10 -11
- package/dist/media/local-runtime.mjs +2 -2
- package/dist/{media-DMj0grzC.mjs → media-B4m-cnmj.mjs} +1 -1
- package/dist/{media-allowlist-BlVCSzHx.mjs → media-allowlist-BQyIBPzd.mjs} +1 -1
- package/dist/{menus-TaW1gKnk.mjs → menus-LYALU2Mf.mjs} +2 -2
- package/dist/{menus-xvsnVZXw.mjs → menus-oYfViqfE.mjs} +6 -6
- package/dist/{oauth-authorization-DiaGvRVz.mjs → oauth-authorization-CX7aa8Ph.mjs} +5 -5
- package/dist/{oauth-clients-Dl9E8dEM.mjs → oauth-clients-D9Gg0WjF.mjs} +2 -2
- package/dist/object-cache/memory.d.mts +1 -1
- package/dist/output-13u4dvu-.mjs +68 -0
- package/dist/page/index.d.mts +9 -3
- package/dist/page/index.mjs +1 -1
- package/dist/{parse-CbymENaR.mjs → parse-B-Y84oJl.mjs} +1 -1
- package/dist/plugin-utils.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
- package/dist/plugins/adapt-sandbox-entry.mjs +3 -1
- package/dist/{plugins-BolVa-tl.mjs → plugins-B7-4Okii.mjs} +95 -10
- package/dist/portable-text-Ehqj3I_y.d.mts +45 -0
- package/dist/{preview-vSVg6fwG.mjs → preview-BMIReQGc.mjs} +2 -2
- package/dist/{provider-loader-MD8zAbnH.d.mts → provider-loader-BIbIiz0P.d.mts} +1 -1
- package/dist/{public-url-gsp3oUbu.d.mts → public-url-DYISdY_R.d.mts} +1 -1
- package/dist/publication-authorization-BVQ5rCAF.mjs +985 -0
- package/dist/{query-CfRCdaL3.mjs → query-C_m8sn-S.mjs} +13 -13
- package/dist/{query-jaAmw8E1.mjs → query-DNczixZr.mjs} +3 -3
- package/dist/{rate-limit-ZLdyWoZF.mjs → rate-limit-oUGexQO1.mjs} +2 -2
- package/dist/{redirect-BAjt4Z6b.mjs → redirect-DoDgOWIA.mjs} +2 -2
- package/dist/{redirects-BTdwpQtE.mjs → redirects-CrP6U4hZ.mjs} +4 -4
- package/dist/{redirects-CA-xylPG.mjs → redirects-E_B6hvuz.mjs} +18 -10
- package/dist/{registry-CtyVedcN.mjs → registry-SEJqFliS.mjs} +24 -10
- package/dist/{request-meta-CUypToDJ.mjs → request-meta-DHFIzWcf.mjs} +1 -1
- package/dist/review-payload-BysRWpxS.mjs +111 -0
- package/dist/{review-requests-DUyEmtmG.mjs → review-requests-CObSuTYU.mjs} +1 -1
- package/dist/review-requests-Cu9051_B.mjs +142 -0
- package/dist/review-route-helpers-Dp_7PH8r.mjs +41 -0
- package/dist/{runner-1tC2tIRV.d.mts → runner-Bcy5w0vj.d.mts} +1 -1
- package/dist/{runner-DB7CRfOF.mjs → runner-BfWbi9YY.mjs} +1166 -447
- package/dist/runtime.d.mts +9 -10
- package/dist/runtime.mjs +3 -3
- package/dist/schema-Dk_N31V4.mjs +8 -0
- package/dist/{search-DSaLgEFI.mjs → search-BXEQepxL.mjs} +3 -3
- package/dist/{secrets-CDZo2k8L.mjs → secrets-CpGpyGcO.mjs} +1 -1
- package/dist/{sections-PVVXHGfp.mjs → sections-DxvEF6Bj.mjs} +2 -2
- package/dist/seed/index.d.mts +2 -2
- package/dist/seed/index.mjs +19 -19
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-CQG3GCHQ.mjs → seo-D1RiaooQ.mjs} +1 -1
- package/dist/service-CY0aH6eI.mjs +347 -0
- package/dist/{service-DiN4ZuPp.mjs → service-QdG0YHws.mjs} +2 -2
- package/dist/{settings-i4VPP8bT.mjs → settings-Dje-PHXo.mjs} +2 -2
- package/dist/{settings-BbqgHWpU.mjs → settings-SVDAB7_W.mjs} +5 -5
- package/dist/{site-activity-Dy3FROs0.mjs → site-activity-BVK40wCy.mjs} +1 -1
- package/dist/{site-context-DQiL8Fl5.mjs → site-context-CzaEGizi.mjs} +565 -129
- package/dist/stable-hash-DshcXvRE.mjs +19 -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/store-CCfMD6nw.mjs +262 -0
- package/dist/{taxonomies-9s-v03H-.mjs → taxonomies-DuhGjBa8.mjs} +3 -3
- package/dist/{taxonomies-DRiixp_E.mjs → taxonomies-WVnFki0o.mjs} +6 -6
- package/dist/{taxonomy-Dvsw6BOs.mjs → taxonomy-CCo2plmV.mjs} +2 -2
- package/dist/{types-DU0bU2Wu.d.mts → types-BFeoAIHl.d.mts} +596 -2
- package/dist/{types-Dq1qT19x.mjs → types-Bshd_6wQ.mjs} +1 -1
- package/dist/{runtime-BOeiQsCv.d.mts → types-CJezJeNE.d.mts} +3561 -1355
- package/dist/{types-4garmdWa.mjs → types-CK0r-Xq4.mjs} +5 -2
- package/dist/{types-C_ly5eTp.d.mts → types-GtwhHAg8.d.mts} +1 -1
- package/dist/{types-DW_-sFyz.d.mts → types-ywmuDETA.d.mts} +2 -0
- package/dist/ui/server-runtime.d.mts +12 -14
- package/dist/ui/server-runtime.mjs +21 -21
- package/dist/{user-BIZPzCb9.mjs → user-Bcvr5ihC.mjs} +2 -2
- package/dist/{utils-CMDhr5Xd.mjs → utils-B7gemXz5.mjs} +1 -1
- package/dist/{validate-CZvb-BKB.d.mts → validate-YiX3rly5.d.mts} +59 -5
- package/dist/{validate-DNs0pTSc.mjs → validate-qKzI3BCv.mjs} +2 -2
- package/dist/version-DEAV9k58.mjs +6 -0
- package/dist/{widgets-f0ibZUIq.mjs → widgets-DyGcotPM.mjs} +3 -3
- package/dist/{wordpress-slugs-BhHJX8XE.mjs → wordpress-slugs-D_LfQCan.mjs} +1 -1
- package/dist/{zod-generator-B7TMjyFJ.mjs → zod-generator-Cr3SiHsc.mjs} +2 -2
- package/package.json +16 -6
- package/dist/hitl-Hw1RmWOq.mjs +0 -677
- package/dist/review-requests-C9Ff11Vq.mjs +0 -79
- package/dist/schema-DXdYj4R3.mjs +0 -8
- package/dist/types-C46EvNdc.d.mts +0 -56
- package/dist/types-C8XW6L19.d.mts +0 -1468
- package/dist/version-BTvfRGc6.mjs +0 -6
- /package/dist/{adapters-NVSs4UH7.d.mts → adapters-DnMDRQ4e.d.mts} +0 -0
- /package/dist/{api-tokens-2r7OWi_I.mjs → api-tokens-D4tcY8R6.mjs} +0 -0
- /package/dist/{challenge-store-Bjlepa2E.mjs → challenge-store-BMkL2kmt.mjs} +0 -0
- /package/dist/{components-Bclf98Be.mjs → components-D0w9MzQe.mjs} +0 -0
- /package/dist/{context-types-DqTo6C79.mjs → context-types-eBuMDAg-.mjs} +0 -0
- /package/dist/{cron-cKcNTix_.mjs → cron-D_c3WUPN.mjs} +0 -0
- /package/dist/{default--K40jqm0.mjs → default-BxoI3SoK.mjs} +0 -0
- /package/dist/{email-console-ChgKFO8-.mjs → email-console-BEMwuxhV.mjs} +0 -0
- /package/dist/{escape-Bd4P_xKg.mjs → escape-smSUOb7u.mjs} +0 -0
- /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
- /package/dist/{media-url-lEKSrpr9.mjs → media-url-B6d-yVI6.mjs} +0 -0
- /package/dist/{mime-CA7Lgovc.mjs → mime-C0vOHFm7.mjs} +0 -0
- /package/dist/{mode-C4CIyjtR.mjs → mode-DPC7segX.mjs} +0 -0
- /package/dist/{normalize-5ek_z7de.mjs → normalize-Cyt7JdF7.mjs} +0 -0
- /package/dist/{oauth-state-store-CNoXafF7.mjs → oauth-state-store-DPVzeoyY.mjs} +0 -0
- /package/dist/{oauth-user-lookup-Ygw4bNyt.mjs → oauth-user-lookup-3E5jlXrr.mjs} +0 -0
- /package/dist/{parser-C1nYd-81.mjs → parser-DX_c5iG3.mjs} +0 -0
- /package/dist/{passkey-config-BUwu8BA3.mjs → passkey-config-DE_0EGEP.mjs} +0 -0
- /package/dist/{patterns-BhAvqO0S.mjs → patterns-CoqlXUvk.mjs} +0 -0
- /package/dist/{placeholder-uvNRZBX9.d.mts → placeholder-C6ZjZcmJ.d.mts} +0 -0
- /package/dist/{portable-text-dA_UlJwW.mjs → portable-text-BASHceim.mjs} +0 -0
- /package/dist/{process-cache-7xgAO9JY.mjs → process-cache-CCDgti7j.mjs} +0 -0
- /package/dist/{provider-loader-D0w9dqjm.mjs → provider-loader-BeQcnPN1.mjs} +0 -0
- /package/dist/{public-url-BEz_sM9n.mjs → public-url-BA-7LKvQ.mjs} +0 -0
- /package/dist/{redirect-wphRBv4y.mjs → redirect-CZFAqHLr.mjs} +0 -0
- /package/dist/{request-cache-D9GQBxMP.mjs → request-cache-CBFjCwSt.mjs} +0 -0
- /package/dist/{resolve-Cb6Dbz-C.mjs → resolve-B6BpqwAR.mjs} +0 -0
- /package/dist/{seo-qa7Dn0jK.mjs → seo-BLszyJxd.mjs} +0 -0
- /package/dist/{seo-contributions-C1EnikHB.mjs → seo-contributions-Ci8_12_r.mjs} +0 -0
- /package/dist/{session-user-CAKImna3.mjs → session-user-BwliEFp0.mjs} +0 -0
- /package/dist/{setup-complete-B8fl-mjV.mjs → setup-complete-PvF8I7Oh.mjs} +0 -0
- /package/dist/{setup-nonce-CoyjILvW.mjs → setup-nonce-DkpYROqg.mjs} +0 -0
- /package/dist/{sidecar-client-C3mqXg4C.mjs → sidecar-client-dt5fv23q.mjs} +0 -0
- /package/dist/{site-url-BML3GQYm.mjs → site-url-DfYDZyWl.mjs} +0 -0
- /package/dist/{ssrf-DWe8jwAp.mjs → ssrf-BZHvtFEv.mjs} +0 -0
- /package/dist/{status-DANd8ERo.mjs → status-BN40hMpr.mjs} +0 -0
- /package/dist/{tokens-1RK1n6ED.mjs → tokens-DIzhPT80.mjs} +0 -0
- /package/dist/{transaction-C2EOMTJA.mjs → transaction-0LEAAy8R.mjs} +0 -0
- /package/dist/{transport-CcJu3Co8.d.mts → transport-BZ3aqdu7.d.mts} +0 -0
- /package/dist/{transport-BNmCqLu7.mjs → transport-C46KHLMP.mjs} +0 -0
- /package/dist/{trusted-proxy-DTXQ2IMv.mjs → trusted-proxy-czZuby6G.mjs} +0 -0
- /package/dist/{types-B3t5cxhU.mjs → types-B7TDDFMG.mjs} +0 -0
- /package/dist/{types-CDpH6MA4.d.mts → types-BsTXSvKG.d.mts} +0 -0
- /package/dist/{types-DF7ZuGGk.d.mts → types-CDcuRd4z.d.mts} +0 -0
- /package/dist/{types-Rc3gQqqw.d.mts → types-S9VIopdY.d.mts} +0 -0
- /package/dist/{types-POH8PQZh.d.mts → types-YxFz4lDr.d.mts} +0 -0
- /package/dist/{types-C5CVgwsV.mjs → types-gvNBqijt.mjs} +0 -0
- /package/dist/{url-CpyFDFpO.mjs → url-D282S1Zw.mjs} +0 -0
- /package/dist/{url-Cac7a9QZ.mjs → url-guoXQQcV.mjs} +0 -0
|
@@ -1,1468 +0,0 @@
|
|
|
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";
|
|
5
|
-
import { z } from "astro/zod";
|
|
6
|
-
import { Permission, RoleLevel } from "@dineway-ai/auth";
|
|
7
|
-
import "react/jsx-runtime";
|
|
8
|
-
import { AnySchema } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
9
|
-
import { JSX } from "astro/jsx-runtime";
|
|
10
|
-
|
|
11
|
-
//#region ../blocks/dist/validation-b1zbwCOE.d.ts
|
|
12
|
-
//#region src/types.d.ts
|
|
13
|
-
interface ConfirmDialog {
|
|
14
|
-
title: string;
|
|
15
|
-
text: string;
|
|
16
|
-
confirm: string;
|
|
17
|
-
deny: string;
|
|
18
|
-
style?: "danger";
|
|
19
|
-
}
|
|
20
|
-
interface ButtonElement {
|
|
21
|
-
type: "button";
|
|
22
|
-
action_id: string;
|
|
23
|
-
label: string;
|
|
24
|
-
style?: "primary" | "danger" | "secondary";
|
|
25
|
-
value?: unknown;
|
|
26
|
-
confirm?: ConfirmDialog;
|
|
27
|
-
}
|
|
28
|
-
interface TextInputElement {
|
|
29
|
-
type: "text_input";
|
|
30
|
-
action_id: string;
|
|
31
|
-
label: string;
|
|
32
|
-
placeholder?: string;
|
|
33
|
-
initial_value?: string;
|
|
34
|
-
multiline?: boolean;
|
|
35
|
-
}
|
|
36
|
-
interface NumberInputElement {
|
|
37
|
-
type: "number_input";
|
|
38
|
-
action_id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
initial_value?: number;
|
|
41
|
-
min?: number;
|
|
42
|
-
max?: number;
|
|
43
|
-
}
|
|
44
|
-
interface SelectElement {
|
|
45
|
-
type: "select";
|
|
46
|
-
action_id: string;
|
|
47
|
-
label: string;
|
|
48
|
-
options: Array<{
|
|
49
|
-
label: string;
|
|
50
|
-
value: string;
|
|
51
|
-
}>;
|
|
52
|
-
initial_value?: string;
|
|
53
|
-
/** Plugin route that returns `{ items: Array<{ id, name }> }` to populate options dynamically */
|
|
54
|
-
optionsRoute?: string;
|
|
55
|
-
}
|
|
56
|
-
interface ToggleElement {
|
|
57
|
-
type: "toggle";
|
|
58
|
-
action_id: string;
|
|
59
|
-
label: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
initial_value?: boolean;
|
|
62
|
-
}
|
|
63
|
-
interface SecretInputElement {
|
|
64
|
-
type: "secret_input";
|
|
65
|
-
action_id: string;
|
|
66
|
-
label: string;
|
|
67
|
-
placeholder?: string;
|
|
68
|
-
has_value?: boolean;
|
|
69
|
-
}
|
|
70
|
-
interface CheckboxElement {
|
|
71
|
-
type: "checkbox";
|
|
72
|
-
action_id: string;
|
|
73
|
-
label: string;
|
|
74
|
-
options: Array<{
|
|
75
|
-
label: string;
|
|
76
|
-
value: string;
|
|
77
|
-
}>;
|
|
78
|
-
initial_value?: string[];
|
|
79
|
-
}
|
|
80
|
-
interface DateInputElement {
|
|
81
|
-
type: "date_input";
|
|
82
|
-
action_id: string;
|
|
83
|
-
label: string;
|
|
84
|
-
initial_value?: string;
|
|
85
|
-
placeholder?: string;
|
|
86
|
-
}
|
|
87
|
-
interface ComboboxElement {
|
|
88
|
-
type: "combobox";
|
|
89
|
-
action_id: string;
|
|
90
|
-
label: string;
|
|
91
|
-
options: Array<{
|
|
92
|
-
label: string;
|
|
93
|
-
value: string;
|
|
94
|
-
}>;
|
|
95
|
-
initial_value?: string;
|
|
96
|
-
placeholder?: string;
|
|
97
|
-
}
|
|
98
|
-
interface RadioElement {
|
|
99
|
-
type: "radio";
|
|
100
|
-
action_id: string;
|
|
101
|
-
label: string;
|
|
102
|
-
options: Array<{
|
|
103
|
-
label: string;
|
|
104
|
-
value: string;
|
|
105
|
-
}>;
|
|
106
|
-
initial_value?: string;
|
|
107
|
-
}
|
|
108
|
-
interface MediaPickerElement {
|
|
109
|
-
type: "media_picker";
|
|
110
|
-
action_id: string;
|
|
111
|
-
label: string;
|
|
112
|
-
mime_type_filter?: string;
|
|
113
|
-
initial_value?: string;
|
|
114
|
-
placeholder?: string;
|
|
115
|
-
}
|
|
116
|
-
type RepeaterSubField = TextInputElement | NumberInputElement | SelectElement | ToggleElement;
|
|
117
|
-
interface RepeaterElement {
|
|
118
|
-
type: "repeater";
|
|
119
|
-
action_id: string;
|
|
120
|
-
label: string;
|
|
121
|
-
item_label?: string;
|
|
122
|
-
fields: RepeaterSubField[];
|
|
123
|
-
min_items?: number;
|
|
124
|
-
max_items?: number;
|
|
125
|
-
initial_value?: Array<Record<string, unknown>>;
|
|
126
|
-
}
|
|
127
|
-
type Element = ButtonElement | TextInputElement | NumberInputElement | SelectElement | ToggleElement | SecretInputElement | CheckboxElement | DateInputElement | ComboboxElement | RadioElement | MediaPickerElement | RepeaterElement;
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/plugins/types.d.ts
|
|
130
|
-
/**
|
|
131
|
-
* Plugin capabilities determine what APIs are available in context
|
|
132
|
-
*/
|
|
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
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Storage collection declaration in plugin definition
|
|
170
|
-
*/
|
|
171
|
-
interface StorageCollectionConfig {
|
|
172
|
-
/**
|
|
173
|
-
* Fields to index for querying.
|
|
174
|
-
* Each entry can be a single field name or an array for composite indexes.
|
|
175
|
-
*/
|
|
176
|
-
indexes: Array<string | string[]>;
|
|
177
|
-
/**
|
|
178
|
-
* Fields with unique constraints.
|
|
179
|
-
* Each entry can be a single field name or an array for composite unique indexes.
|
|
180
|
-
* Unique indexes are also queryable (no need to duplicate in `indexes`).
|
|
181
|
-
*/
|
|
182
|
-
uniqueIndexes?: Array<string | string[]>;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Plugin storage configuration
|
|
186
|
-
*/
|
|
187
|
-
type PluginStorageConfig = Record<string, StorageCollectionConfig>;
|
|
188
|
-
/**
|
|
189
|
-
* Query filter operators
|
|
190
|
-
*/
|
|
191
|
-
interface RangeFilter {
|
|
192
|
-
gt?: number | string;
|
|
193
|
-
gte?: number | string;
|
|
194
|
-
lt?: number | string;
|
|
195
|
-
lte?: number | string;
|
|
196
|
-
}
|
|
197
|
-
interface InFilter {
|
|
198
|
-
in: Array<string | number>;
|
|
199
|
-
}
|
|
200
|
-
interface StartsWithFilter {
|
|
201
|
-
startsWith: string;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Where clause value types
|
|
205
|
-
*/
|
|
206
|
-
type WhereValue = string | number | boolean | null | RangeFilter | InFilter | StartsWithFilter;
|
|
207
|
-
/**
|
|
208
|
-
* Where clause for storage queries
|
|
209
|
-
*/
|
|
210
|
-
type WhereClause = Record<string, WhereValue>;
|
|
211
|
-
/**
|
|
212
|
-
* Query options for storage.query()
|
|
213
|
-
*/
|
|
214
|
-
interface QueryOptions {
|
|
215
|
-
where?: WhereClause;
|
|
216
|
-
orderBy?: Record<string, "asc" | "desc">;
|
|
217
|
-
limit?: number;
|
|
218
|
-
cursor?: string;
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Paginated result (used by storage.query, content.list, media.list)
|
|
222
|
-
*/
|
|
223
|
-
interface PaginatedResult<T> {
|
|
224
|
-
items: T[];
|
|
225
|
-
cursor?: string;
|
|
226
|
-
hasMore: boolean;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Storage collection interface - the API exposed to plugins
|
|
230
|
-
* No async iterators - all operations return promises with pagination
|
|
231
|
-
*/
|
|
232
|
-
interface StorageCollection<T = unknown> {
|
|
233
|
-
get(id: string): Promise<T | null>;
|
|
234
|
-
put(id: string, data: T): Promise<void>;
|
|
235
|
-
delete(id: string): Promise<boolean>;
|
|
236
|
-
exists(id: string): Promise<boolean>;
|
|
237
|
-
getMany(ids: string[]): Promise<Map<string, T>>;
|
|
238
|
-
putMany(items: Array<{
|
|
239
|
-
id: string;
|
|
240
|
-
data: T;
|
|
241
|
-
}>): Promise<void>;
|
|
242
|
-
deleteMany(ids: string[]): Promise<number>;
|
|
243
|
-
query(options?: QueryOptions): Promise<PaginatedResult<{
|
|
244
|
-
id: string;
|
|
245
|
-
data: T;
|
|
246
|
-
}>>;
|
|
247
|
-
count(where?: WhereClause): Promise<number>;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Plugin storage context - typed based on declared collections
|
|
251
|
-
*/
|
|
252
|
-
type PluginStorage<T extends PluginStorageConfig> = { [K in keyof T]: StorageCollection };
|
|
253
|
-
/**
|
|
254
|
-
* KV store interface - unified replacement for settings + options
|
|
255
|
-
*
|
|
256
|
-
* Convention:
|
|
257
|
-
* - `settings:*` - User-configurable preferences (shown in admin UI)
|
|
258
|
-
* - `state:*` - Internal plugin state (not shown to users)
|
|
259
|
-
*/
|
|
260
|
-
interface KVAccess {
|
|
261
|
-
get<T>(key: string): Promise<T | null>;
|
|
262
|
-
set(key: string, value: unknown): Promise<void>;
|
|
263
|
-
delete(key: string): Promise<boolean>;
|
|
264
|
-
list(prefix?: string): Promise<Array<{
|
|
265
|
-
key: string;
|
|
266
|
-
value: unknown;
|
|
267
|
-
}>>;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* SEO metadata for a content item, as stored in the core SEO panel.
|
|
271
|
-
*
|
|
272
|
-
* Only present on items in collections with `has_seo = 1`. For collections
|
|
273
|
-
* without SEO enabled, `ContentItem.seo` is `undefined`.
|
|
274
|
-
*/
|
|
275
|
-
interface ContentItemSeo {
|
|
276
|
-
title: string | null;
|
|
277
|
-
description: string | null;
|
|
278
|
-
image: string | null;
|
|
279
|
-
canonical: string | null;
|
|
280
|
-
noIndex: boolean;
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* SEO input accepted by content write operations.
|
|
284
|
-
*
|
|
285
|
-
* All fields are optional — only fields that are present overwrite existing
|
|
286
|
-
* values. An empty object is treated as a no-op.
|
|
287
|
-
*/
|
|
288
|
-
interface ContentItemSeoInput {
|
|
289
|
-
title?: string | null;
|
|
290
|
-
description?: string | null;
|
|
291
|
-
image?: string | null;
|
|
292
|
-
canonical?: string | null;
|
|
293
|
-
noIndex?: boolean;
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Content item returned from content API
|
|
297
|
-
*/
|
|
298
|
-
interface ContentItem {
|
|
299
|
-
id: string;
|
|
300
|
-
type: string;
|
|
301
|
-
slug: string | null;
|
|
302
|
-
status: string;
|
|
303
|
-
data: Record<string, unknown>;
|
|
304
|
-
/**
|
|
305
|
-
* SEO metadata, populated when the collection has SEO enabled
|
|
306
|
-
* (`has_seo = 1`). `undefined` for non-SEO collections.
|
|
307
|
-
*/
|
|
308
|
-
seo?: ContentItemSeo;
|
|
309
|
-
createdAt: string;
|
|
310
|
-
updatedAt: string;
|
|
311
|
-
publishedAt: string | null;
|
|
312
|
-
locale: string | null;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Content filters supported by the plugin content API.
|
|
316
|
-
*/
|
|
317
|
-
interface ContentListWhere {
|
|
318
|
-
status?: string;
|
|
319
|
-
locale?: string;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Content list options
|
|
323
|
-
*/
|
|
324
|
-
interface ContentListOptions {
|
|
325
|
-
where?: ContentListWhere;
|
|
326
|
-
limit?: number;
|
|
327
|
-
cursor?: string;
|
|
328
|
-
orderBy?: Record<string, "asc" | "desc">;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Input accepted by `content.create` / `content.update`.
|
|
332
|
-
*
|
|
333
|
-
* Most entries are field slugs mapped to their values. The reserved `seo`
|
|
334
|
-
* key is extracted and routed to the core SEO panel (the `_dineway_seo`
|
|
335
|
-
* table), matching the shape accepted by the REST API. Passing `seo` for a
|
|
336
|
-
* collection that does not have SEO enabled throws a validation error.
|
|
337
|
-
*/
|
|
338
|
-
type ContentWriteInput = Record<string, unknown> & {
|
|
339
|
-
seo?: ContentItemSeoInput;
|
|
340
|
-
};
|
|
341
|
-
/**
|
|
342
|
-
* Content access interface - capability-gated
|
|
343
|
-
*/
|
|
344
|
-
interface ContentAccess {
|
|
345
|
-
get(collection: string, id: string): Promise<ContentItem | null>;
|
|
346
|
-
list(collection: string, options?: ContentListOptions): Promise<PaginatedResult<ContentItem>>;
|
|
347
|
-
create?(collection: string, data: ContentWriteInput): Promise<ContentItem>;
|
|
348
|
-
update?(collection: string, id: string, data: ContentWriteInput): Promise<ContentItem>;
|
|
349
|
-
delete?(collection: string, id: string): Promise<boolean>;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Full content access with write operations
|
|
353
|
-
*/
|
|
354
|
-
interface ContentAccessWithWrite extends ContentAccess {
|
|
355
|
-
create(collection: string, data: ContentWriteInput): Promise<ContentItem>;
|
|
356
|
-
update(collection: string, id: string, data: ContentWriteInput): Promise<ContentItem>;
|
|
357
|
-
delete(collection: string, id: string): Promise<boolean>;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Media item returned from media API
|
|
361
|
-
*/
|
|
362
|
-
interface MediaItem {
|
|
363
|
-
id: string;
|
|
364
|
-
filename: string;
|
|
365
|
-
mimeType: string;
|
|
366
|
-
size: number | null;
|
|
367
|
-
url: string;
|
|
368
|
-
createdAt: string;
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Media list options
|
|
372
|
-
*/
|
|
373
|
-
interface MediaListOptions {
|
|
374
|
-
limit?: number;
|
|
375
|
-
cursor?: string;
|
|
376
|
-
mimeType?: string;
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* Media access interface - capability-gated
|
|
380
|
-
*/
|
|
381
|
-
interface MediaAccess {
|
|
382
|
-
get(id: string): Promise<MediaItem | null>;
|
|
383
|
-
list(options?: MediaListOptions): Promise<PaginatedResult<MediaItem>>;
|
|
384
|
-
getUploadUrl?(filename: string, contentType: string): Promise<{
|
|
385
|
-
uploadUrl: string;
|
|
386
|
-
mediaId: string;
|
|
387
|
-
}>;
|
|
388
|
-
/**
|
|
389
|
-
* Upload media bytes directly. Preferred in sandboxed mode where
|
|
390
|
-
* plugins cannot make external requests to a presigned URL.
|
|
391
|
-
* Returns the created media item.
|
|
392
|
-
*/
|
|
393
|
-
upload?(filename: string, contentType: string, bytes: ArrayBuffer): Promise<{
|
|
394
|
-
mediaId: string;
|
|
395
|
-
storageKey: string;
|
|
396
|
-
url: string;
|
|
397
|
-
}>;
|
|
398
|
-
delete?(id: string): Promise<boolean>;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Full media access with write operations
|
|
402
|
-
*/
|
|
403
|
-
interface MediaAccessWithWrite extends MediaAccess {
|
|
404
|
-
getUploadUrl(filename: string, contentType: string): Promise<{
|
|
405
|
-
uploadUrl: string;
|
|
406
|
-
mediaId: string;
|
|
407
|
-
}>;
|
|
408
|
-
upload(filename: string, contentType: string, bytes: ArrayBuffer): Promise<{
|
|
409
|
-
mediaId: string;
|
|
410
|
-
storageKey: string;
|
|
411
|
-
url: string;
|
|
412
|
-
}>;
|
|
413
|
-
delete(id: string): Promise<boolean>;
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* HTTP client interface - requires network:request capability
|
|
417
|
-
*/
|
|
418
|
-
interface HttpAccess {
|
|
419
|
-
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Logger interface - always available
|
|
423
|
-
*/
|
|
424
|
-
interface LogAccess {
|
|
425
|
-
debug(message: string, data?: unknown): void;
|
|
426
|
-
info(message: string, data?: unknown): void;
|
|
427
|
-
warn(message: string, data?: unknown): void;
|
|
428
|
-
error(message: string, data?: unknown): void;
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Site information available to all plugins
|
|
432
|
-
*/
|
|
433
|
-
interface SiteInfo {
|
|
434
|
-
/** Site name (from settings) */
|
|
435
|
-
name: string;
|
|
436
|
-
/** Site URL (from settings or request) */
|
|
437
|
-
url: string;
|
|
438
|
-
/** Site locale (from settings, defaults to "en") */
|
|
439
|
-
locale: string;
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* Read-only user information exposed to plugins.
|
|
443
|
-
* Sensitive fields (password hashes, sessions, passkeys) are excluded.
|
|
444
|
-
*/
|
|
445
|
-
interface UserInfo {
|
|
446
|
-
id: string;
|
|
447
|
-
email: string;
|
|
448
|
-
name: string | null;
|
|
449
|
-
role: number;
|
|
450
|
-
createdAt: string;
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* User access interface - requires users:read capability
|
|
454
|
-
*/
|
|
455
|
-
interface UserAccess {
|
|
456
|
-
/** Get a user by ID */
|
|
457
|
-
get(id: string): Promise<UserInfo | null>;
|
|
458
|
-
/** Get a user by email */
|
|
459
|
-
getByEmail(email: string): Promise<UserInfo | null>;
|
|
460
|
-
/** List users with optional filters */
|
|
461
|
-
list(opts?: {
|
|
462
|
-
role?: number;
|
|
463
|
-
limit?: number;
|
|
464
|
-
cursor?: string;
|
|
465
|
-
}): Promise<{
|
|
466
|
-
items: UserInfo[];
|
|
467
|
-
nextCursor?: string;
|
|
468
|
-
}>;
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* The unified plugin context - same shape for all hooks and routes
|
|
472
|
-
*/
|
|
473
|
-
interface PluginContext<TStorage extends PluginStorageConfig = PluginStorageConfig> {
|
|
474
|
-
/** Plugin metadata */
|
|
475
|
-
plugin: {
|
|
476
|
-
id: string;
|
|
477
|
-
version: string;
|
|
478
|
-
};
|
|
479
|
-
/** Storage collections - only if plugin declares storage */
|
|
480
|
-
storage: PluginStorage<TStorage>;
|
|
481
|
-
/** Key-value store for config and state */
|
|
482
|
-
kv: KVAccess;
|
|
483
|
-
/** Content access - only if content:read or content:write capability */
|
|
484
|
-
content?: ContentAccess | ContentAccessWithWrite;
|
|
485
|
-
/** Media access - only if media:read or media:write capability */
|
|
486
|
-
media?: MediaAccess | MediaAccessWithWrite;
|
|
487
|
-
/** HTTP client - only if network:request capability */
|
|
488
|
-
http?: HttpAccess;
|
|
489
|
-
/** Logger - always available */
|
|
490
|
-
log: LogAccess;
|
|
491
|
-
/** Site information - always available */
|
|
492
|
-
site: SiteInfo;
|
|
493
|
-
/** URL helper - generates absolute URLs from paths. Always available. */
|
|
494
|
-
url(path: string): string;
|
|
495
|
-
/** User access - only if users:read capability */
|
|
496
|
-
users?: UserAccess;
|
|
497
|
-
/** Cron task scheduling - always available, scoped to plugin */
|
|
498
|
-
cron?: CronAccess;
|
|
499
|
-
/** Email access - only if email:send capability and a provider is configured */
|
|
500
|
-
email?: EmailAccess;
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Cron access interface �� always available on plugin context, scoped to plugin.
|
|
504
|
-
*/
|
|
505
|
-
interface CronAccess {
|
|
506
|
-
/** Schedule a recurring or one-shot task */
|
|
507
|
-
schedule(name: string, opts: {
|
|
508
|
-
schedule: string;
|
|
509
|
-
data?: Record<string, unknown>;
|
|
510
|
-
}): Promise<void>;
|
|
511
|
-
/** Cancel a scheduled task */
|
|
512
|
-
cancel(name: string): Promise<void>;
|
|
513
|
-
/** List this plugin's scheduled tasks */
|
|
514
|
-
list(): Promise<CronTaskInfo[]>;
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* Task info returned from CronAccess.list()
|
|
518
|
-
*/
|
|
519
|
-
interface CronTaskInfo {
|
|
520
|
-
name: string;
|
|
521
|
-
schedule: string;
|
|
522
|
-
nextRunAt: string;
|
|
523
|
-
lastRunAt: string | null;
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* Event passed to the `cron` hook handler
|
|
527
|
-
*/
|
|
528
|
-
interface CronEvent {
|
|
529
|
-
name: string;
|
|
530
|
-
data?: Record<string, unknown>;
|
|
531
|
-
scheduledAt: string;
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Cron hook handler type
|
|
535
|
-
*/
|
|
536
|
-
type CronHandler = (event: CronEvent, ctx: PluginContext) => Promise<void>;
|
|
537
|
-
/**
|
|
538
|
-
* Email access interface — requires `email:send` capability.
|
|
539
|
-
* Undefined when no `email:deliver` provider is configured.
|
|
540
|
-
*
|
|
541
|
-
* Related capabilities:
|
|
542
|
-
* - `email:send` — grants ctx.email (this interface)
|
|
543
|
-
* - `hooks.email-transport:register` — allows registering the `email:deliver` exclusive hook
|
|
544
|
-
* - `hooks.email-events:register` — allows registering `email:beforeSend` / `email:afterSend` hooks
|
|
545
|
-
*/
|
|
546
|
-
interface EmailAccess {
|
|
547
|
-
send(message: EmailMessage): Promise<void>;
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* Email message shape
|
|
551
|
-
*/
|
|
552
|
-
interface EmailMessage {
|
|
553
|
-
to: string;
|
|
554
|
-
subject: string;
|
|
555
|
-
text: string;
|
|
556
|
-
html?: string;
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* Event passed to email:beforeSend hooks (middleware — transform, validate, cancel)
|
|
560
|
-
*/
|
|
561
|
-
interface EmailBeforeSendEvent {
|
|
562
|
-
message: EmailMessage;
|
|
563
|
-
/** Where the email originated — "system" for auth emails, plugin ID for plugin emails */
|
|
564
|
-
source: string;
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Event passed to email:deliver hook (exclusive — exactly one provider delivers)
|
|
568
|
-
*/
|
|
569
|
-
interface EmailDeliverEvent {
|
|
570
|
-
message: EmailMessage;
|
|
571
|
-
source: string;
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Event passed to email:afterSend hooks (logging, analytics, fire-and-forget)
|
|
575
|
-
*/
|
|
576
|
-
interface EmailAfterSendEvent {
|
|
577
|
-
message: EmailMessage;
|
|
578
|
-
source: string;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* Handler type for email:beforeSend hooks.
|
|
582
|
-
* Returns modified message, or false to cancel delivery.
|
|
583
|
-
*/
|
|
584
|
-
type EmailBeforeSendHandler = (event: EmailBeforeSendEvent, ctx: PluginContext) => Promise<EmailMessage | false>;
|
|
585
|
-
/**
|
|
586
|
-
* Handler type for email:deliver hooks (exclusive provider).
|
|
587
|
-
*/
|
|
588
|
-
type EmailDeliverHandler = (event: EmailDeliverEvent, ctx: PluginContext) => Promise<void>;
|
|
589
|
-
/**
|
|
590
|
-
* Handler type for email:afterSend hooks (fire-and-forget).
|
|
591
|
-
*/
|
|
592
|
-
type EmailAfterSendHandler = (event: EmailAfterSendEvent, ctx: PluginContext) => Promise<void>;
|
|
593
|
-
/**
|
|
594
|
-
* Collection comment settings (read from _dineway_collections)
|
|
595
|
-
*/
|
|
596
|
-
interface CollectionCommentSettings {
|
|
597
|
-
commentsEnabled: boolean;
|
|
598
|
-
commentsModeration: "all" | "first_time" | "none";
|
|
599
|
-
commentsClosedAfterDays: number;
|
|
600
|
-
commentsAutoApproveUsers: boolean;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Event passed to comment:beforeCreate hooks (middleware — transform, enrich, reject)
|
|
604
|
-
*/
|
|
605
|
-
interface CommentBeforeCreateEvent {
|
|
606
|
-
comment: {
|
|
607
|
-
collection: string;
|
|
608
|
-
contentId: string;
|
|
609
|
-
parentId: string | null;
|
|
610
|
-
authorName: string;
|
|
611
|
-
authorEmail: string;
|
|
612
|
-
authorUserId: string | null;
|
|
613
|
-
body: string;
|
|
614
|
-
ipHash: string | null;
|
|
615
|
-
userAgent: string | null;
|
|
616
|
-
};
|
|
617
|
-
/** Metadata bag — plugins can attach signals for the moderator */
|
|
618
|
-
metadata: Record<string, unknown>;
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* Event passed to comment:moderate hook (exclusive — decides initial status)
|
|
622
|
-
*/
|
|
623
|
-
interface CommentModerateEvent {
|
|
624
|
-
comment: CommentBeforeCreateEvent["comment"];
|
|
625
|
-
metadata: Record<string, unknown>;
|
|
626
|
-
collectionSettings: CollectionCommentSettings;
|
|
627
|
-
/** Number of prior approved comments from this email address */
|
|
628
|
-
priorApprovedCount: number;
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* Moderation decision returned by the comment:moderate handler
|
|
632
|
-
*/
|
|
633
|
-
interface ModerationDecision {
|
|
634
|
-
status: "approved" | "pending" | "spam";
|
|
635
|
-
/** Optional reason for admin visibility */
|
|
636
|
-
reason?: string;
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* Stored comment shape (full record with id, status, timestamps)
|
|
640
|
-
*/
|
|
641
|
-
interface StoredComment {
|
|
642
|
-
id: string;
|
|
643
|
-
collection: string;
|
|
644
|
-
contentId: string;
|
|
645
|
-
parentId: string | null;
|
|
646
|
-
authorName: string;
|
|
647
|
-
authorEmail: string;
|
|
648
|
-
authorUserId: string | null;
|
|
649
|
-
body: string;
|
|
650
|
-
status: string;
|
|
651
|
-
moderationMetadata: Record<string, unknown> | null;
|
|
652
|
-
createdAt: string;
|
|
653
|
-
updatedAt: string;
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Event passed to comment:afterCreate hooks (fire-and-forget)
|
|
657
|
-
*/
|
|
658
|
-
interface CommentAfterCreateEvent {
|
|
659
|
-
comment: StoredComment;
|
|
660
|
-
metadata: Record<string, unknown>;
|
|
661
|
-
/** The content item the comment is on */
|
|
662
|
-
content: {
|
|
663
|
-
id: string;
|
|
664
|
-
collection: string;
|
|
665
|
-
slug: string;
|
|
666
|
-
title?: string;
|
|
667
|
-
};
|
|
668
|
-
/** The content author (for notifications) */
|
|
669
|
-
contentAuthor?: {
|
|
670
|
-
id: string;
|
|
671
|
-
name: string | null;
|
|
672
|
-
email: string;
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* Event passed to comment:afterModerate hooks (fire-and-forget, admin status change)
|
|
677
|
-
*/
|
|
678
|
-
interface CommentAfterModerateEvent {
|
|
679
|
-
comment: StoredComment;
|
|
680
|
-
previousStatus: string;
|
|
681
|
-
newStatus: string;
|
|
682
|
-
/** The admin who moderated */
|
|
683
|
-
moderator: {
|
|
684
|
-
id: string;
|
|
685
|
-
name: string | null;
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* Handler type for comment:beforeCreate hooks.
|
|
690
|
-
* Returns modified event, or false to reject the comment.
|
|
691
|
-
*/
|
|
692
|
-
type CommentBeforeCreateHandler = (event: CommentBeforeCreateEvent, ctx: PluginContext) => Promise<CommentBeforeCreateEvent | false | void>;
|
|
693
|
-
/**
|
|
694
|
-
* Handler type for comment:moderate hook (exclusive provider).
|
|
695
|
-
*/
|
|
696
|
-
type CommentModerateHandler = (event: CommentModerateEvent, ctx: PluginContext) => Promise<ModerationDecision>;
|
|
697
|
-
/**
|
|
698
|
-
* Handler type for comment:afterCreate hooks (fire-and-forget).
|
|
699
|
-
*/
|
|
700
|
-
type CommentAfterCreateHandler = (event: CommentAfterCreateEvent, ctx: PluginContext) => Promise<void>;
|
|
701
|
-
/**
|
|
702
|
-
* Handler type for comment:afterModerate hooks (fire-and-forget).
|
|
703
|
-
*/
|
|
704
|
-
type CommentAfterModerateHandler = (event: CommentAfterModerateEvent, ctx: PluginContext) => Promise<void>;
|
|
705
|
-
/**
|
|
706
|
-
* Hook configuration
|
|
707
|
-
*/
|
|
708
|
-
interface HookConfig<THandler> {
|
|
709
|
-
/** Explicit ordering - lower numbers run first (default: 100) */
|
|
710
|
-
priority?: number;
|
|
711
|
-
/** Max execution time in ms (default: 5000) */
|
|
712
|
-
timeout?: number;
|
|
713
|
-
/** Run after these plugins */
|
|
714
|
-
dependencies?: string[];
|
|
715
|
-
/** Error handling policy */
|
|
716
|
-
errorPolicy?: "continue" | "abort";
|
|
717
|
-
/**
|
|
718
|
-
* Mark this hook as exclusive — only one plugin can be the active provider.
|
|
719
|
-
* Exclusive hooks skip the priority pipeline and dispatch only to the
|
|
720
|
-
* admin-selected provider. Used for email:deliver, search, image optimization, etc.
|
|
721
|
-
*/
|
|
722
|
-
exclusive?: boolean;
|
|
723
|
-
/** The hook handler */
|
|
724
|
-
handler: THandler;
|
|
725
|
-
}
|
|
726
|
-
/**
|
|
727
|
-
* Content hook event
|
|
728
|
-
*/
|
|
729
|
-
interface ContentHookEvent {
|
|
730
|
-
content: Record<string, unknown>;
|
|
731
|
-
collection: string;
|
|
732
|
-
isNew: boolean;
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Content delete hook event
|
|
736
|
-
*/
|
|
737
|
-
interface ContentDeleteEvent {
|
|
738
|
-
id: string;
|
|
739
|
-
collection: string;
|
|
740
|
-
permanent: boolean;
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Content state change hook event.
|
|
744
|
-
*/
|
|
745
|
-
interface ContentStateChangeEvent {
|
|
746
|
-
content: Record<string, unknown>;
|
|
747
|
-
collection: string;
|
|
748
|
-
}
|
|
749
|
-
type ContentPublishStateChangeEvent = ContentStateChangeEvent;
|
|
750
|
-
type ContentRestoreStateChangeEvent = ContentStateChangeEvent;
|
|
751
|
-
type ContentScheduleStateChangeEvent = ContentStateChangeEvent;
|
|
752
|
-
/**
|
|
753
|
-
* Media hook event
|
|
754
|
-
*/
|
|
755
|
-
interface MediaUploadEvent {
|
|
756
|
-
file: {
|
|
757
|
-
name: string;
|
|
758
|
-
type: string;
|
|
759
|
-
size: number;
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
/**
|
|
763
|
-
* Media after upload event
|
|
764
|
-
*/
|
|
765
|
-
interface MediaAfterUploadEvent {
|
|
766
|
-
media: MediaItem;
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* Lifecycle hook event
|
|
770
|
-
*/
|
|
771
|
-
interface LifecycleEvent {}
|
|
772
|
-
/**
|
|
773
|
-
* Uninstall hook event
|
|
774
|
-
*/
|
|
775
|
-
interface UninstallEvent {
|
|
776
|
-
deleteData: boolean;
|
|
777
|
-
}
|
|
778
|
-
type ContentBeforeSaveHandler = (event: ContentHookEvent, ctx: PluginContext) => Promise<Record<string, unknown> | void>;
|
|
779
|
-
type ContentAfterSaveHandler = (event: ContentHookEvent, ctx: PluginContext) => Promise<void>;
|
|
780
|
-
type ContentBeforeDeleteHandler = (event: ContentDeleteEvent, ctx: PluginContext) => Promise<boolean | void>;
|
|
781
|
-
type ContentAfterDeleteHandler = (event: ContentDeleteEvent, ctx: PluginContext) => Promise<void>;
|
|
782
|
-
type ContentAfterPublishHandler = (event: ContentPublishStateChangeEvent, ctx: PluginContext) => Promise<void>;
|
|
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>;
|
|
787
|
-
type MediaBeforeUploadHandler = (event: MediaUploadEvent, ctx: PluginContext) => Promise<{
|
|
788
|
-
name: string;
|
|
789
|
-
type: string;
|
|
790
|
-
size: number;
|
|
791
|
-
} | void>;
|
|
792
|
-
type MediaAfterUploadHandler = (event: MediaAfterUploadEvent, ctx: PluginContext) => Promise<void>;
|
|
793
|
-
type LifecycleHandler = (event: LifecycleEvent, ctx: PluginContext) => Promise<void>;
|
|
794
|
-
type UninstallHandler = (event: UninstallEvent, ctx: PluginContext) => Promise<void>;
|
|
795
|
-
/** Placement targets for page fragment contributions */
|
|
796
|
-
type PagePlacement = "head" | "body:start" | "body:end";
|
|
797
|
-
/**
|
|
798
|
-
* A single breadcrumb trail item. Used by `PublicPageContext.breadcrumbs`
|
|
799
|
-
* so themes can publish breadcrumb trails that SEO plugins consume.
|
|
800
|
-
*/
|
|
801
|
-
interface BreadcrumbItem {
|
|
802
|
-
/** Display name for this crumb (e.g. "Home", "Blog", "My Post"). */
|
|
803
|
-
name: string;
|
|
804
|
-
/** Absolute or root-relative URL for this crumb. */
|
|
805
|
-
url: string;
|
|
806
|
-
}
|
|
807
|
-
/**
|
|
808
|
-
* Describes the page being rendered. Passed to page hooks so plugins
|
|
809
|
-
* can decide what to contribute without fetching content themselves.
|
|
810
|
-
*/
|
|
811
|
-
interface PublicPageContext {
|
|
812
|
-
url: string;
|
|
813
|
-
path: string;
|
|
814
|
-
locale: string | null;
|
|
815
|
-
kind: "content" | "custom";
|
|
816
|
-
pageType: string;
|
|
817
|
-
/** Full document title for the rendered page */
|
|
818
|
-
title: string | null;
|
|
819
|
-
/** Page-only title for OG/Twitter/JSON-LD headline output */
|
|
820
|
-
pageTitle?: string | null;
|
|
821
|
-
description: string | null;
|
|
822
|
-
canonical: string | null;
|
|
823
|
-
image: string | null;
|
|
824
|
-
content?: {
|
|
825
|
-
collection: string;
|
|
826
|
-
id: string;
|
|
827
|
-
slug: string | null;
|
|
828
|
-
};
|
|
829
|
-
/** SEO meta for base metadata generation in DinewayHead */
|
|
830
|
-
seo?: {
|
|
831
|
-
ogTitle?: string | null;
|
|
832
|
-
ogDescription?: string | null;
|
|
833
|
-
ogImage?: string | null;
|
|
834
|
-
robots?: string | null;
|
|
835
|
-
};
|
|
836
|
-
/** Article metadata for Open Graph article: tags */
|
|
837
|
-
articleMeta?: {
|
|
838
|
-
publishedTime?: string | null;
|
|
839
|
-
modifiedTime?: string | null;
|
|
840
|
-
author?: string | null;
|
|
841
|
-
};
|
|
842
|
-
/** Site name for structured data and og:site_name */
|
|
843
|
-
siteName?: string;
|
|
844
|
-
/**
|
|
845
|
-
* Optional breadcrumb trail for this page, root first. When set,
|
|
846
|
-
* SEO plugins should use this verbatim rather than deriving a trail
|
|
847
|
-
* from `path`. Themes typically populate this at the point they
|
|
848
|
-
* build the context (e.g. from a content hierarchy walk, taxonomy
|
|
849
|
-
* lookup, or per-`pageType` routing logic).
|
|
850
|
-
*
|
|
851
|
-
* Semantics for consumers:
|
|
852
|
-
* - `undefined` — theme has no opinion; consumer falls back to
|
|
853
|
-
* its own derivation.
|
|
854
|
-
* - `[]` — this page has no breadcrumbs (e.g. homepage); consumer
|
|
855
|
-
* should skip `BreadcrumbList` emission entirely.
|
|
856
|
-
* - Non-empty array — used verbatim for `BreadcrumbList` output.
|
|
857
|
-
*/
|
|
858
|
-
breadcrumbs?: BreadcrumbItem[];
|
|
859
|
-
/** Public-facing site URL (origin) for structured data */
|
|
860
|
-
siteUrl?: string;
|
|
861
|
-
}
|
|
862
|
-
interface PageMetadataEvent {
|
|
863
|
-
page: PublicPageContext;
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Allowed rel values for link contributions.
|
|
867
|
-
* This is a security-critical allowlist -- sandboxed plugins can only inject
|
|
868
|
-
* link tags with these rel values. Adding "stylesheet", "prefetch", "prerender"
|
|
869
|
-
* etc. would allow sandboxed plugins to inject external resources.
|
|
870
|
-
*/
|
|
871
|
-
type PageMetadataLinkRel = "canonical" | "alternate" | "author" | "license" | "nlweb" | "site.standard.document";
|
|
872
|
-
type PageMetadataContribution = {
|
|
873
|
-
kind: "meta";
|
|
874
|
-
name: string;
|
|
875
|
-
content: string;
|
|
876
|
-
key?: string;
|
|
877
|
-
} | {
|
|
878
|
-
kind: "property";
|
|
879
|
-
property: string;
|
|
880
|
-
content: string;
|
|
881
|
-
key?: string;
|
|
882
|
-
} | {
|
|
883
|
-
kind: "link";
|
|
884
|
-
rel: PageMetadataLinkRel;
|
|
885
|
-
href: string;
|
|
886
|
-
hreflang?: string;
|
|
887
|
-
key?: string;
|
|
888
|
-
} | {
|
|
889
|
-
kind: "jsonld";
|
|
890
|
-
id?: string;
|
|
891
|
-
graph: Record<string, unknown> | Array<Record<string, unknown>>;
|
|
892
|
-
};
|
|
893
|
-
type PageMetadataHandler = (event: PageMetadataEvent, ctx: PluginContext) => PageMetadataContribution | PageMetadataContribution[] | null | Promise<PageMetadataContribution | PageMetadataContribution[] | null>;
|
|
894
|
-
interface PageFragmentEvent {
|
|
895
|
-
page: PublicPageContext;
|
|
896
|
-
}
|
|
897
|
-
type PageFragmentContribution = {
|
|
898
|
-
kind: "external-script";
|
|
899
|
-
placement: PagePlacement;
|
|
900
|
-
src: string;
|
|
901
|
-
async?: boolean;
|
|
902
|
-
defer?: boolean;
|
|
903
|
-
attributes?: Record<string, string>;
|
|
904
|
-
key?: string;
|
|
905
|
-
} | {
|
|
906
|
-
kind: "inline-script";
|
|
907
|
-
placement: PagePlacement;
|
|
908
|
-
code: string;
|
|
909
|
-
attributes?: Record<string, string>;
|
|
910
|
-
key?: string;
|
|
911
|
-
} | {
|
|
912
|
-
kind: "html";
|
|
913
|
-
placement: PagePlacement;
|
|
914
|
-
html: string;
|
|
915
|
-
key?: string;
|
|
916
|
-
};
|
|
917
|
-
type PageFragmentHandler = (event: PageFragmentEvent, ctx: PluginContext) => PageFragmentContribution | PageFragmentContribution[] | null | Promise<PageFragmentContribution | PageFragmentContribution[] | null>;
|
|
918
|
-
/**
|
|
919
|
-
* Plugin hooks definition
|
|
920
|
-
*/
|
|
921
|
-
interface PluginHooks {
|
|
922
|
-
"plugin:install"?: HookConfig<LifecycleHandler> | LifecycleHandler;
|
|
923
|
-
"plugin:activate"?: HookConfig<LifecycleHandler> | LifecycleHandler;
|
|
924
|
-
"plugin:deactivate"?: HookConfig<LifecycleHandler> | LifecycleHandler;
|
|
925
|
-
"plugin:uninstall"?: HookConfig<UninstallHandler> | UninstallHandler;
|
|
926
|
-
"content:beforeSave"?: HookConfig<ContentBeforeSaveHandler> | ContentBeforeSaveHandler;
|
|
927
|
-
"content:afterSave"?: HookConfig<ContentAfterSaveHandler> | ContentAfterSaveHandler;
|
|
928
|
-
"content:beforeDelete"?: HookConfig<ContentBeforeDeleteHandler> | ContentBeforeDeleteHandler;
|
|
929
|
-
"content:afterDelete"?: HookConfig<ContentAfterDeleteHandler> | ContentAfterDeleteHandler;
|
|
930
|
-
"content:afterPublish"?: HookConfig<ContentAfterPublishHandler> | ContentAfterPublishHandler;
|
|
931
|
-
"content:afterUnpublish"?: HookConfig<ContentAfterUnpublishHandler> | ContentAfterUnpublishHandler;
|
|
932
|
-
"content:afterRestore"?: HookConfig<ContentAfterRestoreHandler> | ContentAfterRestoreHandler;
|
|
933
|
-
"content:afterSchedule"?: HookConfig<ContentAfterScheduleHandler> | ContentAfterScheduleHandler;
|
|
934
|
-
"content:afterUnschedule"?: HookConfig<ContentAfterUnscheduleHandler> | ContentAfterUnscheduleHandler;
|
|
935
|
-
"media:beforeUpload"?: HookConfig<MediaBeforeUploadHandler> | MediaBeforeUploadHandler;
|
|
936
|
-
"media:afterUpload"?: HookConfig<MediaAfterUploadHandler> | MediaAfterUploadHandler;
|
|
937
|
-
cron?: HookConfig<CronHandler> | CronHandler;
|
|
938
|
-
"email:beforeSend"?: HookConfig<EmailBeforeSendHandler> | EmailBeforeSendHandler;
|
|
939
|
-
"email:deliver"?: HookConfig<EmailDeliverHandler> | EmailDeliverHandler;
|
|
940
|
-
"email:afterSend"?: HookConfig<EmailAfterSendHandler> | EmailAfterSendHandler;
|
|
941
|
-
"comment:beforeCreate"?: HookConfig<CommentBeforeCreateHandler> | CommentBeforeCreateHandler;
|
|
942
|
-
"comment:moderate"?: HookConfig<CommentModerateHandler> | CommentModerateHandler;
|
|
943
|
-
"comment:afterCreate"?: HookConfig<CommentAfterCreateHandler> | CommentAfterCreateHandler;
|
|
944
|
-
"comment:afterModerate"?: HookConfig<CommentAfterModerateHandler> | CommentAfterModerateHandler;
|
|
945
|
-
"page:metadata"?: HookConfig<PageMetadataHandler> | PageMetadataHandler;
|
|
946
|
-
"page:fragments"?: HookConfig<PageFragmentHandler> | PageFragmentHandler;
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* Hook names
|
|
950
|
-
*/
|
|
951
|
-
type HookName = keyof PluginHooks;
|
|
952
|
-
/**
|
|
953
|
-
* Hook metadata entry in a plugin manifest.
|
|
954
|
-
* Replaces the plain hook name string with structured metadata.
|
|
955
|
-
*/
|
|
956
|
-
interface ManifestHookEntry {
|
|
957
|
-
name: string;
|
|
958
|
-
exclusive?: boolean;
|
|
959
|
-
priority?: number;
|
|
960
|
-
timeout?: number;
|
|
961
|
-
}
|
|
962
|
-
/**
|
|
963
|
-
* Route metadata entry in a plugin manifest.
|
|
964
|
-
* Replaces the plain route name string with structured metadata.
|
|
965
|
-
*/
|
|
966
|
-
interface ManifestRouteEntry {
|
|
967
|
-
name: string;
|
|
968
|
-
public?: boolean;
|
|
969
|
-
}
|
|
970
|
-
/**
|
|
971
|
-
* Resolved hook with normalized config
|
|
972
|
-
*/
|
|
973
|
-
interface ResolvedHook<THandler> {
|
|
974
|
-
priority: number;
|
|
975
|
-
timeout: number;
|
|
976
|
-
dependencies: string[];
|
|
977
|
-
errorPolicy: "continue" | "abort";
|
|
978
|
-
/** Whether this hook is exclusive (provider pattern) */
|
|
979
|
-
exclusive: boolean;
|
|
980
|
-
handler: THandler;
|
|
981
|
-
pluginId: string;
|
|
982
|
-
}
|
|
983
|
-
/**
|
|
984
|
-
* Geographic location information derived from the request.
|
|
985
|
-
* Available when the host runtime provides geographic request metadata
|
|
986
|
-
* (for example via a `request.cf` object).
|
|
987
|
-
*/
|
|
988
|
-
interface GeoInfo {
|
|
989
|
-
country: string | null;
|
|
990
|
-
region: string | null;
|
|
991
|
-
city: string | null;
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
* Normalized request metadata available to plugin route handlers.
|
|
995
|
-
* Extracted from request headers and platform-specific properties.
|
|
996
|
-
*/
|
|
997
|
-
interface RequestMeta {
|
|
998
|
-
ip: string | null;
|
|
999
|
-
userAgent: string | null;
|
|
1000
|
-
referer: string | null;
|
|
1001
|
-
geo: GeoInfo | null;
|
|
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>;
|
|
1044
|
-
/**
|
|
1045
|
-
* Route handler context extends plugin context with request-specific data
|
|
1046
|
-
*/
|
|
1047
|
-
interface RouteContext<TInput = unknown> extends PluginContext {
|
|
1048
|
-
/** Validated input from request body */
|
|
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;
|
|
1056
|
-
/** Original request */
|
|
1057
|
-
request: Request;
|
|
1058
|
-
/** Normalized request metadata (IP, user agent, geo) */
|
|
1059
|
-
requestMeta: RequestMeta;
|
|
1060
|
-
}
|
|
1061
|
-
/**
|
|
1062
|
-
* Route definition
|
|
1063
|
-
*/
|
|
1064
|
-
interface PluginRoute<TInput = unknown> {
|
|
1065
|
-
/** Restrict trusted route invocation to these HTTP methods. Omit for legacy all-method behavior. */
|
|
1066
|
-
methods?: readonly PluginRouteMethod[];
|
|
1067
|
-
/** Zod schema for input validation */
|
|
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>;
|
|
1079
|
-
/**
|
|
1080
|
-
* Mark this route as publicly accessible (no authentication required).
|
|
1081
|
-
* Public routes skip session/token auth and CSRF checks.
|
|
1082
|
-
*/
|
|
1083
|
-
public?: boolean;
|
|
1084
|
-
/** Route handler */
|
|
1085
|
-
handler: (ctx: RouteContext<TInput>) => Promise<unknown>;
|
|
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
|
-
}
|
|
1194
|
-
/**
|
|
1195
|
-
* Admin page definition
|
|
1196
|
-
*/
|
|
1197
|
-
interface PluginAdminPage {
|
|
1198
|
-
path: string;
|
|
1199
|
-
label: string;
|
|
1200
|
-
icon?: string;
|
|
1201
|
-
}
|
|
1202
|
-
/**
|
|
1203
|
-
* Dashboard widget definition
|
|
1204
|
-
*/
|
|
1205
|
-
interface PluginDashboardWidget {
|
|
1206
|
-
id: string;
|
|
1207
|
-
size?: "full" | "half" | "third";
|
|
1208
|
-
title?: string;
|
|
1209
|
-
}
|
|
1210
|
-
/**
|
|
1211
|
-
* Settings field types (for admin UI generation)
|
|
1212
|
-
*/
|
|
1213
|
-
type SettingFieldType = "string" | "number" | "boolean" | "select" | "secret" | "url" | "email";
|
|
1214
|
-
interface BaseSettingField {
|
|
1215
|
-
type: SettingFieldType;
|
|
1216
|
-
label: string;
|
|
1217
|
-
description?: string;
|
|
1218
|
-
}
|
|
1219
|
-
interface StringSettingField extends BaseSettingField {
|
|
1220
|
-
type: "string";
|
|
1221
|
-
default?: string;
|
|
1222
|
-
multiline?: boolean;
|
|
1223
|
-
}
|
|
1224
|
-
interface NumberSettingField extends BaseSettingField {
|
|
1225
|
-
type: "number";
|
|
1226
|
-
default?: number;
|
|
1227
|
-
min?: number;
|
|
1228
|
-
max?: number;
|
|
1229
|
-
}
|
|
1230
|
-
interface BooleanSettingField extends BaseSettingField {
|
|
1231
|
-
type: "boolean";
|
|
1232
|
-
default?: boolean;
|
|
1233
|
-
}
|
|
1234
|
-
interface SelectSettingField extends BaseSettingField {
|
|
1235
|
-
type: "select";
|
|
1236
|
-
options: Array<{
|
|
1237
|
-
value: string;
|
|
1238
|
-
label: string;
|
|
1239
|
-
}>;
|
|
1240
|
-
default?: string;
|
|
1241
|
-
}
|
|
1242
|
-
interface SecretSettingField extends BaseSettingField {
|
|
1243
|
-
type: "secret";
|
|
1244
|
-
}
|
|
1245
|
-
interface UrlSettingField extends BaseSettingField {
|
|
1246
|
-
type: "url";
|
|
1247
|
-
default?: string;
|
|
1248
|
-
placeholder?: string;
|
|
1249
|
-
}
|
|
1250
|
-
interface EmailSettingField extends BaseSettingField {
|
|
1251
|
-
type: "email";
|
|
1252
|
-
default?: string;
|
|
1253
|
-
placeholder?: string;
|
|
1254
|
-
}
|
|
1255
|
-
type SettingField = StringSettingField | NumberSettingField | BooleanSettingField | SelectSettingField | SecretSettingField | UrlSettingField | EmailSettingField;
|
|
1256
|
-
/**
|
|
1257
|
-
* Block Kit element for block editing fields.
|
|
1258
|
-
* This is the `Element` discriminated union from `@dineway-ai/blocks`.
|
|
1259
|
-
* Plugin authors should use `@dineway-ai/blocks` builder functions to create these.
|
|
1260
|
-
*/
|
|
1261
|
-
type PortableTextBlockField = Element;
|
|
1262
|
-
/**
|
|
1263
|
-
* Configuration for a Portable Text block type contributed by a plugin
|
|
1264
|
-
*/
|
|
1265
|
-
interface PortableTextBlockConfig {
|
|
1266
|
-
/** Block type name (must match the `_type` in Portable Text) */
|
|
1267
|
-
type: string;
|
|
1268
|
-
/** Human-readable label shown in slash commands and modals */
|
|
1269
|
-
label: string;
|
|
1270
|
-
/** Icon key (e.g., "video", "code", "link", "link-external") */
|
|
1271
|
-
icon?: string;
|
|
1272
|
-
/** Description shown in slash command menu */
|
|
1273
|
-
description?: string;
|
|
1274
|
-
/** Placeholder text for the URL input */
|
|
1275
|
-
placeholder?: string;
|
|
1276
|
-
/** Block Kit form fields for the editing UI. If declared, replaces the simple URL input. */
|
|
1277
|
-
fields?: PortableTextBlockField[];
|
|
1278
|
-
/**
|
|
1279
|
-
* Optional display category in the slash menu. Defaults to "Embeds".
|
|
1280
|
-
*
|
|
1281
|
-
* Plugin authors should pick a meaningful category that reflects what the
|
|
1282
|
-
* block actually is, for example "Sections", "Marketing", "Media",
|
|
1283
|
-
* "Embeds", or "Layout".
|
|
1284
|
-
*/
|
|
1285
|
-
category?: string;
|
|
1286
|
-
}
|
|
1287
|
-
/**
|
|
1288
|
-
* Configuration for a field widget type contributed by a plugin.
|
|
1289
|
-
* A field widget provides a custom editing UI for a schema field.
|
|
1290
|
-
* The field references the widget via `widget: "pluginId:widgetName"`.
|
|
1291
|
-
*/
|
|
1292
|
-
interface FieldWidgetConfig {
|
|
1293
|
-
/** Widget name (without plugin ID prefix) */
|
|
1294
|
-
name: string;
|
|
1295
|
-
/** Human-readable label for the admin UI */
|
|
1296
|
-
label: string;
|
|
1297
|
-
/** Which field types this widget can edit (e.g., ["json", "string"]) */
|
|
1298
|
-
fieldTypes: FieldType[];
|
|
1299
|
-
/** Block Kit elements for sandboxed rendering. Omit for trusted plugins using React. */
|
|
1300
|
-
elements?: Element[];
|
|
1301
|
-
}
|
|
1302
|
-
/**
|
|
1303
|
-
* Admin configuration
|
|
1304
|
-
*/
|
|
1305
|
-
interface PluginAdminConfig {
|
|
1306
|
-
/** Module specifier for admin UI exports (e.g., "@dineway-ai/plugin-audit-log/admin") */
|
|
1307
|
-
entry?: string;
|
|
1308
|
-
/** Settings schema for auto-generated UI */
|
|
1309
|
-
settingsSchema?: Record<string, SettingField>;
|
|
1310
|
-
/** Admin pages */
|
|
1311
|
-
pages?: PluginAdminPage[];
|
|
1312
|
-
/** Dashboard widgets */
|
|
1313
|
-
widgets?: PluginDashboardWidget[];
|
|
1314
|
-
/** Portable Text block types this plugin provides */
|
|
1315
|
-
portableTextBlocks?: PortableTextBlockConfig[];
|
|
1316
|
-
/** Field widget types this plugin provides */
|
|
1317
|
-
fieldWidgets?: FieldWidgetConfig[];
|
|
1318
|
-
}
|
|
1319
|
-
/**
|
|
1320
|
-
* Plugin definition - input to definePlugin()
|
|
1321
|
-
*/
|
|
1322
|
-
interface PluginDefinition<TStorage extends PluginStorageConfig = PluginStorageConfig> {
|
|
1323
|
-
/** Unique plugin identifier */
|
|
1324
|
-
id: string;
|
|
1325
|
-
/** Plugin version (semver) */
|
|
1326
|
-
version: string;
|
|
1327
|
-
/** Declared capabilities */
|
|
1328
|
-
capabilities?: PluginCapability[];
|
|
1329
|
-
/** Allowed hosts for network:request (wildcards supported: *.example.com) */
|
|
1330
|
-
allowedHosts?: string[];
|
|
1331
|
-
/** Storage collections with indexes */
|
|
1332
|
-
storage?: TStorage;
|
|
1333
|
-
/** Hooks */
|
|
1334
|
-
hooks?: PluginHooks;
|
|
1335
|
-
/** API routes */
|
|
1336
|
-
routes?: Record<string, PluginRoute>;
|
|
1337
|
-
/** Native first-party MCP tools and read-only resources. */
|
|
1338
|
-
mcp?: PluginMcpConfig;
|
|
1339
|
-
/** Admin UI configuration */
|
|
1340
|
-
admin?: PluginAdminConfig;
|
|
1341
|
-
}
|
|
1342
|
-
/**
|
|
1343
|
-
* Resolved plugin - after definePlugin() processing
|
|
1344
|
-
*/
|
|
1345
|
-
interface ResolvedPlugin<TStorage extends PluginStorageConfig = PluginStorageConfig> {
|
|
1346
|
-
id: string;
|
|
1347
|
-
version: string;
|
|
1348
|
-
capabilities: PluginCapability[];
|
|
1349
|
-
allowedHosts: string[];
|
|
1350
|
-
storage: TStorage;
|
|
1351
|
-
hooks: ResolvedPluginHooks;
|
|
1352
|
-
routes: Record<string, PluginRoute>;
|
|
1353
|
-
mcp: ResolvedPluginMcpConfig;
|
|
1354
|
-
admin: PluginAdminConfig;
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* Resolved hooks with normalized config
|
|
1358
|
-
*/
|
|
1359
|
-
interface ResolvedPluginHooks {
|
|
1360
|
-
"plugin:install"?: ResolvedHook<LifecycleHandler>;
|
|
1361
|
-
"plugin:activate"?: ResolvedHook<LifecycleHandler>;
|
|
1362
|
-
"plugin:deactivate"?: ResolvedHook<LifecycleHandler>;
|
|
1363
|
-
"plugin:uninstall"?: ResolvedHook<UninstallHandler>;
|
|
1364
|
-
"content:beforeSave"?: ResolvedHook<ContentBeforeSaveHandler>;
|
|
1365
|
-
"content:afterSave"?: ResolvedHook<ContentAfterSaveHandler>;
|
|
1366
|
-
"content:beforeDelete"?: ResolvedHook<ContentBeforeDeleteHandler>;
|
|
1367
|
-
"content:afterDelete"?: ResolvedHook<ContentAfterDeleteHandler>;
|
|
1368
|
-
"content:afterPublish"?: ResolvedHook<ContentAfterPublishHandler>;
|
|
1369
|
-
"content:afterUnpublish"?: ResolvedHook<ContentAfterUnpublishHandler>;
|
|
1370
|
-
"content:afterRestore"?: ResolvedHook<ContentAfterRestoreHandler>;
|
|
1371
|
-
"content:afterSchedule"?: ResolvedHook<ContentAfterScheduleHandler>;
|
|
1372
|
-
"content:afterUnschedule"?: ResolvedHook<ContentAfterUnscheduleHandler>;
|
|
1373
|
-
"media:beforeUpload"?: ResolvedHook<MediaBeforeUploadHandler>;
|
|
1374
|
-
"media:afterUpload"?: ResolvedHook<MediaAfterUploadHandler>;
|
|
1375
|
-
cron?: ResolvedHook<CronHandler>;
|
|
1376
|
-
"email:beforeSend"?: ResolvedHook<EmailBeforeSendHandler>;
|
|
1377
|
-
"email:deliver"?: ResolvedHook<EmailDeliverHandler>;
|
|
1378
|
-
"email:afterSend"?: ResolvedHook<EmailAfterSendHandler>;
|
|
1379
|
-
"comment:beforeCreate"?: ResolvedHook<CommentBeforeCreateHandler>;
|
|
1380
|
-
"comment:moderate"?: ResolvedHook<CommentModerateHandler>;
|
|
1381
|
-
"comment:afterCreate"?: ResolvedHook<CommentAfterCreateHandler>;
|
|
1382
|
-
"comment:afterModerate"?: ResolvedHook<CommentAfterModerateHandler>;
|
|
1383
|
-
"page:metadata"?: ResolvedHook<PageMetadataHandler>;
|
|
1384
|
-
"page:fragments"?: ResolvedHook<PageFragmentHandler>;
|
|
1385
|
-
}
|
|
1386
|
-
/**
|
|
1387
|
-
* Standard plugin hook handler -- same as sandbox entry format.
|
|
1388
|
-
* Receives the event as the first argument and a PluginContext as the second.
|
|
1389
|
-
*
|
|
1390
|
-
* Plugin authors annotate their event parameters with specific types for IDE
|
|
1391
|
-
* support. At the type level, we accept any function with compatible arity.
|
|
1392
|
-
*/
|
|
1393
|
-
type StandardHookHandler = (...args: any[]) => Promise<any>;
|
|
1394
|
-
/**
|
|
1395
|
-
* Standard plugin hook entry -- either a bare handler or a config object.
|
|
1396
|
-
*/
|
|
1397
|
-
type StandardHookEntry = StandardHookHandler | {
|
|
1398
|
-
handler: StandardHookHandler;
|
|
1399
|
-
priority?: number;
|
|
1400
|
-
timeout?: number;
|
|
1401
|
-
dependencies?: string[];
|
|
1402
|
-
errorPolicy?: "continue" | "abort";
|
|
1403
|
-
exclusive?: boolean;
|
|
1404
|
-
};
|
|
1405
|
-
/**
|
|
1406
|
-
* Standard plugin route handler -- takes (routeCtx, pluginCtx) like sandbox entries.
|
|
1407
|
-
* The routeCtx contains input and request info; pluginCtx is the full plugin context.
|
|
1408
|
-
*
|
|
1409
|
-
* Uses `any` for routeCtx to allow plugins to access properties like
|
|
1410
|
-
* `routeCtx.request.url` without needing exact type matches across
|
|
1411
|
-
* trusted (Request object) and sandboxed (plain object) modes.
|
|
1412
|
-
*/
|
|
1413
|
-
type StandardRouteHandler = (routeCtx: any, ctx: PluginContext) => Promise<unknown>;
|
|
1414
|
-
/**
|
|
1415
|
-
* Standard plugin route entry -- either a config object with handler, or just a handler.
|
|
1416
|
-
*/
|
|
1417
|
-
interface StandardRouteEntry {
|
|
1418
|
-
handler: StandardRouteHandler;
|
|
1419
|
-
input?: unknown;
|
|
1420
|
-
public?: boolean;
|
|
1421
|
-
}
|
|
1422
|
-
/**
|
|
1423
|
-
* Standard plugin definition -- the sandbox entry format.
|
|
1424
|
-
* Used by standard plugins that work in both trusted and sandboxed modes.
|
|
1425
|
-
* No id/version/capabilities -- those come from the descriptor.
|
|
1426
|
-
*
|
|
1427
|
-
* This is the input to definePlugin() for standard-format plugins.
|
|
1428
|
-
*
|
|
1429
|
-
* The hooks and routes use permissive types (Record<string, any>) so that
|
|
1430
|
-
* plugin authors can annotate their handlers with specific event types
|
|
1431
|
-
* without type errors from strictFunctionTypes contravariance.
|
|
1432
|
-
*/
|
|
1433
|
-
interface StandardPluginDefinition {
|
|
1434
|
-
hooks?: Record<string, any>;
|
|
1435
|
-
routes?: Record<string, any>;
|
|
1436
|
-
}
|
|
1437
|
-
/**
|
|
1438
|
-
* Check if a value is a StandardPluginDefinition (has hooks/routes but no id/version).
|
|
1439
|
-
*/
|
|
1440
|
-
declare function isStandardPluginDefinition(value: unknown): value is StandardPluginDefinition;
|
|
1441
|
-
/**
|
|
1442
|
-
* What a plugin exports from its /admin entrypoint
|
|
1443
|
-
* Uses generic component type to avoid React dependency
|
|
1444
|
-
*/
|
|
1445
|
-
interface PluginAdminExports {
|
|
1446
|
-
widgets?: Record<string, JSX.Element>;
|
|
1447
|
-
pages?: Record<string, JSX.Element>;
|
|
1448
|
-
fields?: Record<string, JSX.Element>;
|
|
1449
|
-
}
|
|
1450
|
-
/**
|
|
1451
|
-
* Plugin manifest - the metadata portion of a plugin bundle
|
|
1452
|
-
* Used for sandboxed plugins loaded from marketplace
|
|
1453
|
-
*/
|
|
1454
|
-
interface PluginManifest {
|
|
1455
|
-
id: string;
|
|
1456
|
-
version: string;
|
|
1457
|
-
declaredAccess?: DeclaredAccess;
|
|
1458
|
-
capabilities: PluginCapability[];
|
|
1459
|
-
allowedHosts: string[];
|
|
1460
|
-
storage: PluginStorageConfig;
|
|
1461
|
-
/** Hook declarations — either plain name strings or structured objects */
|
|
1462
|
-
hooks: Array<ManifestHookEntry | HookName>;
|
|
1463
|
-
/** Route declarations — either plain name strings or structured objects */
|
|
1464
|
-
routes: Array<ManifestRouteEntry | string>;
|
|
1465
|
-
admin: PluginAdminConfig;
|
|
1466
|
-
}
|
|
1467
|
-
//#endregion
|
|
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 };
|