@adminiumjs/manifest 0.3.5 → 0.3.7

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 (66) hide show
  1. package/dist/capacity.d.ts +786 -0
  2. package/dist/capacity.d.ts.map +1 -0
  3. package/dist/capacity.js +717 -0
  4. package/dist/capacity.js.map +1 -0
  5. package/dist/documents.d.ts +91 -5
  6. package/dist/documents.d.ts.map +1 -1
  7. package/dist/documents.js +129 -32
  8. package/dist/documents.js.map +1 -1
  9. package/dist/formula.d.ts +114 -2
  10. package/dist/formula.d.ts.map +1 -1
  11. package/dist/formula.js +291 -5
  12. package/dist/formula.js.map +1 -1
  13. package/dist/index.d.ts +12 -6
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +12 -6
  16. package/dist/index.js.map +1 -1
  17. package/dist/marketplace-wire.d.ts +230 -0
  18. package/dist/marketplace-wire.d.ts.map +1 -0
  19. package/dist/marketplace-wire.js +138 -0
  20. package/dist/marketplace-wire.js.map +1 -0
  21. package/dist/outbox.d.ts +242 -27
  22. package/dist/outbox.d.ts.map +1 -1
  23. package/dist/outbox.js +553 -27
  24. package/dist/outbox.js.map +1 -1
  25. package/dist/plan-context.d.ts +28 -3
  26. package/dist/plan-context.d.ts.map +1 -1
  27. package/dist/plan-context.js +291 -14
  28. package/dist/plan-context.js.map +1 -1
  29. package/dist/plan-model.d.ts +58 -3
  30. package/dist/plan-model.d.ts.map +1 -1
  31. package/dist/public-access.d.ts +637 -0
  32. package/dist/public-access.d.ts.map +1 -1
  33. package/dist/public-access.js +1593 -12
  34. package/dist/public-access.js.map +1 -1
  35. package/dist/refs.d.ts +86 -0
  36. package/dist/refs.d.ts.map +1 -1
  37. package/dist/refs.js +186 -0
  38. package/dist/refs.js.map +1 -1
  39. package/dist/roles.d.ts +10 -2
  40. package/dist/roles.d.ts.map +1 -1
  41. package/dist/roles.js +27 -5
  42. package/dist/roles.js.map +1 -1
  43. package/dist/sample.d.ts +218 -2
  44. package/dist/sample.d.ts.map +1 -1
  45. package/dist/sample.js +145 -7
  46. package/dist/sample.js.map +1 -1
  47. package/dist/schema.d.ts +2860 -360
  48. package/dist/schema.d.ts.map +1 -1
  49. package/dist/schema.js +1002 -54
  50. package/dist/schema.js.map +1 -1
  51. package/dist/shapes.d.ts +5 -1
  52. package/dist/shapes.d.ts.map +1 -1
  53. package/dist/shapes.js +13 -3
  54. package/dist/shapes.js.map +1 -1
  55. package/dist/states.d.ts +342 -2
  56. package/dist/states.d.ts.map +1 -1
  57. package/dist/states.js +566 -7
  58. package/dist/states.js.map +1 -1
  59. package/dist/table-shapes.d.ts +47 -0
  60. package/dist/table-shapes.d.ts.map +1 -0
  61. package/dist/table-shapes.js +159 -0
  62. package/dist/table-shapes.js.map +1 -0
  63. package/dist/validate.d.ts.map +1 -1
  64. package/dist/validate.js +80 -2
  65. package/dist/validate.js.map +1 -1
  66. package/package.json +2 -2
