@stndrds/schema 1.0.0-alpha.100 → 1.0.0-alpha.103
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.
- package/dist/{attributes-CH89Z_J-.d.mts → attributes-D7yQuTJK.d.mts} +1 -11
- package/dist/{attributes-dw-jLtYS.d.ts → attributes-DcbQC-4b.d.ts} +1 -11
- package/dist/chunk-3JINFUN3.js +81 -0
- package/dist/{chunk-BZTLI773.mjs → chunk-4KRLCWJM.mjs} +1 -1
- package/dist/{chunk-ERG77ADK.mjs → chunk-4TC27SMF.mjs} +1 -1
- package/dist/{chunk-OO2LJ6GP.js → chunk-56QI6UTK.js} +4 -4
- package/dist/{chunk-P4NGPF5L.mjs → chunk-5XL3JP73.mjs} +3 -19
- package/dist/{chunk-ZJNX6UXB.mjs → chunk-7HFZ7MVR.mjs} +1 -1
- package/dist/{chunk-6IFD5732.js → chunk-ACQ3TUFK.js} +2 -2
- package/dist/{chunk-PGHTIMRD.mjs → chunk-AGOMDWP5.mjs} +28 -19
- package/dist/{chunk-FKPYFM6G.mjs → chunk-AYCSVKI2.mjs} +1 -1
- package/dist/{chunk-ALV6GETG.mjs → chunk-BLXQGQLK.mjs} +1 -1
- package/dist/{chunk-STKN6A5M.js → chunk-D7WFIGXW.js} +2 -2
- package/dist/{chunk-E6XO2STS.js → chunk-FRCDMQER.js} +0 -14
- package/dist/{chunk-QPDXDX7A.js → chunk-GCRHSPZN.js} +2 -2
- package/dist/{chunk-TV4G2KMD.mjs → chunk-IRTRJH37.mjs} +1 -1
- package/dist/{chunk-3RFFA4EV.mjs → chunk-ITTQ4FGR.mjs} +1 -1
- package/dist/{chunk-FKETRWAF.js → chunk-J5HRK3WD.js} +2 -2
- package/dist/{chunk-CE25ADK5.js → chunk-J7TJ2DK2.js} +51 -42
- package/dist/{chunk-6MXQAQBB.mjs → chunk-KNYZH2WD.mjs} +1 -1
- package/dist/chunk-KWVCGQ7N.mjs +78 -0
- package/dist/chunk-MAKSIK3P.js +10 -0
- package/dist/{chunk-H3VBSMVW.js → chunk-N7T66JVY.js} +2 -21
- package/dist/{chunk-UPEQEX2D.js → chunk-OAQWRMTP.js} +2 -2
- package/dist/{chunk-VC4E3OSZ.mjs → chunk-OLJLCVNY.mjs} +1 -1
- package/dist/{chunk-ANP6HGMJ.js → chunk-P2BE2A2G.js} +4 -4
- package/dist/{chunk-HJNLL34O.js → chunk-QWZHR2OO.js} +2 -2
- package/dist/{chunk-XAORXFAX.mjs → chunk-QY6QFRRV.mjs} +1 -12
- package/dist/{chunk-XPFWKISJ.mjs → chunk-R4CJHCC4.mjs} +1 -1
- package/dist/{chunk-5CBTJS7J.js → chunk-RJ4LOX7P.js} +2 -2
- package/dist/{chunk-C7KW4NAD.js → chunk-ROAZLZA2.js} +2 -2
- package/dist/{chunk-4IVCBFJA.mjs → chunk-RUYUFXNW.mjs} +1 -1
- package/dist/{chunk-PZT3CIHD.mjs → chunk-SS2NR6DH.mjs} +2 -18
- package/dist/{chunk-5SQEKHPW.js → chunk-T225DB55.js} +7 -52
- package/dist/{chunk-ATA4XHB4.js → chunk-TKN73433.js} +2 -2
- package/dist/{chunk-2LUHLHLE.mjs → chunk-TMYBEXBT.mjs} +1 -1
- package/dist/{chunk-JEDANRCG.mjs → chunk-UQVW4KPP.mjs} +7 -51
- package/dist/{chunk-IMEPIVTR.js → chunk-V6DE3MXC.js} +1 -38
- package/dist/{chunk-KC2FFNL4.js → chunk-VXOTYFEW.js} +2 -2
- package/dist/{chunk-RDGBQM3N.mjs → chunk-WV4V64D5.mjs} +1 -1
- package/dist/helpers-DD6JzYfI.d.mts +860 -0
- package/dist/helpers-kMS5R7KX.d.ts +860 -0
- package/dist/index.d.mts +718 -2804
- package/dist/index.d.ts +718 -2804
- package/dist/index.js +2055 -3922
- package/dist/index.mjs +2467 -3985
- package/dist/{types-Ms3HtAmo.d.mts → types-BAPgWlpX.d.mts} +1 -1
- package/dist/{types-D-0QbsA9.d.ts → types-mZPUEZl0.d.ts} +1 -1
- package/dist/utils.d.mts +1 -55
- package/dist/utils.d.ts +1 -55
- package/dist/utils.js +6 -18
- package/dist/utils.mjs +1 -1
- package/dist/validation/all.d.mts +5 -20
- package/dist/validation/all.d.ts +5 -20
- package/dist/validation/all.js +27 -236
- package/dist/validation/all.mjs +19 -20
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/currency.js +3 -4
- package/dist/validation/complex/currency.mjs +2 -3
- package/dist/validation/complex/file.d.mts +2 -2
- package/dist/validation/complex/file.d.ts +2 -2
- package/dist/validation/complex/file.js +3 -4
- package/dist/validation/complex/file.mjs +2 -3
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/location.js +3 -4
- package/dist/validation/complex/location.mjs +2 -3
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/phone.js +3 -4
- package/dist/validation/complex/phone.mjs +2 -3
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/relation.js +5 -6
- package/dist/validation/complex/relation.mjs +2 -3
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/richtext.js +3 -4
- package/dist/validation/complex/richtext.mjs +2 -3
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/select.js +5 -6
- package/dist/validation/complex/select.mjs +2 -3
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/complex/user.js +3 -4
- package/dist/validation/complex/user.mjs +2 -3
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/formula.js +3 -4
- package/dist/validation/computed/formula.mjs +2 -3
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/computed/rollup.js +3 -4
- package/dist/validation/computed/rollup.mjs +2 -3
- package/dist/validation/config/index.d.mts +2 -403
- package/dist/validation/config/index.d.ts +2 -403
- package/dist/validation/config/index.js +4 -89
- package/dist/validation/config/index.mjs +1 -2
- package/dist/validation/core/index.d.mts +4 -53
- package/dist/validation/core/index.d.ts +4 -53
- package/dist/validation/core/index.js +3 -12
- package/dist/validation/core/index.mjs +1 -2
- package/dist/validation/object/index.d.mts +29 -4
- package/dist/validation/object/index.d.ts +29 -4
- package/dist/validation/object/index.js +29 -30
- package/dist/validation/object/index.mjs +17 -18
- package/dist/validation/primitives/checkbox.d.mts +2 -2
- package/dist/validation/primitives/checkbox.d.ts +2 -2
- package/dist/validation/primitives/checkbox.js +3 -4
- package/dist/validation/primitives/checkbox.mjs +2 -3
- package/dist/validation/primitives/date.d.mts +2 -2
- package/dist/validation/primitives/date.d.ts +2 -2
- package/dist/validation/primitives/date.js +3 -4
- package/dist/validation/primitives/date.mjs +2 -3
- package/dist/validation/primitives/number.d.mts +2 -2
- package/dist/validation/primitives/number.d.ts +2 -2
- package/dist/validation/primitives/number.js +3 -4
- package/dist/validation/primitives/number.mjs +2 -3
- package/dist/validation/primitives/rating.d.mts +2 -2
- package/dist/validation/primitives/rating.d.ts +2 -2
- package/dist/validation/primitives/rating.js +3 -4
- package/dist/validation/primitives/rating.mjs +2 -3
- package/dist/validation/primitives/text.d.mts +2 -2
- package/dist/validation/primitives/text.d.ts +2 -2
- package/dist/validation/primitives/text.js +4 -5
- package/dist/validation/primitives/text.mjs +2 -3
- package/package.json +2 -3
- package/dist/chunk-4DMDOSFN.js +0 -10
- package/dist/chunk-7FSIBNRH.mjs +0 -25
- package/dist/chunk-BEN6TE7Y.js +0 -11
- package/dist/chunk-RDXQ4CYT.mjs +0 -9
- package/dist/chunk-ZWMMEQI7.js +0 -28
- package/dist/index-CftmKoRP.d.mts +0 -2053
- package/dist/index-Dh_XiNFt.d.ts +0 -2053
- package/dist/validation/validators.d.mts +0 -23
- package/dist/validation/validators.d.ts +0 -23
- package/dist/validation/validators.js +0 -265
- package/dist/validation/validators.mjs +0 -20
- /package/dist/{chunk-R6JFUC32.js → chunk-PGERPYDR.js} +0 -0
- /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,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { E as AttributeGroup, G as BaseAttribute, H as DateFormat, I as DateValue, J as
|
|
5
|
-
import { MimeType, IconName, CountryIso3, CurrencyCode
|
|
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,
|
|
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
|
-
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
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:
|
|
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:
|
|
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
|
*/
|
|
@@ -2506,6 +1100,7 @@ interface ApiKeyAuthContext {
|
|
|
2506
1100
|
userId: string | null;
|
|
2507
1101
|
keyId: string;
|
|
2508
1102
|
permissions: ApiKeyPermission[];
|
|
1103
|
+
createdBy: string;
|
|
2509
1104
|
}
|
|
2510
1105
|
interface CreateApiKeyInput {
|
|
2511
1106
|
name: string;
|
|
@@ -2587,21 +1182,6 @@ declare const BEHAVIOR_PROPERTIES: readonly ["required", "disabled", "hidden", "
|
|
|
2587
1182
|
* These only affect display, not logic.
|
|
2588
1183
|
*/
|
|
2589
1184
|
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
1185
|
|
|
2606
1186
|
/**
|
|
2607
1187
|
* Type of resource that can be audited
|
|
@@ -2670,6 +1250,11 @@ interface CreateAuditLogInput {
|
|
|
2670
1250
|
changes?: AuditChange[];
|
|
2671
1251
|
metadata?: Record<string, unknown>;
|
|
2672
1252
|
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Valid column names for sorting audit log entries.
|
|
1255
|
+
* Maps to snake_case database column names used in Supabase queries.
|
|
1256
|
+
*/
|
|
1257
|
+
type AuditSortField = "created_at" | "action" | "resource_type" | "actor_id" | "actor_email" | "object_name";
|
|
2673
1258
|
/**
|
|
2674
1259
|
* Options for listing audit logs
|
|
2675
1260
|
*/
|
|
@@ -2682,8 +1267,10 @@ interface AuditListOptions {
|
|
|
2682
1267
|
actorId?: string;
|
|
2683
1268
|
from?: Date;
|
|
2684
1269
|
to?: Date;
|
|
2685
|
-
|
|
2686
|
-
|
|
1270
|
+
sorts?: Array<{
|
|
1271
|
+
field: AuditSortField;
|
|
1272
|
+
direction: "asc" | "desc";
|
|
1273
|
+
}>;
|
|
2687
1274
|
}
|
|
2688
1275
|
/**
|
|
2689
1276
|
* Options for AuditService
|
|
@@ -2712,7 +1299,7 @@ type AgentRunStatus = "pending" | "running" | "completed" | "failed" | "cancelle
|
|
|
2712
1299
|
type AgentSessionStatus = "active" | "idle" | "completed" | "failed" | "cancelled" | "waiting_human" | "timeout" | "expired";
|
|
2713
1300
|
type AgentSessionMode = "interactive" | "autonomous";
|
|
2714
1301
|
type QuestionStatus = "pending" | "answered" | "timeout" | "cancelled";
|
|
2715
|
-
type TriggerEventType = "record.created" | "record.updated" | "record.deleted" | "record.field_changed" | "
|
|
1302
|
+
type TriggerEventType = "record.created" | "record.updated" | "record.deleted" | "record.field_changed" | "form.submitted" | "agent.completed" | "webhook" | "schedule";
|
|
2716
1303
|
type AgentTriggerType = Extract<TriggerEventType, "record.created" | "record.updated" | "record.deleted">;
|
|
2717
1304
|
type ProviderName = "anthropic" | "openai" | "google" | "mistral";
|
|
2718
1305
|
interface ModelDefinition {
|
|
@@ -2743,7 +1330,6 @@ interface AgentConfig {
|
|
|
2743
1330
|
canDelegate: boolean;
|
|
2744
1331
|
maxDepth: number;
|
|
2745
1332
|
maxTreeCostUsd?: number;
|
|
2746
|
-
canAskHuman?: boolean;
|
|
2747
1333
|
critic?: CriticConfig;
|
|
2748
1334
|
}
|
|
2749
1335
|
interface CriticConfig {
|
|
@@ -2757,13 +1343,13 @@ interface RecordAgentTrigger {
|
|
|
2757
1343
|
objectId: string;
|
|
2758
1344
|
filter?: Record<string, unknown>;
|
|
2759
1345
|
}
|
|
2760
|
-
interface
|
|
2761
|
-
type: "
|
|
2762
|
-
|
|
2763
|
-
|
|
1346
|
+
interface FormSubmittedAgentTrigger {
|
|
1347
|
+
type: "form.submitted";
|
|
1348
|
+
formId?: string;
|
|
1349
|
+
formName?: string;
|
|
2764
1350
|
filter?: Record<string, unknown>;
|
|
2765
1351
|
}
|
|
2766
|
-
type AgentTrigger = RecordAgentTrigger |
|
|
1352
|
+
type AgentTrigger = RecordAgentTrigger | FormSubmittedAgentTrigger;
|
|
2767
1353
|
/**
|
|
2768
1354
|
* Standalone trigger definition (replaces embedded AgentTrigger[]).
|
|
2769
1355
|
* Triggers are now first-class entities with their own lifecycle.
|
|
@@ -2776,7 +1362,7 @@ interface AgentTriggerDefinition {
|
|
|
2776
1362
|
eventType: TriggerEventType;
|
|
2777
1363
|
objectId?: string;
|
|
2778
1364
|
fieldPath?: string;
|
|
2779
|
-
|
|
1365
|
+
formDefinitionId?: string;
|
|
2780
1366
|
sourceAgentId?: string;
|
|
2781
1367
|
webhookPath?: string;
|
|
2782
1368
|
cronExpression?: string;
|
|
@@ -2956,36 +1542,25 @@ interface RecordAgentEvent {
|
|
|
2956
1542
|
tenantId: string;
|
|
2957
1543
|
data?: Record<string, unknown>;
|
|
2958
1544
|
}
|
|
2959
|
-
interface
|
|
2960
|
-
type: "
|
|
1545
|
+
interface FormSubmittedAgentEvent {
|
|
1546
|
+
type: "form.submitted";
|
|
2961
1547
|
tenantId: string;
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
createdRecordIds: string[];
|
|
2968
|
-
targetRecordIds: string[];
|
|
2969
|
-
slotRecordIds: Record<string, string>;
|
|
1548
|
+
formId: string;
|
|
1549
|
+
formName: string;
|
|
1550
|
+
submissionId: string;
|
|
1551
|
+
createdBy?: string;
|
|
1552
|
+
createdRecordIds: Record<string, string>;
|
|
2970
1553
|
data: {
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
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>;
|
|
1554
|
+
formId: string;
|
|
1555
|
+
formName: string;
|
|
1556
|
+
submissionId: string;
|
|
1557
|
+
createdBy?: string;
|
|
1558
|
+
createdRecordIds: Record<string, string>;
|
|
1559
|
+
slotValues: Record<string, Record<string, unknown>>;
|
|
1560
|
+
stepValues: Record<string, Record<string, unknown>>;
|
|
2986
1561
|
};
|
|
2987
1562
|
}
|
|
2988
|
-
type AgentEvent = RecordAgentEvent |
|
|
1563
|
+
type AgentEvent = RecordAgentEvent | FormSubmittedAgentEvent;
|
|
2989
1564
|
interface AgentDashboard {
|
|
2990
1565
|
activeRuns: number;
|
|
2991
1566
|
pendingRuns: number;
|
|
@@ -2995,27 +1570,6 @@ interface AgentDashboard {
|
|
|
2995
1570
|
totalCostWeek: number;
|
|
2996
1571
|
}
|
|
2997
1572
|
|
|
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
1573
|
/**
|
|
3020
1574
|
* Common configuration for all builders (Objects & Attributes)
|
|
3021
1575
|
*/
|
|
@@ -3119,6 +1673,226 @@ interface DocumentListOptions {
|
|
|
3119
1673
|
processingStatus?: ProcessingStatus;
|
|
3120
1674
|
}
|
|
3121
1675
|
|
|
1676
|
+
/**
|
|
1677
|
+
* Error codes for schema exceptions
|
|
1678
|
+
*/
|
|
1679
|
+
declare const SchemaErrorCode: {
|
|
1680
|
+
readonly UNKNOWN: "SCHEMA_UNKNOWN_ERROR";
|
|
1681
|
+
readonly OBJECT_NOT_FOUND: "SCHEMA_OBJECT_NOT_FOUND";
|
|
1682
|
+
readonly ATTRIBUTE_NOT_FOUND: "SCHEMA_ATTRIBUTE_NOT_FOUND";
|
|
1683
|
+
readonly RECORD_NOT_FOUND: "SCHEMA_RECORD_NOT_FOUND";
|
|
1684
|
+
readonly ROLE_NOT_FOUND: "SCHEMA_ROLE_NOT_FOUND";
|
|
1685
|
+
readonly MEMORY_NOT_FOUND: "SCHEMA_MEMORY_NOT_FOUND";
|
|
1686
|
+
readonly VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED";
|
|
1687
|
+
readonly INVALID_ATTRIBUTE_NAME: "SCHEMA_INVALID_ATTRIBUTE_NAME";
|
|
1688
|
+
readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
|
|
1689
|
+
readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
|
|
1690
|
+
readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
|
|
1691
|
+
readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
|
|
1692
|
+
readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
|
|
1693
|
+
readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
|
|
1694
|
+
readonly ACCESS_DENIED: "SCHEMA_ACCESS_DENIED";
|
|
1695
|
+
readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
|
|
1696
|
+
readonly DUPLICATE_OBJECT: "SCHEMA_DUPLICATE_OBJECT";
|
|
1697
|
+
readonly DUPLICATE_ATTRIBUTE: "SCHEMA_DUPLICATE_ATTRIBUTE";
|
|
1698
|
+
readonly CONFLICT: "SCHEMA_CONFLICT";
|
|
1699
|
+
readonly STORAGE_UPLOAD_FAILED: "SCHEMA_STORAGE_UPLOAD_FAILED";
|
|
1700
|
+
readonly STORAGE_DOWNLOAD_FAILED: "SCHEMA_STORAGE_DOWNLOAD_FAILED";
|
|
1701
|
+
readonly STORAGE_DELETE_FAILED: "SCHEMA_STORAGE_DELETE_FAILED";
|
|
1702
|
+
readonly STORAGE_URL_FAILED: "SCHEMA_STORAGE_URL_FAILED";
|
|
1703
|
+
readonly REPOSITORY_CREATE_FAILED: "SCHEMA_REPOSITORY_CREATE_FAILED";
|
|
1704
|
+
readonly REPOSITORY_UPDATE_FAILED: "SCHEMA_REPOSITORY_UPDATE_FAILED";
|
|
1705
|
+
readonly REPOSITORY_DELETE_FAILED: "SCHEMA_REPOSITORY_DELETE_FAILED";
|
|
1706
|
+
readonly REPOSITORY_QUERY_FAILED: "SCHEMA_REPOSITORY_QUERY_FAILED";
|
|
1707
|
+
readonly NOT_IMPLEMENTED: "SCHEMA_NOT_IMPLEMENTED";
|
|
1708
|
+
readonly TIMEOUT: "SCHEMA_TIMEOUT";
|
|
1709
|
+
readonly RECORD_REFERENCED: "SCHEMA_RECORD_REFERENCED";
|
|
1710
|
+
readonly ATTRIBUTE_IN_USE: "SCHEMA_ATTRIBUTE_IN_USE";
|
|
1711
|
+
readonly OBJECT_REFERENCED: "SCHEMA_OBJECT_REFERENCED";
|
|
1712
|
+
};
|
|
1713
|
+
type SchemaErrorCode = (typeof SchemaErrorCode)[keyof typeof SchemaErrorCode];
|
|
1714
|
+
/**
|
|
1715
|
+
* Base error class for all schema-related errors
|
|
1716
|
+
*/
|
|
1717
|
+
declare class SchemaError extends Error {
|
|
1718
|
+
readonly code: SchemaErrorCode;
|
|
1719
|
+
readonly details?: Record<string, unknown>;
|
|
1720
|
+
constructor(message: string, code?: SchemaErrorCode, details?: Record<string, unknown>);
|
|
1721
|
+
toJSON(): {
|
|
1722
|
+
name: string;
|
|
1723
|
+
code: SchemaErrorCode;
|
|
1724
|
+
message: string;
|
|
1725
|
+
details: Record<string, unknown> | undefined;
|
|
1726
|
+
};
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* Base class for "not found" errors
|
|
1730
|
+
*/
|
|
1731
|
+
declare class NotFoundError extends SchemaError {
|
|
1732
|
+
readonly resourceType: string;
|
|
1733
|
+
readonly resourceId: string;
|
|
1734
|
+
constructor(resourceType: string, resourceId: string, code?: SchemaErrorCode);
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Object not found error
|
|
1738
|
+
*/
|
|
1739
|
+
declare class ObjectNotFoundError extends NotFoundError {
|
|
1740
|
+
constructor(objectId: string);
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Attribute not found error
|
|
1744
|
+
*/
|
|
1745
|
+
declare class AttributeNotFoundError extends NotFoundError {
|
|
1746
|
+
constructor(attributeId: string);
|
|
1747
|
+
}
|
|
1748
|
+
/**
|
|
1749
|
+
* Record not found error
|
|
1750
|
+
*/
|
|
1751
|
+
declare class RecordNotFoundError extends NotFoundError {
|
|
1752
|
+
constructor(recordId: string);
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Validation error with field-level details
|
|
1756
|
+
*/
|
|
1757
|
+
interface ValidationErrorDetail {
|
|
1758
|
+
path: string[];
|
|
1759
|
+
message: string;
|
|
1760
|
+
code?: string;
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Validation error thrown when data fails schema validation
|
|
1764
|
+
*/
|
|
1765
|
+
declare class ValidationError extends SchemaError {
|
|
1766
|
+
readonly errors: ValidationErrorDetail[];
|
|
1767
|
+
constructor(message: string, errors: ValidationErrorDetail[]);
|
|
1768
|
+
/**
|
|
1769
|
+
* Create a validation error from Zod-style errors
|
|
1770
|
+
*/
|
|
1771
|
+
static fromZodErrors(errors: Array<{
|
|
1772
|
+
path: (string | number)[];
|
|
1773
|
+
message: string;
|
|
1774
|
+
}>): ValidationError;
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Error thrown when attempting to modify a protected (system) resource
|
|
1778
|
+
*/
|
|
1779
|
+
declare class ProtectedResourceError extends SchemaError {
|
|
1780
|
+
readonly resourceType: "object" | "attribute" | "view";
|
|
1781
|
+
readonly resourceName: string;
|
|
1782
|
+
readonly operation: "delete" | "modify";
|
|
1783
|
+
constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Error thrown during native object synchronization
|
|
1787
|
+
*/
|
|
1788
|
+
declare class SyncError extends SchemaError {
|
|
1789
|
+
readonly objectName: string;
|
|
1790
|
+
readonly cause?: Error;
|
|
1791
|
+
constructor(objectName: string, message: string, cause?: Error);
|
|
1792
|
+
}
|
|
1793
|
+
/**
|
|
1794
|
+
* Error thrown when attempting to create a duplicate resource
|
|
1795
|
+
*/
|
|
1796
|
+
declare class DuplicateError extends SchemaError {
|
|
1797
|
+
readonly resourceType: "object" | "attribute";
|
|
1798
|
+
readonly resourceName: string;
|
|
1799
|
+
constructor(resourceType: "object" | "attribute", resourceName: string);
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1802
|
+
* Check if an error is a SchemaError
|
|
1803
|
+
*/
|
|
1804
|
+
declare function isSchemaError(error: unknown): error is SchemaError;
|
|
1805
|
+
/**
|
|
1806
|
+
* Check if an error is a NotFoundError
|
|
1807
|
+
*/
|
|
1808
|
+
declare function isNotFoundError(error: unknown): error is NotFoundError;
|
|
1809
|
+
/**
|
|
1810
|
+
* Check if an error is a ValidationError
|
|
1811
|
+
*/
|
|
1812
|
+
declare function isValidationError(error: unknown): error is ValidationError;
|
|
1813
|
+
/**
|
|
1814
|
+
* Check if an error is a ProtectedResourceError
|
|
1815
|
+
*/
|
|
1816
|
+
declare function isProtectedResourceError(error: unknown): error is ProtectedResourceError;
|
|
1817
|
+
/**
|
|
1818
|
+
* Error thrown when a user lacks permission to perform an action
|
|
1819
|
+
*/
|
|
1820
|
+
declare class ForbiddenError extends SchemaError {
|
|
1821
|
+
readonly objectName: string;
|
|
1822
|
+
readonly action: string;
|
|
1823
|
+
readonly userId?: string;
|
|
1824
|
+
constructor(objectName: string, action: string, userId?: string);
|
|
1825
|
+
}
|
|
1826
|
+
/**
|
|
1827
|
+
* Error thrown when trying to modify a protected role
|
|
1828
|
+
*/
|
|
1829
|
+
declare class ProtectedRoleError extends SchemaError {
|
|
1830
|
+
readonly roleName: string;
|
|
1831
|
+
readonly operation: "delete" | "modify";
|
|
1832
|
+
constructor(roleName: string, operation: "delete" | "modify");
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* Role not found error
|
|
1836
|
+
*/
|
|
1837
|
+
declare class RoleNotFoundError extends NotFoundError {
|
|
1838
|
+
constructor(roleId: string);
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Thrown when a record has been modified by another request between read and write.
|
|
1842
|
+
* Clients should retry the operation with fresh data.
|
|
1843
|
+
* Maps to HTTP 409 Conflict.
|
|
1844
|
+
*/
|
|
1845
|
+
declare class ConcurrentModificationError extends SchemaError {
|
|
1846
|
+
constructor(recordId: string);
|
|
1847
|
+
}
|
|
1848
|
+
/**
|
|
1849
|
+
* Storage operation type for error context
|
|
1850
|
+
*/
|
|
1851
|
+
type StorageOperation = "upload" | "download" | "delete" | "signedUrl";
|
|
1852
|
+
/**
|
|
1853
|
+
* Error thrown when a storage operation fails
|
|
1854
|
+
*/
|
|
1855
|
+
declare class StorageError extends SchemaError {
|
|
1856
|
+
readonly operation: StorageOperation;
|
|
1857
|
+
readonly path?: string;
|
|
1858
|
+
readonly cause?: string;
|
|
1859
|
+
constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* Error thrown when access to a resource is denied (e.g., tenant path mismatch)
|
|
1863
|
+
*/
|
|
1864
|
+
declare class AccessDeniedError extends SchemaError {
|
|
1865
|
+
readonly resource: string;
|
|
1866
|
+
readonly reason?: string;
|
|
1867
|
+
constructor(resource: string, reason?: string);
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Repository operation type for error context
|
|
1871
|
+
*/
|
|
1872
|
+
type RepositoryOperation = "create" | "update" | "delete" | "query";
|
|
1873
|
+
/**
|
|
1874
|
+
* Error thrown when a repository operation fails
|
|
1875
|
+
*/
|
|
1876
|
+
declare class RepositoryError extends SchemaError {
|
|
1877
|
+
readonly operation: RepositoryOperation;
|
|
1878
|
+
readonly entity: string;
|
|
1879
|
+
readonly cause?: string;
|
|
1880
|
+
constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* Error thrown when a feature or method is not yet implemented
|
|
1884
|
+
*/
|
|
1885
|
+
declare class NotImplementedError extends SchemaError {
|
|
1886
|
+
readonly feature: string;
|
|
1887
|
+
readonly milestone?: string;
|
|
1888
|
+
constructor(feature: string, milestone?: string);
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Memory entry not found error
|
|
1892
|
+
*/
|
|
1893
|
+
declare class MemoryNotFoundError extends NotFoundError {
|
|
1894
|
+
constructor(memoryId: string);
|
|
1895
|
+
}
|
|
3122
1896
|
/**
|
|
3123
1897
|
* Reference information for a record that is blocking deletion.
|
|
3124
1898
|
*/
|
|
@@ -3135,23 +1909,10 @@ interface RecordReference {
|
|
|
3135
1909
|
*
|
|
3136
1910
|
* This implements the "Restrict" behavior: deletion is blocked and the user
|
|
3137
1911
|
* 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
1912
|
*/
|
|
3151
|
-
declare class RecordReferencedError extends
|
|
1913
|
+
declare class RecordReferencedError extends SchemaError {
|
|
3152
1914
|
readonly recordId: string;
|
|
3153
1915
|
readonly references: RecordReference[];
|
|
3154
|
-
readonly code: "RECORD_REFERENCED";
|
|
3155
1916
|
constructor(recordId: string, references: RecordReference[]);
|
|
3156
1917
|
}
|
|
3157
1918
|
/**
|
|
@@ -3165,22 +1926,10 @@ type AttributeUsage = "labelExpression" | "view" | "filter";
|
|
|
3165
1926
|
* - The object's labelExpression template
|
|
3166
1927
|
* - A saved view's column configuration
|
|
3167
1928
|
* - 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
1929
|
*/
|
|
3180
|
-
declare class AttributeInUseError extends
|
|
1930
|
+
declare class AttributeInUseError extends SchemaError {
|
|
3181
1931
|
readonly attributeName: string;
|
|
3182
1932
|
readonly usage: AttributeUsage;
|
|
3183
|
-
readonly code: "ATTRIBUTE_IN_USE";
|
|
3184
1933
|
constructor(attributeName: string, usage: AttributeUsage);
|
|
3185
1934
|
}
|
|
3186
1935
|
/**
|
|
@@ -3188,27 +1937,28 @@ declare class AttributeInUseError extends Error {
|
|
|
3188
1937
|
*
|
|
3189
1938
|
* Objects cannot be deleted if other objects have relation attributes
|
|
3190
1939
|
* 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
1940
|
*/
|
|
3203
|
-
declare class ObjectReferencedError extends
|
|
1941
|
+
declare class ObjectReferencedError extends SchemaError {
|
|
3204
1942
|
readonly objectName: string;
|
|
3205
1943
|
readonly referencingObjects: string[];
|
|
3206
|
-
readonly code: "OBJECT_REFERENCED";
|
|
3207
1944
|
constructor(objectName: string, referencingObjects: string[]);
|
|
3208
1945
|
}
|
|
3209
1946
|
/**
|
|
3210
|
-
*
|
|
3211
|
-
|
|
1947
|
+
* Check if an error is a RecordReferencedError
|
|
1948
|
+
*/
|
|
1949
|
+
declare function isRecordReferencedError(error: unknown): error is RecordReferencedError;
|
|
1950
|
+
/**
|
|
1951
|
+
* Check if an error is an AttributeInUseError
|
|
1952
|
+
*/
|
|
1953
|
+
declare function isAttributeInUseError(error: unknown): error is AttributeInUseError;
|
|
1954
|
+
/**
|
|
1955
|
+
* Check if an error is an ObjectReferencedError
|
|
1956
|
+
*/
|
|
1957
|
+
declare function isObjectReferencedError(error: unknown): error is ObjectReferencedError;
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* Extracts a safe error message from an unknown error value.
|
|
1961
|
+
*
|
|
3212
1962
|
* @param error - The error value (can be Error, string, unknown)
|
|
3213
1963
|
* @returns A string message suitable for logging or display
|
|
3214
1964
|
*
|
|
@@ -3224,6 +1974,183 @@ declare class ObjectReferencedError extends Error {
|
|
|
3224
1974
|
*/
|
|
3225
1975
|
declare function getErrorMessage(error: unknown): string;
|
|
3226
1976
|
|
|
1977
|
+
declare const FORM_FORBIDDEN_ATTRIBUTE_TYPES: readonly ["relation", "multiRelation", "formula", "rollup", "file", "document", "richtext", "user"];
|
|
1978
|
+
interface FormSlotFieldRef {
|
|
1979
|
+
type: "slot";
|
|
1980
|
+
slotId: string;
|
|
1981
|
+
attribute: string;
|
|
1982
|
+
label?: string;
|
|
1983
|
+
tooltip?: string;
|
|
1984
|
+
required?: boolean;
|
|
1985
|
+
}
|
|
1986
|
+
interface FormFreeFieldRef {
|
|
1987
|
+
type: "free";
|
|
1988
|
+
attribute: Attribute;
|
|
1989
|
+
label?: string;
|
|
1990
|
+
tooltip?: string;
|
|
1991
|
+
required?: boolean;
|
|
1992
|
+
}
|
|
1993
|
+
type FormFieldRef = FormSlotFieldRef | FormFreeFieldRef;
|
|
1994
|
+
declare function isFormSlotFieldRef(f: FormFieldRef): f is FormSlotFieldRef;
|
|
1995
|
+
declare function isFormFreeFieldRef(f: FormFieldRef): f is FormFreeFieldRef;
|
|
1996
|
+
|
|
1997
|
+
interface FormFieldsRow {
|
|
1998
|
+
id: string;
|
|
1999
|
+
order: number;
|
|
2000
|
+
type: "fields";
|
|
2001
|
+
fields: FormFieldRef[];
|
|
2002
|
+
}
|
|
2003
|
+
interface FormHeadingRow {
|
|
2004
|
+
id: string;
|
|
2005
|
+
order: number;
|
|
2006
|
+
type: "heading";
|
|
2007
|
+
content: string;
|
|
2008
|
+
level?: 1 | 2 | 3;
|
|
2009
|
+
}
|
|
2010
|
+
interface FormSeparatorRow {
|
|
2011
|
+
id: string;
|
|
2012
|
+
order: number;
|
|
2013
|
+
type: "separator";
|
|
2014
|
+
}
|
|
2015
|
+
interface FormTextRow {
|
|
2016
|
+
id: string;
|
|
2017
|
+
order: number;
|
|
2018
|
+
type: "text";
|
|
2019
|
+
content: string;
|
|
2020
|
+
}
|
|
2021
|
+
type FormRow = FormFieldsRow | FormHeadingRow | FormSeparatorRow | FormTextRow;
|
|
2022
|
+
declare function isFormFieldsRow(row: FormRow): row is FormFieldsRow;
|
|
2023
|
+
declare function isFormHeadingRow(row: FormRow): row is FormHeadingRow;
|
|
2024
|
+
declare function isFormSeparatorRow(row: FormRow): row is FormSeparatorRow;
|
|
2025
|
+
declare function isFormTextRow(row: FormRow): row is FormTextRow;
|
|
2026
|
+
|
|
2027
|
+
type SlotMode = "create" | "select" | "optional" | "create_if_not_empty";
|
|
2028
|
+
interface FormSlot {
|
|
2029
|
+
id: string;
|
|
2030
|
+
objectName: string;
|
|
2031
|
+
label: string;
|
|
2032
|
+
mode: SlotMode;
|
|
2033
|
+
color?: ColorId;
|
|
2034
|
+
icon?: IconName;
|
|
2035
|
+
objectLabel?: string;
|
|
2036
|
+
}
|
|
2037
|
+
interface FormStep {
|
|
2038
|
+
id: string;
|
|
2039
|
+
label: string;
|
|
2040
|
+
description?: string;
|
|
2041
|
+
rows: FormRow[];
|
|
2042
|
+
}
|
|
2043
|
+
type FormStatus = "draft" | "published" | "archived";
|
|
2044
|
+
interface FormDefinition {
|
|
2045
|
+
id?: Uuid;
|
|
2046
|
+
name: string;
|
|
2047
|
+
label: string;
|
|
2048
|
+
description?: string;
|
|
2049
|
+
icon?: IconName;
|
|
2050
|
+
status: FormStatus;
|
|
2051
|
+
version: number;
|
|
2052
|
+
slots: FormSlot[];
|
|
2053
|
+
steps: FormStep[];
|
|
2054
|
+
metadata?: Record<string, unknown>;
|
|
2055
|
+
createdAt?: Date;
|
|
2056
|
+
updatedAt?: Date;
|
|
2057
|
+
}
|
|
2058
|
+
declare function isFormDefinition(obj: unknown): obj is FormDefinition;
|
|
2059
|
+
|
|
2060
|
+
type FormSubmissionStatus = "draft" | "submitted" | "processing" | "completed" | "failed";
|
|
2061
|
+
interface FormSubmission {
|
|
2062
|
+
id?: Uuid;
|
|
2063
|
+
formId: string;
|
|
2064
|
+
formName: string;
|
|
2065
|
+
/** Values by step ID: { [stepId]: { [attrName]: value } } */
|
|
2066
|
+
stepValues: Record<string, Record<string, unknown>>;
|
|
2067
|
+
/** Aggregated values by slot ID: { [slotId]: { [attrName]: value } } */
|
|
2068
|
+
slotValues: Record<string, Record<string, unknown>>;
|
|
2069
|
+
/** Record IDs created on submit: { [slotId]: recordId } */
|
|
2070
|
+
createdRecordIds: Record<string, string>;
|
|
2071
|
+
status: FormSubmissionStatus;
|
|
2072
|
+
currentStepIndex: number;
|
|
2073
|
+
createdBy?: string;
|
|
2074
|
+
submittedAt?: Date;
|
|
2075
|
+
tenantId?: string;
|
|
2076
|
+
createdAt?: Date;
|
|
2077
|
+
updatedAt?: Date;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
interface DBForm {
|
|
2081
|
+
id: Uuid;
|
|
2082
|
+
tenant_id: string;
|
|
2083
|
+
name: string;
|
|
2084
|
+
label: string;
|
|
2085
|
+
description?: string;
|
|
2086
|
+
icon?: string;
|
|
2087
|
+
status: string;
|
|
2088
|
+
version: number;
|
|
2089
|
+
slots: unknown;
|
|
2090
|
+
steps: unknown;
|
|
2091
|
+
system: boolean;
|
|
2092
|
+
metadata?: unknown;
|
|
2093
|
+
created_at?: string;
|
|
2094
|
+
updated_at?: string;
|
|
2095
|
+
}
|
|
2096
|
+
interface CreateDBForm {
|
|
2097
|
+
tenant_id: string;
|
|
2098
|
+
name: string;
|
|
2099
|
+
label: string;
|
|
2100
|
+
description?: string;
|
|
2101
|
+
icon?: string;
|
|
2102
|
+
status?: string;
|
|
2103
|
+
version?: number;
|
|
2104
|
+
slots?: unknown;
|
|
2105
|
+
steps?: unknown;
|
|
2106
|
+
system?: boolean;
|
|
2107
|
+
metadata?: unknown;
|
|
2108
|
+
}
|
|
2109
|
+
interface UpdateDBForm {
|
|
2110
|
+
label?: string;
|
|
2111
|
+
description?: string;
|
|
2112
|
+
icon?: string;
|
|
2113
|
+
status?: string;
|
|
2114
|
+
version?: number;
|
|
2115
|
+
slots?: unknown;
|
|
2116
|
+
steps?: unknown;
|
|
2117
|
+
metadata?: unknown;
|
|
2118
|
+
updated_at?: string;
|
|
2119
|
+
}
|
|
2120
|
+
interface DBFormSubmission {
|
|
2121
|
+
id: Uuid;
|
|
2122
|
+
tenant_id: string;
|
|
2123
|
+
form_id: Uuid;
|
|
2124
|
+
form_name: string;
|
|
2125
|
+
status: string;
|
|
2126
|
+
current_step_index: number;
|
|
2127
|
+
step_values: unknown;
|
|
2128
|
+
slot_values: unknown;
|
|
2129
|
+
created_record_ids: unknown;
|
|
2130
|
+
created_by?: string;
|
|
2131
|
+
submitted_at?: string;
|
|
2132
|
+
created_at?: string;
|
|
2133
|
+
updated_at?: string;
|
|
2134
|
+
}
|
|
2135
|
+
interface CreateDBFormSubmission {
|
|
2136
|
+
tenant_id: string;
|
|
2137
|
+
form_id: Uuid;
|
|
2138
|
+
form_name: string;
|
|
2139
|
+
status?: string;
|
|
2140
|
+
step_values?: unknown;
|
|
2141
|
+
slot_values?: unknown;
|
|
2142
|
+
created_by?: string;
|
|
2143
|
+
}
|
|
2144
|
+
interface UpdateDBFormSubmission {
|
|
2145
|
+
status?: string;
|
|
2146
|
+
current_step_index?: number;
|
|
2147
|
+
step_values?: unknown;
|
|
2148
|
+
slot_values?: unknown;
|
|
2149
|
+
created_record_ids?: unknown;
|
|
2150
|
+
submitted_at?: string;
|
|
2151
|
+
updated_at?: string;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
3227
2154
|
/**
|
|
3228
2155
|
* Autocomplete suggestion from geocoding service
|
|
3229
2156
|
*/
|
|
@@ -3392,67 +2319,6 @@ type InferMultiselectValue<A extends MultiselectAttribute> = A["options"] extend
|
|
|
3392
2319
|
* This avoids deep conditional nesting that causes TS2589 on large objects
|
|
3393
2320
|
*/
|
|
3394
2321
|
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
2322
|
/**
|
|
3457
2323
|
* Base type for custom attribute values added via UI
|
|
3458
2324
|
* Supports all possible attribute value types
|
|
@@ -3581,67 +2447,6 @@ type ExtractRecordUpdateStrict<TBuilder> = TBuilder extends {
|
|
|
3581
2447
|
update: infer R;
|
|
3582
2448
|
};
|
|
3583
2449
|
} ? 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
2450
|
|
|
3646
2451
|
/**
|
|
3647
2452
|
* Context passed to policy methods
|
|
@@ -3863,20 +2668,6 @@ declare const SYSTEM_ATTRIBUTES: Record<string, SystemAttribute>;
|
|
|
3863
2668
|
* Use this to append system attributes to an object's attribute list
|
|
3864
2669
|
*/
|
|
3865
2670
|
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
2671
|
|
|
3881
2672
|
/**
|
|
3882
2673
|
* User status for account management
|
|
@@ -3990,54 +2781,6 @@ interface InviteUserInput {
|
|
|
3990
2781
|
redirectTo?: string;
|
|
3991
2782
|
}
|
|
3992
2783
|
|
|
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
2784
|
/**
|
|
4042
2785
|
* Utility functions for working with objects.
|
|
4043
2786
|
* Provides type-safe helpers to avoid common anti-patterns like Object.keys().length checks.
|
|
@@ -4069,560 +2812,159 @@ declare function isNotEmpty(obj: unknown): obj is Record<string, unknown>;
|
|
|
4069
2812
|
*
|
|
4070
2813
|
* @example
|
|
4071
2814
|
* 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
|
-
}
|
|
2815
|
+
* const empty = toUndefinedIfEmpty({}); // undefined
|
|
2816
|
+
*/
|
|
2817
|
+
declare function toUndefinedIfEmpty<T extends Record<string, unknown>>(obj: T | undefined | null): T | undefined;
|
|
2818
|
+
|
|
4536
2819
|
/**
|
|
4537
|
-
*
|
|
2820
|
+
* Default empty value placeholder
|
|
4538
2821
|
*/
|
|
4539
|
-
declare
|
|
4540
|
-
readonly roleName: string;
|
|
4541
|
-
readonly operation: "delete" | "modify";
|
|
4542
|
-
constructor(roleName: string, operation: "delete" | "modify");
|
|
4543
|
-
}
|
|
2822
|
+
declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
|
|
4544
2823
|
/**
|
|
4545
|
-
*
|
|
2824
|
+
* Format an attribute value for display
|
|
2825
|
+
*
|
|
2826
|
+
* This function converts raw attribute values into human-readable strings
|
|
2827
|
+
* based on the attribute type and configuration.
|
|
2828
|
+
*
|
|
2829
|
+
* @param value - The raw value to format
|
|
2830
|
+
* @param attribute - The attribute definition
|
|
2831
|
+
* @returns Formatted string representation
|
|
2832
|
+
*
|
|
2833
|
+
* @example
|
|
2834
|
+
* ```typescript
|
|
2835
|
+
* // Text attribute
|
|
2836
|
+
* formatAttributeValue("Hello", textAttr);
|
|
2837
|
+
* // → "Hello"
|
|
2838
|
+
*
|
|
2839
|
+
* // Currency attribute
|
|
2840
|
+
* formatAttributeValue({ value: 1500, code: "EUR" }, currencyAttr);
|
|
2841
|
+
* // → "1,500.00 EUR"
|
|
2842
|
+
*
|
|
2843
|
+
* // Select attribute with options
|
|
2844
|
+
* formatAttributeValue("active", statusAttr);
|
|
2845
|
+
* // → "Active" (label from options)
|
|
2846
|
+
*
|
|
2847
|
+
* // Location with city granularity
|
|
2848
|
+
* formatAttributeValue({ city: "Paris", country: "FRA" }, locationAttr);
|
|
2849
|
+
* // → "Paris, FRA"
|
|
2850
|
+
*
|
|
2851
|
+
* // Empty value
|
|
2852
|
+
* formatAttributeValue(null, textAttr);
|
|
2853
|
+
* // → "—"
|
|
2854
|
+
* ```
|
|
4546
2855
|
*/
|
|
4547
|
-
declare
|
|
4548
|
-
|
|
4549
|
-
}
|
|
2856
|
+
declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
|
|
2857
|
+
|
|
4550
2858
|
/**
|
|
4551
|
-
*
|
|
2859
|
+
* Render a label expression template with values
|
|
2860
|
+
*
|
|
2861
|
+
* Supports:
|
|
2862
|
+
* - Variable interpolation: `{{ fieldName }}`
|
|
2863
|
+
* - Dot notation: `{{ user.firstName }}`
|
|
2864
|
+
* - Simple pipes: `{{ name | UPPER }}`, `{{ name | capitalize | trim }}`
|
|
2865
|
+
* - Conditional pipes with args: `{{ role | prefix:", " }}`, `{{ name | suffix:" Inc." }}`
|
|
2866
|
+
*
|
|
2867
|
+
* Available pipes:
|
|
2868
|
+
* - `UPPER` - Convert to uppercase
|
|
2869
|
+
* - `LOWER` - Convert to lowercase
|
|
2870
|
+
* - `capitalize` - Capitalize first letter of each word
|
|
2871
|
+
* - `trim` - Trim whitespace
|
|
2872
|
+
* - `prefix:"text"` - Add prefix only if value is non-empty
|
|
2873
|
+
* - `suffix:"text"` - Add suffix only if value is non-empty
|
|
2874
|
+
* - `wrap:"pre" "suf"` - Wrap with prefix/suffix only if non-empty
|
|
2875
|
+
* - `default:"text"` - Show default value if empty
|
|
2876
|
+
*
|
|
2877
|
+
* @param template - The label expression template (e.g., "{{ firstName }} {{ lastName }}")
|
|
2878
|
+
* @param values - Record values to interpolate
|
|
2879
|
+
* @param fallback - Fallback value if result is empty (default: "(Untitled)")
|
|
2880
|
+
* @returns The rendered label string
|
|
4552
2881
|
*/
|
|
4553
|
-
declare function
|
|
2882
|
+
declare function renderLabelExpression(template: string, values: Record<string, unknown>, fallback?: string): string;
|
|
4554
2883
|
/**
|
|
4555
|
-
*
|
|
4556
|
-
*
|
|
4557
|
-
* Maps to HTTP 409 Conflict.
|
|
2884
|
+
* Check if a string is a valid label expression template
|
|
2885
|
+
* A valid template contains at least one {{ variable }} block with a non-empty variable
|
|
4558
2886
|
*/
|
|
4559
|
-
declare
|
|
4560
|
-
constructor(recordId: string);
|
|
4561
|
-
}
|
|
2887
|
+
declare function isLabelExpression(value: string): boolean;
|
|
4562
2888
|
/**
|
|
4563
|
-
*
|
|
2889
|
+
* Extract attribute names referenced in a label expression
|
|
2890
|
+
* Useful for validation or dependency tracking
|
|
2891
|
+
*
|
|
2892
|
+
* @example
|
|
2893
|
+
* extractAttributeNames("{{ firstName }} {{ lastName | UPPER }}")
|
|
2894
|
+
* // -> ["firstName", "lastName"]
|
|
4564
2895
|
*/
|
|
4565
|
-
|
|
2896
|
+
declare function extractAttributeNames(template: string): string[];
|
|
2897
|
+
|
|
4566
2898
|
/**
|
|
4567
|
-
*
|
|
2899
|
+
* Attribute fields stored in dedicated database columns (not in config JSONB).
|
|
2900
|
+
* Used to determine which properties are extracted into the config column during sync.
|
|
4568
2901
|
*/
|
|
4569
|
-
declare
|
|
4570
|
-
|
|
4571
|
-
readonly path?: string;
|
|
4572
|
-
readonly cause?: string;
|
|
4573
|
-
constructor(operation: StorageOperation, message: string, path?: string, cause?: string);
|
|
4574
|
-
}
|
|
2902
|
+
declare const DB_COLUMN_FIELDS: ReadonlySet<string>;
|
|
2903
|
+
|
|
4575
2904
|
/**
|
|
4576
|
-
*
|
|
2905
|
+
* System resources that can be managed through permissions.
|
|
4577
2906
|
*/
|
|
4578
|
-
declare
|
|
2907
|
+
declare const SYSTEM_RESOURCES: {
|
|
2908
|
+
/** User profiles, invitations, roles and permissions management */
|
|
2909
|
+
readonly PEOPLE: "people";
|
|
2910
|
+
/** Tenant settings, audit logs, workflow execution, document generation */
|
|
2911
|
+
readonly WORKSPACE: "workspace";
|
|
2912
|
+
/** Object definitions, attributes, views, workflow definitions */
|
|
2913
|
+
readonly ARCHITECT: "architect";
|
|
2914
|
+
};
|
|
4579
2915
|
/**
|
|
4580
|
-
*
|
|
2916
|
+
* All system resources as an array (for iteration)
|
|
4581
2917
|
*/
|
|
4582
|
-
declare
|
|
4583
|
-
readonly resource: string;
|
|
4584
|
-
readonly reason?: string;
|
|
4585
|
-
constructor(resource: string, reason?: string);
|
|
4586
|
-
}
|
|
2918
|
+
declare const ALL_SYSTEM_RESOURCES: SystemResource[];
|
|
4587
2919
|
/**
|
|
4588
|
-
*
|
|
2920
|
+
* Human-readable labels for system resources
|
|
4589
2921
|
*/
|
|
4590
|
-
declare
|
|
2922
|
+
declare const SYSTEM_RESOURCE_LABELS: Record<SystemResource, string>;
|
|
4591
2923
|
/**
|
|
4592
|
-
*
|
|
2924
|
+
* Default role names that are created for every tenant.
|
|
4593
2925
|
*/
|
|
4594
|
-
|
|
2926
|
+
declare const DEFAULT_ROLES: {
|
|
2927
|
+
/** Full platform access - can manage everything */
|
|
2928
|
+
readonly OWNER: "owner";
|
|
2929
|
+
/** Standard user - can work with business data and view people */
|
|
2930
|
+
readonly MEMBER: "member";
|
|
2931
|
+
};
|
|
2932
|
+
type DefaultRoleName = (typeof DEFAULT_ROLES)[keyof typeof DEFAULT_ROLES];
|
|
4595
2933
|
/**
|
|
4596
|
-
*
|
|
2934
|
+
* Human-readable labels for default roles
|
|
4597
2935
|
*/
|
|
4598
|
-
declare
|
|
4599
|
-
readonly operation: RepositoryOperation;
|
|
4600
|
-
readonly entity: string;
|
|
4601
|
-
readonly cause?: string;
|
|
4602
|
-
constructor(operation: RepositoryOperation, entity: string, message: string, cause?: string);
|
|
4603
|
-
}
|
|
2936
|
+
declare const DEFAULT_ROLE_LABELS: Record<DefaultRoleName, string>;
|
|
4604
2937
|
/**
|
|
4605
|
-
*
|
|
2938
|
+
* Descriptions for default roles
|
|
4606
2939
|
*/
|
|
4607
|
-
declare
|
|
2940
|
+
declare const DEFAULT_ROLE_DESCRIPTIONS: Record<DefaultRoleName, string>;
|
|
4608
2941
|
/**
|
|
4609
|
-
*
|
|
2942
|
+
* Default permission configuration for each role.
|
|
2943
|
+
* Used when initializing a new tenant.
|
|
4610
2944
|
*/
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
2945
|
+
interface DefaultRolePermissionConfig {
|
|
2946
|
+
/** System resource permissions (people, workspace) */
|
|
2947
|
+
system: Array<{
|
|
2948
|
+
target: SystemResource | "*";
|
|
2949
|
+
actions: Action[];
|
|
2950
|
+
}>;
|
|
2951
|
+
/** Object permissions (business data) */
|
|
2952
|
+
object: Array<{
|
|
2953
|
+
target: string;
|
|
2954
|
+
actions: Action[];
|
|
2955
|
+
}>;
|
|
4615
2956
|
}
|
|
4616
2957
|
/**
|
|
4617
|
-
*
|
|
2958
|
+
* Default permissions for each built-in role.
|
|
2959
|
+
*
|
|
2960
|
+
* - **owner**: Full access to everything (system + objects)
|
|
2961
|
+
* - **member**: Read-only people access, full CRUD on objects
|
|
4618
2962
|
*/
|
|
4619
|
-
declare
|
|
2963
|
+
declare const DEFAULT_ROLE_PERMISSIONS: Record<DefaultRoleName, DefaultRolePermissionConfig>;
|
|
4620
2964
|
/**
|
|
4621
|
-
*
|
|
2965
|
+
* Check if a role name is a default/built-in role
|
|
4622
2966
|
*/
|
|
4623
|
-
declare
|
|
4624
|
-
constructor(memoryId: string);
|
|
4625
|
-
}
|
|
2967
|
+
declare function isDefaultRole(roleName: string): roleName is DefaultRoleName;
|
|
4626
2968
|
|
|
4627
2969
|
/**
|
|
4628
2970
|
* Builder config with literal name type preservation
|
|
@@ -5537,26 +3879,79 @@ declare class DocumentAttributeBuilder<TName extends string, TRequired extends b
|
|
|
5537
3879
|
* ```
|
|
5538
3880
|
*/
|
|
5539
3881
|
declare function document<TName extends string>(config: TypedBuilderConfig<TName>): DocumentAttributeBuilder<TName, false>;
|
|
3882
|
+
|
|
5540
3883
|
/**
|
|
5541
|
-
*
|
|
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
|
|
3884
|
+
* Validate attribute name as valid variable identifier
|
|
5554
3885
|
*/
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
}
|
|
3886
|
+
declare function validateAttributeName(name: string): void;
|
|
3887
|
+
|
|
3888
|
+
interface AnyAttributeBuilder {
|
|
3889
|
+
build(): Attribute;
|
|
3890
|
+
}
|
|
3891
|
+
declare class FormRowBuilder {
|
|
3892
|
+
private stepBuilder;
|
|
3893
|
+
private rowData;
|
|
3894
|
+
private _finalized;
|
|
3895
|
+
constructor(stepBuilder: FormStepBuilder, rowId: string, order: number);
|
|
3896
|
+
field(slotId: string, attribute: string, options?: {
|
|
3897
|
+
label?: string;
|
|
3898
|
+
required?: boolean;
|
|
3899
|
+
}): this;
|
|
3900
|
+
freeField(builder: AnyAttributeBuilder, options?: {
|
|
3901
|
+
label?: string;
|
|
3902
|
+
required?: boolean;
|
|
3903
|
+
}): this;
|
|
3904
|
+
row(id: string): FormRowBuilder;
|
|
3905
|
+
heading(content: string, level?: 1 | 2 | 3): FormStepBuilder;
|
|
3906
|
+
separator(): FormStepBuilder;
|
|
3907
|
+
text(content: string): FormStepBuilder;
|
|
3908
|
+
endRow(): FormStepBuilder;
|
|
3909
|
+
}
|
|
3910
|
+
declare class FormStepBuilder {
|
|
3911
|
+
private formBuilder;
|
|
3912
|
+
private stepData;
|
|
3913
|
+
private rowOrder;
|
|
3914
|
+
constructor(formBuilder: FormBuilder, id: string, label: string);
|
|
3915
|
+
description(text: string): this;
|
|
3916
|
+
field(slotId: string, attribute: string, options?: {
|
|
3917
|
+
label?: string;
|
|
3918
|
+
required?: boolean;
|
|
3919
|
+
}): this;
|
|
3920
|
+
freeField(builder: AnyAttributeBuilder, options?: {
|
|
3921
|
+
label?: string;
|
|
3922
|
+
required?: boolean;
|
|
3923
|
+
}): this;
|
|
3924
|
+
row(id: string): FormRowBuilder;
|
|
3925
|
+
heading(content: string, level?: 1 | 2 | 3): this;
|
|
3926
|
+
separator(): this;
|
|
3927
|
+
text(content: string): this;
|
|
3928
|
+
step(id: string, label: string): FormStepBuilder;
|
|
3929
|
+
build(): FormDefinition;
|
|
3930
|
+
_finalizeRow(row: FormFieldsRow): this;
|
|
3931
|
+
_getData(): FormStep;
|
|
3932
|
+
}
|
|
3933
|
+
declare class FormBuilder {
|
|
3934
|
+
private data;
|
|
3935
|
+
constructor(name: string, label: string);
|
|
3936
|
+
description(value: string): this;
|
|
3937
|
+
icon(value: IconName): this;
|
|
3938
|
+
status(value: FormStatus): this;
|
|
3939
|
+
metadata(value: Record<string, unknown>): this;
|
|
3940
|
+
slot(id: string, objectName: string, options: {
|
|
3941
|
+
label: string;
|
|
3942
|
+
mode?: SlotMode;
|
|
3943
|
+
color?: ColorId;
|
|
3944
|
+
icon?: IconName;
|
|
3945
|
+
}): this;
|
|
3946
|
+
step(id: string, label: string): FormStepBuilder;
|
|
3947
|
+
build(): FormDefinition;
|
|
3948
|
+
_finalizeStep(step: FormStep): this;
|
|
3949
|
+
private validateName;
|
|
3950
|
+
private validateRequiredData;
|
|
3951
|
+
private validateSlotReferences;
|
|
3952
|
+
private validateFreeFields;
|
|
3953
|
+
}
|
|
3954
|
+
declare function form(name: string, label: string): FormBuilder;
|
|
5560
3955
|
|
|
5561
3956
|
interface ChangeTypeOptions {
|
|
5562
3957
|
/** Optional explicit transform function (used to resolve a BuiltInTransform) */
|
|
@@ -6157,62 +4552,12 @@ declare class ActivityTabConfig {
|
|
|
6157
4552
|
*/
|
|
6158
4553
|
build(): DetailViewDefinition;
|
|
6159
4554
|
}
|
|
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
4555
|
/**
|
|
6209
4556
|
* Builder for configuring documents tabs
|
|
6210
4557
|
*
|
|
6211
4558
|
* All actions are enabled by default:
|
|
6212
4559
|
* - allowUpload: true
|
|
6213
4560
|
* - allowRemove: true
|
|
6214
|
-
* - showProcessing: true
|
|
6215
|
-
* - showRequiredWarnings: true
|
|
6216
4561
|
* - hideAttachments: false
|
|
6217
4562
|
*
|
|
6218
4563
|
* @example
|
|
@@ -6224,30 +4569,23 @@ declare class FlowsTabConfig {
|
|
|
6224
4569
|
* .tab("documents", "Documents")
|
|
6225
4570
|
* .documents()
|
|
6226
4571
|
* .disableUpload()
|
|
4572
|
+
* .disableRemove()
|
|
6227
4573
|
* .hideAttachments()
|
|
6228
4574
|
* ```
|
|
6229
4575
|
*/
|
|
6230
4576
|
declare class DocumentsTabConfig {
|
|
6231
4577
|
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;
|
|
4578
|
+
private tabData;
|
|
4579
|
+
/** @internal */
|
|
4580
|
+
constructor(view: DetailViewBuilder, base: BaseTabConfig);
|
|
6243
4581
|
/**
|
|
6244
|
-
*
|
|
4582
|
+
* Disable uploading new documents
|
|
6245
4583
|
*/
|
|
6246
|
-
|
|
4584
|
+
disableUpload(): this;
|
|
6247
4585
|
/**
|
|
6248
|
-
*
|
|
4586
|
+
* Disable removing documents
|
|
6249
4587
|
*/
|
|
6250
|
-
|
|
4588
|
+
disableRemove(): this;
|
|
6251
4589
|
/**
|
|
6252
4590
|
* Hide the attachments section
|
|
6253
4591
|
*/
|
|
@@ -6327,16 +4665,19 @@ declare class TabBuilder {
|
|
|
6327
4665
|
* @example .activity().limit(50)
|
|
6328
4666
|
*/
|
|
6329
4667
|
activity(): ActivityTabConfig;
|
|
6330
|
-
/**
|
|
6331
|
-
* Create a flows tab for workflow instances
|
|
6332
|
-
* @example .flows().allowStart().allowCancel()
|
|
6333
|
-
*/
|
|
6334
|
-
flows(): FlowsTabConfig;
|
|
6335
4668
|
/**
|
|
6336
4669
|
* Create a documents tab for file attachments
|
|
6337
|
-
* @example .documents().
|
|
4670
|
+
* @example .documents().disableUpload().disableRemove()
|
|
6338
4671
|
*/
|
|
6339
4672
|
documents(): DocumentsTabConfig;
|
|
4673
|
+
/**
|
|
4674
|
+
* Create a forms tab to launch and track form instances linked to this record
|
|
4675
|
+
* @example .tab("forms", "Forms").forms()
|
|
4676
|
+
* @example .tab("forms", "Forms").forms({ objectName: "contacts" })
|
|
4677
|
+
*/
|
|
4678
|
+
forms(options?: {
|
|
4679
|
+
objectName?: string;
|
|
4680
|
+
}): DetailViewBuilder;
|
|
6340
4681
|
}
|
|
6341
4682
|
/**
|
|
6342
4683
|
* Builder for creating detail view definitions
|
|
@@ -6815,379 +5156,6 @@ declare function group(id: string, label: string): GroupBuilder;
|
|
|
6815
5156
|
*/
|
|
6816
5157
|
declare function relationGroup(id: string, label: string, attribute: string): RelationGroupBuilder;
|
|
6817
5158
|
|
|
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
5159
|
/**
|
|
7192
5160
|
* Standard Schema v1 integration for @stndrds/schema
|
|
7193
5161
|
*
|
|
@@ -7210,10 +5178,6 @@ type StandardSchemaIssue = StandardSchemaV1.Issue;
|
|
|
7210
5178
|
* Standard Schema result type
|
|
7211
5179
|
*/
|
|
7212
5180
|
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
5181
|
/**
|
|
7218
5182
|
* Create Standard Schema ~standard props from a Zod schema.
|
|
7219
5183
|
*
|
|
@@ -7223,7 +5187,7 @@ type StandardSchemaProps<Input, Output> = StandardSchemaV1.Props<Input, Output>;
|
|
|
7223
5187
|
* @param zodSchema - The Zod schema to wrap
|
|
7224
5188
|
* @returns Standard Schema v1 props
|
|
7225
5189
|
*/
|
|
7226
|
-
declare function createStandardSchemaProps<T>(zodSchema: z
|
|
5190
|
+
declare function createStandardSchemaProps<T>(zodSchema: z.ZodType<T>): StandardSchemaV1.Props<unknown, T>;
|
|
7227
5191
|
/**
|
|
7228
5192
|
* Type guard to check if an object implements Standard Schema v1
|
|
7229
5193
|
*/
|
|
@@ -7489,32 +5453,6 @@ declare class FlagRegistry {
|
|
|
7489
5453
|
* @returns Array of flag names
|
|
7490
5454
|
*/
|
|
7491
5455
|
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
5456
|
/**
|
|
7519
5457
|
* Unregister a flag (mainly for testing).
|
|
7520
5458
|
*
|
|
@@ -7673,6 +5611,7 @@ declare class FlagService {
|
|
|
7673
5611
|
private getAllOverrides;
|
|
7674
5612
|
/**
|
|
7675
5613
|
* Resolve a flag value from overrides and defaults.
|
|
5614
|
+
* Delegates to resolveWithSource() to avoid duplicating the priority logic.
|
|
7676
5615
|
*/
|
|
7677
5616
|
private resolveValue;
|
|
7678
5617
|
/**
|
|
@@ -7902,29 +5841,11 @@ declare class ViewRegistry {
|
|
|
7902
5841
|
*/
|
|
7903
5842
|
declare const viewRegistry: ViewRegistry;
|
|
7904
5843
|
|
|
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
5844
|
/**
|
|
7916
5845
|
* View Auto-Generator
|
|
7917
5846
|
*
|
|
7918
5847
|
* Generates fallback views from object definitions.
|
|
7919
5848
|
* 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
5849
|
*/
|
|
7929
5850
|
|
|
7930
5851
|
interface GenerateFallbackViewOptions {
|
|
@@ -7938,11 +5859,6 @@ interface GenerateFallbackViewOptions {
|
|
|
7938
5859
|
* @default true
|
|
7939
5860
|
*/
|
|
7940
5861
|
includeDocumentsTab?: boolean;
|
|
7941
|
-
/**
|
|
7942
|
-
* Include flows tab in detail views.
|
|
7943
|
-
* @default false
|
|
7944
|
-
*/
|
|
7945
|
-
includeFlowsTab?: boolean;
|
|
7946
5862
|
/**
|
|
7947
5863
|
* Attributes to exclude from the generated view.
|
|
7948
5864
|
*/
|
|
@@ -7952,6 +5868,11 @@ interface GenerateFallbackViewOptions {
|
|
|
7952
5868
|
* @default 5
|
|
7953
5869
|
*/
|
|
7954
5870
|
maxListColumns?: number;
|
|
5871
|
+
/**
|
|
5872
|
+
* Layout mode for detail views.
|
|
5873
|
+
* @default "page"
|
|
5874
|
+
*/
|
|
5875
|
+
layout?: "page" | "modal";
|
|
7955
5876
|
}
|
|
7956
5877
|
/**
|
|
7957
5878
|
* Generate a default detail view from an object definition.
|
|
@@ -7969,15 +5890,6 @@ declare function generateDefaultDetailView(object: ObjectDefinition, options?: G
|
|
|
7969
5890
|
* @returns A generated ListViewDefinition
|
|
7970
5891
|
*/
|
|
7971
5892
|
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
5893
|
|
|
7982
5894
|
/**
|
|
7983
5895
|
* View Reset Utilities
|
|
@@ -8019,57 +5931,59 @@ interface ResetViewOptions extends GenerateFallbackViewOptions {
|
|
|
8019
5931
|
* @returns A new ViewDefinition with reset structure
|
|
8020
5932
|
*/
|
|
8021
5933
|
declare function resetViewToDefault(currentView: ViewDefinition, object: ObjectDefinition, options?: ResetViewOptions): ViewDefinition;
|
|
5934
|
+
|
|
8022
5935
|
/**
|
|
8023
|
-
*
|
|
5936
|
+
* Get the active tab from a list view config.
|
|
8024
5937
|
*
|
|
8025
|
-
*
|
|
8026
|
-
*
|
|
8027
|
-
*
|
|
5938
|
+
* Resolution order:
|
|
5939
|
+
* 1. Tab matching `tabId` (if provided)
|
|
5940
|
+
* 2. Tab marked as `default`
|
|
5941
|
+
* 3. First tab
|
|
8028
5942
|
*/
|
|
8029
|
-
declare function
|
|
5943
|
+
declare function getActiveTab(config: ListViewConfig, tabId?: string): ListViewTab;
|
|
8030
5944
|
|
|
8031
5945
|
/**
|
|
8032
|
-
*
|
|
5946
|
+
* Registry for developer-defined form definitions.
|
|
8033
5947
|
*
|
|
8034
|
-
*
|
|
8035
|
-
*
|
|
8036
|
-
*
|
|
8037
|
-
* - ajv
|
|
8038
|
-
* - json-schema-form
|
|
8039
|
-
*
|
|
8040
|
-
* @param objectDef - The ObjectDefinition to convert
|
|
8041
|
-
* @returns A JSON Schema object representing the ObjectDefinition
|
|
5948
|
+
* Forms registered here are seeded to the database at application startup
|
|
5949
|
+
* with `system: true` — they are read-only and cannot be modified or deleted
|
|
5950
|
+
* by users through the API.
|
|
8042
5951
|
*
|
|
8043
5952
|
* @example
|
|
8044
5953
|
* ```typescript
|
|
8045
|
-
*
|
|
8046
|
-
*
|
|
8047
|
-
*
|
|
8048
|
-
* .
|
|
5954
|
+
* import { form, formRegistry } from "@stndrds/schema";
|
|
5955
|
+
*
|
|
5956
|
+
* const ONBOARDING = form("client-onboarding", "Onboarding Client")
|
|
5957
|
+
* .slot("client", "contacts", { label: "Client", mode: "create" })
|
|
5958
|
+
* .step("infos", "Informations")
|
|
5959
|
+
* .field("client", "firstName")
|
|
5960
|
+
* .field("client", "email")
|
|
8049
5961
|
* .build();
|
|
8050
5962
|
*
|
|
8051
|
-
*
|
|
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
|
-
* // }
|
|
5963
|
+
* formRegistry.register(ONBOARDING);
|
|
8061
5964
|
* ```
|
|
8062
5965
|
*/
|
|
8063
|
-
declare
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
5966
|
+
declare class FormRegistry {
|
|
5967
|
+
private forms;
|
|
5968
|
+
/**
|
|
5969
|
+
* Register a form definition (or array of definitions).
|
|
5970
|
+
* @throws Error if a form with the same name is already registered.
|
|
5971
|
+
*/
|
|
5972
|
+
register(formOrForms: FormDefinition | FormDefinition[]): this;
|
|
5973
|
+
/**
|
|
5974
|
+
* Get a form definition by name.
|
|
5975
|
+
*/
|
|
5976
|
+
get(name: string): FormDefinition | undefined;
|
|
5977
|
+
/**
|
|
5978
|
+
* Get all registered form definitions.
|
|
5979
|
+
*/
|
|
5980
|
+
getAll(): FormDefinition[];
|
|
5981
|
+
/**
|
|
5982
|
+
* List all registered form names.
|
|
5983
|
+
*/
|
|
5984
|
+
listNames(): string[];
|
|
5985
|
+
}
|
|
5986
|
+
|
|
5987
|
+
declare const formRegistry: FormRegistry;
|
|
8074
5988
|
|
|
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 };
|
|
5989
|
+
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 };
|