@stndrds/schema 1.0.0-alpha.100 → 1.0.0-alpha.102

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 (142) hide show
  1. package/dist/{attributes-CH89Z_J-.d.mts → attributes-D7yQuTJK.d.mts} +1 -11
  2. package/dist/{attributes-dw-jLtYS.d.ts → attributes-DcbQC-4b.d.ts} +1 -11
  3. package/dist/chunk-3JINFUN3.js +81 -0
  4. package/dist/{chunk-BZTLI773.mjs → chunk-4KRLCWJM.mjs} +1 -1
  5. package/dist/{chunk-ERG77ADK.mjs → chunk-4TC27SMF.mjs} +1 -1
  6. package/dist/{chunk-OO2LJ6GP.js → chunk-56QI6UTK.js} +4 -4
  7. package/dist/{chunk-PGHTIMRD.mjs → chunk-5JVVPJJW.mjs} +28 -19
  8. package/dist/{chunk-P4NGPF5L.mjs → chunk-5XL3JP73.mjs} +3 -19
  9. package/dist/{chunk-ZJNX6UXB.mjs → chunk-7HFZ7MVR.mjs} +1 -1
  10. package/dist/{chunk-6IFD5732.js → chunk-ACQ3TUFK.js} +2 -2
  11. package/dist/{chunk-FKPYFM6G.mjs → chunk-AYCSVKI2.mjs} +1 -1
  12. package/dist/{chunk-ALV6GETG.mjs → chunk-BLXQGQLK.mjs} +1 -1
  13. package/dist/{chunk-STKN6A5M.js → chunk-D7WFIGXW.js} +2 -2
  14. package/dist/{chunk-E6XO2STS.js → chunk-FRCDMQER.js} +0 -14
  15. package/dist/{chunk-QPDXDX7A.js → chunk-GCRHSPZN.js} +2 -2
  16. package/dist/{chunk-TV4G2KMD.mjs → chunk-IRTRJH37.mjs} +1 -1
  17. package/dist/{chunk-3RFFA4EV.mjs → chunk-ITTQ4FGR.mjs} +1 -1
  18. package/dist/{chunk-FKETRWAF.js → chunk-J5HRK3WD.js} +2 -2
  19. package/dist/{chunk-6MXQAQBB.mjs → chunk-KNYZH2WD.mjs} +1 -1
  20. package/dist/chunk-KWVCGQ7N.mjs +78 -0
  21. package/dist/chunk-MAKSIK3P.js +10 -0
  22. package/dist/{chunk-H3VBSMVW.js → chunk-N7T66JVY.js} +2 -21
  23. package/dist/{chunk-UPEQEX2D.js → chunk-OAQWRMTP.js} +2 -2
  24. package/dist/{chunk-VC4E3OSZ.mjs → chunk-OLJLCVNY.mjs} +1 -1
  25. package/dist/{chunk-ANP6HGMJ.js → chunk-P2BE2A2G.js} +4 -4
  26. package/dist/{chunk-HJNLL34O.js → chunk-QWZHR2OO.js} +2 -2
  27. package/dist/{chunk-XAORXFAX.mjs → chunk-QY6QFRRV.mjs} +1 -12
  28. package/dist/{chunk-CE25ADK5.js → chunk-QYNPB37W.js} +51 -42
  29. package/dist/{chunk-XPFWKISJ.mjs → chunk-R4CJHCC4.mjs} +1 -1
  30. package/dist/{chunk-5CBTJS7J.js → chunk-RJ4LOX7P.js} +2 -2
  31. package/dist/{chunk-C7KW4NAD.js → chunk-ROAZLZA2.js} +2 -2
  32. package/dist/{chunk-4IVCBFJA.mjs → chunk-RUYUFXNW.mjs} +1 -1
  33. package/dist/{chunk-PZT3CIHD.mjs → chunk-SS2NR6DH.mjs} +2 -18
  34. package/dist/{chunk-5SQEKHPW.js → chunk-T225DB55.js} +7 -52
  35. package/dist/{chunk-ATA4XHB4.js → chunk-TKN73433.js} +2 -2
  36. package/dist/{chunk-2LUHLHLE.mjs → chunk-TMYBEXBT.mjs} +1 -1
  37. package/dist/{chunk-JEDANRCG.mjs → chunk-UQVW4KPP.mjs} +7 -51
  38. package/dist/{chunk-IMEPIVTR.js → chunk-V6DE3MXC.js} +1 -38
  39. package/dist/{chunk-KC2FFNL4.js → chunk-VXOTYFEW.js} +2 -2
  40. package/dist/{chunk-RDGBQM3N.mjs → chunk-WV4V64D5.mjs} +1 -1
  41. package/dist/helpers-DD6JzYfI.d.mts +860 -0
  42. package/dist/helpers-kMS5R7KX.d.ts +860 -0
  43. package/dist/index.d.mts +717 -2804
  44. package/dist/index.d.ts +717 -2804
  45. package/dist/index.js +2055 -3922
  46. package/dist/index.mjs +2467 -3985
  47. package/dist/{types-Ms3HtAmo.d.mts → types-BAPgWlpX.d.mts} +1 -1
  48. package/dist/{types-D-0QbsA9.d.ts → types-mZPUEZl0.d.ts} +1 -1
  49. package/dist/utils.d.mts +1 -55
  50. package/dist/utils.d.ts +1 -55
  51. package/dist/utils.js +6 -18
  52. package/dist/utils.mjs +1 -1
  53. package/dist/validation/all.d.mts +5 -20
  54. package/dist/validation/all.d.ts +5 -20
  55. package/dist/validation/all.js +29 -238
  56. package/dist/validation/all.mjs +19 -20
  57. package/dist/validation/complex/currency.d.mts +2 -2
  58. package/dist/validation/complex/currency.d.ts +2 -2
  59. package/dist/validation/complex/currency.js +3 -4
  60. package/dist/validation/complex/currency.mjs +2 -3
  61. package/dist/validation/complex/file.d.mts +2 -2
  62. package/dist/validation/complex/file.d.ts +2 -2
  63. package/dist/validation/complex/file.js +3 -4
  64. package/dist/validation/complex/file.mjs +2 -3
  65. package/dist/validation/complex/location.d.mts +2 -2
  66. package/dist/validation/complex/location.d.ts +2 -2
  67. package/dist/validation/complex/location.js +3 -4
  68. package/dist/validation/complex/location.mjs +2 -3
  69. package/dist/validation/complex/phone.d.mts +2 -2
  70. package/dist/validation/complex/phone.d.ts +2 -2
  71. package/dist/validation/complex/phone.js +3 -4
  72. package/dist/validation/complex/phone.mjs +2 -3
  73. package/dist/validation/complex/relation.d.mts +2 -2
  74. package/dist/validation/complex/relation.d.ts +2 -2
  75. package/dist/validation/complex/relation.js +5 -6
  76. package/dist/validation/complex/relation.mjs +2 -3
  77. package/dist/validation/complex/richtext.d.mts +2 -2
  78. package/dist/validation/complex/richtext.d.ts +2 -2
  79. package/dist/validation/complex/richtext.js +3 -4
  80. package/dist/validation/complex/richtext.mjs +2 -3
  81. package/dist/validation/complex/select.d.mts +2 -2
  82. package/dist/validation/complex/select.d.ts +2 -2
  83. package/dist/validation/complex/select.js +5 -6
  84. package/dist/validation/complex/select.mjs +2 -3
  85. package/dist/validation/complex/user.d.mts +2 -2
  86. package/dist/validation/complex/user.d.ts +2 -2
  87. package/dist/validation/complex/user.js +3 -4
  88. package/dist/validation/complex/user.mjs +2 -3
  89. package/dist/validation/computed/formula.d.mts +2 -2
  90. package/dist/validation/computed/formula.d.ts +2 -2
  91. package/dist/validation/computed/formula.js +3 -4
  92. package/dist/validation/computed/formula.mjs +2 -3
  93. package/dist/validation/computed/rollup.d.mts +2 -2
  94. package/dist/validation/computed/rollup.d.ts +2 -2
  95. package/dist/validation/computed/rollup.js +3 -4
  96. package/dist/validation/computed/rollup.mjs +2 -3
  97. package/dist/validation/config/index.d.mts +2 -403
  98. package/dist/validation/config/index.d.ts +2 -403
  99. package/dist/validation/config/index.js +4 -89
  100. package/dist/validation/config/index.mjs +1 -2
  101. package/dist/validation/core/index.d.mts +4 -53
  102. package/dist/validation/core/index.d.ts +4 -53
  103. package/dist/validation/core/index.js +3 -12
  104. package/dist/validation/core/index.mjs +1 -2
  105. package/dist/validation/object/index.d.mts +29 -4
  106. package/dist/validation/object/index.d.ts +29 -4
  107. package/dist/validation/object/index.js +29 -30
  108. package/dist/validation/object/index.mjs +17 -18
  109. package/dist/validation/primitives/checkbox.d.mts +2 -2
  110. package/dist/validation/primitives/checkbox.d.ts +2 -2
  111. package/dist/validation/primitives/checkbox.js +3 -4
  112. package/dist/validation/primitives/checkbox.mjs +2 -3
  113. package/dist/validation/primitives/date.d.mts +2 -2
  114. package/dist/validation/primitives/date.d.ts +2 -2
  115. package/dist/validation/primitives/date.js +3 -4
  116. package/dist/validation/primitives/date.mjs +2 -3
  117. package/dist/validation/primitives/number.d.mts +2 -2
  118. package/dist/validation/primitives/number.d.ts +2 -2
  119. package/dist/validation/primitives/number.js +3 -4
  120. package/dist/validation/primitives/number.mjs +2 -3
  121. package/dist/validation/primitives/rating.d.mts +2 -2
  122. package/dist/validation/primitives/rating.d.ts +2 -2
  123. package/dist/validation/primitives/rating.js +3 -4
  124. package/dist/validation/primitives/rating.mjs +2 -3
  125. package/dist/validation/primitives/text.d.mts +2 -2
  126. package/dist/validation/primitives/text.d.ts +2 -2
  127. package/dist/validation/primitives/text.js +4 -5
  128. package/dist/validation/primitives/text.mjs +2 -3
  129. package/package.json +2 -3
  130. package/dist/chunk-4DMDOSFN.js +0 -10
  131. package/dist/chunk-7FSIBNRH.mjs +0 -25
  132. package/dist/chunk-BEN6TE7Y.js +0 -11
  133. package/dist/chunk-RDXQ4CYT.mjs +0 -9
  134. package/dist/chunk-ZWMMEQI7.js +0 -28
  135. package/dist/index-CftmKoRP.d.mts +0 -2053
  136. package/dist/index-Dh_XiNFt.d.ts +0 -2053
  137. package/dist/validation/validators.d.mts +0 -23
  138. package/dist/validation/validators.d.ts +0 -23
  139. package/dist/validation/validators.js +0 -265
  140. package/dist/validation/validators.mjs +0 -20
  141. /package/dist/{chunk-R6JFUC32.js → chunk-PGERPYDR.js} +0 -0
  142. /package/dist/{chunk-EKG35CSO.mjs → chunk-SP3PNHYF.mjs} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,32 +1,16 @@
1
- import { S as SortRule, F as FilterState, W as WorkflowNode, l as FormNode, m as WorkflowNodeType, T as Timestamps, R as RelationFieldConfig, n as FlowHeadingRow, o as FlowSeparatorRow, p as FlowTextRow, q as FlowRelationListRow, r as WorkflowSlot, s as WorkflowTheme, t as RelationBufferMap, V as ViewType, u as ViewConfig, C as ConfigOverrides, w as WorkflowStatus, x as WorkflowLayout, y as WorkflowConfig, z as WorkflowDefinition, I as InstanceStatus, A as WorkflowExecutionContext, B as WorkflowTransition, P as PendingAction, D as CompletionStatus, O as ObjectRecord, M as MigrationDefinition, E as ObjectDefinition, G as DetailViewConfig, H as DetailViewDefinition, J as DetailViewLayout, K as SidePanelConfig, L as Field, N as AttributeGroupField, Q as FieldGroup, U as RelationGroup, X as Group, Y as TableTab, Z as CreateMode, _ as Tab, $ as ListViewConfig, a0 as ListViewDefinition, a1 as SlotMode, a2 as FlowFieldsRow, a3 as ConditionGroup, a4 as ConditionRule, a5 as ViewDefinition, a6 as ListViewTab } from './index-CftmKoRP.mjs';
2
- export { a7 as ActivityTab, a8 as AdvancedFilterState, a9 as BufferedRecord, aa as BuiltInTransform, ab as CalendarViewConfig, ac as CalendarViewDefinition, ad as CanvasViewport, ae as CheckboxFilterOperator, af as ConditionNode, ag as ConditionOperator, ah as CurrencyFilterValue, ai as CustomTab, aj as DEFAULT_RETENTION_POLICY, ak as DEFAULT_THEME, al as DateFilterOperator, am as DisplayRecord, an as DocumentsTab, ao as EndNode, ap as ExtendedFilterRule, aq as FilterCombinator, ar as FilterGroup, as as FilterOperator, at as FilterRule, au as FilterValue, av as FlowDefinition, aw as FlowPage, ax as FlowRelation, ay as FlowRow, az as FlowRowField, aA as FlowRowType, aB as FlowSlot, aC as FlowStatus, aD as FlowsTab, aE as FormDensity, aF as FormFieldRef, aG as FormTab, aH as GalleryViewConfig, aI as GalleryViewDefinition, aJ as GeneratedDocument, aK as InverseSource, aL as ListViewLayout, aM as MigrationError, aN as MigrationPreview, aO as MultiselectFilterOperator, aP as NO_VALUE_OPERATORS, aQ as NoValueOperator, aR as NodePosition, aS as NumberFilterOperator, aT as OPERATORS_BY_TYPE, aU as ObjectAttribute, aV as PhoneFilterValue, aW as QueryState, aX as RESERVED_ATTRIBUTE_NAMES, aY as RecordPatch, aZ as RelationBuffer, a_ as RelationFilterOperator, a$ as RelationQualifierPatch, b0 as RelationSource, b1 as RelativeDateValue, b2 as ReservedAttributeName, b3 as RetentionPolicy, b4 as RichtextTab, b5 as SYSTEM_FIELD_NAMES, b6 as SchemaOperation, b7 as SchemaTransform, b8 as SelectFilterOperator, b9 as SortDirection, ba as StartNode, bb as SystemFieldName, bc as TabType, bd as TableSource, be as TextFilterOperator, bf as ThemeColors, bg as ThemeLogo, bh as ThemeTypography, bi as TimelineViewConfig, bj as TimelineViewDefinition, bk as TransformSource, bl as ViewOperation, bm as ViewOverlay, bn as ViewTransform, bo as WorkflowError, bp as WorkflowInstance, bq as and, br as canResumeInstance, c as computeRecordStatus, a as createAttributeValidator, b as createDraftValidator, bs as createEmptyContext, d as createFormAttributeValidator, e as createObjectValidator, bt as createStartTransition, bu as eq, bv as generateCssVariables, bw as getContextValue, g as getMissingRequiredAttributes, bx as getRollupFilterOperators, by as inValues, bz as isActivityTab, bA as isAdvancedFormNode, bB as isCalendarView, bC as isConditionGroup, bD as isConditionNode, bE as isConditionRule, bF as isCustomTab, bG as isDetailView, bH as isDocumentsTab, bI as isEmpty, bJ as isEndNode, bK as isFieldGroup, bL as isFlowDefinition, bM as isFlowFieldsRow, bN as isFlowPublished, bO as isFlowRelationListRow, bP as isFlowsTab, bQ as isFormNode, bR as isFormTab, bS as isGalleryView, bT as isInstanceTerminal, bU as isInstanceWaiting, bV as isInverseSourceTab, bW as isLayoutRow, bX as isListView, bY as isNoValueOperator, i as isRecordComplete, bZ as isRelationGroup, b_ as isRelationSourceTab, b$ as isRichtextTab, c0 as isSimpleFormNode, c1 as isStartNode, c2 as isSystemFlow, c3 as isSystemWorkflow, c4 as isTableTab, c5 as isTimelineView, c6 as isWorkflowDefinition, c7 as isWorkflowPublished, c8 as mergeWithDefaults, c9 as neq, ca as or, cb as setContextValue, v as validateAttribute, f as validateDraft, h as validateDraftOrThrow, j as validateObject, k as validateObjectOrThrow } from './index-CftmKoRP.mjs';
3
- import { A as Attribute, j as AttributeType, k as LocationGranularity, l as Location, e as FormulaAttribute, f as RollupAttribute, d as StatusAttribute, c as SelectAttribute, b as MultiselectAttribute, m as Phone, n as Currency, D as DateAttribute, U as UserAttribute, o as DocumentAttribute, p as FeatureGate, i as TextAttribute, T as TextAreaAttribute, a as RichtextAttribute, q as RichtextFeature, N as NumberAttribute, g as CheckboxAttribute, P as PhoneAttribute, C as CurrencyAttribute, O as Option, L as LocationAttribute, F as FileAttribute, R as RelationAttribute, h as RatingAttribute, B as BilateralConfig, S as SingleRelationAttribute, M as MultiRelationAttribute, r as RelationTarget, s as FormulaReturnType, t as RollupFunction, u as FlagValueType, v as FeatureFlagDefinition, w as FlagLevel, x as FeatureFlagsRepository, y as StaticFlagDefault, z as ResolvedFlag } from './attributes-CH89Z_J-.mjs';
4
- export { E as AttributeGroup, G as BaseAttribute, H as DateFormat, I as DateValue, J as FORBIDDEN_PROPERTY_TYPES, K as FeatureFlagsConfig, Q as FlagOverride, V as ForbiddenPropertyType, W as NON_SORTABLE_TYPES, X as NumberUnit, Y as OptionPropertyAttribute, Z as PropertyAttribute, _ as PropertySchema, $ as PropertyType, a0 as RELATION_TARGET_ANY, a1 as StatusGroup, a2 as hasOptions, a3 as inferInverseCardinality, a4 as isAttributeSortable, a5 as isBilateralRelation, a6 as isUniversalRelation } from './attributes-CH89Z_J-.mjs';
5
- import { MimeType, IconName, CountryIso3, CurrencyCode, ColorId } from '@stndrds/constants';
1
+ import { S as SortRule, F as FilterState, T as Timestamps, V as ViewType, j as ViewConfig, C as ConfigOverrides, k as CompletionStatus, l as ObjectRecord, M as MigrationDefinition, O as ObjectDefinition, D as DetailViewConfig, m as DetailViewDefinition, n as DetailViewLayout, o as SidePanelConfig, p as Field, A as AttributeGroupField, q as FieldGroup, R as RelationGroup, G as Group, r as TableTab, s as CreateMode, t as Tab, L as ListViewConfig, u as ListViewDefinition, w as ViewDefinition, x as ListViewTab } from './helpers-DD6JzYfI.mjs';
2
+ export { y as ActivityTab, z as AdvancedFilterState, B as BuiltInTransform, E as CurrencyFilterValue, H as CustomTab, I as DocumentsTab, J as ExtendedFilterRule, K as FilterCombinator, N as FilterGroup, P as FilterOperator, Q as FilterRule, U as FilterValue, W as FormDensity, X as FormTab, Y as FormsTab, Z as InverseSource, _ as ListViewLayout, $ as MigrationError, a0 as NO_VALUE_OPERATORS, a1 as NoValueOperator, a2 as OPERATORS_BY_TYPE, a3 as ObjectAttribute, a4 as PhoneFilterValue, a5 as QueryState, a6 as RESERVED_ATTRIBUTE_NAMES, a7 as RelationSource, a8 as RelativeDateValue, a9 as ReservedAttributeName, aa as RichtextTab, ab as SYSTEM_FIELD_NAMES, ac as SchemaOperation, ad as SchemaTransform, ae as SortDirection, af as SystemFieldName, ag as TabType, ah as TableSource, ai as TransformSource, aj as ViewOperation, ak as ViewOverlay, al as ViewTransform, c as computeRecordStatus, a as createFormAttributeValidator, am as getRollupFilterOperators, an as isDetailView, ao as isFieldGroup, ap as isListView, aq as isNoValueOperator, ar as isRelationGroup, v as validateDraftOrThrow, b as validateObject, d as validateObjectOrThrow } from './helpers-DD6JzYfI.mjs';
3
+ import { j as AttributeType, A as Attribute, k as LocationGranularity, l as Location, e as FormulaAttribute, f as RollupAttribute, d as StatusAttribute, c as SelectAttribute, b as MultiselectAttribute, m as Phone, n as Currency, D as DateAttribute, U as UserAttribute, o as DocumentAttribute, p as FeatureGate, g as CheckboxAttribute, C as CurrencyAttribute, F as FileAttribute, q as FormulaReturnType, L as LocationAttribute, O as Option, N as NumberAttribute, P as PhoneAttribute, h as RatingAttribute, R as RelationAttribute, i as TextAttribute, T as TextAreaAttribute, B as BilateralConfig, S as SingleRelationAttribute, M as MultiRelationAttribute, r as RelationTarget, a as RichtextAttribute, s as RichtextFeature, t as RollupFunction, u as FlagValueType, v as FeatureFlagDefinition, w as FlagLevel, x as FeatureFlagsRepository, y as StaticFlagDefault, z as ResolvedFlag } from './attributes-D7yQuTJK.mjs';
4
+ export { E as AttributeGroup, G as BaseAttribute, H as DateFormat, I as DateValue, J as FeatureFlagsConfig, K as FlagOverride, Q as NumberUnit, V as OptionPropertyAttribute, W as PropertyAttribute, X as PropertySchema, Y as PropertyType, Z as RELATION_TARGET_ANY, _ as StatusGroup, $ as hasOptions, a0 as inferInverseCardinality, a1 as isAttributeSortable, a2 as isBilateralRelation, a3 as isUniversalRelation } from './attributes-D7yQuTJK.mjs';
5
+ import { MimeType, IconName, ColorId, CountryIso3, CurrencyCode } from '@stndrds/constants';
6
6
  import { Uuid, TenantId } from './utils.mjs';
7
- export { UserId, asTenantId, asUserId, deepEqual, generateId, generatePrefixedId, generateTemplateName, indexBy, slugify } from './utils.mjs';
8
- import z$1, { z } from 'zod';
7
+ export { UserId, asTenantId, asUserId, deepEqual, generateId, indexBy } from './utils.mjs';
9
8
  import { StandardSchemaV1 } from '@standard-schema/spec';
10
9
  export { StandardSchemaV1 } from '@standard-schema/spec';
11
- export { V as ValidationMessages, a as ValidationResult } from './types-Ms3HtAmo.mjs';
12
- export { DEFAULT_VALIDATION_MESSAGES, createRegexCache, formatZodErrors, getCachedRegex } from './validation/core/index.mjs';
13
- export { createTextAreaValidator, createTextValidator } from './validation/primitives/text.mjs';
14
- export { createNumberValidator } from './validation/primitives/number.mjs';
15
- export { createCheckboxValidator } from './validation/primitives/checkbox.mjs';
16
- export { createDateValidator } from './validation/primitives/date.mjs';
17
- export { createRatingValidator } from './validation/primitives/rating.mjs';
18
- export { createPhoneValidator } from './validation/complex/phone.mjs';
19
- export { createCurrencyValidator } from './validation/complex/currency.mjs';
20
- export { createLocationValidator } from './validation/complex/location.mjs';
21
- export { createRichtextValidator } from './validation/complex/richtext.mjs';
22
- export { createMultiselectValidator, createSelectValidator, createStatusValidator } from './validation/complex/select.mjs';
23
- export { createFileValidator } from './validation/complex/file.mjs';
24
- export { createUserValidator } from './validation/complex/user.mjs';
25
- export { createMultiRelationValidator, createRelationValidator, createSingleRelationValidator } from './validation/complex/relation.mjs';
26
- export { createFormulaValidator } from './validation/computed/formula.mjs';
27
- export { createRollupValidator } from './validation/computed/rollup.mjs';
28
- export { attributeConfigSchemas, checkboxConfigSchema, currencyConfigSchema, dateConfigSchema, documentConfigSchema, fileConfigSchema, formulaConfigSchema, getAttributeConfigSchema, locationConfigSchema, multiselectConfigSchema, numberConfigSchema, parseAttributeConfig, phoneConfigSchema, ratingConfigSchema, relationConfigSchema, richtextConfigSchema, rollupConfigSchema, safeParseAttributeConfig, selectConfigSchema, statusConfigSchema, textConfigSchema, textareaConfigSchema, userConfigSchema, validateAttributeConfig } from './validation/config/index.mjs';
29
- import { JSONSchema7 } from 'json-schema';
10
+ import z from 'zod';
11
+ export { V as ValidationMessages } from './types-BAPgWlpX.mjs';
12
+ export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './validation/core/index.mjs';
13
+ export { parseAttributeConfig } from './validation/config/index.mjs';
30
14
 
