@stndrds/schema 1.0.0-alpha.316 → 1.0.0-alpha.317

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 (67) hide show
  1. package/dist/{all-BGyE2RCe.d.ts → all-BsINIhT4.d.ts} +993 -618
  2. package/dist/{all--LbSrtzk.d.mts → all-Js3OaRJY.d.mts} +993 -618
  3. package/dist/{attributes-cBtnsK8O.d.mts → attributes-2ELU4S-n.d.mts} +2 -2
  4. package/dist/{attributes-cBtnsK8O.d.ts → attributes-2ELU4S-n.d.ts} +2 -2
  5. package/dist/chunk-3VONXKAN.js +2 -0
  6. package/dist/{chunk-D6LPMF5N.mjs → chunk-B2W4ZEO2.mjs} +1 -1
  7. package/dist/{chunk-WKDJGNVI.js → chunk-HS7IRPL2.js} +1 -1
  8. package/dist/chunk-MMOW6WTJ.mjs +2 -0
  9. package/dist/exceptions.d.mts +1 -1
  10. package/dist/exceptions.d.ts +1 -1
  11. package/dist/{objects-iPrveCDN.d.ts → helpers-CAOdIXNe.d.ts} +74 -2
  12. package/dist/{objects-kXaFEi-P.d.mts → helpers-CJpLZ8jG.d.mts} +74 -2
  13. package/dist/index-C6-AlR2_.d.mts +184 -0
  14. package/dist/index-iKNo_z7O.d.ts +184 -0
  15. package/dist/index.d.mts +4721 -3787
  16. package/dist/index.d.ts +4721 -3787
  17. package/dist/index.js +20 -20
  18. package/dist/index.mjs +20 -20
  19. package/dist/{types-DgPbxSij.d.mts → types-DFs7mc3G.d.mts} +1 -1
  20. package/dist/{types-CT0s-S_Y.d.ts → types-DjTB_kVH.d.ts} +1 -1
  21. package/dist/utils.d.mts +1 -1
  22. package/dist/utils.d.ts +1 -1
  23. package/dist/validation/all.d.mts +5 -6
  24. package/dist/validation/all.d.ts +5 -6
  25. package/dist/validation/all.js +1 -1
  26. package/dist/validation/all.mjs +1 -1
  27. package/dist/validation/complex/currency.d.mts +2 -2
  28. package/dist/validation/complex/currency.d.ts +2 -2
  29. package/dist/validation/complex/location.d.mts +2 -2
  30. package/dist/validation/complex/location.d.ts +2 -2
  31. package/dist/validation/complex/phone.d.mts +2 -2
  32. package/dist/validation/complex/phone.d.ts +2 -2
  33. package/dist/validation/complex/relation.d.mts +2 -2
  34. package/dist/validation/complex/relation.d.ts +2 -2
  35. package/dist/validation/complex/richtext.d.mts +2 -2
  36. package/dist/validation/complex/richtext.d.ts +2 -2
  37. package/dist/validation/complex/select.d.mts +2 -2
  38. package/dist/validation/complex/select.d.ts +2 -2
  39. package/dist/validation/complex/user.d.mts +2 -2
  40. package/dist/validation/complex/user.d.ts +2 -2
  41. package/dist/validation/computed/formula.d.mts +2 -2
  42. package/dist/validation/computed/formula.d.ts +2 -2
  43. package/dist/validation/computed/rollup.d.mts +2 -2
  44. package/dist/validation/computed/rollup.d.ts +2 -2
  45. package/dist/validation/config/index.d.mts +2 -3
  46. package/dist/validation/config/index.d.ts +2 -3
  47. package/dist/validation/config/index.js +1 -1
  48. package/dist/validation/config/index.mjs +1 -1
  49. package/dist/validation/core/index.d.mts +3 -3
  50. package/dist/validation/core/index.d.ts +3 -3
  51. package/dist/validation/object/index.d.mts +4 -4
  52. package/dist/validation/object/index.d.ts +4 -4
  53. package/dist/validation/primitives/checkbox.d.mts +2 -2
  54. package/dist/validation/primitives/checkbox.d.ts +2 -2
  55. package/dist/validation/primitives/date.d.mts +2 -2
  56. package/dist/validation/primitives/date.d.ts +2 -2
  57. package/dist/validation/primitives/number.d.mts +2 -2
  58. package/dist/validation/primitives/number.d.ts +2 -2
  59. package/dist/validation/primitives/text.d.mts +2 -2
  60. package/dist/validation/primitives/text.d.ts +2 -2
  61. package/package.json +2 -2
  62. package/dist/chunk-JRBNMHMY.js +0 -2
  63. package/dist/chunk-YFW2M45I.mjs +0 -2
  64. package/dist/helpers-BOtvDGN6.d.ts +0 -76
  65. package/dist/helpers-DrbRe4Xl.d.mts +0 -76
  66. package/dist/index-XQ-3wEYg.d.ts +0 -872
  67. package/dist/index-p0utq5vG.d.mts +0 -872
