@wildo-ai/zod-decorators 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/esm/__mocks__/mime.d.ts +12 -0
  2. package/dist/esm/__mocks__/mime.d.ts.map +1 -0
  3. package/dist/esm/__mocks__/mime.js +75 -0
  4. package/dist/esm/__mocks__/mime.js.map +1 -0
  5. package/dist/esm/commons.d.ts +26 -0
  6. package/dist/esm/commons.d.ts.map +1 -0
  7. package/dist/esm/commons.js +41 -0
  8. package/dist/esm/commons.js.map +1 -0
  9. package/dist/esm/currencies.shared.schemas.d.ts +208 -0
  10. package/dist/esm/currencies.shared.schemas.d.ts.map +1 -0
  11. package/dist/esm/currencies.shared.schemas.js +228 -0
  12. package/dist/esm/currencies.shared.schemas.js.map +1 -0
  13. package/dist/esm/files/agent-file-formats.d.ts +99 -0
  14. package/dist/esm/files/agent-file-formats.d.ts.map +1 -0
  15. package/dist/esm/files/agent-file-formats.js +163 -0
  16. package/dist/esm/files/agent-file-formats.js.map +1 -0
  17. package/dist/esm/files/extension-nature-map.d.ts +12 -0
  18. package/dist/esm/files/extension-nature-map.d.ts.map +1 -0
  19. package/dist/esm/files/extension-nature-map.js +63 -0
  20. package/dist/esm/files/extension-nature-map.js.map +1 -0
  21. package/dist/esm/files/file-extensions.enum.d.ts +58 -0
  22. package/dist/esm/files/file-extensions.enum.d.ts.map +1 -0
  23. package/dist/esm/files/file-extensions.enum.js +65 -0
  24. package/dist/esm/files/file-extensions.enum.js.map +1 -0
  25. package/dist/esm/files/mime-registry.d.ts +72 -0
  26. package/dist/esm/files/mime-registry.d.ts.map +1 -0
  27. package/dist/esm/files/mime-registry.js +174 -0
  28. package/dist/esm/files/mime-registry.js.map +1 -0
  29. package/dist/esm/files/unified-registry.d.ts +112 -0
  30. package/dist/esm/files/unified-registry.d.ts.map +1 -0
  31. package/dist/esm/files/unified-registry.js +190 -0
  32. package/dist/esm/files/unified-registry.js.map +1 -0
  33. package/dist/esm/index.d.ts +29 -0
  34. package/dist/esm/index.d.ts.map +1 -0
  35. package/dist/esm/index.js +36 -0
  36. package/dist/esm/index.js.map +1 -0
  37. package/dist/esm/testing/decorated-test-schemas.d.ts +27 -0
  38. package/dist/esm/testing/decorated-test-schemas.d.ts.map +1 -0
  39. package/dist/esm/testing/decorated-test-schemas.js +26 -0
  40. package/dist/esm/testing/decorated-test-schemas.js.map +1 -0
  41. package/dist/esm/testing.d.ts +6 -0
  42. package/dist/esm/testing.d.ts.map +1 -0
  43. package/dist/esm/testing.js +6 -0
  44. package/dist/esm/testing.js.map +1 -0
  45. package/dist/esm/zod-bigdecimal.d.ts +193 -0
  46. package/dist/esm/zod-bigdecimal.d.ts.map +1 -0
  47. package/dist/esm/zod-bigdecimal.js +274 -0
  48. package/dist/esm/zod-bigdecimal.js.map +1 -0
  49. package/dist/esm/zod-code.d.ts +95 -0
  50. package/dist/esm/zod-code.d.ts.map +1 -0
  51. package/dist/esm/zod-code.js +160 -0
  52. package/dist/esm/zod-code.js.map +1 -0
  53. package/dist/esm/zod-color.d.ts +8 -0
  54. package/dist/esm/zod-color.d.ts.map +1 -0
  55. package/dist/esm/zod-color.js +88 -0
  56. package/dist/esm/zod-color.js.map +1 -0
  57. package/dist/esm/zod-decorators.types.d.ts +2207 -0
  58. package/dist/esm/zod-decorators.types.d.ts.map +1 -0
  59. package/dist/esm/zod-decorators.types.js +771 -0
  60. package/dist/esm/zod-decorators.types.js.map +1 -0
  61. package/dist/esm/zod-duration.d.ts +128 -0
  62. package/dist/esm/zod-duration.d.ts.map +1 -0
  63. package/dist/esm/zod-duration.js +174 -0
  64. package/dist/esm/zod-duration.js.map +1 -0
  65. package/dist/esm/zod-file.d.ts +219 -0
  66. package/dist/esm/zod-file.d.ts.map +1 -0
  67. package/dist/esm/zod-file.js +469 -0
  68. package/dist/esm/zod-file.js.map +1 -0
  69. package/dist/esm/zod-money.d.ts +223 -0
  70. package/dist/esm/zod-money.d.ts.map +1 -0
  71. package/dist/esm/zod-money.js +293 -0
  72. package/dist/esm/zod-money.js.map +1 -0
  73. package/dist/esm/zod-phone.d.ts +75 -0
  74. package/dist/esm/zod-phone.d.ts.map +1 -0
  75. package/dist/esm/zod-phone.js +116 -0
  76. package/dist/esm/zod-phone.js.map +1 -0
  77. package/dist/esm/zod-range.d.ts +87 -0
  78. package/dist/esm/zod-range.d.ts.map +1 -0
  79. package/dist/esm/zod-range.js +138 -0
  80. package/dist/esm/zod-range.js.map +1 -0
  81. package/dist/esm/zod-utils.shared.d.ts +783 -0
  82. package/dist/esm/zod-utils.shared.d.ts.map +1 -0
  83. package/dist/esm/zod-utils.shared.js +2647 -0
  84. package/dist/esm/zod-utils.shared.js.map +1 -0
  85. package/dist/esm/zod-versioned.d.ts +150 -0
  86. package/dist/esm/zod-versioned.d.ts.map +1 -0
  87. package/dist/esm/zod-versioned.js +172 -0
  88. package/dist/esm/zod-versioned.js.map +1 -0
  89. package/dist/esm/zod.module-override.d.ts +413 -0
  90. package/dist/esm/zod.module-override.d.ts.map +1 -0
  91. package/dist/esm/zod.module-override.js +1093 -0
  92. package/dist/esm/zod.module-override.js.map +1 -0
  93. package/dist/tsconfig.build.tsbuildinfo +1 -0
  94. package/package.json +63 -0