31
15
  /**
32
16
  * Generic list options for pagination and sorting
@@ -34,10 +18,6 @@ import { JSONSchema7 } from 'json-schema';
34
18
  interface ListOptions {
35
19
  limit?: number;
36
20
  offset?: number;
37
- /** @deprecated Use sorts instead */
38
- orderBy?: string;
39
- /** @deprecated Use sorts instead */
40
- orderDirection?: "asc" | "desc";
41
21
  /** Multiple sort rules */
42
22
  sorts?: SortRule[];
43
23
  /** Filter state */
@@ -56,65 +36,6 @@ interface ListOptions {
56
36
  include?: string[];
57
37
  }
58
38
 
59
- /**
60
- * Structural definition for a workflow node type.
61
- * Centralizes all type-specific behavior (outputs, slots, validation).
62
- */
63
- interface NodeTypeDefinition<T extends WorkflowNode = WorkflowNode> {
64
- /** Node type identifier (discriminant) */
65
- type: T["type"];
66
- /** Whether this node has a single linear `next` output */
67
- isLinear: boolean;
68
- /** Whether this node is structural (start/end) vs action (form/condition/document) */
69
- structural: boolean;
70
- /** Get all output node IDs (for graph traversal) */
71
- getOutputs(node: T): string[];
72
- /** Set the next target for linear nodes (throws for non-linear) */
73
- setNext(node: T, targetId: string | null): T;
74
- /** Get all slot IDs referenced by this node */
75
- getSlotIds(node: T): string[];
76
- /** Validate node structure, return error messages */
77
- validate(node: T): string[];
78
- }
79
- declare class NodeTypeRegistryImpl {
80
- private definitions;
81
- register<T extends WorkflowNode>(definition: NodeTypeDefinition<T>): void;
82
- get(type: string): NodeTypeDefinition;
83
- has(type: string): boolean;
84
- getAll(): NodeTypeDefinition[];
85
- getActionTypes(): WorkflowNodeType[];
86
- }
87
- declare const nodeTypeRegistry: NodeTypeRegistryImpl;
88
- /**
89
- * Get the output node IDs from a node (for graph traversal).
90
- * Delegates to the registered node type definition.
91
- */
92
- declare function getNodeOutputs(node: WorkflowNode): string[];
93
- /**
94
- * Set the next target for a linear node.
95
- * Throws for non-linear nodes (condition, end).
96
- */
97
- declare function setNodeNext(node: WorkflowNode, targetId: string | null): WorkflowNode;
98
- /**
99
- * Get all slot IDs referenced by a node.
100
- * For form nodes: extracts from fields/rows.
101
- * For document nodes: returns targetSlotIds.
102
- * For other nodes: returns [].
103
- */
104
- declare function getNodeSlotIds(node: WorkflowNode): string[];
105
- /**
106
- * Validate a node's structure and return error messages.
107
- */
108
- declare function validateNode(node: WorkflowNode): string[];
109
- /**
110
- * Extract all field references (slotId + attribute pairs) from a FormNode.
111
- * Works with both simple mode (fields) and advanced mode (rows).
112
- */
113
- declare function getFormFieldRefs(node: FormNode): Array<{
114
- slotId: string;
115
- attribute: string;
116
- }>;
117
-
118
39
  /**
119
40
  * Storage provider type
120
41
  */
@@ -252,1140 +173,6 @@ interface UpdateFile {
252
173
  allowedUsers?: Uuid[];
253
174
  }
254
175
 
