@consciousclouds/canvas-sdk 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +29 -0
  3. package/dist/client/canvas-client.d.ts +28 -0
  4. package/dist/client/canvas-client.d.ts.map +1 -0
  5. package/dist/client/canvas-client.js +50 -0
  6. package/dist/client/canvas-client.js.map +1 -0
  7. package/dist/contracts/experience-adapter.d.ts +83 -0
  8. package/dist/contracts/experience-adapter.d.ts.map +1 -0
  9. package/dist/contracts/experience-adapter.js +50 -0
  10. package/dist/contracts/experience-adapter.js.map +1 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +5 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/registry/component-registry.d.ts +40 -0
  16. package/dist/registry/component-registry.d.ts.map +1 -0
  17. package/dist/registry/component-registry.js +59 -0
  18. package/dist/registry/component-registry.js.map +1 -0
  19. package/dist/storage/client.d.ts +70 -0
  20. package/dist/storage/client.d.ts.map +1 -0
  21. package/dist/storage/client.js +146 -0
  22. package/dist/storage/client.js.map +1 -0
  23. package/dist/storage/index.d.ts +13 -0
  24. package/dist/storage/index.d.ts.map +1 -0
  25. package/dist/storage/index.js +11 -0
  26. package/dist/storage/index.js.map +1 -0
  27. package/dist/storage/types.d.ts +80 -0
  28. package/dist/storage/types.d.ts.map +1 -0
  29. package/dist/storage/types.js +11 -0
  30. package/dist/storage/types.js.map +1 -0
  31. package/dist/types/canvas.d.ts +94 -0
  32. package/dist/types/canvas.d.ts.map +1 -0
  33. package/dist/types/canvas.js +11 -0
  34. package/dist/types/canvas.js.map +1 -0
  35. package/dist/validate/canvas.d.ts +1091 -0
  36. package/dist/validate/canvas.d.ts.map +1 -0
  37. package/dist/validate/canvas.js +120 -0
  38. package/dist/validate/canvas.js.map +1 -0
  39. package/package.json +60 -0