@@ -0,0 +1,771 @@
1
+ // Symbol for storing metadata on Zod schemas. Uses Symbol.for() to ensure the same symbol is used across packages.
2
+ export const SCHEMA_METADATA = Symbol.for('schema_metadata');
3
+ // Schema type categories for component selection.
4
+ // Represents the underlying Zod schema type detected from introspection.
5
+ export var FieldSchemaType;
6
+ (function (FieldSchemaType) {
7
+ FieldSchemaType["STRING"] = "string";
8
+ FieldSchemaType["NUMBER"] = "number";
9
+ FieldSchemaType["BIGINT"] = "bigint";
10
+ FieldSchemaType["BOOLEAN"] = "boolean";
11
+ FieldSchemaType["ENUM"] = "enum";
12
+ FieldSchemaType["DATE"] = "date";
13
+ FieldSchemaType["OBJECT"] = "object";
14
+ FieldSchemaType["ARRAY"] = "array";
15
+ FieldSchemaType["SET"] = "set";
16
+ FieldSchemaType["TUPLE"] = "tuple";
17
+ FieldSchemaType["RECORD"] = "record";
18
+ FieldSchemaType["MAP"] = "map";
19
+ FieldSchemaType["TIME"] = "time";
20
+ FieldSchemaType["DATETIME"] = "datetime";
21
+ FieldSchemaType["RANGE_NUMBER"] = "range_number";
22
+ FieldSchemaType["RANGE_DATE"] = "range_date";
23
+ FieldSchemaType["RANGE_DATETIME"] = "range_datetime";
24
+ FieldSchemaType["RANGE_TIME"] = "range_time";
25
+ FieldSchemaType["RANGE_BIGDECIMAL"] = "range_bigdecimal";
26
+ FieldSchemaType["RANGE_MONEY"] = "range_money";
27
+ FieldSchemaType["MONEY"] = "money";
28
+ FieldSchemaType["BIGDECIMAL"] = "bigdecimal";
29
+ FieldSchemaType["CODE"] = "code";
30
+ FieldSchemaType["FILE"] = "file";
31
+ FieldSchemaType["DURATION"] = "duration";
32
+ FieldSchemaType["PHONE"] = "phone";
33
+ FieldSchemaType["VERSIONED_FOREIGN_KEY"] = "versioned_foreign_key";
34
+ FieldSchemaType["VERSIONED_OBJECT"] = "versioned_object";
35
+ FieldSchemaType["UNKNOWN"] = "unknown";
36
+ })(FieldSchemaType || (FieldSchemaType = {}));
37
+ ///=======================================================================================================================
38
+ /// FORM FIELD COMPONENT TYPES
39
+ ///=======================================================================================================================
40
+ // Form field component types.
41
+ // Represents the UI component that should render a form field.
42
+ export var FormFieldComponent;
43
+ (function (FormFieldComponent) {
44
+ FormFieldComponent["INPUT"] = "input";
45
+ FormFieldComponent["TEXTAREA"] = "textarea";
46
+ FormFieldComponent["SELECT"] = "select";
47
+ FormFieldComponent["RADIO_GROUP"] = "radio-group";
48
+ FormFieldComponent["CHECKBOX"] = "checkbox";
49
+ FormFieldComponent["CHECKBOX_GROUP"] = "checkbox-group";
50
+ FormFieldComponent["SWITCH"] = "switch";
51
+ FormFieldComponent["SLIDER"] = "slider";
52
+ FormFieldComponent["DATE"] = "date";
53
+ FormFieldComponent["TIME"] = "time";
54
+ FormFieldComponent["DATETIME"] = "datetime";
55
+ FormFieldComponent["RANGE_SLIDER"] = "range-slider";
56
+ FormFieldComponent["DATE_RANGE"] = "date-range";
57
+ FormFieldComponent["DATETIME_RANGE"] = "datetime-range";
58
+ FormFieldComponent["TIME_RANGE"] = "time-range";
59
+ FormFieldComponent["BIGDECIMAL_RANGE"] = "bigdecimal-range";
60
+ FormFieldComponent["MONEY_RANGE"] = "money-range";
61
+ FormFieldComponent["DURATION"] = "duration";
62
+ FormFieldComponent["PHONE"] = "phone";
63
+ })(FormFieldComponent || (FormFieldComponent = {}));
64
+ // ================================
65
+ // FORM FIELD CHROME MODES
66
+ // ================================
67
+ //------------------------------------------------------------------------------------------------
68
+ // CHROME MODES — display and edit context
69
+ //------------------------------------------------------------------------------------------------
70
+ /**
71
+ * Chrome layout mode for display context (detail/read-only views).
72
+ * Controls how the field wrapper (label, value, description) is arranged.
73
+ */
74
+ export const DisplayChromeMode = {
75
+ /** Label above, value below, description below value (default). */
76
+ STACKED: 'stacked',
77
+ /** Label and value on the same line. */
78
+ INLINE: 'inline',
79
+ /** No label/description, just value (dense mode). */
80
+ COMPACT: 'compact',
81
+ /** No chrome at all — bare value output. */
82
+ HIDDEN: 'hidden',
83
+ };
84
+ /**
85
+ * Chrome layout mode for edit context (forms).
86
+ * Superset of DisplayChromeMode with form-specific modes (SETTINGS_ROW, RELAXED).
87
+ *
88
+ * Also exported as `FormFieldChromeMode` for backward compatibility.
89
+ */
90
+ export const EditChromeMode = {
91
+ /** Label above, control below, description + error below control (default). */
92
+ STACKED: 'stacked',
93
+ /** Label + description left, control + error right (settings page style). */
94
+ SETTINGS_ROW: 'settings_row',
95
+ /** Control left, label + description right (switch/checkbox style). */
96
+ INLINE: 'inline',
97
+ /** Generous spacing, heading-size label (onboarding, OTP, wizard). */
98
+ RELAXED: 'relaxed',
99
+ /** No label/description, just control + error (dense mode). */
100
+ COMPACT: 'compact',
101
+ /** No chrome at all — bare control output. */
102
+ HIDDEN: 'hidden',
103
+ };
104
+ /** @deprecated Use `EditChromeMode` directly. Kept as alias for backward compatibility. */
105
+ export const FormFieldChromeMode = EditChromeMode;
106
+ ///=======================================================================================================================
107
+ /// DISPLAY FIELD COMPONENT TYPES
108
+ ///=======================================================================================================================
109
+ export var DisplayFieldComponent;
110
+ (function (DisplayFieldComponent) {
111
+ // Basic/fallback
112
+ DisplayFieldComponent["SIMPLE_TEXT"] = "simple-text";
113
+ // Primitive types
114
+ DisplayFieldComponent["STRING"] = "string";
115
+ DisplayFieldComponent["NUMBER"] = "number";
116
+ DisplayFieldComponent["BOOLEAN"] = "boolean";
117
+ DisplayFieldComponent["ENUM"] = "enum";
118
+ // Date/Time types
119
+ DisplayFieldComponent["DATE"] = "date";
120
+ DisplayFieldComponent["TIME"] = "time";
121
+ DisplayFieldComponent["DATETIME"] = "datetime";
122
+ // Special primitive types
123
+ DisplayFieldComponent["CODE"] = "code";
124
+ DisplayFieldComponent["FILE"] = "file";
125
+ DisplayFieldComponent["MONEY"] = "money";
126
+ DisplayFieldComponent["BIGDECIMAL"] = "bigdecimal";
127
+ DisplayFieldComponent["DURATION"] = "duration";
128
+ DisplayFieldComponent["PHONE"] = "phone";
129
+ // Range types
130
+ DisplayFieldComponent["RANGE_NUMBER"] = "range-number";
131
+ DisplayFieldComponent["RANGE_DATE"] = "range-date";
132
+ DisplayFieldComponent["RANGE_TIME"] = "range-time";
133
+ DisplayFieldComponent["RANGE_DATETIME"] = "range-datetime";
134
+ DisplayFieldComponent["RANGE_BIGDECIMAL"] = "range-bigdecimal";
135
+ DisplayFieldComponent["RANGE_MONEY"] = "range-money";
136
+ })(DisplayFieldComponent || (DisplayFieldComponent = {}));
137
+ //------------------------------------------------------------------------------------------------
138
+ // FORM FIELD
139
+ //------------------------------------------------------------------------------------------------
140
+ // =============================================================================
141
+ // SECTION MODE - Unified enum for section rendering
142
+ // =============================================================================
143
+ /**
144
+ * How a section is rendered — both per-section appearance and container grouping.
145
+ *
146
+ * **Solo modes** (render in place, no grouping):
147
+ * - DEFAULT: Standard section with border and padding
148
+ * - CARD: Wrapped in a card container with shadow
149
+ * - GHOST: Minimal container without visual styling
150
+ * - COLLAPSIBLE: Expandable/collapsible section with trigger
151
+ *
152
+ * **Container modes** (sections sharing the same mode are grouped together,
153
+ * rendered at the position of the first occurrence):
154
+ *
155
+ * @category Layout-based (all sections visible simultaneously)
156
+ * - INLINE: Stacked vertically
157
+ * - GRID: CSS Grid layout with configurable columns
158
+ * - COLUMNS: Multi-column layout (newspaper style)
159
+ *
160
+ * @category Navigation-based (one section visible at a time)
161
+ * - TABS: Horizontal tabs navigation
162
+ * - VERTICAL_TABS: Vertical tabs (side navigation)
163
+ * - PILLS: Pill/segment navigation (compact)
164
+ *
165
+ * @category Expandable (toggle section visibility)
166
+ * - ACCORDION: Each section independently collapsible
167
+ * - EXPANDABLE: "Show more" button reveals additional sections
168
+ *
169
+ * @category Guided (sequential, with indicators)
170
+ * - STEPPER: Step-by-step with step indicators
171
+ * - TIMELINE: Chronological progression (vertical timeline)
172
+ *
173
+ * NOTE: Wizard is NOT included — it's a higher-level layout pattern
174
+ * that contains sections, not a section rendering mode.
175
+ */
176
+ export var SectionMode;
177
+ (function (SectionMode) {
178
+ // Solo (render in place, no grouping)
179
+ SectionMode["DEFAULT"] = "default";
180
+ SectionMode["CARD"] = "card";
181
+ SectionMode["GHOST"] = "ghost";
182
+ SectionMode["COLLAPSIBLE"] = "collapsible";
183
+ // Layout-based (all sections visible simultaneously)
184
+ SectionMode["INLINE"] = "inline";
185
+ SectionMode["GRID"] = "grid";
186
+ SectionMode["COLUMNS"] = "columns";
187
+ // Navigation-based (one section visible at a time)
188
+ SectionMode["TABS"] = "tabs";
189
+ SectionMode["VERTICAL_TABS"] = "vertical_tabs";
190
+ SectionMode["PILLS"] = "pills";
191
+ // Expandable (toggle section visibility)
192
+ SectionMode["ACCORDION"] = "accordion";
193
+ SectionMode["EXPANDABLE"] = "expandable";
194
+ // Guided (sequential, with indicators)
195
+ SectionMode["STEPPER"] = "stepper";
196
+ SectionMode["TIMELINE"] = "timeline";
197
+ })(SectionMode || (SectionMode = {}));
198
+ // =============================================================================
199
+ // OVERLAY CONTAINER MODE - UI Abstraction for Overlay Rendering
200
+ // =============================================================================
201
+ /**
202
+ * OverlayContainerMode - How overlay containers are rendered.
203
+ * Controls the presentation style of standalone dismissable containers.
204
+ *
205
+ * @category Centered overlays (modal)
206
+ * - DIALOG: Standard centered modal
207
+ * - ALERT: Confirmation dialog with action buttons
208
+ * - COMMAND: Command palette (search-focused)
209
+ * - LIGHTBOX: Full-screen media viewer with navigation
210
+ *
211
+ * @category Side panels (modal)
212
+ * - SHEET: Side panel (direction via `side` prop)
213
+ *
214
+ * @category Mobile-optimized (modal)
215
+ * - DRAWER: Swipeable drawer with snap points
216
+ * - ACTION_SHEET: iOS-style action list (bottom)
217
+ *
218
+ * @category Non-blocking
219
+ * - POPOVER: Anchored contextual overlay
220
+ * - TOAST: Auto-dismiss notification
221
+ */
222
+ export var OverlayContainerMode;
223
+ (function (OverlayContainerMode) {
224
+ // Centered overlays (modal)
225
+ OverlayContainerMode["DIALOG"] = "dialog";
226
+ OverlayContainerMode["ALERT"] = "alert";
227
+ OverlayContainerMode["COMMAND"] = "command";
228
+ OverlayContainerMode["LIGHTBOX"] = "lightbox";
229
+ // Side panels (modal)
230
+ OverlayContainerMode["SHEET"] = "sheet";
231
+ // Mobile-optimized (modal)
232
+ OverlayContainerMode["DRAWER"] = "drawer";
233
+ OverlayContainerMode["ACTION_SHEET"] = "action_sheet";
234
+ // Non-blocking
235
+ OverlayContainerMode["POPOVER"] = "popover";
236
+ OverlayContainerMode["TOAST"] = "toast";
237
+ })(OverlayContainerMode || (OverlayContainerMode = {}));
238
+ /**
239
+ * Layout orientation / display direction (horizontal | vertical)
240
+ */
241
+ export var DisplayDirection;
242
+ (function (DisplayDirection) {
243
+ DisplayDirection["HORIZONTAL"] = "horizontal";
244
+ DisplayDirection["VERTICAL"] = "vertical";
245
+ })(DisplayDirection || (DisplayDirection = {}));
246
+ /**
247
+ * Horizontal alignment for UI elements (popovers, menus, action bars, etc.)
248
+ */
249
+ export var HorizontalAlign;
250
+ (function (HorizontalAlign) {
251
+ HorizontalAlign["START"] = "start";
252
+ HorizontalAlign["CENTER"] = "center";
253
+ HorizontalAlign["END"] = "end";
254
+ })(HorizontalAlign || (HorizontalAlign = {}));
255
+ //------------------------------------------------------------------------------------------------
256
+ // BOOLEAN DISPLAY POLICY
257
+ //------------------------------------------------------------------------------------------------
258
+ /**
259
+ * Labelling values for boolean fields
260
+ */
261
+ export const BooleanLabellingValue = {
262
+ YES_NO: 'yes/no',
263
+ TRUE_FALSE: 'true/false',
264
+ ON_OFF: 'on/off',
265
+ ENABLED_DISABLED: 'enabled/disabled',
266
+ ACTIVE_INACTIVE: 'active/inactive',
267
+ };
268
+ /**
269
+ * Display mode for boolean fields
270
+ */
271
+ export const BooleanDisplayMode = {
272
+ RAW: 'raw',
273
+ CHECKMARK: 'checkmark',
274
+ EDIT_LIKE: 'edit_like',
275
+ };
276
+ /**
277
+ * Edit mode for boolean fields
278
+ */
279
+ export const BooleanEditMode = {
280
+ TOGGLE: 'toggle',
281
+ SWITCH: 'switch',
282
+ CHECKBOX: 'checkbox',
283
+ RADIO: 'radio',
284
+ };
285
+ //------------------------------------------------------------------------------------------------
286
+ // STRING DISPLAY POLICY
287
+ //------------------------------------------------------------------------------------------------
288
+ /**
289
+ * String display modes for rendering string values
290
+ */
291
+ export const StringDisplayMode = {
292
+ TEXT: 'text',
293
+ TRUNCATE: 'truncate',
294
+ MULTILINE: 'multiline',
295
+ COLOR: 'color',
296
+ LINK: 'link',
297
+ EMAIL: 'email',
298
+ BADGE: 'badge',
299
+ COPY: 'copy',
300
+ SECRET: 'secret',
301
+ };
302
+ /**
303
+ * String edit modes for form components
304
+ */
305
+ export const StringEditMode = {
306
+ INPUT: 'input',
307
+ TEXTAREA: 'textarea',
308
+ COLOR: 'color',
309
+ PASSWORD: 'password',
310
+ OTP: 'otp',
311
+ };
312
+ //------------------------------------------------------------------------------------------------
313
+ // NUMBER DISPLAY POLICY
314
+ //------------------------------------------------------------------------------------------------
315
+ /**
316
+ * Number display modes for rendering number values
317
+ */
318
+ export const NumberDisplayMode = {
319
+ RAW: 'raw',
320
+ FORMATTED: 'formatted',
321
+ PERCENTAGE: 'percentage',
322
+ COMPACT: 'compact',
323
+ ORDINAL: 'ordinal',
324
+ BYTES: 'bytes',
325
+ };
326
+ /**
327
+ * Number edit modes for form components
328
+ */
329
+ export const NumberEditMode = {
330
+ INPUT: 'input',
331
+ SLIDER: 'slider',
332
+ STEPPER: 'stepper',
333
+ };
334
+ /**
335
+ * Scale modes for percentage display.
336
+ * - NORMALIZED: value is 0–1, Intl.NumberFormat's style:'percent' handles ×100
337
+ * - PERCENT: value is already 0–100, must be divided by 100 before passing to Intl
338
+ */
339
+ export const PercentageScale = {
340
+ NORMALIZED: 'normalized',
341
+ PERCENT: 'percent',
342
+ };
343
+ //------------------------------------------------------------------------------------------------
344
+ // BIGDECIMAL DISPLAY / EDIT MODES
345
+ //------------------------------------------------------------------------------------------------
346
+ /**
347
+ * Display mode for BigDecimal fields.
348
+ * Subset of NumberDisplayMode — COMPACT/ORDINAL/BYTES excluded for arbitrary precision numbers.
349
+ */
350
+ export const BigDecimalDisplayMode = {
351
+ RAW: 'raw',
352
+ FORMATTED: 'formatted',
353
+ PERCENTAGE: 'percentage',
354
+ };
355
+ /**
356
+ * Edit mode for BigDecimal fields.
357
+ * Only INPUT — SLIDER/STEPPER are not applicable for arbitrary precision numbers.
358
+ */
359
+ export const BigDecimalEditMode = {
360
+ INPUT: 'input',
361
+ };
362
+ //------------------------------------------------------------------------------------------------
363
+ // ENUM DISPLAY POLICY
364
+ //------------------------------------------------------------------------------------------------
365
+ /**
366
+ * Enum display modes for rendering enum values
367
+ */
368
+ export const EnumDisplayMode = {
369
+ TEXT: 'text',
370
+ BADGE: 'badge',
371
+ ICON: 'icon',
372
+ CARD: 'card',
373
+ };
374
+ /**
375
+ * Enum edit modes for form components
376
+ */
377
+ export const EnumEditMode = {
378
+ SELECT: 'select',
379
+ RADIO: 'radio',
380
+ RADIO_ICON_ONLY: 'radio_icon_only',
381
+ TOGGLE: 'toggle',
382
+ TOGGLE_ICON_ONLY: 'toggle_icon_only',
383
+ CARD: 'card',
384
+ CARD_ICON_ONLY: 'card_icon_only',
385
+ COMBOBOX: 'combobox',
386
+ };
387
+ /**
388
+ * Layout direction for form layouts
389
+ */
390
+ export const LayoutDirection = {
391
+ HORIZONTAL: 'horizontal',
392
+ VERTICAL: 'vertical',
393
+ };
394
+ /**
395
+ * Semantic badge variants for enum display.
396
+ * These map 1:1 to the Badge component's `variant` prop in presets-components.
397
+ */
398
+ export const BadgeSemanticVariant = {
399
+ DEFAULT: 'default',
400
+ SECONDARY: 'secondary',
401
+ OUTLINE: 'outline',
402
+ INFO: 'info',
403
+ SUCCESS: 'success',
404
+ WARNING: 'warning',
405
+ DESTRUCTIVE: 'destructive',
406
+ };
407
+ //------------------------------------------------------------------------------------------------
408
+ // FOREIGN KEY DISPLAY PARAMS
409
+ //------------------------------------------------------------------------------------------------
410
+ /**
411
+ * Foreign key display mode options
412
+ * - ID: Show raw FK ID value
413
+ * - LABEL: Show resolved label via getFrontendResourceLabel
414
+ * - SUMMARY: Show the referenced resource's summary view (compact card) (default)
415
+ *
416
+ * Note: "summary" here is about *FK rendering*, not API data shape (see DataMode.SUMMARY)
417
+ * or operation bar density (see ResourceOperationDisplayMode.SUMMARY).
418
+ */
419
+ export const ForeignKeyDisplayMode = {
420
+ ID: 'id',
421
+ LABEL: 'label',
422
+ SUMMARY: 'summary',
423
+ };
424
+ //------------------------------------------------------------------------------------------------
425
+ // RANGE SCHEMA TYPES
426
+ //------------------------------------------------------------------------------------------------
427
+ /**
428
+ * Supported types for range schemas.
429
+ */
430
+ export var RangeType;
431
+ (function (RangeType) {
432
+ RangeType["NUMBER"] = "number";
433
+ RangeType["DATE"] = "date";
434
+ RangeType["DATETIME"] = "datetime";
435
+ RangeType["TIME"] = "time";
436
+ RangeType["BIGDECIMAL"] = "bigdecimal";
437
+ RangeType["MONEY"] = "money";
438
+ })(RangeType || (RangeType = {}));
439
+ // Range type for range schemas (matches RangeType from saas-models).
440
+ // Duplicated here to avoid circular dependency.
441
+ export var RangeSchemaType;
442
+ (function (RangeSchemaType) {
443
+ RangeSchemaType["NUMBER"] = "number";
444
+ RangeSchemaType["DATE"] = "date";
445
+ RangeSchemaType["DATETIME"] = "datetime";
446
+ RangeSchemaType["TIME"] = "time";
447
+ RangeSchemaType["BIGDECIMAL"] = "bigdecimal";
448
+ RangeSchemaType["MONEY"] = "money";
449
+ })(RangeSchemaType || (RangeSchemaType = {}));
450
+ // Map range type to its default component.
451
+ export const RangeTypeToComponent = {
452
+ [RangeSchemaType.NUMBER]: FormFieldComponent.RANGE_SLIDER,
453
+ [RangeSchemaType.DATE]: FormFieldComponent.DATE_RANGE,
454
+ [RangeSchemaType.DATETIME]: FormFieldComponent.DATETIME_RANGE,
455
+ [RangeSchemaType.TIME]: FormFieldComponent.TIME_RANGE,
456
+ [RangeSchemaType.BIGDECIMAL]: FormFieldComponent.BIGDECIMAL_RANGE,
457
+ [RangeSchemaType.MONEY]: FormFieldComponent.MONEY_RANGE,
458
+ };
459
+ // Get the default form component for a range type.
460
+ export function getDefaultRangeComponent(rangeType) {
461
+ return RangeTypeToComponent[rangeType] ?? FormFieldComponent.RANGE_SLIDER;
462
+ }
463
+ //------------------------------------------------------------------------------------------------
464
+ // DURATION SCHEMA TYPES
465
+ //------------------------------------------------------------------------------------------------
466
+ /**
467
+ * Duration units enum.
468
+ * Uses string values for JSON serialization and API compatibility.
469
+ * Aligns with common patterns (e.g., expiresIn: { value, unit }).
470
+ */
471
+ export var DurationUnit;
472
+ (function (DurationUnit) {
473
+ DurationUnit["MILLISECONDS"] = "milliseconds";
474
+ DurationUnit["SECONDS"] = "seconds";
475
+ DurationUnit["MINUTES"] = "minutes";
476
+ DurationUnit["HOURS"] = "hours";
477
+ DurationUnit["DAYS"] = "days";
478
+ DurationUnit["WEEKS"] = "weeks";
479
+ DurationUnit["MONTHS"] = "months";
480
+ DurationUnit["YEARS"] = "years";
481
+ DurationUnit["CENTURIES"] = "centuries";
482
+ })(DurationUnit || (DurationUnit = {}));
483
+ //------------------------------------------------------------------------------------------------
484
+ // FILE SCHEMA TYPES
485
+ //------------------------------------------------------------------------------------------------
486
+ /**
487
+ * Common MIME type groups for file uploads.
488
+ */
489
+ export const FileMimeTypeGroups = {
490
+ /** Image files: JPEG, PNG, GIF, WebP, SVG, etc. */
491
+ Images: [
492
+ 'image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml',
493
+ 'image/bmp', 'image/tiff', 'image/x-icon', 'image/heic', 'image/heif'
494
+ ],
495
+ /** Video files: MP4, WebM, AVI, MOV, etc. */
496
+ Video: [
497
+ 'video/mp4', 'video/webm', 'video/ogg', 'video/avi', 'video/quicktime',
498
+ 'video/x-msvideo', 'video/x-ms-wmv', 'video/mpeg', 'video/3gpp'
499
+ ],
500
+ /** Audio files: MP3, WAV, OGG, etc. */
501
+ Audio: [
502
+ 'audio/mpeg', 'audio/wav', 'audio/ogg', 'audio/webm', 'audio/aac',
503
+ 'audio/flac', 'audio/x-m4a', 'audio/mp4'
504
+ ],
505
+ /** PDF documents */
506
+ PDF: ['application/pdf'],
507
+ /** Office documents: Word, Excel, PowerPoint, etc. */
508
+ Office: [
509
+ 'application/msword',
510
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
511
+ 'application/vnd.ms-excel',
512
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
513
+ 'application/vnd.ms-powerpoint',
514
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
515
+ 'application/vnd.oasis.opendocument.text',
516
+ 'application/vnd.oasis.opendocument.spreadsheet',
517
+ 'application/vnd.oasis.opendocument.presentation'
518
+ ],
519
+ /** All documents: PDF + Office */
520
+ Documents: [
521
+ 'application/pdf',
522
+ 'application/msword',
523
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
524
+ 'application/vnd.ms-excel',
525
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
526
+ 'application/vnd.ms-powerpoint',
527
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
528
+ 'application/vnd.oasis.opendocument.text',
529
+ 'application/vnd.oasis.opendocument.spreadsheet',
530
+ 'application/vnd.oasis.opendocument.presentation'
531
+ ],
532
+ /** Archives: ZIP, RAR, 7z, etc. */
533
+ Archives: [
534
+ 'application/zip', 'application/x-zip-compressed',
535
+ 'application/x-rar-compressed', 'application/x-7z-compressed',
536
+ 'application/gzip', 'application/x-tar'
537
+ ],
538
+ };
539
+ /**
540
+ * File nature classification for constraint validation and UI display.
541
+ */
542
+ export var FileNature;
543
+ (function (FileNature) {
544
+ FileNature["IMAGE"] = "image";
545
+ FileNature["VIDEO"] = "video";
546
+ FileNature["AUDIO"] = "audio";
547
+ FileNature["PDF"] = "pdf";
548
+ FileNature["OFFICE"] = "office";
549
+ FileNature["ARCHIVE"] = "archive";
550
+ FileNature["ALL"] = "all";
551
+ })(FileNature || (FileNature = {}));
552
+ /**
553
+ * Rendering-level file nature categories.
554
+ *
555
+ * Maps the granular `FileNature` schema enum into coarser display categories
556
+ * used by frontend components to select the appropriate renderer:
557
+ * - `FileNature.PDF` + `FileNature.OFFICE` → `FileDisplayNature.DOCUMENT`
558
+ * - `FileNature.ARCHIVE` + `FileNature.ALL` + unknown → `FileDisplayNature.GENERIC`
559
+ *
560
+ * Use `resolveFileDisplayNature()` from `zod-file.ts` to resolve from
561
+ * schema metadata and/or MIME type.
562
+ */
563
+ export var FileDisplayNature;
564
+ (function (FileDisplayNature) {
565
+ FileDisplayNature["IMAGE"] = "image";
566
+ FileDisplayNature["VIDEO"] = "video";
567
+ FileDisplayNature["AUDIO"] = "audio";
568
+ FileDisplayNature["DOCUMENT"] = "document";
569
+ FileDisplayNature["GENERIC"] = "generic";
570
+ })(FileDisplayNature || (FileDisplayNature = {}));
571
+ /**
572
+ * Storage providers accepted for file uploads.
573
+ */
574
+ export var FileStorageAccepted;
575
+ (function (FileStorageAccepted) {
576
+ FileStorageAccepted["WILDO_MANAGED"] = "wildo_managed";
577
+ FileStorageAccepted["LOCAL_DIRECTORY"] = "local_directory";
578
+ FileStorageAccepted["ONEDRIVE"] = "onedrive";
579
+ FileStorageAccepted["GOOGLE_DRIVE"] = "google_drive";
580
+ FileStorageAccepted["DROPBOX"] = "dropbox";
581
+ })(FileStorageAccepted || (FileStorageAccepted = {}));
582
+ export var FileUploaderEntityType;
583
+ (function (FileUploaderEntityType) {
584
+ FileUploaderEntityType["USER"] = "user";
585
+ FileUploaderEntityType["ANONYMOUS_USER"] = "anonymous_user";
586
+ FileUploaderEntityType["ORGANIZATION_API_KEY"] = "organization_api_key";
587
+ FileUploaderEntityType["APPLICATION_API_KEY"] = "application_api_key";
588
+ })(FileUploaderEntityType || (FileUploaderEntityType = {}));
589
+ /**
590
+ * Image format options for file validation.
591
+ */
592
+ export const ImageFormat = {
593
+ JPEG: 'jpeg',
594
+ PNG: 'png',
595
+ GIF: 'gif',
596
+ WEBP: 'webp',
597
+ SVG: 'svg',
598
+ };
599
+ /**
600
+ * Video format options for file validation.
601
+ */
602
+ export const VideoFormat = {
603
+ MP4: 'mp4',
604
+ WEBM: 'webm',
605
+ MOV: 'mov',
606
+ };
607
+ /**
608
+ * Audio format options for file validation.
609
+ */
610
+ export const AudioFormat = {
611
+ MP3: 'mp3',
612
+ WAV: 'wav',
613
+ OGG: 'ogg',
614
+ AAC: 'aac',
615
+ };
616
+ /**
617
+ * RAG chunking strategy options for file content indexing.
618
+ */
619
+ export const RAGChunkingStrategy = {
620
+ FIXED_SIZE: 'fixed_size',
621
+ RECURSIVE: 'recursive',
622
+ SEMANTIC: 'semantic',
623
+ MARKDOWN: 'markdown',
624
+ };
625
+ /**
626
+ * File behavior when parent resource is deleted.
627
+ * - CASCADE: Mark the file deleted as part of parent removal; physical storage cleanup is deferred to the cleanup batch
628
+ * - SOFT_DELETE: Same current runtime behavior as CASCADE, but keeps an explicit semantic marker for consumers that want to model softer intent
629
+ * - ORPHAN: Keep file, remove association with parent
630
+ */
631
+ export const FileOnParentDelete = {
632
+ CASCADE: 'cascade',
633
+ SOFT_DELETE: 'soft-delete',
634
+ ORPHAN: 'orphan',
635
+ };
636
+ // HiddenFieldParams, NotEditableFieldParams
637
+ // are imported from @wildo-ai/presets-components-models
638
+ /**
639
+ * Inline edit mode options
640
+ */
641
+ export const InlineEditMode = {
642
+ DIRECT: 'direct',
643
+ BUTTON: 'button',
644
+ };
645
+ /**
646
+ * P10: When to trigger save in inline editing mode
647
+ */
648
+ export const InlineEditSaveOn = {
649
+ /** Save on blur (when user clicks away) */
650
+ BLUR: 'blur',
651
+ /** Save only on explicit button click */
652
+ EXPLICIT: 'explicit',
653
+ };
654
+ //------------------------------------------------------------------------------------------------
655
+ // UNIQUE FIELD PARAMS
656
+ //------------------------------------------------------------------------------------------------
657
+ /**
658
+ * Scope for unique constraint enforcement.
659
+ * - 'global': Unique across the entire collection (default)
660
+ * - 'organization': Unique within an organization (compound index with organizationId)
661
+ * - 'user': Unique per user (compound index with createdByUserId)
662
+ */
663
+ export const UniqueScope = {
664
+ GLOBAL: 'global',
665
+ ORGANIZATION: 'organization',
666
+ USER: 'user',
667
+ };
668
+ //------------------------------------------------------------------------------------------------
669
+ // FORM VALIDATION DECORATOR PARAMS
670
+ //------------------------------------------------------------------------------------------------
671
+ /**
672
+ * Validation mode for form fields.
673
+ * Configures when field validation is triggered.
674
+ * - ON_CHANGE: Validate on every change (with debounce for text fields)
675
+ * - ON_BLUR: Validate when field loses focus (default for text fields)
676
+ * - ON_TOUCHED: Validate on blur initially, then on every change once touched
677
+ * - ON_SUBMIT: Validate only on form submission
678
+ */
679
+ export var ValidationMode;
680
+ (function (ValidationMode) {
681
+ ValidationMode["ON_CHANGE"] = "onChange";
682
+ ValidationMode["ON_BLUR"] = "onBlur";
683
+ ValidationMode["ON_TOUCHED"] = "onTouched";
684
+ ValidationMode["ON_SUBMIT"] = "onSubmit";
685
+ })(ValidationMode || (ValidationMode = {}));
686
+ /**
687
+ * Trigger mechanism for autosave.
688
+ * - DEBOUNCE: Save after a delay following the last change
689
+ * - BLUR: Save when field loses focus
690
+ * - NONE: Disable autosave for this field
691
+ */
692
+ export var AutosaveTrigger;
693
+ (function (AutosaveTrigger) {
694
+ AutosaveTrigger["DEBOUNCE"] = "debounce";
695
+ AutosaveTrigger["BLUR"] = "blur";
696
+ AutosaveTrigger["NONE"] = "none";
697
+ })(AutosaveTrigger || (AutosaveTrigger = {}));
698
+ // ==========================================================================================================================================================
699
+ // SHOW WHEN TYPES (FIX-P5-H1)
700
+ // ==========================================================================================================================================================
701
+ /**
702
+ * FIX-P5-H1: Operator for showWhen condition comparison.
703
+ * - EQUALS: Field value equals the specified value
704
+ * - NOT_EQUALS: Field value does not equal the specified value
705
+ * - IN: Field value is in the specified array
706
+ * - NOT_IN: Field value is not in the specified array
707
+ * - EXISTS: Field value exists (is defined and not null)
708
+ * - NOT_EXISTS: Field value does not exist (undefined or null)
709
+ */
710
+ export var ShowWhenOperator;
711
+ (function (ShowWhenOperator) {
712
+ ShowWhenOperator["EQUALS"] = "equals";
713
+ ShowWhenOperator["NOT_EQUALS"] = "notEquals";
714
+ ShowWhenOperator["IN"] = "in";
715
+ ShowWhenOperator["NOT_IN"] = "notIn";
716
+ ShowWhenOperator["EXISTS"] = "exists";
717
+ ShowWhenOperator["NOT_EXISTS"] = "notExists";
718
+ })(ShowWhenOperator || (ShowWhenOperator = {}));
719
+ // ==========================================================================================================================================================
720
+ // ZOD DECORATOR TYPES
721
+ // ==========================================================================================================================================================
722
+ export var ZodDecorator;
723
+ (function (ZodDecorator) {
724
+ ZodDecorator["IS_DB_INDEXED"] = "isDBIndexed";
725
+ ZodDecorator["IS_FOREIGN_KEY"] = "isForeignKey";
726
+ ZodDecorator["IS_HIDDEN"] = "isHidden";
727
+ ZodDecorator["IS_NOT_EDITABLE"] = "isNotEditable";
728
+ // New decorators for resource derived objects rationalization
729
+ ZodDecorator["IS_SUMMARY_FIELD"] = "isSummaryField";
730
+ ZodDecorator["IS_BACKEND_ONLY"] = "isBackendOnly";
731
+ ZodDecorator["IS_VIRTUAL"] = "isVirtual";
732
+ ZodDecorator["IS_DISCRIMINATOR"] = "isDiscriminator";
733
+ ZodDecorator["EXCLUDE_FROM_CREATE"] = "excludeFromCreate";
734
+ ZodDecorator["EXCLUDE_FROM_UPDATE"] = "excludeFromUpdate";
735
+ // Database constraint decorators
736
+ ZodDecorator["IS_UNIQUE"] = "isUnique";
737
+ ZodDecorator["IS_PRIMARY_KEY"] = "isPrimaryKey";
738
+ ZodDecorator["TTL"] = "ttl";
739
+ // String edit mode convenience decorators (shorthand for STRING_UI with specific editMode)
740
+ ZodDecorator["IS_PASSWORD"] = "isPassword";
741
+ ZodDecorator["IS_OTP"] = "isOtp";
742
+ ZodDecorator["IS_COLOR"] = "isColor";
743
+ // Form validation decorators
744
+ ZodDecorator["IS_DRAFT_RELAXED"] = "isDraftRelaxed";
745
+ // FIX-P5-H1: Conditional visibility decorator
746
+ ZodDecorator["SHOW_WHEN"] = "showWhen";
747
+ // System enum decorator - marks an enum field as using a system-level enum (currency, language, country, etc.)
748
+ ZodDecorator["SYSTEM_ENUM"] = "systemEnum";
749
+ // Ephemeral field decorator - marks a field as transient response-only data (shown once, then gone)
750
+ ZodDecorator["IS_EPHEMERAL"] = "isEphemeral";
751
+ // CRDT field decorator - marks a field for future field-level LWW merge (Phase 3C)
752
+ ZodDecorator["IS_CRDT"] = "isCRDT";
753
+ // Unified {primitive}UI decorators — new API replacing display policy + formField decomposition
754
+ ZodDecorator["BOOLEAN_UI"] = "booleanUI";
755
+ ZodDecorator["STRING_UI"] = "stringUI";
756
+ ZodDecorator["NUMBER_UI"] = "numberUI";
757
+ ZodDecorator["ENUM_UI"] = "enumUI";
758
+ ZodDecorator["DATE_UI"] = "dateUI";
759
+ ZodDecorator["DATETIME_UI"] = "dateTimeUI";
760
+ ZodDecorator["TIME_UI"] = "timeUI";
761
+ ZodDecorator["MONEY_UI"] = "moneyUI";
762
+ ZodDecorator["CODE_UI"] = "codeUI";
763
+ ZodDecorator["FILE_UI"] = "fileUI";
764
+ ZodDecorator["DURATION_UI"] = "durationUI";
765
+ ZodDecorator["PHONE_UI"] = "phoneUI";
766
+ ZodDecorator["BIGDECIMAL_UI"] = "bigDecimalUI";
767
+ ZodDecorator["FOREIGN_KEY_UI"] = "foreignKeyUI";
768
+ ZodDecorator["ARRAY_UI"] = "arrayUI";
769
+ ZodDecorator["OBJECT_UI"] = "objectUI";
770
+ })(ZodDecorator || (ZodDecorator = {}));
771
+ //# sourceMappingURL=zod-decorators.types.js.map