255
- declare function registerBuiltInNodeTypes(): void;
256
-
257
- /**
258
- * Status of a workflow invitation
259
- */
260
- type InvitationStatus = "pending" | "accepted" | "expired" | "revoked";
261
- /**
262
- * Represents an invitation to access a workflow instance.
263
- *
264
- * When an admin wants to share a workflow with an external user,
265
- * they create an invitation. The invitation generates a magic link
266
- * that the user clicks to get an access grant.
267
- *
268
- * @example
269
- * ```typescript
270
- * const invitation: WorkflowInvitation = {
271
- * id: "inv_123",
272
- * instanceId: "inst_456",
273
- * recipientEmail: "client@example.com",
274
- * recipientName: "John Doe",
275
- * status: "pending",
276
- * createdBy: "user_789",
277
- * createdAt: new Date(),
278
- * expiresAt: new Date("2024-02-15")
279
- * };
280
- * ```
281
- */
282
- interface WorkflowInvitation {
283
- /** Unique invitation ID */
284
- id: Uuid;
285
- /** ID of the workflow instance */
286
- instanceId: Uuid;
287
- /** Recipient's email */
288
- recipientEmail: string;
289
- /** Recipient's display name */
290
- recipientName?: string;
291
- /** Current invitation status */
292
- status: InvitationStatus;
293
- /** ID of the user who created the invitation */
294
- createdBy: string;
295
- /** When the invitation was created */
296
- createdAt: Date;
297
- /** When the invitation was accepted */
298
- acceptedAt?: Date;
299
- /** When the invitation expires */
300
- expiresAt: Date;
301
- }
302
- /**
303
- * Input for creating a workflow invitation
304
- */
305
- interface CreateInvitationInput {
306
- /** Workflow instance ID */
307
- instanceId: string;
308
- /** Recipient email */
309
- recipientEmail: string;
310
- /** Recipient name (optional) */
311
- recipientName?: string;
312
- /** Expiration in days (default: 7) */
313
- expiresInDays?: number;
314
- /** Whether to send notification email */
315
- sendEmail?: boolean;
316
- }
317
- /**
318
- * Result of creating a workflow invitation
319
- */
320
- interface CreateInvitationResult {
321
- /** The created invitation */
322
- invitation: WorkflowInvitation;
323
- /** Full magic link URL to access the workflow */
324
- magicLink: string;
325
- }
326
- /**
327
- * Check if invitation is still valid (not expired, not revoked)
328
- */
329
- declare function isInvitationValid(invitation: WorkflowInvitation): boolean;
330
- /**
331
- * Check if invitation has been accepted
332
- */
333
- declare function isInvitationAccepted(invitation: WorkflowInvitation): boolean;
334
- /**
335
- * Check if invitation has expired
336
- */
337
- declare function isInvitationExpired(invitation: WorkflowInvitation): boolean;
338
-
339
- /**
340
- * Represents an access grant to a workflow instance.
341
- *
342
- * A grant is created after a user successfully authenticates via magic link.
343
- * It allows them to access the workflow forms with JWT access tokens.
344
- *
345
- * The grant can be revoked entirely (revokedAt) or individual tokens
346
- * can be revoked via the revokedTokenJtis array.
347
- *
348
- * @example
349
- * ```typescript
350
- * const grant: WorkflowAccessGrant = {
351
- * id: "grant_123",
352
- * invitationId: "inv_456",
353
- * instanceId: "inst_789",
354
- * grantedTo: "client@example.com",
355
- * scope: ["*"],
356
- * revokedTokenJtis: [],
357
- * validUntil: new Date("2024-03-15"),
358
- * createdAt: new Date()
359
- * };
360
- * ```
361
- */
362
- interface WorkflowAccessGrant {
363
- /** Unique grant ID */
364
- id: Uuid;
365
- /** ID of the invitation that created this grant */
366
- invitationId: Uuid;
367
- /** ID of the workflow instance */
368
- instanceId: Uuid;
369
- /** Email of the user who has access */
370
- grantedTo: string;
371
- /** Scope of access: ["*"] for full access, or ["node:xyz"] for specific nodes */
372
- scope: string[];
373
- /** Array of JWT IDs (jti) that have been revoked */
374
- revokedTokenJtis: string[];
375
- /** When the entire grant was revoked (null if active) */
376
- revokedAt?: Date;
377
- /** When this grant expires */
378
- validUntil: Date;
379
- /** When the grant was created */
380
- createdAt: Date;
381
- /** Last time the grant was used */
382
- lastUsedAt?: Date;
383
- }
384
- /**
385
- * Input for creating an access grant
386
- */
387
- interface CreateGrantInput {
388
- /** Invitation ID that originated this grant */
389
- invitationId: string;
390
- /** Instance ID to grant access to */
391
- instanceId: string;
392
- /** Email of the user getting access */
393
- grantedTo: string;
394
- /** Scope of access (default: ["*"]) */
395
- scope?: string[];
396
- /** Validity in days (default: 30) */
397
- validDays?: number;
398
- }
399
- /**
400
- * Check if grant is still valid (not revoked, not expired)
401
- */
402
- declare function isGrantValid(grant: WorkflowAccessGrant): boolean;
403
- /**
404
- * Check if grant has been revoked
405
- */
406
- declare function isGrantRevoked(grant: WorkflowAccessGrant): boolean;
407
- /**
408
- * Check if a specific token has been revoked
409
- */
410
- declare function isTokenRevoked(grant: WorkflowAccessGrant, jti: string): boolean;
411
- /**
412
- * Check if grant has expired
413
- */
414
- declare function isGrantExpired(grant: WorkflowAccessGrant): boolean;
415
- /**
416
- * Check if scope allows access to a specific node
417
- */
418
- declare function canAccessNode(grant: WorkflowAccessGrant, nodeId: string): boolean;
419
-
420
- /**
421
- * Workflow access mode - determines how the user is authenticated
422
- * and what permissions they have.
423
- */
424
- type WorkflowAccessMode = {
425
- type: "internal";
426
- userId: string;
427
- } | {
428
- type: "external";
429
- token: string;
430
- grantId: string;
431
- };
432
- /**
433
- * Reason why a field is read-only
434
- */
435
- type ReadOnlyReason = "user_field" | "computed" | "system";
436
- /**
437
- * Context for a single form field.
438
- * Contains schema, current value, and access information.
439
- */
440
- interface FormFieldContext {
441
- /** Slot ID this field belongs to */
442
- slotId: string;
443
- /** Attribute name */
444
- attributeName: string;
445
- /** Full attribute schema */
446
- schema: Attribute;
447
- /** Current value (from slot) */
448
- value: unknown;
449
- /** Is this field read-only for the current access mode? */
450
- readOnly: boolean;
451
- /** Reason for read-only (if applicable) */
452
- readOnlyReason?: ReadOnlyReason;
453
- /** Override label (from FlowRowField.label) */
454
- labelOverride?: string;
455
- /** Override tooltip/description (from FlowRowField.tooltip) */
456
- tooltipOverride?: string;
457
- /** Relation-specific configuration from workflow builder */
458
- relationConfig?: RelationFieldConfig;
459
- }
460
- /**
461
- * Standard row of form fields
462
- */
463
- interface FormFieldsRow {
464
- /** Row ID from the workflow definition */
465
- id: string;
466
- /** Row type (optional for backward compat) */
467
- type?: "fields";
468
- /** Fields in this row */
469
- fields: FormFieldContext[];
470
- }
471
- /**
472
- * Union of all form row types.
473
- * Backward-compatible: rows without `type` are treated as field rows.
474
- * Layout rows (heading, separator, text) are shared with FlowRow types.
475
- */
476
- type FormFieldRow = FormFieldsRow | FlowHeadingRow | FlowSeparatorRow | FlowTextRow | FlowRelationListRow;
477
- /** Check if a form row contains fields */
478
- declare function isFormFieldsRow(row: FormFieldRow): row is FormFieldsRow;
479
- /**
480
- * Form node information
481
- */
482
- interface FormNodeInfo {
483
- /** Node ID */
484
- id: string;
485
- /** Display label */
486
- label: string;
487
- /** Optional description */
488
- description?: string;
489
- }
490
- /**
491
- * Complete form context response.
492
- * Contains all information needed to render a workflow form.
493
- */
494
- interface FormContextResponse {
495
- /** Form node definition */
496
- node: FormNodeInfo;
497
- /** Structured rows with their fields (preserves layout from workflow) */
498
- rows: FormFieldRow[];
499
- /** Flat list of all fields (for backward compatibility) */
500
- fields: FormFieldContext[];
501
- /** Current slot values */
502
- slotValues: Record<string, Record<string, unknown>>;
503
- /** Slot definitions for displaying slot labels and colors */
504
- slots: WorkflowSlot[];
505
- /** Workflow theme for styling */
506
- theme?: WorkflowTheme;
507
- /** Access mode for the current user */
508
- accessMode: "internal" | "external";
509
- /** Preloaded relation buffers, indexed by slot ID then relation name */
510
- relationBuffers?: Record<string, RelationBufferMap>;
511
- }
512
-
513
- /**
514
- * Base event interface with common properties
515
- */
516
- interface BaseWorkflowEvent {
517
- /** Timestamp when the event occurred */
518
- timestamp: Date;
519
- /** Tenant ID for multi-tenant systems */
520
- tenantId: string;
521
- }
522
- /**
523
- * Event fired when a workflow instance is started
524
- */
525
- interface WorkflowInstanceStartedEvent extends BaseWorkflowEvent {
526
- type: "workflow.instance.started";
527
- /** ID of the workflow instance */
528
- instanceId: string;
529
- /** ID of the workflow definition */
530
- workflowId: string;
531
- /** Name of the workflow */
532
- workflowName: string;
533
- /** ID of the user who started the workflow */
534
- startedBy: string;
535
- }
536
- /**
537
- * Event fired when a workflow instance completes successfully
538
- */
539
- interface WorkflowInstanceCompletedEvent extends BaseWorkflowEvent {
540
- type: "workflow.instance.completed";
541
- /** ID of the workflow instance */
542
- instanceId: string;
543
- /** Final status from the end node */
544
- status: string;
545
- /** Duration of the workflow execution in milliseconds */
546
- durationMs: number;
547
- }
548
- /**
549
- * Event fired when a workflow instance fails
550
- */
551
- interface WorkflowInstanceFailedEvent extends BaseWorkflowEvent {
552
- type: "workflow.instance.failed";
553
- /** ID of the workflow instance */
554
- instanceId: string;
555
- /** Error code */
556
- errorCode: string;
557
- /** Error message */
558
- error: string;
559
- /** ID of the node where failure occurred */
560
- failedNodeId?: string;
561
- }
562
- /**
563
- * Event fired when a workflow instance is cancelled
564
- */
565
- interface WorkflowInstanceCancelledEvent extends BaseWorkflowEvent {
566
- type: "workflow.instance.cancelled";
567
- /** ID of the workflow instance */
568
- instanceId: string;
569
- /** ID of the user who cancelled */
570
- cancelledBy: string;
571
- /** Reason for cancellation */
572
- reason?: string;
573
- }
574
- /**
575
- * Event fired when execution enters a node
576
- */
577
- interface WorkflowNodeEnteredEvent extends BaseWorkflowEvent {
578
- type: "workflow.node.entered";
579
- /** ID of the workflow instance */
580
- instanceId: string;
581
- /** ID of the node */
582
- nodeId: string;
583
- /** Type of the node */
584
- nodeType: string;
585
- /** Label of the node */
586
- nodeLabel?: string;
587
- }
588
- /**
589
- * Event fired when a node completes execution
590
- */
591
- interface WorkflowNodeCompletedEvent extends BaseWorkflowEvent {
592
- type: "workflow.node.completed";
593
- /** ID of the workflow instance */
594
- instanceId: string;
595
- /** ID of the node */
596
- nodeId: string;
597
- /** Type of the node */
598
- nodeType: string;
599
- /** ID of the next node to execute */
600
- nextNodeId: string;
601
- /** Duration of node execution in milliseconds */
602
- durationMs: number;
603
- }
604
- /**
605
- * Event fired when a node fails
606
- */
607
- interface WorkflowNodeFailedEvent extends BaseWorkflowEvent {
608
- type: "workflow.node.failed";
609
- /** ID of the workflow instance */
610
- instanceId: string;
611
- /** ID of the node */
612
- nodeId: string;
613
- /** Error message */
614
- error: string;
615
- /** Whether the workflow will continue (if continueOnError is set) */
616
- willContinue: boolean;
617
- }
618
- /**
619
- * Event fired when an invitation is created
620
- */
621
- interface WorkflowInvitationCreatedEvent extends BaseWorkflowEvent {
622
- type: "workflow.invitation.created";
623
- /** ID of the invitation */
624
- invitationId: string;
625
- /** ID of the workflow instance */
626
- instanceId: string;
627
- /** Email of the recipient */
628
- email: string;
629
- /** Name of the recipient */
630
- name?: string;
631
- /** When the invitation expires */
632
- expiresAt: Date;
633
- }
634
- /**
635
- * Event fired when an invitation is accepted (magic link clicked)
636
- */
637
- interface WorkflowInvitationAcceptedEvent extends BaseWorkflowEvent {
638
- type: "workflow.invitation.accepted";
639
- /** ID of the invitation */
640
- invitationId: string;
641
- /** ID of the created access grant */
642
- grantId: string;
643
- /** ID of the workflow instance */
644
- instanceId: string;
645
- /** Email of the recipient */
646
- email: string;
647
- /** IP address used for authentication */
648
- ipAddress?: string;
649
- }
650
- /**
651
- * Event fired when an access grant is revoked
652
- */
653
- interface WorkflowGrantRevokedEvent extends BaseWorkflowEvent {
654
- type: "workflow.grant.revoked";
655
- /** ID of the access grant */
656
- grantId: string;
657
- /** ID of the workflow instance */
658
- instanceId: string;
659
- /** Email of the user */
660
- email: string;
661
- }
662
- /**
663
- * Event fired when an invitation expires
664
- */
665
- interface WorkflowInvitationExpiredEvent extends BaseWorkflowEvent {
666
- type: "workflow.invitation.expired";
667
- /** ID of the invitation */
668
- invitationId: string;
669
- /** ID of the workflow instance */
670
- instanceId: string;
671
- /** Email of the recipient */
672
- email: string;
673
- }
674
- /**
675
- * Union of all workflow event types
676
- */
677
- type WorkflowEvent = WorkflowInstanceStartedEvent | WorkflowInstanceCompletedEvent | WorkflowInstanceFailedEvent | WorkflowInstanceCancelledEvent | WorkflowNodeEnteredEvent | WorkflowNodeCompletedEvent | WorkflowNodeFailedEvent | WorkflowInvitationCreatedEvent | WorkflowInvitationAcceptedEvent | WorkflowGrantRevokedEvent | WorkflowInvitationExpiredEvent;
678
- /**
679
- * All possible event types
680
- */
681
- type WorkflowEventType = WorkflowEvent["type"];
682
- /**
683
- * Check if an event is an instance event
684
- */
685
- declare function isInstanceEvent(event: WorkflowEvent): event is WorkflowInstanceStartedEvent | WorkflowInstanceCompletedEvent | WorkflowInstanceFailedEvent | WorkflowInstanceCancelledEvent;
686
- /**
687
- * Check if an event is a node event
688
- */
689
- declare function isNodeEvent(event: WorkflowEvent): event is WorkflowNodeEnteredEvent | WorkflowNodeCompletedEvent | WorkflowNodeFailedEvent;
690
- /**
691
- * Check if an event is an invitation or grant event
692
- */
693
- declare function isInvitationOrGrantEvent(event: WorkflowEvent): event is WorkflowInvitationCreatedEvent | WorkflowInvitationAcceptedEvent | WorkflowGrantRevokedEvent | WorkflowInvitationExpiredEvent;
694
-
695
- type WorkflowZone = "collect" | "actions";
696
- declare const ZONE_ORDER: WorkflowZone[];
697
- declare const ZONE_CONFIG: Record<WorkflowZone, {
698
- allowedNodeTypes: WorkflowNodeType[];
699
- }>;
700
- /**
701
- * Assign zones to an ordered list of nodes.
702
- *
703
- * Logic: linear scan. Each node is assigned to its natural zone based on type.
704
- * Conditions are assigned to "collect" if they precede a form, "actions" otherwise.
705
- * Terminal nodes (start, end) are NOT assigned a zone — they return null.
706
- */
707
- declare function assignNodeZones(orderedNodes: WorkflowNode[]): Map<string, WorkflowZone | null>;
708
- interface GroupedWorkflowNodes {
709
- /** The start node (always exactly one) */
710
- start: WorkflowNode | null;
711
- /** Nodes grouped by zone, preserving order */
712
- zones: Record<WorkflowZone, WorkflowNode[]>;
713
- /** The end node (always exactly one) */
714
- end: WorkflowNode | null;
715
- }
716
- /**
717
- * Group ordered nodes by zone, preserving order within each zone.
718
- * Terminal nodes (start, end) are extracted separately.
719
- */
720
- declare function groupNodesByZone(orderedNodes: WorkflowNode[]): GroupedWorkflowNodes;
721
- /**
722
- * Get allowed node types for a given zone.
723
- */
724
- declare function getZoneAllowedTypes(zone: WorkflowZone): WorkflowNodeType[];
725
-
726
- /**
727
- * All valid condition operators
728
- */
729
- declare const ConditionOperatorSchema: z.ZodEnum<{
730
- contains: "contains";
731
- eq: "eq";
732
- neq: "neq";
733
- lt: "lt";
734
- gt: "gt";
735
- lte: "lte";
736
- gte: "gte";
737
- startsWith: "startsWith";
738
- endsWith: "endsWith";
739
- isEmpty: "isEmpty";
740
- isNotEmpty: "isNotEmpty";
741
- in: "in";
742
- notIn: "notIn";
743
- }>;
744
- /**
745
- * Single condition rule schema
746
- */
747
- declare const ConditionRuleSchema: z.ZodObject<{
748
- field: z.ZodString;
749
- operator: z.ZodEnum<{
750
- contains: "contains";
751
- eq: "eq";
752
- neq: "neq";
753
- lt: "lt";
754
- gt: "gt";
755
- lte: "lte";
756
- gte: "gte";
757
- startsWith: "startsWith";
758
- endsWith: "endsWith";
759
- isEmpty: "isEmpty";
760
- isNotEmpty: "isNotEmpty";
761
- in: "in";
762
- notIn: "notIn";
763
- }>;
764
- value: z.ZodUnknown;
765
- }, z.core.$strip>;
766
- /**
767
- * Condition group schema (recursive)
768
- *
769
- * Uses Zod v4 getter pattern for recursive types instead of z.lazy().
770
- * This provides cleaner code, better type inference, and improved performance.
771
- */
772
- declare const ConditionGroupSchema: z.ZodObject<{
773
- operator: z.ZodEnum<{
774
- and: "and";
775
- or: "or";
776
- }>;
777
- rules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
778
- field: z.ZodString;
779
- operator: z.ZodEnum<{
780
- contains: "contains";
781
- eq: "eq";
782
- neq: "neq";
783
- lt: "lt";
784
- gt: "gt";
785
- lte: "lte";
786
- gte: "gte";
787
- startsWith: "startsWith";
788
- endsWith: "endsWith";
789
- isEmpty: "isEmpty";
790
- isNotEmpty: "isNotEmpty";
791
- in: "in";
792
- notIn: "notIn";
793
- }>;
794
- value: z.ZodUnknown;
795
- }, z.core.$strip>, z.ZodObject</*elided*/ any, z.core.$strip>]>>;
796
- }, z.core.$strip>;
797
- /**
798
- * Start node schema
799
- */
800
- declare const StartNodeSchema: z.ZodObject<{
801
- type: z.ZodLiteral<"start">;
802
- id: z.ZodString;
803
- next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
804
- }, z.core.$strip>;
805
- declare const FormFieldRefSchema: z.ZodObject<{
806
- slotId: z.ZodString;
807
- attribute: z.ZodString;
808
- relationConfig: z.ZodOptional<z.ZodObject<{
809
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
810
- allowCreate: z.ZodOptional<z.ZodBoolean>;
811
- }, z.core.$strip>>;
812
- }, z.core.$strip>;
813
- /**
814
- * Flow row field schema
815
- */
816
- declare const FlowRowFieldSchema: z.ZodObject<{
817
- id: z.ZodString;
818
- slotId: z.ZodString;
819
- attribute: z.ZodString;
820
- label: z.ZodOptional<z.ZodString>;
821
- tooltip: z.ZodOptional<z.ZodString>;
822
- required: z.ZodOptional<z.ZodBoolean>;
823
- relationConfig: z.ZodOptional<z.ZodObject<{
824
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
825
- allowCreate: z.ZodOptional<z.ZodBoolean>;
826
- }, z.core.$strip>>;
827
- }, z.core.$strip>;
828
- declare const FlowRowSchema: z.ZodUnion<readonly [z.ZodObject<{
829
- id: z.ZodString;
830
- order: z.ZodNumber;
831
- type: z.ZodLiteral<"heading">;
832
- content: z.ZodString;
833
- level: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
834
- }, z.core.$strip>, z.ZodObject<{
835
- id: z.ZodString;
836
- order: z.ZodNumber;
837
- type: z.ZodLiteral<"separator">;
838
- }, z.core.$strip>, z.ZodObject<{
839
- id: z.ZodString;
840
- order: z.ZodNumber;
841
- type: z.ZodLiteral<"text">;
842
- content: z.ZodString;
843
- }, z.core.$strip>, z.ZodObject<{
844
- id: z.ZodString;
845
- order: z.ZodNumber;
846
- type: z.ZodOptional<z.ZodLiteral<"fields">>;
847
- fields: z.ZodArray<z.ZodObject<{
848
- id: z.ZodString;
849
- slotId: z.ZodString;
850
- attribute: z.ZodString;
851
- label: z.ZodOptional<z.ZodString>;
852
- tooltip: z.ZodOptional<z.ZodString>;
853
- required: z.ZodOptional<z.ZodBoolean>;
854
- relationConfig: z.ZodOptional<z.ZodObject<{
855
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
856
- allowCreate: z.ZodOptional<z.ZodBoolean>;
857
- }, z.core.$strip>>;
858
- }, z.core.$strip>>;
859
- }, z.core.$strip>]>;
860
- /**
861
- * Form node schema (supports both simple and advanced modes)
862
- *
863
- * Simple mode: uses `fields` array with FormFieldRef objects
864
- * Advanced mode: uses `rows` array with full row/field structure
865
- */
866
- declare const FormNodeSchema: z.ZodObject<{
867
- type: z.ZodLiteral<"form">;
868
- id: z.ZodString;
869
- label: z.ZodString;
870
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
871
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
872
- slotId: z.ZodString;
873
- attribute: z.ZodString;
874
- relationConfig: z.ZodOptional<z.ZodObject<{
875
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
876
- allowCreate: z.ZodOptional<z.ZodBoolean>;
877
- }, z.core.$strip>>;
878
- }, z.core.$strip>>>;
879
- rows: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
880
- id: z.ZodString;
881
- order: z.ZodNumber;
882
- type: z.ZodLiteral<"heading">;
883
- content: z.ZodString;
884
- level: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
885
- }, z.core.$strip>, z.ZodObject<{
886
- id: z.ZodString;
887
- order: z.ZodNumber;
888
- type: z.ZodLiteral<"separator">;
889
- }, z.core.$strip>, z.ZodObject<{
890
- id: z.ZodString;
891
- order: z.ZodNumber;
892
- type: z.ZodLiteral<"text">;
893
- content: z.ZodString;
894
- }, z.core.$strip>, z.ZodObject<{
895
- id: z.ZodString;
896
- order: z.ZodNumber;
897
- type: z.ZodOptional<z.ZodLiteral<"fields">>;
898
- fields: z.ZodArray<z.ZodObject<{
899
- id: z.ZodString;
900
- slotId: z.ZodString;
901
- attribute: z.ZodString;
902
- label: z.ZodOptional<z.ZodString>;
903
- tooltip: z.ZodOptional<z.ZodString>;
904
- required: z.ZodOptional<z.ZodBoolean>;
905
- relationConfig: z.ZodOptional<z.ZodObject<{
906
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
907
- allowCreate: z.ZodOptional<z.ZodBoolean>;
908
- }, z.core.$strip>>;
909
- }, z.core.$strip>>;
910
- }, z.core.$strip>]>>>;
911
- participantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
912
- next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
913
- }, z.core.$strip>;
914
- /**
915
- * Condition node schema
916
- */
917
- declare const ConditionNodeSchema: z.ZodObject<{
918
- type: z.ZodLiteral<"condition">;
919
- id: z.ZodString;
920
- label: z.ZodString;
921
- condition: z.ZodObject<{
922
- operator: z.ZodEnum<{
923
- and: "and";
924
- or: "or";
925
- }>;
926
- rules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
927
- field: z.ZodString;
928
- operator: z.ZodEnum<{
929
- contains: "contains";
930
- eq: "eq";
931
- neq: "neq";
932
- lt: "lt";
933
- gt: "gt";
934
- lte: "lte";
935
- gte: "gte";
936
- startsWith: "startsWith";
937
- endsWith: "endsWith";
938
- isEmpty: "isEmpty";
939
- isNotEmpty: "isNotEmpty";
940
- in: "in";
941
- notIn: "notIn";
942
- }>;
943
- value: z.ZodUnknown;
944
- }, z.core.$strip>, z.ZodObject</*elided*/ any, z.core.$strip>]>>;
945
- }, z.core.$strip>;
946
- onTrue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
947
- onFalse: z.ZodOptional<z.ZodNullable<z.ZodString>>;
948
- }, z.core.$strip>;
949
- /**
950
- * End node schema
951
- */
952
- declare const EndNodeSchema: z.ZodObject<{
953
- type: z.ZodLiteral<"end">;
954
- id: z.ZodString;
955
- label: z.ZodOptional<z.ZodString>;
956
- status: z.ZodOptional<z.ZodString>;
957
- }, z.core.$strip>;
958
- /**
959
- * Union of all node schemas
960
- */
961
- declare const WorkflowNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
962
- type: z.ZodLiteral<"start">;
963
- id: z.ZodString;
964
- next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
965
- }, z.core.$strip>, z.ZodObject<{
966
- type: z.ZodLiteral<"form">;
967
- id: z.ZodString;
968
- label: z.ZodString;
969
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
970
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
971
- slotId: z.ZodString;
972
- attribute: z.ZodString;
973
- relationConfig: z.ZodOptional<z.ZodObject<{
974
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
975
- allowCreate: z.ZodOptional<z.ZodBoolean>;
976
- }, z.core.$strip>>;
977
- }, z.core.$strip>>>;
978
- rows: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
979
- id: z.ZodString;
980
- order: z.ZodNumber;
981
- type: z.ZodLiteral<"heading">;
982
- content: z.ZodString;
983
- level: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
984
- }, z.core.$strip>, z.ZodObject<{
985
- id: z.ZodString;
986
- order: z.ZodNumber;
987
- type: z.ZodLiteral<"separator">;
988
- }, z.core.$strip>, z.ZodObject<{
989
- id: z.ZodString;
990
- order: z.ZodNumber;
991
- type: z.ZodLiteral<"text">;
992
- content: z.ZodString;
993
- }, z.core.$strip>, z.ZodObject<{
994
- id: z.ZodString;
995
- order: z.ZodNumber;
996
- type: z.ZodOptional<z.ZodLiteral<"fields">>;
997
- fields: z.ZodArray<z.ZodObject<{
998
- id: z.ZodString;
999
- slotId: z.ZodString;
1000
- attribute: z.ZodString;
1001
- label: z.ZodOptional<z.ZodString>;
1002
- tooltip: z.ZodOptional<z.ZodString>;
1003
- required: z.ZodOptional<z.ZodBoolean>;
1004
- relationConfig: z.ZodOptional<z.ZodObject<{
1005
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
1006
- allowCreate: z.ZodOptional<z.ZodBoolean>;
1007
- }, z.core.$strip>>;
1008
- }, z.core.$strip>>;
1009
- }, z.core.$strip>]>>>;
1010
- participantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1011
- next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1012
- }, z.core.$strip>, z.ZodObject<{
1013
- type: z.ZodLiteral<"condition">;
1014
- id: z.ZodString;
1015
- label: z.ZodString;
1016
- condition: z.ZodObject<{
1017
- operator: z.ZodEnum<{
1018
- and: "and";
1019
- or: "or";
1020
- }>;
1021
- rules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1022
- field: z.ZodString;
1023
- operator: z.ZodEnum<{
1024
- contains: "contains";
1025
- eq: "eq";
1026
- neq: "neq";
1027
- lt: "lt";
1028
- gt: "gt";
1029
- lte: "lte";
1030
- gte: "gte";
1031
- startsWith: "startsWith";
1032
- endsWith: "endsWith";
1033
- isEmpty: "isEmpty";
1034
- isNotEmpty: "isNotEmpty";
1035
- in: "in";
1036
- notIn: "notIn";
1037
- }>;
1038
- value: z.ZodUnknown;
1039
- }, z.core.$strip>, z.ZodObject</*elided*/ any, z.core.$strip>]>>;
1040
- }, z.core.$strip>;
1041
- onTrue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1042
- onFalse: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1043
- }, z.core.$strip>, z.ZodObject<{
1044
- type: z.ZodLiteral<"end">;
1045
- id: z.ZodString;
1046
- label: z.ZodOptional<z.ZodString>;
1047
- status: z.ZodOptional<z.ZodString>;
1048
- }, z.core.$strip>], "type">;
1049
- /**
1050
- * Slot mode schema
1051
- */
1052
- declare const SlotModeSchema: z.ZodEnum<{
1053
- select: "select";
1054
- create: "create";
1055
- optional: "optional";
1056
- }>;
1057
- /**
1058
- * Workflow slot schema
1059
- */
1060
- declare const WorkflowSlotSchema: z.ZodObject<{
1061
- id: z.ZodString;
1062
- objectName: z.ZodString;
1063
- label: z.ZodString;
1064
- mode: z.ZodEnum<{
1065
- select: "select";
1066
- create: "create";
1067
- optional: "optional";
1068
- }>;
1069
- color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1070
- icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1071
- }, z.core.$strip>;
1072
- /**
1073
- * Authentication method schema
1074
- */
1075
- declare const AuthMethodSchema: z.ZodEnum<{
1076
- signed_link: "signed_link";
1077
- pin_code: "pin_code";
1078
- }>;
1079
- /**
1080
- * Share status schema
1081
- */
1082
- declare const ShareStatusSchema: z.ZodEnum<{
1083
- pending: "pending";
1084
- expired: "expired";
1085
- revoked: "revoked";
1086
- active: "active";
1087
- }>;
1088
- /**
1089
- * Workflow share schema (simplified from WorkflowParticipation)
1090
- */
1091
- declare const WorkflowShareSchema: z.ZodObject<{
1092
- id: z.ZodUUID;
1093
- instanceId: z.ZodUUID;
1094
- email: z.ZodEmail;
1095
- name: z.ZodOptional<z.ZodString>;
1096
- phone: z.ZodOptional<z.ZodString>;
1097
- authMethod: z.ZodEnum<{
1098
- signed_link: "signed_link";
1099
- pin_code: "pin_code";
1100
- }>;
1101
- token: z.ZodOptional<z.ZodString>;
1102
- pinCodeHash: z.ZodOptional<z.ZodString>;
1103
- pinAttempts: z.ZodOptional<z.ZodNumber>;
1104
- status: z.ZodEnum<{
1105
- pending: "pending";
1106
- expired: "expired";
1107
- revoked: "revoked";
1108
- active: "active";
1109
- }>;
1110
- emailSent: z.ZodBoolean;
1111
- smsSent: z.ZodOptional<z.ZodBoolean>;
1112
- createdAt: z.ZodCoercedDate<unknown>;
1113
- expiresAt: z.ZodCoercedDate<unknown>;
1114
- lastAccessAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1115
- }, z.core.$strip>;
1116
- /**
1117
- * Create share input schema
1118
- */
1119
- declare const CreateShareInputSchema: z.ZodObject<{
1120
- instanceId: z.ZodUUID;
1121
- email: z.ZodEmail;
1122
- name: z.ZodOptional<z.ZodString>;
1123
- phone: z.ZodOptional<z.ZodString>;
1124
- authMethod: z.ZodEnum<{
1125
- signed_link: "signed_link";
1126
- pin_code: "pin_code";
1127
- }>;
1128
- sendNotification: z.ZodOptional<z.ZodBoolean>;
1129
- expiresInDays: z.ZodOptional<z.ZodNumber>;
1130
- }, z.core.$strip>;
1131
- /**
1132
- * Node position schema
1133
- */
1134
- declare const NodePositionSchema: z.ZodObject<{
1135
- x: z.ZodNumber;
1136
- y: z.ZodNumber;
1137
- }, z.core.$strip>;
1138
- /**
1139
- * Viewport schema
1140
- */
1141
- declare const ViewportSchema: z.ZodObject<{
1142
- x: z.ZodNumber;
1143
- y: z.ZodNumber;
1144
- zoom: z.ZodNumber;
1145
- }, z.core.$strip>;
1146
- /**
1147
- * Workflow layout schema
1148
- */
1149
- declare const WorkflowLayoutSchema: z.ZodObject<{
1150
- positions: z.ZodRecord<z.ZodString, z.ZodObject<{
1151
- x: z.ZodNumber;
1152
- y: z.ZodNumber;
1153
- }, z.core.$strip>>;
1154
- viewport: z.ZodOptional<z.ZodObject<{
1155
- x: z.ZodNumber;
1156
- y: z.ZodNumber;
1157
- zoom: z.ZodNumber;
1158
- }, z.core.$strip>>;
1159
- }, z.core.$strip>;
1160
- /**
1161
- * Theme colors schema
1162
- */
1163
- declare const ThemeColorsSchema: z.ZodObject<{
1164
- primary: z.ZodOptional<z.ZodString>;
1165
- primaryForeground: z.ZodOptional<z.ZodString>;
1166
- background: z.ZodOptional<z.ZodString>;
1167
- foreground: z.ZodOptional<z.ZodString>;
1168
- muted: z.ZodOptional<z.ZodString>;
1169
- border: z.ZodOptional<z.ZodString>;
1170
- accent: z.ZodOptional<z.ZodString>;
1171
- }, z.core.$strip>;
1172
- /**
1173
- * Theme logo schema
1174
- */
1175
- declare const ThemeLogoSchema: z.ZodObject<{
1176
- url: z.ZodURL;
1177
- alt: z.ZodOptional<z.ZodString>;
1178
- maxHeight: z.ZodOptional<z.ZodNumber>;
1179
- }, z.core.$strip>;
1180
- /**
1181
- * Workflow theme schema
1182
- */
1183
- declare const WorkflowThemeSchema: z.ZodObject<{
1184
- logo: z.ZodOptional<z.ZodObject<{
1185
- url: z.ZodURL;
1186
- alt: z.ZodOptional<z.ZodString>;
1187
- maxHeight: z.ZodOptional<z.ZodNumber>;
1188
- }, z.core.$strip>>;
1189
- colors: z.ZodOptional<z.ZodObject<{
1190
- primary: z.ZodOptional<z.ZodString>;
1191
- primaryForeground: z.ZodOptional<z.ZodString>;
1192
- background: z.ZodOptional<z.ZodString>;
1193
- foreground: z.ZodOptional<z.ZodString>;
1194
- muted: z.ZodOptional<z.ZodString>;
1195
- border: z.ZodOptional<z.ZodString>;
1196
- accent: z.ZodOptional<z.ZodString>;
1197
- }, z.core.$strip>>;
1198
- typography: z.ZodOptional<z.ZodObject<{
1199
- headingFont: z.ZodOptional<z.ZodString>;
1200
- bodyFont: z.ZodOptional<z.ZodString>;
1201
- baseFontSize: z.ZodOptional<z.ZodNumber>;
1202
- }, z.core.$strip>>;
1203
- borderRadius: z.ZodOptional<z.ZodNumber>;
1204
- showPoweredBy: z.ZodOptional<z.ZodBoolean>;
1205
- customCss: z.ZodOptional<z.ZodString>;
1206
- }, z.core.$strip>;
1207
- /**
1208
- * Workflow config schema
1209
- */
1210
- declare const WorkflowConfigSchema: z.ZodObject<{
1211
- instanceTtl: z.ZodOptional<z.ZodString>;
1212
- externalLinkTtl: z.ZodOptional<z.ZodString>;
1213
- allowExternalParticipants: z.ZodOptional<z.ZodBoolean>;
1214
- }, z.core.$strip>;
1215
- /**
1216
- * Workflow status schema
1217
- */
1218
- declare const WorkflowStatusSchema: z.ZodEnum<{
1219
- archived: "archived";
1220
- draft: "draft";
1221
- published: "published";
1222
- }>;
1223
- /**
1224
- * Complete workflow definition schema
1225
- */
1226
- declare const WorkflowDefinitionSchema: z.ZodObject<{
1227
- id: z.ZodOptional<z.ZodString>;
1228
- name: z.ZodString;
1229
- label: z.ZodString;
1230
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1231
- icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1232
- status: z.ZodEnum<{
1233
- archived: "archived";
1234
- draft: "draft";
1235
- published: "published";
1236
- }>;
1237
- version: z.ZodNumber;
1238
- slots: z.ZodArray<z.ZodObject<{
1239
- id: z.ZodString;
1240
- objectName: z.ZodString;
1241
- label: z.ZodString;
1242
- mode: z.ZodEnum<{
1243
- select: "select";
1244
- create: "create";
1245
- optional: "optional";
1246
- }>;
1247
- color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1248
- icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1249
- }, z.core.$strip>>;
1250
- nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1251
- type: z.ZodLiteral<"start">;
1252
- id: z.ZodString;
1253
- next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1254
- }, z.core.$strip>, z.ZodObject<{
1255
- type: z.ZodLiteral<"form">;
1256
- id: z.ZodString;
1257
- label: z.ZodString;
1258
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1259
- fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
1260
- slotId: z.ZodString;
1261
- attribute: z.ZodString;
1262
- relationConfig: z.ZodOptional<z.ZodObject<{
1263
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
1264
- allowCreate: z.ZodOptional<z.ZodBoolean>;
1265
- }, z.core.$strip>>;
1266
- }, z.core.$strip>>>;
1267
- rows: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1268
- id: z.ZodString;
1269
- order: z.ZodNumber;
1270
- type: z.ZodLiteral<"heading">;
1271
- content: z.ZodString;
1272
- level: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
1273
- }, z.core.$strip>, z.ZodObject<{
1274
- id: z.ZodString;
1275
- order: z.ZodNumber;
1276
- type: z.ZodLiteral<"separator">;
1277
- }, z.core.$strip>, z.ZodObject<{
1278
- id: z.ZodString;
1279
- order: z.ZodNumber;
1280
- type: z.ZodLiteral<"text">;
1281
- content: z.ZodString;
1282
- }, z.core.$strip>, z.ZodObject<{
1283
- id: z.ZodString;
1284
- order: z.ZodNumber;
1285
- type: z.ZodOptional<z.ZodLiteral<"fields">>;
1286
- fields: z.ZodArray<z.ZodObject<{
1287
- id: z.ZodString;
1288
- slotId: z.ZodString;
1289
- attribute: z.ZodString;
1290
- label: z.ZodOptional<z.ZodString>;
1291
- tooltip: z.ZodOptional<z.ZodString>;
1292
- required: z.ZodOptional<z.ZodBoolean>;
1293
- relationConfig: z.ZodOptional<z.ZodObject<{
1294
- visibleProperties: z.ZodOptional<z.ZodArray<z.ZodString>>;
1295
- allowCreate: z.ZodOptional<z.ZodBoolean>;
1296
- }, z.core.$strip>>;
1297
- }, z.core.$strip>>;
1298
- }, z.core.$strip>]>>>;
1299
- participantId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1300
- next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1301
- }, z.core.$strip>, z.ZodObject<{
1302
- type: z.ZodLiteral<"condition">;
1303
- id: z.ZodString;
1304
- label: z.ZodString;
1305
- condition: z.ZodObject<{
1306
- operator: z.ZodEnum<{
1307
- and: "and";
1308
- or: "or";
1309
- }>;
1310
- rules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
1311
- field: z.ZodString;
1312
- operator: z.ZodEnum<{
1313
- contains: "contains";
1314
- eq: "eq";
1315
- neq: "neq";
1316
- lt: "lt";
1317
- gt: "gt";
1318
- lte: "lte";
1319
- gte: "gte";
1320
- startsWith: "startsWith";
1321
- endsWith: "endsWith";
1322
- isEmpty: "isEmpty";
1323
- isNotEmpty: "isNotEmpty";
1324
- in: "in";
1325
- notIn: "notIn";
1326
- }>;
1327
- value: z.ZodUnknown;
1328
- }, z.core.$strip>, z.ZodObject</*elided*/ any, z.core.$strip>]>>;
1329
- }, z.core.$strip>;
1330
- onTrue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1331
- onFalse: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1332
- }, z.core.$strip>, z.ZodObject<{
1333
- type: z.ZodLiteral<"end">;
1334
- id: z.ZodString;
1335
- label: z.ZodOptional<z.ZodString>;
1336
- status: z.ZodOptional<z.ZodString>;
1337
- }, z.core.$strip>], "type">>;
1338
- startNodeId: z.ZodString;
1339
- layout: z.ZodOptional<z.ZodObject<{
1340
- positions: z.ZodRecord<z.ZodString, z.ZodObject<{
1341
- x: z.ZodNumber;
1342
- y: z.ZodNumber;
1343
- }, z.core.$strip>>;
1344
- viewport: z.ZodOptional<z.ZodObject<{
1345
- x: z.ZodNumber;
1346
- y: z.ZodNumber;
1347
- zoom: z.ZodNumber;
1348
- }, z.core.$strip>>;
1349
- }, z.core.$strip>>;
1350
- theme: z.ZodOptional<z.ZodObject<{
1351
- logo: z.ZodOptional<z.ZodObject<{
1352
- url: z.ZodURL;
1353
- alt: z.ZodOptional<z.ZodString>;
1354
- maxHeight: z.ZodOptional<z.ZodNumber>;
1355
- }, z.core.$strip>>;
1356
- colors: z.ZodOptional<z.ZodObject<{
1357
- primary: z.ZodOptional<z.ZodString>;
1358
- primaryForeground: z.ZodOptional<z.ZodString>;
1359
- background: z.ZodOptional<z.ZodString>;
1360
- foreground: z.ZodOptional<z.ZodString>;
1361
- muted: z.ZodOptional<z.ZodString>;
1362
- border: z.ZodOptional<z.ZodString>;
1363
- accent: z.ZodOptional<z.ZodString>;
1364
- }, z.core.$strip>>;
1365
- typography: z.ZodOptional<z.ZodObject<{
1366
- headingFont: z.ZodOptional<z.ZodString>;
1367
- bodyFont: z.ZodOptional<z.ZodString>;
1368
- baseFontSize: z.ZodOptional<z.ZodNumber>;
1369
- }, z.core.$strip>>;
1370
- borderRadius: z.ZodOptional<z.ZodNumber>;
1371
- showPoweredBy: z.ZodOptional<z.ZodBoolean>;
1372
- customCss: z.ZodOptional<z.ZodString>;
1373
- }, z.core.$strip>>;
1374
- config: z.ZodOptional<z.ZodObject<{
1375
- instanceTtl: z.ZodOptional<z.ZodString>;
1376
- externalLinkTtl: z.ZodOptional<z.ZodString>;
1377
- allowExternalParticipants: z.ZodOptional<z.ZodBoolean>;
1378
- }, z.core.$strip>>;
1379
- tenantId: z.ZodOptional<z.ZodString>;
1380
- system: z.ZodOptional<z.ZodBoolean>;
1381
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1382
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1383
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
1384
- }, z.core.$strip>;
1385
- type ValidatedWorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
1386
- type ValidatedWorkflowNode = z.infer<typeof WorkflowNodeSchema>;
1387
- type ValidatedConditionGroup = z.infer<typeof ConditionGroupSchema>;
1388
-
1389
176
  /**
1390
177
  * Object as stored in database (metadata)
1391
178
  */
@@ -1502,7 +289,7 @@ interface CreateObjectRecord {
1502
289
  * - `draft`: Record is incomplete (missing required values)
1503
290
  * - `complete`: All required values are present and valid
1504
291
  */
1505
- completionStatus: "draft" | "complete";
292
+ completionStatus: CompletionStatus;
1506
293
  /**
1507
294
  * Developer-managed metadata for storing custom data.
1508
295
  * Defaults to empty object if not provided.
@@ -1552,7 +339,7 @@ interface GlobalSearchResultItem {
1552
339
  /** Computed label from labelExpression */
1553
340
  label: string;
1554
341
  recordId: string;
1555
- completionStatus: "draft" | "complete";
342
+ completionStatus: CompletionStatus;
1556
343
  createdAt: Date;
1557
344
  updatedAt: Date;
1558
345
  }
@@ -1678,199 +465,6 @@ interface UpdateDBViewOverlay {
1678
465
  configOverrides?: ConfigOverrides;
1679
466
  isUserDefault?: boolean;
1680
467
  }
