@dataverse-kit/form-runtime 0.1.0
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/LICENSE +21 -0
- package/README.md +93 -0
- package/dist/businessRules-U1_MBgyG.d.cts +372 -0
- package/dist/businessRules-U1_MBgyG.d.ts +372 -0
- package/dist/context.cjs +151 -0
- package/dist/context.cjs.map +1 -0
- package/dist/context.d.cts +132 -0
- package/dist/context.d.ts +132 -0
- package/dist/context.mjs +113 -0
- package/dist/context.mjs.map +1 -0
- package/dist/control-DFOg_pc_.d.cts +1027 -0
- package/dist/control-DaXBm-52.d.ts +1027 -0
- package/dist/gridCustomizer-C0V9FAE_.d.ts +569 -0
- package/dist/gridCustomizer-mJO-kmQ4.d.cts +569 -0
- package/dist/hooks.cjs +85 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +24 -0
- package/dist/hooks.d.ts +24 -0
- package/dist/hooks.mjs +60 -0
- package/dist/hooks.mjs.map +1 -0
- package/dist/icons.cjs +202 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.cts +130 -0
- package/dist/icons.d.ts +130 -0
- package/dist/icons.mjs +165 -0
- package/dist/icons.mjs.map +1 -0
- package/dist/index.cjs +6509 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +410 -0
- package/dist/index.d.ts +410 -0
- package/dist/index.mjs +6490 -0
- package/dist/index.mjs.map +1 -0
- package/dist/runtime-capabilities-BdGDdu0d.d.cts +119 -0
- package/dist/runtime-capabilities-Brfc7loJ.d.ts +119 -0
- package/dist/theme-BfeZIxmZ.d.cts +74 -0
- package/dist/theme-BfeZIxmZ.d.ts +74 -0
- package/dist/theme.cjs +215 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +32 -0
- package/dist/theme.d.ts +32 -0
- package/dist/theme.mjs +186 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/types.cjs +976 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +813 -0
- package/dist/types.d.ts +813 -0
- package/dist/types.mjs +902 -0
- package/dist/types.mjs.map +1 -0
- package/dist/utils.cjs +250 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +99 -0
- package/dist/utils.d.ts +99 -0
- package/dist/utils.mjs +220 -0
- package/dist/utils.mjs.map +1 -0
- package/dist/v8.cjs +4622 -0
- package/dist/v8.cjs.map +1 -0
- package/dist/v8.d.cts +730 -0
- package/dist/v8.d.ts +730 -0
- package/dist/v8.mjs +4622 -0
- package/dist/v8.mjs.map +1 -0
- package/dist/v9.cjs +19 -0
- package/dist/v9.cjs.map +1 -0
- package/dist/v9.d.cts +2 -0
- package/dist/v9.d.ts +2 -0
- package/dist/v9.mjs +1 -0
- package/dist/v9.mjs.map +1 -0
- package/package.json +113 -0
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,813 @@
|
|
|
1
|
+
import { Y as FormType } from './control-DFOg_pc_.cjs';
|
|
2
|
+
export { A as AuditFormTab, a as AuditHistoryConfig, B as ButtonAction, b as ButtonCommandBarItem, c as ButtonConfig, d as ButtonMenuItem, e as ButtonSize, f as ButtonVariant, C as CalloutActionButton, g as CalloutAttachment, h as CalloutDefinition, i as CalloutDirectionalHint, j as CalloutFieldBinding, k as CalloutTargetType, l as CalloutTrigger, m as ChartAggregation, n as ChartConfig, o as ChartPalette, p as ComboBoxConfig, q as CommandBarItem, r as CommandBarItemActionScope, s as CommandBarItemActionType, t as CommandBarItemPosition, u as CommandBarItemVisibility, v as ControlCategory, w as ControlDataBinding, x as ControlDefinition, y as ControlRegistryEntry, z as ControlType, D as CustomOptionItem, E as DEFAULT_FORM_GRID_LAYOUT, F as DialogActionButton, G as DialogButtonAction, H as DialogButtonAppearance, I as DialogButtonPosition, J as DropdownConfig, K as FetchXmlAggregateFunction, L as FetchXmlAttribute, M as FormCell, N as FormDataSource, O as FormDefinition, P as FormGridLayout, Q as FormHeader, R as FormLayoutMode, S as FormParameter, T as FormRow, U as FormSection, V as FormSectionGridPosition, W as FormSettings, X as FormTab, Z as HeaderDisplayMode, _ as HeaderPersonaColor, $ as HeaderPersonaConfig, a0 as HeaderPersonaSize, a1 as HeaderPersonaSourceMode, a2 as HeaderSlotCount, a3 as LayoutActionEntry, a4 as LayoutActionType, a5 as MainFormTab, a6 as NavigationAction, a7 as NavigationActionType, a8 as NavigationCloseResult, a9 as NavigationContext, aa as NavigationOnCloseConfig, ab as NavigationSizeConfig, ac as NavigationStackEntry, ad as OptionSourceMode, ae as PRIMARY_CAPABLE_VARIANTS, af as PanelPosition, ag as ParameterMapping, ah as ParameterSourceType, ai as RelatedFormTab, aj as RelatedTabConfig, ak as ResponsiveSettings, al as SubgridColumn, am as SubgridColumnDataType, an as SubgridGridType, ao as TabLayout, ap as TextFieldConfig, aq as TextFormat, ar as ValidationRule, as as isAuditTab, at as isMainTab, au as isRelatedTab } from './control-DFOg_pc_.cjs';
|
|
3
|
+
export { B as BackgroundConfig, D as DEFAULT_THEME, F as FormTheme, a as FormThemeColors, b as FormThemeSettings, G as GradientStop, S as STANDARD_COLORS, T as THEME_PRESETS, g as getResolvedThemeColors, c as getThemeById } from './theme-BfeZIxmZ.cjs';
|
|
4
|
+
export { A as AggregateFunction, C as CellEditorType, a as CellRendererType, b as CompositeRendererConfig, c as CompositeSlot, d as CompositeSlotType, e as ConditionalStyle, F as FOCUSED_VIEW_ICON_OPTIONS, f as FocusedViewConfig, g as FocusedViewField, h as FocusedViewRow, G as GridCardViewConfig, i as GridChartConfig, j as GridColumnDataType, k as GridColumnDefinition, l as GridColumnInput, m as GridCustomizerDefinition, n as GridFocusedViewSettings, o as GridNestedRelationship, p as GridPaginationMode, q as GridSelectionMode, r as GridToolbarButton, s as GridToolbarConfig, t as GridType, L as LegacySummaryField, u as LookupPreviewConfig, M as MAX_FOCUSED_VIEW_ROWS, N as NestedDisplayConfig, v as NestedDisplayMode, w as NestedSidePanelSize, x as createConfigFromColumns, y as createDefaultCardViewConfig, z as createDefaultCompositeRendererConfig, B as createDefaultCompositeSlot, D as createDefaultFocusedViewConfig, E as createDefaultGridColumn, H as createDefaultGridCustomizer, I as createDefaultToolbarConfig, J as generateGridId, K as isValidFocusedViewConfig, O as migrateLegacyConfig } from './gridCustomizer-mJO-kmQ4.cjs';
|
|
5
|
+
import { m as RuleConditionGroup, R as RuleAction, f as ConditionOperator, g as ConditionValue } from './businessRules-U1_MBgyG.cjs';
|
|
6
|
+
export { A as ActionConfig, a as ActionResult, b as ActionTarget, c as ApiParameter, B as BusinessRuleDefinition, C as CallApiConfig, d as CanvasConnection, e as CanvasNode, h as CrudBlockConfig, F as FieldState, i as FormNotification, N as NavigateToFormConfig, O as OpenDialogConfig, P as PreventSaveConfig, j as RuleActionType, k as RuleCanvasLayout, l as RuleCondition, n as RuleDataSource, o as RuleExecutionContext, p as RuleExecutionResult, q as RuleTrigger, r as RuleVariable, S as SectionState, s as SetDefaultValueConfig, t as SetFieldValueConfig, u as SetFormNotificationConfig, v as SetFormReadOnlyConfig, w as SetHighlightConfig, x as SetLockConfig, y as SetRequiredConfig, z as SetVisibilityConfig, D as ShowMessageConfig, T as TabState, E as TriggerEvent, G as TriggerWorkflowConfig, W as WorkflowDefinition, H as WorkflowResult, I as WorkflowStep, J as WorkflowStepResult, K as createDefaultBusinessRule, L as createDefaultFieldState, M as getActionTargets, Q as isConditionGroup } from './businessRules-U1_MBgyG.cjs';
|
|
7
|
+
export { F as FormRuntimeCapabilities, a as FormRuntimeConnection, b as FormRuntimePreviewContext, L as LiveDataResult, c as LookupResult, d as LookupSearchOptions, T as TimelineItem, W as WebResourceData } from './runtime-capabilities-BdGDdu0d.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Dataverse metadata types — declarations only.
|
|
11
|
+
*
|
|
12
|
+
* Originally re-exported from `@dataverse-kit/api-client`. Inlined here
|
|
13
|
+
* so form-runtime stays a self-contained type peer for `@dataverse-kit/api-service`
|
|
14
|
+
* (which already exposes `EntityMetadata`, `AttributeMetadata`, `ViewMetadata`)
|
|
15
|
+
* without form-runtime needing api-client as a peer dep.
|
|
16
|
+
*
|
|
17
|
+
* TODO (cleanup PR): consolidate `EntityMetadata` / `AttributeMetadata` /
|
|
18
|
+
* `ViewMetadata` between api-service and form-runtime — pick one origin
|
|
19
|
+
* and have the other re-export. Today both packages declare them
|
|
20
|
+
* independently. Relationship + global-option-set types are form-runtime
|
|
21
|
+
* specific (api-service does not declare them).
|
|
22
|
+
*/
|
|
23
|
+
interface DisplayNameInfo {
|
|
24
|
+
UserLocalizedLabel?: {
|
|
25
|
+
Label: string;
|
|
26
|
+
LanguageCode?: number;
|
|
27
|
+
};
|
|
28
|
+
LocalizedLabels?: Array<{
|
|
29
|
+
Label: string;
|
|
30
|
+
LanguageCode?: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/** Entity metadata from Dataverse EntityDefinitions. */
|
|
34
|
+
interface EntityMetadata {
|
|
35
|
+
LogicalName: string;
|
|
36
|
+
EntitySetName: string;
|
|
37
|
+
SchemaName: string;
|
|
38
|
+
DisplayName: DisplayNameInfo;
|
|
39
|
+
DisplayCollectionName: DisplayNameInfo;
|
|
40
|
+
PrimaryIdAttribute: string;
|
|
41
|
+
PrimaryNameAttribute: string;
|
|
42
|
+
IsCustomEntity: boolean;
|
|
43
|
+
IsActivity: boolean;
|
|
44
|
+
IsValidForAdvancedFind: boolean;
|
|
45
|
+
ObjectTypeCode?: number;
|
|
46
|
+
Description?: DisplayNameInfo;
|
|
47
|
+
}
|
|
48
|
+
/** Attribute metadata from Dataverse. */
|
|
49
|
+
interface AttributeMetadata {
|
|
50
|
+
LogicalName: string;
|
|
51
|
+
SchemaName: string;
|
|
52
|
+
DisplayName: DisplayNameInfo;
|
|
53
|
+
Description?: DisplayNameInfo;
|
|
54
|
+
AttributeType: string;
|
|
55
|
+
AttributeTypeName: {
|
|
56
|
+
Value: string;
|
|
57
|
+
};
|
|
58
|
+
RequiredLevel: {
|
|
59
|
+
Value: 'None' | 'SystemRequired' | 'ApplicationRequired' | 'Recommended';
|
|
60
|
+
};
|
|
61
|
+
IsValidForRead: boolean;
|
|
62
|
+
IsValidForCreate: boolean;
|
|
63
|
+
IsValidForUpdate: boolean;
|
|
64
|
+
IsPrimaryId?: boolean;
|
|
65
|
+
IsPrimaryName?: boolean;
|
|
66
|
+
MaxLength?: number;
|
|
67
|
+
Precision?: number;
|
|
68
|
+
MinValue?: number;
|
|
69
|
+
MaxValue?: number;
|
|
70
|
+
Format?: string;
|
|
71
|
+
FormatName?: {
|
|
72
|
+
Value: string;
|
|
73
|
+
};
|
|
74
|
+
OptionSet?: {
|
|
75
|
+
Options: Array<{
|
|
76
|
+
Value: number;
|
|
77
|
+
Label: DisplayNameInfo;
|
|
78
|
+
Color?: string;
|
|
79
|
+
}>;
|
|
80
|
+
IsGlobal?: boolean;
|
|
81
|
+
Name?: string;
|
|
82
|
+
};
|
|
83
|
+
GlobalOptionSet?: {
|
|
84
|
+
Options: Array<{
|
|
85
|
+
Value: number;
|
|
86
|
+
Label: DisplayNameInfo;
|
|
87
|
+
Color?: string;
|
|
88
|
+
}>;
|
|
89
|
+
IsGlobal?: boolean;
|
|
90
|
+
Name?: string;
|
|
91
|
+
};
|
|
92
|
+
DateTimeBehavior?: {
|
|
93
|
+
Value: string;
|
|
94
|
+
};
|
|
95
|
+
Targets?: string[];
|
|
96
|
+
}
|
|
97
|
+
/** View metadata from Dataverse. */
|
|
98
|
+
interface ViewMetadata {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
fetchxml: string;
|
|
102
|
+
layoutxml?: string;
|
|
103
|
+
isDefault?: boolean;
|
|
104
|
+
isPersonal: boolean;
|
|
105
|
+
returnedtypecode: string;
|
|
106
|
+
description?: string;
|
|
107
|
+
}
|
|
108
|
+
/** Relationship type discriminator. */
|
|
109
|
+
type RelationshipType = 'OneToMany' | 'ManyToOne';
|
|
110
|
+
interface OneToManyRelationshipMetadata {
|
|
111
|
+
MetadataId: string;
|
|
112
|
+
SchemaName: string;
|
|
113
|
+
RelationshipType: 'OneToManyRelationship';
|
|
114
|
+
ReferencedEntity: string;
|
|
115
|
+
ReferencedAttribute: string;
|
|
116
|
+
ReferencingEntity: string;
|
|
117
|
+
ReferencingAttribute: string;
|
|
118
|
+
IsCustomRelationship?: boolean;
|
|
119
|
+
ReferencingEntityNavigationPropertyName?: string;
|
|
120
|
+
ReferencedEntityNavigationPropertyName?: string;
|
|
121
|
+
}
|
|
122
|
+
interface ManyToOneRelationshipMetadata {
|
|
123
|
+
MetadataId: string;
|
|
124
|
+
SchemaName: string;
|
|
125
|
+
RelationshipType: 'ManyToOneRelationship';
|
|
126
|
+
ReferencedEntity: string;
|
|
127
|
+
ReferencedAttribute: string;
|
|
128
|
+
ReferencingEntity: string;
|
|
129
|
+
ReferencingAttribute: string;
|
|
130
|
+
IsCustomRelationship?: boolean;
|
|
131
|
+
ReferencingEntityNavigationPropertyName?: string;
|
|
132
|
+
ReferencedEntityNavigationPropertyName?: string;
|
|
133
|
+
}
|
|
134
|
+
type RelationshipMetadata = OneToManyRelationshipMetadata | ManyToOneRelationshipMetadata;
|
|
135
|
+
/** Normalized relationship for UI display. */
|
|
136
|
+
interface NormalizedRelationship {
|
|
137
|
+
key: string;
|
|
138
|
+
schemaName: string;
|
|
139
|
+
displayName: string;
|
|
140
|
+
relatedEntity: string;
|
|
141
|
+
primaryField: string;
|
|
142
|
+
relatedField: string;
|
|
143
|
+
direction: 'parent' | 'child';
|
|
144
|
+
relationshipType: RelationshipType;
|
|
145
|
+
}
|
|
146
|
+
/** Option within a global option set. */
|
|
147
|
+
interface GlobalOptionSetOption {
|
|
148
|
+
Value: number;
|
|
149
|
+
Label: DisplayNameInfo;
|
|
150
|
+
Description?: DisplayNameInfo;
|
|
151
|
+
Color?: string;
|
|
152
|
+
}
|
|
153
|
+
/** Global option set metadata from Dataverse. */
|
|
154
|
+
interface GlobalOptionSetMetadata {
|
|
155
|
+
MetadataId: string;
|
|
156
|
+
Name: string;
|
|
157
|
+
DisplayName: DisplayNameInfo;
|
|
158
|
+
Description?: DisplayNameInfo;
|
|
159
|
+
IsCustomOptionSet: boolean;
|
|
160
|
+
IsGlobal: boolean;
|
|
161
|
+
IsManaged?: boolean;
|
|
162
|
+
OptionSetType: 'Picklist' | 'Boolean' | 'State' | 'Status';
|
|
163
|
+
Options: GlobalOptionSetOption[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Unified Dataverse client interface (CRUD + metadata + views).
|
|
167
|
+
*
|
|
168
|
+
* Form-runtime hooks consume `IApiService` (from `@dataverse-kit/api-service`)
|
|
169
|
+
* rather than this interface directly, but the type stays in the public
|
|
170
|
+
* surface because some consumers of `form-runtime/types` still hand off
|
|
171
|
+
* the lower-level client (e.g., view-management tooling in the editor).
|
|
172
|
+
*/
|
|
173
|
+
interface IDataverseClient {
|
|
174
|
+
retrieve<T = Record<string, unknown>>(entitySetName: string, id: string, options?: string): Promise<T>;
|
|
175
|
+
retrieveMultiple<T = Record<string, unknown>>(entitySetName: string, options?: string): Promise<{
|
|
176
|
+
value: T[];
|
|
177
|
+
}>;
|
|
178
|
+
create(entitySetName: string, data: Record<string, unknown>): Promise<{
|
|
179
|
+
id: string;
|
|
180
|
+
}>;
|
|
181
|
+
update(entitySetName: string, id: string, data: Record<string, unknown>): Promise<void>;
|
|
182
|
+
delete(entitySetName: string, id: string): Promise<void>;
|
|
183
|
+
getEntityDefinitions(filter?: string): Promise<EntityMetadata[]>;
|
|
184
|
+
getAttributeMetadata(entityLogicalName: string, filter?: string): Promise<AttributeMetadata[]>;
|
|
185
|
+
getRelationshipMetadata(entityLogicalName: string): Promise<RelationshipMetadata[]>;
|
|
186
|
+
getViews(entityLogicalName: string): Promise<ViewMetadata[]>;
|
|
187
|
+
getGlobalOptionSets(): Promise<GlobalOptionSetMetadata[]>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Business Process Flow Type Definitions
|
|
192
|
+
*
|
|
193
|
+
* Models the BPF structure matching Dynamics 365's process flow system.
|
|
194
|
+
* Supports both importing existing BPFs from Dataverse and creating custom ones.
|
|
195
|
+
*
|
|
196
|
+
* Design principles:
|
|
197
|
+
* - Matches Dynamics 365 BPF structure (workflow, processstage, processstageattribute)
|
|
198
|
+
* - Reuses RuleConditionGroup and RuleAction from businessRules for conditions/actions
|
|
199
|
+
* - Supports runtime instance tracking per record
|
|
200
|
+
* - JSON-serializable for persistence
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
/** BPF source - imported from Dataverse or created custom */
|
|
204
|
+
type BPFSource = 'dataverse' | 'custom';
|
|
205
|
+
/** Stage completion status */
|
|
206
|
+
type BPFStageStatus = 'pending' | 'active' | 'completed' | 'skipped';
|
|
207
|
+
/** Step types matching Dynamics 365 BPF step types */
|
|
208
|
+
type BPFStepType = 'data' | 'workflow' | 'action' | 'flow';
|
|
209
|
+
/** Field types for data steps - determines input control in callout */
|
|
210
|
+
type BPFStepFieldType = 'text' | 'textarea' | 'number' | 'decimal' | 'currency' | 'date' | 'datetime' | 'lookup' | 'optionset' | 'multiselect' | 'boolean' | 'owner';
|
|
211
|
+
/** Represents a connection between stages (or from condition nodes) */
|
|
212
|
+
interface BPFEdge {
|
|
213
|
+
/** Unique identifier */
|
|
214
|
+
id: string;
|
|
215
|
+
/** Source stage ID (or condition node ID) */
|
|
216
|
+
fromStageId: string;
|
|
217
|
+
/** Target stage ID */
|
|
218
|
+
toStageId: string;
|
|
219
|
+
/** Optional condition - if set, edge is only taken when condition evaluates true */
|
|
220
|
+
condition?: RuleConditionGroup;
|
|
221
|
+
/** Label for the edge (e.g., "Yes", "No", "Approved") */
|
|
222
|
+
label?: string;
|
|
223
|
+
/** Evaluation order when multiple edges from same source (lower = evaluated first) */
|
|
224
|
+
order?: number;
|
|
225
|
+
/** Whether this is the default/fallback edge when no conditions match */
|
|
226
|
+
isDefault?: boolean;
|
|
227
|
+
}
|
|
228
|
+
/** A condition branch point in the BPF (the purple diamond in Dynamics) */
|
|
229
|
+
interface BPFConditionNode {
|
|
230
|
+
/** Unique identifier */
|
|
231
|
+
id: string;
|
|
232
|
+
/** Display name (e.g., "Met Budget?") */
|
|
233
|
+
name: string;
|
|
234
|
+
/** Optional description */
|
|
235
|
+
description?: string;
|
|
236
|
+
/** The condition to evaluate (determines which outgoing edge to take) */
|
|
237
|
+
condition: RuleConditionGroup;
|
|
238
|
+
/** Position for visual layout */
|
|
239
|
+
position?: {
|
|
240
|
+
x: number;
|
|
241
|
+
y: number;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/** 2D position for flowchart layout */
|
|
245
|
+
interface BPFNodePosition {
|
|
246
|
+
x: number;
|
|
247
|
+
y: number;
|
|
248
|
+
}
|
|
249
|
+
/** A step within a BPF stage */
|
|
250
|
+
interface BPFStep {
|
|
251
|
+
/** Unique identifier */
|
|
252
|
+
id: string;
|
|
253
|
+
/** Step name/label */
|
|
254
|
+
name: string;
|
|
255
|
+
/** Display order within stage (1-based) */
|
|
256
|
+
order: number;
|
|
257
|
+
/** Step type */
|
|
258
|
+
type: BPFStepType;
|
|
259
|
+
/** Whether this step must be completed to advance */
|
|
260
|
+
required: boolean;
|
|
261
|
+
/** Optional description */
|
|
262
|
+
description?: string;
|
|
263
|
+
/** For data steps - field logical name to fill */
|
|
264
|
+
fieldLogicalName?: string;
|
|
265
|
+
/** For data steps - field display name */
|
|
266
|
+
fieldDisplayName?: string;
|
|
267
|
+
/** For data steps - field type (determines input control) */
|
|
268
|
+
fieldType?: BPFStepFieldType;
|
|
269
|
+
/** For optionset fields - available options */
|
|
270
|
+
options?: Array<{
|
|
271
|
+
value: string | number;
|
|
272
|
+
label: string;
|
|
273
|
+
}>;
|
|
274
|
+
/** For lookup fields - target entity */
|
|
275
|
+
lookupTargetEntity?: string;
|
|
276
|
+
/** For lookup fields - additional target entities (polymorphic lookups like Customer) */
|
|
277
|
+
lookupTargetEntities?: string[];
|
|
278
|
+
/** For lookup fields - OData filter expression (e.g., "statecode eq 0") */
|
|
279
|
+
lookupFilter?: string;
|
|
280
|
+
/** For lookup fields - custom FetchXML for advanced filtering */
|
|
281
|
+
lookupFetchXml?: string;
|
|
282
|
+
/** For lookup fields - view ID to use for filtering (uses view's FetchXML) */
|
|
283
|
+
lookupViewId?: string;
|
|
284
|
+
/** For lookup fields - whether to allow creating new records inline */
|
|
285
|
+
lookupAllowCreate?: boolean;
|
|
286
|
+
/** For lookup fields - columns to display in search results */
|
|
287
|
+
lookupDisplayColumns?: string[];
|
|
288
|
+
/** For workflow steps - workflow ID */
|
|
289
|
+
workflowId?: string;
|
|
290
|
+
/** For workflow steps - workflow name */
|
|
291
|
+
workflowName?: string;
|
|
292
|
+
/** For action steps - action ID */
|
|
293
|
+
actionId?: string;
|
|
294
|
+
/** For action steps - action name */
|
|
295
|
+
actionName?: string;
|
|
296
|
+
/** For Power Automate flow steps - flow ID */
|
|
297
|
+
flowId?: string;
|
|
298
|
+
/** For Power Automate flow steps - flow name */
|
|
299
|
+
flowName?: string;
|
|
300
|
+
/** Dataverse process stage attribute ID (for imported BPFs) */
|
|
301
|
+
dataverseAttributeId?: string;
|
|
302
|
+
}
|
|
303
|
+
/** A stage in the BPF */
|
|
304
|
+
interface BPFStage {
|
|
305
|
+
/** Unique identifier */
|
|
306
|
+
id: string;
|
|
307
|
+
/** Stage name/label */
|
|
308
|
+
name: string;
|
|
309
|
+
/** Display order (1-based) */
|
|
310
|
+
order: number;
|
|
311
|
+
/** Current status (runtime) */
|
|
312
|
+
status: BPFStageStatus;
|
|
313
|
+
/** Optional description */
|
|
314
|
+
description?: string;
|
|
315
|
+
/** Fluent UI icon name */
|
|
316
|
+
icon?: string;
|
|
317
|
+
/** Custom color (hex) */
|
|
318
|
+
color?: string;
|
|
319
|
+
/** Steps within this stage */
|
|
320
|
+
steps: BPFStep[];
|
|
321
|
+
/** Conditions required to enter this stage */
|
|
322
|
+
entryCondition?: RuleConditionGroup;
|
|
323
|
+
/** Conditions required to exit this stage */
|
|
324
|
+
exitCondition?: RuleConditionGroup;
|
|
325
|
+
/** Actions to execute when entering this stage */
|
|
326
|
+
onEnterActions?: RuleAction[];
|
|
327
|
+
/** Actions to execute when exiting this stage */
|
|
328
|
+
onExitActions?: RuleAction[];
|
|
329
|
+
/** Link to a form to show for this stage */
|
|
330
|
+
linkedFormId?: string;
|
|
331
|
+
/** Dataverse process stage ID (for imported BPFs) */
|
|
332
|
+
dataverseStageId?: string;
|
|
333
|
+
/** Dataverse stage category (for imported BPFs) */
|
|
334
|
+
dataverseStageCategory?: number;
|
|
335
|
+
/** Position for flowchart layout (used when edges are present) */
|
|
336
|
+
position?: BPFNodePosition;
|
|
337
|
+
}
|
|
338
|
+
/** Complete BPF definition */
|
|
339
|
+
interface BusinessProcessFlowDefinition {
|
|
340
|
+
/** Unique identifier */
|
|
341
|
+
id: string;
|
|
342
|
+
/** BPF name */
|
|
343
|
+
name: string;
|
|
344
|
+
/** Optional description */
|
|
345
|
+
description?: string;
|
|
346
|
+
/** Entity this BPF applies to */
|
|
347
|
+
entityLogicalName: string;
|
|
348
|
+
/** Entity display name */
|
|
349
|
+
entityDisplayName?: string;
|
|
350
|
+
/** Whether imported from Dataverse or created custom */
|
|
351
|
+
source: BPFSource;
|
|
352
|
+
/** Dataverse workflow ID (for imported BPFs) */
|
|
353
|
+
dataverseWorkflowId?: string;
|
|
354
|
+
/** Dataverse unique name (for imported BPFs) */
|
|
355
|
+
dataverseUniqueName?: string;
|
|
356
|
+
/** Ordered list of stages */
|
|
357
|
+
stages: BPFStage[];
|
|
358
|
+
/**
|
|
359
|
+
* Edges connecting stages/condition nodes.
|
|
360
|
+
* If present, navigation uses edge traversal instead of index arithmetic.
|
|
361
|
+
* Empty or undefined = linear navigation (backward compatible).
|
|
362
|
+
*/
|
|
363
|
+
edges?: BPFEdge[];
|
|
364
|
+
/**
|
|
365
|
+
* Condition branch points (purple diamonds in Dynamics designer).
|
|
366
|
+
* Referenced by edges via their IDs.
|
|
367
|
+
*/
|
|
368
|
+
conditionNodes?: BPFConditionNode[];
|
|
369
|
+
/** Currently active stage index (0-based, -1 if not started) */
|
|
370
|
+
activeStageIndex: number;
|
|
371
|
+
/** Whether this BPF is active */
|
|
372
|
+
isActive: boolean;
|
|
373
|
+
/** Allow navigating to previous stages */
|
|
374
|
+
allowBackNavigation: boolean;
|
|
375
|
+
/** Show stage labels in progress indicator */
|
|
376
|
+
showStageLabels: boolean;
|
|
377
|
+
/** Progress indicator variant */
|
|
378
|
+
progressVariant?: 'chevron' | 'circle' | 'minimal';
|
|
379
|
+
/** BPF-wide accent color applied to all stages (individual stage.color overrides) */
|
|
380
|
+
accentColor?: string;
|
|
381
|
+
/** ISO timestamp when created */
|
|
382
|
+
createdAt: string;
|
|
383
|
+
/** ISO timestamp when last updated */
|
|
384
|
+
updatedAt: string;
|
|
385
|
+
/** Creator user ID */
|
|
386
|
+
createdBy?: string;
|
|
387
|
+
}
|
|
388
|
+
/** Runtime instance of a BPF for a specific record */
|
|
389
|
+
interface BPFInstance {
|
|
390
|
+
/** Instance ID */
|
|
391
|
+
id: string;
|
|
392
|
+
/** Reference to the BPF definition */
|
|
393
|
+
bpfDefinitionId: string;
|
|
394
|
+
/** Record ID this instance is tracking */
|
|
395
|
+
recordId: string;
|
|
396
|
+
/** Entity logical name of the record */
|
|
397
|
+
entityLogicalName: string;
|
|
398
|
+
/** Current active stage ID */
|
|
399
|
+
activeStageId: string;
|
|
400
|
+
/** IDs of completed stages */
|
|
401
|
+
completedStageIds: string[];
|
|
402
|
+
/** IDs of skipped stages */
|
|
403
|
+
skippedStageIds: string[];
|
|
404
|
+
/** IDs of completed steps (across all stages) */
|
|
405
|
+
completedStepIds: string[];
|
|
406
|
+
/**
|
|
407
|
+
* Path history - ordered list of stage/node IDs visited.
|
|
408
|
+
* Used for tracking non-linear traversal in branching BPFs.
|
|
409
|
+
*/
|
|
410
|
+
pathHistory?: string[];
|
|
411
|
+
/** When the BPF was started for this record */
|
|
412
|
+
startedAt: string;
|
|
413
|
+
/** When the BPF was completed (all stages done) */
|
|
414
|
+
completedAt?: string;
|
|
415
|
+
/** Dataverse process instance ID */
|
|
416
|
+
dataverseInstanceId?: string;
|
|
417
|
+
}
|
|
418
|
+
/** Dataverse BPF metadata from workflow entity */
|
|
419
|
+
interface DataverseBPFMetadata {
|
|
420
|
+
/** Workflow ID (GUID) */
|
|
421
|
+
workflowId: string;
|
|
422
|
+
/** BPF name */
|
|
423
|
+
name: string;
|
|
424
|
+
/** Description */
|
|
425
|
+
description?: string;
|
|
426
|
+
/** Primary entity logical name */
|
|
427
|
+
primaryEntity: string;
|
|
428
|
+
/** Category (4 = Business Process Flow) */
|
|
429
|
+
category: number;
|
|
430
|
+
/** State code (1 = Activated) */
|
|
431
|
+
stateCode: number;
|
|
432
|
+
/** Status code */
|
|
433
|
+
statusCode: number;
|
|
434
|
+
/** Unique name */
|
|
435
|
+
uniqueName?: string;
|
|
436
|
+
/** Stages within this BPF */
|
|
437
|
+
stages: DataverseBPFStageMetadata[];
|
|
438
|
+
/** Branch data (for branching BPFs) */
|
|
439
|
+
branchData?: DataverseBPFBranchData;
|
|
440
|
+
}
|
|
441
|
+
/** Dataverse attribute types */
|
|
442
|
+
type DataverseAttributeType = 'String' | 'Memo' | 'Integer' | 'BigInt' | 'Decimal' | 'Double' | 'Money' | 'DateTime' | 'Boolean' | 'Lookup' | 'Owner' | 'Customer' | 'Picklist' | 'State' | 'Status' | 'MultiSelectPicklist' | 'Uniqueidentifier' | 'Image' | 'File' | 'EntityName' | 'Virtual' | 'ManagedProperty' | 'PartyList';
|
|
443
|
+
/** Parsed step info from clientdata */
|
|
444
|
+
interface DataverseBPFStepInfo {
|
|
445
|
+
/** Field logical name (e.g., "parentcontactid") */
|
|
446
|
+
controlId: string;
|
|
447
|
+
/** Display name/label (e.g., "Existing Contact") */
|
|
448
|
+
displayName: string;
|
|
449
|
+
/** Whether this step is required to advance */
|
|
450
|
+
isRequired?: boolean;
|
|
451
|
+
/** Attribute type from Dataverse (e.g., "Lookup", "Picklist", "Money") */
|
|
452
|
+
attributeType?: DataverseAttributeType;
|
|
453
|
+
/** For lookup fields - target entity logical names */
|
|
454
|
+
lookupTargets?: string[];
|
|
455
|
+
/** For optionset fields - available options */
|
|
456
|
+
options?: Array<{
|
|
457
|
+
value: number;
|
|
458
|
+
label: string;
|
|
459
|
+
}>;
|
|
460
|
+
/** Format hint (e.g., "Phone", "Email", "Url" for String attributes) */
|
|
461
|
+
format?: string;
|
|
462
|
+
/** Max length for string fields */
|
|
463
|
+
maxLength?: number;
|
|
464
|
+
/** Precision for decimal/currency fields */
|
|
465
|
+
precision?: number;
|
|
466
|
+
}
|
|
467
|
+
/** Dataverse process stage metadata */
|
|
468
|
+
interface DataverseBPFStageMetadata {
|
|
469
|
+
/** Process stage ID (GUID) */
|
|
470
|
+
stageId: string;
|
|
471
|
+
/** Stage name */
|
|
472
|
+
name: string;
|
|
473
|
+
/** Stage category (order indicator) */
|
|
474
|
+
stageCategory: number;
|
|
475
|
+
/** Primary entity for this stage */
|
|
476
|
+
primaryEntityLogicalName: string;
|
|
477
|
+
/** Required attributes (field logical names) - legacy */
|
|
478
|
+
requiredAttributes: string[];
|
|
479
|
+
/** Parsed step info with both controlId and displayName */
|
|
480
|
+
parsedSteps?: DataverseBPFStepInfo[];
|
|
481
|
+
/** Process ID this stage belongs to */
|
|
482
|
+
processId: string;
|
|
483
|
+
}
|
|
484
|
+
/** Branch connection from clientdata */
|
|
485
|
+
interface DataverseBPFBranchInfo {
|
|
486
|
+
/** Source stage or condition node ID */
|
|
487
|
+
fromNodeId: string;
|
|
488
|
+
/** Target stage ID */
|
|
489
|
+
toStageId: string;
|
|
490
|
+
/** Branch label (e.g., "Yes", "No") */
|
|
491
|
+
label?: string;
|
|
492
|
+
/** Condition expression (raw from Dynamics) */
|
|
493
|
+
conditionExpression?: string;
|
|
494
|
+
/** Parsed condition field */
|
|
495
|
+
conditionField?: string;
|
|
496
|
+
/** Parsed condition operator */
|
|
497
|
+
conditionOperator?: string;
|
|
498
|
+
/** Parsed condition value */
|
|
499
|
+
conditionValue?: unknown;
|
|
500
|
+
/** Whether this is the default/else branch */
|
|
501
|
+
isDefault?: boolean;
|
|
502
|
+
/** Branch order (for evaluation priority) */
|
|
503
|
+
order?: number;
|
|
504
|
+
}
|
|
505
|
+
/** Condition node from clientdata (the decision point) */
|
|
506
|
+
interface DataverseBPFConditionInfo {
|
|
507
|
+
/** Condition node ID */
|
|
508
|
+
nodeId: string;
|
|
509
|
+
/** Display name (e.g., "Met Budget?") */
|
|
510
|
+
name: string;
|
|
511
|
+
/** The field being evaluated */
|
|
512
|
+
conditionField?: string;
|
|
513
|
+
/** The operator (eq, ne, gt, etc.) */
|
|
514
|
+
conditionOperator?: string;
|
|
515
|
+
/** The value being compared */
|
|
516
|
+
conditionValue?: unknown;
|
|
517
|
+
/** Raw condition expression */
|
|
518
|
+
conditionExpression?: string;
|
|
519
|
+
/** Stage ID this condition belongs to (the "parent" stage) */
|
|
520
|
+
parentStageId?: string;
|
|
521
|
+
}
|
|
522
|
+
/** Extended BPF metadata with branching info */
|
|
523
|
+
interface DataverseBPFBranchData {
|
|
524
|
+
/** Branch connections */
|
|
525
|
+
branches: DataverseBPFBranchInfo[];
|
|
526
|
+
/** Condition nodes (decision points) */
|
|
527
|
+
conditionNodes: DataverseBPFConditionInfo[];
|
|
528
|
+
/** Whether this BPF has branching */
|
|
529
|
+
hasBranching: boolean;
|
|
530
|
+
}
|
|
531
|
+
/** Result of a stage navigation attempt */
|
|
532
|
+
interface BPFNavigationResult {
|
|
533
|
+
/** Whether navigation succeeded */
|
|
534
|
+
success: boolean;
|
|
535
|
+
/** New active stage ID (if successful) */
|
|
536
|
+
newActiveStageId?: string;
|
|
537
|
+
/** Error message (if failed) */
|
|
538
|
+
error?: string;
|
|
539
|
+
/** Validation errors preventing navigation */
|
|
540
|
+
validationErrors?: BPFValidationError[];
|
|
541
|
+
}
|
|
542
|
+
/** Validation error for BPF operations */
|
|
543
|
+
interface BPFValidationError {
|
|
544
|
+
/** Stage ID where error occurred */
|
|
545
|
+
stageId?: string;
|
|
546
|
+
/** Step ID where error occurred */
|
|
547
|
+
stepId?: string;
|
|
548
|
+
/** Error message */
|
|
549
|
+
message: string;
|
|
550
|
+
/** Error type */
|
|
551
|
+
type: 'required-step' | 'exit-condition' | 'entry-condition' | 'workflow-failed';
|
|
552
|
+
}
|
|
553
|
+
/** Create a default BPF step */
|
|
554
|
+
declare function createDefaultBPFStep(type?: BPFStepType, order?: number): BPFStep;
|
|
555
|
+
/** Create a default BPF stage */
|
|
556
|
+
declare function createDefaultBPFStage(order?: number): BPFStage;
|
|
557
|
+
/** Create a default BPF edge */
|
|
558
|
+
declare function createDefaultBPFEdge(fromStageId: string, toStageId: string, options?: {
|
|
559
|
+
label?: string;
|
|
560
|
+
condition?: RuleConditionGroup;
|
|
561
|
+
isDefault?: boolean;
|
|
562
|
+
order?: number;
|
|
563
|
+
}): BPFEdge;
|
|
564
|
+
/** Create a default BPF condition node */
|
|
565
|
+
declare function createDefaultBPFConditionNode(name?: string, condition?: RuleConditionGroup): BPFConditionNode;
|
|
566
|
+
/** Create a default BPF definition */
|
|
567
|
+
declare function createDefaultBPF(entityLogicalName: string, name?: string): BusinessProcessFlowDefinition;
|
|
568
|
+
/** Create a BPF instance for a record */
|
|
569
|
+
declare function createBPFInstance(bpf: BusinessProcessFlowDefinition, recordId: string): BPFInstance;
|
|
570
|
+
/** Convert Dataverse BPF metadata to BPF definition */
|
|
571
|
+
declare function convertDataverseBPFToDefinition(metadata: DataverseBPFMetadata): BusinessProcessFlowDefinition;
|
|
572
|
+
/** Step type display information */
|
|
573
|
+
declare const BPF_STEP_TYPES: Record<BPFStepType, {
|
|
574
|
+
label: string;
|
|
575
|
+
icon: string;
|
|
576
|
+
description: string;
|
|
577
|
+
}>;
|
|
578
|
+
/** Stage status display information */
|
|
579
|
+
declare const BPF_STAGE_STATUSES: Record<BPFStageStatus, {
|
|
580
|
+
label: string;
|
|
581
|
+
icon: string;
|
|
582
|
+
color: string;
|
|
583
|
+
}>;
|
|
584
|
+
/** Condition node display information */
|
|
585
|
+
declare const BPF_CONDITION_NODE_DISPLAY: {
|
|
586
|
+
label: string;
|
|
587
|
+
icon: string;
|
|
588
|
+
color: string;
|
|
589
|
+
shape: string;
|
|
590
|
+
};
|
|
591
|
+
/** Edge display information */
|
|
592
|
+
declare const BPF_EDGE_DISPLAY: {
|
|
593
|
+
defaultLabel: string;
|
|
594
|
+
yesLabel: string;
|
|
595
|
+
noLabel: string;
|
|
596
|
+
defaultColor: string;
|
|
597
|
+
conditionalColor: string;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* Check if a BPF uses edge-based branching.
|
|
601
|
+
* Returns false for linear BPFs (backward compatible).
|
|
602
|
+
*/
|
|
603
|
+
declare function hasBranching(bpf: BusinessProcessFlowDefinition): boolean;
|
|
604
|
+
/**
|
|
605
|
+
* Get outgoing edges from a stage or condition node.
|
|
606
|
+
*/
|
|
607
|
+
declare function getOutgoingEdges(bpf: BusinessProcessFlowDefinition, nodeId: string): BPFEdge[];
|
|
608
|
+
/**
|
|
609
|
+
* Get incoming edges to a stage or condition node.
|
|
610
|
+
*/
|
|
611
|
+
declare function getIncomingEdges(bpf: BusinessProcessFlowDefinition, nodeId: string): BPFEdge[];
|
|
612
|
+
/**
|
|
613
|
+
* Get condition node by ID.
|
|
614
|
+
*/
|
|
615
|
+
declare function getConditionNodeById(bpf: BusinessProcessFlowDefinition, nodeId: string): BPFConditionNode | undefined;
|
|
616
|
+
/**
|
|
617
|
+
* Check if a node ID is a condition node (vs a stage).
|
|
618
|
+
*/
|
|
619
|
+
declare function isConditionNode(bpf: BusinessProcessFlowDefinition, nodeId: string): boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Get the default (fallback) edge from a node.
|
|
622
|
+
*/
|
|
623
|
+
declare function getDefaultEdge(bpf: BusinessProcessFlowDefinition, nodeId: string): BPFEdge | undefined;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Form Selector Types
|
|
627
|
+
*
|
|
628
|
+
* Defines types for Dynamics 365-style form switching functionality:
|
|
629
|
+
* - Form grouping by entity (like D365 form selector dropdown)
|
|
630
|
+
* - Form selection rules (auto-select based on conditions)
|
|
631
|
+
* - Entity-based sidebar organization
|
|
632
|
+
* - Default form per entity
|
|
633
|
+
*/
|
|
634
|
+
|
|
635
|
+
/** Lightweight form reference for dropdowns and lists */
|
|
636
|
+
interface FormSummary {
|
|
637
|
+
id: string;
|
|
638
|
+
name: string;
|
|
639
|
+
type: FormType;
|
|
640
|
+
entityLogicalName?: string;
|
|
641
|
+
isDefault?: boolean;
|
|
642
|
+
order?: number;
|
|
643
|
+
description?: string;
|
|
644
|
+
/** Number of embedded callouts on this form */
|
|
645
|
+
calloutCount?: number;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Determines which form to display based on conditions.
|
|
649
|
+
* Rules are evaluated in priority order; first match wins.
|
|
650
|
+
*/
|
|
651
|
+
interface FormSelectorRule {
|
|
652
|
+
id: string;
|
|
653
|
+
name: string;
|
|
654
|
+
/** Entity this rule applies to */
|
|
655
|
+
entityLogicalName: string;
|
|
656
|
+
/** Form type this rule applies to (e.g., only 'main' forms) */
|
|
657
|
+
formType: FormType;
|
|
658
|
+
/** The form to show when this rule matches */
|
|
659
|
+
targetFormId: string;
|
|
660
|
+
/** Condition tree that determines when this rule applies */
|
|
661
|
+
condition: RuleConditionGroup;
|
|
662
|
+
/** Evaluation order (lower = higher priority) */
|
|
663
|
+
priority: number;
|
|
664
|
+
/** Whether this rule is active */
|
|
665
|
+
enabled: boolean;
|
|
666
|
+
/** Metadata */
|
|
667
|
+
createdAt: string;
|
|
668
|
+
updatedAt: string;
|
|
669
|
+
}
|
|
670
|
+
/** Type of condition for form selection */
|
|
671
|
+
type FormSelectorConditionType = 'field-value' | 'security-role' | 'business-unit' | 'team' | 'form-context' | 'record-type' | 'custom';
|
|
672
|
+
/** Condition for checking user's security role */
|
|
673
|
+
interface SecurityRoleCondition {
|
|
674
|
+
type: 'security-role';
|
|
675
|
+
roleId?: string;
|
|
676
|
+
roleName?: string;
|
|
677
|
+
operator: 'has-role' | 'not-has-role';
|
|
678
|
+
}
|
|
679
|
+
/** Condition for checking user's business unit */
|
|
680
|
+
interface BusinessUnitCondition {
|
|
681
|
+
type: 'business-unit';
|
|
682
|
+
businessUnitId?: string;
|
|
683
|
+
businessUnitName?: string;
|
|
684
|
+
operator: 'in-bu' | 'not-in-bu' | 'in-bu-hierarchy';
|
|
685
|
+
}
|
|
686
|
+
/** Condition for checking form context */
|
|
687
|
+
interface FormContextCondition {
|
|
688
|
+
type: 'form-context';
|
|
689
|
+
context: 'is-create-mode' | 'is-update-mode' | 'is-mobile' | 'is-tablet' | 'is-desktop' | 'is-offline' | 'is-quick-create';
|
|
690
|
+
}
|
|
691
|
+
/** Condition for checking field values */
|
|
692
|
+
interface FieldValueCondition {
|
|
693
|
+
type: 'field-value';
|
|
694
|
+
fieldName: string;
|
|
695
|
+
operator: ConditionOperator;
|
|
696
|
+
value?: ConditionValue;
|
|
697
|
+
compareToField?: string;
|
|
698
|
+
}
|
|
699
|
+
/** Union of all form selector condition types */
|
|
700
|
+
type FormSelectorCondition = SecurityRoleCondition | BusinessUnitCondition | FormContextCondition | FieldValueCondition;
|
|
701
|
+
/**
|
|
702
|
+
* Computed grouping of forms by entity.
|
|
703
|
+
* Derived from FormDefinition[] - not stored directly.
|
|
704
|
+
*/
|
|
705
|
+
interface EntityFormGroup {
|
|
706
|
+
/** Entity logical name (e.g., "contact", "account") */
|
|
707
|
+
entityLogicalName: string;
|
|
708
|
+
/** Display name for the entity (from form data binding) */
|
|
709
|
+
entityDisplayName: string;
|
|
710
|
+
/** Icon name for the entity (optional) */
|
|
711
|
+
entityIcon?: string;
|
|
712
|
+
/** Forms grouped by their type */
|
|
713
|
+
formsByType: Partial<Record<FormType, FormSummary[]>>;
|
|
714
|
+
/** Total number of forms for this entity */
|
|
715
|
+
totalForms: number;
|
|
716
|
+
/** ID of the default main form for this entity */
|
|
717
|
+
defaultMainFormId?: string;
|
|
718
|
+
/** Form selector rules for this entity */
|
|
719
|
+
rules: FormSelectorRule[];
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Group for forms without entity binding.
|
|
723
|
+
* These are typically dialogs, panels, or utility forms.
|
|
724
|
+
*/
|
|
725
|
+
interface UnboundFormGroup {
|
|
726
|
+
/** Forms grouped by their type */
|
|
727
|
+
formsByType: Partial<Record<FormType, FormSummary[]>>;
|
|
728
|
+
/** Total number of unbound forms */
|
|
729
|
+
totalForms: number;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Runtime context for selecting a form.
|
|
733
|
+
* Passed to the form selection engine.
|
|
734
|
+
*/
|
|
735
|
+
interface FormSelectionContext {
|
|
736
|
+
/** Current user's security roles */
|
|
737
|
+
userRoles?: string[];
|
|
738
|
+
/** Current user's business unit ID */
|
|
739
|
+
userBusinessUnitId?: string;
|
|
740
|
+
/** Current user's team IDs */
|
|
741
|
+
userTeamIds?: string[];
|
|
742
|
+
/** Whether creating a new record */
|
|
743
|
+
isCreateMode?: boolean;
|
|
744
|
+
/** Whether updating an existing record */
|
|
745
|
+
isUpdateMode?: boolean;
|
|
746
|
+
/** Client type */
|
|
747
|
+
clientType?: 'web' | 'mobile' | 'tablet';
|
|
748
|
+
/** Whether offline */
|
|
749
|
+
isOffline?: boolean;
|
|
750
|
+
/** Whether quick create mode */
|
|
751
|
+
isQuickCreate?: boolean;
|
|
752
|
+
/** Current record data (for field-value conditions) */
|
|
753
|
+
recordData?: Record<string, unknown>;
|
|
754
|
+
/** Explicitly requested form ID (overrides rules) */
|
|
755
|
+
requestedFormId?: string;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Result of form selection.
|
|
759
|
+
* Indicates which form was selected and why.
|
|
760
|
+
*/
|
|
761
|
+
interface FormSelectionResult {
|
|
762
|
+
/** The selected form ID */
|
|
763
|
+
formId: string;
|
|
764
|
+
/** Form name for display */
|
|
765
|
+
formName: string;
|
|
766
|
+
/** How the form was selected */
|
|
767
|
+
selectionReason: 'explicit-request' | 'rule-match' | 'default-form' | 'first-available';
|
|
768
|
+
/** If selected by rule, the rule that matched */
|
|
769
|
+
matchedRuleId?: string;
|
|
770
|
+
matchedRuleName?: string;
|
|
771
|
+
/** Other forms available for this entity */
|
|
772
|
+
alternativeForms: FormSummary[];
|
|
773
|
+
}
|
|
774
|
+
/** How forms are organized in the sidebar */
|
|
775
|
+
type SidebarViewMode = 'by-type' | 'by-entity';
|
|
776
|
+
/**
|
|
777
|
+
* Information about forms linked by sharing the same entity.
|
|
778
|
+
* Used in properties panel to show linked forms.
|
|
779
|
+
*/
|
|
780
|
+
interface LinkedFormsInfo {
|
|
781
|
+
/** Entity logical name */
|
|
782
|
+
entityLogicalName: string;
|
|
783
|
+
/** Entity display name */
|
|
784
|
+
entityDisplayName: string;
|
|
785
|
+
/** Other forms that share this entity */
|
|
786
|
+
linkedForms: FormSummary[];
|
|
787
|
+
/** Associated BPF (if any) */
|
|
788
|
+
bpfId?: string;
|
|
789
|
+
bpfName?: string;
|
|
790
|
+
}
|
|
791
|
+
/** Creates a new form selector rule with defaults */
|
|
792
|
+
declare function createFormSelectorRule(entityLogicalName: string, targetFormId: string, name?: string): FormSelectorRule;
|
|
793
|
+
/** Converts a FormDefinition to a FormSummary */
|
|
794
|
+
declare function toFormSummary(form: {
|
|
795
|
+
id: string;
|
|
796
|
+
name: string;
|
|
797
|
+
type: FormType;
|
|
798
|
+
settings?: {
|
|
799
|
+
dataSources?: {
|
|
800
|
+
entityName?: string;
|
|
801
|
+
}[];
|
|
802
|
+
isDefaultForEntity?: boolean;
|
|
803
|
+
};
|
|
804
|
+
order?: number;
|
|
805
|
+
description?: string;
|
|
806
|
+
callouts?: unknown[];
|
|
807
|
+
}): FormSummary;
|
|
808
|
+
/** Map of common entity names to Fluent UI icons */
|
|
809
|
+
declare const entityIconMap: Record<string, string>;
|
|
810
|
+
/** Get icon for an entity, with fallback */
|
|
811
|
+
declare function getEntityIcon(entityLogicalName: string): string;
|
|
812
|
+
|
|
813
|
+
export { type AttributeMetadata, type BPFConditionNode, type BPFEdge, type BPFInstance, type BPFNavigationResult, type BPFNodePosition, type BPFSource, type BPFStage, type BPFStageStatus, type BPFStep, type BPFStepFieldType, type BPFStepType, type BPFValidationError, BPF_CONDITION_NODE_DISPLAY, BPF_EDGE_DISPLAY, BPF_STAGE_STATUSES, BPF_STEP_TYPES, type BusinessProcessFlowDefinition, type BusinessUnitCondition, ConditionOperator, ConditionValue, type DataverseAttributeType, type DataverseBPFBranchData, type DataverseBPFBranchInfo, type DataverseBPFConditionInfo, type DataverseBPFMetadata, type DataverseBPFStageMetadata, type DataverseBPFStepInfo, type DisplayNameInfo, type EntityFormGroup, type EntityMetadata, type FieldValueCondition, type FormContextCondition, type FormSelectionContext, type FormSelectionResult, type FormSelectorCondition, type FormSelectorConditionType, type FormSelectorRule, type FormSummary, FormType, type GlobalOptionSetMetadata, type GlobalOptionSetOption, type IDataverseClient, type LinkedFormsInfo, type ManyToOneRelationshipMetadata, type NormalizedRelationship, type OneToManyRelationshipMetadata, type RelationshipMetadata, type RelationshipType, RuleAction, RuleConditionGroup, type SecurityRoleCondition, type SidebarViewMode, type UnboundFormGroup, type ViewMetadata, convertDataverseBPFToDefinition, createBPFInstance, createDefaultBPF, createDefaultBPFConditionNode, createDefaultBPFEdge, createDefaultBPFStage, createDefaultBPFStep, createFormSelectorRule, entityIconMap, getConditionNodeById, getDefaultEdge, getEntityIcon, getIncomingEdges, getOutgoingEdges, hasBranching, isConditionNode, toFormSummary };
|