@kitsuden/shared 0.0.0-stage → 0.9.0-beta

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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -2
  3. package/dist/admin-registry-contract.d.ts +99 -0
  4. package/dist/admin-registry-contract.d.ts.map +1 -0
  5. package/dist/admin-view.d.ts +123 -0
  6. package/dist/admin-view.d.ts.map +1 -0
  7. package/dist/agent-permission.d.ts +161 -0
  8. package/dist/agent-permission.d.ts.map +1 -0
  9. package/dist/approvals.d.ts +164 -0
  10. package/dist/approvals.d.ts.map +1 -0
  11. package/dist/automation.d.ts +175 -0
  12. package/dist/automation.d.ts.map +1 -0
  13. package/dist/block-keys.d.ts +82 -0
  14. package/dist/block-keys.d.ts.map +1 -0
  15. package/dist/code-scan.d.ts +64 -0
  16. package/dist/code-scan.d.ts.map +1 -0
  17. package/dist/comment-subjects.d.ts +129 -0
  18. package/dist/comment-subjects.d.ts.map +1 -0
  19. package/dist/connections.d.ts +96 -0
  20. package/dist/connections.d.ts.map +1 -0
  21. package/dist/constants.d.ts +37 -0
  22. package/dist/constants.d.ts.map +1 -0
  23. package/dist/content-publishing.d.ts +34 -0
  24. package/dist/content-publishing.d.ts.map +1 -0
  25. package/dist/contracts.d.ts +87 -0
  26. package/dist/contracts.d.ts.map +1 -0
  27. package/dist/dataset-catalog.d.ts +91 -0
  28. package/dist/dataset-catalog.d.ts.map +1 -0
  29. package/dist/deck-analysis.d.ts +63 -0
  30. package/dist/deck-analysis.d.ts.map +1 -0
  31. package/dist/env.d.ts +2 -0
  32. package/dist/env.d.ts.map +1 -0
  33. package/dist/errors.d.ts +275 -0
  34. package/dist/errors.d.ts.map +1 -0
  35. package/dist/field-types.d.ts +304 -0
  36. package/dist/field-types.d.ts.map +1 -0
  37. package/dist/index.d.ts +79 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +7785 -0
  40. package/dist/kon-api.d.ts +914 -0
  41. package/dist/kon-api.d.ts.map +1 -0
  42. package/dist/kon-entities.d.ts +204 -0
  43. package/dist/kon-entities.d.ts.map +1 -0
  44. package/dist/kon-events.d.ts +103 -0
  45. package/dist/kon-events.d.ts.map +1 -0
  46. package/dist/kon-package.d.ts +124 -0
  47. package/dist/kon-package.d.ts.map +1 -0
  48. package/dist/link-relations.d.ts +73 -0
  49. package/dist/link-relations.d.ts.map +1 -0
  50. package/dist/meta-levels.d.ts +81 -0
  51. package/dist/meta-levels.d.ts.map +1 -0
  52. package/dist/models-sql.d.ts +110 -0
  53. package/dist/models-sql.d.ts.map +1 -0
  54. package/dist/models.d.ts +354 -0
  55. package/dist/models.d.ts.map +1 -0
  56. package/dist/operations.d.ts +428 -0
  57. package/dist/operations.d.ts.map +1 -0
  58. package/dist/promotion.d.ts +244 -0
  59. package/dist/promotion.d.ts.map +1 -0
  60. package/dist/public-site.d.ts +106 -0
  61. package/dist/public-site.d.ts.map +1 -0
  62. package/dist/render-blocks.d.ts +150 -0
  63. package/dist/render-blocks.d.ts.map +1 -0
  64. package/dist/reports.d.ts +109 -0
  65. package/dist/reports.d.ts.map +1 -0
  66. package/dist/rls-builder.d.ts +136 -0
  67. package/dist/rls-builder.d.ts.map +1 -0
  68. package/dist/safe-pattern.d.ts +47 -0
  69. package/dist/safe-pattern.d.ts.map +1 -0
  70. package/dist/schemas.d.ts +977 -0
  71. package/dist/schemas.d.ts.map +1 -0
  72. package/dist/sensitivity.d.ts +37 -0
  73. package/dist/sensitivity.d.ts.map +1 -0
  74. package/dist/signer.d.ts +67 -0
  75. package/dist/signer.d.ts.map +1 -0
  76. package/dist/tier-ranges.d.ts +37 -0
  77. package/dist/tier-ranges.d.ts.map +1 -0
  78. package/dist/types.d.ts +261 -0
  79. package/dist/types.d.ts.map +1 -0
  80. package/dist/utils.d.ts +71 -0
  81. package/dist/utils.d.ts.map +1 -0
  82. package/dist/wiki-links.d.ts +56 -0
  83. package/dist/wiki-links.d.ts.map +1 -0
  84. package/package.json +53 -3