1681
- /**
1682
- * Workflow definition as stored in database.
1683
- * Uses snake_case to match database column names.
1684
- */
1685
- interface DBWorkflow {
1686
- id: string;
1687
- tenant_id: string;
1688
- name: string;
1689
- label: string;
1690
- description: string | null;
1691
- icon: string | null;
1692
- status: WorkflowStatus;
1693
- version: number;
1694
- slots: WorkflowSlot[];
1695
- nodes: Record<string, WorkflowNode>;
1696
- start_node_id: string;
1697
- layout?: WorkflowLayout;
1698
- theme: WorkflowTheme | null;
1699
- config: WorkflowConfig | null;
1700
- system: boolean;
1701
- metadata: Record<string, unknown> | null;
1702
- created_at: string;
1703
- updated_at: string;
1704
- }
1705
- /**
1706
- * Data for creating a new workflow.
1707
- * Tenant ID is automatically set from the execution context.
1708
- */
1709
- interface CreateDBWorkflow {
1710
- name: string;
1711
- label: string;
1712
- description?: string;
1713
- icon?: IconName;
1714
- status?: WorkflowStatus;
1715
- version?: number;
1716
- slots: WorkflowSlot[];
1717
- nodes: Record<string, WorkflowNode>;
1718
- startNodeId: string;
1719
- layout?: WorkflowLayout;
1720
- theme?: WorkflowTheme;
1721
- config?: WorkflowConfig;
1722
- system?: boolean;
1723
- metadata?: Record<string, unknown>;
1724
- }
1725
- /**
1726
- * Data for updating a workflow.
1727
- */
1728
- interface UpdateDBWorkflow {
1729
- label?: string;
1730
- description?: string;
1731
- icon?: IconName;
1732
- status?: WorkflowStatus;
1733
- version?: number;
1734
- slots?: WorkflowSlot[];
1735
- nodes?: Record<string, WorkflowNode>;
1736
- startNodeId?: string;
1737
- layout?: WorkflowLayout;
1738
- theme?: WorkflowTheme;
1739
- config?: WorkflowConfig;
1740
- metadata?: Record<string, unknown>;
1741
- }
1742
- /**
1743
- * Workflow instance as stored in database.
1744
- * Uses snake_case to match database column names.
1745
- */
1746
- interface DBWorkflowInstance {
1747
- id: string;
1748
- tenant_id: string;
1749
- workflow_id: string;
1750
- workflow_version: number;
1751
- workflow_snapshot: WorkflowDefinition;
1752
- status: InstanceStatus;
1753
- current_node_id: string;
1754
- context: WorkflowExecutionContext;
1755
- history: WorkflowTransition[];
1756
- pending_action: PendingAction | null;
1757
- error: {
1758
- code: string;
1759
- message: string;
1760
- nodeId?: string;
1761
- } | null;
1762
- started_by: string;
1763
- expires_at: string | null;
1764
- created_at: string;
1765
- updated_at: string;
1766
- completed_at: string | null;
1767
- }
1768
- /**
1769
- * Data for creating a workflow instance.
1770
- * Tenant ID is automatically set from the execution context.
1771
- */
1772
- interface CreateDBWorkflowInstance {
1773
- workflowId: string;
1774
- workflowVersion: number;
1775
- workflowSnapshot: WorkflowDefinition;
1776
- status: InstanceStatus;
1777
- currentNodeId: string;
1778
- context: WorkflowExecutionContext;
1779
- history: WorkflowTransition[];
1780
- pendingAction?: PendingAction;
1781
- startedBy: string;
1782
- expiresAt?: Date;
1783
- }
1784
- /**
1785
- * Data for updating a workflow instance.
1786
- */
1787
- interface UpdateDBWorkflowInstance {
1788
- status?: InstanceStatus;
1789
- currentNodeId?: string;
1790
- context?: WorkflowExecutionContext;
1791
- history?: WorkflowTransition[];
1792
- pendingAction?: PendingAction | null;
1793
- error?: {
1794
- code: string;
1795
- message: string;
1796
- nodeId?: string;
1797
- } | null;
1798
- expiresAt?: Date | null;
1799
- completedAt?: Date | null;
1800
- }
1801
- /**
1802
- * Workflow invitation as stored in database.
1803
- * Uses snake_case to match database column names.
1804
- */
1805
- interface DBWorkflowInvitation {
1806
- id: string;
1807
- tenant_id: string;
1808
- instance_id: string;
1809
- recipient_email: string;
1810
- recipient_name: string | null;
1811
- status: InvitationStatus;
1812
- created_by: string;
1813
- created_at: string;
1814
- accepted_at: string | null;
1815
- expires_at: string;
1816
- }
1817
- /**
1818
- * Data for creating a workflow invitation.
1819
- * Tenant ID is automatically set from the execution context.
1820
- */
1821
- interface CreateDBWorkflowInvitation {
1822
- instanceId: string;
1823
- recipientEmail: string;
1824
- recipientName?: string;
1825
- status?: InvitationStatus;
1826
- createdBy: string;
1827
- expiresAt: Date;
1828
- }
1829
- /**
1830
- * Data for updating a workflow invitation.
1831
- */
1832
- interface UpdateDBWorkflowInvitation {
1833
- status?: InvitationStatus;
1834
- acceptedAt?: Date | null;
1835
- expiresAt?: Date;
1836
- }
1837
- /**
1838
- * Workflow access grant as stored in database.
1839
- * Uses snake_case to match database column names.
1840
- */
1841
- interface DBWorkflowAccessGrant {
1842
- id: string;
1843
- tenant_id: string;
1844
- invitation_id: string;
1845
- instance_id: string;
1846
- granted_to: string;
1847
- scope: string[];
1848
- revoked_token_jtis: string[];
1849
- created_at: string;
1850
- last_used_at: string | null;
1851
- valid_until: string;
1852
- revoked_at: string | null;
1853
- }
1854
- /**
1855
- * Data for creating a workflow access grant.
1856
- * Tenant ID is automatically set from the execution context.
1857
- */
1858
- interface CreateDBWorkflowAccessGrant {
1859
- invitationId: string;
1860
- instanceId: string;
1861
- grantedTo: string;
1862
- scope?: string[];
1863
- revokedTokenJtis?: string[];
1864
- validUntil: Date;
1865
- }
1866
- /**
1867
- * Data for updating a workflow access grant.
1868
- */
1869
- interface UpdateDBWorkflowAccessGrant {
1870
- lastUsedAt?: Date;
1871
- revokedTokenJtis?: string[];
1872
- revokedAt?: Date | null;
1873
- }
1874
468
  /**
1875
469
  * Result of an operation
1876
470
  */
