@stndrds/schema 1.0.0-alpha.192 → 1.0.0-alpha.194

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 (125) hide show
  1. package/dist/attributes-DP08iPCh.d.mts +889 -0
  2. package/dist/attributes-Ddhps_AU.d.ts +889 -0
  3. package/dist/{chunk-MAKSIK3P.js → chunk-5WATIVCA.js} +2 -2
  4. package/dist/{chunk-4KRLCWJM.mjs → chunk-6I2R22CX.mjs} +1 -1
  5. package/dist/{chunk-DC7YYE3U.js → chunk-ACKMC6FL.js} +2 -2
  6. package/dist/{chunk-TEQNVO7W.mjs → chunk-AYVHMVKQ.mjs} +1 -1
  7. package/dist/{chunk-P2BE2A2G.js → chunk-BV3IUMMW.js} +4 -7
  8. package/dist/{chunk-CCB4OY2O.js → chunk-E6JUYGJX.js} +2 -2
  9. package/dist/{chunk-7A3Y6O32.js → chunk-EBGRZUIH.js} +2 -2
  10. package/dist/{chunk-QWZHR2OO.js → chunk-EW5XR2X3.js} +2 -2
  11. package/dist/{chunk-UQVW4KPP.mjs → chunk-HRQEZUAA.mjs} +0 -1
  12. package/dist/{chunk-OAQWRMTP.js → chunk-HTSTPTNZ.js} +2 -2
  13. package/dist/{chunk-U4JC7P6D.mjs → chunk-HXDDJLHD.mjs} +37 -52
  14. package/dist/{chunk-Z75P63VF.mjs → chunk-JUKLL5RJ.mjs} +1 -1
  15. package/dist/{chunk-YQROI4IE.js → chunk-M5QIBMIH.js} +37 -52
  16. package/dist/{chunk-FQ2ZYOVS.js → chunk-MZOEL7FN.js} +47 -41
  17. package/dist/{chunk-KWVCGQ7N.mjs → chunk-NOMHDOVE.mjs} +2 -5
  18. package/dist/{chunk-OLJLCVNY.mjs → chunk-NS63SPNN.mjs} +1 -1
  19. package/dist/{chunk-J5HRK3WD.js → chunk-O44XVGHE.js} +2 -2
  20. package/dist/{chunk-TMYBEXBT.mjs → chunk-OSSGN43B.mjs} +1 -1
  21. package/dist/{chunk-LTHSU4NF.mjs → chunk-PMKCDRRO.mjs} +26 -21
  22. package/dist/{chunk-4TC27SMF.mjs → chunk-QEZUDVTN.mjs} +1 -1
  23. package/dist/{chunk-BLXQGQLK.mjs → chunk-QVLQPW3O.mjs} +1 -1
  24. package/dist/{chunk-EZHMVZQ4.js → chunk-QWKLQRBX.js} +4 -4
  25. package/dist/{chunk-ROAZLZA2.js → chunk-ROLWVTU3.js} +2 -2
  26. package/dist/{chunk-3JINFUN3.js → chunk-SGSGREPG.js} +2 -6
  27. package/dist/{chunk-VXOTYFEW.js → chunk-T6L2MUG2.js} +2 -2
  28. package/dist/{chunk-KNYZH2WD.mjs → chunk-UANQJ2GH.mjs} +8 -1
  29. package/dist/{chunk-IRTRJH37.mjs → chunk-UXAHLSWC.mjs} +1 -1
  30. package/dist/{chunk-ACQ3TUFK.js → chunk-V2UA2D4E.js} +2 -2
  31. package/dist/{chunk-R4CJHCC4.mjs → chunk-XZ5RG2OG.mjs} +1 -4
  32. package/dist/{chunk-TKN73433.js → chunk-YIP5FJ5H.js} +9 -2
  33. package/dist/{chunk-T225DB55.js → chunk-YKWSHBT5.js} +0 -1
  34. package/dist/{chunk-TBYXYSGA.mjs → chunk-YUFTHPOE.mjs} +1 -1
  35. package/dist/{chunk-ITTQ4FGR.mjs → chunk-ZDMOXF3U.mjs} +1 -1
  36. package/dist/{chunk-SMOHDR6M.mjs → chunk-ZDQ5AP26.mjs} +1 -1
  37. package/dist/{helpers-Y9rNQ6sz.d.ts → helpers-Bph8AoY7.d.mts} +15 -3
  38. package/dist/{helpers-HrKmSkLi.d.mts → helpers-D9klos6x.d.ts} +15 -3
  39. package/dist/index.d.mts +1121 -235
  40. package/dist/index.d.ts +1121 -235
  41. package/dist/index.js +2369 -854
  42. package/dist/index.mjs +2264 -774
  43. package/dist/{types-Bdlhgrf7.d.ts → types-D38kriFw.d.mts} +1 -2
  44. package/dist/{types-C5DittlR.d.mts → types-iKvYBe6v.d.ts} +1 -2
  45. package/dist/validation/all.d.mts +3 -3
  46. package/dist/validation/all.d.ts +3 -3
  47. package/dist/validation/all.js +30 -27
  48. package/dist/validation/all.mjs +17 -18
  49. package/dist/validation/complex/currency.d.mts +2 -2
  50. package/dist/validation/complex/currency.d.ts +2 -2
  51. package/dist/validation/complex/currency.js +3 -3
  52. package/dist/validation/complex/currency.mjs +2 -2
  53. package/dist/validation/complex/file.d.mts +2 -2
  54. package/dist/validation/complex/file.d.ts +2 -2
  55. package/dist/validation/complex/file.js +3 -3
  56. package/dist/validation/complex/file.mjs +2 -2
  57. package/dist/validation/complex/location.d.mts +2 -2
  58. package/dist/validation/complex/location.d.ts +2 -2
  59. package/dist/validation/complex/location.js +3 -3
  60. package/dist/validation/complex/location.mjs +2 -2
  61. package/dist/validation/complex/phone.d.mts +2 -2
  62. package/dist/validation/complex/phone.d.ts +2 -2
  63. package/dist/validation/complex/phone.js +3 -3
  64. package/dist/validation/complex/phone.mjs +2 -2
  65. package/dist/validation/complex/relation.d.mts +2 -2
  66. package/dist/validation/complex/relation.d.ts +2 -2
  67. package/dist/validation/complex/relation.js +5 -5
  68. package/dist/validation/complex/relation.mjs +2 -2
  69. package/dist/validation/complex/richtext.d.mts +2 -2
  70. package/dist/validation/complex/richtext.d.ts +2 -2
  71. package/dist/validation/complex/richtext.js +3 -3
  72. package/dist/validation/complex/richtext.mjs +2 -2
  73. package/dist/validation/complex/select.d.mts +2 -2
  74. package/dist/validation/complex/select.d.ts +2 -2
  75. package/dist/validation/complex/select.js +5 -5
  76. package/dist/validation/complex/select.mjs +2 -2
  77. package/dist/validation/complex/user.d.mts +2 -2
  78. package/dist/validation/complex/user.d.ts +2 -2
  79. package/dist/validation/complex/user.js +3 -3
  80. package/dist/validation/complex/user.mjs +2 -2
  81. package/dist/validation/computed/formula.d.mts +2 -2
  82. package/dist/validation/computed/formula.d.ts +2 -2
  83. package/dist/validation/computed/formula.js +3 -3
  84. package/dist/validation/computed/formula.mjs +2 -2
  85. package/dist/validation/computed/rollup.d.mts +2 -2
  86. package/dist/validation/computed/rollup.d.ts +2 -2
  87. package/dist/validation/computed/rollup.js +3 -3
  88. package/dist/validation/computed/rollup.mjs +2 -2
  89. package/dist/validation/config/index.d.mts +1 -1
  90. package/dist/validation/config/index.d.ts +1 -1
  91. package/dist/validation/config/index.js +4 -4
  92. package/dist/validation/config/index.mjs +1 -1
  93. package/dist/validation/core/index.d.mts +3 -3
  94. package/dist/validation/core/index.d.ts +3 -3
  95. package/dist/validation/core/index.js +3 -3
  96. package/dist/validation/core/index.mjs +1 -1
  97. package/dist/validation/object/index.d.mts +3 -3
  98. package/dist/validation/object/index.d.ts +3 -3
  99. package/dist/validation/object/index.js +32 -29
  100. package/dist/validation/object/index.mjs +16 -17
  101. package/dist/validation/primitives/checkbox.d.mts +2 -2
  102. package/dist/validation/primitives/checkbox.d.ts +2 -2
  103. package/dist/validation/primitives/checkbox.js +3 -3
  104. package/dist/validation/primitives/checkbox.mjs +2 -2
  105. package/dist/validation/primitives/date.d.mts +2 -2
  106. package/dist/validation/primitives/date.d.ts +2 -2
  107. package/dist/validation/primitives/date.js +3 -3
  108. package/dist/validation/primitives/date.mjs +2 -2
  109. package/dist/validation/primitives/number.d.mts +2 -2
  110. package/dist/validation/primitives/number.d.ts +2 -2
  111. package/dist/validation/primitives/number.js +3 -3
  112. package/dist/validation/primitives/number.mjs +2 -2
  113. package/dist/validation/primitives/text.d.mts +3 -8
  114. package/dist/validation/primitives/text.d.ts +3 -8
  115. package/dist/validation/primitives/text.js +3 -7
  116. package/dist/validation/primitives/text.mjs +2 -2
  117. package/package.json +2 -13
  118. package/dist/chunk-D7WFIGXW.js +0 -14
  119. package/dist/chunk-RUYUFXNW.mjs +0 -12
  120. package/dist/filters-DVBn5tov.d.ts +0 -1630
  121. package/dist/filters-HDG4kLoo.d.mts +0 -1630
  122. package/dist/validation/primitives/rating.d.mts +0 -12
  123. package/dist/validation/primitives/rating.d.ts +0 -12
  124. package/dist/validation/primitives/rating.js +0 -11
  125. package/dist/validation/primitives/rating.mjs +0 -2