@@ -0,0 +1,1091 @@
1
+ /**
2
+ * Runtime validation of a CanvasDefinition (zod mirror of the JSON Schema).
3
+ *
4
+ * The JSON Schema under platform/contracts/canvas/v1/ is authoritative; this
5
+ * zod schema mirrors it for ergonomic in-process validation. The conformance
6
+ * test asserts the discriminants here match the contract and the registry.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ import { z } from 'zod';
11
+ import type { CanvasDefinition, CanvasNodeType } from '../types/canvas.js';
12
+ /** The node `type` discriminants, in registry order. */
13
+ export declare const NODE_TYPES: readonly ["stat-card", "data-table", "service-health", "text-block"];
14
+ export declare const canvasNodeSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
15
+ props: z.ZodObject<{
16
+ label: z.ZodString;
17
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
18
+ unit: z.ZodOptional<z.ZodString>;
19
+ trend: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
20
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
21
+ label: z.ZodString;
22
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
23
+ unit: z.ZodOptional<z.ZodString>;
24
+ trend: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
25
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
26
+ label: z.ZodString;
27
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
28
+ unit: z.ZodOptional<z.ZodString>;
29
+ trend: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
30
+ }, z.ZodTypeAny, "passthrough">>;
31
+ id: z.ZodString;
32
+ requiredPermission: z.ZodOptional<z.ZodString>;
33
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
34
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ prop: z.ZodString;
36
+ source: z.ZodString;
37
+ }, "strict", z.ZodTypeAny, {
38
+ prop: string;
39
+ source: string;
40
+ }, {
41
+ prop: string;
42
+ source: string;
43
+ }>, "many">>;
44
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
45
+ id: z.ZodString;
46
+ label: z.ZodString;
47
+ target: z.ZodString;
48
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
49
+ }, "strict", z.ZodTypeAny, {
50
+ label: string;
51
+ id: string;
52
+ target: string;
53
+ method?: "GET" | "POST" | undefined;
54
+ }, {
55
+ label: string;
56
+ id: string;
57
+ target: string;
58
+ method?: "GET" | "POST" | undefined;
59
+ }>, "many">>;
60
+ type: z.ZodLiteral<"stat-card">;
61
+ }, "strict", z.ZodTypeAny, {
62
+ type: "stat-card";
63
+ id: string;
64
+ props: {
65
+ label: string;
66
+ value: string | number;
67
+ unit?: string | undefined;
68
+ trend?: "up" | "down" | "flat" | undefined;
69
+ } & {
70
+ [k: string]: unknown;
71
+ };
72
+ requiredPermission?: string | undefined;
73
+ nodeVersion?: number | undefined;
74
+ bindings?: {
75
+ prop: string;
76
+ source: string;
77
+ }[] | undefined;
78
+ actions?: {
79
+ label: string;
80
+ id: string;
81
+ target: string;
82
+ method?: "GET" | "POST" | undefined;
83
+ }[] | undefined;
84
+ }, {
85
+ type: "stat-card";
86
+ id: string;
87
+ props: {
88
+ label: string;
89
+ value: string | number;
90
+ unit?: string | undefined;
91
+ trend?: "up" | "down" | "flat" | undefined;
92
+ } & {
93
+ [k: string]: unknown;
94
+ };
95
+ requiredPermission?: string | undefined;
96
+ nodeVersion?: number | undefined;
97
+ bindings?: {
98
+ prop: string;
99
+ source: string;
100
+ }[] | undefined;
101
+ actions?: {
102
+ label: string;
103
+ id: string;
104
+ target: string;
105
+ method?: "GET" | "POST" | undefined;
106
+ }[] | undefined;
107
+ }>, z.ZodObject<{
108
+ props: z.ZodObject<{
109
+ title: z.ZodOptional<z.ZodString>;
110
+ columns: z.ZodArray<z.ZodObject<{
111
+ key: z.ZodString;
112
+ label: z.ZodString;
113
+ }, "strict", z.ZodTypeAny, {
114
+ label: string;
115
+ key: string;
116
+ }, {
117
+ label: string;
118
+ key: string;
119
+ }>, "many">;
120
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
121
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
122
+ title: z.ZodOptional<z.ZodString>;
123
+ columns: z.ZodArray<z.ZodObject<{
124
+ key: z.ZodString;
125
+ label: z.ZodString;
126
+ }, "strict", z.ZodTypeAny, {
127
+ label: string;
128
+ key: string;
129
+ }, {
130
+ label: string;
131
+ key: string;
132
+ }>, "many">;
133
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
134
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
135
+ title: z.ZodOptional<z.ZodString>;
136
+ columns: z.ZodArray<z.ZodObject<{
137
+ key: z.ZodString;
138
+ label: z.ZodString;
139
+ }, "strict", z.ZodTypeAny, {
140
+ label: string;
141
+ key: string;
142
+ }, {
143
+ label: string;
144
+ key: string;
145
+ }>, "many">;
146
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
147
+ }, z.ZodTypeAny, "passthrough">>;
148
+ id: z.ZodString;
149
+ requiredPermission: z.ZodOptional<z.ZodString>;
150
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
151
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ prop: z.ZodString;
153
+ source: z.ZodString;
154
+ }, "strict", z.ZodTypeAny, {
155
+ prop: string;
156
+ source: string;
157
+ }, {
158
+ prop: string;
159
+ source: string;
160
+ }>, "many">>;
161
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
162
+ id: z.ZodString;
163
+ label: z.ZodString;
164
+ target: z.ZodString;
165
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
166
+ }, "strict", z.ZodTypeAny, {
167
+ label: string;
168
+ id: string;
169
+ target: string;
170
+ method?: "GET" | "POST" | undefined;
171
+ }, {
172
+ label: string;
173
+ id: string;
174
+ target: string;
175
+ method?: "GET" | "POST" | undefined;
176
+ }>, "many">>;
177
+ type: z.ZodLiteral<"data-table">;
178
+ }, "strict", z.ZodTypeAny, {
179
+ type: "data-table";
180
+ id: string;
181
+ props: {
182
+ columns: {
183
+ label: string;
184
+ key: string;
185
+ }[];
186
+ rows: Record<string, unknown>[];
187
+ title?: string | undefined;
188
+ } & {
189
+ [k: string]: unknown;
190
+ };
191
+ requiredPermission?: string | undefined;
192
+ nodeVersion?: number | undefined;
193
+ bindings?: {
194
+ prop: string;
195
+ source: string;
196
+ }[] | undefined;
197
+ actions?: {
198
+ label: string;
199
+ id: string;
200
+ target: string;
201
+ method?: "GET" | "POST" | undefined;
202
+ }[] | undefined;
203
+ }, {
204
+ type: "data-table";
205
+ id: string;
206
+ props: {
207
+ columns: {
208
+ label: string;
209
+ key: string;
210
+ }[];
211
+ rows: Record<string, unknown>[];
212
+ title?: string | undefined;
213
+ } & {
214
+ [k: string]: unknown;
215
+ };
216
+ requiredPermission?: string | undefined;
217
+ nodeVersion?: number | undefined;
218
+ bindings?: {
219
+ prop: string;
220
+ source: string;
221
+ }[] | undefined;
222
+ actions?: {
223
+ label: string;
224
+ id: string;
225
+ target: string;
226
+ method?: "GET" | "POST" | undefined;
227
+ }[] | undefined;
228
+ }>, z.ZodObject<{
229
+ props: z.ZodObject<{
230
+ title: z.ZodOptional<z.ZodString>;
231
+ services: z.ZodArray<z.ZodObject<{
232
+ name: z.ZodString;
233
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
234
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
235
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
236
+ name: z.ZodString;
237
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
238
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
239
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
240
+ name: z.ZodString;
241
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
242
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
243
+ }, z.ZodTypeAny, "passthrough">>, "many">;
244
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
245
+ title: z.ZodOptional<z.ZodString>;
246
+ services: z.ZodArray<z.ZodObject<{
247
+ name: z.ZodString;
248
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
249
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
250
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
251
+ name: z.ZodString;
252
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
253
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
254
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
255
+ name: z.ZodString;
256
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
257
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
258
+ }, z.ZodTypeAny, "passthrough">>, "many">;
259
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
260
+ title: z.ZodOptional<z.ZodString>;
261
+ services: z.ZodArray<z.ZodObject<{
262
+ name: z.ZodString;
263
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
264
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
265
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
266
+ name: z.ZodString;
267
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
268
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
269
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
270
+ name: z.ZodString;
271
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
272
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
273
+ }, z.ZodTypeAny, "passthrough">>, "many">;
274
+ }, z.ZodTypeAny, "passthrough">>;
275
+ id: z.ZodString;
276
+ requiredPermission: z.ZodOptional<z.ZodString>;
277
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
278
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
279
+ prop: z.ZodString;
280
+ source: z.ZodString;
281
+ }, "strict", z.ZodTypeAny, {
282
+ prop: string;
283
+ source: string;
284
+ }, {
285
+ prop: string;
286
+ source: string;
287
+ }>, "many">>;
288
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
289
+ id: z.ZodString;
290
+ label: z.ZodString;
291
+ target: z.ZodString;
292
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
293
+ }, "strict", z.ZodTypeAny, {
294
+ label: string;
295
+ id: string;
296
+ target: string;
297
+ method?: "GET" | "POST" | undefined;
298
+ }, {
299
+ label: string;
300
+ id: string;
301
+ target: string;
302
+ method?: "GET" | "POST" | undefined;
303
+ }>, "many">>;
304
+ type: z.ZodLiteral<"service-health">;
305
+ }, "strict", z.ZodTypeAny, {
306
+ type: "service-health";
307
+ id: string;
308
+ props: {
309
+ services: z.objectOutputType<{
310
+ name: z.ZodString;
311
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
312
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
313
+ }, z.ZodTypeAny, "passthrough">[];
314
+ title?: string | undefined;
315
+ } & {
316
+ [k: string]: unknown;
317
+ };
318
+ requiredPermission?: string | undefined;
319
+ nodeVersion?: number | undefined;
320
+ bindings?: {
321
+ prop: string;
322
+ source: string;
323
+ }[] | undefined;
324
+ actions?: {
325
+ label: string;
326
+ id: string;
327
+ target: string;
328
+ method?: "GET" | "POST" | undefined;
329
+ }[] | undefined;
330
+ }, {
331
+ type: "service-health";
332
+ id: string;
333
+ props: {
334
+ services: z.objectInputType<{
335
+ name: z.ZodString;
336
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
337
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
338
+ }, z.ZodTypeAny, "passthrough">[];
339
+ title?: string | undefined;
340
+ } & {
341
+ [k: string]: unknown;
342
+ };
343
+ requiredPermission?: string | undefined;
344
+ nodeVersion?: number | undefined;
345
+ bindings?: {
346
+ prop: string;
347
+ source: string;
348
+ }[] | undefined;
349
+ actions?: {
350
+ label: string;
351
+ id: string;
352
+ target: string;
353
+ method?: "GET" | "POST" | undefined;
354
+ }[] | undefined;
355
+ }>, z.ZodObject<{
356
+ props: z.ZodObject<{
357
+ variant: z.ZodEnum<["heading", "subheading", "body"]>;
358
+ text: z.ZodString;
359
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
360
+ variant: z.ZodEnum<["heading", "subheading", "body"]>;
361
+ text: z.ZodString;
362
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
363
+ variant: z.ZodEnum<["heading", "subheading", "body"]>;
364
+ text: z.ZodString;
365
+ }, z.ZodTypeAny, "passthrough">>;
366
+ id: z.ZodString;
367
+ requiredPermission: z.ZodOptional<z.ZodString>;
368
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
369
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
370
+ prop: z.ZodString;
371
+ source: z.ZodString;
372
+ }, "strict", z.ZodTypeAny, {
373
+ prop: string;
374
+ source: string;
375
+ }, {
376
+ prop: string;
377
+ source: string;
378
+ }>, "many">>;
379
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
380
+ id: z.ZodString;
381
+ label: z.ZodString;
382
+ target: z.ZodString;
383
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
384
+ }, "strict", z.ZodTypeAny, {
385
+ label: string;
386
+ id: string;
387
+ target: string;
388
+ method?: "GET" | "POST" | undefined;
389
+ }, {
390
+ label: string;
391
+ id: string;
392
+ target: string;
393
+ method?: "GET" | "POST" | undefined;
394
+ }>, "many">>;
395
+ type: z.ZodLiteral<"text-block">;
396
+ }, "strict", z.ZodTypeAny, {
397
+ type: "text-block";
398
+ id: string;
399
+ props: {
400
+ variant: "heading" | "subheading" | "body";
401
+ text: string;
402
+ } & {
403
+ [k: string]: unknown;
404
+ };
405
+ requiredPermission?: string | undefined;
406
+ nodeVersion?: number | undefined;
407
+ bindings?: {
408
+ prop: string;
409
+ source: string;
410
+ }[] | undefined;
411
+ actions?: {
412
+ label: string;
413
+ id: string;
414
+ target: string;
415
+ method?: "GET" | "POST" | undefined;
416
+ }[] | undefined;
417
+ }, {
418
+ type: "text-block";
419
+ id: string;
420
+ props: {
421
+ variant: "heading" | "subheading" | "body";
422
+ text: string;
423
+ } & {
424
+ [k: string]: unknown;
425
+ };
426
+ requiredPermission?: string | undefined;
427
+ nodeVersion?: number | undefined;
428
+ bindings?: {
429
+ prop: string;
430
+ source: string;
431
+ }[] | undefined;
432
+ actions?: {
433
+ label: string;
434
+ id: string;
435
+ target: string;
436
+ method?: "GET" | "POST" | undefined;
437
+ }[] | undefined;
438
+ }>]>;
439
+ export declare const canvasDefinitionSchema: z.ZodObject<{
440
+ version: z.ZodLiteral<"v1">;
441
+ correlationId: z.ZodString;
442
+ layout: z.ZodObject<{
443
+ type: z.ZodEnum<["stack", "grid"]>;
444
+ columns: z.ZodOptional<z.ZodNumber>;
445
+ }, "strict", z.ZodTypeAny, {
446
+ type: "stack" | "grid";
447
+ columns?: number | undefined;
448
+ }, {
449
+ type: "stack" | "grid";
450
+ columns?: number | undefined;
451
+ }>;
452
+ nodes: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
453
+ props: z.ZodObject<{
454
+ label: z.ZodString;
455
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
456
+ unit: z.ZodOptional<z.ZodString>;
457
+ trend: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
458
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
459
+ label: z.ZodString;
460
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
461
+ unit: z.ZodOptional<z.ZodString>;
462
+ trend: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
463
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
464
+ label: z.ZodString;
465
+ value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
466
+ unit: z.ZodOptional<z.ZodString>;
467
+ trend: z.ZodOptional<z.ZodEnum<["up", "down", "flat"]>>;
468
+ }, z.ZodTypeAny, "passthrough">>;
469
+ id: z.ZodString;
470
+ requiredPermission: z.ZodOptional<z.ZodString>;
471
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
472
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
473
+ prop: z.ZodString;
474
+ source: z.ZodString;
475
+ }, "strict", z.ZodTypeAny, {
476
+ prop: string;
477
+ source: string;
478
+ }, {
479
+ prop: string;
480
+ source: string;
481
+ }>, "many">>;
482
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
483
+ id: z.ZodString;
484
+ label: z.ZodString;
485
+ target: z.ZodString;
486
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
487
+ }, "strict", z.ZodTypeAny, {
488
+ label: string;
489
+ id: string;
490
+ target: string;
491
+ method?: "GET" | "POST" | undefined;
492
+ }, {
493
+ label: string;
494
+ id: string;
495
+ target: string;
496
+ method?: "GET" | "POST" | undefined;
497
+ }>, "many">>;
498
+ type: z.ZodLiteral<"stat-card">;
499
+ }, "strict", z.ZodTypeAny, {
500
+ type: "stat-card";
501
+ id: string;
502
+ props: {
503
+ label: string;
504
+ value: string | number;
505
+ unit?: string | undefined;
506
+ trend?: "up" | "down" | "flat" | undefined;
507
+ } & {
508
+ [k: string]: unknown;
509
+ };
510
+ requiredPermission?: string | undefined;
511
+ nodeVersion?: number | undefined;
512
+ bindings?: {
513
+ prop: string;
514
+ source: string;
515
+ }[] | undefined;
516
+ actions?: {
517
+ label: string;
518
+ id: string;
519
+ target: string;
520
+ method?: "GET" | "POST" | undefined;
521
+ }[] | undefined;
522
+ }, {
523
+ type: "stat-card";
524
+ id: string;
525
+ props: {
526
+ label: string;
527
+ value: string | number;
528
+ unit?: string | undefined;
529
+ trend?: "up" | "down" | "flat" | undefined;
530
+ } & {
531
+ [k: string]: unknown;
532
+ };
533
+ requiredPermission?: string | undefined;
534
+ nodeVersion?: number | undefined;
535
+ bindings?: {
536
+ prop: string;
537
+ source: string;
538
+ }[] | undefined;
539
+ actions?: {
540
+ label: string;
541
+ id: string;
542
+ target: string;
543
+ method?: "GET" | "POST" | undefined;
544
+ }[] | undefined;
545
+ }>, z.ZodObject<{
546
+ props: z.ZodObject<{
547
+ title: z.ZodOptional<z.ZodString>;
548
+ columns: z.ZodArray<z.ZodObject<{
549
+ key: z.ZodString;
550
+ label: z.ZodString;
551
+ }, "strict", z.ZodTypeAny, {
552
+ label: string;
553
+ key: string;
554
+ }, {
555
+ label: string;
556
+ key: string;
557
+ }>, "many">;
558
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
559
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
560
+ title: z.ZodOptional<z.ZodString>;
561
+ columns: z.ZodArray<z.ZodObject<{
562
+ key: z.ZodString;
563
+ label: z.ZodString;
564
+ }, "strict", z.ZodTypeAny, {
565
+ label: string;
566
+ key: string;
567
+ }, {
568
+ label: string;
569
+ key: string;
570
+ }>, "many">;
571
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
572
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
573
+ title: z.ZodOptional<z.ZodString>;
574
+ columns: z.ZodArray<z.ZodObject<{
575
+ key: z.ZodString;
576
+ label: z.ZodString;
577
+ }, "strict", z.ZodTypeAny, {
578
+ label: string;
579
+ key: string;
580
+ }, {
581
+ label: string;
582
+ key: string;
583
+ }>, "many">;
584
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
585
+ }, z.ZodTypeAny, "passthrough">>;
586
+ id: z.ZodString;
587
+ requiredPermission: z.ZodOptional<z.ZodString>;
588
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
589
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
590
+ prop: z.ZodString;
591
+ source: z.ZodString;
592
+ }, "strict", z.ZodTypeAny, {
593
+ prop: string;
594
+ source: string;
595
+ }, {
596
+ prop: string;
597
+ source: string;
598
+ }>, "many">>;
599
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
600
+ id: z.ZodString;
601
+ label: z.ZodString;
602
+ target: z.ZodString;
603
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
604
+ }, "strict", z.ZodTypeAny, {
605
+ label: string;
606
+ id: string;
607
+ target: string;
608
+ method?: "GET" | "POST" | undefined;
609
+ }, {
610
+ label: string;
611
+ id: string;
612
+ target: string;
613
+ method?: "GET" | "POST" | undefined;
614
+ }>, "many">>;
615
+ type: z.ZodLiteral<"data-table">;
616
+ }, "strict", z.ZodTypeAny, {
617
+ type: "data-table";
618
+ id: string;
619
+ props: {
620
+ columns: {
621
+ label: string;
622
+ key: string;
623
+ }[];
624
+ rows: Record<string, unknown>[];
625
+ title?: string | undefined;
626
+ } & {
627
+ [k: string]: unknown;
628
+ };
629
+ requiredPermission?: string | undefined;
630
+ nodeVersion?: number | undefined;
631
+ bindings?: {
632
+ prop: string;
633
+ source: string;
634
+ }[] | undefined;
635
+ actions?: {
636
+ label: string;
637
+ id: string;
638
+ target: string;
639
+ method?: "GET" | "POST" | undefined;
640
+ }[] | undefined;
641
+ }, {
642
+ type: "data-table";
643
+ id: string;
644
+ props: {
645
+ columns: {
646
+ label: string;
647
+ key: string;
648
+ }[];
649
+ rows: Record<string, unknown>[];
650
+ title?: string | undefined;
651
+ } & {
652
+ [k: string]: unknown;
653
+ };
654
+ requiredPermission?: string | undefined;
655
+ nodeVersion?: number | undefined;
656
+ bindings?: {
657
+ prop: string;
658
+ source: string;
659
+ }[] | undefined;
660
+ actions?: {
661
+ label: string;
662
+ id: string;
663
+ target: string;
664
+ method?: "GET" | "POST" | undefined;
665
+ }[] | undefined;
666
+ }>, z.ZodObject<{
667
+ props: z.ZodObject<{
668
+ title: z.ZodOptional<z.ZodString>;
669
+ services: z.ZodArray<z.ZodObject<{
670
+ name: z.ZodString;
671
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
672
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
673
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
674
+ name: z.ZodString;
675
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
676
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
677
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
678
+ name: z.ZodString;
679
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
680
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
681
+ }, z.ZodTypeAny, "passthrough">>, "many">;
682
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
683
+ title: z.ZodOptional<z.ZodString>;
684
+ services: z.ZodArray<z.ZodObject<{
685
+ name: z.ZodString;
686
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
687
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
688
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
689
+ name: z.ZodString;
690
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
691
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
692
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
693
+ name: z.ZodString;
694
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
695
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
696
+ }, z.ZodTypeAny, "passthrough">>, "many">;
697
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
698
+ title: z.ZodOptional<z.ZodString>;
699
+ services: z.ZodArray<z.ZodObject<{
700
+ name: z.ZodString;
701
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
702
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
703
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
704
+ name: z.ZodString;
705
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
706
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
707
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
708
+ name: z.ZodString;
709
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
710
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
711
+ }, z.ZodTypeAny, "passthrough">>, "many">;
712
+ }, z.ZodTypeAny, "passthrough">>;
713
+ id: z.ZodString;
714
+ requiredPermission: z.ZodOptional<z.ZodString>;
715
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
716
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
717
+ prop: z.ZodString;
718
+ source: z.ZodString;
719
+ }, "strict", z.ZodTypeAny, {
720
+ prop: string;
721
+ source: string;
722
+ }, {
723
+ prop: string;
724
+ source: string;
725
+ }>, "many">>;
726
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
727
+ id: z.ZodString;
728
+ label: z.ZodString;
729
+ target: z.ZodString;
730
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
731
+ }, "strict", z.ZodTypeAny, {
732
+ label: string;
733
+ id: string;
734
+ target: string;
735
+ method?: "GET" | "POST" | undefined;
736
+ }, {
737
+ label: string;
738
+ id: string;
739
+ target: string;
740
+ method?: "GET" | "POST" | undefined;
741
+ }>, "many">>;
742
+ type: z.ZodLiteral<"service-health">;
743
+ }, "strict", z.ZodTypeAny, {
744
+ type: "service-health";
745
+ id: string;
746
+ props: {
747
+ services: z.objectOutputType<{
748
+ name: z.ZodString;
749
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
750
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
751
+ }, z.ZodTypeAny, "passthrough">[];
752
+ title?: string | undefined;
753
+ } & {
754
+ [k: string]: unknown;
755
+ };
756
+ requiredPermission?: string | undefined;
757
+ nodeVersion?: number | undefined;
758
+ bindings?: {
759
+ prop: string;
760
+ source: string;
761
+ }[] | undefined;
762
+ actions?: {
763
+ label: string;
764
+ id: string;
765
+ target: string;
766
+ method?: "GET" | "POST" | undefined;
767
+ }[] | undefined;
768
+ }, {
769
+ type: "service-health";
770
+ id: string;
771
+ props: {
772
+ services: z.objectInputType<{
773
+ name: z.ZodString;
774
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
775
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
776
+ }, z.ZodTypeAny, "passthrough">[];
777
+ title?: string | undefined;
778
+ } & {
779
+ [k: string]: unknown;
780
+ };
781
+ requiredPermission?: string | undefined;
782
+ nodeVersion?: number | undefined;
783
+ bindings?: {
784
+ prop: string;
785
+ source: string;
786
+ }[] | undefined;
787
+ actions?: {
788
+ label: string;
789
+ id: string;
790
+ target: string;
791
+ method?: "GET" | "POST" | undefined;
792
+ }[] | undefined;
793
+ }>, z.ZodObject<{
794
+ props: z.ZodObject<{
795
+ variant: z.ZodEnum<["heading", "subheading", "body"]>;
796
+ text: z.ZodString;
797
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
798
+ variant: z.ZodEnum<["heading", "subheading", "body"]>;
799
+ text: z.ZodString;
800
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
801
+ variant: z.ZodEnum<["heading", "subheading", "body"]>;
802
+ text: z.ZodString;
803
+ }, z.ZodTypeAny, "passthrough">>;
804
+ id: z.ZodString;
805
+ requiredPermission: z.ZodOptional<z.ZodString>;
806
+ nodeVersion: z.ZodOptional<z.ZodNumber>;
807
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
808
+ prop: z.ZodString;
809
+ source: z.ZodString;
810
+ }, "strict", z.ZodTypeAny, {
811
+ prop: string;
812
+ source: string;
813
+ }, {
814
+ prop: string;
815
+ source: string;
816
+ }>, "many">>;
817
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
818
+ id: z.ZodString;
819
+ label: z.ZodString;
820
+ target: z.ZodString;
821
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
822
+ }, "strict", z.ZodTypeAny, {
823
+ label: string;
824
+ id: string;
825
+ target: string;
826
+ method?: "GET" | "POST" | undefined;
827
+ }, {
828
+ label: string;
829
+ id: string;
830
+ target: string;
831
+ method?: "GET" | "POST" | undefined;
832
+ }>, "many">>;
833
+ type: z.ZodLiteral<"text-block">;
834
+ }, "strict", z.ZodTypeAny, {
835
+ type: "text-block";
836
+ id: string;
837
+ props: {
838
+ variant: "heading" | "subheading" | "body";
839
+ text: string;
840
+ } & {
841
+ [k: string]: unknown;
842
+ };
843
+ requiredPermission?: string | undefined;
844
+ nodeVersion?: number | undefined;
845
+ bindings?: {
846
+ prop: string;
847
+ source: string;
848
+ }[] | undefined;
849
+ actions?: {
850
+ label: string;
851
+ id: string;
852
+ target: string;
853
+ method?: "GET" | "POST" | undefined;
854
+ }[] | undefined;
855
+ }, {
856
+ type: "text-block";
857
+ id: string;
858
+ props: {
859
+ variant: "heading" | "subheading" | "body";
860
+ text: string;
861
+ } & {
862
+ [k: string]: unknown;
863
+ };
864
+ requiredPermission?: string | undefined;
865
+ nodeVersion?: number | undefined;
866
+ bindings?: {
867
+ prop: string;
868
+ source: string;
869
+ }[] | undefined;
870
+ actions?: {
871
+ label: string;
872
+ id: string;
873
+ target: string;
874
+ method?: "GET" | "POST" | undefined;
875
+ }[] | undefined;
876
+ }>]>, "many">;
877
+ }, "strict", z.ZodTypeAny, {
878
+ version: "v1";
879
+ correlationId: string;
880
+ layout: {
881
+ type: "stack" | "grid";
882
+ columns?: number | undefined;
883
+ };
884
+ nodes: ({
885
+ type: "stat-card";
886
+ id: string;
887
+ props: {
888
+ label: string;
889
+ value: string | number;
890
+ unit?: string | undefined;
891
+ trend?: "up" | "down" | "flat" | undefined;
892
+ } & {
893
+ [k: string]: unknown;
894
+ };
895
+ requiredPermission?: string | undefined;
896
+ nodeVersion?: number | undefined;
897
+ bindings?: {
898
+ prop: string;
899
+ source: string;
900
+ }[] | undefined;
901
+ actions?: {
902
+ label: string;
903
+ id: string;
904
+ target: string;
905
+ method?: "GET" | "POST" | undefined;
906
+ }[] | undefined;
907
+ } | {
908
+ type: "data-table";
909
+ id: string;
910
+ props: {
911
+ columns: {
912
+ label: string;
913
+ key: string;
914
+ }[];
915
+ rows: Record<string, unknown>[];
916
+ title?: string | undefined;
917
+ } & {
918
+ [k: string]: unknown;
919
+ };
920
+ requiredPermission?: string | undefined;
921
+ nodeVersion?: number | undefined;
922
+ bindings?: {
923
+ prop: string;
924
+ source: string;
925
+ }[] | undefined;
926
+ actions?: {
927
+ label: string;
928
+ id: string;
929
+ target: string;
930
+ method?: "GET" | "POST" | undefined;
931
+ }[] | undefined;
932
+ } | {
933
+ type: "service-health";
934
+ id: string;
935
+ props: {
936
+ services: z.objectOutputType<{
937
+ name: z.ZodString;
938
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
939
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
940
+ }, z.ZodTypeAny, "passthrough">[];
941
+ title?: string | undefined;
942
+ } & {
943
+ [k: string]: unknown;
944
+ };
945
+ requiredPermission?: string | undefined;
946
+ nodeVersion?: number | undefined;
947
+ bindings?: {
948
+ prop: string;
949
+ source: string;
950
+ }[] | undefined;
951
+ actions?: {
952
+ label: string;
953
+ id: string;
954
+ target: string;
955
+ method?: "GET" | "POST" | undefined;
956
+ }[] | undefined;
957
+ } | {
958
+ type: "text-block";
959
+ id: string;
960
+ props: {
961
+ variant: "heading" | "subheading" | "body";
962
+ text: string;
963
+ } & {
964
+ [k: string]: unknown;
965
+ };
966
+ requiredPermission?: string | undefined;
967
+ nodeVersion?: number | undefined;
968
+ bindings?: {
969
+ prop: string;
970
+ source: string;
971
+ }[] | undefined;
972
+ actions?: {
973
+ label: string;
974
+ id: string;
975
+ target: string;
976
+ method?: "GET" | "POST" | undefined;
977
+ }[] | undefined;
978
+ })[];
979
+ }, {
980
+ version: "v1";
981
+ correlationId: string;
982
+ layout: {
983
+ type: "stack" | "grid";
984
+ columns?: number | undefined;
985
+ };
986
+ nodes: ({
987
+ type: "stat-card";
988
+ id: string;
989
+ props: {
990
+ label: string;
991
+ value: string | number;
992
+ unit?: string | undefined;
993
+ trend?: "up" | "down" | "flat" | undefined;
994
+ } & {
995
+ [k: string]: unknown;
996
+ };
997
+ requiredPermission?: string | undefined;
998
+ nodeVersion?: number | undefined;
999
+ bindings?: {
1000
+ prop: string;
1001
+ source: string;
1002
+ }[] | undefined;
1003
+ actions?: {
1004
+ label: string;
1005
+ id: string;
1006
+ target: string;
1007
+ method?: "GET" | "POST" | undefined;
1008
+ }[] | undefined;
1009
+ } | {
1010
+ type: "data-table";
1011
+ id: string;
1012
+ props: {
1013
+ columns: {
1014
+ label: string;
1015
+ key: string;
1016
+ }[];
1017
+ rows: Record<string, unknown>[];
1018
+ title?: string | undefined;
1019
+ } & {
1020
+ [k: string]: unknown;
1021
+ };
1022
+ requiredPermission?: string | undefined;
1023
+ nodeVersion?: number | undefined;
1024
+ bindings?: {
1025
+ prop: string;
1026
+ source: string;
1027
+ }[] | undefined;
1028
+ actions?: {
1029
+ label: string;
1030
+ id: string;
1031
+ target: string;
1032
+ method?: "GET" | "POST" | undefined;
1033
+ }[] | undefined;
1034
+ } | {
1035
+ type: "service-health";
1036
+ id: string;
1037
+ props: {
1038
+ services: z.objectInputType<{
1039
+ name: z.ZodString;
1040
+ state: z.ZodEnum<["running", "stopped", "unknown", "error"]>;
1041
+ health: z.ZodOptional<z.ZodEnum<["healthy", "unhealthy", "unknown"]>>;
1042
+ }, z.ZodTypeAny, "passthrough">[];
1043
+ title?: string | undefined;
1044
+ } & {
1045
+ [k: string]: unknown;
1046
+ };
1047
+ requiredPermission?: string | undefined;
1048
+ nodeVersion?: number | undefined;
1049
+ bindings?: {
1050
+ prop: string;
1051
+ source: string;
1052
+ }[] | undefined;
1053
+ actions?: {
1054
+ label: string;
1055
+ id: string;
1056
+ target: string;
1057
+ method?: "GET" | "POST" | undefined;
1058
+ }[] | undefined;
1059
+ } | {
1060
+ type: "text-block";
1061
+ id: string;
1062
+ props: {
1063
+ variant: "heading" | "subheading" | "body";
1064
+ text: string;
1065
+ } & {
1066
+ [k: string]: unknown;
1067
+ };
1068
+ requiredPermission?: string | undefined;
1069
+ nodeVersion?: number | undefined;
1070
+ bindings?: {
1071
+ prop: string;
1072
+ source: string;
1073
+ }[] | undefined;
1074
+ actions?: {
1075
+ label: string;
1076
+ id: string;
1077
+ target: string;
1078
+ method?: "GET" | "POST" | undefined;
1079
+ }[] | undefined;
1080
+ })[];
1081
+ }>;
1082
+ export interface ValidationResult {
1083
+ ok: boolean;
1084
+ data?: CanvasDefinition;
1085
+ errors?: string[];
1086
+ }
1087
+ /** Validate an unknown value as a CanvasDefinition. */
1088
+ export declare function validateCanvasDefinition(input: unknown): ValidationResult;
1089
+ /** The discriminant literals the zod union accepts (for conformance checks). */
1090
+ export declare const ZOD_NODE_TYPES: readonly CanvasNodeType[];
1091
+ //# sourceMappingURL=canvas.d.ts.map