@stndrds/schema 1.0.0-alpha.293 → 1.0.0-alpha.68

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 (161) hide show
  1. package/dist/chunk-36UBIXJN.js +82 -0
  2. package/dist/chunk-3RG5ZIWI.js +10 -0
  3. package/dist/chunk-IXHWBBIY.mjs +721 -0
  4. package/dist/chunk-KG75T7MA.mjs +18664 -0
  5. package/dist/chunk-NEVERCM3.js +41 -0
  6. package/dist/chunk-V2RPPE2Y.mjs +41 -0
  7. package/dist/chunk-V32FQLWX.js +721 -0
  8. package/dist/chunk-V5QXU2OK.mjs +82 -0
  9. package/dist/chunk-XGFBT4K2.js +18664 -0
  10. package/dist/chunk-Y6FXYEAI.mjs +10 -0
  11. package/dist/default-roles-42X3TJI5.mjs +21 -0
  12. package/dist/default-roles-C3FYDYMN.js +21 -0
  13. package/dist/index.d.mts +3392 -10860
  14. package/dist/index.d.ts +3392 -10860
  15. package/dist/index.js +1705 -10255
  16. package/dist/index.mjs +1735 -9398
  17. package/dist/runtime-B0G6eBXO.d.ts +12810 -0
  18. package/dist/runtime-fj4EKCWH.d.mts +12810 -0
  19. package/dist/runtime.d.mts +6 -0
  20. package/dist/runtime.d.ts +6 -0
  21. package/dist/runtime.js +323 -0
  22. package/dist/runtime.mjs +323 -0
  23. package/dist/utils.d.mts +55 -35
  24. package/dist/utils.d.ts +55 -35
  25. package/dist/utils.js +19 -31
  26. package/dist/utils.mjs +19 -2
  27. package/dist/validation/validators.d.mts +4 -0
  28. package/dist/validation/validators.d.ts +4 -0
  29. package/dist/validation/validators.js +121 -0
  30. package/dist/validation/validators.mjs +121 -0
  31. package/dist/validators-B6L_hVBw.d.ts +1564 -0
  32. package/dist/validators-CgiGGhyH.d.mts +1564 -0
  33. package/package.json +16 -106
  34. package/dist/all-CDJSpI46.d.ts +0 -978
  35. package/dist/all-Cru_CaSY.d.mts +0 -978
  36. package/dist/attributes-CNYwg_Nr.d.ts +0 -584
  37. package/dist/attributes-CWPLbp7c.d.mts +0 -584
  38. package/dist/capabilities.d.mts +0 -146
  39. package/dist/capabilities.d.ts +0 -146
  40. package/dist/capabilities.js +0 -77
  41. package/dist/capabilities.mjs +0 -70
  42. package/dist/chunk-5N7OSHVX.js +0 -657
  43. package/dist/chunk-5WATIVCA.js +0 -10
  44. package/dist/chunk-ACKMC6FL.js +0 -17
  45. package/dist/chunk-APRL56F4.mjs +0 -226
  46. package/dist/chunk-AYVHMVKQ.mjs +0 -15
  47. package/dist/chunk-C32UUQ6D.js +0 -241
  48. package/dist/chunk-E6JUYGJX.js +0 -22
  49. package/dist/chunk-EEH4XQ7W.js +0 -61
  50. package/dist/chunk-EW5XR2X3.js +0 -12
  51. package/dist/chunk-GO6LQADH.mjs +0 -57
  52. package/dist/chunk-GRUSTQK3.mjs +0 -641
  53. package/dist/chunk-HRQEZUAA.mjs +0 -29
  54. package/dist/chunk-HTSTPTNZ.js +0 -10
  55. package/dist/chunk-KNGWHQLR.js +0 -16
  56. package/dist/chunk-LV3FEUKU.mjs +0 -14
  57. package/dist/chunk-NS63SPNN.mjs +0 -8
  58. package/dist/chunk-O73ROMWQ.mjs +0 -85
  59. package/dist/chunk-OASIPLEB.js +0 -1504
  60. package/dist/chunk-OSSGN43B.mjs +0 -8
  61. package/dist/chunk-P4VCAPJT.js +0 -81
  62. package/dist/chunk-Q44QKLN4.mjs +0 -43
  63. package/dist/chunk-Q4SZAMJT.js +0 -72
  64. package/dist/chunk-QVLQPW3O.mjs +0 -10
  65. package/dist/chunk-QWKLQRBX.js +0 -35
  66. package/dist/chunk-R5LAJCBU.mjs +0 -67
  67. package/dist/chunk-SI34M4IC.js +0 -45
  68. package/dist/chunk-UANQJ2GH.mjs +0 -25
  69. package/dist/chunk-ULM2BA5A.mjs +0 -1432
  70. package/dist/chunk-UXAHLSWC.mjs +0 -8
  71. package/dist/chunk-V2UA2D4E.js +0 -10
  72. package/dist/chunk-VGGGLTYJ.mjs +0 -74
  73. package/dist/chunk-Y3UPKP2B.js +0 -605
  74. package/dist/chunk-YIP5FJ5H.js +0 -27
  75. package/dist/chunk-YKWSHBT5.js +0 -32
  76. package/dist/chunk-YUFTHPOE.mjs +0 -20
  77. package/dist/chunk-Z5OPSBMQ.mjs +0 -566
  78. package/dist/chunk-ZDQ5AP26.mjs +0 -31
  79. package/dist/chunk-ZPFOKBIN.js +0 -89
  80. package/dist/exceptions.d.mts +0 -507
  81. package/dist/exceptions.d.ts +0 -507
  82. package/dist/exceptions.js +0 -158
  83. package/dist/exceptions.mjs +0 -1
  84. package/dist/helpers-CXkVwpsl.d.ts +0 -76
  85. package/dist/helpers-Dul_r9rJ.d.mts +0 -76
  86. package/dist/index-BdVnHL3F.d.mts +0 -853
  87. package/dist/index-CFhPHQaI.d.ts +0 -853
  88. package/dist/migrations-DaFneOfx.d.ts +0 -39
  89. package/dist/migrations-fRvadl6i.d.mts +0 -39
  90. package/dist/objects-CDwMSnqv.d.mts +0 -250
  91. package/dist/objects-DJv6WrDE.d.ts +0 -250
  92. package/dist/types-CVYiFc69.d.mts +0 -38
  93. package/dist/types-NGEww_ln.d.ts +0 -38
  94. package/dist/validation/all.d.mts +0 -11
  95. package/dist/validation/all.d.ts +0 -11
  96. package/dist/validation/all.js +0 -131
  97. package/dist/validation/all.mjs +0 -18
  98. package/dist/validation/complex/currency.d.mts +0 -15
  99. package/dist/validation/complex/currency.d.ts +0 -15
  100. package/dist/validation/complex/currency.js +0 -11
  101. package/dist/validation/complex/currency.mjs +0 -2
  102. package/dist/validation/complex/location.d.mts +0 -22
  103. package/dist/validation/complex/location.d.ts +0 -22
  104. package/dist/validation/complex/location.js +0 -11
  105. package/dist/validation/complex/location.mjs +0 -2
  106. package/dist/validation/complex/phone.d.mts +0 -22
  107. package/dist/validation/complex/phone.d.ts +0 -22
  108. package/dist/validation/complex/phone.js +0 -11
  109. package/dist/validation/complex/phone.mjs +0 -2
  110. package/dist/validation/complex/relation.d.mts +0 -25
  111. package/dist/validation/complex/relation.d.ts +0 -25
  112. package/dist/validation/complex/relation.js +0 -19
  113. package/dist/validation/complex/relation.mjs +0 -2
  114. package/dist/validation/complex/richtext.d.mts +0 -13
  115. package/dist/validation/complex/richtext.d.ts +0 -13
  116. package/dist/validation/complex/richtext.js +0 -11
  117. package/dist/validation/complex/richtext.mjs +0 -2
  118. package/dist/validation/complex/select.d.mts +0 -20
  119. package/dist/validation/complex/select.d.ts +0 -20
  120. package/dist/validation/complex/select.js +0 -19
  121. package/dist/validation/complex/select.mjs +0 -2
  122. package/dist/validation/complex/user.d.mts +0 -13
  123. package/dist/validation/complex/user.d.ts +0 -13
  124. package/dist/validation/complex/user.js +0 -11
  125. package/dist/validation/complex/user.mjs +0 -2
  126. package/dist/validation/computed/formula.d.mts +0 -14
  127. package/dist/validation/computed/formula.d.ts +0 -14
  128. package/dist/validation/computed/formula.js +0 -11
  129. package/dist/validation/computed/formula.mjs +0 -2
  130. package/dist/validation/computed/rollup.d.mts +0 -14
  131. package/dist/validation/computed/rollup.d.ts +0 -14
  132. package/dist/validation/computed/rollup.js +0 -11
  133. package/dist/validation/computed/rollup.mjs +0 -2
  134. package/dist/validation/config/index.d.mts +0 -7
  135. package/dist/validation/config/index.d.ts +0 -7
  136. package/dist/validation/config/index.js +0 -52
  137. package/dist/validation/config/index.mjs +0 -7
  138. package/dist/validation/core/index.d.mts +0 -19
  139. package/dist/validation/core/index.d.ts +0 -19
  140. package/dist/validation/core/index.js +0 -14
  141. package/dist/validation/core/index.mjs +0 -1
  142. package/dist/validation/object/index.d.mts +0 -32
  143. package/dist/validation/object/index.d.ts +0 -32
  144. package/dist/validation/object/index.js +0 -69
  145. package/dist/validation/object/index.mjs +0 -16
  146. package/dist/validation/primitives/checkbox.d.mts +0 -12
  147. package/dist/validation/primitives/checkbox.d.ts +0 -12
  148. package/dist/validation/primitives/checkbox.js +0 -11
  149. package/dist/validation/primitives/checkbox.mjs +0 -2
  150. package/dist/validation/primitives/date.d.mts +0 -25
  151. package/dist/validation/primitives/date.d.ts +0 -25
  152. package/dist/validation/primitives/date.js +0 -11
  153. package/dist/validation/primitives/date.mjs +0 -2
  154. package/dist/validation/primitives/number.d.mts +0 -12
  155. package/dist/validation/primitives/number.d.ts +0 -12
  156. package/dist/validation/primitives/number.js +0 -11
  157. package/dist/validation/primitives/number.mjs +0 -2
  158. package/dist/validation/primitives/text.d.mts +0 -12
  159. package/dist/validation/primitives/text.d.ts +0 -12
  160. package/dist/validation/primitives/text.js +0 -11
  161. package/dist/validation/primitives/text.mjs +0 -2
