@sonicjs-cms/core 3.0.0-beta.23 → 3.0.0-beta.25
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/bin/db-reset.js +39 -22
- package/dist/admin-documents-form.template-JWV5GITD.js +6 -0
- package/dist/{admin-documents-form.template-55V2ZGWT.js.map → admin-documents-form.template-JWV5GITD.js.map} +1 -1
- package/dist/admin-documents-form.template-UWKGVAMW.cjs +19 -0
- package/dist/{admin-layout-catalyst.template-6UQGLCKI.js.map → admin-documents-form.template-UWKGVAMW.cjs.map} +1 -1
- package/dist/admin-layout-catalyst.template-MOQ3BBXA.cjs +21 -0
- package/dist/{admin-layout-catalyst.template-3XZXDGF7.cjs.map → admin-layout-catalyst.template-MOQ3BBXA.cjs.map} +1 -1
- package/dist/admin-layout-catalyst.template-WCYMQVTZ.js +7 -0
- package/dist/{admin-documents-form.template-YNAVMJCV.cjs.map → admin-layout-catalyst.template-WCYMQVTZ.js.map} +1 -1
- package/dist/{chunk-KS24NPPL.js → chunk-2D3A4X52.js} +21 -2
- package/dist/chunk-2D3A4X52.js.map +1 -0
- package/dist/{chunk-DIBCKCUE.js → chunk-2OXFMMA3.js} +14 -29
- package/dist/chunk-2OXFMMA3.js.map +1 -0
- package/dist/{chunk-SOZUG52O.js → chunk-3KGY4IBW.js} +3 -3
- package/dist/{chunk-SOZUG52O.js.map → chunk-3KGY4IBW.js.map} +1 -1
- package/dist/{chunk-CTYLCWMO.cjs → chunk-6OA77UM7.cjs} +802 -481
- package/dist/chunk-6OA77UM7.cjs.map +1 -0
- package/dist/{chunk-URIBTX27.js → chunk-73RTFFMX.js} +3 -3
- package/dist/{chunk-URIBTX27.js.map → chunk-73RTFFMX.js.map} +1 -1
- package/dist/{chunk-SK5CHFJP.js → chunk-7P5OCUPS.js} +467 -149
- package/dist/chunk-7P5OCUPS.js.map +1 -0
- package/dist/{chunk-3TMTYJAJ.js → chunk-BDQ55MWV.js} +18 -2
- package/dist/chunk-BDQ55MWV.js.map +1 -0
- package/dist/{chunk-C3ZQP5NW.cjs → chunk-BJ6NJL2E.cjs} +7 -12
- package/dist/chunk-BJ6NJL2E.cjs.map +1 -0
- package/dist/{chunk-2MIYYAO4.js → chunk-C54MH5UI.js} +5 -4
- package/dist/chunk-C54MH5UI.js.map +1 -0
- package/dist/{chunk-BBEKHLTW.cjs → chunk-CN3T3TDI.cjs} +9 -9
- package/dist/{chunk-BBEKHLTW.cjs.map → chunk-CN3T3TDI.cjs.map} +1 -1
- package/dist/{chunk-DPLJYTHE.js → chunk-CWIGQYRR.js} +7 -12
- package/dist/chunk-CWIGQYRR.js.map +1 -0
- package/dist/{chunk-4WMZGHIC.cjs → chunk-D6FWEYQE.cjs} +6 -5
- package/dist/chunk-D6FWEYQE.cjs.map +1 -0
- package/dist/{chunk-A46IRC5A.js → chunk-D7RLBBHE.js} +2 -2
- package/dist/{chunk-A46IRC5A.js.map → chunk-D7RLBBHE.js.map} +1 -1
- package/dist/{chunk-IXUHXTHW.cjs → chunk-DLTT7QZU.cjs} +17 -6
- package/dist/chunk-DLTT7QZU.cjs.map +1 -0
- package/dist/{chunk-BHND5PEV.js → chunk-E3TQG7AA.js} +3 -3
- package/dist/{chunk-BHND5PEV.js.map → chunk-E3TQG7AA.js.map} +1 -1
- package/dist/{chunk-IS54FPB7.cjs → chunk-E7E3NL3Y.cjs} +27 -42
- package/dist/chunk-E7E3NL3Y.cjs.map +1 -0
- package/dist/{chunk-XXRR54AB.js → chunk-F26HP3B6.js} +36 -5
- package/dist/chunk-F26HP3B6.js.map +1 -0
- package/dist/{chunk-QZGABF2M.js → chunk-FVAK4C6L.js} +17 -6
- package/dist/chunk-FVAK4C6L.js.map +1 -0
- package/dist/{chunk-BJROXF4N.js → chunk-HSDJDWLV.js} +19 -4
- package/dist/chunk-HSDJDWLV.js.map +1 -0
- package/dist/{chunk-RFBW5RRH.cjs → chunk-I7MIRRFJ.cjs} +43 -12
- package/dist/chunk-I7MIRRFJ.cjs.map +1 -0
- package/dist/{chunk-LTZ5WYOK.cjs → chunk-JCBDXEY2.cjs} +18 -2
- package/dist/chunk-JCBDXEY2.cjs.map +1 -0
- package/dist/{chunk-UYJQDDEE.cjs → chunk-MI2YXCK4.cjs} +14 -8
- package/dist/chunk-MI2YXCK4.cjs.map +1 -0
- package/dist/{chunk-VGHEKIJL.cjs → chunk-MOGK3U4A.cjs} +2 -2
- package/dist/{chunk-VGHEKIJL.cjs.map → chunk-MOGK3U4A.cjs.map} +1 -1
- package/dist/{chunk-E66UVONV.cjs → chunk-OUBUS74I.cjs} +24 -9
- package/dist/chunk-OUBUS74I.cjs.map +1 -0
- package/dist/{chunk-GMMCCIQO.cjs → chunk-RSBZITK3.cjs} +3 -3
- package/dist/{chunk-GMMCCIQO.cjs.map → chunk-RSBZITK3.cjs.map} +1 -1
- package/dist/{chunk-THFZSDIU.js → chunk-SXC4HPK6.js} +14 -8
- package/dist/chunk-SXC4HPK6.js.map +1 -0
- package/dist/{chunk-JMJM7DMM.cjs → chunk-TT3TQSCZ.cjs} +5 -5
- package/dist/{chunk-JMJM7DMM.cjs.map → chunk-TT3TQSCZ.cjs.map} +1 -1
- package/dist/{chunk-AT4ZQGEZ.cjs → chunk-YAURVGUK.cjs} +21 -2
- package/dist/chunk-YAURVGUK.cjs.map +1 -0
- package/dist/config-4TIHSNW6.js +6 -0
- package/dist/{config-6FB2BXMP.js.map → config-4TIHSNW6.js.map} +1 -1
- package/dist/{config-OCH7S4WK.cjs → config-XN2ETAJ3.cjs} +5 -5
- package/dist/{config-OCH7S4WK.cjs.map → config-XN2ETAJ3.cjs.map} +1 -1
- package/dist/{define-plugin-D_6D9vVZ.d.ts → define-plugin-DDe8a_bh.d.ts} +3 -0
- package/dist/{define-plugin-DMcvEy_C.d.cts → define-plugin-rjXmGOgu.d.cts} +3 -0
- package/dist/index.cjs +1220 -353
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -3
- package/dist/index.d.ts +38 -3
- package/dist/index.js +895 -30
- package/dist/index.js.map +1 -1
- package/dist/middleware.cjs +35 -35
- package/dist/middleware.d.cts +4 -1
- package/dist/middleware.d.ts +4 -1
- package/dist/middleware.js +6 -6
- package/dist/migrations-JAHMI5MK.js +4 -0
- package/dist/{migrations-XQ6EX6HX.js.map → migrations-JAHMI5MK.js.map} +1 -1
- package/dist/migrations-KU4V6T73.cjs +13 -0
- package/dist/{migrations-ZD7Y5NUC.cjs.map → migrations-KU4V6T73.cjs.map} +1 -1
- package/dist/plugins.cjs +40 -40
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +3 -3
- package/dist/rbac-AORZ6O3N.cjs +14 -0
- package/dist/{rbac-7QZ4JZ2E.cjs.map → rbac-AORZ6O3N.cjs.map} +1 -1
- package/dist/rbac-P44772FP.js +5 -0
- package/dist/{rbac-Y43IEQOP.js.map → rbac-P44772FP.js.map} +1 -1
- package/dist/routes.cjs +31 -31
- package/dist/routes.js +11 -11
- package/dist/services.cjs +18 -18
- package/dist/services.d.cts +1 -1
- package/dist/services.d.ts +1 -1
- package/dist/services.js +2 -2
- package/dist/{telemetry-Cku1ax74.d.cts → telemetry-QFlTv9f8.d.cts} +1 -1
- package/dist/{telemetry-Cku1ax74.d.ts → telemetry-QFlTv9f8.d.ts} +1 -1
- package/dist/templates.cjs +17 -17
- package/dist/templates.js +3 -3
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils.cjs +12 -12
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +5 -10
- package/dist/admin-documents-form.template-55V2ZGWT.js +0 -6
- package/dist/admin-documents-form.template-YNAVMJCV.cjs +0 -19
- package/dist/admin-layout-catalyst.template-3XZXDGF7.cjs +0 -21
- package/dist/admin-layout-catalyst.template-6UQGLCKI.js +0 -7
- package/dist/chunk-2MIYYAO4.js.map +0 -1
- package/dist/chunk-3TMTYJAJ.js.map +0 -1
- package/dist/chunk-4WMZGHIC.cjs.map +0 -1
- package/dist/chunk-AT4ZQGEZ.cjs.map +0 -1
- package/dist/chunk-BJROXF4N.js.map +0 -1
- package/dist/chunk-C3ZQP5NW.cjs.map +0 -1
- package/dist/chunk-CTYLCWMO.cjs.map +0 -1
- package/dist/chunk-DIBCKCUE.js.map +0 -1
- package/dist/chunk-DPLJYTHE.js.map +0 -1
- package/dist/chunk-E66UVONV.cjs.map +0 -1
- package/dist/chunk-IS54FPB7.cjs.map +0 -1
- package/dist/chunk-IXUHXTHW.cjs.map +0 -1
- package/dist/chunk-KS24NPPL.js.map +0 -1
- package/dist/chunk-LTZ5WYOK.cjs.map +0 -1
- package/dist/chunk-QZGABF2M.js.map +0 -1
- package/dist/chunk-RFBW5RRH.cjs.map +0 -1
- package/dist/chunk-SK5CHFJP.js.map +0 -1
- package/dist/chunk-THFZSDIU.js.map +0 -1
- package/dist/chunk-UYJQDDEE.cjs.map +0 -1
- package/dist/chunk-XXRR54AB.js.map +0 -1
- package/dist/config-6FB2BXMP.js +0 -6
- package/dist/migrations-XQ6EX6HX.js +0 -4
- package/dist/migrations-ZD7Y5NUC.cjs +0 -13
- package/dist/rbac-7QZ4JZ2E.cjs +0 -14
- package/dist/rbac-Y43IEQOP.js +0 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { B as Bindings, a as BootIsolateFn, b as SonicJSApp, S as SonicJSConfig, V as Variables, c as createSonicJSApp, s as setupCoreMiddleware, d as setupCoreRoutes } from './app-aj39TGHB.cjs';
|
|
2
|
-
import { o as DefinedPlugin } from './define-plugin-
|
|
3
|
-
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-
|
|
2
|
+
import { o as DefinedPlugin } from './define-plugin-rjXmGOgu.cjs';
|
|
3
|
+
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-rjXmGOgu.cjs';
|
|
4
4
|
import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { E as EmailProvider, N as NormalizedEmailMessage, t as SendResult } from './types-DT7XN5TX.cjs';
|
|
@@ -159,6 +159,14 @@ declare class RbacService {
|
|
|
159
159
|
getRolesForUser(userId: string): Promise<RbacRole[]>;
|
|
160
160
|
/** Grants attached to a set of role ids (from the embedded role grants). */
|
|
161
161
|
private grantsForRoleIds;
|
|
162
|
+
/**
|
|
163
|
+
* Does the role (matched by document slug OR data.name) have a grant for resource+verb?
|
|
164
|
+
* Matches the role principal id from the request context, which can be either the RBAC slug
|
|
165
|
+
* (e.g. 'role-public') or the legacy role name (e.g. 'public').
|
|
166
|
+
*/
|
|
167
|
+
isGrantedForRole(roleNameOrSlug: string, resource: string, verb: string): Promise<boolean>;
|
|
168
|
+
/** True if a role document exists for this id or name. Use to distinguish "no RBAC role → default allow" from "role exists but no grant → deny". */
|
|
169
|
+
hasRbacRole(idOrName: string): Promise<boolean>;
|
|
162
170
|
/** Does a single grant row satisfy the requested (resource, verb)? */
|
|
163
171
|
private grantMatches;
|
|
164
172
|
private strongestScope;
|
|
@@ -352,6 +360,7 @@ declare class DocumentRepository {
|
|
|
352
360
|
getById(id: string): Promise<Document | null>;
|
|
353
361
|
getCurrentDraft(rootId: string): Promise<Document | null>;
|
|
354
362
|
getPublished(rootId: string): Promise<Document | null>;
|
|
363
|
+
getBySlug(typeId: string, slug: string): Promise<Document | null>;
|
|
355
364
|
list(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
356
365
|
listPublished(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
357
366
|
listDrafts(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
@@ -709,6 +718,32 @@ declare function getUserProfileConfig(): UserProfileConfig | null;
|
|
|
709
718
|
declare const userProfilesPlugin: DefinedPlugin;
|
|
710
719
|
declare function createUserProfilesPlugin(): DefinedPlugin;
|
|
711
720
|
|
|
721
|
+
/**
|
|
722
|
+
* MCP plugin configuration.
|
|
723
|
+
*
|
|
724
|
+
* Config is supplied in code when the operator adds `mcpPlugin({...})` to the app's
|
|
725
|
+
* plugin register array — captured in a closure and resolved against the live
|
|
726
|
+
* CollectionRegistry on each request (so newly registered collections appear
|
|
727
|
+
* without a restart). All fields are optional with safe defaults.
|
|
728
|
+
*/
|
|
729
|
+
|
|
730
|
+
declare const mcpConfigSchema: z.ZodObject<{
|
|
731
|
+
expose: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
732
|
+
types: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
733
|
+
read: z.ZodDefault<z.ZodBoolean>;
|
|
734
|
+
write: z.ZodDefault<z.ZodBoolean>;
|
|
735
|
+
}, z.core.$strip>>>;
|
|
736
|
+
redactFields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
737
|
+
listLimit: z.ZodDefault<z.ZodNumber>;
|
|
738
|
+
}, z.core.$strip>;
|
|
739
|
+
type McpConfigInput = z.input<typeof mcpConfigSchema>;
|
|
740
|
+
type McpConfig = z.infer<typeof mcpConfigSchema>;
|
|
741
|
+
|
|
742
|
+
/** Build an MCP plugin instance bound to the given config. */
|
|
743
|
+
declare function mcpPlugin(options?: McpConfigInput): DefinedPlugin;
|
|
744
|
+
/** Alias matching the repo's `createXPlugin` convention. */
|
|
745
|
+
declare function createMcpPlugin(options?: McpConfigInput): DefinedPlugin;
|
|
746
|
+
|
|
712
747
|
/**
|
|
713
748
|
* @sonicjs/core - Main Entry Point
|
|
714
749
|
*
|
|
@@ -729,4 +764,4 @@ declare function createUserProfilesPlugin(): DefinedPlugin;
|
|
|
729
764
|
|
|
730
765
|
declare const VERSION: string;
|
|
731
766
|
|
|
732
|
-
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, DocumentRepository, DocumentsService, FieldType, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createHelloWorldPlugin, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, helloWorldPlugin, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|
|
767
|
+
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, DocumentRepository, DocumentsService, FieldType, type McpConfig, type McpConfigInput, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createHelloWorldPlugin, createMcpPlugin, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, helloWorldPlugin, mcpPlugin, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { B as Bindings, a as BootIsolateFn, b as SonicJSApp, S as SonicJSConfig, V as Variables, c as createSonicJSApp, s as setupCoreMiddleware, d as setupCoreRoutes } from './app-01M0dIwt.js';
|
|
2
|
-
import { o as DefinedPlugin } from './define-plugin-
|
|
3
|
-
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-
|
|
2
|
+
import { o as DefinedPlugin } from './define-plugin-DDe8a_bh.js';
|
|
3
|
+
export { B as BooleanField, e as ConfigSchema, f as ConfigSchemaField, h as CronContext, i as CronDeclaration, j as CronDispatchResult, k as CronTickEvent, l as CronablePlugin, H as HookSystemImpl, r as HookUtils, N as NumberField, P as ParsedField, v as PluginManagerClass, an as PluginMenuEntry, x as PluginRegistryImpl, y as PluginValidatorClass, z as PluginsRegistry, A as RegisterPluginsError, G as RegisterPluginsErrorReason, I as RegisterPluginsHostContext, J as RegisterablePlugin, K as RegistryEntry, ao as ResolvedPluginMenuEntry, L as ScopedHookSystemClass, O as SelectField, Q as SettingsFor, U as StringField, Y as applySchemaDefaults, _ as collectCronSchedules, $ as collectCrons, a2 as createScheduledHandler, a3 as definePlugin, a4 as dispatchCronTick, a5 as getHookSystem, ap as getPluginMenu, a6 as getTypedHooks, a8 as hasHookSystem, a9 as isDefinedPlugin, ae as parseConfigSchema, af as parseFormDataToSettings, ah as registerPlugins, ai as renderSchemaFields, aj as resetHookSystem, aq as resetPluginMenu, ar as resolvePluginMenuItems, ak as setHookSystem, as as setPluginMenu } from './define-plugin-DDe8a_bh.js';
|
|
4
4
|
import { D1Database as D1Database$1 } from '@cloudflare/workers-types';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { E as EmailProvider, N as NormalizedEmailMessage, t as SendResult } from './types-DT7XN5TX.js';
|
|
@@ -159,6 +159,14 @@ declare class RbacService {
|
|
|
159
159
|
getRolesForUser(userId: string): Promise<RbacRole[]>;
|
|
160
160
|
/** Grants attached to a set of role ids (from the embedded role grants). */
|
|
161
161
|
private grantsForRoleIds;
|
|
162
|
+
/**
|
|
163
|
+
* Does the role (matched by document slug OR data.name) have a grant for resource+verb?
|
|
164
|
+
* Matches the role principal id from the request context, which can be either the RBAC slug
|
|
165
|
+
* (e.g. 'role-public') or the legacy role name (e.g. 'public').
|
|
166
|
+
*/
|
|
167
|
+
isGrantedForRole(roleNameOrSlug: string, resource: string, verb: string): Promise<boolean>;
|
|
168
|
+
/** True if a role document exists for this id or name. Use to distinguish "no RBAC role → default allow" from "role exists but no grant → deny". */
|
|
169
|
+
hasRbacRole(idOrName: string): Promise<boolean>;
|
|
162
170
|
/** Does a single grant row satisfy the requested (resource, verb)? */
|
|
163
171
|
private grantMatches;
|
|
164
172
|
private strongestScope;
|
|
@@ -352,6 +360,7 @@ declare class DocumentRepository {
|
|
|
352
360
|
getById(id: string): Promise<Document | null>;
|
|
353
361
|
getCurrentDraft(rootId: string): Promise<Document | null>;
|
|
354
362
|
getPublished(rootId: string): Promise<Document | null>;
|
|
363
|
+
getBySlug(typeId: string, slug: string): Promise<Document | null>;
|
|
355
364
|
list(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
356
365
|
listPublished(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
357
366
|
listDrafts(opts?: ListDocumentsOptions): Promise<Document[]>;
|
|
@@ -709,6 +718,32 @@ declare function getUserProfileConfig(): UserProfileConfig | null;
|
|
|
709
718
|
declare const userProfilesPlugin: DefinedPlugin;
|
|
710
719
|
declare function createUserProfilesPlugin(): DefinedPlugin;
|
|
711
720
|
|
|
721
|
+
/**
|
|
722
|
+
* MCP plugin configuration.
|
|
723
|
+
*
|
|
724
|
+
* Config is supplied in code when the operator adds `mcpPlugin({...})` to the app's
|
|
725
|
+
* plugin register array — captured in a closure and resolved against the live
|
|
726
|
+
* CollectionRegistry on each request (so newly registered collections appear
|
|
727
|
+
* without a restart). All fields are optional with safe defaults.
|
|
728
|
+
*/
|
|
729
|
+
|
|
730
|
+
declare const mcpConfigSchema: z.ZodObject<{
|
|
731
|
+
expose: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
732
|
+
types: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
733
|
+
read: z.ZodDefault<z.ZodBoolean>;
|
|
734
|
+
write: z.ZodDefault<z.ZodBoolean>;
|
|
735
|
+
}, z.core.$strip>>>;
|
|
736
|
+
redactFields: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
737
|
+
listLimit: z.ZodDefault<z.ZodNumber>;
|
|
738
|
+
}, z.core.$strip>;
|
|
739
|
+
type McpConfigInput = z.input<typeof mcpConfigSchema>;
|
|
740
|
+
type McpConfig = z.infer<typeof mcpConfigSchema>;
|
|
741
|
+
|
|
742
|
+
/** Build an MCP plugin instance bound to the given config. */
|
|
743
|
+
declare function mcpPlugin(options?: McpConfigInput): DefinedPlugin;
|
|
744
|
+
/** Alias matching the repo's `createXPlugin` convention. */
|
|
745
|
+
declare function createMcpPlugin(options?: McpConfigInput): DefinedPlugin;
|
|
746
|
+
|
|
712
747
|
/**
|
|
713
748
|
* @sonicjs/core - Main Entry Point
|
|
714
749
|
*
|
|
@@ -729,4 +764,4 @@ declare function createUserProfilesPlugin(): DefinedPlugin;
|
|
|
729
764
|
|
|
730
765
|
declare const VERSION: string;
|
|
731
766
|
|
|
732
|
-
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, DocumentRepository, DocumentsService, FieldType, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createHelloWorldPlugin, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, helloWorldPlugin, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|
|
767
|
+
export { BUILT_IN_PROVIDERS, type CFSendEmailBinding, CloudflareEmailProvider, type CloudflareEmailProviderOptions, DocumentRepository, DocumentsService, FieldType, type McpConfig, type McpConfigInput, OAuthService, PluginDependencyCycleError, type ProfileFieldDefinition, RbacService, type SortablePlugin, type TopoSortOptions, type UserProfileConfig, VERSION, bootstrapDocumentTypes, createDb, createHelloWorldPlugin, createMcpPlugin, createOAuthProvidersPlugin, createRedirectPlugin, createUserProfilesPlugin, defineUserProfile, emailReconciliationPlugin, generateTriggersComment, getUserProfileConfig, helloWorldPlugin, mcpPlugin, oauthProvidersPlugin, parseCronTriggers, redirectPlugin, _default as siteSettingsCollection, topoSort, updateWranglerTriggers, userProfilesPlugin };
|