@@ -0,0 +1,786 @@
1
+ /**
2
+ * `capacity` — how much of a pool a table's rows may take. One rule, three
3
+ * ways of naming the pool:
4
+ *
5
+ * - `slot` (the default, and the only kind before): rows add up per start
6
+ * time, a table in a restaurant or an order in a pickup slot. A rule with
7
+ * no `kind` is a slot rule, and its parse gives back exactly what was
8
+ * written — no `kind` is added — so a released app's stored rule reads the
9
+ * same as it always has.
10
+ * - `parent`: rows take from a limit held on the row they point at (tickets
11
+ * of a type, portions of a dish, uses of a code), within its sales window,
12
+ * up to a number per order, and within wider pools (`also`).
13
+ * - `night`: a stay takes one unit on every night from its arrival to the
14
+ * day before it leaves, from a pool counted in another table (the rooms of
15
+ * a type), less the ones out of service.
16
+ *
17
+ * A table may carry up to three rules as a list (a pool per room type and a
18
+ * pool per room on the same stays).
19
+ *
20
+ * `hold` makes a row count only while its hold has not ended, and only while
21
+ * its state is one of `hold.states` (a paid order counts whatever its old
22
+ * hold says). `reserved` keeps places that came back (a refunded ticket held
23
+ * for the waitlist) counted against the public while staff decide.
24
+ *
25
+ * Every table a rule names sits under a key called `table`, so the installer
26
+ * maps each of them to the real table. Columns of the rows a rule reaches
27
+ * through a foreign key (`via`) are named plainly and found at run time.
28
+ */
29
+ import { z } from 'zod';
30
+ import { type ColumnShape, type ReferenceIssue, type TableIndex, type TableShape } from './refs.js';
31
+ declare const slotRuleSchema: z.ZodObject<{
32
+ kind: z.ZodOptional<z.ZodLiteral<"slot">>;
33
+ slot: z.ZodString;
34
+ amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
35
+ perSlot: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
36
+ table: z.ZodString;
37
+ column: z.ZodString;
38
+ }, z.core.$strict>]>;
39
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
40
+ via: z.ZodOptional<z.ZodString>;
41
+ column: z.ZodString;
42
+ values: z.ZodArray<z.ZodString>;
43
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
44
+ via: z.ZodOptional<z.ZodString>;
45
+ column: z.ZodString;
46
+ values: z.ZodArray<z.ZodString>;
47
+ }, z.core.$strict>>]>>;
48
+ slotMinutes: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
49
+ table: z.ZodString;
50
+ column: z.ZodString;
51
+ }, z.core.$strict>]>;
52
+ windowDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
53
+ table: z.ZodString;
54
+ column: z.ZodString;
55
+ }, z.core.$strict>]>>;
56
+ opens: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
57
+ table: z.ZodString;
58
+ column: z.ZodString;
59
+ }, z.core.$strict>]>>;
60
+ closes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
61
+ table: z.ZodString;
62
+ column: z.ZodString;
63
+ }, z.core.$strict>]>>;
64
+ resource: z.ZodOptional<z.ZodString>;
65
+ cancelHours: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
66
+ table: z.ZodString;
67
+ column: z.ZodString;
68
+ }, z.core.$strict>]>>;
69
+ hours: z.ZodOptional<z.ZodObject<{
70
+ table: z.ZodString;
71
+ weekday: z.ZodString;
72
+ open: z.ZodOptional<z.ZodString>;
73
+ opens: z.ZodString;
74
+ closes: z.ZodString;
75
+ }, z.core.$strict>>;
76
+ closures: z.ZodOptional<z.ZodObject<{
77
+ table: z.ZodString;
78
+ from: z.ZodString;
79
+ to: z.ZodString;
80
+ active: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strict>>;
82
+ pauses: z.ZodOptional<z.ZodObject<{
83
+ table: z.ZodString;
84
+ slot: z.ZodString;
85
+ active: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strict>>;
87
+ noticeMinutes: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
88
+ table: z.ZodString;
89
+ column: z.ZodString;
90
+ }, z.core.$strict>]>>;
91
+ hold: z.ZodOptional<z.ZodObject<{
92
+ via: z.ZodOptional<z.ZodString>;
93
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
94
+ column: z.ZodString;
95
+ via: z.ZodOptional<z.ZodString>;
96
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
+ column: z.ZodString;
98
+ via: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strict>>>;
100
+ }, z.core.$strict>]>;
101
+ states: z.ZodArray<z.ZodString>;
102
+ }, z.core.$strict>>;
103
+ }, z.core.$strict>;
104
+ declare const parentRuleSchema: z.ZodObject<{
105
+ kind: z.ZodLiteral<"parent">;
106
+ via: z.ZodString;
107
+ size: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
108
+ table: z.ZodString;
109
+ column: z.ZodString;
110
+ }, z.core.$strict>]>, z.ZodObject<{
111
+ column: z.ZodString;
112
+ onDay: z.ZodOptional<z.ZodString>;
113
+ }, z.core.$strict>]>;
114
+ amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
115
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
116
+ via: z.ZodOptional<z.ZodString>;
117
+ column: z.ZodString;
118
+ values: z.ZodArray<z.ZodString>;
119
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
120
+ via: z.ZodOptional<z.ZodString>;
121
+ column: z.ZodString;
122
+ values: z.ZodArray<z.ZodString>;
123
+ }, z.core.$strict>>]>>;
124
+ window: z.ZodOptional<z.ZodObject<{
125
+ opens: z.ZodOptional<z.ZodString>;
126
+ closes: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strict>>;
128
+ perWrite: z.ZodOptional<z.ZodObject<{
129
+ max: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
130
+ table: z.ZodString;
131
+ column: z.ZodString;
132
+ }, z.core.$strict>]>, z.ZodObject<{
133
+ column: z.ZodString;
134
+ onDay: z.ZodOptional<z.ZodString>;
135
+ }, z.core.$strict>]>;
136
+ within: z.ZodString;
137
+ }, z.core.$strict>>;
138
+ also: z.ZodOptional<z.ZodArray<z.ZodObject<{
139
+ via: z.ZodString;
140
+ size: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
141
+ table: z.ZodString;
142
+ column: z.ZodString;
143
+ }, z.core.$strict>]>, z.ZodObject<{
144
+ column: z.ZodString;
145
+ onDay: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strict>]>, z.ZodObject<{
147
+ via: z.ZodString;
148
+ column: z.ZodString;
149
+ }, z.core.$strict>]>;
150
+ }, z.core.$strict>>>;
151
+ day: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
152
+ via: z.ZodOptional<z.ZodString>;
153
+ column: z.ZodString;
154
+ }, z.core.$strict>]>>;
155
+ lockBy: z.ZodOptional<z.ZodString>;
156
+ hold: z.ZodOptional<z.ZodObject<{
157
+ via: z.ZodOptional<z.ZodString>;
158
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
159
+ column: z.ZodString;
160
+ via: z.ZodOptional<z.ZodString>;
161
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
162
+ column: z.ZodString;
163
+ via: z.ZodOptional<z.ZodString>;
164
+ }, z.core.$strict>>>;
165
+ }, z.core.$strict>]>;
166
+ states: z.ZodArray<z.ZodString>;
167
+ }, z.core.$strict>>;
168
+ reserved: z.ZodOptional<z.ZodObject<{
169
+ via: z.ZodOptional<z.ZodString>;
170
+ states: z.ZodArray<z.ZodString>;
171
+ }, z.core.$strict>>;
172
+ }, z.core.$strict>;
173
+ declare const nightRuleSchema: z.ZodObject<{
174
+ kind: z.ZodLiteral<"night">;
175
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
176
+ via: z.ZodString;
177
+ column: z.ZodString;
178
+ }, z.core.$strict>]>;
179
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
180
+ via: z.ZodString;
181
+ column: z.ZodString;
182
+ }, z.core.$strict>]>;
183
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
184
+ via: z.ZodOptional<z.ZodString>;
185
+ column: z.ZodString;
186
+ values: z.ZodArray<z.ZodString>;
187
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
188
+ via: z.ZodOptional<z.ZodString>;
189
+ column: z.ZodString;
190
+ values: z.ZodArray<z.ZodString>;
191
+ }, z.core.$strict>>]>>;
192
+ pool: z.ZodUnion<readonly [z.ZodObject<{
193
+ via: z.ZodString;
194
+ count: z.ZodObject<{
195
+ table: z.ZodString;
196
+ column: z.ZodString;
197
+ outOfService: z.ZodOptional<z.ZodObject<{
198
+ table: z.ZodString;
199
+ room: z.ZodString;
200
+ from: z.ZodString;
201
+ to: z.ZodString;
202
+ active: z.ZodOptional<z.ZodString>;
203
+ }, z.core.$strict>>;
204
+ }, z.core.$strict>;
205
+ fits: z.ZodOptional<z.ZodObject<{
206
+ column: z.ZodString;
207
+ }, z.core.$strict>>;
208
+ given: z.ZodOptional<z.ZodObject<{
209
+ via: z.ZodString;
210
+ column: z.ZodString;
211
+ }, z.core.$strict>>;
212
+ }, z.core.$strict>, z.ZodObject<{
213
+ via: z.ZodString;
214
+ size: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodObject<{
215
+ column: z.ZodString;
216
+ }, z.core.$strict>]>;
217
+ outOfService: z.ZodOptional<z.ZodObject<{
218
+ table: z.ZodString;
219
+ room: z.ZodString;
220
+ from: z.ZodString;
221
+ to: z.ZodString;
222
+ active: z.ZodOptional<z.ZodString>;
223
+ }, z.core.$strict>>;
224
+ }, z.core.$strict>]>;
225
+ nights: z.ZodOptional<z.ZodObject<{
226
+ min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
227
+ table: z.ZodString;
228
+ column: z.ZodString;
229
+ }, z.core.$strict>]>>;
230
+ max: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
231
+ table: z.ZodString;
232
+ column: z.ZodString;
233
+ }, z.core.$strict>]>>;
234
+ minByArrival: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
235
+ mon: "mon";
236
+ tue: "tue";
237
+ wed: "wed";
238
+ thu: "thu";
239
+ fri: "fri";
240
+ sat: "sat";
241
+ sun: "sun";
242
+ }> & z.core.$partial, z.ZodNumber>>;
243
+ aheadDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
244
+ table: z.ZodString;
245
+ column: z.ZodString;
246
+ }, z.core.$strict>]>>;
247
+ }, z.core.$strict>>;
248
+ hold: z.ZodOptional<z.ZodObject<{
249
+ via: z.ZodOptional<z.ZodString>;
250
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
251
+ column: z.ZodString;
252
+ via: z.ZodOptional<z.ZodString>;
253
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
254
+ column: z.ZodString;
255
+ via: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$strict>>>;
257
+ }, z.core.$strict>]>;
258
+ states: z.ZodArray<z.ZodString>;
259
+ }, z.core.$strict>>;
260
+ arrived: z.ZodOptional<z.ZodObject<{
261
+ via: z.ZodOptional<z.ZodString>;
262
+ states: z.ZodArray<z.ZodString>;
263
+ }, z.core.$strict>>;
264
+ }, z.core.$strict>;
265
+ /** One limit on a table: a slot rule (with or without `kind`), a parent rule or a night rule. */
266
+ export declare const capacityRuleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
267
+ kind: z.ZodOptional<z.ZodLiteral<"slot">>;
268
+ slot: z.ZodString;
269
+ amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
270
+ perSlot: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
271
+ table: z.ZodString;
272
+ column: z.ZodString;
273
+ }, z.core.$strict>]>;
274
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
275
+ via: z.ZodOptional<z.ZodString>;
276
+ column: z.ZodString;
277
+ values: z.ZodArray<z.ZodString>;
278
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
279
+ via: z.ZodOptional<z.ZodString>;
280
+ column: z.ZodString;
281
+ values: z.ZodArray<z.ZodString>;
282
+ }, z.core.$strict>>]>>;
283
+ slotMinutes: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
284
+ table: z.ZodString;
285
+ column: z.ZodString;
286
+ }, z.core.$strict>]>;
287
+ windowDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
288
+ table: z.ZodString;
289
+ column: z.ZodString;
290
+ }, z.core.$strict>]>>;
291
+ opens: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
292
+ table: z.ZodString;
293
+ column: z.ZodString;
294
+ }, z.core.$strict>]>>;
295
+ closes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
296
+ table: z.ZodString;
297
+ column: z.ZodString;
298
+ }, z.core.$strict>]>>;
299
+ resource: z.ZodOptional<z.ZodString>;
300
+ cancelHours: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
301
+ table: z.ZodString;
302
+ column: z.ZodString;
303
+ }, z.core.$strict>]>>;
304
+ hours: z.ZodOptional<z.ZodObject<{
305
+ table: z.ZodString;
306
+ weekday: z.ZodString;
307
+ open: z.ZodOptional<z.ZodString>;
308
+ opens: z.ZodString;
309
+ closes: z.ZodString;
310
+ }, z.core.$strict>>;
311
+ closures: z.ZodOptional<z.ZodObject<{
312
+ table: z.ZodString;
313
+ from: z.ZodString;
314
+ to: z.ZodString;
315
+ active: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strict>>;
317
+ pauses: z.ZodOptional<z.ZodObject<{
318
+ table: z.ZodString;
319
+ slot: z.ZodString;
320
+ active: z.ZodOptional<z.ZodString>;
321
+ }, z.core.$strict>>;
322
+ noticeMinutes: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
323
+ table: z.ZodString;
324
+ column: z.ZodString;
325
+ }, z.core.$strict>]>>;
326
+ hold: z.ZodOptional<z.ZodObject<{
327
+ via: z.ZodOptional<z.ZodString>;
328
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
329
+ column: z.ZodString;
330
+ via: z.ZodOptional<z.ZodString>;
331
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
332
+ column: z.ZodString;
333
+ via: z.ZodOptional<z.ZodString>;
334
+ }, z.core.$strict>>>;
335
+ }, z.core.$strict>]>;
336
+ states: z.ZodArray<z.ZodString>;
337
+ }, z.core.$strict>>;
338
+ }, z.core.$strict>, z.ZodObject<{
339
+ kind: z.ZodLiteral<"parent">;
340
+ via: z.ZodString;
341
+ size: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
342
+ table: z.ZodString;
343
+ column: z.ZodString;
344
+ }, z.core.$strict>]>, z.ZodObject<{
345
+ column: z.ZodString;
346
+ onDay: z.ZodOptional<z.ZodString>;
347
+ }, z.core.$strict>]>;
348
+ amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
349
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
350
+ via: z.ZodOptional<z.ZodString>;
351
+ column: z.ZodString;
352
+ values: z.ZodArray<z.ZodString>;
353
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
354
+ via: z.ZodOptional<z.ZodString>;
355
+ column: z.ZodString;
356
+ values: z.ZodArray<z.ZodString>;
357
+ }, z.core.$strict>>]>>;
358
+ window: z.ZodOptional<z.ZodObject<{
359
+ opens: z.ZodOptional<z.ZodString>;
360
+ closes: z.ZodOptional<z.ZodString>;
361
+ }, z.core.$strict>>;
362
+ perWrite: z.ZodOptional<z.ZodObject<{
363
+ max: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
364
+ table: z.ZodString;
365
+ column: z.ZodString;
366
+ }, z.core.$strict>]>, z.ZodObject<{
367
+ column: z.ZodString;
368
+ onDay: z.ZodOptional<z.ZodString>;
369
+ }, z.core.$strict>]>;
370
+ within: z.ZodString;
371
+ }, z.core.$strict>>;
372
+ also: z.ZodOptional<z.ZodArray<z.ZodObject<{
373
+ via: z.ZodString;
374
+ size: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
375
+ table: z.ZodString;
376
+ column: z.ZodString;
377
+ }, z.core.$strict>]>, z.ZodObject<{
378
+ column: z.ZodString;
379
+ onDay: z.ZodOptional<z.ZodString>;
380
+ }, z.core.$strict>]>, z.ZodObject<{
381
+ via: z.ZodString;
382
+ column: z.ZodString;
383
+ }, z.core.$strict>]>;
384
+ }, z.core.$strict>>>;
385
+ day: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
386
+ via: z.ZodOptional<z.ZodString>;
387
+ column: z.ZodString;
388
+ }, z.core.$strict>]>>;
389
+ lockBy: z.ZodOptional<z.ZodString>;
390
+ hold: z.ZodOptional<z.ZodObject<{
391
+ via: z.ZodOptional<z.ZodString>;
392
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
393
+ column: z.ZodString;
394
+ via: z.ZodOptional<z.ZodString>;
395
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
396
+ column: z.ZodString;
397
+ via: z.ZodOptional<z.ZodString>;
398
+ }, z.core.$strict>>>;
399
+ }, z.core.$strict>]>;
400
+ states: z.ZodArray<z.ZodString>;
401
+ }, z.core.$strict>>;
402
+ reserved: z.ZodOptional<z.ZodObject<{
403
+ via: z.ZodOptional<z.ZodString>;
404
+ states: z.ZodArray<z.ZodString>;
405
+ }, z.core.$strict>>;
406
+ }, z.core.$strict>, z.ZodObject<{
407
+ kind: z.ZodLiteral<"night">;
408
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
409
+ via: z.ZodString;
410
+ column: z.ZodString;
411
+ }, z.core.$strict>]>;
412
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
413
+ via: z.ZodString;
414
+ column: z.ZodString;
415
+ }, z.core.$strict>]>;
416
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
417
+ via: z.ZodOptional<z.ZodString>;
418
+ column: z.ZodString;
419
+ values: z.ZodArray<z.ZodString>;
420
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
421
+ via: z.ZodOptional<z.ZodString>;
422
+ column: z.ZodString;
423
+ values: z.ZodArray<z.ZodString>;
424
+ }, z.core.$strict>>]>>;
425
+ pool: z.ZodUnion<readonly [z.ZodObject<{
426
+ via: z.ZodString;
427
+ count: z.ZodObject<{
428
+ table: z.ZodString;
429
+ column: z.ZodString;
430
+ outOfService: z.ZodOptional<z.ZodObject<{
431
+ table: z.ZodString;
432
+ room: z.ZodString;
433
+ from: z.ZodString;
434
+ to: z.ZodString;
435
+ active: z.ZodOptional<z.ZodString>;
436
+ }, z.core.$strict>>;
437
+ }, z.core.$strict>;
438
+ fits: z.ZodOptional<z.ZodObject<{
439
+ column: z.ZodString;
440
+ }, z.core.$strict>>;
441
+ given: z.ZodOptional<z.ZodObject<{
442
+ via: z.ZodString;
443
+ column: z.ZodString;
444
+ }, z.core.$strict>>;
445
+ }, z.core.$strict>, z.ZodObject<{
446
+ via: z.ZodString;
447
+ size: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodObject<{
448
+ column: z.ZodString;
449
+ }, z.core.$strict>]>;
450
+ outOfService: z.ZodOptional<z.ZodObject<{
451
+ table: z.ZodString;
452
+ room: z.ZodString;
453
+ from: z.ZodString;
454
+ to: z.ZodString;
455
+ active: z.ZodOptional<z.ZodString>;
456
+ }, z.core.$strict>>;
457
+ }, z.core.$strict>]>;
458
+ nights: z.ZodOptional<z.ZodObject<{
459
+ min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
460
+ table: z.ZodString;
461
+ column: z.ZodString;
462
+ }, z.core.$strict>]>>;
463
+ max: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
464
+ table: z.ZodString;
465
+ column: z.ZodString;
466
+ }, z.core.$strict>]>>;
467
+ minByArrival: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
468
+ mon: "mon";
469
+ tue: "tue";
470
+ wed: "wed";
471
+ thu: "thu";
472
+ fri: "fri";
473
+ sat: "sat";
474
+ sun: "sun";
475
+ }> & z.core.$partial, z.ZodNumber>>;
476
+ aheadDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
477
+ table: z.ZodString;
478
+ column: z.ZodString;
479
+ }, z.core.$strict>]>>;
480
+ }, z.core.$strict>>;
481
+ hold: z.ZodOptional<z.ZodObject<{
482
+ via: z.ZodOptional<z.ZodString>;
483
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
484
+ column: z.ZodString;
485
+ via: z.ZodOptional<z.ZodString>;
486
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
487
+ column: z.ZodString;
488
+ via: z.ZodOptional<z.ZodString>;
489
+ }, z.core.$strict>>>;
490
+ }, z.core.$strict>]>;
491
+ states: z.ZodArray<z.ZodString>;
492
+ }, z.core.$strict>>;
493
+ arrived: z.ZodOptional<z.ZodObject<{
494
+ via: z.ZodOptional<z.ZodString>;
495
+ states: z.ZodArray<z.ZodString>;
496
+ }, z.core.$strict>>;
497
+ }, z.core.$strict>], "kind">;
498
+ export type CapacityRule = z.infer<typeof capacityRuleSchema>;
499
+ export type SlotCapacityRule = z.infer<typeof slotRuleSchema>;
500
+ export type ParentCapacityRule = z.infer<typeof parentRuleSchema>;
501
+ export type NightCapacityRule = z.infer<typeof nightRuleSchema>;
502
+ export type CapacityKind = 'slot' | 'parent' | 'night';
503
+ /** Up to three limits on one table. */
504
+ export declare const capacityListSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
505
+ kind: z.ZodOptional<z.ZodLiteral<"slot">>;
506
+ slot: z.ZodString;
507
+ amount: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
508
+ perSlot: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
509
+ table: z.ZodString;
510
+ column: z.ZodString;
511
+ }, z.core.$strict>]>;
512
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
513
+ via: z.ZodOptional<z.ZodString>;
514
+ column: z.ZodString;
515
+ values: z.ZodArray<z.ZodString>;
516
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
517
+ via: z.ZodOptional<z.ZodString>;
518
+ column: z.ZodString;
519
+ values: z.ZodArray<z.ZodString>;
520
+ }, z.core.$strict>>]>>;
521
+ slotMinutes: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
522
+ table: z.ZodString;
523
+ column: z.ZodString;
524
+ }, z.core.$strict>]>;
525
+ windowDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
526
+ table: z.ZodString;
527
+ column: z.ZodString;
528
+ }, z.core.$strict>]>>;
529
+ opens: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
530
+ table: z.ZodString;
531
+ column: z.ZodString;
532
+ }, z.core.$strict>]>>;
533
+ closes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
534
+ table: z.ZodString;
535
+ column: z.ZodString;
536
+ }, z.core.$strict>]>>;
537
+ resource: z.ZodOptional<z.ZodString>;
538
+ cancelHours: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
539
+ table: z.ZodString;
540
+ column: z.ZodString;
541
+ }, z.core.$strict>]>>;
542
+ hours: z.ZodOptional<z.ZodObject<{
543
+ table: z.ZodString;
544
+ weekday: z.ZodString;
545
+ open: z.ZodOptional<z.ZodString>;
546
+ opens: z.ZodString;
547
+ closes: z.ZodString;
548
+ }, z.core.$strict>>;
549
+ closures: z.ZodOptional<z.ZodObject<{
550
+ table: z.ZodString;
551
+ from: z.ZodString;
552
+ to: z.ZodString;
553
+ active: z.ZodOptional<z.ZodString>;
554
+ }, z.core.$strict>>;
555
+ pauses: z.ZodOptional<z.ZodObject<{
556
+ table: z.ZodString;
557
+ slot: z.ZodString;
558
+ active: z.ZodOptional<z.ZodString>;
559
+ }, z.core.$strict>>;
560
+ noticeMinutes: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
561
+ table: z.ZodString;
562
+ column: z.ZodString;
563
+ }, z.core.$strict>]>>;
564
+ hold: z.ZodOptional<z.ZodObject<{
565
+ via: z.ZodOptional<z.ZodString>;
566
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
567
+ column: z.ZodString;
568
+ via: z.ZodOptional<z.ZodString>;
569
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
570
+ column: z.ZodString;
571
+ via: z.ZodOptional<z.ZodString>;
572
+ }, z.core.$strict>>>;
573
+ }, z.core.$strict>]>;
574
+ states: z.ZodArray<z.ZodString>;
575
+ }, z.core.$strict>>;
576
+ }, z.core.$strict>, z.ZodObject<{
577
+ kind: z.ZodLiteral<"parent">;
578
+ via: z.ZodString;
579
+ size: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
580
+ table: z.ZodString;
581
+ column: z.ZodString;
582
+ }, z.core.$strict>]>, z.ZodObject<{
583
+ column: z.ZodString;
584
+ onDay: z.ZodOptional<z.ZodString>;
585
+ }, z.core.$strict>]>;
586
+ amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
587
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
588
+ via: z.ZodOptional<z.ZodString>;
589
+ column: z.ZodString;
590
+ values: z.ZodArray<z.ZodString>;
591
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
592
+ via: z.ZodOptional<z.ZodString>;
593
+ column: z.ZodString;
594
+ values: z.ZodArray<z.ZodString>;
595
+ }, z.core.$strict>>]>>;
596
+ window: z.ZodOptional<z.ZodObject<{
597
+ opens: z.ZodOptional<z.ZodString>;
598
+ closes: z.ZodOptional<z.ZodString>;
599
+ }, z.core.$strict>>;
600
+ perWrite: z.ZodOptional<z.ZodObject<{
601
+ max: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
602
+ table: z.ZodString;
603
+ column: z.ZodString;
604
+ }, z.core.$strict>]>, z.ZodObject<{
605
+ column: z.ZodString;
606
+ onDay: z.ZodOptional<z.ZodString>;
607
+ }, z.core.$strict>]>;
608
+ within: z.ZodString;
609
+ }, z.core.$strict>>;
610
+ also: z.ZodOptional<z.ZodArray<z.ZodObject<{
611
+ via: z.ZodString;
612
+ size: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
613
+ table: z.ZodString;
614
+ column: z.ZodString;
615
+ }, z.core.$strict>]>, z.ZodObject<{
616
+ column: z.ZodString;
617
+ onDay: z.ZodOptional<z.ZodString>;
618
+ }, z.core.$strict>]>, z.ZodObject<{
619
+ via: z.ZodString;
620
+ column: z.ZodString;
621
+ }, z.core.$strict>]>;
622
+ }, z.core.$strict>>>;
623
+ day: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
624
+ via: z.ZodOptional<z.ZodString>;
625
+ column: z.ZodString;
626
+ }, z.core.$strict>]>>;
627
+ lockBy: z.ZodOptional<z.ZodString>;
628
+ hold: z.ZodOptional<z.ZodObject<{
629
+ via: z.ZodOptional<z.ZodString>;
630
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
631
+ column: z.ZodString;
632
+ via: z.ZodOptional<z.ZodString>;
633
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
634
+ column: z.ZodString;
635
+ via: z.ZodOptional<z.ZodString>;
636
+ }, z.core.$strict>>>;
637
+ }, z.core.$strict>]>;
638
+ states: z.ZodArray<z.ZodString>;
639
+ }, z.core.$strict>>;
640
+ reserved: z.ZodOptional<z.ZodObject<{
641
+ via: z.ZodOptional<z.ZodString>;
642
+ states: z.ZodArray<z.ZodString>;
643
+ }, z.core.$strict>>;
644
+ }, z.core.$strict>, z.ZodObject<{
645
+ kind: z.ZodLiteral<"night">;
646
+ from: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
647
+ via: z.ZodString;
648
+ column: z.ZodString;
649
+ }, z.core.$strict>]>;
650
+ to: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
651
+ via: z.ZodString;
652
+ column: z.ZodString;
653
+ }, z.core.$strict>]>;
654
+ countWhere: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
655
+ via: z.ZodOptional<z.ZodString>;
656
+ column: z.ZodString;
657
+ values: z.ZodArray<z.ZodString>;
658
+ }, z.core.$strict>, z.ZodArray<z.ZodObject<{
659
+ via: z.ZodOptional<z.ZodString>;
660
+ column: z.ZodString;
661
+ values: z.ZodArray<z.ZodString>;
662
+ }, z.core.$strict>>]>>;
663
+ pool: z.ZodUnion<readonly [z.ZodObject<{
664
+ via: z.ZodString;
665
+ count: z.ZodObject<{
666
+ table: z.ZodString;
667
+ column: z.ZodString;
668
+ outOfService: z.ZodOptional<z.ZodObject<{
669
+ table: z.ZodString;
670
+ room: z.ZodString;
671
+ from: z.ZodString;
672
+ to: z.ZodString;
673
+ active: z.ZodOptional<z.ZodString>;
674
+ }, z.core.$strict>>;
675
+ }, z.core.$strict>;
676
+ fits: z.ZodOptional<z.ZodObject<{
677
+ column: z.ZodString;
678
+ }, z.core.$strict>>;
679
+ given: z.ZodOptional<z.ZodObject<{
680
+ via: z.ZodString;
681
+ column: z.ZodString;
682
+ }, z.core.$strict>>;
683
+ }, z.core.$strict>, z.ZodObject<{
684
+ via: z.ZodString;
685
+ size: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodObject<{
686
+ column: z.ZodString;
687
+ }, z.core.$strict>]>;
688
+ outOfService: z.ZodOptional<z.ZodObject<{
689
+ table: z.ZodString;
690
+ room: z.ZodString;
691
+ from: z.ZodString;
692
+ to: z.ZodString;
693
+ active: z.ZodOptional<z.ZodString>;
694
+ }, z.core.$strict>>;
695
+ }, z.core.$strict>]>;
696
+ nights: z.ZodOptional<z.ZodObject<{
697
+ min: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
698
+ table: z.ZodString;
699
+ column: z.ZodString;
700
+ }, z.core.$strict>]>>;
701
+ max: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
702
+ table: z.ZodString;
703
+ column: z.ZodString;
704
+ }, z.core.$strict>]>>;
705
+ minByArrival: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
706
+ mon: "mon";
707
+ tue: "tue";
708
+ wed: "wed";
709
+ thu: "thu";
710
+ fri: "fri";
711
+ sat: "sat";
712
+ sun: "sun";
713
+ }> & z.core.$partial, z.ZodNumber>>;
714
+ aheadDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
715
+ table: z.ZodString;
716
+ column: z.ZodString;
717
+ }, z.core.$strict>]>>;
718
+ }, z.core.$strict>>;
719
+ hold: z.ZodOptional<z.ZodObject<{
720
+ via: z.ZodOptional<z.ZodString>;
721
+ column: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
722
+ column: z.ZodString;
723
+ via: z.ZodOptional<z.ZodString>;
724
+ or: z.ZodOptional<z.ZodArray<z.ZodObject<{
725
+ column: z.ZodString;
726
+ via: z.ZodOptional<z.ZodString>;
727
+ }, z.core.$strict>>>;
728
+ }, z.core.$strict>]>;
729
+ states: z.ZodArray<z.ZodString>;
730
+ }, z.core.$strict>>;
731
+ arrived: z.ZodOptional<z.ZodObject<{
732
+ via: z.ZodOptional<z.ZodString>;
733
+ states: z.ZodArray<z.ZodString>;
734
+ }, z.core.$strict>>;
735
+ }, z.core.$strict>], "kind">>;
736
+ /** One rule or a list of them, as a table declares it. */
737
+ export type Capacity = CapacityRule | CapacityRule[];
738
+ /**
739
+ * `capacity` on a table: one rule, or a list of up to three. Parsed by the
740
+ * schema of the form written, so a mistake is named where it is (a union of
741
+ * the two would only say the input is invalid). What comes back is what was
742
+ * written: nothing is added.
743
+ */
744
+ export declare const capacitySchema: z.ZodCustom<Capacity, Capacity>;
745
+ /** A table's limits as a list, whichever form it wrote. */
746
+ export declare function rulesOf(capacity: Capacity | undefined): CapacityRule[];
747
+ /** The kind of a rule: a rule that names none is a slot rule. */
748
+ export declare function kindOf(rule: CapacityRule): CapacityKind;
749
+ /**
750
+ * Whether a table's capacity is the one rule a released app writes: a single
751
+ * slot rule with only the keys it had before kinds, its `amount` a column and
752
+ * its `countWhere` one condition on the row itself.
753
+ */
754
+ export declare function isLegacyCapacity(capacity: Capacity | undefined): boolean;
755
+ /**
756
+ * Everything in a table's capacity that names something the manifest does
757
+ * not declare, or a column of the wrong kind. A released app's rule (see
758
+ * {@link isLegacyCapacity}) gets exactly the checks it always had, so no app
759
+ * that validated before is refused now.
760
+ */
761
+ export declare function capacityIssues(table: TableShape, capacity: Capacity, index: TableIndex, at: (...rest: (string | number)[]) => (string | number)[]): ReferenceIssue[];
762
+ /**
763
+ * The foreign keys a limit counts by, on `tableRef`: the pool's, a wider
764
+ * pool's, the per-order key and the owner's. A plain index on one of them
765
+ * keeps the count from reading the whole table.
766
+ */
767
+ export declare function capacityViaColumns(capacity: Capacity | undefined): string[];
768
+ /**
769
+ * Columns marked `index: true`: each must be a foreign key a limit or a total
770
+ * counts by (a capacity's `via`, or the `via` of a rollup that adds up this
771
+ * table's rows), and not already unique.
772
+ */
773
+ export declare function viaIndexIssues(tables: readonly (TableShape<ColumnShape & {
774
+ index?: true | undefined;
775
+ unique?: true | undefined;
776
+ rules?: {
777
+ rollup?: {
778
+ from: string;
779
+ via: string;
780
+ } | undefined;
781
+ } | undefined;
782
+ }> & {
783
+ capacity?: Capacity | undefined;
784
+ })[]): ReferenceIssue[];
785
+ export {};
786
+ //# sourceMappingURL=capacity.d.ts.map