@@ -1,872 +0,0 @@
1
- import { z } from 'zod';
2
- import { A as Attribute, k as AttributeType, f as RollupAttribute } from './attributes-cBtnsK8O.mjs';
3
- import { IconName } from '@stndrds/constants';
4
- import { L as ListViewTabVisibility } from './objects-kXaFEi-P.mjs';
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
- * Where a record opens from this tab: the record-stack side panel, or its own
201
- * page. Absent means the surface's own default — an existing view must not
202
- * change how its records open because a field gained a value (#3158).
203
- *
204
- * Center peek is deliberately not offered (Karl, 2026-09-04).
205
- */
206
- type RecordOpenMode = "side" | "page";
207
- /**
208
- * Inline attribute group configuration
209
- * Groups multiple attributes into a single composite field with dropdown editing
210
- */
211
- interface AttributeGroupField {
212
- /** Unique identifier for the group */
213
- id: string;
214
- /** Display label for the composite field */
215
- label: string;
216
- /** Description shown in the dropdown */
217
- description?: string;
218
- /** Attribute names to include in this group */
219
- attributes: string[];
220
- /**
221
- * Template for the display value
222
- * Uses {attributeName} syntax for interpolation
223
- * @example "{billing_street}, {billing_city} {billing_postal_code}"
224
- */
225
- displayTemplate?: string;
226
- }
227
- /**
228
- * Field definition within a form group
229
- * Can be either a single attribute or an inline attribute group
230
- */
231
- interface Field {
232
- /**
233
- * Stable identity of this slot, assigned by `ensureFieldIds` and backfilled
234
- * for existing configs. Architect operations address a slot by this id, never
235
- * by position — a composite field has no attribute name to be addressed by.
236
- * Optional so a builder may omit it; every persisted config has one.
237
- */
238
- id?: string;
239
- /** Attribute name to display (for single attribute fields) */
240
- attribute?: string;
241
- /** Inline attribute group (groups multiple attributes into one composite field) */
242
- attributeGroup?: AttributeGroupField;
243
- /** Grid span (1-12 columns) */
244
- span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
245
- /** Override label for this view (only for single attribute fields) */
246
- label?: string;
247
- /** Force read-only display */
248
- readOnly?: boolean;
249
- }
250
- /**
251
- * Base properties shared by all group types
252
- */
253
- interface BaseGroup {
254
- id: string;
255
- label: string;
256
- description?: string;
257
- collapsible?: boolean;
258
- collapsed?: boolean;
259
- order?: number;
260
- }
261
- /**
262
- * Group of fields for organizing forms (default group type)
263
- */
264
- interface FieldGroup extends BaseGroup {
265
- /** Discriminant */
266
- type: "fields";
267
- fields: Field[];
268
- }
269
- /**
270
- * A form tab's groups. Only field groups exist: related records are shown by a
271
- * table tab (`table()` / `tableFrom()`), which rendered the same thing.
272
- */
273
- type Group = FieldGroup;
274
- type TabType = "form" | "table" | "custom" | "activity" | "richtext" | "documents" | "forms" | "emails" | "meetings";
275
- /**
276
- * Base properties shared by all tab types
277
- */
278
- interface BaseTab {
279
- id: string;
280
- name: string;
281
- label: string;
282
- icon?: IconName;
283
- order?: number;
284
- }
285
- /**
286
- * Form layout density
287
- */
288
- type FormDensity = "compact" | "comfortable" | "spacious";
289
- /**
290
- * Form tab - displays attributes organized in groups
291
- */
292
- interface FormTab extends BaseTab {
293
- type: "form";
294
- groups: Group[];
295
- /** Number of grid columns (1, 2, or 3). Default: 2 */
296
- formColumns?: 1 | 2 | 3;
297
- /** Layout density. Default: "comfortable" */
298
- density?: FormDensity;
299
- }
300
- /**
301
- * Direct relation on the current object
302
- *
303
- * @example Contact.companies → shows Companies linked via the "companies" relation
304
- */
305
- interface RelationSource {
306
- type: "relation";
307
- /** Relation attribute name on the current object */
308
- attribute: string;
309
- }
310
- /**
311
- * Inverse lookup — records from another object that point to us
312
- *
313
- * @example On Company, show Contacts where Contact.company = this Company
314
- */
315
- interface InverseSource {
316
- type: "inverse";
317
- /** Object name that has the relation to us */
318
- object: string;
319
- /** Relation attribute name on the source object that points to us */
320
- attribute: string;
321
- }
322
- /**
323
- * Where table data comes from — either a direct relation or an inverse lookup
324
- */
325
- type TableSource = RelationSource | InverseSource;
326
- /**
327
- * Table tab - displays related records in a table
328
- *
329
- * The `source` field determines where data comes from.
330
- *
331
- * @example Direct: source = { type: "relation", attribute: "members" }
332
- * @example Inverse: source = { type: "inverse", object: "contacts", attribute: "company" }
333
- */
334
- interface TableTab extends BaseTab {
335
- type: "table";
336
- /** Where the data comes from */
337
- source: TableSource;
338
- /** Columns to display (attribute names from the resolved target object) */
339
- columns: string[];
340
- /** Allow creating new records */
341
- allowCreate?: boolean;
342
- /** Creation behavior when allowCreate is true. Default: "redirect" */
343
- createMode?: CreateMode;
344
- /** Where a record from this tab opens. Absent = the surface's default. */
345
- openMode?: RecordOpenMode;
346
- /** Allow inline editing */
347
- allowEdit?: boolean;
348
- /** Allow deleting records */
349
- allowDelete?: boolean;
350
- /** Default filters applied to the table */
351
- filters?: FilterState;
352
- /** Default sort rules */
353
- sorts?: SortRule[];
354
- }
355
- /**
356
- * Custom tab - renders a developer-defined component
357
- */
358
- interface CustomTab extends BaseTab {
359
- type: "custom";
360
- /** Component identifier to render */
361
- component: string;
362
- /** Props to pass to the component */
363
- props?: Record<string, unknown>;
364
- }
365
- /**
366
- * Activity tab - displays activity feed for the current record
367
- */
368
- interface ActivityTab extends BaseTab {
369
- type: "activity";
370
- limit?: number;
371
- }
372
- /**
373
- * Richtext tab - displays a block editor for a richtext attribute
374
- */
375
- interface RichtextTab extends BaseTab {
376
- type: "richtext";
377
- /** Richtext attribute to display in the BlockEditor */
378
- attribute: string;
379
- /** Optional text attribute for an editable title input above the editor */
380
- titleAttribute?: string;
381
- }
382
- /**
383
- * Documents tab - displays all documents attached to the record
384
- */
385
- interface DocumentsTab extends BaseTab {
386
- type: "documents";
387
- allowUpload?: boolean;
388
- allowRemove?: boolean;
389
- hideAttachments?: boolean;
390
- /**
391
- * Names of relation attributes on the current object whose target records'
392
- * drives are listed beside the record's own. Absent = single drive.
393
- */
394
- relations?: string[];
395
- }
396
- /**
397
- * Forms tab - displays available forms for creating related records
398
- */
399
- interface FormsTab extends BaseTab {
400
- type: "forms";
401
- /** Object name to filter forms by slot (derived from record context, but can be overridden) */
402
- objectName?: string;
403
- }
404
- /**
405
- * Emails tab - displays emails associated with the record at query time via the
406
- * values of configured email-bearing text attributes. Config-only: no schema change.
407
- */
408
- interface EmailsTab extends BaseTab {
409
- type: "emails";
410
- /** Names of text attributes whose values hold email addresses to match on. */
411
- emailAttributeIds: string[];
412
- }
413
- /**
414
- * Meetings tab - displays calendar meetings associated with the record at query
415
- * time via the values of configured email-bearing text attributes. Config-only:
416
- * no schema change. Carries the same configuration as {@link EmailsTab} because
417
- * both answer "which attributes hold this record's addresses".
418
- */
419
- interface MeetingsTab extends BaseTab {
420
- type: "meetings";
421
- /** Names of text attributes whose values hold email addresses to match on. */
422
- emailAttributeIds: string[];
423
- }
424
- /**
425
- * Union of all tab types (for detail views)
426
- */
427
- type Tab = FormTab | TableTab | CustomTab | ActivityTab | RichtextTab | DocumentsTab | FormsTab | EmailsTab | MeetingsTab;
428
- /**
429
- * List view layout mode
430
- * - `table`: Table/grid layout
431
- * - `list`: Rows with a description and ordered attributes
432
- * - `kanban`: Kanban board layout (grouped by attribute)
433
- */
434
- type ListViewLayout = "table" | "list" | "kanban";
435
- /**
436
- * Tab within a list view — each tab carries its own full display configuration.
437
- *
438
- * @example
439
- * ```typescript
440
- * const tabs: ListViewTab[] = [
441
- * { id: "all", label: "All Contacts", default: true, visibility: "workspace", layout: "table", columns: ["name", "email", "status"] },
442
- * { id: "active", label: "Active", visibility: "workspace", layout: "table", columns: ["name", "email"], filters: activeFilter },
443
- * { id: "pipeline", label: "Pipeline", visibility: "workspace", layout: "kanban", columns: ["name", "amount"], groupByAttribute: "stage" },
444
- * ];
445
- * ```
446
- */
447
- interface ListViewTab {
448
- /** Unique identifier */
449
- id: string;
450
- /** Display label */
451
- label: string;
452
- /** Icon */
453
- icon?: IconName;
454
- /** Default tab (shown on load) */
455
- default?: boolean;
456
- /**
457
- * Record scope this tab reads. `all` (the default) imposes no scope, so the
458
- * tab shows every workspace record plus the viewer's own private ones;
459
- * `workspace` and `private` narrow it to exactly one.
460
- */
461
- visibility: ListViewTabVisibility;
462
- /** Layout mode */
463
- layout: ListViewLayout;
464
- /** Attribute names to display as columns */
465
- columns: string[];
466
- /** Column widths in pixels */
467
- columnSizing?: Record<string, number>;
468
- /** Text/richtext attribute below the record label in List and Kanban. */
469
- descriptionAttribute?: string;
470
- /** Ordered attributes below List rows and Kanban cards. An explicit [] hides all. */
471
- displayAttributes?: string[];
472
- /** Filters applied to this tab */
473
- filters?: FilterGroup;
474
- /** Sort rules for this tab */
475
- sorts?: SortRule[];
476
- /** Required for Kanban; an inert code grouping hint on customized native List/Table tabs. */
477
- groupByAttribute?: string;
478
- /** When true, the tab is read-only: no cell editing, no create, no delete */
479
- readOnly?: boolean;
480
- /** Creation behavior when clicking "+". Default: "redirect" */
481
- createMode?: CreateMode;
482
- /** Where a record from this tab opens. Absent = the surface's default. */
483
- openMode?: RecordOpenMode;
484
- /** @deprecated Use displayAttributes. Legacy user attribute on Kanban cards. */
485
- cardUserAttribute?: string;
486
- /** @deprecated Use displayAttributes. Legacy date attribute on Kanban cards. */
487
- cardDateAttribute?: string;
488
- /** Order of kanban columns (by option value) - for kanban layout only */
489
- kanbanColumnOrder?: string[];
490
- /** Visibility of kanban columns (by option value) - for kanban layout only */
491
- kanbanColumnVisibility?: Record<string, boolean>;
492
- /** Pinned kanban columns (by option value) - for kanban layout only */
493
- kanbanPinnedColumns?: string[];
494
- }
495
- /**
496
- * One stacked section of the detail side panel.
497
- *
498
- * The panel is a column beside the main tabs, so its sections stack — a second
499
- * tab row inside it would compete with the first. Only the three kinds below
500
- * exist in v1; `table`, `custom`, `richtext`, `forms`, `emails` and `meetings`
501
- * stay out until width and UX prove out, and their absence from this union is
502
- * what enforces that.
503
- */
504
- type SidePanelPane = {
505
- kind: "fields";
506
- id?: string;
507
- label?: string;
508
- attributes: string[];
509
- } | {
510
- kind: "activity";
511
- id?: string;
512
- label?: string;
513
- } | {
514
- kind: "documents";
515
- /**
516
- * Required, unlike the other kinds: `RecordDriveContent` keys its
517
- * sort-mode persistence on it, so a pane without one would share the
518
- * main-column documents tab's stored sort.
519
- */
520
- id: string;
521
- label?: string;
522
- allowUpload?: boolean;
523
- allowRemove?: boolean;
524
- };
525
- /**
526
- * Configuration for the side panel displayed alongside tab content.
527
- * When present, a right-side panel shows the configured attributes as flat fields.
528
- */
529
- interface SidePanelConfig {
530
- /**
531
- * Flat fields, the original shape. Equivalent to a single `fields` pane and
532
- * still supported unchanged; supply this or `panes`, not both.
533
- */
534
- attributes?: string[];
535
- /** Ordered stacked sections, rendered top to bottom. */
536
- panes?: SidePanelPane[];
537
- /** Width in pixels. @default 480 */
538
- width?: number;
539
- }
540
- /**
541
- * Configuration for detail views (RecordEditView)
542
- */
543
- interface DetailViewConfig {
544
- /** Tabs in this view */
545
- tabs: Tab[];
546
- /** Optional side panel with flat attribute fields */
547
- sidePanel?: SidePanelConfig;
548
- /** Render the whole record detail surface without mutation affordances. */
549
- readOnly?: boolean;
550
- }
551
- /**
552
- * Configuration for list views (RecordsView)
553
- *
554
- * Each tab carries its own full config (layout, columns, filters, sorts, groupBy).
555
- * The view only holds shared base filters applied to ALL tabs.
556
- */
557
- interface ListViewConfig {
558
- /** Allow Architect presentation-only overrides on this system list view. */
559
- allowPresentationCustomization?: boolean;
560
- /** Base filters applied to ALL tabs (scoping, tenant, etc.) */
561
- defaultFilters?: FilterGroup;
562
- /** Tabs — at least one required. Each carries its own full config. */
563
- tabs: ListViewTab[];
564
- }
565
- /**
566
- * Union of all view configs
567
- */
568
- type ViewConfig = DetailViewConfig | ListViewConfig;
569
- /**
570
- * Base view properties shared by all view types
571
- */
572
- interface BaseViewDefinition {
573
- /** Unique identifier (UUID, assigned by database) */
574
- id?: string;
575
- /** Technical name (kebab-case) */
576
- name: string;
577
- /** Display label */
578
- label: string;
579
- /** Description */
580
- description?: string;
581
- /** Icon */
582
- icon?: IconName;
583
- /** Object this view belongs to (object name) */
584
- object: string;
585
- /** Default view for this object+type combination */
586
- default?: boolean;
587
- /** Extensible metadata */
588
- metadata?: Record<string, unknown>;
589
- /**
590
- * Framework-native view: locked at runtime, force-seeded on every boot,
591
- * composed only with explicitly opted-in presentation overrides. Set only by
592
- * the native registry — there is deliberately no public builder API for it.
593
- */
594
- system?: boolean;
595
- }
596
- /**
597
- * Detail view definition
598
- */
599
- interface DetailViewDefinition extends BaseViewDefinition {
600
- type: "detail";
601
- config: DetailViewConfig;
602
- }
603
- /**
604
- * List view definition
605
- */
606
- interface ListViewDefinition extends BaseViewDefinition {
607
- type: "list";
608
- config: ListViewConfig;
609
- }
610
- /**
611
- * Unified view definition - discriminated union by type
612
- */
613
- type ViewDefinition = DetailViewDefinition | ListViewDefinition;
614
- /** Workspace presentation patch for an existing code-owned list tab. */
615
- type ListViewPresentationTabOverrides = Partial<Pick<ListViewTab, "layout" | "columns" | "columnSizing" | "displayAttributes" | "kanbanColumnOrder" | "kanbanColumnVisibility" | "kanbanPinnedColumns">> & {
616
- descriptionAttribute?: string | null;
617
- };
618
- interface ListViewPresentationOverrides {
619
- /** Patches keyed by stable tab ID. Null description explicitly clears the code default. */
620
- tabs: Record<string, ListViewPresentationTabOverrides>;
621
- }
622
- /**
623
- * Configuration overrides for user customizations
624
- * Only stores the delta from the source view
625
- */
626
- interface ConfigOverrides {
627
- /** Allowlisted workspace presentation overrides for opted-in system list views. */
628
- presentation?: ListViewPresentationOverrides;
629
- tabs?: ListViewTab[];
630
- hiddenTabIds?: string[];
631
- detailTabs?: Tab[];
632
- hiddenDetailTabIds?: string[];
633
- /** Workspace-scope scalar overrides on the view row's cosmetic fields. */
634
- label?: string;
635
- icon?: string;
636
- description?: string;
637
- /** Overrides for top-level config keys other than tabs (e.g. groupBy). */
638
- topLevel?: Record<string, unknown>;
639
- }
640
- /**
641
- * User customization overlay for a view
642
- * Stored per user, merged at runtime with the source view
643
- */
644
- interface ViewOverlay {
645
- /** Unique identifier */
646
- id: string;
647
- /** View ID this overlay applies to (UUID or virtual ID) */
648
- viewId: string;
649
- /** User ID who owns this overlay */
650
- userId: string;
651
- /** Configuration overrides (delta only) */
652
- configOverrides: ConfigOverrides;
653
- /** User's default view for this object (stored in overlay) */
654
- isUserDefault?: boolean;
655
- /** Created timestamp */
656
- createdAt: Date;
657
- /** Updated timestamp */
658
- updatedAt: Date;
659
- }
660
- /**
661
- * Check if a view is a detail view
662
- */
663
- declare function isDetailView(view: ViewDefinition): view is DetailViewDefinition;
664
- /**
665
- * Check if a view is a list view
666
- */
667
- declare function isListView(view: ViewDefinition): view is ListViewDefinition;
668
- /**
669
- * Check if a group is a field group. Kept because persisted configs written
670
- * before the relation group was removed may still carry another discriminant.
671
- */
672
- declare function isFieldGroup(group: Group): group is FieldGroup;
673
-
674
- interface AddAttributeInput {
675
- name: string;
676
- label: string;
677
- type: AttributeType;
678
- required?: boolean;
679
- unique?: boolean;
680
- description?: string;
681
- placeholder?: string;
682
- icon?: IconName;
683
- defaultValue?: unknown;
684
- metadata?: Record<string, unknown>;
685
- [key: string]: unknown;
686
- }
687
- interface CreateCustomObjectInput {
688
- name: string;
689
- label: string;
690
- pluralLabel?: string;
691
- labelExpression: string;
692
- embeddingExpression?: string;
693
- description?: string;
694
- icon?: IconName;
695
- attributes?: (Attribute | {
696
- build: () => Attribute;
697
- })[];
698
- metadata?: Record<string, unknown>;
699
- }
700
- interface UpdateObjectInput {
701
- label?: string;
702
- pluralLabel?: string;
703
- description?: string;
704
- icon?: IconName;
705
- labelExpression?: string;
706
- embeddingExpression?: string;
707
- metadata?: Record<string, unknown>;
708
- }
709
- interface CreateViewInput {
710
- objectName: string;
711
- type: ViewType;
712
- name: string;
713
- label: string;
714
- description?: string;
715
- icon?: IconName;
716
- config: ViewConfig;
717
- default?: boolean;
718
- metadata?: Record<string, unknown>;
719
- }
720
- interface UpdateViewInput {
721
- label?: string;
722
- description?: string;
723
- icon?: IconName;
724
- config?: ViewConfig;
725
- default?: boolean;
726
- metadata?: Record<string, unknown>;
727
- }
728
- interface RelationOption {
729
- id: string;
730
- objectId: string;
731
- objectName: string;
732
- objectLabel: string;
733
- objectIcon?: string;
734
- label: string;
735
- }
736
- interface RelationOptionsResponse {
737
- options: RelationOption[];
738
- hasMore: boolean;
739
- total: number;
740
- nextOffset?: number;
741
- }
742
-
743
- declare const statusGroupSchema: z.ZodEnum<{
744
- idle: "idle";
745
- in_progress: "in_progress";
746
- finished: "finished";
747
- }>;
748
- declare const selectOptionWriteSchema: z.ZodObject<{
749
- value: z.ZodString;
750
- label: z.ZodString;
751
- description: z.ZodOptional<z.ZodString>;
752
- inverse: z.ZodOptional<z.ZodString>;
753
- archived: z.ZodOptional<z.ZodBoolean>;
754
- color: z.ZodEnum<{
755
- gray: "gray";
756
- slate: "slate";
757
- blue: "blue";
758
- sky: "sky";
759
- indigo: "indigo";
760
- green: "green";
761
- emerald: "emerald";
762
- teal: "teal";
763
- red: "red";
764
- rose: "rose";
765
- yellow: "yellow";
766
- amber: "amber";
767
- orange: "orange";
768
- purple: "purple";
769
- violet: "violet";
770
- fuchsia: "fuchsia";
771
- pink: "pink";
772
- cyan: "cyan";
773
- lime: "lime";
774
- }>;
775
- }, z.core.$strict>;
776
- declare const multiselectOptionWriteSchema: z.ZodObject<{
777
- value: z.ZodString;
778
- label: z.ZodString;
779
- description: z.ZodOptional<z.ZodString>;
780
- inverse: z.ZodOptional<z.ZodString>;
781
- archived: z.ZodOptional<z.ZodBoolean>;
782
- color: z.ZodEnum<{
783
- gray: "gray";
784
- slate: "slate";
785
- blue: "blue";
786
- sky: "sky";
787
- indigo: "indigo";
788
- green: "green";
789
- emerald: "emerald";
790
- teal: "teal";
791
- red: "red";
792
- rose: "rose";
793
- yellow: "yellow";
794
- amber: "amber";
795
- orange: "orange";
796
- purple: "purple";
797
- violet: "violet";
798
- fuchsia: "fuchsia";
799
- pink: "pink";
800
- cyan: "cyan";
801
- lime: "lime";
802
- }>;
803
- }, z.core.$strict>;
804
- declare const statusOptionWriteSchema: z.ZodObject<{
805
- value: z.ZodString;
806
- label: z.ZodString;
807
- description: z.ZodOptional<z.ZodString>;
808
- inverse: z.ZodOptional<z.ZodString>;
809
- archived: z.ZodOptional<z.ZodBoolean>;
810
- color: z.ZodEnum<{
811
- gray: "gray";
812
- slate: "slate";
813
- blue: "blue";
814
- sky: "sky";
815
- indigo: "indigo";
816
- green: "green";
817
- emerald: "emerald";
818
- teal: "teal";
819
- red: "red";
820
- rose: "rose";
821
- yellow: "yellow";
822
- amber: "amber";
823
- orange: "orange";
824
- purple: "purple";
825
- violet: "violet";
826
- fuchsia: "fuchsia";
827
- pink: "pink";
828
- cyan: "cyan";
829
- lime: "lime";
830
- }>;
831
- group: z.ZodEnum<{
832
- idle: "idle";
833
- in_progress: "in_progress";
834
- finished: "finished";
835
- }>;
836
- }, z.core.$strict>;
837
- /**
838
- * Map of attribute type to config schema
839
- */
840
- declare const attributeConfigSchemas: Record<AttributeType, z.ZodObject<z.ZodRawShape>>;
841
- /**
842
- * Get the config schema for a specific attribute type
843
- */
844
- declare function getAttributeConfigSchema(type: AttributeType): z.ZodObject<z.ZodRawShape>;
845
- /**
846
- * Validate and strip unknown properties from attribute config
847
- * This ensures only allowed properties are stored in the database
848
- */
849
- declare function parseAttributeConfig(type: AttributeType, config: Record<string, unknown>): Record<string, unknown>;
850
- /**
851
- * The config contract as a WRITE applies it: the stored schema plus the
852
- * stricter option and icon rules newly written values must satisfy.
853
- */
854
- declare function getAttributeConfigWriteSchema(type: AttributeType): z.ZodObject<z.ZodRawShape>;
855
- /**
856
- * Strict parser for newly created attribute definitions.
857
- *
858
- * Top-level config remains strip-compatible with the historical config
859
- * contract, while newly written icons and select-like option objects are
860
- * validated strictly.
861
- */
862
- declare function parseAttributeConfigForCreate(type: AttributeType, input: unknown): Record<string, unknown>;
863
- /**
864
- * Patch-aware parser for persisted attributes.
865
- *
866
- * An explicit options patch owns and strictly validates the complete new
867
- * list. Omission means the stored legacy list is preserved without
868
- * reconstruction, including options that predate required colours/groups.
869
- */
870
- declare function parseAttributeConfigForUpdate(stored: Attribute, patch: Partial<AddAttributeInput>): Record<string, unknown>;
871
-
872
- export { type RelationOptionsResponse as $, type AttributeGroupField as A, type ExtendedFilterRule as B, type ConfigOverrides as C, type DetailViewConfig as D, type EmailsTab as E, type FilterState as F, type Group as G, type FilterCombinator as H, type FilterGroup as I, type FormDensity as J, type FormTab as K, type ListViewTab as L, type MeetingsTab as M, type FormsTab as N, type InverseSource as O, type ListViewPresentationOverrides as P, type ListViewPresentationTabOverrides as Q, type RecordOpenMode as R, type SortRule as S, type TableTab as T, NO_VALUE_OPERATORS as U, type ViewType as V, type NoValueOperator as W, OPERATORS_BY_TYPE as X, type PhoneFilterValue as Y, type QueryState as Z, type RelationOption as _, type ViewConfig as a, type RelationSource as a0, type RichtextTab as a1, type SidePanelPane as a2, type SortDirection as a3, type TabType as a4, type TableSource as a5, type UpdateObjectInput as a6, type UpdateViewInput as a7, type ViewOverlay as a8, attributeConfigSchemas as a9, getRollupFilterOperators as aa, isDetailView as ab, isFieldGroup as ac, isListView as ad, isNoValueOperator as ae, multiselectOptionWriteSchema as af, parseAttributeConfig as ag, parseAttributeConfigForCreate as ah, parseAttributeConfigForUpdate as ai, selectOptionWriteSchema as aj, statusGroupSchema as ak, statusOptionWriteSchema as al, getAttributeConfigSchema as am, getAttributeConfigWriteSchema as an, 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 RelativeDateValue as p, type ActivityTab as q, type AddAttributeInput as r, type AdvancedFilterState as s, type CreateCustomObjectInput as t, type CreateViewInput as u, type CurrencyFilterValue as v, type CustomTab as w, type DayMonthValue as x, type DocumentsTab as y, type EdgeQuantifier as z };