@crasi/bisque-spec 0.0.0-stage → 0.3.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.
@@ -0,0 +1,870 @@
1
+ import { z } from "zod";
2
+ import { type Problem, type Role } from "@crasi/bisque-core";
3
+ import type { ContractDiff, ContractManifest } from "@crasi/bisque-contract";
4
+ import { type ArgExpr, type Draft } from "./schema.js";
5
+ /**
6
+ * Templates: a saved spec shared beyond its tenant, e.g. in a host's gallery
7
+ * of views other workspaces can add. A spec is pure data that every host
8
+ * re-validates against its own contract and the installer's role, and that
9
+ * runs on the installer's own data, so sharing one is not sharing code.
10
+ *
11
+ * What a template can carry from its author's tenant is text: titles,
12
+ * labels and the literal values in filters ("Metro", "TABAC"). Those may be
13
+ * names of the author's customers, so {@link templateDisclosure} lists them
14
+ * for the author to see before publishing.
15
+ */
16
+ export declare const TemplateSchema: z.ZodObject<{
17
+ format: z.ZodLiteral<1>;
18
+ kind: z.ZodLiteral<"template">;
19
+ app: z.ZodString;
20
+ contractVersion: z.ZodString;
21
+ draft: z.ZodObject<{
22
+ kind: z.ZodLiteral<"spec">;
23
+ body: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
25
+ data: z.ZodObject<{
26
+ scan: z.ZodString;
27
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ on: z.ZodString;
29
+ to: z.ZodString;
30
+ }, z.core.$strict>>>;
31
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
32
+ "!=": "!=";
33
+ "<": "<";
34
+ "<=": "<=";
35
+ "=": "=";
36
+ ">": ">";
37
+ ">=": ">=";
38
+ in: "in";
39
+ match: "match";
40
+ notIn: "notIn";
41
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
42
+ param: z.ZodString;
43
+ }, z.core.$strict>, z.ZodObject<{
44
+ today: z.ZodNumber;
45
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
46
+ param: z.ZodString;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ today: z.ZodNumber;
49
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
50
+ isNull: "isNull";
51
+ notNull: "notNull";
52
+ }>], null>]>>>;
53
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
55
+ as: z.ZodString;
56
+ sum: z.ZodString;
57
+ }, z.core.$strict>, z.ZodObject<{
58
+ as: z.ZodString;
59
+ avg: z.ZodString;
60
+ }, z.core.$strict>, z.ZodObject<{
61
+ as: z.ZodString;
62
+ min: z.ZodString;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ as: z.ZodString;
65
+ max: z.ZodString;
66
+ }, z.core.$strict>, z.ZodObject<{
67
+ as: z.ZodString;
68
+ count: z.ZodString;
69
+ }, z.core.$strict>, z.ZodObject<{
70
+ as: z.ZodString;
71
+ countDistinct: z.ZodString;
72
+ }, z.core.$strict>]>>>;
73
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
75
+ asc: "asc";
76
+ desc: "desc";
77
+ }>], null>>>;
78
+ limit: z.ZodNumber;
79
+ }, z.core.$strict>;
80
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
81
+ bind: z.ZodString;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ control: z.ZodLiteral<"slider">;
84
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
85
+ min: z.ZodNumber;
86
+ max: z.ZodNumber;
87
+ step: z.ZodOptional<z.ZodNumber>;
88
+ default: z.ZodNumber;
89
+ }, z.core.$strict>, z.ZodObject<{
90
+ control: z.ZodLiteral<"select">;
91
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
92
+ options: z.ZodArray<z.ZodObject<{
93
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
94
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
95
+ }, z.core.$strict>>;
96
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ control: z.ZodLiteral<"toggle">;
99
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
100
+ default: z.ZodBoolean;
101
+ }, z.core.$strict>]>>>;
102
+ onClick: z.ZodOptional<z.ZodObject<{
103
+ navigate: z.ZodString;
104
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
105
+ }, z.core.$strict>>;
106
+ component: z.ZodLiteral<"sankey">;
107
+ encode: z.ZodObject<{
108
+ source: z.ZodString;
109
+ target: z.ZodString;
110
+ value: z.ZodString;
111
+ label: z.ZodOptional<z.ZodEnum<{
112
+ "share-of-source": "share-of-source";
113
+ "share-of-total": "share-of-total";
114
+ value: "value";
115
+ }>>;
116
+ }, z.core.$strict>;
117
+ otherBucket: z.ZodOptional<z.ZodObject<{
118
+ maxTargets: z.ZodNumber;
119
+ }, z.core.$strict>>;
120
+ }, z.core.$strict>, z.ZodObject<{
121
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
122
+ data: z.ZodObject<{
123
+ scan: z.ZodString;
124
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
125
+ on: z.ZodString;
126
+ to: z.ZodString;
127
+ }, z.core.$strict>>>;
128
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
129
+ "!=": "!=";
130
+ "<": "<";
131
+ "<=": "<=";
132
+ "=": "=";
133
+ ">": ">";
134
+ ">=": ">=";
135
+ in: "in";
136
+ match: "match";
137
+ notIn: "notIn";
138
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
139
+ param: z.ZodString;
140
+ }, z.core.$strict>, z.ZodObject<{
141
+ today: z.ZodNumber;
142
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
143
+ param: z.ZodString;
144
+ }, z.core.$strict>, z.ZodObject<{
145
+ today: z.ZodNumber;
146
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
147
+ isNull: "isNull";
148
+ notNull: "notNull";
149
+ }>], null>]>>>;
150
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
151
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
152
+ as: z.ZodString;
153
+ sum: z.ZodString;
154
+ }, z.core.$strict>, z.ZodObject<{
155
+ as: z.ZodString;
156
+ avg: z.ZodString;
157
+ }, z.core.$strict>, z.ZodObject<{
158
+ as: z.ZodString;
159
+ min: z.ZodString;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ as: z.ZodString;
162
+ max: z.ZodString;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ as: z.ZodString;
165
+ count: z.ZodString;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ as: z.ZodString;
168
+ countDistinct: z.ZodString;
169
+ }, z.core.$strict>]>>>;
170
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
172
+ asc: "asc";
173
+ desc: "desc";
174
+ }>], null>>>;
175
+ limit: z.ZodNumber;
176
+ }, z.core.$strict>;
177
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
178
+ bind: z.ZodString;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ control: z.ZodLiteral<"slider">;
181
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
182
+ min: z.ZodNumber;
183
+ max: z.ZodNumber;
184
+ step: z.ZodOptional<z.ZodNumber>;
185
+ default: z.ZodNumber;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ control: z.ZodLiteral<"select">;
188
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
189
+ options: z.ZodArray<z.ZodObject<{
190
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
191
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
192
+ }, z.core.$strict>>;
193
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
194
+ }, z.core.$strict>, z.ZodObject<{
195
+ control: z.ZodLiteral<"toggle">;
196
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
197
+ default: z.ZodBoolean;
198
+ }, z.core.$strict>]>>>;
199
+ onClick: z.ZodOptional<z.ZodObject<{
200
+ navigate: z.ZodString;
201
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
202
+ }, z.core.$strict>>;
203
+ component: z.ZodLiteral<"bar">;
204
+ encode: z.ZodObject<{
205
+ x: z.ZodString;
206
+ y: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
207
+ series: z.ZodOptional<z.ZodString>;
208
+ stacked: z.ZodOptional<z.ZodBoolean>;
209
+ horizontal: z.ZodOptional<z.ZodBoolean>;
210
+ format: z.ZodOptional<z.ZodEnum<{
211
+ date: "date";
212
+ money: "money";
213
+ month: "month";
214
+ number: "number";
215
+ percent: "percent";
216
+ text: "text";
217
+ }>>;
218
+ }, z.core.$strict>;
219
+ otherBucket: z.ZodOptional<z.ZodObject<{
220
+ maxCategories: z.ZodNumber;
221
+ }, z.core.$strict>>;
222
+ }, z.core.$strict>, z.ZodObject<{
223
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
224
+ data: z.ZodObject<{
225
+ scan: z.ZodString;
226
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
227
+ on: z.ZodString;
228
+ to: z.ZodString;
229
+ }, z.core.$strict>>>;
230
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
231
+ "!=": "!=";
232
+ "<": "<";
233
+ "<=": "<=";
234
+ "=": "=";
235
+ ">": ">";
236
+ ">=": ">=";
237
+ in: "in";
238
+ match: "match";
239
+ notIn: "notIn";
240
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
241
+ param: z.ZodString;
242
+ }, z.core.$strict>, z.ZodObject<{
243
+ today: z.ZodNumber;
244
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
245
+ param: z.ZodString;
246
+ }, z.core.$strict>, z.ZodObject<{
247
+ today: z.ZodNumber;
248
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
249
+ isNull: "isNull";
250
+ notNull: "notNull";
251
+ }>], null>]>>>;
252
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
253
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
254
+ as: z.ZodString;
255
+ sum: z.ZodString;
256
+ }, z.core.$strict>, z.ZodObject<{
257
+ as: z.ZodString;
258
+ avg: z.ZodString;
259
+ }, z.core.$strict>, z.ZodObject<{
260
+ as: z.ZodString;
261
+ min: z.ZodString;
262
+ }, z.core.$strict>, z.ZodObject<{
263
+ as: z.ZodString;
264
+ max: z.ZodString;
265
+ }, z.core.$strict>, z.ZodObject<{
266
+ as: z.ZodString;
267
+ count: z.ZodString;
268
+ }, z.core.$strict>, z.ZodObject<{
269
+ as: z.ZodString;
270
+ countDistinct: z.ZodString;
271
+ }, z.core.$strict>]>>>;
272
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
273
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
274
+ asc: "asc";
275
+ desc: "desc";
276
+ }>], null>>>;
277
+ limit: z.ZodNumber;
278
+ }, z.core.$strict>;
279
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
280
+ bind: z.ZodString;
281
+ }, z.core.$strict>, z.ZodObject<{
282
+ control: z.ZodLiteral<"slider">;
283
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
284
+ min: z.ZodNumber;
285
+ max: z.ZodNumber;
286
+ step: z.ZodOptional<z.ZodNumber>;
287
+ default: z.ZodNumber;
288
+ }, z.core.$strict>, z.ZodObject<{
289
+ control: z.ZodLiteral<"select">;
290
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
291
+ options: z.ZodArray<z.ZodObject<{
292
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
293
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
294
+ }, z.core.$strict>>;
295
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ control: z.ZodLiteral<"toggle">;
298
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
299
+ default: z.ZodBoolean;
300
+ }, z.core.$strict>]>>>;
301
+ onClick: z.ZodOptional<z.ZodObject<{
302
+ navigate: z.ZodString;
303
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
304
+ }, z.core.$strict>>;
305
+ component: z.ZodLiteral<"line">;
306
+ encode: z.ZodObject<{
307
+ x: z.ZodString;
308
+ y: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
309
+ series: z.ZodOptional<z.ZodString>;
310
+ stacked: z.ZodOptional<z.ZodBoolean>;
311
+ horizontal: z.ZodOptional<z.ZodBoolean>;
312
+ format: z.ZodOptional<z.ZodEnum<{
313
+ date: "date";
314
+ money: "money";
315
+ month: "month";
316
+ number: "number";
317
+ percent: "percent";
318
+ text: "text";
319
+ }>>;
320
+ }, z.core.$strict>;
321
+ }, z.core.$strict>, z.ZodObject<{
322
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
323
+ data: z.ZodObject<{
324
+ scan: z.ZodString;
325
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
326
+ on: z.ZodString;
327
+ to: z.ZodString;
328
+ }, z.core.$strict>>>;
329
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
330
+ "!=": "!=";
331
+ "<": "<";
332
+ "<=": "<=";
333
+ "=": "=";
334
+ ">": ">";
335
+ ">=": ">=";
336
+ in: "in";
337
+ match: "match";
338
+ notIn: "notIn";
339
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
340
+ param: z.ZodString;
341
+ }, z.core.$strict>, z.ZodObject<{
342
+ today: z.ZodNumber;
343
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
344
+ param: z.ZodString;
345
+ }, z.core.$strict>, z.ZodObject<{
346
+ today: z.ZodNumber;
347
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
348
+ isNull: "isNull";
349
+ notNull: "notNull";
350
+ }>], null>]>>>;
351
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
352
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
353
+ as: z.ZodString;
354
+ sum: z.ZodString;
355
+ }, z.core.$strict>, z.ZodObject<{
356
+ as: z.ZodString;
357
+ avg: z.ZodString;
358
+ }, z.core.$strict>, z.ZodObject<{
359
+ as: z.ZodString;
360
+ min: z.ZodString;
361
+ }, z.core.$strict>, z.ZodObject<{
362
+ as: z.ZodString;
363
+ max: z.ZodString;
364
+ }, z.core.$strict>, z.ZodObject<{
365
+ as: z.ZodString;
366
+ count: z.ZodString;
367
+ }, z.core.$strict>, z.ZodObject<{
368
+ as: z.ZodString;
369
+ countDistinct: z.ZodString;
370
+ }, z.core.$strict>]>>>;
371
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
372
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
373
+ asc: "asc";
374
+ desc: "desc";
375
+ }>], null>>>;
376
+ limit: z.ZodNumber;
377
+ }, z.core.$strict>;
378
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
379
+ bind: z.ZodString;
380
+ }, z.core.$strict>, z.ZodObject<{
381
+ control: z.ZodLiteral<"slider">;
382
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
383
+ min: z.ZodNumber;
384
+ max: z.ZodNumber;
385
+ step: z.ZodOptional<z.ZodNumber>;
386
+ default: z.ZodNumber;
387
+ }, z.core.$strict>, z.ZodObject<{
388
+ control: z.ZodLiteral<"select">;
389
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
390
+ options: z.ZodArray<z.ZodObject<{
391
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
392
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
393
+ }, z.core.$strict>>;
394
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ control: z.ZodLiteral<"toggle">;
397
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
398
+ default: z.ZodBoolean;
399
+ }, z.core.$strict>]>>>;
400
+ onClick: z.ZodOptional<z.ZodObject<{
401
+ navigate: z.ZodString;
402
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
403
+ }, z.core.$strict>>;
404
+ component: z.ZodLiteral<"area">;
405
+ encode: z.ZodObject<{
406
+ x: z.ZodString;
407
+ y: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
408
+ series: z.ZodOptional<z.ZodString>;
409
+ stacked: z.ZodOptional<z.ZodBoolean>;
410
+ horizontal: z.ZodOptional<z.ZodBoolean>;
411
+ format: z.ZodOptional<z.ZodEnum<{
412
+ date: "date";
413
+ money: "money";
414
+ month: "month";
415
+ number: "number";
416
+ percent: "percent";
417
+ text: "text";
418
+ }>>;
419
+ }, z.core.$strict>;
420
+ }, z.core.$strict>, z.ZodObject<{
421
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
422
+ data: z.ZodObject<{
423
+ scan: z.ZodString;
424
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
425
+ on: z.ZodString;
426
+ to: z.ZodString;
427
+ }, z.core.$strict>>>;
428
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
429
+ "!=": "!=";
430
+ "<": "<";
431
+ "<=": "<=";
432
+ "=": "=";
433
+ ">": ">";
434
+ ">=": ">=";
435
+ in: "in";
436
+ match: "match";
437
+ notIn: "notIn";
438
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
439
+ param: z.ZodString;
440
+ }, z.core.$strict>, z.ZodObject<{
441
+ today: z.ZodNumber;
442
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
443
+ param: z.ZodString;
444
+ }, z.core.$strict>, z.ZodObject<{
445
+ today: z.ZodNumber;
446
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
447
+ isNull: "isNull";
448
+ notNull: "notNull";
449
+ }>], null>]>>>;
450
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
451
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
452
+ as: z.ZodString;
453
+ sum: z.ZodString;
454
+ }, z.core.$strict>, z.ZodObject<{
455
+ as: z.ZodString;
456
+ avg: z.ZodString;
457
+ }, z.core.$strict>, z.ZodObject<{
458
+ as: z.ZodString;
459
+ min: z.ZodString;
460
+ }, z.core.$strict>, z.ZodObject<{
461
+ as: z.ZodString;
462
+ max: z.ZodString;
463
+ }, z.core.$strict>, z.ZodObject<{
464
+ as: z.ZodString;
465
+ count: z.ZodString;
466
+ }, z.core.$strict>, z.ZodObject<{
467
+ as: z.ZodString;
468
+ countDistinct: z.ZodString;
469
+ }, z.core.$strict>]>>>;
470
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
471
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
472
+ asc: "asc";
473
+ desc: "desc";
474
+ }>], null>>>;
475
+ limit: z.ZodNumber;
476
+ }, z.core.$strict>;
477
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
478
+ bind: z.ZodString;
479
+ }, z.core.$strict>, z.ZodObject<{
480
+ control: z.ZodLiteral<"slider">;
481
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
482
+ min: z.ZodNumber;
483
+ max: z.ZodNumber;
484
+ step: z.ZodOptional<z.ZodNumber>;
485
+ default: z.ZodNumber;
486
+ }, z.core.$strict>, z.ZodObject<{
487
+ control: z.ZodLiteral<"select">;
488
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
489
+ options: z.ZodArray<z.ZodObject<{
490
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
491
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
492
+ }, z.core.$strict>>;
493
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
494
+ }, z.core.$strict>, z.ZodObject<{
495
+ control: z.ZodLiteral<"toggle">;
496
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
497
+ default: z.ZodBoolean;
498
+ }, z.core.$strict>]>>>;
499
+ onClick: z.ZodOptional<z.ZodObject<{
500
+ navigate: z.ZodString;
501
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
502
+ }, z.core.$strict>>;
503
+ component: z.ZodLiteral<"table">;
504
+ encode: z.ZodObject<{
505
+ columns: z.ZodArray<z.ZodObject<{
506
+ field: z.ZodString;
507
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
508
+ format: z.ZodOptional<z.ZodEnum<{
509
+ date: "date";
510
+ money: "money";
511
+ month: "month";
512
+ number: "number";
513
+ percent: "percent";
514
+ text: "text";
515
+ }>>;
516
+ }, z.core.$strict>>;
517
+ }, z.core.$strict>;
518
+ }, z.core.$strict>, z.ZodObject<{
519
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
520
+ data: z.ZodObject<{
521
+ scan: z.ZodString;
522
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
523
+ on: z.ZodString;
524
+ to: z.ZodString;
525
+ }, z.core.$strict>>>;
526
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
527
+ "!=": "!=";
528
+ "<": "<";
529
+ "<=": "<=";
530
+ "=": "=";
531
+ ">": ">";
532
+ ">=": ">=";
533
+ in: "in";
534
+ match: "match";
535
+ notIn: "notIn";
536
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
537
+ param: z.ZodString;
538
+ }, z.core.$strict>, z.ZodObject<{
539
+ today: z.ZodNumber;
540
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
541
+ param: z.ZodString;
542
+ }, z.core.$strict>, z.ZodObject<{
543
+ today: z.ZodNumber;
544
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
545
+ isNull: "isNull";
546
+ notNull: "notNull";
547
+ }>], null>]>>>;
548
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
549
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
550
+ as: z.ZodString;
551
+ sum: z.ZodString;
552
+ }, z.core.$strict>, z.ZodObject<{
553
+ as: z.ZodString;
554
+ avg: z.ZodString;
555
+ }, z.core.$strict>, z.ZodObject<{
556
+ as: z.ZodString;
557
+ min: z.ZodString;
558
+ }, z.core.$strict>, z.ZodObject<{
559
+ as: z.ZodString;
560
+ max: z.ZodString;
561
+ }, z.core.$strict>, z.ZodObject<{
562
+ as: z.ZodString;
563
+ count: z.ZodString;
564
+ }, z.core.$strict>, z.ZodObject<{
565
+ as: z.ZodString;
566
+ countDistinct: z.ZodString;
567
+ }, z.core.$strict>]>>>;
568
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
569
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
570
+ asc: "asc";
571
+ desc: "desc";
572
+ }>], null>>>;
573
+ limit: z.ZodNumber;
574
+ }, z.core.$strict>;
575
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
576
+ bind: z.ZodString;
577
+ }, z.core.$strict>, z.ZodObject<{
578
+ control: z.ZodLiteral<"slider">;
579
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
580
+ min: z.ZodNumber;
581
+ max: z.ZodNumber;
582
+ step: z.ZodOptional<z.ZodNumber>;
583
+ default: z.ZodNumber;
584
+ }, z.core.$strict>, z.ZodObject<{
585
+ control: z.ZodLiteral<"select">;
586
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
587
+ options: z.ZodArray<z.ZodObject<{
588
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
589
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
590
+ }, z.core.$strict>>;
591
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
592
+ }, z.core.$strict>, z.ZodObject<{
593
+ control: z.ZodLiteral<"toggle">;
594
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
595
+ default: z.ZodBoolean;
596
+ }, z.core.$strict>]>>>;
597
+ onClick: z.ZodOptional<z.ZodObject<{
598
+ navigate: z.ZodString;
599
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
600
+ }, z.core.$strict>>;
601
+ component: z.ZodLiteral<"kpi">;
602
+ encode: z.ZodObject<{
603
+ value: z.ZodString;
604
+ format: z.ZodOptional<z.ZodEnum<{
605
+ date: "date";
606
+ money: "money";
607
+ month: "month";
608
+ number: "number";
609
+ percent: "percent";
610
+ text: "text";
611
+ }>>;
612
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
613
+ }, z.core.$strict>;
614
+ }, z.core.$strict>, z.ZodObject<{
615
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
616
+ data: z.ZodObject<{
617
+ scan: z.ZodString;
618
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
619
+ on: z.ZodString;
620
+ to: z.ZodString;
621
+ }, z.core.$strict>>>;
622
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
623
+ "!=": "!=";
624
+ "<": "<";
625
+ "<=": "<=";
626
+ "=": "=";
627
+ ">": ">";
628
+ ">=": ">=";
629
+ in: "in";
630
+ match: "match";
631
+ notIn: "notIn";
632
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
633
+ param: z.ZodString;
634
+ }, z.core.$strict>, z.ZodObject<{
635
+ today: z.ZodNumber;
636
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
637
+ param: z.ZodString;
638
+ }, z.core.$strict>, z.ZodObject<{
639
+ today: z.ZodNumber;
640
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
641
+ isNull: "isNull";
642
+ notNull: "notNull";
643
+ }>], null>]>>>;
644
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
645
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
646
+ as: z.ZodString;
647
+ sum: z.ZodString;
648
+ }, z.core.$strict>, z.ZodObject<{
649
+ as: z.ZodString;
650
+ avg: z.ZodString;
651
+ }, z.core.$strict>, z.ZodObject<{
652
+ as: z.ZodString;
653
+ min: z.ZodString;
654
+ }, z.core.$strict>, z.ZodObject<{
655
+ as: z.ZodString;
656
+ max: z.ZodString;
657
+ }, z.core.$strict>, z.ZodObject<{
658
+ as: z.ZodString;
659
+ count: z.ZodString;
660
+ }, z.core.$strict>, z.ZodObject<{
661
+ as: z.ZodString;
662
+ countDistinct: z.ZodString;
663
+ }, z.core.$strict>]>>>;
664
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
665
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
666
+ asc: "asc";
667
+ desc: "desc";
668
+ }>], null>>>;
669
+ limit: z.ZodNumber;
670
+ }, z.core.$strict>;
671
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
672
+ bind: z.ZodString;
673
+ }, z.core.$strict>, z.ZodObject<{
674
+ control: z.ZodLiteral<"slider">;
675
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
676
+ min: z.ZodNumber;
677
+ max: z.ZodNumber;
678
+ step: z.ZodOptional<z.ZodNumber>;
679
+ default: z.ZodNumber;
680
+ }, z.core.$strict>, z.ZodObject<{
681
+ control: z.ZodLiteral<"select">;
682
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
683
+ options: z.ZodArray<z.ZodObject<{
684
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
685
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
686
+ }, z.core.$strict>>;
687
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
688
+ }, z.core.$strict>, z.ZodObject<{
689
+ control: z.ZodLiteral<"toggle">;
690
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
691
+ default: z.ZodBoolean;
692
+ }, z.core.$strict>]>>>;
693
+ onClick: z.ZodOptional<z.ZodObject<{
694
+ navigate: z.ZodString;
695
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
696
+ }, z.core.$strict>>;
697
+ component: z.ZodLiteral<"grid">;
698
+ encode: z.ZodObject<{
699
+ rowKey: z.ZodString;
700
+ columns: z.ZodArray<z.ZodObject<{
701
+ field: z.ZodString;
702
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
703
+ format: z.ZodOptional<z.ZodEnum<{
704
+ date: "date";
705
+ money: "money";
706
+ month: "month";
707
+ number: "number";
708
+ percent: "percent";
709
+ text: "text";
710
+ }>>;
711
+ edit: z.ZodOptional<z.ZodObject<{
712
+ intent: z.ZodString;
713
+ value: z.ZodString;
714
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
715
+ }, z.core.$strict>>;
716
+ }, z.core.$strict>>;
717
+ }, z.core.$strict>;
718
+ }, z.core.$strict>, z.ZodObject<{
719
+ title: z.ZodRecord<z.ZodString, z.ZodString>;
720
+ data: z.ZodObject<{
721
+ scan: z.ZodString;
722
+ join: z.ZodOptional<z.ZodArray<z.ZodObject<{
723
+ on: z.ZodString;
724
+ to: z.ZodString;
725
+ }, z.core.$strict>>>;
726
+ where: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodTuple<[z.ZodString, z.ZodEnum<{
727
+ "!=": "!=";
728
+ "<": "<";
729
+ "<=": "<=";
730
+ "=": "=";
731
+ ">": ">";
732
+ ">=": ">=";
733
+ in: "in";
734
+ match: "match";
735
+ notIn: "notIn";
736
+ }>, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
737
+ param: z.ZodString;
738
+ }, z.core.$strict>, z.ZodObject<{
739
+ today: z.ZodNumber;
740
+ }, z.core.$strict>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodObject<{
741
+ param: z.ZodString;
742
+ }, z.core.$strict>, z.ZodObject<{
743
+ today: z.ZodNumber;
744
+ }, z.core.$strict>]>>]>], null>, z.ZodTuple<[z.ZodString, z.ZodEnum<{
745
+ isNull: "isNull";
746
+ notNull: "notNull";
747
+ }>], null>]>>>;
748
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
749
+ measures: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
750
+ as: z.ZodString;
751
+ sum: z.ZodString;
752
+ }, z.core.$strict>, z.ZodObject<{
753
+ as: z.ZodString;
754
+ avg: z.ZodString;
755
+ }, z.core.$strict>, z.ZodObject<{
756
+ as: z.ZodString;
757
+ min: z.ZodString;
758
+ }, z.core.$strict>, z.ZodObject<{
759
+ as: z.ZodString;
760
+ max: z.ZodString;
761
+ }, z.core.$strict>, z.ZodObject<{
762
+ as: z.ZodString;
763
+ count: z.ZodString;
764
+ }, z.core.$strict>, z.ZodObject<{
765
+ as: z.ZodString;
766
+ countDistinct: z.ZodString;
767
+ }, z.core.$strict>]>>>;
768
+ select: z.ZodOptional<z.ZodArray<z.ZodString>>;
769
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodEnum<{
770
+ asc: "asc";
771
+ desc: "desc";
772
+ }>], null>>>;
773
+ limit: z.ZodNumber;
774
+ }, z.core.$strict>;
775
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
776
+ bind: z.ZodString;
777
+ }, z.core.$strict>, z.ZodObject<{
778
+ control: z.ZodLiteral<"slider">;
779
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
780
+ min: z.ZodNumber;
781
+ max: z.ZodNumber;
782
+ step: z.ZodOptional<z.ZodNumber>;
783
+ default: z.ZodNumber;
784
+ }, z.core.$strict>, z.ZodObject<{
785
+ control: z.ZodLiteral<"select">;
786
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
787
+ options: z.ZodArray<z.ZodObject<{
788
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
789
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
790
+ }, z.core.$strict>>;
791
+ default: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
792
+ }, z.core.$strict>, z.ZodObject<{
793
+ control: z.ZodLiteral<"toggle">;
794
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
795
+ default: z.ZodBoolean;
796
+ }, z.core.$strict>]>>>;
797
+ onClick: z.ZodOptional<z.ZodObject<{
798
+ navigate: z.ZodString;
799
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
800
+ }, z.core.$strict>>;
801
+ component: z.ZodLiteral<"actionTable">;
802
+ encode: z.ZodObject<{
803
+ rowKey: z.ZodString;
804
+ columns: z.ZodArray<z.ZodObject<{
805
+ field: z.ZodString;
806
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
807
+ format: z.ZodOptional<z.ZodEnum<{
808
+ date: "date";
809
+ money: "money";
810
+ month: "month";
811
+ number: "number";
812
+ percent: "percent";
813
+ text: "text";
814
+ }>>;
815
+ }, z.core.$strict>>;
816
+ inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
817
+ name: z.ZodString;
818
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
819
+ type: z.ZodEnum<{
820
+ number: "number";
821
+ text: "text";
822
+ }>;
823
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
824
+ min: z.ZodOptional<z.ZodNumber>;
825
+ max: z.ZodOptional<z.ZodNumber>;
826
+ }, z.core.$strict>>>;
827
+ action: z.ZodObject<{
828
+ intent: z.ZodString;
829
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
830
+ args: z.ZodRecord<z.ZodString, z.ZodType<ArgExpr, unknown, z.core.$ZodTypeInternals<ArgExpr, unknown>>>;
831
+ }, z.core.$strict>;
832
+ }, z.core.$strict>;
833
+ }, z.core.$strict>], "component">;
834
+ manifest: z.ZodObject<{
835
+ reads: z.ZodArray<z.ZodString>;
836
+ acts: z.ZodArray<z.ZodString>;
837
+ contributes: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
838
+ }, z.core.$strict>;
839
+ placement: z.ZodObject<{
840
+ slot: z.ZodString;
841
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
842
+ }, z.core.$strict>;
843
+ }, z.core.$strict>;
844
+ }, z.core.$strict>;
845
+ export type Template = z.infer<typeof TemplateSchema>;
846
+ /** Strips everything tenant-specific: owner, history, revision, visibility. Only the draft travels. */
847
+ export declare function toTemplate(draft: Draft, m: ContractManifest): Template;
848
+ export type TemplateDisclosure = {
849
+ /** Titles and labels, in every locale. */
850
+ text: string[];
851
+ /** Literal values the query filters on or passes to actions. */
852
+ values: string[];
853
+ };
854
+ /** Every piece of text a template would publish, for the author's consent. */
855
+ export declare function templateDisclosure(draft: Draft): TemplateDisclosure;
856
+ export type TemplateImport = {
857
+ ok: boolean;
858
+ problems: Problem[];
859
+ draft?: Draft;
860
+ migrated: boolean;
861
+ };
862
+ /**
863
+ * Turns a template into a draft for this host and this user: same app,
864
+ * renames applied, then the full host validation with the installer's role.
865
+ * The result is previewed and saved like any proposal.
866
+ */
867
+ export declare function fromTemplate(input: unknown, m: ContractManifest, opts: {
868
+ role: Role;
869
+ renames?: ContractDiff["renames"];
870
+ }): TemplateImport;