@@ -1,853 +0,0 @@
1
- import { z } from 'zod';
2
- import { A as Attribute, f as AttributeType, e as RollupAttribute } from './attributes-CNYwg_Nr.js';
3
- import { IconName } from '@stndrds/constants';
4
- import { L as ListViewTabVisibility } from './objects-DJv6WrDE.js';
5
-
6
- /** Operators for text-based attributes */
7
- type TextFilterOperator = "is" | "is_not" | "contains" | "not_contains" | "starts_with" | "ends_with" | "is_empty" | "is_not_empty";
8
- /** Operators for number-based attributes */
9
- type NumberFilterOperator = "is" | "is_not" | "less_than" | "greater_than" | "less_or_equal" | "greater_or_equal" | "is_empty" | "is_not_empty";
10
- /** Operators for checkbox — `is` with a boolean rule value (a checkbox always has a value) */
11
- type CheckboxFilterOperator = "is";
12
- /** Operators for date-based attributes (ordering shares the numeric vocabulary) */
13
- type DateFilterOperator = "is" | "is_not" | "less_than" | "greater_than" | "less_or_equal" | "greater_or_equal" | "is_within" | "on_day_month" | "is_empty" | "is_not_empty";
14
- /** Operators for select-based attributes (supports single or multi-value filtering) */
15
- type SelectFilterOperator = "is" | "is_not" | "any_of" | "none_of" | "is_empty" | "is_not_empty";
16
- /** Operators for multiselect-based attributes — set membership only */
17
- type MultiselectFilterOperator = "any_of" | "none_of" | "is_empty" | "is_not_empty";
18
- /**
19
- * Operators for relation-based attributes (covers single, multi-value, and
20
- * reference-shaped filtering — user, relation, document share the same
21
- * edge-backed operator set). Membership is `any_of`/`none_of` only.
22
- */
23
- type RelationFilterOperator = "is" | "is_not" | "any_of" | "none_of" | "is_empty" | "is_not_empty";
24
- /**
25
- * All possible filter operators — the canonical set of 16.
26
- * Short input codes (`lt`, `gte`, `eq`, `in`, …) are accepted at entry only
27
- * and normalized via SYNONYM_ALIASES; they are never stored and never typed.
28
- */
29
- type FilterOperator = TextFilterOperator | NumberFilterOperator | CheckboxFilterOperator | DateFilterOperator | SelectFilterOperator | MultiselectFilterOperator | RelationFilterOperator;
30
- /** Relative date value for "is_within" operator */
31
- interface RelativeDateValue {
32
- amount: number;
33
- unit: "days" | "weeks" | "months" | "years";
34
- direction: "past" | "future";
35
- }
36
- /** Currency filter value with amount and optional currency codes
37
- * - code: undefined or [] = any currency
38
- * - code: string[] = filter by specific currencies
39
- */
40
- interface CurrencyFilterValue {
41
- value: number | null;
42
- code?: string[];
43
- }
44
- /** Phone filter value with number and optional country code */
45
- interface PhoneFilterValue {
46
- phoneNumber: string | null;
47
- countryCode?: string;
48
- }
49
- /**
50
- * A filter value resolved at query time from the execution context.
51
- * Stored verbatim in a view's filter; replaced with a concrete value by the
52
- * runtime before reaching any query layer. Discriminated by the `dynamic` key —
53
- * no static FilterValue carries it.
54
- */
55
- type DynamicValue = {
56
- dynamic: "actor";
57
- ref: "current";
58
- } | {
59
- dynamic: "date";
60
- anchor: "today";
61
- } | {
62
- dynamic: "date";
63
- anchor: "now";
64
- };
65
- /**
66
- * The value `on_day_month` ("is on") takes: a calendar day without a year.
67
- *
68
- * Postgres matches it with `LIKE '%-MM-DD'` and Meili with `CONTAINS "-MM-DD"`,
69
- * both reading these two members off the stored value, and the filter UI renders
70
- * a dedicated input producing exactly this shape. It was the one operator whose
71
- * value had no member in the union below, so the same shape had to be cast in
72
- * at every site that used it (#2469).
73
- */
74
- interface DayMonthValue {
75
- month: number;
76
- day: number;
77
- }
78
- /** Filter value can be various types depending on the attribute */
79
- type FilterValue = string | number | boolean | string[] | RelativeDateValue | CurrencyFilterValue | PhoneFilterValue | DayMonthValue | DynamicValue | null;
80
- /** Existence quantifier for qualified edge rules. Maps to SQL EXISTS / NOT EXISTS. */
81
- type EdgeQuantifier = "any" | "none";
82
- /** A single filter rule */
83
- interface FilterRule {
84
- /** Root attribute name (scalar attribute, or a reference attribute when `property` is set). */
85
- attribute: string;
86
- /**
87
- * If set, this rule filters on a qualified edge property.
88
- * Requires `attribute` to be a reference attribute (today: `relation` or `document`) that has `.qualifyWith()`.
89
- * The `operator` must be valid for the property's type, not the root attribute's type.
90
- * On a `location` attribute it names one of the location's parts instead
91
- * (`city` | `postalCode` | `country`), compared as text; `quantifier` is
92
- * invalid there — one location is not a set of edges (#3118).
93
- */
94
- property?: string;
95
- /**
96
- * Existence quantifier for qualified edge rules ("at least one" vs "none").
97
- * Only valid when `property` is set. Maps to SQL EXISTS / NOT EXISTS.
98
- * Defaults to the operator-derived polarity when omitted.
99
- */
100
- quantifier?: EdgeQuantifier;
101
- /** Filter operator */
102
- operator: FilterOperator;
103
- /** Filter value (null for operators like is_empty) */
104
- value: FilterValue;
105
- }
106
- /**
107
- * Extended filter rule with optional attribute definition.
108
- * When provided, enables smarter type-aware filtering (e.g., array operators for multiselect).
109
- */
110
- interface ExtendedFilterRule extends FilterRule {
111
- /** Full attribute definition for type-aware filtering */
112
- attributeDef?: Attribute;
113
- }
114
- /** Combinator for filter rules */
115
- type FilterCombinator = "and" | "or";
116
- /** Complete filter state (simple mode) */
117
- interface FilterState {
118
- /** How to combine rules */
119
- combinator: FilterCombinator;
120
- /** List of filter rules */
121
- rules: FilterRule[];
122
- }
123
- /**
124
- * A filter group containing rules (used in advanced mode)
125
- * Groups can be nested up to 2 levels deep
126
- */
127
- interface FilterGroup {
128
- /** Unique identifier for this group */
129
- id: string;
130
- /** How to combine rules within this group */
131
- combinator: FilterCombinator;
132
- /** List of filter rules in this group */
133
- rules: FilterRule[];
134
- }
135
- /**
136
- * Advanced filter state with nested groups
137
- * Structure: AdvancedFilterState -> FilterGroup[] -> FilterRule[]
138
- * Maximum 2 levels of nesting
139
- */
140
- interface AdvancedFilterState {
141
- /** How to combine groups at the top level */
142
- combinator: FilterCombinator;
143
- /** List of filter groups */
144
- groups: FilterGroup[];
145
- }
146
- /** Sort direction */
147
- type SortDirection = "asc" | "desc";
148
- /** A single sort rule */
149
- interface SortRule {
150
- /** Attribute name to sort by */
151
- attribute: string;
152
- /** Sort direction */
153
- direction: SortDirection;
154
- }
155
- /** Complete query state with search, filters, sorts, and pagination */
156
- interface QueryState {
157
- /** Full-text search query */
158
- search?: string;
159
- /** Filter configuration (simple mode) */
160
- filters?: FilterState;
161
- /** Advanced filter configuration (grouped mode) */
162
- advancedFilters?: AdvancedFilterState;
163
- /** Sort configuration (multiple sorts supported) */
164
- sorts?: SortRule[];
165
- /** Pagination */
166
- limit?: number;
167
- offset?: number;
168
- }
169
- /** Mapping of attribute types to their valid operators (rollup excluded — use getRollupFilterOperators()) */
170
- declare const OPERATORS_BY_TYPE: Record<Exclude<AttributeType, "rollup">, readonly FilterOperator[]>;
171
- /** Check if an operator requires a value */
172
- type NoValueOperator = "is_empty" | "is_not_empty";
173
- /** Operators that don't require a value */
174
- declare const NO_VALUE_OPERATORS: readonly NoValueOperator[];
175
- /**
176
- * Check if an operator requires a value
177
- */
178
- declare function isNoValueOperator(operator: FilterOperator): operator is NoValueOperator;
179
- /**
180
- * Get the filter operators for a rollup attribute based on its aggregation function and target type.
181
- *
182
- * - earliest / latest → date operators
183
- * - original → operators matching targetAttributeType (falls back to numeric if unknown)
184
- * - all other functions → numeric operators (sum, avg, count, percent, etc.)
185
- */
186
- declare function getRollupFilterOperators(attr: RollupAttribute): readonly FilterOperator[];
187
-
188
- /**
189
- * Type of view - determines the config structure
190
- */
191
- type ViewType = "detail" | "list";
192
- /**
193
- * Creation behavior when clicking the "+" button
194
- * - `redirect`: Create the record then navigate to its detail page
195
- * - `inline`: Insert an empty row in the table (no navigation)
196
- * - `peek`: Create a draft immediately and open it in the record stack side panel
197
- */
198
- type CreateMode = "redirect" | "inline" | "peek";
199
- /**
200
- * Inline attribute group configuration
201
- * Groups multiple attributes into a single composite field with dropdown editing
202
- */
203
- interface AttributeGroupField {
204
- /** Unique identifier for the group */
205
- id: string;
206
- /** Display label for the composite field */
207
- label: string;
208
- /** Description shown in the dropdown */
209
- description?: string;
210
- /** Attribute names to include in this group */
211
- attributes: string[];
212
- /**
213
- * Template for the display value
214
- * Uses {attributeName} syntax for interpolation
215
- * @example "{billing_street}, {billing_city} {billing_postal_code}"
216
- */
217
- displayTemplate?: string;
218
- }
219
- /**
220
- * Field definition within a form group
221
- * Can be either a single attribute or an inline attribute group
222
- */
223
- interface Field {
224
- /**
225
- * Stable identity of this slot, assigned by `ensureFieldIds` and backfilled
226
- * for existing configs. Architect operations address a slot by this id, never
227
- * by position — a composite field has no attribute name to be addressed by.
228
- * Optional so a builder may omit it; every persisted config has one.
229
- */
230
- id?: string;
231
- /** Attribute name to display (for single attribute fields) */
232
- attribute?: string;
233
- /** Inline attribute group (groups multiple attributes into one composite field) */
234
- attributeGroup?: AttributeGroupField;
235
- /** Grid span (1-12 columns) */
236
- span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
237
- /** Override label for this view (only for single attribute fields) */
238
- label?: string;
239
- /** Force read-only display */
240
- readOnly?: boolean;
241
- }
242
- /**
243
- * Base properties shared by all group types
244
- */
245
- interface BaseGroup {
246
- id: string;
247
- label: string;
248
- description?: string;
249
- collapsible?: boolean;
250
- collapsed?: boolean;
251
- order?: number;
252
- }
253
- /**
254
- * Group of fields for organizing forms (default group type)
255
- */
256
- interface FieldGroup extends BaseGroup {
257
- /** Discriminant */
258
- type: "fields";
259
- fields: Field[];
260
- }
261
- /**
262
- * A form tab's groups. Only field groups exist: related records are shown by a
263
- * table tab (`table()` / `tableFrom()`), which rendered the same thing.
264
- */
265
- type Group = FieldGroup;
266
- type TabType = "form" | "table" | "custom" | "activity" | "richtext" | "documents" | "forms" | "emails" | "meetings";
267
- /**
268
- * Base properties shared by all tab types
269
- */
270
- interface BaseTab {
271
- id: string;
272
- name: string;
273
- label: string;
274
- icon?: IconName;
275
- order?: number;
276
- }
277
- /**
278
- * Form layout density
279
- */
280
- type FormDensity = "compact" | "comfortable" | "spacious";
281
- /**
282
- * Form tab - displays attributes organized in groups
283
- */
284
- interface FormTab extends BaseTab {
285
- type: "form";
286
- groups: Group[];
287
- /** Number of grid columns (1, 2, or 3). Default: 2 */
288
- formColumns?: 1 | 2 | 3;
289
- /** Layout density. Default: "comfortable" */
290
- density?: FormDensity;
291
- }
292
- /**
293
- * Direct relation on the current object
294
- *
295
- * @example Contact.companies → shows Companies linked via the "companies" relation
296
- */
297
- interface RelationSource {
298
- type: "relation";
299
- /** Relation attribute name on the current object */
300
- attribute: string;
301
- }
302
- /**
303
- * Inverse lookup — records from another object that point to us
304
- *
305
- * @example On Company, show Contacts where Contact.company = this Company
306
- */
307
- interface InverseSource {
308
- type: "inverse";
309
- /** Object name that has the relation to us */
310
- object: string;
311
- /** Relation attribute name on the source object that points to us */
312
- attribute: string;
313
- }
314
- /**
315
- * Where table data comes from — either a direct relation or an inverse lookup
316
- */
317
- type TableSource = RelationSource | InverseSource;
318
- /**
319
- * Table tab - displays related records in a table
320
- *
321
- * The `source` field determines where data comes from.
322
- *
323
- * @example Direct: source = { type: "relation", attribute: "members" }
324
- * @example Inverse: source = { type: "inverse", object: "contacts", attribute: "company" }
325
- */
326
- interface TableTab extends BaseTab {
327
- type: "table";
328
- /** Where the data comes from */
329
- source: TableSource;
330
- /** Columns to display (attribute names from the resolved target object) */
331
- columns: string[];
332
- /** Allow creating new records */
333
- allowCreate?: boolean;
334
- /** Creation behavior when allowCreate is true. Default: "redirect" */
335
- createMode?: CreateMode;
336
- /** Allow inline editing */
337
- allowEdit?: boolean;
338
- /** Allow deleting records */
339
- allowDelete?: boolean;
340
- /** Default filters applied to the table */
341
- filters?: FilterState;
342
- /** Default sort rules */
343
- sorts?: SortRule[];
344
- }
345
- /**
346
- * Custom tab - renders a developer-defined component
347
- */
348
- interface CustomTab extends BaseTab {
349
- type: "custom";
350
- /** Component identifier to render */
351
- component: string;
352
- /** Props to pass to the component */
353
- props?: Record<string, unknown>;
354
- }
355
- /**
356
- * Activity tab - displays activity feed for the current record
357
- */
358
- interface ActivityTab extends BaseTab {
359
- type: "activity";
360
- limit?: number;
361
- }
362
- /**
363
- * Richtext tab - displays a block editor for a richtext attribute
364
- */
365
- interface RichtextTab extends BaseTab {
366
- type: "richtext";
367
- /** Richtext attribute to display in the BlockEditor */
368
- attribute: string;
369
- /** Optional text attribute for an editable title input above the editor */
370
- titleAttribute?: string;
371
- }
372
- /**
373
- * Documents tab - displays all documents attached to the record
374
- */
375
- interface DocumentsTab extends BaseTab {
376
- type: "documents";
377
- allowUpload?: boolean;
378
- allowRemove?: boolean;
379
- hideAttachments?: boolean;
380
- }
381
- /**
382
- * Forms tab - displays available forms for creating related records
383
- */
384
- interface FormsTab extends BaseTab {
385
- type: "forms";
386
- /** Object name to filter forms by slot (derived from record context, but can be overridden) */
387
- objectName?: string;
388
- }
389
- /**
390
- * Emails tab - displays emails associated with the record at query time via the
391
- * values of configured email-bearing text attributes. Config-only: no schema change.
392
- */
393
- interface EmailsTab extends BaseTab {
394
- type: "emails";
395
- /** Names of text attributes whose values hold email addresses to match on. */
396
- emailAttributeIds: string[];
397
- }
398
- /**
399
- * Meetings tab - displays calendar meetings associated with the record at query
400
- * time via the values of configured email-bearing text attributes. Config-only:
401
- * no schema change. Carries the same configuration as {@link EmailsTab} because
402
- * both answer "which attributes hold this record's addresses".
403
- */
404
- interface MeetingsTab extends BaseTab {
405
- type: "meetings";
406
- /** Names of text attributes whose values hold email addresses to match on. */
407
- emailAttributeIds: string[];
408
- }
409
- /**
410
- * Union of all tab types (for detail views)
411
- */
412
- type Tab = FormTab | TableTab | CustomTab | ActivityTab | RichtextTab | DocumentsTab | FormsTab | EmailsTab | MeetingsTab;
413
- /**
414
- * List view layout mode
415
- * - `table`: Table/grid layout
416
- * - `list`: Rows with a description and ordered attributes
417
- * - `kanban`: Kanban board layout (grouped by attribute)
418
- */
419
- type ListViewLayout = "table" | "list" | "kanban";
420
- /**
421
- * Tab within a list view — each tab carries its own full display configuration.
422
- *
423
- * @example
424
- * ```typescript
425
- * const tabs: ListViewTab[] = [
426
- * { id: "all", label: "All Contacts", default: true, visibility: "workspace", layout: "table", columns: ["name", "email", "status"] },
427
- * { id: "active", label: "Active", visibility: "workspace", layout: "table", columns: ["name", "email"], filters: activeFilter },
428
- * { id: "pipeline", label: "Pipeline", visibility: "workspace", layout: "kanban", columns: ["name", "amount"], groupByAttribute: "stage" },
429
- * ];
430
- * ```
431
- */
432
- interface ListViewTab {
433
- /** Unique identifier */
434
- id: string;
435
- /** Display label */
436
- label: string;
437
- /** Icon */
438
- icon?: IconName;
439
- /** Default tab (shown on load) */
440
- default?: boolean;
441
- /**
442
- * Record scope this tab reads. `all` (the default) imposes no scope, so the
443
- * tab shows every workspace record plus the viewer's own private ones;
444
- * `workspace` and `private` narrow it to exactly one.
445
- */
446
- visibility: ListViewTabVisibility;
447
- /** Layout mode */
448
- layout: ListViewLayout;
449
- /** Attribute names to display as columns */
450
- columns: string[];
451
- /** Column widths in pixels */
452
- columnSizing?: Record<string, number>;
453
- /** Text/richtext attribute below the record label in List and Kanban. */
454
- descriptionAttribute?: string;
455
- /** Ordered attributes below List rows and Kanban cards. An explicit [] hides all. */
456
- displayAttributes?: string[];
457
- /** Filters applied to this tab */
458
- filters?: FilterGroup;
459
- /** Sort rules for this tab */
460
- sorts?: SortRule[];
461
- /** Required for Kanban; an inert code grouping hint on customized native List/Table tabs. */
462
- groupByAttribute?: string;
463
- /** When true, the tab is read-only: no cell editing, no create, no delete */
464
- readOnly?: boolean;
465
- /** Creation behavior when clicking "+". Default: "redirect" */
466
- createMode?: CreateMode;
467
- /** @deprecated Use displayAttributes. Legacy user attribute on Kanban cards. */
468
- cardUserAttribute?: string;
469
- /** @deprecated Use displayAttributes. Legacy date attribute on Kanban cards. */
470
- cardDateAttribute?: string;
471
- /** Order of kanban columns (by option value) - for kanban layout only */
472
- kanbanColumnOrder?: string[];
473
- /** Visibility of kanban columns (by option value) - for kanban layout only */
474
- kanbanColumnVisibility?: Record<string, boolean>;
475
- /** Pinned kanban columns (by option value) - for kanban layout only */
476
- kanbanPinnedColumns?: string[];
477
- }
478
- /**
479
- * One stacked section of the detail side panel.
480
- *
481
- * The panel is a column beside the main tabs, so its sections stack — a second
482
- * tab row inside it would compete with the first. Only the three kinds below
483
- * exist in v1; `table`, `custom`, `richtext`, `forms`, `emails` and `meetings`
484
- * stay out until width and UX prove out, and their absence from this union is
485
- * what enforces that.
486
- */
487
- type SidePanelPane = {
488
- kind: "fields";
489
- id?: string;
490
- label?: string;
491
- attributes: string[];
492
- } | {
493
- kind: "activity";
494
- id?: string;
495
- label?: string;
496
- } | {
497
- kind: "documents";
498
- /**
499
- * Required, unlike the other kinds: `DocumentsTabContent` keys its
500
- * sort-mode persistence on it, so a pane without one would share the
501
- * main-column documents tab's stored sort.
502
- */
503
- id: string;
504
- label?: string;
505
- allowUpload?: boolean;
506
- allowRemove?: boolean;
507
- };
508
- /**
509
- * Configuration for the side panel displayed alongside tab content.
510
- * When present, a right-side panel shows the configured attributes as flat fields.
511
- */
512
- interface SidePanelConfig {
513
- /**
514
- * Flat fields, the original shape. Equivalent to a single `fields` pane and
515
- * still supported unchanged; supply this or `panes`, not both.
516
- */
517
- attributes?: string[];
518
- /** Ordered stacked sections, rendered top to bottom. */
519
- panes?: SidePanelPane[];
520
- /** Width in pixels. @default 480 */
521
- width?: number;
522
- }
523
- /**
524
- * Configuration for detail views (RecordEditView)
525
- */
526
- interface DetailViewConfig {
527
- /** Tabs in this view */
528
- tabs: Tab[];
529
- /** Optional side panel with flat attribute fields */
530
- sidePanel?: SidePanelConfig;
531
- }
532
- /**
533
- * Configuration for list views (RecordsView)
534
- *
535
- * Each tab carries its own full config (layout, columns, filters, sorts, groupBy).
536
- * The view only holds shared base filters applied to ALL tabs.
537
- */
538
- interface ListViewConfig {
539
- /** Allow Architect presentation-only overrides on this system list view. */
540
- allowPresentationCustomization?: boolean;
541
- /** Base filters applied to ALL tabs (scoping, tenant, etc.) */
542
- defaultFilters?: FilterGroup;
543
- /** Tabs — at least one required. Each carries its own full config. */
544
- tabs: ListViewTab[];
545
- }
546
- /**
547
- * Union of all view configs
548
- */
549
- type ViewConfig = DetailViewConfig | ListViewConfig;
550
- /**
551
- * Base view properties shared by all view types
552
- */
553
- interface BaseViewDefinition {
554
- /** Unique identifier (UUID, assigned by database) */
555
- id?: string;
556
- /** Technical name (kebab-case) */
557
- name: string;
558
- /** Display label */
559
- label: string;
560
- /** Description */
561
- description?: string;
562
- /** Icon */
563
- icon?: IconName;
564
- /** Object this view belongs to (object name) */
565
- object: string;
566
- /** Default view for this object+type combination */
567
- default?: boolean;
568
- /** Extensible metadata */
569
- metadata?: Record<string, unknown>;
570
- /**
571
- * Framework-native view: locked at runtime, force-seeded on every boot,
572
- * composed only with explicitly opted-in presentation overrides. Set only by
573
- * the native registry — there is deliberately no public builder API for it.
574
- */
575
- system?: boolean;
576
- }
577
- /**
578
- * Detail view definition
579
- */
580
- interface DetailViewDefinition extends BaseViewDefinition {
581
- type: "detail";
582
- config: DetailViewConfig;
583
- }
584
- /**
585
- * List view definition
586
- */
587
- interface ListViewDefinition extends BaseViewDefinition {
588
- type: "list";
589
- config: ListViewConfig;
590
- }
591
- /**
592
- * Unified view definition - discriminated union by type
593
- */
594
- type ViewDefinition = DetailViewDefinition | ListViewDefinition;
595
- /** Workspace presentation patch for an existing code-owned list tab. */
596
- type ListViewPresentationTabOverrides = Partial<Pick<ListViewTab, "layout" | "columns" | "columnSizing" | "displayAttributes" | "kanbanColumnOrder" | "kanbanColumnVisibility" | "kanbanPinnedColumns">> & {
597
- descriptionAttribute?: string | null;
598
- };
599
- interface ListViewPresentationOverrides {
600
- /** Patches keyed by stable tab ID. Null description explicitly clears the code default. */
601
- tabs: Record<string, ListViewPresentationTabOverrides>;
602
- }
603
- /**
604
- * Configuration overrides for user customizations
605
- * Only stores the delta from the source view
606
- */
607
- interface ConfigOverrides {
608
- /** Allowlisted workspace presentation overrides for opted-in system list views. */
609
- presentation?: ListViewPresentationOverrides;
610
- tabs?: ListViewTab[];
611
- hiddenTabIds?: string[];
612
- detailTabs?: Tab[];
613
- hiddenDetailTabIds?: string[];
614
- /** Workspace-scope scalar overrides on the view row's cosmetic fields. */
615
- label?: string;
616
- icon?: string;
617
- description?: string;
618
- /** Overrides for top-level config keys other than tabs (e.g. groupBy). */
619
- topLevel?: Record<string, unknown>;
620
- }
621
- /**
622
- * User customization overlay for a view
623
- * Stored per user, merged at runtime with the source view
624
- */
625
- interface ViewOverlay {
626
- /** Unique identifier */
627
- id: string;
628
- /** View ID this overlay applies to (UUID or virtual ID) */
629
- viewId: string;
630
- /** User ID who owns this overlay */
631
- userId: string;
632
- /** Configuration overrides (delta only) */
633
- configOverrides: ConfigOverrides;
634
- /** User's default view for this object (stored in overlay) */
635
- isUserDefault?: boolean;
636
- /** Created timestamp */
637
- createdAt: Date;
638
- /** Updated timestamp */
639
- updatedAt: Date;
640
- }
641
- /**
642
- * Check if a view is a detail view
643
- */
644
- declare function isDetailView(view: ViewDefinition): view is DetailViewDefinition;
645
- /**
646
- * Check if a view is a list view
647
- */
648
- declare function isListView(view: ViewDefinition): view is ListViewDefinition;
649
- /**
650
- * Check if a group is a field group. Kept because persisted configs written
651
- * before the relation group was removed may still carry another discriminant.
652
- */
653
- declare function isFieldGroup(group: Group): group is FieldGroup;
654
-
655
- interface AddAttributeInput {
656
- name: string;
657
- label: string;
658
- type: AttributeType;
659
- required?: boolean;
660
- unique?: boolean;
661
- description?: string;
662
- placeholder?: string;
663
- icon?: IconName;
664
- defaultValue?: unknown;
665
- metadata?: Record<string, unknown>;
666
- [key: string]: unknown;
667
- }
668
- interface CreateCustomObjectInput {
669
- name: string;
670
- label: string;
671
- pluralLabel?: string;
672
- labelExpression: string;
673
- embeddingExpression?: string;
674
- description?: string;
675
- icon?: IconName;
676
- attributes?: (Attribute | {
677
- build: () => Attribute;
678
- })[];
679
- metadata?: Record<string, unknown>;
680
- }
681
- interface UpdateObjectInput {
682
- label?: string;
683
- pluralLabel?: string;
684
- description?: string;
685
- icon?: IconName;
686
- labelExpression?: string;
687
- embeddingExpression?: string;
688
- metadata?: Record<string, unknown>;
689
- }
690
- interface CreateViewInput {
691
- objectName: string;
692
- type: ViewType;
693
- name: string;
694
- label: string;
695
- description?: string;
696
- icon?: IconName;
697
- config: ViewConfig;
698
- default?: boolean;
699
- metadata?: Record<string, unknown>;
700
- }
701
- interface UpdateViewInput {
702
- label?: string;
703
- description?: string;
704
- icon?: IconName;
705
- config?: ViewConfig;
706
- default?: boolean;
707
- metadata?: Record<string, unknown>;
708
- }
709
- interface RelationOption {
710
- id: string;
711
- objectId: string;
712
- objectName: string;
713
- objectLabel: string;
714
- objectIcon?: string;
715
- label: string;
716
- }
717
- interface RelationOptionsResponse {
718
- options: RelationOption[];
719
- hasMore: boolean;
720
- total: number;
721
- nextOffset?: number;
722
- }
723
-
724
- declare const statusGroupSchema: z.ZodEnum<{
725
- idle: "idle";
726
- in_progress: "in_progress";
727
- finished: "finished";
728
- }>;
729
- declare const selectOptionWriteSchema: z.ZodObject<{
730
- value: z.ZodString;
731
- label: z.ZodString;
732
- description: z.ZodOptional<z.ZodString>;
733
- inverse: z.ZodOptional<z.ZodString>;
734
- archived: z.ZodOptional<z.ZodBoolean>;
735
- color: z.ZodEnum<{
736
- gray: "gray";
737
- slate: "slate";
738
- blue: "blue";
739
- sky: "sky";
740
- indigo: "indigo";
741
- green: "green";
742
- emerald: "emerald";
743
- teal: "teal";
744
- red: "red";
745
- rose: "rose";
746
- yellow: "yellow";
747
- amber: "amber";
748
- orange: "orange";
749
- purple: "purple";
750
- violet: "violet";
751
- fuchsia: "fuchsia";
752
- pink: "pink";
753
- cyan: "cyan";
754
- lime: "lime";
755
- }>;
756
- }, z.core.$strict>;
757
- declare const multiselectOptionWriteSchema: z.ZodObject<{
758
- value: z.ZodString;
759
- label: z.ZodString;
760
- description: z.ZodOptional<z.ZodString>;
761
- inverse: z.ZodOptional<z.ZodString>;
762
- archived: z.ZodOptional<z.ZodBoolean>;
763
- color: z.ZodEnum<{
764
- gray: "gray";
765
- slate: "slate";
766
- blue: "blue";
767
- sky: "sky";
768
- indigo: "indigo";
769
- green: "green";
770
- emerald: "emerald";
771
- teal: "teal";
772
- red: "red";
773
- rose: "rose";
774
- yellow: "yellow";
775
- amber: "amber";
776
- orange: "orange";
777
- purple: "purple";
778
- violet: "violet";
779
- fuchsia: "fuchsia";
780
- pink: "pink";
781
- cyan: "cyan";
782
- lime: "lime";
783
- }>;
784
- }, z.core.$strict>;
785
- declare const statusOptionWriteSchema: z.ZodObject<{
786
- value: z.ZodString;
787
- label: z.ZodString;
788
- description: z.ZodOptional<z.ZodString>;
789
- inverse: z.ZodOptional<z.ZodString>;
790
- archived: z.ZodOptional<z.ZodBoolean>;
791
- color: z.ZodEnum<{
792
- gray: "gray";
793
- slate: "slate";
794
- blue: "blue";
795
- sky: "sky";
796
- indigo: "indigo";
797
- green: "green";
798
- emerald: "emerald";
799
- teal: "teal";
800
- red: "red";
801
- rose: "rose";
802
- yellow: "yellow";
803
- amber: "amber";
804
- orange: "orange";
805
- purple: "purple";
806
- violet: "violet";
807
- fuchsia: "fuchsia";
808
- pink: "pink";
809
- cyan: "cyan";
810
- lime: "lime";
811
- }>;
812
- group: z.ZodEnum<{
813
- idle: "idle";
814
- in_progress: "in_progress";
815
- finished: "finished";
816
- }>;
817
- }, z.core.$strict>;
818
- /**
819
- * Map of attribute type to config schema
820
- */
821
- declare const attributeConfigSchemas: Record<AttributeType, z.ZodObject<z.ZodRawShape>>;
822
- /**
823
- * Get the config schema for a specific attribute type
824
- */
825
- declare function getAttributeConfigSchema(type: AttributeType): z.ZodObject<z.ZodRawShape>;
826
- /**
827
- * Validate and strip unknown properties from attribute config
828
- * This ensures only allowed properties are stored in the database
829
- */
830
- declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
831
- /**
832
- * The config contract as a WRITE applies it: the stored schema plus the
833
- * stricter option and icon rules newly written values must satisfy.
834
- */
835
- declare function getAttributeConfigWriteSchema(type: AttributeType): z.ZodObject<z.ZodRawShape>;
836
- /**
837
- * Strict parser for newly created attribute definitions.
838
- *
839
- * Top-level config remains strip-compatible with the historical config
840
- * contract, while newly written icons and select-like option objects are
841
- * validated strictly.
842
- */
843
- declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
844
- /**
845
- * Patch-aware parser for persisted attributes.
846
- *
847
- * An explicit options patch owns and strictly validates the complete new
848
- * list. Omission means the stored legacy list is preserved without
849
- * reconstruction, including options that predate required colours/groups.
850
- */
851
- declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
852
-
853
- export { type RelationSource as $, type AttributeGroupField as A, type FilterCombinator as B, type ConfigOverrides as C, type DetailViewConfig as D, type EmailsTab as E, type FilterState as F, type Group as G, type FilterGroup as H, type FormDensity as I, type FormTab as J, type FormsTab as K, type ListViewTab as L, type MeetingsTab as M, type InverseSource as N, type ListViewPresentationOverrides as O, type ListViewPresentationTabOverrides as P, NO_VALUE_OPERATORS as Q, type RelativeDateValue as R, type SortRule as S, type TableTab as T, type NoValueOperator as U, type ViewType as V, OPERATORS_BY_TYPE as W, type PhoneFilterValue as X, type QueryState as Y, type RelationOption as Z, type RelationOptionsResponse as _, type ViewConfig as a, type RichtextTab as a0, type SidePanelPane as a1, type SortDirection as a2, type TabType as a3, type TableSource as a4, type UpdateObjectInput as a5, type UpdateViewInput as a6, type ViewOverlay as a7, getRollupFilterOperators as a8, isDetailView as a9, isFieldGroup as aa, isListView as ab, isNoValueOperator as ac, multiselectOptionWriteSchema as ad, parseAttributeConfig as ae, parseAttributeConfigForCreate as af, parseAttributeConfigForUpdate as ag, selectOptionWriteSchema as ah, statusGroupSchema as ai, statusOptionWriteSchema as aj, attributeConfigSchemas as ak, getAttributeConfigSchema as al, getAttributeConfigWriteSchema as am, type FilterOperator as b, type DetailViewDefinition as c, type SidePanelConfig as d, type Field as e, type FieldGroup as f, type CreateMode as g, type Tab as h, type ListViewConfig as i, type ListViewDefinition as j, type ListViewLayout as k, type ViewDefinition as l, type FilterValue as m, type FilterRule as n, type DynamicValue as o, type ActivityTab as p, type AddAttributeInput as q, type AdvancedFilterState as r, type CreateCustomObjectInput as s, type CreateViewInput as t, type CurrencyFilterValue as u, type CustomTab as v, type DayMonthValue as w, type DocumentsTab as x, type EdgeQuantifier as y, type ExtendedFilterRule as z };