@rizom/brain 0.2.0-alpha.149 → 0.2.0-alpha.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brain.js +707 -707
- package/dist/deploy.d.ts +8 -8
- package/dist/entities.d.ts +414 -421
- package/dist/index.d.ts +39 -45
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/interfaces.d.ts +211 -132
- package/dist/plugins.d.ts +967 -954
- package/dist/services.d.ts +399 -397
- package/dist/site.d.ts +63 -66
- package/dist/site.js +4 -4
- package/dist/site.js.map +1 -1
- package/dist/templates.d.ts +117 -115
- package/dist/themes.d.ts +3 -2
- package/package.json +4 -4
package/dist/interfaces.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
|
|
3
|
-
export { EntityDisplayEntry, NavigationItem, NavigationSlot, RouteDefinition, RouteDefinitionInput, SectionDefinition } from '@rizom/site';
|
|
4
|
-
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
//#region ../../shell/templates/src/permission-service.d.ts
|
|
5
3
|
/**
|
|
6
4
|
* User permission level schema
|
|
7
5
|
*/
|
|
@@ -14,11 +12,11 @@ declare const UserPermissionLevelSchema: z.ZodType<UserPermissionLevel, UserPerm
|
|
|
14
12
|
*/
|
|
15
13
|
type EntityActionRequiredLevel = "never" | UserPermissionLevel;
|
|
16
14
|
interface EntityActionPolicyRule {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
create?: EntityActionRequiredLevel | undefined;
|
|
16
|
+
update?: EntityActionRequiredLevel | undefined;
|
|
17
|
+
delete?: EntityActionRequiredLevel | undefined;
|
|
18
|
+
extract?: EntityActionRequiredLevel | undefined;
|
|
19
|
+
publish?: EntityActionRequiredLevel | undefined;
|
|
22
20
|
}
|
|
23
21
|
type EntityActionPolicyRuleInput = EntityActionPolicyRule;
|
|
24
22
|
type EntityActionPolicyConfigInput = Record<string, EntityActionPolicyRuleInput>;
|
|
@@ -26,25 +24,26 @@ type EntityActionPolicyConfigInput = Record<string, EntityActionPolicyRuleInput>
|
|
|
26
24
|
* Generic interface for items with visibility
|
|
27
25
|
*/
|
|
28
26
|
interface WithVisibility {
|
|
29
|
-
|
|
27
|
+
visibility?: UserPermissionLevel;
|
|
30
28
|
}
|
|
31
29
|
/**
|
|
32
30
|
* Permission rule for pattern-based permission matching
|
|
33
31
|
*/
|
|
34
32
|
interface PermissionRule {
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
pattern: string;
|
|
34
|
+
level: UserPermissionLevel;
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
37
|
* Configuration for the permission system
|
|
40
38
|
*/
|
|
41
39
|
interface PermissionConfig {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
anchors?: string[];
|
|
41
|
+
trusted?: string[];
|
|
42
|
+
rules?: PermissionRule[];
|
|
43
|
+
entityActions?: EntityActionPolicyConfigInput;
|
|
46
44
|
}
|
|
47
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../../shell/plugins/src/contracts/metadata.d.ts
|
|
48
47
|
/**
|
|
49
48
|
* Best-effort extension metadata carried across public DTO boundaries.
|
|
50
49
|
*
|
|
@@ -53,93 +52,172 @@ interface PermissionConfig {
|
|
|
53
52
|
* schema and keep this bag only as optional extension data.
|
|
54
53
|
*/
|
|
55
54
|
declare const ExtensionMetadataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}>
|
|
66
|
-
]>;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region ../../shell/plugins/src/contracts/messaging.d.ts
|
|
57
|
+
declare const MessageResponseSchema: z.ZodUnion<[z.ZodObject<{
|
|
58
|
+
success: z.ZodBoolean;
|
|
59
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
60
|
+
error: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}>, z.ZodObject<{
|
|
62
|
+
noop: z.ZodLiteral<true>;
|
|
63
|
+
}>]>;
|
|
67
64
|
type MessageResponse<T = unknown> = ({
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
success: boolean;
|
|
66
|
+
error?: string | undefined;
|
|
70
67
|
} & {
|
|
71
|
-
|
|
68
|
+
data?: T | undefined;
|
|
72
69
|
}) | {
|
|
73
|
-
|
|
70
|
+
noop: true;
|
|
74
71
|
};
|
|
75
72
|
declare const BaseMessageSchema: z.ZodObject<{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
timestamp: z.ZodString;
|
|
75
|
+
type: z.ZodString;
|
|
76
|
+
source: z.ZodString;
|
|
77
|
+
target: z.ZodOptional<z.ZodString>;
|
|
78
|
+
metadata: z.ZodOptional<typeof ExtensionMetadataSchema>;
|
|
82
79
|
}>;
|
|
83
80
|
type BaseMessage = z.output<typeof BaseMessageSchema>;
|
|
84
81
|
type MessageWithPayload<T = unknown> = BaseMessage & {
|
|
85
|
-
|
|
82
|
+
payload: T;
|
|
86
83
|
};
|
|
87
84
|
interface MessageSendOptions {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
target?: string;
|
|
86
|
+
metadata?: z.output<typeof ExtensionMetadataSchema>;
|
|
87
|
+
broadcast?: boolean;
|
|
91
88
|
}
|
|
92
89
|
interface MessageSendRequest<T = unknown> extends MessageSendOptions {
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
type: string;
|
|
91
|
+
payload: T;
|
|
95
92
|
}
|
|
96
93
|
type MessageSender<T = unknown, R = unknown> = (request: MessageSendRequest<T>) => Promise<MessageResponse<R>>;
|
|
97
94
|
interface MessageContext {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
95
|
+
userId?: string;
|
|
96
|
+
channelId?: string;
|
|
97
|
+
messageId?: string;
|
|
98
|
+
timestamp?: string;
|
|
99
|
+
interfaceType?: string;
|
|
100
|
+
userPermissionLevel?: UserPermissionLevel;
|
|
101
|
+
threadId?: string;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region ../site/src/index.d.ts
|
|
105
|
+
/** Navigation slot types exposed to authored routes and generated entity routes. */
|
|
106
|
+
type NavigationSlot = "primary" | "secondary";
|
|
107
|
+
/** Display and behavior metadata for an entity type. */
|
|
108
|
+
interface EntityDisplayEntry {
|
|
109
|
+
label: string;
|
|
110
|
+
pluralName?: string | undefined;
|
|
111
|
+
/** Layout name for this entity type's generated routes (defaults to "default"). */
|
|
112
|
+
layout?: string | undefined;
|
|
113
|
+
/** Enable pagination for list pages. */
|
|
114
|
+
paginate?: boolean | undefined;
|
|
115
|
+
/** Items per page (default: 10). */
|
|
116
|
+
pageSize?: number | undefined;
|
|
117
|
+
navigation?: {
|
|
118
|
+
show?: boolean | undefined;
|
|
119
|
+
slot?: NavigationSlot | undefined;
|
|
120
|
+
priority?: number | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
}
|
|
123
|
+
interface SectionDefinitionInput {
|
|
124
|
+
id: string;
|
|
125
|
+
template: string;
|
|
126
|
+
content?: unknown;
|
|
127
|
+
dataQuery?: {
|
|
128
|
+
entityType?: string | undefined;
|
|
129
|
+
template?: string | undefined;
|
|
130
|
+
query?: Record<string, unknown> | undefined;
|
|
131
|
+
[key: string]: unknown;
|
|
132
|
+
} | undefined;
|
|
133
|
+
order?: number | undefined;
|
|
134
|
+
}
|
|
135
|
+
type SectionDefinition = SectionDefinitionInput;
|
|
136
|
+
interface NavigationMetadataInput {
|
|
137
|
+
show?: boolean | undefined;
|
|
138
|
+
label?: string | undefined;
|
|
139
|
+
slot?: NavigationSlot | undefined;
|
|
140
|
+
priority?: number | undefined;
|
|
141
|
+
}
|
|
142
|
+
interface NavigationMetadata {
|
|
143
|
+
show: boolean;
|
|
144
|
+
label?: string | undefined;
|
|
145
|
+
slot: NavigationSlot;
|
|
146
|
+
priority: number;
|
|
147
|
+
}
|
|
148
|
+
interface RouteDefinitionInput {
|
|
149
|
+
id: string;
|
|
150
|
+
path: string;
|
|
151
|
+
title?: string | undefined;
|
|
152
|
+
/** Bare display label without any page suffix. */
|
|
153
|
+
pageLabel?: string | undefined;
|
|
154
|
+
description?: string | undefined;
|
|
155
|
+
sections?: SectionDefinitionInput[] | undefined;
|
|
156
|
+
layout?: string | undefined;
|
|
157
|
+
fullscreen?: boolean | undefined;
|
|
158
|
+
pluginId?: string | undefined;
|
|
159
|
+
sourceEntityType?: string | undefined;
|
|
160
|
+
external?: boolean | undefined;
|
|
161
|
+
navigation?: NavigationMetadataInput | undefined;
|
|
162
|
+
}
|
|
163
|
+
interface RouteDefinition {
|
|
164
|
+
id: string;
|
|
165
|
+
path: string;
|
|
166
|
+
title: string;
|
|
167
|
+
pageLabel?: string | undefined;
|
|
168
|
+
description: string;
|
|
169
|
+
sections: SectionDefinition[];
|
|
170
|
+
layout: string;
|
|
171
|
+
fullscreen?: boolean | undefined;
|
|
172
|
+
pluginId?: string | undefined;
|
|
173
|
+
sourceEntityType?: string | undefined;
|
|
174
|
+
external?: boolean | undefined;
|
|
175
|
+
navigation?: NavigationMetadata | undefined;
|
|
176
|
+
}
|
|
177
|
+
interface NavigationItem {
|
|
178
|
+
label: string;
|
|
179
|
+
href: string;
|
|
180
|
+
priority: number;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../../shared/site-composition/src/routes.d.ts
|
|
107
184
|
/** Navigation slot types. */
|
|
108
185
|
declare const NavigationSlots: readonly ["primary", "secondary"];
|
|
109
186
|
/** Route definition schema. */
|
|
110
187
|
declare const RouteDefinitionSchema: z.ZodType<RouteDefinition, RouteDefinitionInput>;
|
|
111
188
|
interface RegisterRoutesPayload {
|
|
112
|
-
|
|
113
|
-
|
|
189
|
+
routes: RouteDefinition[];
|
|
190
|
+
pluginId: string;
|
|
114
191
|
}
|
|
115
192
|
interface UnregisterRoutesPayload {
|
|
116
|
-
|
|
117
|
-
|
|
193
|
+
paths?: string[] | undefined;
|
|
194
|
+
pluginId?: string | undefined;
|
|
118
195
|
}
|
|
119
196
|
interface ListRoutesPayload {
|
|
120
|
-
|
|
197
|
+
pluginId?: string | undefined;
|
|
121
198
|
}
|
|
122
199
|
interface GetRoutePayload {
|
|
123
|
-
|
|
200
|
+
path: string;
|
|
124
201
|
}
|
|
125
202
|
/** Message payload schemas for route operations. */
|
|
126
203
|
declare const RegisterRoutesPayloadSchema: z.ZodType<RegisterRoutesPayload>;
|
|
127
204
|
declare const UnregisterRoutesPayloadSchema: z.ZodType<UnregisterRoutesPayload>;
|
|
128
205
|
declare const ListRoutesPayloadSchema: z.ZodType<ListRoutesPayload>;
|
|
129
206
|
declare const GetRoutePayloadSchema: z.ZodType<GetRoutePayload>;
|
|
130
|
-
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region ../../shell/plugins/src/types/api-routes.d.ts
|
|
131
209
|
declare const apiRouteDefinitionSchema: z.ZodObject<{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
210
|
+
path: z.ZodString;
|
|
211
|
+
method: z.ZodDefault<z.ZodEnum<{
|
|
212
|
+
GET: "GET";
|
|
213
|
+
POST: "POST";
|
|
214
|
+
PUT: "PUT";
|
|
215
|
+
DELETE: "DELETE";
|
|
216
|
+
}>>;
|
|
217
|
+
tool: z.ZodString;
|
|
218
|
+
public: z.ZodDefault<z.ZodBoolean>;
|
|
219
|
+
successRedirect: z.ZodOptional<z.ZodString>;
|
|
220
|
+
errorRedirect: z.ZodOptional<z.ZodString>;
|
|
143
221
|
}>;
|
|
144
222
|
type ApiRouteDefinition = z.output<typeof apiRouteDefinitionSchema>;
|
|
145
223
|
/**
|
|
@@ -147,91 +225,92 @@ type ApiRouteDefinition = z.output<typeof apiRouteDefinitionSchema>;
|
|
|
147
225
|
* Returned by Shell.getPluginApiRoutes()
|
|
148
226
|
*/
|
|
149
227
|
interface RegisteredApiRoute {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
228
|
+
/** The plugin that registered this route */
|
|
229
|
+
pluginId: string;
|
|
230
|
+
/** Full path including /api/{pluginId} prefix */
|
|
231
|
+
fullPath: string;
|
|
232
|
+
/** The original route definition */
|
|
233
|
+
definition: ApiRouteDefinition;
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region ../../shell/plugins/src/types/web-routes.d.ts
|
|
158
237
|
declare const WebRouteMethods: readonly ["GET", "POST", "PUT", "DELETE", "OPTIONS"];
|
|
159
238
|
type WebRouteMethod = (typeof WebRouteMethods)[number];
|
|
160
239
|
type WebRouteHandler = (request: Request) => Response | Promise<Response>;
|
|
161
240
|
interface WebRouteDefinition {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
241
|
+
/** Absolute mounted path (e.g. "/cms" or "/cms-config") */
|
|
242
|
+
path: string;
|
|
243
|
+
/** HTTP method */
|
|
244
|
+
method?: WebRouteMethod;
|
|
245
|
+
/** Allow unauthenticated access */
|
|
246
|
+
public?: boolean;
|
|
247
|
+
/** Request handler */
|
|
248
|
+
handler: WebRouteHandler;
|
|
170
249
|
}
|
|
171
250
|
interface RegisteredWebRoute {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
251
|
+
/** The plugin that registered this route */
|
|
252
|
+
pluginId: string;
|
|
253
|
+
/** The mounted path */
|
|
254
|
+
fullPath: string;
|
|
255
|
+
/** The original route definition */
|
|
256
|
+
definition: WebRouteDefinition;
|
|
257
|
+
}
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region ../../shell/plugins/src/manager/daemon-types.d.ts
|
|
180
260
|
/**
|
|
181
261
|
* Daemon health status schema
|
|
182
262
|
*/
|
|
183
263
|
declare const DaemonHealthSchema: z.ZodObject<{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
264
|
+
status: z.ZodEnum<{
|
|
265
|
+
healthy: "healthy";
|
|
266
|
+
warning: "warning";
|
|
267
|
+
error: "error";
|
|
268
|
+
unknown: "unknown";
|
|
269
|
+
}>;
|
|
270
|
+
message: z.ZodOptional<z.ZodString>;
|
|
271
|
+
lastCheck: z.ZodOptional<z.ZodDate>;
|
|
272
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
193
273
|
}>;
|
|
194
274
|
type DaemonHealth = z.output<typeof DaemonHealthSchema>;
|
|
195
275
|
/**
|
|
196
276
|
* Daemon status info schema for validation
|
|
197
277
|
*/
|
|
198
278
|
declare const DaemonStatusInfoSchema: z.ZodObject<{
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
279
|
+
name: z.ZodString;
|
|
280
|
+
pluginId: z.ZodString;
|
|
281
|
+
status: z.ZodString;
|
|
282
|
+
health: z.ZodOptional<typeof DaemonHealthSchema>;
|
|
203
283
|
}>;
|
|
204
284
|
type DaemonStatusInfo = z.output<typeof DaemonStatusInfoSchema>;
|
|
205
285
|
/**
|
|
206
286
|
* Daemon interface for long-running interface processes
|
|
207
287
|
*/
|
|
208
288
|
interface Daemon {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
289
|
+
/**
|
|
290
|
+
* Start the daemon - called when plugin is initialized
|
|
291
|
+
*/
|
|
292
|
+
start: () => Promise<void>;
|
|
293
|
+
/**
|
|
294
|
+
* Stop the daemon - called when plugin is unloaded/shutdown
|
|
295
|
+
*/
|
|
296
|
+
stop: () => Promise<void>;
|
|
297
|
+
/**
|
|
298
|
+
* Optional health check - called periodically to monitor daemon health
|
|
299
|
+
*/
|
|
300
|
+
healthCheck?: () => Promise<DaemonHealth>;
|
|
221
301
|
}
|
|
222
302
|
/**
|
|
223
303
|
* Information about a registered daemon
|
|
224
304
|
*/
|
|
225
305
|
interface DaemonInfo {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export { BaseMessageSchema, GetRoutePayloadSchema, ListRoutesPayloadSchema, MessageResponseSchema, NavigationSlots, RegisterRoutesPayloadSchema, RouteDefinitionSchema, UnregisterRoutesPayloadSchema, UserPermissionLevelSchema };
|
|
237
|
-
export type { ApiRouteDefinition, BaseMessage, Daemon, DaemonHealth, DaemonInfo, DaemonStatusInfo, MessageContext, MessageResponse, MessageSendOptions, MessageSender, MessageWithPayload, PermissionConfig, PermissionRule, RegisteredApiRoute, RegisteredWebRoute, UserPermissionLevel, WebRouteDefinition, WebRouteHandler, WebRouteMethod, WithVisibility };
|
|
306
|
+
name: string;
|
|
307
|
+
daemon: Daemon;
|
|
308
|
+
pluginId: string;
|
|
309
|
+
status: "stopped" | "starting" | "running" | "stopping" | "error";
|
|
310
|
+
health?: DaemonHealth;
|
|
311
|
+
error?: Error;
|
|
312
|
+
startedAt?: Date;
|
|
313
|
+
stoppedAt?: Date;
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
export { type ApiRouteDefinition, type BaseMessage, BaseMessageSchema, type Daemon, type DaemonHealth, type DaemonInfo, type DaemonStatusInfo, type EntityDisplayEntry, GetRoutePayloadSchema, ListRoutesPayloadSchema, type MessageContext, type MessageResponse, MessageResponseSchema, type MessageSendOptions, type MessageSender, type MessageWithPayload, type NavigationItem, type NavigationSlot, NavigationSlots, type PermissionConfig, type PermissionRule, RegisterRoutesPayloadSchema, type RegisteredApiRoute, type RegisteredWebRoute, type RouteDefinition, type RouteDefinitionInput, RouteDefinitionSchema, type SectionDefinition, UnregisterRoutesPayloadSchema, type UserPermissionLevel, UserPermissionLevelSchema, type WebRouteDefinition, type WebRouteHandler, type WebRouteMethod, type WithVisibility };
|