@@ -1,1630 +0,0 @@
1
- import { IconName, CountryIso3, CurrencyCode, ColorId, MimeType } from '@stndrds/constants';
2
- import { Uuid } from './utils.mjs';
3
-
4
- interface DocumentLayout {
5
- /** Named sub-folders auto-created at the top of the record's drive when first used via attach --variant. */
6
- variants?: Record<string, DocumentLayoutVariant>;
7
- /** Dev-declared folder structures the user can instantiate via the UI inside a record's drive. */
8
- presets?: FolderPreset[];
9
- }
10
- interface DocumentLayoutVariant {
11
- /** Display title for the auto-created sub-folder. */
12
- title: string;
13
- description?: string;
14
- }
15
- interface FolderPreset {
16
- id: string;
17
- label: string;
18
- icon?: IconName;
19
- description?: string;
20
- structure: PresetNode[];
21
- }
22
- interface PresetNode {
23
- title: string;
24
- description?: string;
25
- children?: PresetNode[];
26
- }
27
- /** Max depth allowed for preset.structure to keep instantiation predictable. */
28
- declare const MAX_PRESET_DEPTH = 5;
29
-
30
- /**
31
- * Type of view - determines the config structure
32
- */
33
- type ViewType = "detail" | "list";
34
- /**
35
- * Creation behavior when clicking the "+" button
36
- * - `redirect`: Create the record then navigate to its detail page
37
- * - `inline`: Insert an empty row in the table (no navigation)
38
- * - `modal`: Open a stacked modal for creation
39
- */
40
- type CreateMode = "redirect" | "inline" | "modal";
41
- /**
42
- * Inline attribute group configuration
43
- * Groups multiple attributes into a single composite field with dropdown editing
44
- */
45
- interface AttributeGroupField {
46
- /** Unique identifier for the group */
47
- id: string;
48
- /** Display label for the composite field */
49
- label: string;
50
- /** Description shown in the dropdown */
51
- description?: string;
52
- /** Attribute names to include in this group */
53
- attributes: string[];
54
- /**
55
- * Template for the display value
56
- * Uses {attributeName} syntax for interpolation
57
- * @example "{billing_street}, {billing_city} {billing_postal_code}"
58
- */
59
- displayTemplate?: string;
60
- }
61
- /**
62
- * Field definition within a form group
63
- * Can be either a single attribute or an inline attribute group
64
- */
65
- interface Field {
66
- /** Attribute name to display (for single attribute fields) */
67
- attribute?: string;
68
- /** Inline attribute group (groups multiple attributes into one composite field) */
69
- attributeGroup?: AttributeGroupField;
70
- /** Grid span (1-12 columns) */
71
- span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
72
- /** Override label for this view (only for single attribute fields) */
73
- label?: string;
74
- /** Force read-only display */
75
- readOnly?: boolean;
76
- }
77
- /**
78
- * Base properties shared by all group types
79
- */
80
- interface BaseGroup {
81
- id: string;
82
- label: string;
83
- description?: string;
84
- collapsible?: boolean;
85
- collapsed?: boolean;
86
- order?: number;
87
- }
88
- /**
89
- * Group of fields for organizing forms (default group type)
90
- */
91
- interface FieldGroup extends BaseGroup {
92
- /** Discriminant — optional for backward compatibility with existing data */
93
- type?: "fields";
94
- fields: Field[];
95
- }
96
- /**
97
- * Group that displays related records for a relation attribute
98
- */
99
- interface RelationGroup extends BaseGroup {
100
- type: "relation";
101
- /** Relation attribute name on the source object */
102
- attribute: string;
103
- /** Columns to display (auto-detected from target object if empty) */
104
- columns?: string[];
105
- /** Read-only mode */
106
- readOnly?: boolean;
107
- /** Allow creating new related records */
108
- allowCreate?: boolean;
109
- /**
110
- * Two-level traversal — display records from the target's relation.
111
- * When set, parent rows become grouping headers and the sub-rows
112
- * (from `through.attribute`) are the primary display.
113
- *
114
- * @example attribute = "members", through.attribute = "companies"
115
- * → displays companies of each member
116
- */
117
- through?: {
118
- /** Relation attribute on the first-level target object */
119
- attribute: string;
120
- };
121
- }
122
- /**
123
- * Discriminated union of all group types
124
- */
125
- type Group = FieldGroup | RelationGroup;
126
- type TabType = "form" | "table" | "custom" | "activity" | "richtext" | "documents" | "forms";
127
- /**
128
- * Base properties shared by all tab types
129
- */
130
- interface BaseTab {
131
- id: string;
132
- name: string;
133
- label: string;
134
- icon?: IconName;
135
- order?: number;
136
- }
137
- /**
138
- * Form layout density
139
- */
140
- type FormDensity = "compact" | "comfortable" | "spacious";
141
- /**
142
- * Form tab - displays attributes organized in groups
143
- */
144
- interface FormTab extends BaseTab {
145
- type: "form";
146
- groups: Group[];
147
- /** Number of grid columns (1, 2, or 3). Default: 2 */
148
- formColumns?: 1 | 2 | 3;
149
- /** Layout density. Default: "comfortable" */
150
- density?: FormDensity;
151
- }
152
- /**
153
- * Direct relation on the current object
154
- *
155
- * @example Contact.companies → shows Companies linked via the "companies" relation
156
- */
157
- interface RelationSource {
158
- type: "relation";
159
- /** Relation attribute name on the current object */
160
- attribute: string;
161
- }
162
- /**
163
- * Inverse lookup — records from another object that point to us
164
- *
165
- * @example On Company, show Contacts where Contact.company = this Company
166
- */
167
- interface InverseSource {
168
- type: "inverse";
169
- /** Object name that has the relation to us */
170
- object: string;
171
- /** Relation attribute name on the source object that points to us */
172
- attribute: string;
173
- }
174
- /**
175
- * Where table data comes from — either a direct relation or an inverse lookup
176
- */
177
- type TableSource = RelationSource | InverseSource;
178
- /**
179
- * Table tab - displays related records in a table
180
- *
181
- * The `source` field determines where data comes from.
182
- *
183
- * @example Direct: source = { type: "relation", attribute: "members" }
184
- * @example Inverse: source = { type: "inverse", object: "contacts", attribute: "company" }
185
- */
186
- interface TableTab extends BaseTab {
187
- type: "table";
188
- /** Where the data comes from */
189
- source: TableSource;
190
- /** Columns to display (attribute names from the resolved target object) */
191
- columns: string[];
192
- /**
193
- * Traverse a 2nd-level relation to display nested data.
194
- * When active, `columns` stores the 2nd-level object's attribute names.
195
- *
196
- * @example source.attribute = "members", through.attribute = "companies"
197
- * → displays companies of each member
198
- */
199
- through?: {
200
- /** Relation attribute on the first-level target object */
201
- attribute: string;
202
- /** Show _source and _target columns */
203
- showSourceTarget?: boolean;
204
- };
205
- /** Allow creating new records */
206
- allowCreate?: boolean;
207
- /** Creation behavior when allowCreate is true. Default: "redirect" */
208
- createMode?: CreateMode;
209
- /** Allow inline editing */
210
- allowEdit?: boolean;
211
- /** Allow deleting records */
212
- allowDelete?: boolean;
213
- /** Default filters applied to the table */
214
- filters?: FilterState;
215
- /** Default sort rules */
216
- sorts?: SortRule[];
217
- }
218
- /**
219
- * Custom tab - renders a developer-defined component
220
- */
221
- interface CustomTab extends BaseTab {
222
- type: "custom";
223
- /** Component identifier to render */
224
- component: string;
225
- /** Props to pass to the component */
226
- props?: Record<string, unknown>;
227
- }
228
- /**
229
- * Activity tab - displays activity feed for the current record
230
- */
231
- interface ActivityTab extends BaseTab {
232
- type: "activity";
233
- limit?: number;
234
- }
235
- /**
236
- * Richtext tab - displays a block editor for a richtext attribute
237
- */
238
- interface RichtextTab extends BaseTab {
239
- type: "richtext";
240
- /** Richtext attribute to display in the BlockEditor */
241
- attribute: string;
242
- /** Optional text attribute for an editable title input above the editor */
243
- titleAttribute?: string;
244
- }
245
- /**
246
- * Documents tab - displays all documents attached to the record
247
- */
248
- interface DocumentsTab extends BaseTab {
249
- type: "documents";
250
- allowUpload?: boolean;
251
- allowRemove?: boolean;
252
- hideAttachments?: boolean;
253
- }
254
- /**
255
- * Forms tab - displays available forms for creating related records
256
- */
257
- interface FormsTab extends BaseTab {
258
- type: "forms";
259
- /** Object name to filter forms by slot (derived from record context, but can be overridden) */
260
- objectName?: string;
261
- }
262
- /**
263
- * Union of all tab types (for detail views)
264
- */
265
- type Tab = FormTab | TableTab | CustomTab | ActivityTab | RichtextTab | DocumentsTab | FormsTab;
266
- /**
267
- * Detail view layout mode
268
- * - `page`: Full view with multiple tabs
269
- * - `modal`: Simplified view for modals (single FormTab, no tabs UI)
270
- */
271
- type DetailViewLayout = "page" | "modal";
272
- /**
273
- * List view layout mode
274
- * - `table`: Table/grid layout
275
- * - `kanban`: Kanban board layout (grouped by attribute)
276
- */
277
- type ListViewLayout = "table" | "kanban";
278
- /**
279
- * Tab within a list view — each tab carries its own full display configuration.
280
- *
281
- * @example
282
- * ```typescript
283
- * const tabs: ListViewTab[] = [
284
- * { id: "all", label: "All Contacts", default: true, layout: "table", columns: ["name", "email", "status"] },
285
- * { id: "active", label: "Active", layout: "table", columns: ["name", "email"], filters: activeFilter },
286
- * { id: "pipeline", label: "Pipeline", layout: "kanban", columns: ["name", "amount"], groupByAttribute: "stage" },
287
- * ];
288
- * ```
289
- */
290
- interface ListViewTab {
291
- /** Unique identifier */
292
- id: string;
293
- /** Display label */
294
- label: string;
295
- /** Icon */
296
- icon?: IconName;
297
- /** Default tab (shown on load) */
298
- default?: boolean;
299
- /** Layout mode */
300
- layout: ListViewLayout;
301
- /** Attribute names to display as columns */
302
- columns: string[];
303
- /** Column widths in pixels */
304
- columnSizing?: Record<string, number>;
305
- /** Filters applied to this tab */
306
- filters?: FilterGroup;
307
- /** Sort rules for this tab */
308
- sorts?: SortRule[];
309
- /** Attribute to group by (required when layout is "kanban") */
310
- groupByAttribute?: string;
311
- /** When true, the tab is read-only: no cell editing, no create, no delete */
312
- readOnly?: boolean;
313
- /** Creation behavior when clicking "+". Default: "redirect" */
314
- createMode?: CreateMode;
315
- /** User attribute to display on kanban cards (bottom-left) */
316
- cardUserAttribute?: string;
317
- /** Date attribute to display on kanban cards (bottom-right) */
318
- cardDateAttribute?: string;
319
- /** Order of kanban columns (by option value) - for kanban layout only */
320
- kanbanColumnOrder?: string[];
321
- /** Visibility of kanban columns (by option value) - for kanban layout only */
322
- kanbanColumnVisibility?: Record<string, boolean>;
323
- /** Pinned kanban columns (by option value) - for kanban layout only */
324
- kanbanPinnedColumns?: string[];
325
- }
326
- /**
327
- * Configuration for the side panel displayed alongside tab content.
328
- * When present, a right-side panel shows the configured attributes as flat fields.
329
- */
330
- interface SidePanelConfig {
331
- /** Attribute names to display as flat fields in the panel */
332
- attributes: string[];
333
- /** Width in pixels. @default 320 */
334
- width?: number;
335
- }
336
- /**
337
- * Configuration for detail views (RecordEditView)
338
- */
339
- interface DetailViewConfig {
340
- /** Layout mode */
341
- layout: DetailViewLayout;
342
- /** Tabs in this view */
343
- tabs: Tab[];
344
- /** Optional side panel with flat attribute fields (not available for modal layout) */
345
- sidePanel?: SidePanelConfig;
346
- }
347
- /**
348
- * Configuration for list views (RecordsView)
349
- *
350
- * Each tab carries its own full config (layout, columns, filters, sorts, groupBy).
351
- * The view only holds shared base filters applied to ALL tabs.
352
- */
353
- interface ListViewConfig {
354
- /** Base filters applied to ALL tabs (scoping, tenant, etc.) */
355
- defaultFilters?: FilterGroup;
356
- /** Tabs — at least one required. Each carries its own full config. */
357
- tabs: ListViewTab[];
358
- }
359
- /**
360
- * Union of all view configs
361
- */
362
- type ViewConfig = DetailViewConfig | ListViewConfig;
363
- /**
364
- * Base view properties shared by all view types
365
- */
366
- interface BaseViewDefinition {
367
- /** Unique identifier (UUID, assigned by database) */
368
- id?: string;
369
- /** Technical name (kebab-case) */
370
- name: string;
371
- /** Display label */
372
- label: string;
373
- /** Description */
374
- description?: string;
375
- /** Icon */
376
- icon?: IconName;
377
- /** Object this view belongs to (object name) */
378
- object: string;
379
- /** Default view for this object+type combination */
380
- default?: boolean;
381
- /** Extensible metadata */
382
- metadata?: Record<string, unknown>;
383
- /** Current schema version of this view definition */
384
- schema_version: number;
385
- }
386
- /**
387
- * Detail view definition
388
- */
389
- interface DetailViewDefinition extends BaseViewDefinition {
390
- type: "detail";
391
- config: DetailViewConfig;
392
- }
393
- /**
394
- * List view definition
395
- */
396
- interface ListViewDefinition extends BaseViewDefinition {
397
- type: "list";
398
- config: ListViewConfig;
399
- }
400
- /**
401
- * Unified view definition - discriminated union by type
402
- */
403
- type ViewDefinition = DetailViewDefinition | ListViewDefinition;
404
- /**
405
- * Configuration overrides for user customizations
406
- * Only stores the delta from the source view
407
- */
408
- interface ConfigOverrides {
409
- tabs?: ListViewTab[];
410
- hiddenTabIds?: string[];
411
- detailTabs?: Tab[];
412
- hiddenDetailTabIds?: string[];
413
- }
414
- /**
415
- * User customization overlay for a view
416
- * Stored per user, merged at runtime with the source view
417
- */
418
- interface ViewOverlay {
419
- /** Unique identifier */
420
- id: string;
421
- /** View ID this overlay applies to (UUID or virtual ID) */
422
- viewId: string;
423
- /** User ID who owns this overlay */
424
- userId: string;
425
- /** Configuration overrides (delta only) */
426
- configOverrides: ConfigOverrides;
427
- /** User's default view for this object (stored in overlay) */
428
- isUserDefault?: boolean;
429
- /** Created timestamp */
430
- createdAt: Date;
431
- /** Updated timestamp */
432
- updatedAt: Date;
433
- }
434
- /**
435
- * Check if a view is a detail view
436
- */
437
- declare function isDetailView(view: ViewDefinition): view is DetailViewDefinition;
438
- /**
439
- * Check if a view is a list view
440
- */
441
- declare function isListView(view: ViewDefinition): view is ListViewDefinition;
442
- /**
443
- * Check if a group is a field group (default type)
444
- */
445
- declare function isFieldGroup(group: Group): group is FieldGroup;
446
- /**
447
- * Check if a group is a relation group
448
- */
449
- declare function isRelationGroup(group: Group): group is RelationGroup;
450
-
451
- type BuiltInTransform = "toString" | "toNumber" | "toDate" | "toBoolean" | "toISOString";
452
- type SchemaOperation = {
453
- type: "add_attribute";
454
- attribute: Attribute;
455
- } | {
456
- type: "remove_attribute";
457
- name: string;
458
- backup_config: Attribute;
459
- } | {
460
- type: "rename_attribute";
461
- from: string;
462
- to: string;
463
- } | {
464
- type: "change_type";
465
- name: string;
466
- from: AttributeType;
467
- to: AttributeType;
468
- transform?: BuiltInTransform;
469
- } | {
470
- type: "update_config";
471
- name: string;
472
- from: Partial<Record<string, unknown>>;
473
- to: Partial<Record<string, unknown>>;
474
- } | {
475
- type: "remove_object";
476
- backup: Record<string, unknown>;
477
- } | {
478
- type: "rename_object";
479
- from: string;
480
- to: string;
481
- };
482
- type ViewOperation = {
483
- type: "update_config";
484
- from: ViewConfig;
485
- to: ViewConfig;
486
- } | {
487
- type: "update_tabs";
488
- from: (ListViewTab | Tab)[];
489
- to: (ListViewTab | Tab)[];
490
- } | {
491
- type: "force_reset";
492
- config: ViewConfig;
493
- } | {
494
- type: "remove_view";
495
- backup: Record<string, unknown>;
496
- };
497
- interface MigrationDefinition {
498
- version: number;
499
- operations: SchemaOperation[];
500
- }
501
- interface ViewTransform {
502
- id: string;
503
- tenantId: string;
504
- viewId: string;
505
- fromVersion: number;
506
- toVersion: number;
507
- operations: ViewOperation[];
508
- appliedAt: Date;
509
- }
510
- interface MigrationError {
511
- id: string;
512
- tenantId: string;
513
- transformId: string;
514
- recordId: string;
515
- attributeName: string;
516
- originalValue: unknown;
517
- error: string;
518
- resolvedAt: Date | null;
519
- resolvedValue: unknown | null;
520
- }
521
-
522
- /**
523
- * Timestamps for tracking creation and updates
524
- */
525
- interface Timestamps {
526
- createdAt: Date;
527
- updatedAt: Date;
528
- }
529
- /**
530
- * Object definition - Represents a database table/entity
531
- */
532
- interface ObjectDefinition {
533
- id?: Uuid;
534
- name: string;
535
- label: string;
536
- pluralLabel?: string;
537
- description?: string;
538
- icon?: IconName;
539
- /**
540
- * Template expression used to compute the object's display label.
541
- * Supports variable interpolation and pipes for formatting.
542
- *
543
- * @example
544
- * ```typescript
545
- * // Simple attribute reference
546
- * labelExpression: "{{ name }}"
547
- *
548
- * // Multiple attributes
549
- * labelExpression: "{{ firstName }} {{ lastName }}"
550
- *
551
- * // With pipes for formatting
552
- * labelExpression: "{{ code | UPPER }} - {{ name | capitalize }}"
553
- * ```
554
- *
555
- * Available pipes: UPPER, LOWER, capitalize, trim
556
- */
557
- labelExpression: string;
558
- attributes: Attribute[];
559
- system?: boolean;
560
- metadata?: Record<string, unknown>;
561
- /** Current schema version (incremented with each migration) */
562
- schema_version: number;
563
- /** Ordered list of migrations applied to this object's schema */
564
- migrations: MigrationDefinition[];
565
- /** Smart-folder layout convention for documents attached to records of this object. */
566
- documentLayout?: DocumentLayout;
567
- }
568
- /**
569
- * Links an attribute to an object
570
- */
571
- interface ObjectAttribute {
572
- objectId: Uuid;
573
- attributeId: Uuid;
574
- order?: number;
575
- required?: boolean;
576
- }
577
- /**
578
- * Completion status of a record based on data completeness.
579
- *
580
- * - `draft`: Record is missing one or more required attribute values.
581
- * Can be saved but is considered incomplete.
582
- * - `complete`: All required attribute values are present and valid.
583
- * Record is ready for use.
584
- *
585
- * This is different from workflow status (e.g., "pending", "approved").
586
- * Completion status is computed dynamically based on the object schema.
587
- */
588
- type CompletionStatus = "draft" | "complete";
589
- /**
590
- * Record - Instance of an Object (a row in the database)
591
- */
592
- interface ObjectRecord extends Timestamps {
593
- id: Uuid;
594
- objectId: Uuid;
595
- /**
596
- * Display label computed from the object's labelExpression.
597
- * Computed dynamically based on record values.
598
- *
599
- * @example "John Doe" (from "{{ firstName }} {{ lastName }}")
600
- */
601
- label: string;
602
- /**
603
- * Completion status of the record.
604
- * - `draft`: Missing required values, record is incomplete
605
- * - `complete`: All required values present and valid
606
- *
607
- * Computed dynamically based on the object's schema.
608
- */
609
- completionStatus: CompletionStatus;
610
- values: Record<string, unknown>;
611
- /**
612
- * Custom metadata for the record.
613
- * Use this for UI/UX state, feature flags, or any application-specific data.
614
- * Unlike system fields (id, createdAt, updatedAt), metadata can be updated.
615
- */
616
- metadata?: Record<string, unknown>;
617
- /**
618
- * Soft delete timestamp.
619
- * If set, the record is considered deleted but can be restored.
620
- * Queries exclude soft-deleted records by default.
621
- */
622
- deletedAt?: Date | null;
623
- /**
624
- * Actor ID who soft-deleted this record.
625
- * Set alongside deletedAt when a record is soft-deleted.
626
- */
627
- deletedBy?: string | null;
628
- /**
629
- * Actor ID who created this record.
630
- * Automatically set by RecordService when actorId is configured.
631
- * Optional for backward compatibility with existing records.
632
- */
633
- createdBy?: string;
634
- /**
635
- * Actor ID who last updated this record.
636
- * Automatically set by RecordService when actorId is configured.
637
- * Optional for backward compatibility with existing records.
638
- */
639
- lastUpdatedBy?: string;
640
- /** Schema version at the time this record was last migrated */
641
- schemaVersion: number;
642
- }
643
- /**
644
- * System-managed field names on ObjectRecord.
645
- * These are stored as SQL columns (not in JSONB `values`).
646
- *
647
- * Use this in adapters to determine if a filter/sort attribute is a table column
648
- * vs. a JSONB value field.
649
- *
650
- * @example
651
- * ```typescript
652
- * if (SYSTEM_FIELD_NAMES.includes(filter.attribute)) {
653
- * // Filter on SQL column (e.g., WHERE created_at > ...)
654
- * } else {
655
- * // Filter on JSONB field (e.g., WHERE values->>'name' = ...)
656
- * }
657
- * ```
658
- */
659
- declare const SYSTEM_FIELD_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy"];
660
- /**
661
- * Type for system field names
662
- */
663
- type SystemFieldName = (typeof SYSTEM_FIELD_NAMES)[number];
664
- /**
665
- * Reserved attribute names that cannot be used for custom attributes.
666
- * These names conflict with ObjectRecord properties.
667
- *
668
- * Includes:
669
- * - System fields (id, createdAt, updatedAt, createdBy, lastUpdatedBy)
670
- * - Other ObjectRecord properties (objectId, label, completionStatus, values, metadata, deletedAt)
671
- *
672
- * @example
673
- * ```typescript
674
- * if (RESERVED_ATTRIBUTE_NAMES.includes(attributeName)) {
675
- * throw new Error(`"${attributeName}" is a reserved name`);
676
- * }
677
- * ```
678
- */
679
- declare const RESERVED_ATTRIBUTE_NAMES: readonly ["id", "createdAt", "updatedAt", "createdBy", "lastUpdatedBy", "objectId", "label", "completionStatus", "values", "metadata", "deletedAt", "deletedBy", "schemaVersion"];
680
- /**
681
- * Type for reserved attribute names
682
- */
683
- type ReservedAttributeName = (typeof RESERVED_ATTRIBUTE_NAMES)[number];
684
-
685
- type DocumentKind = "file" | "folder";
686
- interface Document extends Timestamps {
687
- id: Uuid;
688
- tenantId: Uuid;
689
- title: string;
690
- kind: DocumentKind;
691
- parentId?: Uuid | null;
692
- description?: string;
693
- contentHash?: string;
694
- createdBy?: Uuid;
695
- updatedBy?: Uuid;
696
- deletedAt?: Date | null;
697
- /**
698
- * Fractional ordering position within `(tenantId, parentId)`. Lower values
699
- * sort first. New rows default to `max(siblings) + 1024` so reorderings can
700
- * insert between neighbours without renumbering. The server may rebalance
701
- * positions in the background to keep the spacing bounded.
702
- */
703
- position: number;
704
- }
705
- interface DocumentWithSubCount extends Document {
706
- subCount: number | null;
707
- }
708
- /**
709
- * Configuration for a single named slot on a DocumentAttribute.
710
- * Slots are placeholders for files within a Document; declared at design-time
711
- * on the attribute and validated at attach time.
712
- */
713
- interface DocumentSlotConfig {
714
- /** Stable identifier referenced in DB. */
715
- name: string;
716
- /** Display label in UI. Falls back to `name` if absent. */
717
- label?: string;
718
- /** Description shown to users and to the AI in tool context. */
719
- description?: string;
720
- /** Surfaced to UI/AI but not enforced by the system. */
721
- required?: boolean;
722
- /** MIME prefixes or globs (e.g. "image/*", "application/pdf"). */
723
- acceptedMimeTypes?: string[];
724
- /** Hard ceiling enforced by the service before upload. */
725
- maxSizeBytes?: number;
726
- }
727
- /** Default applied by the document() builder when no slots are configured. */
728
- declare const DEFAULT_DOCUMENT_SLOT: DocumentSlotConfig;
729
- interface DocumentSlot extends Timestamps {
730
- id: Uuid;
731
- tenantId: Uuid;
732
- documentId: Uuid;
733
- slotName: string;
734
- isAdditional: boolean;
735
- fileId: Uuid;
736
- status: SlotStatus;
737
- ocrText?: string;
738
- ocrConfidence?: number;
739
- processedAt?: Date;
740
- }
741
- type SlotStatus = "uploaded" | "processing" | "completed" | "failed";
742
- interface ProcessingJob extends Timestamps {
743
- id: Uuid;
744
- tenantId: Uuid;
745
- documentId: Uuid;
746
- slotName?: string | null;
747
- type: ProcessingJobType;
748
- provider: string;
749
- status: ProcessingJobStatus;
750
- input?: Record<string, unknown>;
751
- result?: Record<string, unknown>;
752
- error?: string;
753
- startedAt?: Date | null;
754
- completedAt?: Date | null;
755
- createdBy?: Uuid;
756
- }
757
- type ProcessingJobType = "ocr";
758
- type ProcessingJobStatus = "pending" | "processing" | "completed" | "failed" | "cancelled";
759
- interface CreateDocument {
760
- title: string;
761
- kind?: DocumentKind;
762
- parentId?: Uuid | null;
763
- description?: string;
764
- position?: number;
765
- }
766
- /**
767
- * Reference to a record attribute that should atomically attach a freshly
768
- * created Document. Passed alongside `CreateDocument` to make creation
769
- * link-aware end-to-end (client → REST → service → repo).
770
- *
771
- * The server requires this — orphan Documents are not creatable through the
772
- * REST API.
773
- */
774
- interface CreateDocumentLink {
775
- objectName: string;
776
- sourceRecordId: string;
777
- attributeName: string;
778
- /**
779
- * Optional qualifyWith properties on the record→Document edge. Currently
780
- * accepted by the controller DTO but silently ignored by the service (see
781
- * `DocumentService.createDocument` — there's a TODO to support this).
782
- */
783
- properties?: Record<string, unknown>;
784
- }
785
- interface UpdateDocument {
786
- title?: string;
787
- parentId?: Uuid | null;
788
- position?: number;
789
- }
790
- interface CreateDocumentSlot {
791
- documentId: Uuid;
792
- slotName: string;
793
- fileId: Uuid;
794
- isAdditional?: boolean;
795
- }
796
- interface UpdateDocumentSlot {
797
- status?: SlotStatus;
798
- ocrText?: string;
799
- ocrConfidence?: number;
800
- }
801
- interface CreateProcessingJob {
802
- documentId: Uuid;
803
- slotName?: string;
804
- type: ProcessingJobType;
805
- provider: string;
806
- input?: Record<string, unknown>;
807
- }
808
- interface UpdateProcessingJob {
809
- status?: ProcessingJobStatus;
810
- result?: Record<string, unknown>;
811
- error?: string;
812
- startedAt?: Date;
813
- completedAt?: Date;
814
- }
815
- interface DocumentListOptions {
816
- limit?: number;
817
- offset?: number;
818
- }
819
- interface DocumentWithSlots extends Document {
820
- slots: DocumentSlot[];
821
- }
822
- interface RecordDocuments {
823
- /** Documents grouped by attribute name (includes system 'attachments' attribute) */
824
- byAttribute: Record<string, DocumentWithSlots[]>;
825
- }
826
-
827
- /**
828
- * Feature flag levels (resolution priority: user > tenant > global).
829
- *
830
- * - `global`: Applies to all tenants and users
831
- * - `tenant`: Applies to a specific tenant
832
- * - `user`: Applies to a specific user within a tenant
833
- */
834
- type FlagLevel = "global" | "tenant" | "user";
835
- /**
836
- * Flag value types supported by the system.
837
- */
838
- type FlagValueType = "boolean" | "string" | "number" | "json";
839
- /**
840
- * Definition of a feature flag.
841
- * Created using the flag builders (booleanFlag, stringFlag, etc.)
842
- */
843
- interface FeatureFlagDefinition<T = unknown> {
844
- /** Unique identifier for the flag (kebab-case) */
845
- name: string;
846
- /** Human-readable label */
847
- label: string;
848
- /** Optional description */
849
- description?: string;
850
- /** Type of the flag value */
851
- valueType: FlagValueType;
852
- /** Default value when no override exists */
853
- defaultValue: T;
854
- /** Levels at which this flag can be overridden */
855
- allowedLevels: FlagLevel[];
856
- /** Grouping category for UI */
857
- category?: string;
858
- /** System flag - cannot be modified via API */
859
- system?: boolean;
860
- }
861
- /**
862
- * Stored override for a feature flag.
863
- * Represents a row in the feature_flag_overrides table.
864
- */
865
- interface FlagOverride<T = unknown> {
866
- /** Name of the flag being overridden */
867
- flagName: string;
868
- /** Level of the override */
869
- level: FlagLevel;
870
- /** Target ID (tenantId for tenant-level, userId for user-level) */
871
- targetId?: string;
872
- /** Override value */
873
- value: T;
874
- /** Optional expiration date */
875
- expiresAt?: Date;
876
- /** Who created this override */
877
- createdBy?: string;
878
- /** When the override was created */
879
- createdAt: Date;
880
- /** When the override was last updated */
881
- updatedAt: Date;
882
- }
883
- /**
884
- * Resolved flag value with source information.
885
- * Result of flag resolution including where the value came from.
886
- */
887
- interface ResolvedFlag<T = unknown> {
888
- /** Flag name */
889
- name: string;
890
- /** Resolved value */
891
- value: T;
892
- /** Where the value came from */
893
- source: FlagLevel | "default";
894
- /** ID of the source (tenantId or userId) if not default */
895
- sourceId?: string;
896
- }
897
- /**
898
- * Feature gate configuration for conditional attribute visibility.
899
- * Used with the `.featureGate()` builder method.
900
- */
901
- interface FeatureGate {
902
- /** Name of the flag to check */
903
- flag: string;
904
- /**
905
- * Expected value for the gate to pass.
906
- * For boolean flags, defaults to `true`.
907
- * For other types, compares with strict equality.
908
- */
909
- expectedValue?: unknown;
910
- /**
911
- * Behavior when the gate fails.
912
- * - `hide`: Attribute is completely hidden (default)
913
- * - `show`: Attribute is shown regardless (no gating)
914
- * - `disable`: Attribute is visible but read-only
915
- */
916
- fallback?: "hide" | "show" | "disable";
917
- }
918
- /**
919
- * Repository interface for feature flag overrides storage.
920
- * Added to DatabaseAdapter as an optional repository.
921
- *
922
- * If not provided, only static defaults from module config are used.
923
- */
924
- interface FeatureFlagsRepository {
925
- /**
926
- * Get all overrides matching the criteria.
927
- * Returns overrides from the database (global, tenant, or user level).
928
- */
929
- getOverrides(options: {
930
- /** Filter by level */
931
- level?: FlagLevel;
932
- /** Filter by target ID (tenantId or userId) */
933
- targetId?: string;
934
- /** Filter by flag names (for efficient single/batch lookups) */
935
- flagNames?: string[];
936
- }): Promise<FlagOverride[]>;
937
- /**
938
- * Create or update an override.
939
- * Uses upsert semantics based on (flagName, level, targetId).
940
- */
941
- setOverride(override: Omit<FlagOverride, "createdAt" | "updatedAt">): Promise<FlagOverride>;
942
- /**
943
- * Delete an override.
944
- */
945
- deleteOverride(flagName: string, level: FlagLevel, targetId?: string): Promise<void>;
946
- }
947
- /**
948
- * Static flag default value for module configuration.
949
- */
950
- interface StaticFlagDefault {
951
- /** Flag name */
952
- name: string;
953
- /** Default value */
954
- value: unknown;
955
- }
956
- /**
957
- * Feature flags configuration for SchemaModule.
958
- */
959
- interface FeatureFlagsConfig {
960
- /**
961
- * Static default values for flags.
962
- * These are always applied and used when no database override exists.
963
- *
964
- * @example
965
- * ```typescript
966
- * featureFlags: {
967
- * defaults: [
968
- * { name: "architect-mode", value: false },
969
- * { name: "ai-chat", value: false },
970
- * { name: "tier", value: "free" },
971
- * ],
972
- * }
973
- * ```
974
- */
975
- defaults?: StaticFlagDefault[];
976
- }
977
-
978
- /**
979
- * Allowed attribute types in .qualifyWith()
980
- *
981
- * IMPORTANT: Complex types (formula, rollup, relation, file, user, document, richtext)
982
- * are NOT supported to avoid duplicating backend behavior.
983
- */
984
- type PropertyType = "text" | "textarea" | "number" | "checkbox" | "date" | "phone" | "currency" | "status" | "select" | "multiselect" | "rating" | "location";
985
- /**
986
- * Union of attribute types allowed as qualified relation properties.
987
- *
988
- * These are the same Attribute types used for object attributes,
989
- * restricted to simple types that don't require complex backend duplication.
990
- */
991
- type PropertyAttribute = TextAttribute | TextAreaAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | SelectAttribute | MultiselectAttribute | RatingAttribute | LocationAttribute;
992
- /**
993
- * Schema defining properties for a qualified relation.
994
- *
995
- * Uses the same Attribute types as object attributes, enabling DRY builders:
996
- *
997
- * @example
998
- * ```typescript
999
- * relation({ name: "companies", label: "Companies" })
1000
- * .to("companies").many()
1001
- * .qualifyWith(
1002
- * select({ name: "role", label: "Role" }).options([...]).required(),
1003
- * number({ name: "shares", label: "Shares" }).min(0),
1004
- * )
1005
- * ```
1006
- */
1007
- interface PropertySchema {
1008
- definitions: PropertyAttribute[];
1009
- }
1010
- /**
1011
- * Property attribute types that have an `options` array.
1012
- */
1013
- type OptionPropertyAttribute = SelectAttribute | StatusAttribute | MultiselectAttribute;
1014
- /**
1015
- * Type guard to check if a property attribute has options.
1016
- *
1017
- * @param attr - The property attribute to check
1018
- * @returns true if the attribute is a select, status, or multiselect type with options
1019
- *
1020
- * @example
1021
- * ```typescript
1022
- * for (const def of definitions) {
1023
- * if (hasOptions(def)) {
1024
- * // TypeScript knows def.options exists and is Option[]
1025
- * for (const option of def.options) {
1026
- * console.log(option.value);
1027
- * }
1028
- * }
1029
- * }
1030
- * ```
1031
- */
1032
- declare function hasOptions(attr: PropertyAttribute): attr is OptionPropertyAttribute;
1033
-
1034
- type AttributeType = "text" | "textarea" | "richtext" | "number" | "checkbox" | "date" | "phone" | "currency" | "status" | "location" | "select" | "multiselect" | "file" | "user" | "relation" | "rating" | "formula" | "rollup" | "document";
1035
- /**
1036
- * Status group categorization
1037
- */
1038
- type StatusGroup = "idle" | "in_progress" | "finished";
1039
- /**
1040
- * Unified option type for select-like fields
1041
- */
1042
- interface Option {
1043
- id: string;
1044
- label: string;
1045
- value: string;
1046
- color?: ColorId;
1047
- icon?: IconName;
1048
- description?: string;
1049
- group?: StatusGroup;
1050
- /** Value of the inverse option for bilateral relations (e.g. "parent" → "child") */
1051
- inverse?: string;
1052
- }
1053
- /**
1054
- * Attribute grouping for UI organization
1055
- */
1056
- interface AttributeGroup {
1057
- id: string;
1058
- label: string;
1059
- description?: string;
1060
- attributeIds: string[];
1061
- collapsible?: boolean;
1062
- collapsed?: boolean;
1063
- order?: number;
1064
- }
1065
- interface BaseAttribute<DefaultValueType = unknown> {
1066
- id: Uuid;
1067
- name: string;
1068
- label: string;
1069
- type: AttributeType;
1070
- required: boolean;
1071
- disabled?: boolean;
1072
- placeholder?: string;
1073
- description?: string;
1074
- defaultValue?: DefaultValueType;
1075
- icon?: IconName;
1076
- order?: number;
1077
- hidden?: boolean;
1078
- archived?: boolean;
1079
- deprecated?: boolean;
1080
- system?: boolean;
1081
- /**
1082
- * Feature gate to conditionally show/hide/disable this attribute.
1083
- * When the flag condition is not met, the attribute behavior depends on `fallback`:
1084
- * - "hide" (default): Attribute is completely hidden
1085
- * - "disable": Attribute is visible but read-only
1086
- * - "show": No gating (useful for overriding parent settings)
1087
- */
1088
- featureGate?: FeatureGate;
1089
- metadata?: Record<string, unknown>;
1090
- }
1091
- interface TextAttribute extends BaseAttribute<string> {
1092
- type: "text";
1093
- minLength?: number;
1094
- maxLength?: number;
1095
- pattern?: string;
1096
- }
1097
- type NumberUnit = "integer" | "decimal" | "percentage";
1098
- interface NumberAttribute extends BaseAttribute<number> {
1099
- type: "number";
1100
- min?: number;
1101
- max?: number;
1102
- unit?: NumberUnit;
1103
- decimals?: number;
1104
- }
1105
- interface CheckboxAttribute extends BaseAttribute<boolean> {
1106
- type: "checkbox";
1107
- }
1108
- type DateFormat = "short" | "long" | "full" | "relative";
1109
- type DateValue = string | "today";
1110
- interface DateAttribute extends BaseAttribute<string> {
1111
- type: "date";
1112
- dateFormat?: DateFormat;
1113
- minDate?: DateValue;
1114
- maxDate?: DateValue;
1115
- }
1116
- interface Phone {
1117
- countryCode: CountryIso3;
1118
- phoneNumber: string;
1119
- }
1120
- interface PhoneAttribute extends BaseAttribute<Phone> {
1121
- type: "phone";
1122
- defaultCountryCode?: CountryIso3;
1123
- }
1124
- interface Currency {
1125
- code: CurrencyCode;
1126
- value: number;
1127
- }
1128
- interface CurrencyAttribute extends BaseAttribute<Currency> {
1129
- type: "currency";
1130
- defaultCurrency?: CurrencyCode;
1131
- allowedCurrencies?: CurrencyCode[];
1132
- /** Allow negative currency values (e.g. refunds, credits). Defaults to false. */
1133
- allowNegative?: boolean;
1134
- }
1135
- /**
1136
- * StatusAttribute - For workflow states with semantic grouping (idle/in_progress/finished)
1137
- * Use this for: Task status, Order status, Project phases, Process states
1138
- * Use SelectAttribute for: Categories, Types, simple choices without workflow
1139
- */
1140
- interface StatusAttribute extends BaseAttribute<string> {
1141
- type: "status";
1142
- options: Option[];
1143
- }
1144
- interface Location {
1145
- address?: string;
1146
- address2?: string;
1147
- city?: string;
1148
- state?: string;
1149
- postalCode?: string;
1150
- country?: CountryIso3;
1151
- latitude?: number;
1152
- longitude?: number;
1153
- }
1154
- type LocationGranularity = "full" | "address" | "city" | "state" | "country" | "coordinates";
1155
- interface LocationAttribute extends BaseAttribute<Location> {
1156
- type: "location";
1157
- granularity: LocationGranularity;
1158
- enableAutocomplete?: boolean;
1159
- enableMap?: boolean;
1160
- defaultCountry?: CountryIso3;
1161
- allowedCountries?: CountryIso3[];
1162
- displayFormat?: "single_line" | "multi_line" | "compact";
1163
- }
1164
- /**
1165
- * SelectAttribute - For simple single-choice selection
1166
- * Use this for: Categories, Document types, Departments, Priorities
1167
- * Options can be grouped (e.g., countries by continent) but no workflow logic
1168
- */
1169
- interface SelectAttribute extends BaseAttribute<string> {
1170
- type: "select";
1171
- options: Option[];
1172
- }
1173
- interface MultiselectAttribute extends BaseAttribute<string[]> {
1174
- type: "multiselect";
1175
- options: Option[];
1176
- }
1177
- interface FileAttribute extends BaseAttribute<string> {
1178
- type: "file";
1179
- maxFiles?: number;
1180
- maxSize?: number;
1181
- allowedTypes?: MimeType[] | readonly MimeType[];
1182
- multiple?: boolean;
1183
- }
1184
- interface UserAttribute extends BaseAttribute<string> {
1185
- type: "user";
1186
- allowedRoles?: string[];
1187
- multiple?: boolean;
1188
- }
1189
- /**
1190
- * Wildcard marker for universal relations (can link to any object)
1191
- * Use with `.toAny()` builder method
1192
- */
1193
- declare const RELATION_TARGET_ANY: "*";
1194
- /**
1195
- * Configuration for bilateral synchronization (bidirectional relations)
1196
- */
1197
- interface BilateralConfig {
1198
- /** Target object containing the inverse attribute */
1199
- object: string;
1200
- /** Name of the inverse attribute */
1201
- attribute: string;
1202
- /** Optional cardinality override (inferred by default) */
1203
- cardinality?: "one" | "many";
1204
- /** When true, this side owns the storage direction for qualified properties.
1205
- * Set to false on the inverse side (enriched at read time). */
1206
- storageOwner?: boolean;
1207
- }
1208
- /**
1209
- * Target object for a relation - defines which objects can be linked
1210
- */
1211
- interface RelationTarget {
1212
- /** Object name (e.g., "companies", "contacts") or "*" for any object */
1213
- object: string;
1214
- /**
1215
- * Display template for the label using mustache-like syntax
1216
- * @example "{name}" or "{firstName} {lastName} — {email}"
1217
- */
1218
- displayTemplate?: string;
1219
- /**
1220
- * Optional filter to restrict available records
1221
- * @example { status: "active" }
1222
- */
1223
- filter?: Record<string, unknown>;
1224
- }
1225
- /**
1226
- * Base properties shared by both single and multi relation attributes
1227
- *
1228
- * Note: Deletion behavior is always "restrict" - if a record is referenced
1229
- * by other records, it cannot be deleted until those references are removed.
1230
- * This is enforced by RecordService.deleteRecord() which throws
1231
- * RecordReferencedError when attempting to delete a referenced record.
1232
- */
1233
- interface RelationAttributeBase extends Omit<BaseAttribute<unknown>, "defaultValue"> {
1234
- type: "relation";
1235
- /** Target objects that can be linked */
1236
- targets: RelationTarget[];
1237
- /** Optional properties schema for qualified relations */
1238
- properties?: PropertySchema;
1239
- /** Configuration for bilateral synchronization (opt-in) */
1240
- bilateral?: BilateralConfig;
1241
- }
1242
- /**
1243
- * Single relation attribute (one-to-one or many-to-one)
1244
- * Stores a single record ID or null
1245
- */
1246
- interface SingleRelationAttribute extends RelationAttributeBase {
1247
- cardinality: "one";
1248
- defaultValue?: string | null;
1249
- }
1250
- /**
1251
- * Multi relation attribute (one-to-many or many-to-many)
1252
- * Stores an array of record IDs
1253
- */
1254
- interface MultiRelationAttribute extends RelationAttributeBase {
1255
- cardinality: "many";
1256
- defaultValue?: string[];
1257
- /** Minimum number of relations required */
1258
- minItems?: number;
1259
- /** Maximum number of relations allowed */
1260
- maxItems?: number;
1261
- }
1262
- /**
1263
- * RelationAttribute links to other objects/records
1264
- * Discriminated union by cardinality for type-safe value handling
1265
- *
1266
- * @example Single relation (many-to-one)
1267
- * ```typescript
1268
- * relation({ name: "company", label: "Company" })
1269
- * .to("companies")
1270
- * .required()
1271
- * // → Value: "rec-uuid-123" | null
1272
- * ```
1273
- *
1274
- * @example Multi relation (many-to-many)
1275
- * ```typescript
1276
- * relation({ name: "contacts", label: "Contacts" })
1277
- * .to("contacts", { displayTemplate: "{firstName} {lastName}" })
1278
- * .many()
1279
- * .maxItems(5)
1280
- * // → Value: ["rec-1", "rec-2", ...]
1281
- * ```
1282
- *
1283
- * @example Polymorphic relation (multiple target objects)
1284
- * ```typescript
1285
- * relation({ name: "linked", label: "Linked Items" })
1286
- * .to("companies")
1287
- * .to("contacts")
1288
- * .to("deals")
1289
- * .many()
1290
- * // → Can link to records from any of these objects
1291
- * ```
1292
- */
1293
- type RelationAttribute = SingleRelationAttribute | MultiRelationAttribute;
1294
- /**
1295
- * Check if a relation attribute is universal (can link to any object)
1296
- * Universal relations have `targets: [{ object: "*" }]`
1297
- */
1298
- declare function isUniversalRelation(attr: RelationAttribute): boolean;
1299
- /**
1300
- * Check if a relation attribute has bilateral synchronization enabled
1301
- */
1302
- declare function isBilateralRelation(attr: RelationAttribute): attr is RelationAttribute & {
1303
- bilateral: BilateralConfig;
1304
- };
1305
- /**
1306
- * Infer the cardinality of the inverse relation
1307
- * - one → many (contact.company ↔ company.contacts)
1308
- * - many → many (contact.tags ↔ tag.contacts)
1309
- */
1310
- declare function inferInverseCardinality(cardinality: "one" | "many"): "one" | "many";
1311
- interface TextAreaAttribute extends BaseAttribute<string> {
1312
- type: "textarea";
1313
- }
1314
- /**
1315
- * Available features for richtext editor
1316
- */
1317
- type RichtextFeature = "headings" | "bold" | "italic" | "lists" | "links" | "images" | "codeBlocks" | "tables";
1318
- /**
1319
- * RichtextAttribute - Rich text content using semantic markdown
1320
- *
1321
- * Stores content as semantic markdown string (with directives like :::callout).
1322
- * Parsed at runtime to Tiptap JSON for editing.
1323
- * Use this for: Notes, articles, descriptions, long-form content.
1324
- *
1325
- * @example
1326
- * ```typescript
1327
- * richtext({ name: "content", label: "Content" })
1328
- * .features(["headings", "bold", "italic", "lists", "links"])
1329
- * .required()
1330
- * ```
1331
- */
1332
- interface RichtextAttribute extends BaseAttribute<string> {
1333
- type: "richtext";
1334
- /** Enabled features. If undefined, all features are enabled. */
1335
- features?: RichtextFeature[];
1336
- }
1337
- interface RatingAttribute extends BaseAttribute<number> {
1338
- type: "rating";
1339
- max?: number;
1340
- iconType?: "star" | "heart" | "thumbs" | "number";
1341
- }
1342
- /**
1343
- * Return type for formula expressions
1344
- */
1345
- type FormulaReturnType = "text" | "number" | "boolean" | "date";
1346
- /**
1347
- * FormulaAttribute - Computed value based on other attributes
1348
- *
1349
- * Formulas are calculated at read-time and are always read-only.
1350
- * Users cannot directly edit formula values.
1351
- *
1352
- * @example Simple calculation
1353
- * ```typescript
1354
- * formula({ name: "total", label: "Total" })
1355
- * .expression("price * quantity")
1356
- * .returns("number")
1357
- * .decimals(2)
1358
- * ```
1359
- *
1360
- * @example With functions
1361
- * ```typescript
1362
- * formula({ name: "fullName", label: "Full Name" })
1363
- * .expression("CONCAT(firstName, ' ', lastName)")
1364
- * .returns("text")
1365
- * ```
1366
- */
1367
- interface FormulaAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "required"> {
1368
- type: "formula";
1369
- /** Expression to evaluate (e.g., "price * quantity") */
1370
- expression: string;
1371
- /** Expected return type for formatting */
1372
- returnType: FormulaReturnType;
1373
- /** Decimal places for number results */
1374
- decimals?: number;
1375
- /** Whether to allow relation references in the expression (e.g., "company.name") */
1376
- allowRelations?: boolean;
1377
- /** Formula is always not required (read-only) */
1378
- required: false;
1379
- }
1380
- /**
1381
- * Aggregation functions for rollup attributes
1382
- *
1383
- * Categories:
1384
- * - Numeric (sum, avg): Only for number, currency, rating types
1385
- * - Date (earliest, latest): Only for date type
1386
- * - Count (count, countValues, countUniqueValues, countEmpty): Universal
1387
- * - Percent (percentEmpty, percentNotEmpty): Universal
1388
- * - Lookup (original): Returns all values as array, rendered as target type
1389
- */
1390
- type RollupFunction = "sum" | "avg" | "earliest" | "latest" | "count" | "countValues" | "countUniqueValues" | "countEmpty" | "percentEmpty" | "percentNotEmpty" | "original";
1391
- /**
1392
- * RollupAttribute - Aggregates values from related records
1393
- *
1394
- * Rollups are calculated and stored (denormalized) for performance.
1395
- * They are automatically recalculated when related records change.
1396
- * Users cannot directly edit rollup values.
1397
- *
1398
- * @example Sum of related amounts
1399
- * ```typescript
1400
- * rollup({ name: "totalOrders", label: "Total Orders" })
1401
- * .from("orders") // relation attribute name
1402
- * .aggregate("amount") // target attribute to sum
1403
- * .using("sum")
1404
- * .decimals(2)
1405
- * ```
1406
- *
1407
- * @example Count of related records
1408
- * ```typescript
1409
- * rollup({ name: "orderCount", label: "Number of Orders" })
1410
- * .from("orders")
1411
- * .using("count")
1412
- * ```
1413
- */
1414
- interface RollupAttribute extends Omit<BaseAttribute<never>, "defaultValue" | "required"> {
1415
- type: "rollup";
1416
- /** Name of the relation attribute on this object */
1417
- relationAttribute: string;
1418
- /**
1419
- * Dot notation path for multi-level traversal (Phase 4+)
1420
- * @example "orders.items" - traverse through orders to items
1421
- */
1422
- relationPath?: string;
1423
- /** Attribute name on the target object to aggregate */
1424
- targetAttribute: string;
1425
- /** Aggregation function to apply */
1426
- function: RollupFunction;
1427
- /** Decimal places for numeric results */
1428
- decimals?: number;
1429
- /** Rollup is always not required (read-only) */
1430
- required: false;
1431
- /**
1432
- * Cached type of the target attribute for display purposes
1433
- * Used when function="original" to render values as the target type
1434
- */
1435
- targetAttributeType?: AttributeType;
1436
- /**
1437
- * Cached options from target attribute (for select/status/multiselect display)
1438
- * Required when function="original" and target is a select-like type
1439
- */
1440
- targetAttributeOptions?: Option[];
1441
- }
1442
- /**
1443
- * DocumentAttribute - References one or multiple structured documents.
1444
- *
1445
- * Unlike FileAttribute which stores raw file references, DocumentAttribute
1446
- * provides structured document handling with multi-file support and
1447
- * optional agent-compatible processing (for example OCR).
1448
- *
1449
- * Every document attribute is multi by construction — the underlying
1450
- * storage (documents + document_slots + files) supports 1 Doc → N slot
1451
- * files uniformly. Single-value file fields use `file()` instead.
1452
- *
1453
- * @example
1454
- * ```typescript
1455
- * document({ name: "contracts", label: "Contrats" })
1456
- * .autoProcess()
1457
- * .maxDocuments(10)
1458
- * ```
1459
- */
1460
- interface DocumentAttribute extends BaseAttribute<string[]> {
1461
- type: "document";
1462
- /**
1463
- * Maximum number of documents.
1464
- */
1465
- maxDocuments?: number;
1466
- /**
1467
- * Automatically trigger agent-compatible processing on upload.
1468
- */
1469
- autoProcess?: boolean;
1470
- /**
1471
- * Schema for typed properties on the record→document edge.
1472
- * Symmetric with `RelationAttribute.properties`; populated by `.qualifyWith(...)`.
1473
- * Stored on `record_reference_edges.properties`, not on the document itself.
1474
- */
1475
- properties?: PropertySchema;
1476
- /** Child attribute definitions for per-document metadata. */
1477
- attributes?: Attribute[];
1478
- /**
1479
- * File slots declared on this attribute. Builder injects
1480
- * [DEFAULT_DOCUMENT_SLOT] when omitted. Always non-empty in practice.
1481
- */
1482
- slots?: DocumentSlotConfig[];
1483
- }
1484
- type Attribute = TextAttribute | TextAreaAttribute | RichtextAttribute | NumberAttribute | CheckboxAttribute | DateAttribute | PhoneAttribute | CurrencyAttribute | StatusAttribute | LocationAttribute | SelectAttribute | MultiselectAttribute | FileAttribute | UserAttribute | RelationAttribute | RatingAttribute | FormulaAttribute | RollupAttribute | DocumentAttribute;
1485
- /**
1486
- * Check if an attribute supports sorting based on its type.
1487
- */
1488
- declare function isAttributeSortable(attr: {
1489
- type: AttributeType;
1490
- }): boolean;
1491
-
1492
- /** Operators for text-based attributes */
1493
- type TextFilterOperator = "is" | "is_not" | "contains" | "not_contains" | "starts_with" | "ends_with" | "is_empty" | "is_not_empty";
1494
- /** Operators for number-based attributes */
1495
- type NumberFilterOperator = "eq" | "neq" | "lt" | "gt" | "lte" | "gte" | "is_empty" | "is_not_empty";
1496
- /** Operators for checkbox */
1497
- type CheckboxFilterOperator = "is_checked" | "is_not_checked";
1498
- /** Operators for date-based attributes */
1499
- type DateFilterOperator = "is" | "is_not" | "before" | "after" | "on_or_before" | "on_or_after" | "is_within" | "day_month_eq" | "is_empty" | "is_not_empty";
1500
- /** Operators for select-based attributes (supports single or multi-value filtering) */
1501
- type SelectFilterOperator = "is" | "is_not" | "any_of" | "none_of" | "is_empty" | "is_not_empty";
1502
- /** Operators for multiselect-based attributes */
1503
- type MultiselectFilterOperator = "contains" | "not_contains" | "is_empty" | "is_not_empty";
1504
- /**
1505
- * Operators for relation-based attributes (covers single, multi-value, and
1506
- * reference-shaped filtering — file, user, relation, document all share the
1507
- * same edge-backed operator set as of Phase 4.4).
1508
- */
1509
- type RelationFilterOperator = "is" | "is_not" | "any_of" | "none_of" | "contains" | "not_contains" | "is_empty" | "is_not_empty";
1510
- /** All possible filter operators */
1511
- type FilterOperator = TextFilterOperator | NumberFilterOperator | CheckboxFilterOperator | DateFilterOperator | SelectFilterOperator | MultiselectFilterOperator | RelationFilterOperator;
1512
- /** Relative date value for "is_within" operator */
1513
- interface RelativeDateValue {
1514
- amount: number;
1515
- unit: "days" | "weeks" | "months" | "years";
1516
- direction: "past" | "future";
1517
- }
1518
- /** Currency filter value with amount and optional currency codes
1519
- * - code: undefined or [] = any currency
1520
- * - code: string[] = filter by specific currencies
1521
- */
1522
- interface CurrencyFilterValue {
1523
- value: number | null;
1524
- code?: string[];
1525
- }
1526
- /** Phone filter value with number and optional country code */
1527
- interface PhoneFilterValue {
1528
- phoneNumber: string | null;
1529
- countryCode?: string;
1530
- }
1531
- /** Filter value can be various types depending on the attribute */
1532
- type FilterValue = string | number | boolean | string[] | RelativeDateValue | CurrencyFilterValue | PhoneFilterValue | null;
1533
- /** A single filter rule */
1534
- interface FilterRule {
1535
- /** Root attribute name (scalar attribute, or a reference attribute when `property` is set). */
1536
- attribute: string;
1537
- /**
1538
- * If set, this rule filters on a qualified edge property.
1539
- * Requires `attribute` to be a reference attribute (today: `relation` or `document`) that has `.qualifyWith()`.
1540
- * The `operator` must be valid for the property's type, not the root attribute's type.
1541
- */
1542
- property?: string;
1543
- /** Filter operator */
1544
- operator: FilterOperator;
1545
- /** Filter value (null for operators like is_empty) */
1546
- value: FilterValue;
1547
- }
1548
- /**
1549
- * Extended filter rule with optional attribute definition.
1550
- * When provided, enables smarter type-aware filtering (e.g., array operators for multiselect).
1551
- */
1552
- interface ExtendedFilterRule extends FilterRule {
1553
- /** Full attribute definition for type-aware filtering */
1554
- attributeDef?: Attribute;
1555
- }
1556
- /** Combinator for filter rules */
1557
- type FilterCombinator = "and" | "or";
1558
- /** Complete filter state (simple mode) */
1559
- interface FilterState {
1560
- /** How to combine rules */
1561
- combinator: FilterCombinator;
1562
- /** List of filter rules */
1563
- rules: FilterRule[];
1564
- }
1565
- /**
1566
- * A filter group containing rules (used in advanced mode)
1567
- * Groups can be nested up to 2 levels deep
1568
- */
1569
- interface FilterGroup {
1570
- /** Unique identifier for this group */
1571
- id: string;
1572
- /** How to combine rules within this group */
1573
- combinator: FilterCombinator;
1574
- /** List of filter rules in this group */
1575
- rules: FilterRule[];
1576
- }
1577
- /**
1578
- * Advanced filter state with nested groups
1579
- * Structure: AdvancedFilterState -> FilterGroup[] -> FilterRule[]
1580
- * Maximum 2 levels of nesting
1581
- */
1582
- interface AdvancedFilterState {
1583
- /** How to combine groups at the top level */
1584
- combinator: FilterCombinator;
1585
- /** List of filter groups */
1586
- groups: FilterGroup[];
1587
- }
1588
- /** Sort direction */
1589
- type SortDirection = "asc" | "desc";
1590
- /** A single sort rule */
1591
- interface SortRule {
1592
- /** Attribute name to sort by */
1593
- attribute: string;
1594
- /** Sort direction */
1595
- direction: SortDirection;
1596
- }
1597
- /** Complete query state with search, filters, sorts, and pagination */
1598
- interface QueryState {
1599
- /** Full-text search query */
1600
- search?: string;
1601
- /** Filter configuration (simple mode) */
1602
- filters?: FilterState;
1603
- /** Advanced filter configuration (grouped mode) */
1604
- advancedFilters?: AdvancedFilterState;
1605
- /** Sort configuration (multiple sorts supported) */
1606
- sorts?: SortRule[];
1607
- /** Pagination */
1608
- limit?: number;
1609
- offset?: number;
1610
- }
1611
- /** Mapping of attribute types to their valid operators (rollup excluded — use getRollupFilterOperators()) */
1612
- declare const OPERATORS_BY_TYPE: Record<Exclude<AttributeType, "rollup">, readonly FilterOperator[]>;
1613
- /** Check if an operator requires a value */
1614
- type NoValueOperator = "is_empty" | "is_not_empty" | "is_checked" | "is_not_checked";
1615
- /** Operators that don't require a value */
1616
- declare const NO_VALUE_OPERATORS: readonly NoValueOperator[];
1617
- /**
1618
- * Check if an operator requires a value
1619
- */
1620
- declare function isNoValueOperator(operator: FilterOperator): operator is NoValueOperator;
1621
- /**
1622
- * Get the filter operators for a rollup attribute based on its aggregation function and target type.
1623
- *
1624
- * - earliest / latest → date operators
1625
- * - original → operators matching targetAttributeType (falls back to numeric if unknown)
1626
- * - all other functions → numeric operators (sum, avg, count, percent, etc.)
1627
- */
1628
- declare function getRollupFilterOperators(attr: RollupAttribute): readonly FilterOperator[];
1629
-
1630
- export { type FieldGroup as $, type Attribute as A, type Option as B, type CurrencyAttribute as C, type DateAttribute as D, type FormulaReturnType as E, type FileAttribute as F, type BilateralConfig as G, type RelationTarget as H, type RichtextFeature as I, type RollupFunction as J, type MigrationDefinition as K, type LocationAttribute as L, type MultiRelationAttribute as M, type NumberAttribute as N, type ObjectDefinition as O, type PhoneAttribute as P, type DetailViewConfig as Q, type RelationAttribute as R, type SingleRelationAttribute as S, type TextAreaAttribute as T, type UserAttribute as U, type ViewType as V, type DetailViewDefinition as W, type DetailViewLayout as X, type SidePanelConfig as Y, type Field as Z, type AttributeGroupField as _, type RichtextAttribute as a, type ProcessingJobStatus as a$, type RelationGroup as a0, type Group as a1, type TableTab as a2, type CreateMode as a3, type Tab as a4, type ListViewConfig as a5, type ListViewDefinition as a6, type FlagValueType as a7, type FeatureFlagDefinition as a8, type FlagLevel as a9, type DocumentSlot as aA, type DocumentWithSlots as aB, type DocumentWithSubCount as aC, type DocumentsTab as aD, type ExtendedFilterRule as aE, type FeatureFlagsConfig as aF, type FilterCombinator as aG, type FilterGroup as aH, type FlagOverride as aI, type FolderPreset as aJ, type FormDensity as aK, type FormTab as aL, type FormsTab as aM, type InverseSource as aN, type ListViewLayout as aO, MAX_PRESET_DEPTH as aP, type MigrationError as aQ, NO_VALUE_OPERATORS as aR, type NoValueOperator as aS, type NumberUnit as aT, OPERATORS_BY_TYPE as aU, type ObjectAttribute as aV, type ObjectRecord as aW, type OptionPropertyAttribute as aX, type PhoneFilterValue as aY, type PresetNode as aZ, type ProcessingJob as a_, type FeatureFlagsRepository as aa, type StaticFlagDefault as ab, type ResolvedFlag as ac, type ViewDefinition as ad, type ListViewTab as ae, type FilterOperator as af, type FilterValue as ag, type FilterRule as ah, type ActivityTab as ai, type AdvancedFilterState as aj, type AttributeGroup as ak, type BaseAttribute as al, type BuiltInTransform as am, type CreateDocument as an, type CreateDocumentLink as ao, type CreateDocumentSlot as ap, type CreateProcessingJob as aq, type CurrencyFilterValue as ar, type CustomTab as as, DEFAULT_DOCUMENT_SLOT as at, type DateFormat as au, type DateValue as av, type Document as aw, type DocumentKind as ax, type DocumentLayoutVariant as ay, type DocumentListOptions as az, type MultiselectAttribute as b, type ProcessingJobType as b0, type PropertyAttribute as b1, type PropertyType as b2, type QueryState as b3, RELATION_TARGET_ANY as b4, RESERVED_ATTRIBUTE_NAMES as b5, type RecordDocuments as b6, type RelationSource as b7, type RelativeDateValue as b8, type ReservedAttributeName as b9, type RichtextTab as ba, SYSTEM_FIELD_NAMES as bb, type SlotStatus as bc, type SortDirection as bd, type StatusGroup as be, type SystemFieldName as bf, type TabType as bg, type TableSource as bh, type UpdateDocument as bi, type UpdateDocumentSlot as bj, type UpdateProcessingJob as bk, type ViewOperation as bl, type ViewOverlay as bm, type ViewTransform as bn, getRollupFilterOperators as bo, hasOptions as bp, inferInverseCardinality as bq, isAttributeSortable as br, isBilateralRelation as bs, isDetailView as bt, isFieldGroup as bu, isListView as bv, isNoValueOperator as bw, isRelationGroup as bx, isUniversalRelation as by, type SelectAttribute as c, type StatusAttribute as d, type FormulaAttribute as e, type RollupAttribute as f, type CheckboxAttribute as g, type RatingAttribute as h, type TextAttribute as i, type CompletionStatus as j, type SortRule as k, type FilterState as l, type Timestamps as m, type AttributeType as n, type DocumentLayout as o, type ViewConfig as p, type ConfigOverrides as q, type SchemaOperation as r, type LocationGranularity as s, type Location as t, type DocumentAttribute as u, type Phone as v, type Currency as w, type DocumentSlotConfig as x, type PropertySchema as y, type FeatureGate as z };