@@ -2587,21 +1181,6 @@ declare const BEHAVIOR_PROPERTIES: readonly ["required", "disabled", "hidden", "
2587
1181
  * These only affect display, not logic.
2588
1182
  */
2589
1183
  declare const PRESENTATION_PROPERTIES: readonly ["label", "description", "placeholder", "icon"];
2590
- type IdentityProperty = (typeof IDENTITY_PROPERTIES)[number];
2591
- type BehaviorProperty = (typeof BEHAVIOR_PROPERTIES)[number];
2592
- type PresentationProperty = (typeof PRESENTATION_PROPERTIES)[number];
2593
- /**
2594
- * Check if a property is an identity property (never modifiable)
2595
- */
2596
- declare function isIdentityProperty(property: string): property is IdentityProperty;
2597
- /**
2598
- * Check if a property is a behavior property (protected for system attributes)
2599
- */
2600
- declare function isBehaviorProperty(property: string): property is BehaviorProperty;
2601
- /**
2602
- * Check if a property is a presentation property (always modifiable)
2603
- */
2604
- declare function isPresentationProperty(property: string): property is PresentationProperty;
2605
1184
 
2606
1185
  /**
2607
1186
  * Type of resource that can be audited
@@ -2671,7 +1250,12 @@ interface CreateAuditLogInput {
2671
1250
  metadata?: Record<string, unknown>;
2672
1251
  }
2673
1252
  /**
2674
- * Options for listing audit logs
1253
+ * Valid column names for sorting audit log entries.
1254
+ * Maps to snake_case database column names used in Supabase queries.
1255
+ */
1256
+ type AuditSortField = "created_at" | "action" | "resource_type" | "actor_id" | "actor_email" | "object_name";
1257
+ /**
1258
+ * Options for listing audit logs
2675
1259
  */
2676
1260
  interface AuditListOptions {
2677
1261
  limit?: number;
@@ -2682,8 +1266,10 @@ interface AuditListOptions {
2682
1266
  actorId?: string;
2683
1267
  from?: Date;
2684
1268
  to?: Date;
2685
- orderBy?: "createdAt";
2686
- orderDirection?: "asc" | "desc";
1269
+ sorts?: Array<{
1270
+ field: AuditSortField;
1271
+ direction: "asc" | "desc";
1272
+ }>;
2687
1273
  }
2688
1274
  /**
2689
1275
  * Options for AuditService
@@ -2712,7 +1298,7 @@ type AgentRunStatus = "pending" | "running" | "completed" | "failed" | "cancelle
2712
1298
  type AgentSessionStatus = "active" | "idle" | "completed" | "failed" | "cancelled" | "waiting_human" | "timeout" | "expired";
2713
1299
  type AgentSessionMode = "interactive" | "autonomous";
2714
1300
  type QuestionStatus = "pending" | "answered" | "timeout" | "cancelled";
2715
- type TriggerEventType = "record.created" | "record.updated" | "record.deleted" | "record.field_changed" | "workflow.completed" | "agent.completed" | "webhook" | "schedule";
1301
+ type TriggerEventType = "record.created" | "record.updated" | "record.deleted" | "record.field_changed" | "form.submitted" | "agent.completed" | "webhook" | "schedule";
2716
1302
  type AgentTriggerType = Extract<TriggerEventType, "record.created" | "record.updated" | "record.deleted">;
2717
1303
  type ProviderName = "anthropic" | "openai" | "google" | "mistral";
2718
1304
  interface ModelDefinition {
@@ -2743,7 +1329,6 @@ interface AgentConfig {
2743
1329
  canDelegate: boolean;
2744
1330
  maxDepth: number;
2745
1331
  maxTreeCostUsd?: number;
2746
- canAskHuman?: boolean;
2747
1332
  critic?: CriticConfig;
2748
1333
  }
2749
1334
  interface CriticConfig {
@@ -2757,13 +1342,13 @@ interface RecordAgentTrigger {
2757
1342
  objectId: string;
2758
1343
  filter?: Record<string, unknown>;
2759
1344
  }
2760
- interface WorkflowCompletedAgentTrigger {
2761
- type: "workflow.completed";
2762
- workflowId?: string;
2763
- workflowName?: string;
1345
+ interface FormSubmittedAgentTrigger {
1346
+ type: "form.submitted";
1347
+ formId?: string;
1348
+ formName?: string;
2764
1349
  filter?: Record<string, unknown>;
2765
1350
  }
2766
- type AgentTrigger = RecordAgentTrigger | WorkflowCompletedAgentTrigger;
1351
+ type AgentTrigger = RecordAgentTrigger | FormSubmittedAgentTrigger;
2767
1352
  /**
2768
1353
  * Standalone trigger definition (replaces embedded AgentTrigger[]).
2769
1354
  * Triggers are now first-class entities with their own lifecycle.
@@ -2776,7 +1361,7 @@ interface AgentTriggerDefinition {
2776
1361
  eventType: TriggerEventType;
2777
1362
  objectId?: string;
2778
1363
  fieldPath?: string;
2779
- workflowDefinitionId?: string;
1364
+ formDefinitionId?: string;
2780
1365
  sourceAgentId?: string;
2781
1366
  webhookPath?: string;
2782
1367
  cronExpression?: string;
@@ -2956,36 +1541,25 @@ interface RecordAgentEvent {
2956
1541
  tenantId: string;
2957
1542
  data?: Record<string, unknown>;
2958
1543
  }
2959
- interface WorkflowCompletedAgentEvent {
2960
- type: "workflow.completed";
1544
+ interface FormSubmittedAgentEvent {
1545
+ type: "form.submitted";
2961
1546
  tenantId: string;
2962
- workflowId: string;
2963
- workflowName: string;
2964
- workflowDescription?: string;
2965
- workflowInstanceId: string;
2966
- startedBy: string;
2967
- createdRecordIds: string[];
2968
- targetRecordIds: string[];
2969
- slotRecordIds: Record<string, string>;
1547
+ formId: string;
1548
+ formName: string;
1549
+ submissionId: string;
1550
+ createdBy?: string;
1551
+ createdRecordIds: Record<string, string>;
2970
1552
  data: {
2971
- workflowId: string;
2972
- workflowName: string;
2973
- workflowDescription?: string;
2974
- workflowInstanceId: string;
2975
- startedBy: string;
2976
- createdRecordIds: string[];
2977
- targetRecordIds: string[];
2978
- slotRecordIds: Record<string, string>;
2979
- context: Record<string, unknown>;
2980
- slots: Record<string, Record<string, unknown>>;
2981
- forms: Record<string, Record<string, unknown>>;
2982
- documents: Record<string, unknown>;
2983
- variables: Record<string, unknown>;
2984
- conditionResults: Record<string, boolean>;
2985
- relationBuffers: Record<string, unknown>;
1553
+ formId: string;
1554
+ formName: string;
1555
+ submissionId: string;
1556
+ createdBy?: string;
1557
+ createdRecordIds: Record<string, string>;
1558
+ slotValues: Record<string, Record<string, unknown>>;
1559
+ stepValues: Record<string, Record<string, unknown>>;
2986
1560
  };
2987
1561
  }
2988
- type AgentEvent = RecordAgentEvent | WorkflowCompletedAgentEvent;
1562
+ type AgentEvent = RecordAgentEvent | FormSubmittedAgentEvent;
2989
1563
  interface AgentDashboard {
2990
1564
  activeRuns: number;
2991
1565
  pendingRuns: number;
@@ -2995,27 +1569,6 @@ interface AgentDashboard {
2995
1569
  totalCostWeek: number;
2996
1570
  }
2997
1571
 
2998
- /**
2999
- * Validation result for bilateral relations
3000
- */
3001
- interface BilateralValidationResult {
3002
- valid: boolean;
3003
- errors: BilateralValidationError[];
3004
- }
3005
- /**
3006
- * Error codes for bilateral relation validation
3007
- */
3008
- interface BilateralValidationError {
3009
- code: "INVERSE_ATTR_NOT_FOUND" | "INVERSE_TARGET_MISMATCH" | "CIRCULAR_BILATERAL" | "CARDINALITY_CONFLICT" | "POLYMORPHIC_NOT_SUPPORTED";
3010
- message: string;
3011
- context: {
3012
- sourceObject: string;
3013
- sourceAttribute: string;
3014
- targetObject: string;
3015
- targetAttribute: string;
3016
- };
3017
- }
3018
-
3019
1572
  /**
3020
1573
  * Common configuration for all builders (Objects & Attributes)
3021
1574
  */
@@ -3119,6 +1672,226 @@ interface DocumentListOptions {
3119
1672
  processingStatus?: ProcessingStatus;
3120
1673
  }
3121
1674
 
1675
+ /**
1676
+ * Error codes for schema exceptions
1677
+ */
1678
+ declare const SchemaErrorCode: {
1679
+ readonly UNKNOWN: "SCHEMA_UNKNOWN_ERROR";
1680
+ readonly OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND";
1681
+ readonly ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND";
1682
+ readonly RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND";
1683
+ readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
1684
+ readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
1685
+ readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
1686
+ readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
1687
+ readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
1688
+ readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
1689
+ readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
1690
+ readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
1691
+ readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
1692
+ readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
1693
+ readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
1694
+ readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
1695
+ readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
1696
+ readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
1697
+ readonly CONFLICT: "SCHEMA_CONFLICT";
1698
+ readonly STORAGE_UPLOAD_FAILED: "SCHEMA_STORAGE_UPLOAD_FAILED";
1699
+ readonly STORAGE_DOWNLOAD_FAILED: "SCHEMA_STORAGE_DOWNLOAD_FAILED";
1700
+ readonly STORAGE_DELETE_FAILED: "SCHEMA_STORAGE_DELETE_FAILED";
1701
+ readonly STORAGE_URL_FAILED: "SCHEMA_STORAGE_URL_FAILED";
1702
+ readonly REPOSITORY_CREATE_FAILED: "SCHEMA_REPOSITORY_CREATE_FAILED";
1703
+ readonly REPOSITORY_UPDATE_FAILED: "SCHEMA_REPOSITORY_UPDATE_FAILED";
1704
+ readonly REPOSITORY_DELETE_FAILED: "SCHEMA_REPOSITORY_DELETE_FAILED";
1705
+ readonly REPOSITORY_QUERY_FAILED: "SCHEMA_REPOSITORY_QUERY_FAILED";
1706
+ readonly NOT_IMPLEMENTED: "SCHEMA_NOT_IMPLEMENTED";
1707
+ readonly TIMEOUT: "SCHEMA_TIMEOUT";
1708
+ readonly RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED";
1709
+ readonly ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE";
1710
+ readonly OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED";
1711
+ };
1712
+ type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
1713
+ /**
1714
+ * Base error class for all schema-related errors
1715
+ */
1716
+ declare class SchemaError extends Error {
1717
+ readonly code: SchemaErrorCode;
1718
+ readonly details?: Record<string, unknown>;
1719
+ constructor(message: string, code?: SchemaErrorCode, details?: Record<string, unknown>);
1720
+ toJSON(): {
1721
+ name: string;
1722
+ code: SchemaErrorCode;
1723
+ message: string;
1724
+ details: Record<string, unknown> | undefined;
1725
+ };
1726
+ }
1727
+ /**
1728
+ * Base class for "not found" errors
1729
+ */
1730
+ declare class NotFoundError extends SchemaError {
1731
+ readonly resourceType: string;
1732
+ readonly resourceId: string;
1733
+ constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode);
1734
+ }
1735
+ /**
1736
+ * Object not found error
1737
+ */
1738
+ declare class ObjectNotFoundError extends NotFoundError {
1739
+ constructor(objectId: string);
1740
+ }
1741
+ /**
1742
+ * Attribute not found error
1743
+ */
1744
+ declare class AttributeNotFoundError extends NotFoundError {
1745
+ constructor(attributeId: string);
1746
+ }
1747
+ /**
1748
+ * Record not found error
1749
+ */
1750
+ declare class RecordNotFoundError extends NotFoundError {
1751
+ constructor(recordId: string);
1752
+ }
1753
+ /**
1754
+ * Validation error with field-level details
1755
+ */
1756
+ interface ValidationErrorDetail {
1757
+ path: string[];
1758
+ message: string;
1759
+ code?: string;
1760
+ }
1761
+ /**
1762
+ * Validation error thrown when data fails schema validation
1763
+ */
1764
+ declare class ValidationError extends SchemaError {
1765
+ readonly errors: ValidationErrorDetail[];
1766
+ constructor(message: string, errors: ValidationErrorDetail[]);
1767
+ /**
1768
+ * Create a validation error from Zod-style errors
1769
+ */
1770
+ static fromZodErrors(errors: Array<{
1771
+ path: (string | number)[];
1772
+ message: string;
1773
+ }>): ValidationError;
1774
+ }
1775
+ /**
1776
+ * Error thrown when attempting to modify a protected (system) resource
1777
+ */
1778
+ declare class ProtectedResourceError extends SchemaError {
1779
+ readonly resourceType: "object" | "attribute" | "view";
1780
+ readonly resourceName: string;
1781
+ readonly operation: "delete" | "modify";
1782
+ constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
1783
+ }
1784
+ /**
1785
+ * Error thrown during native object synchronization
1786
+ */
1787
+ declare class SyncError extends SchemaError {
1788
+ readonly objectName: string;
1789
+ readonly cause?: Error;
1790
+ constructor(objectName: string, message: string, cause?: Error);
1791
+ }
1792
+ /**
1793
+ * Error thrown when attempting to create a duplicate resource
1794
+ */
1795
+ declare class DuplicateError extends SchemaError {
1796
+ readonly resourceType: "object" | "attribute";
1797
+ readonly resourceName: string;
1798
+ constructor(resourceType: "object" | "attribute", resourceName: string);
1799
+ }
1800
+ /**
1801
+ * Check if an error is a SchemaError
1802
+ */
1803
+ declare function isSchemaError(error: unknown): error is SchemaError;
1804
+ /**
1805
+ * Check if an error is a NotFoundError
1806
+ */
1807
+ declare function isNotFoundError(error: unknown): error is NotFoundError;
1808
+ /**
1809
+ * Check if an error is a ValidationError
1810
+ */
1811
+ declare function isValidationError(error: unknown): error is ValidationError;
1812
+ /**
1813
+ * Check if an error is a ProtectedResourceError
1814
+ */
1815
+ declare function isProtectedResourceError(error: unknown): error is ProtectedResourceError;
1816
+ /**
1817
+ * Error thrown when a user lacks permission to perform an action
1818
+ */
1819
+ declare class ForbiddenError extends SchemaError {
1820
+ readonly objectName: string;
1821
+ readonly action: string;
1822
+ readonly userId?: string;
1823
+ constructor(objectName: string, action: string, userId?: string);
1824
+ }
1825
+ /**
1826
+ * Error thrown when trying to modify a protected role
1827
+ */
1828
+ declare class ProtectedRoleError extends SchemaError {
1829
+ readonly roleName: string;
1830
+ readonly operation: "delete" | "modify";
1831
+ constructor(roleName: string, operation: "delete" | "modify");
1832
+ }
1833
+ /**
1834
+ * Role not found error
1835
+ */
1836
+ declare class RoleNotFoundError extends NotFoundError {
1837
+ constructor(roleId: string);
1838
+ }
1839
+ /**
1840
+ * Thrown when a record has been modified by another request between read and write.
1841
+ * Clients should retry the operation with fresh data.
1842
+ * Maps to HTTP 409 Conflict.
1843
+ */
1844
+ declare class ConcurrentModificationError extends SchemaError {
1845
+ constructor(recordId: string);
1846
+ }
1847
+ /**
1848
+ * Storage operation type for error context
1849
+ */
1850
+ type StorageOperation = "upload" | "download" | "delete" | "signedUrl";
1851
+ /**
1852
+ * Error thrown when a storage operation fails
1853
+ */
1854
+ declare class StorageError extends SchemaError {
1855
+ readonly operation: StorageOperation;
1856
+ readonly path?: string;
1857
+ readonly cause?: string;
1858
+ constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
1859
+ }
1860
+ /**
1861
+ * Error thrown when access to a resource is denied (e.g., tenant path mismatch)
1862
+ */
1863
+ declare class AccessDeniedError extends SchemaError {
1864
+ readonly resource: string;
1865
+ readonly reason?: string;
1866
+ constructor(resource: string, reason?: string);
1867
+ }
1868
+ /**
1869
+ * Repository operation type for error context
1870
+ */
1871
+ type RepositoryOperation = "create" | "update" | "delete" | "query";
1872
+ /**
1873
+ * Error thrown when a repository operation fails
1874
+ */
1875
+ declare class RepositoryError extends SchemaError {
1876
+ readonly operation: RepositoryOperation;
1877
+ readonly entity: string;
1878
+ readonly cause?: string;
1879
+ constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
1880
+ }
1881
+ /**
1882
+ * Error thrown when a feature or method is not yet implemented
1883
+ */
1884
+ declare class NotImplementedError extends SchemaError {
1885
+ readonly feature: string;
1886
+ readonly milestone?: string;
1887
+ constructor(feature: string, milestone?: string);
1888
+ }
1889
+ /**
1890
+ * Memory entry not found error
1891
+ */
1892
+ declare class MemoryNotFoundError extends NotFoundError {
1893
+ constructor(memoryId: string);
1894
+ }
3122
1895
  /**
3123
1896
  * Reference information for a record that is blocking deletion.
3124
1897
  */
@@ -3135,23 +1908,10 @@ interface RecordReference {
3135
1908
  *
3136
1909
  * This implements the "Restrict" behavior: deletion is blocked and the user
3137
1910
  * must first remove or update the referencing records.
3138
- *
3139
- * @example
3140
- * ```typescript
3141
- * try {
3142
- * await recordService.deleteRecord(companyId);
3143
- * } catch (error) {
3144
- * if (error instanceof RecordReferencedError) {
3145
- * console.log(`Cannot delete: referenced by ${error.references.length} objects`);
3146
- * // Show UI with details: error.references
3147
- * }
3148
- * }
3149
- * ```
3150
1911
  */
3151
- declare class RecordReferencedError extends Error {
1912
+ declare class RecordReferencedError extends SchemaError {
3152
1913
  readonly recordId: string;
3153
1914
  readonly references: RecordReference[];
3154
- readonly code: "RECORD_REFERENCED";
3155
1915
  constructor(recordId: string, references: RecordReference[]);
3156
1916
  }
3157
1917
  /**
@@ -3165,22 +1925,10 @@ type AttributeUsage = "labelExpression" | "view" | "filter";
3165
1925
  * - The object's labelExpression template
3166
1926
  * - A saved view's column configuration
3167
1927
  * - A saved filter condition
3168
- *
3169
- * @example
3170
- * ```typescript
3171
- * try {
3172
- * await schemaService.deleteAttribute(attributeId);
3173
- * } catch (error) {
3174
- * if (error instanceof AttributeInUseError) {
3175
- * console.log(`Cannot delete "${error.attributeName}": used in ${error.usage}`);
3176
- * }
3177
- * }
3178
- * ```
3179
1928
  */
3180
- declare class AttributeInUseError extends Error {
1929
+ declare class AttributeInUseError extends SchemaError {
3181
1930
  readonly attributeName: string;
3182
1931
  readonly usage: AttributeUsage;
3183
- readonly code: "ATTRIBUTE_IN_USE";
3184
1932
  constructor(attributeName: string, usage: AttributeUsage);
3185
1933
  }
3186
1934
  /**
@@ -3188,26 +1936,27 @@ declare class AttributeInUseError extends Error {
3188
1936
  *
3189
1937
  * Objects cannot be deleted if other objects have relation attributes
3190
1938
  * pointing to them as a target.
3191
- *
3192
- * @example
3193
- * ```typescript
3194
- * try {
3195
- * await schemaService.deleteObject(objectId);
3196
- * } catch (error) {
3197
- * if (error instanceof ObjectReferencedError) {
3198
- * console.log(`Cannot delete "${error.objectName}": target of ${error.referencingObjects.join(", ")}`);
3199
- * }
3200
- * }
3201
- * ```
3202
1939
  */
3203
- declare class ObjectReferencedError extends Error {
1940
+ declare class ObjectReferencedError extends SchemaError {
3204
1941
  readonly objectName: string;
3205
1942
  readonly referencingObjects: string[];
3206
- readonly code: "OBJECT_REFERENCED";
3207
1943
  constructor(objectName: string, referencingObjects: string[]);
3208
1944
  }
3209
1945
  /**
3210
- * Extracts a safe error message from an unknown error value.
1946
+ * Check if an error is a RecordReferencedError
1947
+ */
1948
+ declare function isRecordReferencedError(error: unknown): error is RecordReferencedError;
1949
+ /**
1950
+ * Check if an error is an AttributeInUseError
1951
+ */
1952
+ declare function isAttributeInUseError(error: unknown): error is AttributeInUseError;
1953
+ /**
1954
+ * Check if an error is an ObjectReferencedError
1955
+ */
1956
+ declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
1957
+
1958
+ /**
1959
+ * Extracts a safe error message from an unknown error value.
3211
1960
  *
3212
1961
  * @param error - The error value (can be Error, string, unknown)
3213
1962
  * @returns A string message suitable for logging or display
@@ -3224,6 +1973,183 @@ declare class ObjectReferencedError extends Error {
3224
1973
  */
3225
1974
  declare function getErrorMessage(error: unknown): string;
3226
1975
 
1976
+ declare const FORM_FORBIDDEN_ATTRIBUTE_TYPES: readonly ["relation", "multiRelation", "formula", "rollup", "file", "document", "richtext", "user"];
1977
+ interface FormSlotFieldRef {
1978
+ type: "slot";
1979
+ slotId: string;
1980
+ attribute: string;
1981
+ label?: string;
1982
+ tooltip?: string;
1983
+ required?: boolean;
1984
+ }
1985
+ interface FormFreeFieldRef {
1986
+ type: "free";
1987
+ attribute: Attribute;
1988
+ label?: string;
1989
+ tooltip?: string;
1990
+ required?: boolean;
1991
+ }
1992
+ type FormFieldRef = FormSlotFieldRef | FormFreeFieldRef;
1993
+ declare function isFormSlotFieldRef(f: FormFieldRef): f is FormSlotFieldRef;
1994
+ declare function isFormFreeFieldRef(f: FormFieldRef): f is FormFreeFieldRef;
1995
+
1996
+ interface FormFieldsRow {
1997
+ id: string;
1998
+ order: number;
1999
+ type: "fields";
2000
+ fields: FormFieldRef[];
2001
+ }
2002
+ interface FormHeadingRow {
2003
+ id: string;
2004
+ order: number;
2005
+ type: "heading";
2006
+ content: string;
2007
+ level?: 1 | 2 | 3;
2008
+ }
2009
+ interface FormSeparatorRow {
2010
+ id: string;
2011
+ order: number;
2012
+ type: "separator";
2013
+ }
2014
+ interface FormTextRow {
2015
+ id: string;
2016
+ order: number;
2017
+ type: "text";
2018
+ content: string;
2019
+ }
2020
+ type FormRow = FormFieldsRow | FormHeadingRow | FormSeparatorRow | FormTextRow;
2021
+ declare function isFormFieldsRow(row: FormRow): row is FormFieldsRow;
2022
+ declare function isFormHeadingRow(row: FormRow): row is FormHeadingRow;
2023
+ declare function isFormSeparatorRow(row: FormRow): row is FormSeparatorRow;
2024
+ declare function isFormTextRow(row: FormRow): row is FormTextRow;
2025
+
2026
+ type SlotMode = "create" | "select" | "optional" | "create_if_not_empty";
2027
+ interface FormSlot {
2028
+ id: string;
2029
+ objectName: string;
2030
+ label: string;
2031
+ mode: SlotMode;
2032
+ color?: ColorId;
2033
+ icon?: IconName;
2034
+ objectLabel?: string;
2035
+ }
2036
+ interface FormStep {
2037
+ id: string;
2038
+ label: string;
2039
+ description?: string;
2040
+ rows: FormRow[];
2041
+ }
2042
+ type FormStatus = "draft" | "published" | "archived";
2043
+ interface FormDefinition {
2044
+ id?: Uuid;
2045
+ name: string;
2046
+ label: string;
2047
+ description?: string;
2048
+ icon?: IconName;
2049
+ status: FormStatus;
2050
+ version: number;
2051
+ slots: FormSlot[];
2052
+ steps: FormStep[];
2053
+ metadata?: Record<string, unknown>;
2054
+ createdAt?: Date;
2055
+ updatedAt?: Date;
2056
+ }
2057
+ declare function isFormDefinition(obj: unknown): obj is FormDefinition;
2058
+
2059
+ type FormSubmissionStatus = "draft" | "submitted" | "processing" | "completed" | "failed";
2060
+ interface FormSubmission {
2061
+ id?: Uuid;
2062
+ formId: string;
2063
+ formName: string;
2064
+ /** Values by step ID: { [stepId]: { [attrName]: value } } */
2065
+ stepValues: Record<string, Record<string, unknown>>;
2066
+ /** Aggregated values by slot ID: { [slotId]: { [attrName]: value } } */
2067
+ slotValues: Record<string, Record<string, unknown>>;
2068
+ /** Record IDs created on submit: { [slotId]: recordId } */
2069
+ createdRecordIds: Record<string, string>;
2070
+ status: FormSubmissionStatus;
2071
+ currentStepIndex: number;
2072
+ createdBy?: string;
2073
+ submittedAt?: Date;
2074
+ tenantId?: string;
2075
+ createdAt?: Date;
2076
+ updatedAt?: Date;
2077
+ }
2078
+
2079
+ interface DBForm {
2080
+ id: Uuid;
2081
+ tenant_id: string;
2082
+ name: string;
2083
+ label: string;
2084
+ description?: string;
2085
+ icon?: string;
2086
+ status: string;
2087
+ version: number;
2088
+ slots: unknown;
2089
+ steps: unknown;
2090
+ system: boolean;
2091
+ metadata?: unknown;
2092
+ created_at?: string;
2093
+ updated_at?: string;
2094
+ }
2095
+ interface CreateDBForm {
2096
+ tenant_id: string;
2097
+ name: string;
2098
+ label: string;
2099
+ description?: string;
2100
+ icon?: string;
2101
+ status?: string;
2102
+ version?: number;
2103
+ slots?: unknown;
2104
+ steps?: unknown;
2105
+ system?: boolean;
2106
+ metadata?: unknown;
2107
+ }
2108
+ interface UpdateDBForm {
2109
+ label?: string;
2110
+ description?: string;
2111
+ icon?: string;
2112
+ status?: string;
2113
+ version?: number;
2114
+ slots?: unknown;
2115
+ steps?: unknown;
2116
+ metadata?: unknown;
2117
+ updated_at?: string;
2118
+ }
2119
+ interface DBFormSubmission {
2120
+ id: Uuid;
2121
+ tenant_id: string;
2122
+ form_id: Uuid;
2123
+ form_name: string;
2124
+ status: string;
2125
+ current_step_index: number;
2126
+ step_values: unknown;
2127
+ slot_values: unknown;
2128
+ created_record_ids: unknown;
2129
+ created_by?: string;
2130
+ submitted_at?: string;
2131
+ created_at?: string;
2132
+ updated_at?: string;
2133
+ }
2134
+ interface CreateDBFormSubmission {
2135
+ tenant_id: string;
2136
+ form_id: Uuid;
2137
+ form_name: string;
2138
+ status?: string;
2139
+ step_values?: unknown;
2140
+ slot_values?: unknown;
2141
+ created_by?: string;
2142
+ }
2143
+ interface UpdateDBFormSubmission {
2144
+ status?: string;
2145
+ current_step_index?: number;
2146
+ step_values?: unknown;
2147
+ slot_values?: unknown;
2148
+ created_record_ids?: unknown;
2149
+ submitted_at?: string;
2150
+ updated_at?: string;
2151
+ }
2152
+
3227
2153
  /**
3228
2154
  * Autocomplete suggestion from geocoding service
3229
2155
  */
@@ -3392,67 +2318,6 @@ type InferMultiselectValue<A extends MultiselectAttribute> = A["options"] extend
3392
2318
  * This avoids deep conditional nesting that causes TS2589 on large objects
3393
2319
  */
3394
2320
  type InferAttributeValue<A extends Attribute> = A extends StatusAttribute ? InferStatusValue<A> : A extends SelectAttribute ? InferSelectValue<A> : A extends MultiselectAttribute ? InferMultiselectValue<A> : A["type"] extends keyof AttributeValueMap ? AttributeValueMap[A["type"]] : unknown;
3395
- /**
3396
- * Schema definition type for type-safe object definitions
3397
- * Maps attribute names to their builder types
3398
- */
3399
- type AttributeSchema = Record<string, Attribute>;
3400
- /**
3401
- * Infer record type from an attribute schema
3402
- * Creates a typed object with all attribute values
3403
- */
3404
- type InferRecordFromSchema<TSchema extends AttributeSchema> = {
3405
- [K in keyof TSchema]: InferAttributeValue<TSchema[K]>;
3406
- };
3407
- /**
3408
- * Make required attributes required and optional ones optional
3409
- */
3410
- type InferRecordWithRequirements<TSchema extends AttributeSchema> = {
3411
- [K in RequiredAttributeKeys<TSchema>]: InferAttributeValue<TSchema[K]>;
3412
- } & {
3413
- [K in OptionalAttributeKeys<TSchema>]?: InferAttributeValue<TSchema[K]>;
3414
- };
3415
- /**
3416
- * Extract keys of required attributes
3417
- */
3418
- type RequiredAttributeKeys<TSchema extends AttributeSchema> = {
3419
- [K in keyof TSchema]: TSchema[K]["required"] extends true ? K : never;
3420
- }[keyof TSchema];
3421
- /**
3422
- * Extract keys of optional attributes
3423
- */
3424
- type OptionalAttributeKeys<TSchema extends AttributeSchema> = {
3425
- [K in keyof TSchema]: TSchema[K]["required"] extends true ? never : K;
3426
- }[keyof TSchema];
3427
- /**
3428
- * Type-safe attribute entry for builder accumulation
3429
- * Preserves the attribute name as a literal type
3430
- */
3431
- type TypedAttribute<TName extends string = string, TAttr extends Attribute = Attribute> = TAttr & {
3432
- readonly name: TName;
3433
- };
3434
- /**
3435
- * Accumulated attributes map (built via chained .attribute() calls)
3436
- */
3437
- type AttributeMap = Record<string, Attribute>;
3438
- /**
3439
- * Add an attribute to an existing map
3440
- */
3441
- type AddAttribute$1<TMap extends AttributeMap, TName extends string, TAttr extends Attribute> = TMap & {
3442
- [K in TName]: TAttr;
3443
- };
3444
- /**
3445
- * Infer record type from accumulated attribute map
3446
- */
3447
- type InferRecord<TMap extends AttributeMap> = InferRecordWithRequirements<TMap>;
3448
- /**
3449
- * Infer input type for creating a record (all required + partial optional)
3450
- */
3451
- type InferRecordInput<TMap extends AttributeMap> = InferRecordWithRequirements<TMap>;
3452
- /**
3453
- * Infer update type (all fields optional)
3454
- */
3455
- type InferRecordUpdate<TMap extends AttributeMap> = Partial<InferRecordFromSchema<TMap>>;
3456
2321
  /**
3457
2322
  * Base type for custom attribute values added via UI
3458
2323
  * Supports all possible attribute value types
@@ -3581,67 +2446,6 @@ type ExtractRecordUpdateStrict<TBuilder> = TBuilder extends {
3581
2446
  update: infer R;
3582
2447
  };
3583
2448
  } ? Omit<R, SystemFields> : never;
3584
- /**
3585
- * Extract the attribute map from an ObjectBuilder instance
3586
- */
3587
- type ExtractAttributes<TBuilder> = TBuilder extends {
3588
- _types: {
3589
- attributes: infer A;
3590
- };
3591
- } ? A : never;
3592
- /**
3593
- * Raw ObjectRecord structure as stored in the database.
3594
- * Values are stored in the `values` field, not flattened at root level.
3595
- *
3596
- * Use this when working with raw database records or the RecordService.
3597
- */
3598
- interface TypedObjectRecord<TValues extends Record<string, unknown>> extends Timestamps {
3599
- id: string;
3600
- objectId: string;
3601
- label: string;
3602
- completionStatus: CompletionStatus;
3603
- values: TValues;
3604
- metadata?: Record<string, unknown>;
3605
- deletedAt?: Date | null;
3606
- createdBy?: string;
3607
- lastUpdatedBy?: string;
3608
- }
3609
- /**
3610
- * Extract the raw ObjectRecord type from an ObjectBuilder instance.
3611
- * Returns the database structure with typed `values` field.
3612
- *
3613
- * @example
3614
- * ```typescript
3615
- * const PRODUCT = object({ name: "products", label: "Product" })
3616
- * .attribute(text({ name: "name", label: "Name" }).required())
3617
- * .attribute(number({ name: "price", label: "Price" }));
3618
- *
3619
- * type ProductObjectRecord = ExtractObjectRecord<typeof PRODUCT>;
3620
- * // → {
3621
- * // id: string;
3622
- * // objectId: string;
3623
- * // label: string;
3624
- * // completionStatus: CompletionStatus;
3625
- * // values: { name: string; price?: number };
3626
- * // metadata?: Record<string, unknown>;
3627
- * // ...
3628
- * // }
3629
- * ```
3630
- */
3631
- type ExtractObjectRecord<TBuilder> = TBuilder extends {
3632
- _types: {
3633
- record: infer R;
3634
- };
3635
- } ? TypedObjectRecord<R extends Record<string, unknown> ? R : Record<string, unknown>> : never;
3636
- /**
3637
- * Extract the raw ObjectRecord type with custom attribute support.
3638
- * Same as ExtractObjectRecord but allows additional properties in `values`.
3639
- */
3640
- type ExtractObjectRecordWithCustom<TBuilder> = TBuilder extends {
3641
- _types: {
3642
- record: infer R;
3643
- };
3644
- } ? TypedObjectRecord<R extends Record<string, unknown> ? WithCustomAttributes$1<R> : Record<string, CustomAttributeValue>> : never;
3645
2449
 
3646
2450
  /**
3647
2451
  * Context passed to policy methods
@@ -3863,20 +2667,6 @@ declare const SYSTEM_ATTRIBUTES: Record<string, SystemAttribute>;
3863
2667
  * Use this to append system attributes to an object's attribute list
3864
2668
  */
3865
2669
  declare function getSystemAttributeList(): SystemAttribute[];
3866
- /**
3867
- * System attribute names as a union type
3868
- */
3869
- type SystemAttributeName = keyof typeof SYSTEM_ATTRIBUTES;
3870
- /**
3871
- * Check if an attribute name is a system attribute
3872
- */
3873
- declare function isSystemAttribute(name: string): name is SystemAttributeName;
3874
- /**
3875
- * Check if an attribute is a system attribute by its properties
3876
- */
3877
- declare function isSystemAttributeObject(attr: {
3878
- system?: boolean;
3879
- }): boolean;
3880
2670
 
3881
2671
  /**
3882
2672
  * User status for account management
@@ -3990,54 +2780,6 @@ interface InviteUserInput {
3990
2780
  redirectTo?: string;
3991
2781
  }
3992
2782
 
3993
- /**
3994
- * API types for workflow operations.
3995
- *
3996
- * These types represent the client-side API contract.
3997
- * Server-side types (with fields like startedBy) are in runtime/services.
3998
- *
3999
- * @packageDocumentation
4000
- */
4001
- /**
4002
- * API input for starting a workflow instance (client-side).
4003
- *
4004
- * Note: `startedBy` is added server-side from authentication context.
4005
- *
4006
- * @example
4007
- * ```typescript
4008
- * const input: StartWorkflowApiInput = {
4009
- * workflowName: "onboarding",
4010
- * initialSlots: {
4011
- * user: { id: "user-123" },
4012
- * },
4013
- * };
4014
- * ```
4015
- */
4016
- interface StartWorkflowApiInput {
4017
- /** Name of the workflow to start */
4018
- workflowName: string;
4019
- /** Initial slot data (for "select" mode slots) */
4020
- initialSlots?: Record<string, Record<string, unknown>>;
4021
- /** Custom variables to initialize */
4022
- variables?: Record<string, unknown>;
4023
- }
4024
- /**
4025
- * API input for resuming a waiting workflow instance (client-side).
4026
- *
4027
- * @example
4028
- * ```typescript
4029
- * const input: ResumeWorkflowApiInput = {
4030
- * input: {
4031
- * user: { approved: true, notes: "All good" },
4032
- * },
4033
- * };
4034
- * ```
4035
- */
4036
- interface ResumeWorkflowApiInput {
4037
- /** Form/action data to submit, keyed by slot ID */
4038
- input: Record<string, unknown>;
4039
- }
4040
-
4041
2783
  /**
4042
2784
  * Utility functions for working with objects.
4043
2785
  * Provides type-safe helpers to avoid common anti-patterns like Object.keys().length checks.
@@ -4069,560 +2811,159 @@ declare function isNotEmpty(obj: unknown): obj is Record<string, unknown>;
4069
2811
  *
4070
2812
  * @example
4071
2813
  * const params = toUndefinedIfEmpty({ foo: 'bar' }); // { foo: 'bar' }
4072
- * const empty = toUndefinedIfEmpty({}); // undefined
4073
- */
4074
- declare function toUndefinedIfEmpty<T extends Record<string, unknown>>(obj: T | undefined | null): T | undefined;
4075
- /**
4076
- * Checks if an object has at least one own enumerable property.
4077
- * Alias for isNotEmpty for better readability in some contexts.
4078
- *
4079
- * @example
4080
- * if (hasProperties(config)) {
4081
- * // config has at least one property
4082
- * }
4083
- */
4084
- declare function hasProperties(obj: unknown): obj is Record<string, unknown>;
4085
-
4086
- /**
4087
- * Default empty value placeholder
4088
- */
4089
- declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
4090
- /**
4091
- * Format an attribute value for display
4092
- *
4093
- * This function converts raw attribute values into human-readable strings
4094
- * based on the attribute type and configuration.
4095
- *
4096
- * @param value - The raw value to format
4097
- * @param attribute - The attribute definition
4098
- * @returns Formatted string representation
4099
- *
4100
- * @example
4101
- * ```typescript
4102
- * // Text attribute
4103
- * formatAttributeValue("Hello", textAttr);
4104
- * // → "Hello"
4105
- *
4106
- * // Currency attribute
4107
- * formatAttributeValue({ value: 1500, code: "EUR" }, currencyAttr);
4108
- * // → "1,500.00 EUR"
4109
- *
4110
- * // Select attribute with options
4111
- * formatAttributeValue("active", statusAttr);
4112
- * // → "Active" (label from options)
4113
- *
4114
- * // Location with city granularity
4115
- * formatAttributeValue({ city: "Paris", country: "FRA" }, locationAttr);
4116
- * // → "Paris, FRA"
4117
- *
4118
- * // Empty value
4119
- * formatAttributeValue(null, textAttr);
4120
- * // → "—"
4121
- * ```
4122
- */
4123
- declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
4124
-
4125
- type PhoneNormalizationResult = {
4126
- success: true;
4127
- phone: Phone;
4128
- } | {
4129
- success: false;
4130
- error: string;
4131
- };
4132
- /**
4133
- * Normalize a phone number to storage format: national digits without trunk prefix.
4134
- *
4135
- * Handles multiple input formats:
4136
- * - National with trunk: "06 12 34 56 78" → "612345678"
4137
- * - National without trunk: "6 12 34 56 78" → "612345678"
4138
- * - E.164: "+33612345678" → "612345678"
4139
- * - Raw digits: "0612345678" → "612345678"
4140
- *
4141
- * @returns Normalized national digits (without trunk prefix, without spaces)
4142
- */
4143
- declare function normalizePhoneNumber(phoneNumber: string, countryIso3: CountryIso3): string;
4144
- /**
4145
- * Validate a phone number against a country.
4146
- *
4147
- * Expects normalized input (national digits without trunk prefix).
4148
- * Uses libphonenumber-js for accurate validation with fallback to digit count.
4149
- */
4150
- declare function validatePhoneNumber(phoneNumber: string, countryIso3: CountryIso3): boolean;
4151
- /**
4152
- * Format a Phone object for international display.
4153
- *
4154
- * @example
4155
- * formatPhoneForDisplay({ countryCode: "FRA", phoneNumber: "612345678" })
4156
- * // → "+33 6 12 34 56 78"
4157
- *
4158
- * formatPhoneForDisplay({ countryCode: "USA", phoneNumber: "5551234567" })
4159
- * // → "+1 555 123 4567"
4160
- */
4161
- declare function formatPhoneForDisplay(phone: Phone): string;
4162
- /**
4163
- * Parse and normalize a raw phone input into the storage Phone format.
4164
- * Handles various input formats including corrupted data from imports.
4165
- *
4166
- * @example
4167
- * parseRawPhoneInput("+33612345678", "FRA")
4168
- * // → { success: true, phone: { countryCode: "FRA", phoneNumber: "612345678" } }
4169
- *
4170
- * parseRawPhoneInput("0+324988613", "FRA")
4171
- * // → { success: false, error: "Invalid phone number for country" }
4172
- */
4173
- declare function parseRawPhoneInput(rawInput: string, countryIso3: CountryIso3): PhoneNormalizationResult;
4174
-
4175
- /**
4176
- * Substitute `{{ props.X }}` tokens in a relation label using client-side props.
4177
- *
4178
- * The backend preserves `{{ props.X }}` and `{{ props.X | pipe }}` tokens in labels
4179
- * (sentinel approach). This function resolves them on the client using the props
4180
- * the client already has, leveraging the existing template engine for pipe support
4181
- * (prefix, suffix, wrap, UPPER, LOWER, etc.).
4182
- *
4183
- * Each prop value is formatted using its attribute definition via `formatAttributeValue`
4184
- * (e.g., select → label, currency → "1,500 EUR", rating → "4/5") BEFORE pipe processing.
4185
- *
4186
- * When props are missing or empty, the tokens and surrounding punctuation are cleaned up
4187
- * so the label reads naturally (e.g., "Apple ()" → "Apple").
4188
- *
4189
- * @param label - The label string potentially containing `{{ props.X }}` tokens
4190
- * @param props - Property values keyed by property name
4191
- * @param propertyDefs - Attribute definitions for the properties (used for formatting)
4192
- * @returns The label with tokens substituted and cleaned up
4193
- *
4194
- * @example
4195
- * ```typescript
4196
- * applyRelationProps(
4197
- * "Apple{{ props.role | prefix:' - ' }}{{ props.pct | prefix:' (' | suffix:'%)' }}",
4198
- * { role: "ceo", pct: 25 },
4199
- * [{ name: "role", type: "select", options: [{ value: "ceo", label: "CEO" }] },
4200
- * { name: "pct", type: "number" }]
4201
- * );
4202
- * // → "Apple - CEO (25%)"
4203
- *
4204
- * applyRelationProps("Apple{{ props.role | prefix:' - ' }}", undefined, []);
4205
- * // → "Apple"
4206
- * ```
4207
- */
4208
- declare function applyRelationProps(label: string, props: Record<string, unknown> | undefined, propertyDefs: Attribute[] | undefined): string;
4209
-
4210
- /**
4211
- * Valid simple pipe names (no arguments)
4212
- */
4213
- declare const SIMPLE_PIPES: readonly ["UPPER", "LOWER", "capitalize", "trim"];
4214
- /**
4215
- * Valid pipe names that take arguments
4216
- */
4217
- declare const PIPES_WITH_ARGS: readonly ["prefix", "suffix", "wrap", "default"];
4218
- /**
4219
- * All valid pipe names
4220
- */
4221
- declare const ALL_PIPES: readonly ["UPPER", "LOWER", "capitalize", "trim", "prefix", "suffix", "wrap", "default"];
4222
- type SimplePipe = (typeof SIMPLE_PIPES)[number];
4223
- type PipeWithArgs = (typeof PIPES_WITH_ARGS)[number];
4224
- type LabelPipe = (typeof ALL_PIPES)[number];
4225
- /**
4226
- * Zod schema for validating labelExpression templates.
4227
- *
4228
- * Validates the syntax of label expression templates used throughout the system.
4229
- * Uses the existing `isLabelExpression` function for basic validation, then
4230
- * performs additional checks for pipe validity.
4231
- *
4232
- * @example Valid expressions:
4233
- * ```typescript
4234
- * "{{ name }}"
4235
- * "{{ firstName }} {{ lastName }}"
4236
- * "{{ name | UPPER }}"
4237
- * "{{ role | prefix:\", \" }}"
4238
- * "{{ firstName || name }}"
4239
- * "{{ user.firstName }}"
4240
- * ```
4241
- */
4242
- declare const labelExpressionSchema: z.ZodString;
4243
- type LabelExpression = z.infer<typeof labelExpressionSchema>;
4244
- /**
4245
- * Validate a labelExpression and return detailed result
4246
- *
4247
- * @param expression - The labelExpression to validate
4248
- * @returns Validation result with success status and extracted info
4249
- */
4250
- declare function validateLabelExpression(expression: string): {
4251
- success: boolean;
4252
- error?: string;
4253
- attributes?: string[];
4254
- };
4255
- /**
4256
- * Default fallback value when expression resolves to empty string
4257
- */
4258
- declare const DEFAULT_LABEL_FALLBACK = "(Untitled)";
4259
- /**
4260
- * Render a label expression template with values
4261
- *
4262
- * Supports:
4263
- * - Variable interpolation: `{{ fieldName }}`
4264
- * - Dot notation: `{{ user.firstName }}`
4265
- * - Simple pipes: `{{ name | UPPER }}`, `{{ name | capitalize | trim }}`
4266
- * - Conditional pipes with args: `{{ role | prefix:", " }}`, `{{ name | suffix:" Inc." }}`
4267
- *
4268
- * Available pipes:
4269
- * - `UPPER` - Convert to uppercase
4270
- * - `LOWER` - Convert to lowercase
4271
- * - `capitalize` - Capitalize first letter of each word
4272
- * - `trim` - Trim whitespace
4273
- * - `prefix:"text"` - Add prefix only if value is non-empty
4274
- * - `suffix:"text"` - Add suffix only if value is non-empty
4275
- * - `wrap:"pre" "suf"` - Wrap with prefix/suffix only if non-empty
4276
- * - `default:"text"` - Show default value if empty
4277
- *
4278
- * @param template - The label expression template (e.g., "{{ firstName }} {{ lastName }}")
4279
- * @param values - Record values to interpolate
4280
- * @param fallback - Fallback value if result is empty (default: "(Untitled)")
4281
- * @returns The rendered label string
4282
- */
4283
- declare function renderLabelExpression(template: string, values: Record<string, unknown>, fallback?: string): string;
4284
- /**
4285
- * Check if a string is a valid label expression template
4286
- * A valid template contains at least one {{ variable }} block with a non-empty variable
4287
- */
4288
- declare function isLabelExpression(value: string): boolean;
4289
- /**
4290
- * Extract attribute names referenced in a label expression
4291
- * Useful for validation or dependency tracking
4292
- *
4293
- * @example
4294
- * extractAttributeNames("{{ firstName }} {{ lastName | UPPER }}")
4295
- * // -> ["firstName", "lastName"]
4296
- */
4297
- declare function extractAttributeNames(template: string): string[];
4298
-
4299
- /**
4300
- * System resources that can be managed through permissions.
4301
- */
4302
- declare const SYSTEM_RESOURCES: {
4303
- /** User profiles, invitations, roles and permissions management */
4304
- readonly PEOPLE: "people";
4305
- /** Tenant settings, audit logs, workflow execution, document generation */
4306
- readonly WORKSPACE: "workspace";
4307
- /** Object definitions, attributes, views, workflow definitions */
4308
- readonly ARCHITECT: "architect";
4309
- };
4310
- /**
4311
- * All system resources as an array (for iteration)
4312
- */
4313
- declare const ALL_SYSTEM_RESOURCES: SystemResource[];
4314
- /**
4315
- * Human-readable labels for system resources
4316
- */
4317
- declare const SYSTEM_RESOURCE_LABELS: Record<SystemResource, string>;
4318
- /**
4319
- * Default role names that are created for every tenant.
4320
- */
4321
- declare const DEFAULT_ROLES: {
4322
- /** Full platform access - can manage everything */
4323
- readonly OWNER: "owner";
4324
- /** Standard user - can work with business data and view people */
4325
- readonly MEMBER: "member";
4326
- };
4327
- type DefaultRoleName = (typeof DEFAULT_ROLES)[keyof typeof DEFAULT_ROLES];
4328
- /**
4329
- * Human-readable labels for default roles
4330
- */
4331
- declare const DEFAULT_ROLE_LABELS: Record<DefaultRoleName, string>;
4332
- /**
4333
- * Descriptions for default roles
4334
- */
4335
- declare const DEFAULT_ROLE_DESCRIPTIONS: Record<DefaultRoleName, string>;
4336
- /**
4337
- * Default permission configuration for each role.
4338
- * Used when initializing a new tenant.
4339
- */
4340
- interface DefaultRolePermissionConfig {
4341
- /** System resource permissions (people, workspace) */
4342
- system: Array<{
4343
- target: SystemResource | "*";
4344
- actions: Action[];
4345
- }>;
4346
- /** Object permissions (business data) */
4347
- object: Array<{
4348
- target: string;
4349
- actions: Action[];
4350
- }>;
4351
- }
4352
- /**
4353
- * Default permissions for each built-in role.
4354
- *
4355
- * - **owner**: Full access to everything (system + objects)
4356
- * - **member**: Read-only people access, full CRUD on objects
4357
- */
4358
- declare const DEFAULT_ROLE_PERMISSIONS: Record<DefaultRoleName, DefaultRolePermissionConfig>;
4359
- /**
4360
- * The role automatically assigned to newly invited users.
4361
- */
4362
- declare const DEFAULT_ROLE_FOR_NEW_USERS: DefaultRoleName;
4363
- /**
4364
- * Check if a role name is a default/built-in role
4365
- */
4366
- declare function isDefaultRole(roleName: string): roleName is DefaultRoleName;
4367
-
4368
- /**
4369
- * Error codes for schema exceptions
4370
- */
4371
- declare const SchemaErrorCode: {
4372
- readonly UNKNOWN: "SCHEMA_UNKNOWN_ERROR";
4373
- readonly OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND";
4374
- readonly ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND";
4375
- readonly RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND";
4376
- readonly USER_PROFILE_NOT_FOUND: "SCHEMA_USER_PROFILE_NOT_FOUND";
4377
- readonly FILE_NOT_FOUND: "SCHEMA_FILE_NOT_FOUND";
4378
- readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
4379
- readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
4380
- readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
4381
- readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
4382
- readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
4383
- readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
4384
- readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
4385
- readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
4386
- readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
4387
- readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
4388
- readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
4389
- readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
4390
- readonly NOT_SYSTEM_OBJECT: "SCHEMA_NOT_SYSTEM_OBJECT";
4391
- readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
4392
- readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
4393
- readonly CONFLICT: "SCHEMA_CONFLICT";
4394
- readonly STORAGE_UPLOAD_FAILED: "SCHEMA_STORAGE_UPLOAD_FAILED";
4395
- readonly STORAGE_DOWNLOAD_FAILED: "SCHEMA_STORAGE_DOWNLOAD_FAILED";
4396
- readonly STORAGE_DELETE_FAILED: "SCHEMA_STORAGE_DELETE_FAILED";
4397
- readonly STORAGE_URL_FAILED: "SCHEMA_STORAGE_URL_FAILED";
4398
- readonly REPOSITORY_CREATE_FAILED: "SCHEMA_REPOSITORY_CREATE_FAILED";
4399
- readonly REPOSITORY_UPDATE_FAILED: "SCHEMA_REPOSITORY_UPDATE_FAILED";
4400
- readonly REPOSITORY_DELETE_FAILED: "SCHEMA_REPOSITORY_DELETE_FAILED";
4401
- readonly REPOSITORY_QUERY_FAILED: "SCHEMA_REPOSITORY_QUERY_FAILED";
4402
- readonly NOT_IMPLEMENTED: "SCHEMA_NOT_IMPLEMENTED";
4403
- };
4404
- type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
4405
- /**
4406
- * Base error class for all schema-related errors
4407
- */
4408
- declare class SchemaError extends Error {
4409
- readonly code: SchemaErrorCode;
4410
- readonly details?: Record<string, unknown>;
4411
- constructor(message: string, code?: SchemaErrorCode, details?: Record<string, unknown>);
4412
- toJSON(): {
4413
- name: string;
4414
- code: SchemaErrorCode;
4415
- message: string;
4416
- details: Record<string, unknown> | undefined;
4417
- };
4418
- }
4419
- /**
4420
- * Base class for "not found" errors
4421
- */
4422
- declare class NotFoundError extends SchemaError {
4423
- readonly resourceType: string;
4424
- readonly resourceId: string;
4425
- constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode);
4426
- }
4427
- /**
4428
- * Object not found error
4429
- */
4430
- declare class ObjectNotFoundError extends NotFoundError {
4431
- constructor(objectId: string);
4432
- }
4433
- /**
4434
- * Attribute not found error
4435
- */
4436
- declare class AttributeNotFoundError extends NotFoundError {
4437
- constructor(attributeId: string);
4438
- }
4439
- /**
4440
- * Record not found error
4441
- */
4442
- declare class RecordNotFoundError extends NotFoundError {
4443
- constructor(recordId: string);
4444
- }
4445
- /**
4446
- * User profile not found error
4447
- */
4448
- declare class UserProfileNotFoundError extends NotFoundError {
4449
- constructor(identifier: string);
4450
- }
4451
- /**
4452
- * File not found error
4453
- */
4454
- declare class FileNotFoundError extends NotFoundError {
4455
- constructor(fileId: string);
4456
- }
4457
- /**
4458
- * Validation error with field-level details
4459
- */
4460
- interface ValidationErrorDetail {
4461
- path: string[];
4462
- message: string;
4463
- code?: string;
4464
- }
4465
- /**
4466
- * Validation error thrown when data fails schema validation
4467
- */
4468
- declare class ValidationError extends SchemaError {
4469
- readonly errors: ValidationErrorDetail[];
4470
- constructor(message: string, errors: ValidationErrorDetail[]);
4471
- /**
4472
- * Create a validation error from Zod-style errors
4473
- */
4474
- static fromZodErrors(errors: Array<{
4475
- path: (string | number)[];
4476
- message: string;
4477
- }>): ValidationError;
4478
- }
4479
- /**
4480
- * Error thrown when attempting to modify a protected (system) resource
4481
- */
4482
- declare class ProtectedResourceError extends SchemaError {
4483
- readonly resourceType: "object" | "attribute" | "view";
4484
- readonly resourceName: string;
4485
- readonly operation: "delete" | "modify";
4486
- constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
4487
- }
4488
- /**
4489
- * Error thrown during native object synchronization
4490
- */
4491
- declare class SyncError extends SchemaError {
4492
- readonly objectName: string;
4493
- readonly cause?: Error;
4494
- constructor(objectName: string, message: string, cause?: Error);
4495
- }
4496
- /**
4497
- * Error thrown when trying to sync a non-system object as native
4498
- */
4499
- declare class NotSystemObjectError extends SchemaError {
4500
- readonly objectName: string;
4501
- constructor(objectName: string);
4502
- }
4503
- /**
4504
- * Error thrown when attempting to create a duplicate resource
4505
- */
4506
- declare class DuplicateError extends SchemaError {
4507
- readonly resourceType: "object" | "attribute";
4508
- readonly resourceName: string;
4509
- constructor(resourceType: "object" | "attribute", resourceName: string);
4510
- }
4511
- /**
4512
- * Check if an error is a SchemaError
4513
- */
4514
- declare function isSchemaError(error: unknown): error is SchemaError;
4515
- /**
4516
- * Check if an error is a NotFoundError
4517
- */
4518
- declare function isNotFoundError(error: unknown): error is NotFoundError;
4519
- /**
4520
- * Check if an error is a ValidationError
4521
- */
4522
- declare function isValidationError(error: unknown): error is ValidationError;
4523
- /**
4524
- * Check if an error is a ProtectedResourceError
4525
- */
4526
- declare function isProtectedResourceError(error: unknown): error is ProtectedResourceError;
4527
- /**
4528
- * Error thrown when a user lacks permission to perform an action
4529
- */
4530
- declare class ForbiddenError extends SchemaError {
4531
- readonly objectName: string;
4532
- readonly action: string;
4533
- readonly userId?: string;
4534
- constructor(objectName: string, action: string, userId?: string);
4535
- }
2814
+ * const empty = toUndefinedIfEmpty({}); // undefined
2815
+ */
2816
+ declare function toUndefinedIfEmpty<T extends Record<string, unknown>>(obj: T | undefined | null): T | undefined;
2817
+
4536
2818
  /**
4537
- * Error thrown when trying to modify a protected role
2819
+ * Default empty value placeholder
4538
2820
  */
4539
- declare class ProtectedRoleError extends SchemaError {
4540
- readonly roleName: string;
4541
- readonly operation: "delete" | "modify";
4542
- constructor(roleName: string, operation: "delete" | "modify");
4543
- }
2821
+ declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
4544
2822
  /**
4545
- * Role not found error
2823
+ * Format an attribute value for display
2824
+ *
2825
+ * This function converts raw attribute values into human-readable strings
2826
+ * based on the attribute type and configuration.
2827
+ *
2828
+ * @param value - The raw value to format
2829
+ * @param attribute - The attribute definition
2830
+ * @returns Formatted string representation
2831
+ *
2832
+ * @example
2833
+ * ```typescript
2834
+ * // Text attribute
2835
+ * formatAttributeValue("Hello", textAttr);
2836
+ * // → "Hello"
2837
+ *
2838
+ * // Currency attribute
2839
+ * formatAttributeValue({ value: 1500, code: "EUR" }, currencyAttr);
2840
+ * // → "1,500.00 EUR"
2841
+ *
2842
+ * // Select attribute with options
2843
+ * formatAttributeValue("active", statusAttr);
2844
+ * // → "Active" (label from options)
2845
+ *
2846
+ * // Location with city granularity
2847
+ * formatAttributeValue({ city: "Paris", country: "FRA" }, locationAttr);
2848
+ * // → "Paris, FRA"
2849
+ *
2850
+ * // Empty value
2851
+ * formatAttributeValue(null, textAttr);
2852
+ * // → "—"
2853
+ * ```
4546
2854
  */
4547
- declare class RoleNotFoundError extends NotFoundError {
4548
- constructor(roleId: string);
4549
- }
2855
+ declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
2856
+
4550
2857
  /**
4551
- * Check if an error is a ForbiddenError
2858
+ * Render a label expression template with values
2859
+ *
2860
+ * Supports:
2861
+ * - Variable interpolation: `{{ fieldName }}`
2862
+ * - Dot notation: `{{ user.firstName }}`
2863
+ * - Simple pipes: `{{ name | UPPER }}`, `{{ name | capitalize | trim }}`
2864
+ * - Conditional pipes with args: `{{ role | prefix:", " }}`, `{{ name | suffix:" Inc." }}`
2865
+ *
2866
+ * Available pipes:
2867
+ * - `UPPER` - Convert to uppercase
2868
+ * - `LOWER` - Convert to lowercase
2869
+ * - `capitalize` - Capitalize first letter of each word
2870
+ * - `trim` - Trim whitespace
2871
+ * - `prefix:"text"` - Add prefix only if value is non-empty
2872
+ * - `suffix:"text"` - Add suffix only if value is non-empty
2873
+ * - `wrap:"pre" "suf"` - Wrap with prefix/suffix only if non-empty
2874
+ * - `default:"text"` - Show default value if empty
2875
+ *
2876
+ * @param template - The label expression template (e.g., "{{ firstName }} {{ lastName }}")
2877
+ * @param values - Record values to interpolate
2878
+ * @param fallback - Fallback value if result is empty (default: "(Untitled)")
2879
+ * @returns The rendered label string
4552
2880
  */
4553
- declare function isForbiddenError(error: unknown): error is ForbiddenError;
2881
+ declare function renderLabelExpression(template: string, values: Record<string, unknown>, fallback?: string): string;
4554
2882
  /**
4555
- * Thrown when a record has been modified by another request between read and write.
4556
- * Clients should retry the operation with fresh data.
4557
- * Maps to HTTP 409 Conflict.
2883
+ * Check if a string is a valid label expression template
2884
+ * A valid template contains at least one {{ variable }} block with a non-empty variable
4558
2885
  */
4559
- declare class ConcurrentModificationError extends SchemaError {
4560
- constructor(recordId: string);
4561
- }
2886
+ declare function isLabelExpression(value: string): boolean;
4562
2887
  /**
4563
- * Storage operation type for error context
2888
+ * Extract attribute names referenced in a label expression
2889
+ * Useful for validation or dependency tracking
2890
+ *
2891
+ * @example
2892
+ * extractAttributeNames("{{ firstName }} {{ lastName | UPPER }}")
2893
+ * // -> ["firstName", "lastName"]
4564
2894
  */
4565
- type StorageOperation = "upload" | "download" | "delete" | "signedUrl";
2895
+ declare function extractAttributeNames(template: string): string[];
2896
+
4566
2897
  /**
4567
- * Error thrown when a storage operation fails
2898
+ * Attribute fields stored in dedicated database columns (not in config JSONB).
2899
+ * Used to determine which properties are extracted into the config column during sync.
4568
2900
  */
4569
- declare class StorageError extends SchemaError {
4570
- readonly operation: StorageOperation;
4571
- readonly path?: string;
4572
- readonly cause?: string;
4573
- constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
4574
- }
2901
+ declare const DB_COLUMN_FIELDS: ReadonlySet<string>;
2902
+
4575
2903
  /**
4576
- * Check if an error is a StorageError
2904
+ * System resources that can be managed through permissions.
4577
2905
  */
4578
- declare function isStorageError(error: unknown): error is StorageError;
2906
+ declare const SYSTEM_RESOURCES: {
2907
+ /** User profiles, invitations, roles and permissions management */
2908
+ readonly PEOPLE: "people";
2909
+ /** Tenant settings, audit logs, workflow execution, document generation */
2910
+ readonly WORKSPACE: "workspace";
2911
+ /** Object definitions, attributes, views, workflow definitions */
2912
+ readonly ARCHITECT: "architect";
2913
+ };
4579
2914
  /**
4580
- * Error thrown when access to a resource is denied (e.g., tenant path mismatch)
2915
+ * All system resources as an array (for iteration)
4581
2916
  */
4582
- declare class AccessDeniedError extends SchemaError {
4583
- readonly resource: string;
4584
- readonly reason?: string;
4585
- constructor(resource: string, reason?: string);
4586
- }
2917
+ declare const ALL_SYSTEM_RESOURCES: SystemResource[];
4587
2918
  /**
4588
- * Check if an error is an AccessDeniedError
2919
+ * Human-readable labels for system resources
4589
2920
  */
4590
- declare function isAccessDeniedError(error: unknown): error is AccessDeniedError;
2921
+ declare const SYSTEM_RESOURCE_LABELS: Record<SystemResource, string>;
4591
2922
  /**
4592
- * Repository operation type for error context
2923
+ * Default role names that are created for every tenant.
4593
2924
  */
4594
- type RepositoryOperation = "create" | "update" | "delete" | "query";
2925
+ declare const DEFAULT_ROLES: {
2926
+ /** Full platform access - can manage everything */
2927
+ readonly OWNER: "owner";
2928
+ /** Standard user - can work with business data and view people */
2929
+ readonly MEMBER: "member";
2930
+ };
2931
+ type DefaultRoleName = (typeof DEFAULT_ROLES)[keyof typeof DEFAULT_ROLES];
4595
2932
  /**
4596
- * Error thrown when a repository operation fails
2933
+ * Human-readable labels for default roles
4597
2934
  */
4598
- declare class RepositoryError extends SchemaError {
4599
- readonly operation: RepositoryOperation;
4600
- readonly entity: string;
4601
- readonly cause?: string;
4602
- constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
4603
- }
2935
+ declare const DEFAULT_ROLE_LABELS: Record<DefaultRoleName, string>;
4604
2936
  /**
4605
- * Check if an error is a RepositoryError
2937
+ * Descriptions for default roles
4606
2938
  */
4607
- declare function isRepositoryError(error: unknown): error is RepositoryError;
2939
+ declare const DEFAULT_ROLE_DESCRIPTIONS: Record<DefaultRoleName, string>;
4608
2940
  /**
4609
- * Error thrown when a feature or method is not yet implemented
2941
+ * Default permission configuration for each role.
2942
+ * Used when initializing a new tenant.
4610
2943
  */
4611
- declare class NotImplementedError extends SchemaError {
4612
- readonly feature: string;
4613
- readonly milestone?: string;
4614
- constructor(feature: string, milestone?: string);
2944
+ interface DefaultRolePermissionConfig {
2945
+ /** System resource permissions (people, workspace) */
2946
+ system: Array<{
2947
+ target: SystemResource | "*";
2948
+ actions: Action[];
2949
+ }>;
2950
+ /** Object permissions (business data) */
2951
+ object: Array<{
2952
+ target: string;
2953
+ actions: Action[];
2954
+ }>;
4615
2955
  }
4616
2956
  /**
4617
- * Check if an error is a NotImplementedError
2957
+ * Default permissions for each built-in role.
2958
+ *
2959
+ * - **owner**: Full access to everything (system + objects)
2960
+ * - **member**: Read-only people access, full CRUD on objects
4618
2961
  */
4619
- declare function isNotImplementedError(error: unknown): error is NotImplementedError;
2962
+ declare const DEFAULT_ROLE_PERMISSIONS: Record<DefaultRoleName, DefaultRolePermissionConfig>;
4620
2963
  /**
4621
- * Memory entry not found error
2964
+ * Check if a role name is a default/built-in role
4622
2965
  */
4623
- declare class MemoryNotFoundError extends NotFoundError {
4624
- constructor(memoryId: string);
4625
- }
2966
+ declare function isDefaultRole(roleName: string): roleName is DefaultRoleName;
4626
2967
 
4627
2968
  /**
4628
2969
  * Builder config with literal name type preservation
@@ -5537,26 +3878,79 @@ declare class DocumentAttributeBuilder<TName extends string, TRequired extends b
5537
3878
  * ```
5538
3879
  */
5539
3880
  declare function document<TName extends string>(config: TypedBuilderConfig<TName>): DocumentAttributeBuilder<TName, false>;
3881
+
5540
3882
  /**
5541
- * Union of all attribute builder types
5542
- */
5543
- type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | RichtextAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean> | FormulaAttributeBuilder<string> | RollupAttributeBuilder<string> | DocumentAttributeBuilder<string, boolean>;
5544
- /**
5545
- * Extract the attribute name from a builder
5546
- */
5547
- type ExtractAttributeName<T> = T extends {
5548
- _types: {
5549
- name: infer N;
5550
- };
5551
- } ? N : never;
5552
- /**
5553
- * Extract the required flag from a builder
3883
+ * Validate attribute name as valid variable identifier
5554
3884
  */
5555
- type ExtractAttributeRequired<T> = T extends {
5556
- _types: {
5557
- required: infer R;
5558
- };
5559
- } ? R : false;
3885
+ declare function validateAttributeName(name: string): void;
3886
+
3887
+ interface AnyAttributeBuilder {
3888
+ build(): Attribute;
3889
+ }
3890
+ declare class FormRowBuilder {
3891
+ private stepBuilder;
3892
+ private rowData;
3893
+ private _finalized;
3894
+ constructor(stepBuilder: FormStepBuilder, rowId: string, order: number);
3895
+ field(slotId: string, attribute: string, options?: {
3896
+ label?: string;
3897
+ required?: boolean;
3898
+ }): this;
3899
+ freeField(builder: AnyAttributeBuilder, options?: {
3900
+ label?: string;
3901
+ required?: boolean;
3902
+ }): this;
3903
+ row(id: string): FormRowBuilder;
3904
+ heading(content: string, level?: 1 | 2 | 3): FormStepBuilder;
3905
+ separator(): FormStepBuilder;
3906
+ text(content: string): FormStepBuilder;
3907
+ endRow(): FormStepBuilder;
3908
+ }
3909
+ declare class FormStepBuilder {
3910
+ private formBuilder;
3911
+ private stepData;
3912
+ private rowOrder;
3913
+ constructor(formBuilder: FormBuilder, id: string, label: string);
3914
+ description(text: string): this;
3915
+ field(slotId: string, attribute: string, options?: {
3916
+ label?: string;
3917
+ required?: boolean;
3918
+ }): this;
3919
+ freeField(builder: AnyAttributeBuilder, options?: {
3920
+ label?: string;
3921
+ required?: boolean;
3922
+ }): this;
3923
+ row(id: string): FormRowBuilder;
3924
+ heading(content: string, level?: 1 | 2 | 3): this;
3925
+ separator(): this;
3926
+ text(content: string): this;
3927
+ step(id: string, label: string): FormStepBuilder;
3928
+ build(): FormDefinition;
3929
+ _finalizeRow(row: FormFieldsRow): this;
3930
+ _getData(): FormStep;
3931
+ }
3932
+ declare class FormBuilder {
3933
+ private data;
3934
+ constructor(name: string, label: string);
3935
+ description(value: string): this;
3936
+ icon(value: IconName): this;
3937
+ status(value: FormStatus): this;
3938
+ metadata(value: Record<string, unknown>): this;
3939
+ slot(id: string, objectName: string, options: {
3940
+ label: string;
3941
+ mode?: SlotMode;
3942
+ color?: ColorId;
3943
+ icon?: IconName;
3944
+ }): this;
3945
+ step(id: string, label: string): FormStepBuilder;
3946
+ build(): FormDefinition;
3947
+ _finalizeStep(step: FormStep): this;
3948
+ private validateName;
3949
+ private validateRequiredData;
3950
+ private validateSlotReferences;
3951
+ private validateFreeFields;
3952
+ }
3953
+ declare function form(name: string, label: string): FormBuilder;
5560
3954
 
5561
3955
  interface ChangeTypeOptions {
5562
3956
  /** Optional explicit transform function (used to resolve a BuiltInTransform) */
@@ -6157,62 +4551,12 @@ declare class ActivityTabConfig {
6157
4551
  */
6158
4552
  build(): DetailViewDefinition;
6159
4553
  }
6160
- /**
6161
- * Builder for configuring flows tabs (workflow instances)
6162
- *
6163
- * @example
6164
- * ```typescript
6165
- * .tab("workflows", "Workflows")
6166
- * .flows()
6167
- * .allowStart()
6168
- * .allowCancel()
6169
- * .statusFilter("running", "waiting")
6170
- * ```
6171
- */
6172
- declare class FlowsTabConfig {
6173
- private view;
6174
- private tabData;
6175
- /** @internal */
6176
- constructor(view: DetailViewBuilder, base: BaseTabConfig);
6177
- /**
6178
- * Filter by instance statuses
6179
- * @example .statusFilter("running", "waiting", "completed")
6180
- */
6181
- statusFilter(...statuses: InstanceStatus[]): this;
6182
- /**
6183
- * Allow starting new workflow instances
6184
- */
6185
- allowStart(): this;
6186
- /**
6187
- * Allow canceling running instances
6188
- */
6189
- allowCancel(): this;
6190
- /**
6191
- * Set columns to display in the instances table
6192
- * @example .columns("workflow", "status", "createdAt")
6193
- */
6194
- columns(...cols: ("workflow" | "status" | "startedBy" | "createdAt" | "updatedAt")[]): this;
6195
- /**
6196
- * Continue building with a new tab
6197
- */
6198
- tab(name: string, label: string): TabBuilder;
6199
- /**
6200
- * Finish this tab and return to DetailViewBuilder
6201
- */
6202
- done(): DetailViewBuilder;
6203
- /**
6204
- * Build the final view definition
6205
- */
6206
- build(): DetailViewDefinition;
6207
- }
6208
4554
  /**
6209
4555
  * Builder for configuring documents tabs
6210
4556
  *
6211
4557
  * All actions are enabled by default:
6212
4558
  * - allowUpload: true
6213
4559
  * - allowRemove: true
6214
- * - showProcessing: true
6215
- * - showRequiredWarnings: true
6216
4560
  * - hideAttachments: false
6217
4561
  *
6218
4562
  * @example
@@ -6224,30 +4568,23 @@ declare class FlowsTabConfig {
6224
4568
  * .tab("documents", "Documents")
6225
4569
  * .documents()
6226
4570
  * .disableUpload()
4571
+ * .disableRemove()
6227
4572
  * .hideAttachments()
6228
4573
  * ```
6229
4574
  */
6230
4575
  declare class DocumentsTabConfig {
6231
4576
  private view;
6232
- private tabData;
6233
- /** @internal */
6234
- constructor(view: DetailViewBuilder, base: BaseTabConfig);
6235
- /**
6236
- * Allow uploading new documents
6237
- */
6238
- allowUpload(): this;
6239
- /**
6240
- * Allow removing documents
6241
- */
6242
- allowRemove(): this;
4577
+ private tabData;
4578
+ /** @internal */
4579
+ constructor(view: DetailViewBuilder, base: BaseTabConfig);
6243
4580
  /**
6244
- * Show processing actions (OCR, verify, sign)
4581
+ * Disable uploading new documents
6245
4582
  */
6246
- showProcessing(): this;
4583
+ disableUpload(): this;
6247
4584
  /**
6248
- * Highlight empty required document attributes
4585
+ * Disable removing documents
6249
4586
  */
6250
- showRequiredWarnings(): this;
4587
+ disableRemove(): this;
6251
4588
  /**
6252
4589
  * Hide the attachments section
6253
4590
  */
@@ -6327,16 +4664,19 @@ declare class TabBuilder {
6327
4664
  * @example .activity().limit(50)
6328
4665
  */
6329
4666
  activity(): ActivityTabConfig;
6330
- /**
6331
- * Create a flows tab for workflow instances
6332
- * @example .flows().allowStart().allowCancel()
6333
- */
6334
- flows(): FlowsTabConfig;
6335
4667
  /**
6336
4668
  * Create a documents tab for file attachments
6337
- * @example .documents().allowUpload().allowRemove()
4669
+ * @example .documents().disableUpload().disableRemove()
6338
4670
  */
6339
4671
  documents(): DocumentsTabConfig;
4672
+ /**
4673
+ * Create a forms tab to launch and track form instances linked to this record
4674
+ * @example .tab("forms", "Forms").forms()
4675
+ * @example .tab("forms", "Forms").forms({ objectName: "contacts" })
4676
+ */
4677
+ forms(options?: {
4678
+ objectName?: string;
4679
+ }): DetailViewBuilder;
6340
4680
  }
6341
4681
  /**
6342
4682
  * Builder for creating detail view definitions
@@ -6815,379 +5155,6 @@ declare function group(id: string, label: string): GroupBuilder;
6815
5155
  */
6816
5156
  declare function relationGroup(id: string, label: string, attribute: string): RelationGroupBuilder;
6817
5157
 
6818
- /**
6819
- * Builder for creating rows within a form node.
6820
- * Each row can contain fields from multiple slots.
6821
- */
6822
- declare class WorkflowFormRowBuilder {
6823
- private formBuilder;
6824
- private rowData;
6825
- /** @internal */
6826
- constructor(formBuilder: WorkflowFormBuilder, rowId: string, order: number);
6827
- /**
6828
- * Add a field to the current row
6829
- * @param slotId - The slot containing the attribute
6830
- * @param attribute - The attribute name
6831
- * @param options - Optional label override and required flag
6832
- */
6833
- field(slotId: string, attribute: string, options?: {
6834
- label?: string;
6835
- required?: boolean;
6836
- }): this;
6837
- /**
6838
- * Add a relation field to the current row.
6839
- * Use this for relation attributes that need specific configuration
6840
- * (e.g., which qualified properties to display).
6841
- *
6842
- * @param slotId - The slot containing the relation attribute
6843
- * @param attribute - The relation attribute name
6844
- * @param options - Optional label, required flag, and relation config
6845
- */
6846
- relationField(slotId: string, attribute: string, options?: {
6847
- label?: string;
6848
- required?: boolean;
6849
- visibleProperties?: string[];
6850
- allowCreate?: boolean;
6851
- }): this;
6852
- /**
6853
- * Start a new row
6854
- */
6855
- row(id: string): WorkflowFormRowBuilder;
6856
- /**
6857
- * Add a heading row (finalizes the current field row first)
6858
- */
6859
- heading(content: string, level?: 1 | 2 | 3): WorkflowFormBuilder;
6860
- /**
6861
- * Add a visual separator (finalizes the current field row first)
6862
- */
6863
- separator(): WorkflowFormBuilder;
6864
- /**
6865
- * Add a static text row (finalizes the current field row first)
6866
- */
6867
- text(content: string): WorkflowFormBuilder;
6868
- /**
6869
- * Set the next node and finish this form
6870
- */
6871
- next(nodeId: string): WorkflowBuilder;
6872
- }
6873
- /**
6874
- * Builder for creating form nodes with advanced row structure.
6875
- * Each form node is a single "step" that can contain fields from multiple slots.
6876
- */
6877
- declare class WorkflowFormBuilder {
6878
- private workflowBuilder;
6879
- private nodeId;
6880
- private label;
6881
- private description?;
6882
- private rows;
6883
- private rowOrder;
6884
- /** @internal */
6885
- constructor(workflowBuilder: WorkflowBuilder, nodeId: string, label: string);
6886
- /**
6887
- * Set the description for this form step
6888
- */
6889
- describe(description: string): this;
6890
- /**
6891
- * Start a new row in the form
6892
- */
6893
- row(id: string): WorkflowFormRowBuilder;
6894
- /**
6895
- * Add a heading row to the form
6896
- */
6897
- heading(content: string, level?: 1 | 2 | 3): this;
6898
- /**
6899
- * Add a visual separator row to the form
6900
- */
6901
- separator(): this;
6902
- /**
6903
- * Add a static text row to the form
6904
- */
6905
- text(content: string): this;
6906
- /**
6907
- * Add a relation list row to the form.
6908
- * Renders an editable list of related records for a given slot and relation.
6909
- *
6910
- * @param id - Unique row identifier
6911
- * @param slotId - The slot containing the relation
6912
- * @param relationName - The relation attribute name
6913
- * @param options - Display and preload options
6914
- */
6915
- relationListField(id: string, slotId: string, relationName: string, options?: {
6916
- preload?: boolean;
6917
- columns?: string[];
6918
- qualifiersInline?: boolean;
6919
- modalFields?: "all" | string[];
6920
- label?: string;
6921
- }): this;
6922
- /**
6923
- * Set the next node and complete the form definition
6924
- */
6925
- next(nodeId: string): WorkflowBuilder;
6926
- /** @internal */
6927
- _finalizeRow(row: FlowFieldsRow): this;
6928
- }
6929
- /**
6930
- * Builder for creating simple form nodes with field references.
6931
- * Each field specifies both the slot and attribute.
6932
- */
6933
- declare class WorkflowSimpleFormBuilder {
6934
- private workflowBuilder;
6935
- private nodeId;
6936
- private label;
6937
- private description?;
6938
- private fieldList;
6939
- /** @internal */
6940
- constructor(workflowBuilder: WorkflowBuilder, nodeId: string, label: string);
6941
- /**
6942
- * Set the description for this form step
6943
- */
6944
- describe(description: string): this;
6945
- /**
6946
- * Add a field reference (slotId + attribute)
6947
- */
6948
- field(slotId: string, attribute: string): this;
6949
- /**
6950
- * Add multiple fields from the same slot
6951
- */
6952
- fieldsFrom(slotId: string, attributes: string[]): this;
6953
- /**
6954
- * Add a relation field with optional configuration.
6955
- * Use this for relation attributes that need specific configuration
6956
- * (e.g., which qualified properties to display).
6957
- */
6958
- relationField(slotId: string, attribute: string, options?: {
6959
- visibleProperties?: string[];
6960
- allowCreate?: boolean;
6961
- }): this;
6962
- /**
6963
- * Set the next node and complete the form definition
6964
- */
6965
- next(nodeId: string): WorkflowBuilder;
6966
- }
6967
- /**
6968
- * Builder for creating condition nodes
6969
- */
6970
- declare class WorkflowConditionBuilder {
6971
- private workflowBuilder;
6972
- private nodeId;
6973
- private label;
6974
- private condition?;
6975
- /** @internal */
6976
- constructor(workflowBuilder: WorkflowBuilder, nodeId: string, label: string);
6977
- /**
6978
- * Set the condition to evaluate (full ConditionGroup)
6979
- */
6980
- when(condition: ConditionGroup): this;
6981
- /**
6982
- * Shorthand: create a simple single-rule condition
6983
- */
6984
- whenField(rule: ConditionRule): this;
6985
- /**
6986
- * Set the branches for true/false outcomes
6987
- */
6988
- branches(onTrue: string, onFalse: string): WorkflowBuilder;
6989
- /**
6990
- * Set onTrue branch and return builder for onFalse
6991
- */
6992
- onTrue(nodeId: string): {
6993
- onFalse: (nodeId: string) => WorkflowBuilder;
6994
- };
6995
- }
6996
- /**
6997
- * Builder for creating end nodes
6998
- */
6999
- declare class WorkflowEndBuilder {
7000
- private workflowBuilder;
7001
- private nodeId;
7002
- private nodeLabel?;
7003
- private nodeStatus?;
7004
- /** @internal */
7005
- constructor(workflowBuilder: WorkflowBuilder, nodeId: string);
7006
- /**
7007
- * Set the display label
7008
- */
7009
- label(label: string): this;
7010
- /**
7011
- * Set the final status
7012
- */
7013
- status(status: string): this;
7014
- /**
7015
- * Build and add the end node, then return to workflow builder
7016
- */
7017
- done(): WorkflowBuilder;
7018
- }
7019
- /**
7020
- * Builder for the start node
7021
- */
7022
- declare class WorkflowStartBuilder {
7023
- private workflowBuilder;
7024
- private nodeId;
7025
- /** @internal */
7026
- constructor(workflowBuilder: WorkflowBuilder, nodeId: string);
7027
- /**
7028
- * Set the next node after start
7029
- */
7030
- next(nodeId: string): WorkflowBuilder;
7031
- }
7032
- /**
7033
- * Fluent builder for creating WorkflowDefinition with validation
7034
- *
7035
- * @example
7036
- * ```typescript
7037
- * const ONBOARDING = workflow("client-onboarding", "Onboarding Client")
7038
- * .description("Collecte des informations client")
7039
- *
7040
- * .slot("client", "contacts", { label: "Client", mode: "optional" })
7041
- * .slot("company", "companies", { label: "Entreprise", mode: "create" })
7042
- *
7043
- * .start("entry").next("client-form")
7044
- *
7045
- * .simpleForm("client-form", "Infos Client")
7046
- * .slot("client")
7047
- * .fields(["firstName", "lastName", "email", "type"])
7048
- * .next("check-vip")
7049
- *
7050
- * .condition("check-vip", "Client VIP ?")
7051
- * .when({ operator: "or", rules: [
7052
- * { field: "slots.client.type", operator: "eq", value: "vip" },
7053
- * { field: "slots.client.type", operator: "eq", value: "premium" }
7054
- * ]})
7055
- * .onTrue("company-form")
7056
- * .onFalse("end-basic")
7057
- *
7058
- * .form("company-form", "Infos Entreprise")
7059
- * .slot("company")
7060
- * .page("main", "Entreprise")
7061
- * .row("name").field("name").field("siret")
7062
- * .row("address").field("address")
7063
- * .next("end-complete")
7064
- *
7065
- * .end("end-basic").label("Client créé").done()
7066
- * .end("end-complete").label("Client + Entreprise créés").done()
7067
- *
7068
- * .build();
7069
- * ```
7070
- */
7071
- declare class WorkflowBuilder {
7072
- private data;
7073
- private startNodeId;
7074
- private nodeCount;
7075
- /**
7076
- * Drizzle-style static type inference property.
7077
- * Provides direct access to inferred types without utility type imports.
7078
- *
7079
- * @example
7080
- * ```typescript
7081
- * const ONBOARDING = workflow("client-onboarding", "Onboarding")
7082
- * .slot("client", "contacts", { label: "Client", mode: "create" })
7083
- * .start("entry").next("form")
7084
- * // ... nodes
7085
- * .build();
7086
- *
7087
- * // Zero-import type inference! ✨
7088
- * type Slots = typeof ONBOARDING.$infer.slots;
7089
- * type WorkflowDef = typeof ONBOARDING.$infer.definition;
7090
- * ```
7091
- */
7092
- readonly $infer: {
7093
- /** The workflow slots type */
7094
- slots: WorkflowSlot[];
7095
- /** The full workflow definition type */
7096
- definition: WorkflowDefinition;
7097
- };
7098
- constructor(name: string, label: string);
7099
- /**
7100
- * Set workflow description
7101
- */
7102
- description(value: string): this;
7103
- /**
7104
- * Set workflow icon
7105
- */
7106
- icon(value: IconName): this;
7107
- /**
7108
- * Mark as system workflow (protected from deletion)
7109
- */
7110
- system(): this;
7111
- /**
7112
- * Set extensible metadata
7113
- */
7114
- metadata(value: Record<string, unknown>): this;
7115
- /**
7116
- * Set workflow theme
7117
- */
7118
- theme(value: WorkflowTheme): this;
7119
- /**
7120
- * Set workflow config
7121
- */
7122
- config(value: WorkflowConfig): this;
7123
- /**
7124
- * Add a slot (object to manipulate in the workflow)
7125
- *
7126
- * @param id - Unique slot identifier
7127
- * @param objectName - Name of the object definition
7128
- * @param options - Slot configuration
7129
- */
7130
- slot(id: string, objectName: string, options: {
7131
- label: string;
7132
- mode?: SlotMode;
7133
- color?: ColorId;
7134
- icon?: IconName;
7135
- }): this;
7136
- /**
7137
- * Define the start node
7138
- */
7139
- start(id: string): WorkflowStartBuilder;
7140
- /**
7141
- * Define a simple form node (single page, list of fields)
7142
- */
7143
- simpleForm(id: string, label: string): WorkflowSimpleFormBuilder;
7144
- /**
7145
- * Define an advanced form node (multi-page with custom layout)
7146
- */
7147
- form(id: string, label: string): WorkflowFormBuilder;
7148
- /**
7149
- * Define a condition node
7150
- */
7151
- condition(id: string, label: string): WorkflowConditionBuilder;
7152
- /**
7153
- * Define an end node
7154
- */
7155
- end(id: string): WorkflowEndBuilder;
7156
- /** @internal */
7157
- _addNode(node: WorkflowNode): this;
7158
- /** @internal */
7159
- _addFormNode(node: WorkflowNode): this;
7160
- /**
7161
- * Build and validate the workflow definition
7162
- */
7163
- build(): WorkflowDefinition;
7164
- private validateName;
7165
- private validateRequiredData;
7166
- private validateNodeReferences;
7167
- private validateSlotReferences;
7168
- private validateDAG;
7169
- }
7170
- /**
7171
- * Create a new workflow builder
7172
- *
7173
- * @param name - Workflow name (kebab-case)
7174
- * @param label - Display label
7175
- *
7176
- * @example
7177
- * ```typescript
7178
- * const ONBOARDING = workflow("client-onboarding", "Onboarding Client")
7179
- * .slot("client", "contacts", { label: "Client", mode: "create" })
7180
- * .start("entry").next("form-1")
7181
- * .simpleForm("form-1", "Info")
7182
- * .slot("client")
7183
- * .fields(["firstName", "lastName"])
7184
- * .next("end")
7185
- * .end("end").done()
7186
- * .build();
7187
- * ```
7188
- */
7189
- declare function workflow(name: string, label: string): WorkflowBuilder;
7190
-
7191
5158
  /**
7192
5159
  * Standard Schema v1 integration for @stndrds/schema
7193
5160
  *
@@ -7210,10 +5177,6 @@ type StandardSchemaIssue = StandardSchemaV1.Issue;
7210
5177
  * Standard Schema result type
7211
5178
  */
7212
5179
  type StandardSchemaResult<T> = StandardSchemaV1.Result<T>;
7213
- /**
7214
- * Standard Schema props type (the ~standard property value)
7215
- */
7216
- type StandardSchemaProps<Input, Output> = StandardSchemaV1.Props<Input, Output>;
7217
5180
  /**
7218
5181
  * Create Standard Schema ~standard props from a Zod schema.
7219
5182
  *
@@ -7223,7 +5186,7 @@ type StandardSchemaProps<Input, Output> = StandardSchemaV1.Props<Input, Output>;
7223
5186
  * @param zodSchema - The Zod schema to wrap
7224
5187
  * @returns Standard Schema v1 props
7225
5188
  */
7226
- declare function createStandardSchemaProps<T>(zodSchema: z$1.ZodType<T>): StandardSchemaV1.Props<unknown, T>;
5189
+ declare function createStandardSchemaProps<T>(zodSchema: z.ZodType<T>): StandardSchemaV1.Props<unknown, T>;
7227
5190
  /**
7228
5191
  * Type guard to check if an object implements Standard Schema v1
7229
5192
  */
@@ -7489,32 +5452,6 @@ declare class FlagRegistry {
7489
5452
  * @returns Array of flag names
7490
5453
  */
7491
5454
  listNames(): string[];
7492
- /**
7493
- * List flags filtered by category.
7494
- *
7495
- * @param category - The category to filter by
7496
- * @returns Array of flag definitions in the category
7497
- */
7498
- listByCategory(category: string): FeatureFlagDefinition[];
7499
- /**
7500
- * Get all unique categories.
7501
- *
7502
- * @returns Array of unique category names
7503
- */
7504
- getCategories(): string[];
7505
- /**
7506
- * Get the default value for a flag.
7507
- *
7508
- * @param name - The flag name
7509
- * @returns The default value or undefined if flag not found
7510
- */
7511
- getDefaultValue<T = unknown>(name: string): T | undefined;
7512
- /**
7513
- * Get a map of all flag names to their default values.
7514
- *
7515
- * @returns Map of flag names to default values
7516
- */
7517
- getDefaults(): Map<string, unknown>;
7518
5455
  /**
7519
5456
  * Unregister a flag (mainly for testing).
7520
5457
  *
@@ -7673,6 +5610,7 @@ declare class FlagService {
7673
5610
  private getAllOverrides;
7674
5611
  /**
7675
5612
  * Resolve a flag value from overrides and defaults.
5613
+ * Delegates to resolveWithSource() to avoid duplicating the priority logic.
7676
5614
  */
7677
5615
  private resolveValue;
7678
5616
  /**
@@ -7902,29 +5840,11 @@ declare class ViewRegistry {
7902
5840
  */
7903
5841
  declare const viewRegistry: ViewRegistry;
7904
5842
 
7905
- /**
7906
- * Get the active tab from a list view config.
7907
- *
7908
- * Resolution order:
7909
- * 1. Tab matching `tabId` (if provided)
7910
- * 2. Tab marked as `default`
7911
- * 3. First tab
7912
- */
7913
- declare function getActiveTab(config: ListViewConfig, tabId?: string): ListViewTab;
7914
-
7915
5843
  /**
7916
5844
  * View Auto-Generator
7917
5845
  *
7918
5846
  * Generates fallback views from object definitions.
7919
5847
  * Used when no custom view is defined (lazy creation pattern).
7920
- *
7921
- * @example
7922
- * ```typescript
7923
- * import { generateFallbackView } from "@stndrds/schema";
7924
- *
7925
- * const view = generateFallbackView(objectDefinition, "detail");
7926
- * // Returns a DetailViewDefinition with all visible attributes
7927
- * ```
7928
5848
  */
7929
5849
 
7930
5850
  interface GenerateFallbackViewOptions {
@@ -7938,11 +5858,6 @@ interface GenerateFallbackViewOptions {
7938
5858
  * @default true
7939
5859
  */
7940
5860
  includeDocumentsTab?: boolean;
7941
- /**
7942
- * Include flows tab in detail views.
7943
- * @default false
7944
- */
7945
- includeFlowsTab?: boolean;
7946
5861
  /**
7947
5862
  * Attributes to exclude from the generated view.
7948
5863
  */
@@ -7952,6 +5867,11 @@ interface GenerateFallbackViewOptions {
7952
5867
  * @default 5
7953
5868
  */
7954
5869
  maxListColumns?: number;
5870
+ /**
5871
+ * Layout mode for detail views.
5872
+ * @default "page"
5873
+ */
5874
+ layout?: "page" | "modal";
7955
5875
  }
7956
5876
  /**
7957
5877
  * Generate a default detail view from an object definition.
@@ -7969,15 +5889,6 @@ declare function generateDefaultDetailView(object: ObjectDefinition, options?: G
7969
5889
  * @returns A generated ListViewDefinition
7970
5890
  */
7971
5891
  declare function generateDefaultListView(object: ObjectDefinition, options?: GenerateFallbackViewOptions): ListViewDefinition;
7972
- /**
7973
- * Generate a fallback view for any supported type.
7974
- *
7975
- * @param object - The object definition
7976
- * @param type - View type to generate
7977
- * @param options - Generation options
7978
- * @returns A generated ViewDefinition
7979
- */
7980
- declare function generateFallbackView(object: ObjectDefinition, type: ViewType, options?: GenerateFallbackViewOptions): ViewDefinition;
7981
5892
 
7982
5893
  /**
7983
5894
  * View Reset Utilities
@@ -8019,57 +5930,59 @@ interface ResetViewOptions extends GenerateFallbackViewOptions {
8019
5930
  * @returns A new ViewDefinition with reset structure
8020
5931
  */
8021
5932
  declare function resetViewToDefault(currentView: ViewDefinition, object: ObjectDefinition, options?: ResetViewOptions): ViewDefinition;
5933
+
8022
5934
  /**
8023
- * Check if a view has been customized from its default state.
5935
+ * Get the active tab from a list view config.
8024
5936
  *
8025
- * @param view - The view to check
8026
- * @param object - The object definition
8027
- * @returns true if the view differs from the default
5937
+ * Resolution order:
5938
+ * 1. Tab matching `tabId` (if provided)
5939
+ * 2. Tab marked as `default`
5940
+ * 3. First tab
8028
5941
  */
8029
- declare function isViewCustomized(view: ViewDefinition, object: ObjectDefinition): boolean;
5942
+ declare function getActiveTab(config: ListViewConfig, tabId?: string): ListViewTab;
8030
5943
 
8031
5944
  /**
8032
- * Convert an ObjectDefinition to JSON Schema.
5945
+ * Registry for developer-defined form definitions.
8033
5946
  *
8034
- * This enables runtime form generation from schema definitions.
8035
- * The generated JSON Schema is compatible with libraries like:
8036
- * - react-jsonschema-form
8037
- * - ajv
8038
- * - json-schema-form
8039
- *
8040
- * @param objectDef - The ObjectDefinition to convert
8041
- * @returns A JSON Schema object representing the ObjectDefinition
5947
+ * Forms registered here are seeded to the database at application startup
5948
+ * with `system: true` they are read-only and cannot be modified or deleted
5949
+ * by users through the API.
8042
5950
  *
8043
5951
  * @example
8044
5952
  * ```typescript
8045
- * const PRODUCT = object({ name: "products", label: "Product" })
8046
- * .labelExpression("{{ name }}")
8047
- * .attribute(text({ name: "name", label: "Name" }).required())
8048
- * .attribute(number({ name: "price", label: "Price" }).min(0))
5953
+ * import { form, formRegistry } from "@stndrds/schema";
5954
+ *
5955
+ * const ONBOARDING = form("client-onboarding", "Onboarding Client")
5956
+ * .slot("client", "contacts", { label: "Client", mode: "create" })
5957
+ * .step("infos", "Informations")
5958
+ * .field("client", "firstName")
5959
+ * .field("client", "email")
8049
5960
  * .build();
8050
5961
  *
8051
- * const jsonSchema = objectToJSONSchema(PRODUCT);
8052
- * // => {
8053
- * // type: "object",
8054
- * // title: "Product",
8055
- * // properties: {
8056
- * // name: { type: "string", title: "Name" },
8057
- * // price: { type: "number", title: "Price", minimum: 0 }
8058
- * // },
8059
- * // required: ["name"]
8060
- * // }
5962
+ * formRegistry.register(ONBOARDING);
8061
5963
  * ```
8062
5964
  */
8063
- declare function objectToJSONSchema(objectDef: ObjectDefinition): JSONSchema7;
8064
- /**
8065
- * Convert an ObjectDefinition's Zod validator to JSON Schema using z.toJSONSchema().
8066
- *
8067
- * This is an alternative approach that uses Zod's native JSON Schema generation.
8068
- * Use this when you need exact parity with Zod validation behavior.
8069
- *
8070
- * @param objectDef - The ObjectDefinition to convert
8071
- * @returns A JSON Schema generated by Zod
8072
- */
8073
- declare function objectValidatorToJSONSchema(objectDef: ObjectDefinition): JSONSchema7;
5965
+ declare class FormRegistry {
5966
+ private forms;
5967
+ /**
5968
+ * Register a form definition (or array of definitions).
5969
+ * @throws Error if a form with the same name is already registered.
5970
+ */
5971
+ register(formOrForms: FormDefinition | FormDefinition[]): this;
5972
+ /**
5973
+ * Get a form definition by name.
5974
+ */
5975
+ get(name: string): FormDefinition | undefined;
5976
+ /**
5977
+ * Get all registered form definitions.
5978
+ */
5979
+ getAll(): FormDefinition[];
5980
+ /**
5981
+ * List all registered form names.
5982
+ */
5983
+ listNames(): string[];
5984
+ }
5985
+
5986
+ declare const formRegistry: FormRegistry;
8074
5987
 
8075
- export { type AIAvailableModel, type AIBatchQuestion, type AIBatchQuestionAnswer, type AIBatchQuestionOption, type AIChatMessage, type AIChatMessagePart, type AIChatMessagePartType, type AICompactionSummary, type AIMemoryEntry, type AIMemoryType, type AIMessageRole, type AIProviderMetrics, type AIQuestion, type AIQuestionAnswer, type AIQuestionOption, type AIQuestionType, type AITodoItem, type AITodoList, type AITodoStatus, type AIToolCall, type AIToolCallStatus, type AIUsageMetrics, ALL_ACTIONS, ALL_PIPES, ALL_SYSTEM_RESOURCES, AccessDeniedError, type AccessLevel, type Action, ActivityTabConfig, type AddAttribute$1 as AddAttribute, type AgentAttachment, type AgentAttachmentCategory, type AgentConfig, type AgentContextEntry, type AgentDashboard, type AgentDefinition, type AgentEvent, type AgentExecutionConfig, type AgentMessageAttachment, type AgentQuestion, type AgentRun, type AgentRunStatus, type AgentSchedule, type AgentSession, type AgentSessionMessage, type AgentSessionMode, type AgentSessionStatus, type AgentToolCall, type AgentTrigger, type AgentTriggerDefinition, type AgentTriggerType, type AnyAttributeBuilder, type ApiKey, type ApiKeyAuthContext, type ApiKeyPermission, type ApiKeyWithSecret, type AssignRoleInput, Attribute, AttributeGroupField, AttributeInUseError, type AttributeMap, AttributeNotFoundError, type AttributeSchema, AttributeType, type AttributeUsage, type AuditAction, type AuditActorType, type AuditChange, type AuditListOptions, type AuditLogEntry, type AuditResourceType, type AuditServiceOptions, AuthMethodSchema, BEHAVIOR_PROPERTIES, type BehaviorProperty, BilateralConfig, type BilateralValidationError, type BilateralValidationResult, type BoundingBox, type BuilderConfig, CheckboxAttribute, CompletionStatus, ConcurrentModificationError, ConditionGroup, ConditionGroupSchema, ConditionNodeSchema, ConditionOperatorSchema, ConditionRule, ConditionRuleSchema, ConfigOverrides, type CreateApiKeyInput, type CreateAuditLogInput, type CreateDBAttribute, type CreateDBObject, type CreateDBView, type CreateDBViewOverlay, type CreateDBWorkflow, type CreateDBWorkflowAccessGrant, type CreateDBWorkflowInstance, type CreateDBWorkflowInvitation, type CreateDocument, type CreateDocumentSlot, type CreateFile, type CreateGrantInput, type CreateInvitationInput, type CreateInvitationResult, CreateMode, type CreateObjectRecord, type CreatePermissionInput, type CreateProcessingJob, type CreateRoleInput, type CreateSandboxExecution, CreateShareInputSchema, type CreateUserProfile, type CriticConfig, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, type DBAttribute, type DBObject, type DBView, type DBViewOverlay, type DBWorkflow, type DBWorkflowAccessGrant, type DBWorkflowInstance, type DBWorkflowInvitation, DEFAULT_LABEL_FALLBACK, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_FOR_NEW_USERS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DetailViewBuilder, DetailViewConfig, DetailViewDefinition, DetailViewLayout, type Document, DocumentAttribute, type DocumentListOptions, type DocumentSlot, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type EffectivePermissions, EndNodeSchema, type ExtractAttributeName, type ExtractAttributeRequired, type ExtractAttributes, type ExtractObjectRecord, type ExtractObjectRecordWithCustom, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, FeatureFlagDefinition, FeatureFlagsRepository, FeatureGate, Field, FieldGroup, type File, FileAttribute, type FileListOptions, FileNotFoundError, type FileVisibility, FilterState, FlagLevel, FlagRegistry, type FlagResolutionContext, FlagService, type FlagServiceOptions, FlagValueType, FlowFieldsRow, FlowHeadingRow, FlowRelationListRow, FlowRowFieldSchema, FlowRowSchema, FlowSeparatorRow, FlowTextRow, FlowsTabConfig, ForbiddenError, type FormContextResponse, type FormFieldContext, FormFieldRefSchema, type FormFieldRow, type FormFieldsRow, FormNode, type FormNodeInfo, FormNodeSchema, FormulaAttribute, FormulaReturnType, type GenerateFallbackViewOptions, type GeocodingAdapter, type GeocodingAutocompleteParams, type GeocodingParams, type GeocodingSuggestion, type GlobalSearchGroupedOptions, type GlobalSearchGroupedResult, type GlobalSearchOptions, type GlobalSearchResultItem, Group, GroupBuilder, type GroupedWorkflowNodes, IDENTITY_PROPERTIES, type IdentityProperty, type InferAttributeValue, type InferRecord, type InferRecordFromSchema, type InferRecordInput, type InferRecordUpdate, type InferRecordWithRequirements, InstanceStatus, type InvitationStatus, type InviteUserInput, type LabelExpression, type LabelPipe, type ListOptions, ListViewBuilder, ListViewConfig, ListViewDefinition, ListViewTab, ListViewTabConfigBuilder, Location, LocationAttribute, LocationGranularity, MemoryNotFoundError, type MentionEntityType, type MentionReference, type MentionedContext, type MentionedEntityContext, MigrationDefinition, type ModelDefinition, MultiRelationAttribute, MultiselectAttribute, NodePositionSchema, type NodeTypeDefinition, NoopGeocodingAdapter, NotFoundError, NotImplementedError, NotSystemObjectError, NumberAttribute, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, type ObjectPermissions, ObjectRecord, ObjectReferencedError, type OcrAdapter, type OcrInput, type OcrOptions, type OcrPage, type OcrResult, type OcrTextBlock, type OperationResult, Option, PIPES_WITH_ARGS, PRESENTATION_PROPERTIES, PendingAction, type Permission, type PermissionScope, Phone, PhoneAttribute, type PhoneNormalizationResult, type PipeWithArgs, type PolicyContext, PolicyViolationError, type PresentationProperty, type ProcessingJob, type ProcessingJobStatus, type ProcessingJobType, type ProcessingStatus, type PropertyAttributeBuilder, ProtectedResourceError, ProtectedRoleError, type ProviderName, type QuestionResponse, type QuestionStatus, RatingAttribute, type ReadOnlyReason, type ReasoningPartData, type RecordAgentEvent, type RecordAgentTrigger, type RecordMetadata, RecordNotFoundError, type RecordPolicy, type RecordReference, RecordReferencedError, RelationAttribute, RelationBufferMap, RelationFieldConfig, RelationGroup, RelationGroupBuilder, RelationTarget, RepositoryError, type RepositoryOperation, type ResetViewOptions, ResolvedFlag, type ResumeWorkflowApiInput, type RetryPolicy, type ReverseGeocodingParams, RichtextAttribute, RichtextFeature, RichtextTabConfig, type Role, RoleNotFoundError, RollupAttribute, RollupFunction, SIMPLE_PIPES, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, type SandboxExecution, type SandboxExecutionInput, type SandboxExecutionResult, type SandboxExecutionStatus, type SandboxMode, type SandboxTrigger, SchemaError, SchemaErrorCode, type SearchOptions, SelectAttribute, ShareStatusSchema, SidePanelConfig, type SimplePipe, SingleRelationAttribute, SlotMode, SlotModeSchema, type SlotStatus, SortRule, type StandardSchemaIssue, type StandardSchemaProps, type StandardSchemaResult, StartNodeSchema, type StartWorkflowApiInput, StaticFlagDefault, StatusAttribute, StorageError, type StorageOperation, type StorageProvider, SyncError, type SystemAttribute, type SystemAttributeName, type SystemFields, type SystemPermissions, type SystemResource, Tab, TabBuilder, TableTab, TableTabConfig, TenantId, TextAreaAttribute, TextAttribute, type TextPartData, ThemeColorsSchema, ThemeLogoSchema, type ThinkingPartData, type TimeoutPolicy, Timestamps, type ToolPartData, type TriggerEventType, type TypedAttribute, type TypedBuilderConfig, type TypedObjectRecord, USER_STATUSES, type UpdateDBAttribute, type UpdateDBObject, type UpdateDBView, type UpdateDBViewOverlay, type UpdateDBWorkflow, type UpdateDBWorkflowAccessGrant, type UpdateDBWorkflowInstance, type UpdateDBWorkflowInvitation, type UpdateDocument, type UpdateDocumentSlot, type UpdateFile, type UpdateProcessingJob, type UpdateRoleInput, type UpdateUserProfile, type UpsertDBAttribute, type UpsertDBObject, type UpsertDBView, UserAttribute, type UserProfile, UserProfileNotFoundError, type UserRoleAssignment, type UserStatus, Uuid, type ValidatedConditionGroup, type ValidatedWorkflowDefinition, type ValidatedWorkflowNode, ValidationError, type ValidationErrorDetail, ViewConfig, ViewDefinition, ViewType, ViewportSchema, type WithCustomAttributes$1 as WithCustomAttributes, type WorkflowAccessGrant, type WorkflowAccessMode, WorkflowBuilder, type WorkflowCompletedAgentEvent, type WorkflowCompletedAgentTrigger, WorkflowConditionBuilder, WorkflowConfig, WorkflowConfigSchema, WorkflowDefinition, WorkflowDefinitionSchema, WorkflowEndBuilder, type WorkflowEvent, type WorkflowEventType, WorkflowExecutionContext, WorkflowFormBuilder, WorkflowFormRowBuilder, type WorkflowGrantRevokedEvent, type WorkflowInstanceCancelledEvent, type WorkflowInstanceCompletedEvent, type WorkflowInstanceFailedEvent, type WorkflowInstanceStartedEvent, type WorkflowInvitation, type WorkflowInvitationAcceptedEvent, type WorkflowInvitationCreatedEvent, type WorkflowInvitationExpiredEvent, WorkflowLayout, WorkflowLayoutSchema, WorkflowNode, type WorkflowNodeCompletedEvent, type WorkflowNodeEnteredEvent, type WorkflowNodeFailedEvent, WorkflowNodeSchema, WorkflowNodeType, WorkflowShareSchema, WorkflowSimpleFormBuilder, WorkflowSlot, WorkflowSlotSchema, WorkflowStartBuilder, WorkflowStatus, WorkflowStatusSchema, WorkflowTheme, WorkflowThemeSchema, WorkflowTransition, type WorkflowZone, ZONE_CONFIG, ZONE_ORDER, accessLevelToActions, actionsToAccessLevel, applyRelationProps, assignNodeZones, booleanFlag, canAccessNode, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, formatAttributeValue, formatPhoneForDisplay, formula, generateDefaultDetailView, generateDefaultListView, generateFallbackView, getActiveTab, getErrorMessage, getFormFieldRefs, getNodeOutputs, getNodeSlotIds, getSystemAttributeList, getZoneAllowedTypes, group, groupNodesByZone, hasProperties, isAccessDeniedError, isBehaviorProperty, isDefaultRole, isEmptyObject, isForbiddenError, isFormFieldsRow, isGrantExpired, isGrantRevoked, isGrantValid, isIdentityProperty, isInstanceEvent, isInvitationAccepted, isInvitationExpired, isInvitationOrGrantEvent, isInvitationValid, isLabelExpression, isNodeEvent, isNotEmpty, isNotFoundError, isNotImplementedError, isPresentationProperty, isProtectedResourceError, isRepositoryError, isSchemaError, isStandardSchema, isStorageError, isSystemAttribute, isSystemAttributeObject, isTokenRevoked, isValidationError, isViewCustomized, jsonFlag, labelExpressionSchema, listView, location, multiselect, nodeTypeRegistry, normalizePhoneNumber, number, numberFlag, object, objectToJSONSchema, objectValidatorToJSONSchema, parseRawPhoneInput, phone, rating, registerBuiltInNodeTypes, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, setNodeNext, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateLabelExpression, validateNode, validatePhoneNumber, viewRegistry, workflow };
5988
+ export { type AIAvailableModel, type AIBatchQuestion, type AIBatchQuestionAnswer, type AIBatchQuestionOption, type AIChatMessage, type AIChatMessagePart, type AIChatMessagePartType, type AICompactionSummary, type AIMemoryEntry, type AIMemoryType, type AIMessageRole, type AIProviderMetrics, type AIQuestion, type AIQuestionAnswer, type AIQuestionOption, type AIQuestionType, type AITodoItem, type AITodoList, type AITodoStatus, type AIToolCall, type AIToolCallStatus, type AIUsageMetrics, ALL_ACTIONS, ALL_SYSTEM_RESOURCES, AccessDeniedError, type AccessLevel, type Action, ActivityTabConfig, type AgentAttachment, type AgentAttachmentCategory, type AgentConfig, type AgentContextEntry, type AgentDashboard, type AgentDefinition, type AgentEvent, type AgentExecutionConfig, type AgentMessageAttachment, type AgentQuestion, type AgentRun, type AgentRunStatus, type AgentSchedule, type AgentSession, type AgentSessionMessage, type AgentSessionMode, type AgentSessionStatus, type AgentToolCall, type AgentTrigger, type AgentTriggerDefinition, type AgentTriggerType, type ApiKey, type ApiKeyAuthContext, type ApiKeyPermission, type ApiKeyWithSecret, type AssignRoleInput, Attribute, AttributeGroupField, AttributeInUseError, AttributeNotFoundError, AttributeType, type AttributeUsage, type AuditAction, type AuditActorType, type AuditChange, type AuditListOptions, type AuditLogEntry, type AuditResourceType, type AuditServiceOptions, type AuditSortField, BEHAVIOR_PROPERTIES, BilateralConfig, type BoundingBox, type BuilderConfig, CheckboxAttribute, CompletionStatus, ConcurrentModificationError, ConfigOverrides, type CreateApiKeyInput, type CreateAuditLogInput, type CreateDBAttribute, type CreateDBForm, type CreateDBFormSubmission, type CreateDBObject, type CreateDBView, type CreateDBViewOverlay, type CreateDocument, type CreateDocumentSlot, type CreateFile, CreateMode, type CreateObjectRecord, type CreatePermissionInput, type CreateProcessingJob, type CreateRoleInput, type CreateSandboxExecution, type CreateUserProfile, type CriticConfig, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, type DBAttribute, type DBForm, type DBFormSubmission, type DBObject, type DBView, type DBViewOverlay, DB_COLUMN_FIELDS, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, DetailViewBuilder, DetailViewConfig, DetailViewDefinition, DetailViewLayout, type Document, DocumentAttribute, type DocumentListOptions, type DocumentSlot, DocumentsTabConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type EffectivePermissions, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, FORM_FORBIDDEN_ATTRIBUTE_TYPES, FeatureFlagDefinition, FeatureFlagsRepository, FeatureGate, Field, FieldGroup, type File, FileAttribute, type FileListOptions, type FileVisibility, FilterState, FlagLevel, FlagRegistry, FlagService, FlagValueType, ForbiddenError, FormBuilder, type FormDefinition, type FormFieldRef, type FormFieldsRow, type FormFreeFieldRef, type FormHeadingRow, FormRegistry, type FormRow, FormRowBuilder, type FormSeparatorRow, type FormSlot, type FormSlotFieldRef, type FormStatus, type FormStep, FormStepBuilder, type FormSubmission, type FormSubmissionStatus, type FormSubmittedAgentEvent, type FormSubmittedAgentTrigger, type FormTextRow, FormulaAttribute, FormulaReturnType, type GeocodingAdapter, type GeocodingAutocompleteParams, type GeocodingParams, type GeocodingSuggestion, type GlobalSearchGroupedOptions, type GlobalSearchGroupedResult, type GlobalSearchOptions, type GlobalSearchResultItem, Group, GroupBuilder, IDENTITY_PROPERTIES, type InferAttributeValue, type InviteUserInput, type ListOptions, ListViewBuilder, ListViewConfig, ListViewDefinition, ListViewTab, ListViewTabConfigBuilder, Location, LocationAttribute, LocationGranularity, MemoryNotFoundError, type MentionEntityType, type MentionReference, type MentionedContext, type MentionedEntityContext, MigrationDefinition, type ModelDefinition, MultiRelationAttribute, MultiselectAttribute, NoopGeocodingAdapter, NotFoundError, NotImplementedError, NumberAttribute, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, type ObjectPermissions, ObjectRecord, ObjectReferencedError, type OcrAdapter, type OcrInput, type OcrOptions, type OcrPage, type OcrResult, type OcrTextBlock, type OperationResult, Option, PRESENTATION_PROPERTIES, type Permission, type PermissionScope, Phone, PhoneAttribute, type PolicyContext, PolicyViolationError, type ProcessingJob, type ProcessingJobStatus, type ProcessingJobType, type ProcessingStatus, ProtectedResourceError, ProtectedRoleError, type ProviderName, type QuestionResponse, type QuestionStatus, RatingAttribute, type ReasoningPartData, type RecordAgentEvent, type RecordAgentTrigger, type RecordMetadata, RecordNotFoundError, type RecordPolicy, type RecordReference, RecordReferencedError, RelationAttribute, RelationGroup, RelationGroupBuilder, RelationTarget, RepositoryError, type RepositoryOperation, ResolvedFlag, type RetryPolicy, type ReverseGeocodingParams, RichtextAttribute, RichtextFeature, RichtextTabConfig, type Role, RoleNotFoundError, RollupAttribute, RollupFunction, STANDARD_SCHEMA_VENDOR, SYSTEM_ATTRIBUTES, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, type SandboxExecution, type SandboxExecutionInput, type SandboxExecutionResult, type SandboxExecutionStatus, type SandboxMode, type SandboxTrigger, SchemaError, SchemaErrorCode, type SearchOptions, SelectAttribute, SidePanelConfig, SingleRelationAttribute, type SlotMode, type SlotStatus, SortRule, type StandardSchemaIssue, type StandardSchemaResult, StaticFlagDefault, StatusAttribute, StorageError, type StorageOperation, type StorageProvider, SyncError, type SystemAttribute, type SystemFields, type SystemPermissions, type SystemResource, Tab, TabBuilder, TableTab, TableTabConfig, TenantId, TextAreaAttribute, TextAttribute, type TextPartData, type ThinkingPartData, type TimeoutPolicy, Timestamps, type ToolPartData, type TriggerEventType, USER_STATUSES, type UpdateDBAttribute, type UpdateDBForm, type UpdateDBFormSubmission, type UpdateDBObject, type UpdateDBView, type UpdateDBViewOverlay, type UpdateDocument, type UpdateDocumentSlot, type UpdateFile, type UpdateProcessingJob, type UpdateRoleInput, type UpdateUserProfile, type UpsertDBAttribute, type UpsertDBObject, type UpsertDBView, UserAttribute, type UserProfile, type UserRoleAssignment, type UserStatus, Uuid, ValidationError, type ValidationErrorDetail, ViewConfig, ViewDefinition, ViewType, type WithCustomAttributes$1 as WithCustomAttributes, accessLevelToActions, actionsToAccessLevel, booleanFlag, checkbox, createFlagRegistry, createFlagService, createStandardSchemaProps, currency, date, detailView, document, extractAttributeNames, file, flagRegistry, form, formRegistry, formatAttributeValue, formula, generateDefaultDetailView, generateDefaultListView, getActiveTab, getErrorMessage, getSystemAttributeList, group, isAttributeInUseError, isDefaultRole, isEmptyObject, isFormDefinition, isFormFieldsRow, isFormFreeFieldRef, isFormHeadingRow, isFormSeparatorRow, isFormSlotFieldRef, isFormTextRow, isLabelExpression, isNotEmpty, isNotFoundError, isObjectReferencedError, isProtectedResourceError, isRecordReferencedError, isSchemaError, isStandardSchema, isValidationError, jsonFlag, listView, location, multiselect, number, numberFlag, object, phone, rating, registry, relation, relationGroup, renderLabelExpression, resetViewToDefault, richtext, rollup, select, status, stringFlag, text, textarea, toUndefinedIfEmpty, user, validateAttributeName, viewRegistry };