@@ -0,0 +1,977 @@
1
+ /**
2
+ * ============================================================================
3
+ * THE ZOD BRIDGE - Shared Validation Schemas
4
+ * ============================================================================
5
+ *
6
+ * Single source of truth for data validation between Backend (Hono)
7
+ * and Frontend (SvelteKit).
8
+ *
9
+ * Any change in the data structure must be reflected here.
10
+ */
11
+ import { z } from "zod";
12
+ /**
13
+ * Derived from the registry instead of repeating the list: maintaining two copies is
14
+ * exactly how `multiselect`, `textarea`, `datetime` and `media` ended up
15
+ * validating in the backend without existing for the user.
16
+ */
17
+ export declare const FieldTypeSchema: z.ZodEnum<{
18
+ number: "number";
19
+ boolean: "boolean";
20
+ json: "json";
21
+ date: "date";
22
+ text: "text";
23
+ image: "image";
24
+ media: "media";
25
+ email: "email";
26
+ url: "url";
27
+ textarea: "textarea";
28
+ datetime: "datetime";
29
+ select: "select";
30
+ multiselect: "multiselect";
31
+ richtext: "richtext";
32
+ relation: "relation";
33
+ kpi: "kpi";
34
+ repeater: "repeater";
35
+ }>;
36
+ export type FieldType = z.infer<typeof FieldTypeSchema>;
37
+ export declare const RelationTypeSchema: z.ZodEnum<{
38
+ "one-to-one": "one-to-one";
39
+ "one-to-many": "one-to-many";
40
+ "many-to-many": "many-to-many";
41
+ }>;
42
+ export type RelationType = z.infer<typeof RelationTypeSchema>;
43
+ export declare const RelationTargetSchema: z.ZodEnum<{
44
+ tags: "tags";
45
+ dataset: "dataset";
46
+ games: "games";
47
+ platforms: "platforms";
48
+ "blog-posts": "blog-posts";
49
+ streamers: "streamers";
50
+ }>;
51
+ export type RelationTarget = z.infer<typeof RelationTargetSchema>;
52
+ export declare const RelationConfigSchema: z.ZodObject<{
53
+ target: z.ZodEnum<{
54
+ tags: "tags";
55
+ dataset: "dataset";
56
+ games: "games";
57
+ platforms: "platforms";
58
+ "blog-posts": "blog-posts";
59
+ streamers: "streamers";
60
+ }>;
61
+ targetDatasetId: z.ZodOptional<z.ZodString>;
62
+ targetDatasetName: z.ZodOptional<z.ZodString>;
63
+ type: z.ZodEnum<{
64
+ "one-to-one": "one-to-one";
65
+ "one-to-many": "one-to-many";
66
+ "many-to-many": "many-to-many";
67
+ }>;
68
+ displayField: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>;
70
+ export type RelationConfig = z.infer<typeof RelationConfigSchema>;
71
+ export declare const SelectOptionSchema: z.ZodObject<{
72
+ label: z.ZodString;
73
+ value: z.ZodString;
74
+ }, z.core.$strip>;
75
+ export type SelectOption = z.infer<typeof SelectOptionSchema>;
76
+ /**
77
+ * Shows a field only if another field of the same form meets the condition.
78
+ *
79
+ * It reuses the `rlsRules` operator vocabulary on purpose: the user already
80
+ * knows it from access policies, and does not deserve a second dialect.
81
+ *
82
+ * Inside a repeater, `field` is resolved against the SAME row, not against
83
+ * the parent form. It is what whoever configures it expects, and it prevents a
84
+ * row from depending on the state of another.
85
+ */
86
+ export declare const ShowIfSchema: z.ZodObject<{
87
+ field: z.ZodString;
88
+ operator: z.ZodEnum<{
89
+ eq: "eq";
90
+ neq: "neq";
91
+ gt: "gt";
92
+ lt: "lt";
93
+ contains: "contains";
94
+ }>;
95
+ value: z.ZodString;
96
+ }, z.core.$strip>;
97
+ export type ShowIf = z.infer<typeof ShowIfSchema>;
98
+ /**
99
+ * Subfield of a repeater: it is a full field MINUS `subFields`.
100
+ *
101
+ * Nesting is cut off at ONE level on purpose, not by oversight. A repeater
102
+ * inside a repeater multiplies rows by rows: the render and validation
103
+ * cost grows quadratically, and in practice almost everything
104
+ * people solve this way (FAQs, team members, price tiers) is flat.
105
+ * Also, an unbounded recursive schema allows building a definition that
106
+ * blows the stack when generating the validator — an explicit limit is also
107
+ * a security limit.
108
+ */
109
+ export declare const SubFieldDefinitionSchema: z.ZodObject<{
110
+ id: z.ZodString;
111
+ key: z.ZodString;
112
+ label: z.ZodString;
113
+ type: z.ZodEnum<{
114
+ number: "number";
115
+ boolean: "boolean";
116
+ json: "json";
117
+ date: "date";
118
+ text: "text";
119
+ image: "image";
120
+ media: "media";
121
+ email: "email";
122
+ url: "url";
123
+ textarea: "textarea";
124
+ datetime: "datetime";
125
+ select: "select";
126
+ multiselect: "multiselect";
127
+ richtext: "richtext";
128
+ relation: "relation";
129
+ kpi: "kpi";
130
+ repeater: "repeater";
131
+ }>;
132
+ helpText: z.ZodOptional<z.ZodString>;
133
+ order: z.ZodDefault<z.ZodNumber>;
134
+ isRequired: z.ZodDefault<z.ZodBoolean>;
135
+ isUnique: z.ZodDefault<z.ZodBoolean>;
136
+ validationRegex: z.ZodOptional<z.ZodString>;
137
+ defaultValue: z.ZodOptional<z.ZodString>;
138
+ minValue: z.ZodOptional<z.ZodNumber>;
139
+ maxValue: z.ZodOptional<z.ZodNumber>;
140
+ minLength: z.ZodOptional<z.ZodNumber>;
141
+ maxLength: z.ZodOptional<z.ZodNumber>;
142
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
+ label: z.ZodString;
144
+ value: z.ZodString;
145
+ }, z.core.$strip>>>;
146
+ relation: z.ZodOptional<z.ZodObject<{
147
+ target: z.ZodEnum<{
148
+ tags: "tags";
149
+ dataset: "dataset";
150
+ games: "games";
151
+ platforms: "platforms";
152
+ "blog-posts": "blog-posts";
153
+ streamers: "streamers";
154
+ }>;
155
+ targetDatasetId: z.ZodOptional<z.ZodString>;
156
+ targetDatasetName: z.ZodOptional<z.ZodString>;
157
+ type: z.ZodEnum<{
158
+ "one-to-one": "one-to-one";
159
+ "one-to-many": "one-to-many";
160
+ "many-to-many": "many-to-many";
161
+ }>;
162
+ displayField: z.ZodOptional<z.ZodString>;
163
+ }, z.core.$strip>>;
164
+ width: z.ZodOptional<z.ZodNumber>;
165
+ hidden: z.ZodDefault<z.ZodBoolean>;
166
+ showIf: z.ZodOptional<z.ZodObject<{
167
+ field: z.ZodString;
168
+ operator: z.ZodEnum<{
169
+ eq: "eq";
170
+ neq: "neq";
171
+ gt: "gt";
172
+ lt: "lt";
173
+ contains: "contains";
174
+ }>;
175
+ value: z.ZodString;
176
+ }, z.core.$strip>>;
177
+ sensitivity: z.ZodOptional<z.ZodEnum<{
178
+ customer: "customer";
179
+ personal: "personal";
180
+ }>>;
181
+ }, z.core.$strip>;
182
+ export type SubFieldDefinition = z.infer<typeof SubFieldDefinitionSchema>;
183
+ /**
184
+ * Zod schema for the definition of an individual field.
185
+ *
186
+ * CRITICAL: This schema validates that each field has:
187
+ * - unique id
188
+ * - key (machine name)
189
+ * - label (visible name)
190
+ * - type (one of the allowed FieldTypes)
191
+ * - Optional validations (required, unique, regex, min/max)
192
+ */
193
+ export declare const FieldDefinitionSchema: z.ZodObject<{
194
+ subFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
195
+ id: z.ZodString;
196
+ key: z.ZodString;
197
+ label: z.ZodString;
198
+ type: z.ZodEnum<{
199
+ number: "number";
200
+ boolean: "boolean";
201
+ json: "json";
202
+ date: "date";
203
+ text: "text";
204
+ image: "image";
205
+ media: "media";
206
+ email: "email";
207
+ url: "url";
208
+ textarea: "textarea";
209
+ datetime: "datetime";
210
+ select: "select";
211
+ multiselect: "multiselect";
212
+ richtext: "richtext";
213
+ relation: "relation";
214
+ kpi: "kpi";
215
+ repeater: "repeater";
216
+ }>;
217
+ helpText: z.ZodOptional<z.ZodString>;
218
+ order: z.ZodDefault<z.ZodNumber>;
219
+ isRequired: z.ZodDefault<z.ZodBoolean>;
220
+ isUnique: z.ZodDefault<z.ZodBoolean>;
221
+ validationRegex: z.ZodOptional<z.ZodString>;
222
+ defaultValue: z.ZodOptional<z.ZodString>;
223
+ minValue: z.ZodOptional<z.ZodNumber>;
224
+ maxValue: z.ZodOptional<z.ZodNumber>;
225
+ minLength: z.ZodOptional<z.ZodNumber>;
226
+ maxLength: z.ZodOptional<z.ZodNumber>;
227
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
228
+ label: z.ZodString;
229
+ value: z.ZodString;
230
+ }, z.core.$strip>>>;
231
+ relation: z.ZodOptional<z.ZodObject<{
232
+ target: z.ZodEnum<{
233
+ tags: "tags";
234
+ dataset: "dataset";
235
+ games: "games";
236
+ platforms: "platforms";
237
+ "blog-posts": "blog-posts";
238
+ streamers: "streamers";
239
+ }>;
240
+ targetDatasetId: z.ZodOptional<z.ZodString>;
241
+ targetDatasetName: z.ZodOptional<z.ZodString>;
242
+ type: z.ZodEnum<{
243
+ "one-to-one": "one-to-one";
244
+ "one-to-many": "one-to-many";
245
+ "many-to-many": "many-to-many";
246
+ }>;
247
+ displayField: z.ZodOptional<z.ZodString>;
248
+ }, z.core.$strip>>;
249
+ width: z.ZodOptional<z.ZodNumber>;
250
+ hidden: z.ZodDefault<z.ZodBoolean>;
251
+ showIf: z.ZodOptional<z.ZodObject<{
252
+ field: z.ZodString;
253
+ operator: z.ZodEnum<{
254
+ eq: "eq";
255
+ neq: "neq";
256
+ gt: "gt";
257
+ lt: "lt";
258
+ contains: "contains";
259
+ }>;
260
+ value: z.ZodString;
261
+ }, z.core.$strip>>;
262
+ sensitivity: z.ZodOptional<z.ZodEnum<{
263
+ customer: "customer";
264
+ personal: "personal";
265
+ }>>;
266
+ }, z.core.$strip>>>;
267
+ id: z.ZodString;
268
+ key: z.ZodString;
269
+ label: z.ZodString;
270
+ type: z.ZodEnum<{
271
+ number: "number";
272
+ boolean: "boolean";
273
+ json: "json";
274
+ date: "date";
275
+ text: "text";
276
+ image: "image";
277
+ media: "media";
278
+ email: "email";
279
+ url: "url";
280
+ textarea: "textarea";
281
+ datetime: "datetime";
282
+ select: "select";
283
+ multiselect: "multiselect";
284
+ richtext: "richtext";
285
+ relation: "relation";
286
+ kpi: "kpi";
287
+ repeater: "repeater";
288
+ }>;
289
+ helpText: z.ZodOptional<z.ZodString>;
290
+ order: z.ZodDefault<z.ZodNumber>;
291
+ isRequired: z.ZodDefault<z.ZodBoolean>;
292
+ isUnique: z.ZodDefault<z.ZodBoolean>;
293
+ validationRegex: z.ZodOptional<z.ZodString>;
294
+ defaultValue: z.ZodOptional<z.ZodString>;
295
+ minValue: z.ZodOptional<z.ZodNumber>;
296
+ maxValue: z.ZodOptional<z.ZodNumber>;
297
+ minLength: z.ZodOptional<z.ZodNumber>;
298
+ maxLength: z.ZodOptional<z.ZodNumber>;
299
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
300
+ label: z.ZodString;
301
+ value: z.ZodString;
302
+ }, z.core.$strip>>>;
303
+ relation: z.ZodOptional<z.ZodObject<{
304
+ target: z.ZodEnum<{
305
+ tags: "tags";
306
+ dataset: "dataset";
307
+ games: "games";
308
+ platforms: "platforms";
309
+ "blog-posts": "blog-posts";
310
+ streamers: "streamers";
311
+ }>;
312
+ targetDatasetId: z.ZodOptional<z.ZodString>;
313
+ targetDatasetName: z.ZodOptional<z.ZodString>;
314
+ type: z.ZodEnum<{
315
+ "one-to-one": "one-to-one";
316
+ "one-to-many": "one-to-many";
317
+ "many-to-many": "many-to-many";
318
+ }>;
319
+ displayField: z.ZodOptional<z.ZodString>;
320
+ }, z.core.$strip>>;
321
+ width: z.ZodOptional<z.ZodNumber>;
322
+ hidden: z.ZodDefault<z.ZodBoolean>;
323
+ showIf: z.ZodOptional<z.ZodObject<{
324
+ field: z.ZodString;
325
+ operator: z.ZodEnum<{
326
+ eq: "eq";
327
+ neq: "neq";
328
+ gt: "gt";
329
+ lt: "lt";
330
+ contains: "contains";
331
+ }>;
332
+ value: z.ZodString;
333
+ }, z.core.$strip>>;
334
+ sensitivity: z.ZodOptional<z.ZodEnum<{
335
+ customer: "customer";
336
+ personal: "personal";
337
+ }>>;
338
+ }, z.core.$strip>;
339
+ export type FieldDefinition = z.infer<typeof FieldDefinitionSchema>;
340
+ export declare const DatasetPolicySchema: z.ZodObject<{
341
+ readAccess: z.ZodEnum<{
342
+ admin: "admin";
343
+ public: "public";
344
+ authenticated: "authenticated";
345
+ }>;
346
+ writeAccess: z.ZodEnum<{
347
+ admin: "admin";
348
+ authenticated: "authenticated";
349
+ }>;
350
+ enableRLS: z.ZodDefault<z.ZodBoolean>;
351
+ rlsRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
352
+ field: z.ZodString;
353
+ operator: z.ZodEnum<{
354
+ eq: "eq";
355
+ neq: "neq";
356
+ gt: "gt";
357
+ lt: "lt";
358
+ contains: "contains";
359
+ }>;
360
+ value: z.ZodString;
361
+ }, z.core.$strip>>>;
362
+ }, z.core.$strip>;
363
+ export type DatasetPolicy = z.infer<typeof DatasetPolicySchema>;
364
+ export declare const DatasetWorkflowSchema: z.ZodObject<{
365
+ requireApproval: z.ZodBoolean;
366
+ approverUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
367
+ }, z.core.$strip>;
368
+ export type DatasetWorkflow = z.infer<typeof DatasetWorkflowSchema>;
369
+ /**
370
+ * Zod schema for the complete definition of a Dataset.
371
+ *
372
+ * CRITICAL: This schema guarantees that:
373
+ * 1. The dataset has a valid name and slug
374
+ * 2. It contains an array of fields (NOT a flat object)
375
+ * 3. Each field meets FieldDefinitionSchema
376
+ *
377
+ * Backend use: Validates the POST/PATCH payload with @hono/zod-validator
378
+ * Frontend use: Imports the inferred type with z.infer<typeof DatasetDefinitionSchema>
379
+ */
380
+ export declare const DatasetDefinitionSchema: z.ZodObject<{
381
+ id: z.ZodString;
382
+ name: z.ZodString;
383
+ slug: z.ZodString;
384
+ description: z.ZodOptional<z.ZodString>;
385
+ icon: z.ZodOptional<z.ZodString>;
386
+ fields: z.ZodArray<z.ZodObject<{
387
+ subFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
388
+ id: z.ZodString;
389
+ key: z.ZodString;
390
+ label: z.ZodString;
391
+ type: z.ZodEnum<{
392
+ number: "number";
393
+ boolean: "boolean";
394
+ json: "json";
395
+ date: "date";
396
+ text: "text";
397
+ image: "image";
398
+ media: "media";
399
+ email: "email";
400
+ url: "url";
401
+ textarea: "textarea";
402
+ datetime: "datetime";
403
+ select: "select";
404
+ multiselect: "multiselect";
405
+ richtext: "richtext";
406
+ relation: "relation";
407
+ kpi: "kpi";
408
+ repeater: "repeater";
409
+ }>;
410
+ helpText: z.ZodOptional<z.ZodString>;
411
+ order: z.ZodDefault<z.ZodNumber>;
412
+ isRequired: z.ZodDefault<z.ZodBoolean>;
413
+ isUnique: z.ZodDefault<z.ZodBoolean>;
414
+ validationRegex: z.ZodOptional<z.ZodString>;
415
+ defaultValue: z.ZodOptional<z.ZodString>;
416
+ minValue: z.ZodOptional<z.ZodNumber>;
417
+ maxValue: z.ZodOptional<z.ZodNumber>;
418
+ minLength: z.ZodOptional<z.ZodNumber>;
419
+ maxLength: z.ZodOptional<z.ZodNumber>;
420
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
421
+ label: z.ZodString;
422
+ value: z.ZodString;
423
+ }, z.core.$strip>>>;
424
+ relation: z.ZodOptional<z.ZodObject<{
425
+ target: z.ZodEnum<{
426
+ tags: "tags";
427
+ dataset: "dataset";
428
+ games: "games";
429
+ platforms: "platforms";
430
+ "blog-posts": "blog-posts";
431
+ streamers: "streamers";
432
+ }>;
433
+ targetDatasetId: z.ZodOptional<z.ZodString>;
434
+ targetDatasetName: z.ZodOptional<z.ZodString>;
435
+ type: z.ZodEnum<{
436
+ "one-to-one": "one-to-one";
437
+ "one-to-many": "one-to-many";
438
+ "many-to-many": "many-to-many";
439
+ }>;
440
+ displayField: z.ZodOptional<z.ZodString>;
441
+ }, z.core.$strip>>;
442
+ width: z.ZodOptional<z.ZodNumber>;
443
+ hidden: z.ZodDefault<z.ZodBoolean>;
444
+ showIf: z.ZodOptional<z.ZodObject<{
445
+ field: z.ZodString;
446
+ operator: z.ZodEnum<{
447
+ eq: "eq";
448
+ neq: "neq";
449
+ gt: "gt";
450
+ lt: "lt";
451
+ contains: "contains";
452
+ }>;
453
+ value: z.ZodString;
454
+ }, z.core.$strip>>;
455
+ sensitivity: z.ZodOptional<z.ZodEnum<{
456
+ customer: "customer";
457
+ personal: "personal";
458
+ }>>;
459
+ }, z.core.$strip>>>;
460
+ id: z.ZodString;
461
+ key: z.ZodString;
462
+ label: z.ZodString;
463
+ type: z.ZodEnum<{
464
+ number: "number";
465
+ boolean: "boolean";
466
+ json: "json";
467
+ date: "date";
468
+ text: "text";
469
+ image: "image";
470
+ media: "media";
471
+ email: "email";
472
+ url: "url";
473
+ textarea: "textarea";
474
+ datetime: "datetime";
475
+ select: "select";
476
+ multiselect: "multiselect";
477
+ richtext: "richtext";
478
+ relation: "relation";
479
+ kpi: "kpi";
480
+ repeater: "repeater";
481
+ }>;
482
+ helpText: z.ZodOptional<z.ZodString>;
483
+ order: z.ZodDefault<z.ZodNumber>;
484
+ isRequired: z.ZodDefault<z.ZodBoolean>;
485
+ isUnique: z.ZodDefault<z.ZodBoolean>;
486
+ validationRegex: z.ZodOptional<z.ZodString>;
487
+ defaultValue: z.ZodOptional<z.ZodString>;
488
+ minValue: z.ZodOptional<z.ZodNumber>;
489
+ maxValue: z.ZodOptional<z.ZodNumber>;
490
+ minLength: z.ZodOptional<z.ZodNumber>;
491
+ maxLength: z.ZodOptional<z.ZodNumber>;
492
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
493
+ label: z.ZodString;
494
+ value: z.ZodString;
495
+ }, z.core.$strip>>>;
496
+ relation: z.ZodOptional<z.ZodObject<{
497
+ target: z.ZodEnum<{
498
+ tags: "tags";
499
+ dataset: "dataset";
500
+ games: "games";
501
+ platforms: "platforms";
502
+ "blog-posts": "blog-posts";
503
+ streamers: "streamers";
504
+ }>;
505
+ targetDatasetId: z.ZodOptional<z.ZodString>;
506
+ targetDatasetName: z.ZodOptional<z.ZodString>;
507
+ type: z.ZodEnum<{
508
+ "one-to-one": "one-to-one";
509
+ "one-to-many": "one-to-many";
510
+ "many-to-many": "many-to-many";
511
+ }>;
512
+ displayField: z.ZodOptional<z.ZodString>;
513
+ }, z.core.$strip>>;
514
+ width: z.ZodOptional<z.ZodNumber>;
515
+ hidden: z.ZodDefault<z.ZodBoolean>;
516
+ showIf: z.ZodOptional<z.ZodObject<{
517
+ field: z.ZodString;
518
+ operator: z.ZodEnum<{
519
+ eq: "eq";
520
+ neq: "neq";
521
+ gt: "gt";
522
+ lt: "lt";
523
+ contains: "contains";
524
+ }>;
525
+ value: z.ZodString;
526
+ }, z.core.$strip>>;
527
+ sensitivity: z.ZodOptional<z.ZodEnum<{
528
+ customer: "customer";
529
+ personal: "personal";
530
+ }>>;
531
+ }, z.core.$strip>>;
532
+ policyJson: z.ZodOptional<z.ZodNullable<z.ZodObject<{
533
+ readAccess: z.ZodEnum<{
534
+ admin: "admin";
535
+ public: "public";
536
+ authenticated: "authenticated";
537
+ }>;
538
+ writeAccess: z.ZodEnum<{
539
+ admin: "admin";
540
+ authenticated: "authenticated";
541
+ }>;
542
+ enableRLS: z.ZodDefault<z.ZodBoolean>;
543
+ rlsRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
544
+ field: z.ZodString;
545
+ operator: z.ZodEnum<{
546
+ eq: "eq";
547
+ neq: "neq";
548
+ gt: "gt";
549
+ lt: "lt";
550
+ contains: "contains";
551
+ }>;
552
+ value: z.ZodString;
553
+ }, z.core.$strip>>>;
554
+ }, z.core.$strip>>>;
555
+ workflowJson: z.ZodOptional<z.ZodNullable<z.ZodObject<{
556
+ requireApproval: z.ZodBoolean;
557
+ approverUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
558
+ }, z.core.$strip>>>;
559
+ createdAt: z.ZodOptional<z.ZodString>;
560
+ updatedAt: z.ZodOptional<z.ZodString>;
561
+ }, z.core.$strip>;
562
+ export type DatasetDefinition = z.infer<typeof DatasetDefinitionSchema>;
563
+ export declare const DatasetEntrySchema: z.ZodObject<{
564
+ id: z.ZodString;
565
+ datasetId: z.ZodString;
566
+ data: z.ZodRecord<z.ZodString, z.ZodAny>;
567
+ createdAt: z.ZodOptional<z.ZodString>;
568
+ updatedAt: z.ZodOptional<z.ZodString>;
569
+ }, z.core.$strip>;
570
+ export type DatasetEntry = z.infer<typeof DatasetEntrySchema>;
571
+ /**
572
+ * Schema for creating a new Dataset (no ID or timestamps)
573
+ */
574
+ export declare const CreateDatasetPayloadSchema: z.ZodObject<{
575
+ description: z.ZodOptional<z.ZodString>;
576
+ slug: z.ZodString;
577
+ name: z.ZodString;
578
+ icon: z.ZodOptional<z.ZodString>;
579
+ fields: z.ZodArray<z.ZodObject<{
580
+ subFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
581
+ id: z.ZodString;
582
+ key: z.ZodString;
583
+ label: z.ZodString;
584
+ type: z.ZodEnum<{
585
+ number: "number";
586
+ boolean: "boolean";
587
+ json: "json";
588
+ date: "date";
589
+ text: "text";
590
+ image: "image";
591
+ media: "media";
592
+ email: "email";
593
+ url: "url";
594
+ textarea: "textarea";
595
+ datetime: "datetime";
596
+ select: "select";
597
+ multiselect: "multiselect";
598
+ richtext: "richtext";
599
+ relation: "relation";
600
+ kpi: "kpi";
601
+ repeater: "repeater";
602
+ }>;
603
+ helpText: z.ZodOptional<z.ZodString>;
604
+ order: z.ZodDefault<z.ZodNumber>;
605
+ isRequired: z.ZodDefault<z.ZodBoolean>;
606
+ isUnique: z.ZodDefault<z.ZodBoolean>;
607
+ validationRegex: z.ZodOptional<z.ZodString>;
608
+ defaultValue: z.ZodOptional<z.ZodString>;
609
+ minValue: z.ZodOptional<z.ZodNumber>;
610
+ maxValue: z.ZodOptional<z.ZodNumber>;
611
+ minLength: z.ZodOptional<z.ZodNumber>;
612
+ maxLength: z.ZodOptional<z.ZodNumber>;
613
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
614
+ label: z.ZodString;
615
+ value: z.ZodString;
616
+ }, z.core.$strip>>>;
617
+ relation: z.ZodOptional<z.ZodObject<{
618
+ target: z.ZodEnum<{
619
+ tags: "tags";
620
+ dataset: "dataset";
621
+ games: "games";
622
+ platforms: "platforms";
623
+ "blog-posts": "blog-posts";
624
+ streamers: "streamers";
625
+ }>;
626
+ targetDatasetId: z.ZodOptional<z.ZodString>;
627
+ targetDatasetName: z.ZodOptional<z.ZodString>;
628
+ type: z.ZodEnum<{
629
+ "one-to-one": "one-to-one";
630
+ "one-to-many": "one-to-many";
631
+ "many-to-many": "many-to-many";
632
+ }>;
633
+ displayField: z.ZodOptional<z.ZodString>;
634
+ }, z.core.$strip>>;
635
+ width: z.ZodOptional<z.ZodNumber>;
636
+ hidden: z.ZodDefault<z.ZodBoolean>;
637
+ showIf: z.ZodOptional<z.ZodObject<{
638
+ field: z.ZodString;
639
+ operator: z.ZodEnum<{
640
+ eq: "eq";
641
+ neq: "neq";
642
+ gt: "gt";
643
+ lt: "lt";
644
+ contains: "contains";
645
+ }>;
646
+ value: z.ZodString;
647
+ }, z.core.$strip>>;
648
+ sensitivity: z.ZodOptional<z.ZodEnum<{
649
+ customer: "customer";
650
+ personal: "personal";
651
+ }>>;
652
+ }, z.core.$strip>>>;
653
+ id: z.ZodString;
654
+ key: z.ZodString;
655
+ label: z.ZodString;
656
+ type: z.ZodEnum<{
657
+ number: "number";
658
+ boolean: "boolean";
659
+ json: "json";
660
+ date: "date";
661
+ text: "text";
662
+ image: "image";
663
+ media: "media";
664
+ email: "email";
665
+ url: "url";
666
+ textarea: "textarea";
667
+ datetime: "datetime";
668
+ select: "select";
669
+ multiselect: "multiselect";
670
+ richtext: "richtext";
671
+ relation: "relation";
672
+ kpi: "kpi";
673
+ repeater: "repeater";
674
+ }>;
675
+ helpText: z.ZodOptional<z.ZodString>;
676
+ order: z.ZodDefault<z.ZodNumber>;
677
+ isRequired: z.ZodDefault<z.ZodBoolean>;
678
+ isUnique: z.ZodDefault<z.ZodBoolean>;
679
+ validationRegex: z.ZodOptional<z.ZodString>;
680
+ defaultValue: z.ZodOptional<z.ZodString>;
681
+ minValue: z.ZodOptional<z.ZodNumber>;
682
+ maxValue: z.ZodOptional<z.ZodNumber>;
683
+ minLength: z.ZodOptional<z.ZodNumber>;
684
+ maxLength: z.ZodOptional<z.ZodNumber>;
685
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
686
+ label: z.ZodString;
687
+ value: z.ZodString;
688
+ }, z.core.$strip>>>;
689
+ relation: z.ZodOptional<z.ZodObject<{
690
+ target: z.ZodEnum<{
691
+ tags: "tags";
692
+ dataset: "dataset";
693
+ games: "games";
694
+ platforms: "platforms";
695
+ "blog-posts": "blog-posts";
696
+ streamers: "streamers";
697
+ }>;
698
+ targetDatasetId: z.ZodOptional<z.ZodString>;
699
+ targetDatasetName: z.ZodOptional<z.ZodString>;
700
+ type: z.ZodEnum<{
701
+ "one-to-one": "one-to-one";
702
+ "one-to-many": "one-to-many";
703
+ "many-to-many": "many-to-many";
704
+ }>;
705
+ displayField: z.ZodOptional<z.ZodString>;
706
+ }, z.core.$strip>>;
707
+ width: z.ZodOptional<z.ZodNumber>;
708
+ hidden: z.ZodDefault<z.ZodBoolean>;
709
+ showIf: z.ZodOptional<z.ZodObject<{
710
+ field: z.ZodString;
711
+ operator: z.ZodEnum<{
712
+ eq: "eq";
713
+ neq: "neq";
714
+ gt: "gt";
715
+ lt: "lt";
716
+ contains: "contains";
717
+ }>;
718
+ value: z.ZodString;
719
+ }, z.core.$strip>>;
720
+ sensitivity: z.ZodOptional<z.ZodEnum<{
721
+ customer: "customer";
722
+ personal: "personal";
723
+ }>>;
724
+ }, z.core.$strip>>;
725
+ policyJson: z.ZodOptional<z.ZodNullable<z.ZodObject<{
726
+ readAccess: z.ZodEnum<{
727
+ admin: "admin";
728
+ public: "public";
729
+ authenticated: "authenticated";
730
+ }>;
731
+ writeAccess: z.ZodEnum<{
732
+ admin: "admin";
733
+ authenticated: "authenticated";
734
+ }>;
735
+ enableRLS: z.ZodDefault<z.ZodBoolean>;
736
+ rlsRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
737
+ field: z.ZodString;
738
+ operator: z.ZodEnum<{
739
+ eq: "eq";
740
+ neq: "neq";
741
+ gt: "gt";
742
+ lt: "lt";
743
+ contains: "contains";
744
+ }>;
745
+ value: z.ZodString;
746
+ }, z.core.$strip>>>;
747
+ }, z.core.$strip>>>;
748
+ workflowJson: z.ZodOptional<z.ZodNullable<z.ZodObject<{
749
+ requireApproval: z.ZodBoolean;
750
+ approverUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
751
+ }, z.core.$strip>>>;
752
+ displayConfig: z.ZodOptional<z.ZodObject<{
753
+ titleField: z.ZodOptional<z.ZodString>;
754
+ sortField: z.ZodOptional<z.ZodString>;
755
+ sortDirection: z.ZodOptional<z.ZodEnum<{
756
+ asc: "asc";
757
+ desc: "desc";
758
+ }>>;
759
+ }, z.core.$strip>>;
760
+ }, z.core.$strip>;
761
+ export type CreateDatasetPayload = z.infer<typeof CreateDatasetPayloadSchema>;
762
+ /**
763
+ * Schema for updating a Dataset (all fields optional)
764
+ */
765
+ export declare const UpdateDatasetPayloadSchema: z.ZodObject<{
766
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
767
+ slug: z.ZodOptional<z.ZodString>;
768
+ name: z.ZodOptional<z.ZodString>;
769
+ icon: z.ZodOptional<z.ZodOptional<z.ZodString>>;
770
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
771
+ subFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
772
+ id: z.ZodString;
773
+ key: z.ZodString;
774
+ label: z.ZodString;
775
+ type: z.ZodEnum<{
776
+ number: "number";
777
+ boolean: "boolean";
778
+ json: "json";
779
+ date: "date";
780
+ text: "text";
781
+ image: "image";
782
+ media: "media";
783
+ email: "email";
784
+ url: "url";
785
+ textarea: "textarea";
786
+ datetime: "datetime";
787
+ select: "select";
788
+ multiselect: "multiselect";
789
+ richtext: "richtext";
790
+ relation: "relation";
791
+ kpi: "kpi";
792
+ repeater: "repeater";
793
+ }>;
794
+ helpText: z.ZodOptional<z.ZodString>;
795
+ order: z.ZodDefault<z.ZodNumber>;
796
+ isRequired: z.ZodDefault<z.ZodBoolean>;
797
+ isUnique: z.ZodDefault<z.ZodBoolean>;
798
+ validationRegex: z.ZodOptional<z.ZodString>;
799
+ defaultValue: z.ZodOptional<z.ZodString>;
800
+ minValue: z.ZodOptional<z.ZodNumber>;
801
+ maxValue: z.ZodOptional<z.ZodNumber>;
802
+ minLength: z.ZodOptional<z.ZodNumber>;
803
+ maxLength: z.ZodOptional<z.ZodNumber>;
804
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
805
+ label: z.ZodString;
806
+ value: z.ZodString;
807
+ }, z.core.$strip>>>;
808
+ relation: z.ZodOptional<z.ZodObject<{
809
+ target: z.ZodEnum<{
810
+ tags: "tags";
811
+ dataset: "dataset";
812
+ games: "games";
813
+ platforms: "platforms";
814
+ "blog-posts": "blog-posts";
815
+ streamers: "streamers";
816
+ }>;
817
+ targetDatasetId: z.ZodOptional<z.ZodString>;
818
+ targetDatasetName: z.ZodOptional<z.ZodString>;
819
+ type: z.ZodEnum<{
820
+ "one-to-one": "one-to-one";
821
+ "one-to-many": "one-to-many";
822
+ "many-to-many": "many-to-many";
823
+ }>;
824
+ displayField: z.ZodOptional<z.ZodString>;
825
+ }, z.core.$strip>>;
826
+ width: z.ZodOptional<z.ZodNumber>;
827
+ hidden: z.ZodDefault<z.ZodBoolean>;
828
+ showIf: z.ZodOptional<z.ZodObject<{
829
+ field: z.ZodString;
830
+ operator: z.ZodEnum<{
831
+ eq: "eq";
832
+ neq: "neq";
833
+ gt: "gt";
834
+ lt: "lt";
835
+ contains: "contains";
836
+ }>;
837
+ value: z.ZodString;
838
+ }, z.core.$strip>>;
839
+ sensitivity: z.ZodOptional<z.ZodEnum<{
840
+ customer: "customer";
841
+ personal: "personal";
842
+ }>>;
843
+ }, z.core.$strip>>>;
844
+ id: z.ZodString;
845
+ key: z.ZodString;
846
+ label: z.ZodString;
847
+ type: z.ZodEnum<{
848
+ number: "number";
849
+ boolean: "boolean";
850
+ json: "json";
851
+ date: "date";
852
+ text: "text";
853
+ image: "image";
854
+ media: "media";
855
+ email: "email";
856
+ url: "url";
857
+ textarea: "textarea";
858
+ datetime: "datetime";
859
+ select: "select";
860
+ multiselect: "multiselect";
861
+ richtext: "richtext";
862
+ relation: "relation";
863
+ kpi: "kpi";
864
+ repeater: "repeater";
865
+ }>;
866
+ helpText: z.ZodOptional<z.ZodString>;
867
+ order: z.ZodDefault<z.ZodNumber>;
868
+ isRequired: z.ZodDefault<z.ZodBoolean>;
869
+ isUnique: z.ZodDefault<z.ZodBoolean>;
870
+ validationRegex: z.ZodOptional<z.ZodString>;
871
+ defaultValue: z.ZodOptional<z.ZodString>;
872
+ minValue: z.ZodOptional<z.ZodNumber>;
873
+ maxValue: z.ZodOptional<z.ZodNumber>;
874
+ minLength: z.ZodOptional<z.ZodNumber>;
875
+ maxLength: z.ZodOptional<z.ZodNumber>;
876
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
877
+ label: z.ZodString;
878
+ value: z.ZodString;
879
+ }, z.core.$strip>>>;
880
+ relation: z.ZodOptional<z.ZodObject<{
881
+ target: z.ZodEnum<{
882
+ tags: "tags";
883
+ dataset: "dataset";
884
+ games: "games";
885
+ platforms: "platforms";
886
+ "blog-posts": "blog-posts";
887
+ streamers: "streamers";
888
+ }>;
889
+ targetDatasetId: z.ZodOptional<z.ZodString>;
890
+ targetDatasetName: z.ZodOptional<z.ZodString>;
891
+ type: z.ZodEnum<{
892
+ "one-to-one": "one-to-one";
893
+ "one-to-many": "one-to-many";
894
+ "many-to-many": "many-to-many";
895
+ }>;
896
+ displayField: z.ZodOptional<z.ZodString>;
897
+ }, z.core.$strip>>;
898
+ width: z.ZodOptional<z.ZodNumber>;
899
+ hidden: z.ZodDefault<z.ZodBoolean>;
900
+ showIf: z.ZodOptional<z.ZodObject<{
901
+ field: z.ZodString;
902
+ operator: z.ZodEnum<{
903
+ eq: "eq";
904
+ neq: "neq";
905
+ gt: "gt";
906
+ lt: "lt";
907
+ contains: "contains";
908
+ }>;
909
+ value: z.ZodString;
910
+ }, z.core.$strip>>;
911
+ sensitivity: z.ZodOptional<z.ZodEnum<{
912
+ customer: "customer";
913
+ personal: "personal";
914
+ }>>;
915
+ }, z.core.$strip>>>;
916
+ policyJson: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
917
+ readAccess: z.ZodEnum<{
918
+ admin: "admin";
919
+ public: "public";
920
+ authenticated: "authenticated";
921
+ }>;
922
+ writeAccess: z.ZodEnum<{
923
+ admin: "admin";
924
+ authenticated: "authenticated";
925
+ }>;
926
+ enableRLS: z.ZodDefault<z.ZodBoolean>;
927
+ rlsRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
928
+ field: z.ZodString;
929
+ operator: z.ZodEnum<{
930
+ eq: "eq";
931
+ neq: "neq";
932
+ gt: "gt";
933
+ lt: "lt";
934
+ contains: "contains";
935
+ }>;
936
+ value: z.ZodString;
937
+ }, z.core.$strip>>>;
938
+ }, z.core.$strip>>>>;
939
+ workflowJson: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
940
+ requireApproval: z.ZodBoolean;
941
+ approverUserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
942
+ }, z.core.$strip>>>>;
943
+ displayConfig: z.ZodOptional<z.ZodObject<{
944
+ titleField: z.ZodOptional<z.ZodString>;
945
+ sortField: z.ZodOptional<z.ZodString>;
946
+ sortDirection: z.ZodOptional<z.ZodEnum<{
947
+ asc: "asc";
948
+ desc: "desc";
949
+ }>>;
950
+ }, z.core.$strip>>;
951
+ }, z.core.$strip>;
952
+ export type UpdateDatasetPayload = z.infer<typeof UpdateDatasetPayloadSchema>;
953
+ /**
954
+ * Validates that an object is a valid DatasetDefinition.
955
+ * Throws ZodError if it does not meet the schema.
956
+ */
957
+ export declare function validateDatasetDefinition(data: unknown): DatasetDefinition;
958
+ /**
959
+ * Validates safely without throwing exceptions.
960
+ * Returns { success: true, data } or { success: false, error }
961
+ */
962
+ export declare function safeValidateDataset(data: unknown): {
963
+ success: true;
964
+ data: DatasetDefinition;
965
+ } | {
966
+ success: false;
967
+ error: z.ZodError;
968
+ };
969
+ /**
970
+ * Generates a unique field ID
971
+ */
972
+ export declare function generateFieldId(): string;
973
+ /**
974
+ * Creates an empty field of the specified type
975
+ */
976
+ export declare function createEmptyField(type: FieldType, order: number): FieldDefinition;
977
+ //# sourceMappingURL=schemas.d.ts.map