@stndrds/schema 0.1.0-alpha.15 → 0.1.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/chunk-4D23X5XN.mjs +7257 -0
  2. package/dist/chunk-6RPWHMTH.mjs +7101 -0
  3. package/dist/chunk-BTVPMGYW.mjs +6327 -0
  4. package/dist/chunk-C7HZ55GJ.mjs +6882 -0
  5. package/dist/chunk-CMO3JEJL.mjs +7259 -0
  6. package/dist/chunk-JDUTFH3J.mjs +6940 -0
  7. package/dist/chunk-JWRGX3UW.mjs +7265 -0
  8. package/dist/chunk-OUSLILLE.mjs +7259 -0
  9. package/dist/chunk-PMJZPJDP.mjs +7265 -0
  10. package/dist/chunk-QAGN53HE.mjs +6327 -0
  11. package/dist/chunk-UUOAVXAI.mjs +6327 -0
  12. package/dist/chunk-VYZ3BOSB.mjs +6946 -0
  13. package/dist/chunk-XAX75NSP.mjs +6321 -0
  14. package/dist/chunk-YEV46K3M.mjs +7259 -0
  15. package/dist/chunk-ZG3PT3RL.mjs +6944 -0
  16. package/dist/index.d.mts +268 -4
  17. package/dist/index.d.ts +268 -4
  18. package/dist/index.js +1136 -168
  19. package/dist/index.mjs +35 -1
  20. package/dist/runtime--rp-TG-h.d.mts +5181 -0
  21. package/dist/runtime--rp-TG-h.d.ts +5181 -0
  22. package/dist/runtime-BPYJWZfC.d.mts +5130 -0
  23. package/dist/runtime-BPYJWZfC.d.ts +5130 -0
  24. package/dist/runtime-DRc_OhnM.d.mts +5142 -0
  25. package/dist/runtime-DRc_OhnM.d.ts +5142 -0
  26. package/dist/runtime-D_S3m9jf.d.mts +5142 -0
  27. package/dist/runtime-D_S3m9jf.d.ts +5142 -0
  28. package/dist/runtime-Db3rRxbJ.d.mts +4821 -0
  29. package/dist/runtime-Db3rRxbJ.d.ts +4821 -0
  30. package/dist/runtime-DlCiIIfr.d.mts +5130 -0
  31. package/dist/runtime-DlCiIIfr.d.ts +5130 -0
  32. package/dist/runtime-WqYxjhjJ.d.mts +5125 -0
  33. package/dist/runtime-WqYxjhjJ.d.ts +5125 -0
  34. package/dist/runtime.d.mts +1 -1
  35. package/dist/runtime.d.ts +1 -1
  36. package/dist/runtime.js +855 -222
  37. package/dist/runtime.mjs +5 -1
  38. package/package.json +2 -2
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { A as Attribute, S as StatusAttribute, a as SelectAttribute, M as MultiselectAttribute, P as Phone, C as Currency, L as Location, b as SystemResource, c as SystemAction, O as ObjectAction, T as TextAttribute, d as TextAreaAttribute, N as NumberAttribute, e as CheckboxAttribute, D as DateAttribute, f as PhoneAttribute, g as CurrencyAttribute, h as Option, i as LocationAttribute, j as TimestampAttribute, F as FileAttribute, U as UserAttribute, k as SingleRelationAttribute, l as MultiRelationAttribute, R as RelationTarget, m as RatingAttribute, n as ObjectDefinition, o as Field, p as AttributeGroupField, G as Group, V as ViewDefinition, q as Tab } from './runtime-DUxWyRcq.mjs';
2
- export { cf as AddAttributeInput, ak as AdvancedFilterState, aP as AssignRoleInput, bV as AttributeChange, t as AttributeGroup, r as AttributeType, c2 as AttributesRepository, K as AuditAction, Q as AuditActorType, W as AuditChange, Z as AuditListOptions, X as AuditLogEntry, c7 as AuditRepository, J as AuditResourceType, ca as AuditService, _ as AuditServiceOptions, B as BaseAttribute, a6 as CheckboxFilterOperator, aD as CompletionStatus, Y as CreateAuditLogInput, ce as CreateCustomObjectInput, cP as CreateDBAttribute, cL as CreateDBObject, cZ as CreateDBView, a2 as CreateFile, cS as CreateObjectRecord, aO as CreatePermissionInput, aM as CreateRoleInput, aT as CreateUserProfile, cv as CreateViewInput, ad as CurrencyFilterValue, aY as CustomTab, cO as DBAttribute, cK as DBObject, cY as DBView, cG as DEFAULT_LABEL_FALLBACK, bU as DatabaseAdapter, a7 as DateFilterOperator, v as DateFormat, w as DateValue, z as DocumentFace, y as DocumentType, E as DocumentTypeConfig, aJ as EffectivePermissions, a1 as File, cX as FileListOptions, cb as FileService, H as FileVerificationConfig, a0 as FileVisibility, c4 as FilesRepository, ah as FilterCombinator, aj as FilterGroup, ab as FilterOperator, ag as FilterRule, ai as FilterState, af as FilterValue, aW as FormTab, cE as FullSyncOptions, cD as FullSyncResult, az as GeocodingAdapter, aw as GeocodingAutocompleteParams, ay as GeocodingParams, cc as GeocodingService, av as GeocodingSuggestion, cr as GetRelationOptionsParams, cV as GlobalSearchOptions, cW as GlobalSearchResultItem, cd as GlobalSearchService, bW as HookContext, bX as HookDefinition, bY as HookHandler, b$ as HookRegistry, bZ as HookType, cT as ListOptions, x as LocationGranularity, a9 as MultiselectFilterOperator, at as NO_VALUE_OPERATORS, as as NoValueOperator, aA as NoopGeocodingAdapter, b_ as NoopHookRegistry, a5 as NumberFilterOperator, u as NumberUnit, ar as OPERATORS_BY_TYPE, aC as ObjectAttribute, aK as ObjectPermissions, aE as ObjectRecord, c5 as ObjectRecordsRepository, ci as ObjectSchemaService, ch as ObjectSchemaServiceOptions, c1 as ObjectsRepository, d0 as OperationResult, aH as Permission, aF as PermissionScope, ck as PermissionService, cj as PermissionServiceOptions, c8 as PermissionsRepository, ae as PhoneFilterValue, aq as QueryState, cm as RecordService, cl as RecordServiceOptions, I as RelationAttribute, aa as RelationFilterOperator, cp as RelationOption, cq as RelationOptionsResponse, cs as RelationService, co as RelationValidationError, cn as RelationValidationResult, ac as RelativeDateValue, ax as ReverseGeocodingParams, aG as Role, cU as SearchOptions, a8 as SelectFilterOperator, ao as SortDirection, ap as SortRule, s as StatusGroup, $ as StorageProvider, cz as SyncOptions, cy as SyncResult, aL as SystemPermissions, aV as TabType, aX as TableTab, b1 as TenantId, a4 as TextFilterOperator, aB as Timestamps, cQ as UpdateDBAttribute, cM as UpdateDBObject, c_ as UpdateDBView, a3 as UpdateFile, cg as UpdateObjectInput, aN as UpdateRoleInput, aU as UpdateUserProfile, cw as UpdateViewInput, cR as UpsertDBAttribute, cN as UpsertDBObject, c$ as UpsertDBView, aS as UserProfile, cu as UserProfileService, ct as UserProfileServiceOptions, c3 as UserProfilesRepository, aQ as UserRole, aI as UserRoleAssignment, aR as UserStatus, b0 as Uuid, bK as ValidationResult, cx as ViewService, d2 as ViewSyncOptions, d1 as ViewSyncResult, c6 as ViewsRepository, bm as attributeConfigSchemas, c9 as buildAuditChanges, b9 as checkboxConfigSchema, bT as computeRecordStatus, bI as createAttributeValidator, bt as createCheckboxValidator, bw as createCurrencyValidator, bu as createDateValidator, bO as createDraftValidator, bC as createFileValidator, bA as createLocationValidator, c0 as createMockAdapter, bF as createMultiRelationValidator, bz as createMultiselectValidator, bs as createNumberValidator, bJ as createObjectValidator, bv as createPhoneValidator, bH as createRatingValidator, bG as createRelationValidator, by as createSelectValidator, bE as createSingleRelationValidator, bx as createStatusValidator, br as createTextValidator, bB as createTimestampValidator, bD as createUserValidator, bc as currencyConfigSchema, ba as dateConfigSchema, cJ as extractAttributeNames, bi as fileConfigSchema, b2 as generateId, b3 as generatePrefixedId, bn as getAttributeConfigSchema, bR as getMissingRequiredAttributes, cC as getSyncPreview, d5 as getViewSyncPreview, al as isAdvancedFilterState, a$ as isCustomTab, aZ as isFormTab, cI as isLabelExpression, au as isNoValueOperator, bS as isRecordComplete, a_ as isTableTab, be as locationConfigSchema, bh as multiselectConfigSchema, b8 as numberConfigSchema, bp as parseAttributeConfig, bb as phoneConfigSchema, bl as ratingConfigSchema, b4 as registry, bk as relationConfigSchema, cH as renderLabelExpression, bq as safeParseAttributeConfig, bg as selectConfigSchema, bd as statusConfigSchema, cF as syncAll, cA as syncNativeObjects, d3 as syncNativeViews, b6 as textConfigSchema, b7 as textareaConfigSchema, bf as timestampConfigSchema, am as toAdvancedFilterState, an as toSimpleFilterState, bj as userConfigSchema, bL as validateAttribute, bo as validateAttributeConfig, bP as validateDraft, bQ as validateDraftOrThrow, bM as validateObject, bN as validateObjectOrThrow, cB as verifyNativeObjectsSync, d4 as verifyNativeViewsSync, b5 as viewRegistry } from './runtime-DUxWyRcq.mjs';
3
- import { IconName, CountryIso3, CurrencyCode, MimeType } from '@stndrds/constants';
1
+ import { A as Attribute, S as StatusAttribute, a as SelectAttribute, M as MultiselectAttribute, P as Phone, C as Currency, L as Location, b as SystemResource, c as SystemAction, O as ObjectAction, T as TextAttribute, d as TextAreaAttribute, N as NumberAttribute, e as CheckboxAttribute, D as DateAttribute, f as PhoneAttribute, g as CurrencyAttribute, h as Option, i as LocationAttribute, j as TimestampAttribute, F as FileAttribute, U as UserAttribute, k as SingleRelationAttribute, l as MultiRelationAttribute, R as RelationTarget, m as RatingAttribute, n as FlowDefinition, o as FlowPage, p as FlowRow, q as ObjectDefinition, r as Field, s as AttributeGroupField, G as Group, V as ViewDefinition, t as Tab } from './runtime--rp-TG-h.mjs';
2
+ export { b7 as ActivityTab, cv as AddAttributeInput, an as AdvancedFilterState, aZ as AssignRoleInput, c5 as AttributeChange, w as AttributeGroup, u as AttributeType, ce as AttributesRepository, X as AuditAction, Y as AuditActorType, Z as AuditChange, a0 as AuditListOptions, _ as AuditLogEntry, ck as AuditRepository, W as AuditResourceType, cn as AuditService, a1 as AuditServiceOptions, B as BaseAttribute, a9 as CheckboxFilterOperator, aN as CompletionStatus, $ as CreateAuditLogInput, cu as CreateCustomObjectInput, d4 as CreateDBAttribute, di as CreateDBFlow, d0 as CreateDBObject, de as CreateDBView, a5 as CreateFile, cp as CreateFlowInput, d7 as CreateObjectRecord, aY as CreatePermissionInput, aW as CreateRoleInput, b1 as CreateUserProfile, cL as CreateViewInput, ag as CurrencyFilterValue, b6 as CustomTab, d3 as DBAttribute, dh as DBFlow, c$ as DBObject, dd as DBView, cW as DEFAULT_LABEL_FALLBACK, c4 as DatabaseAdapter, aa as DateFilterOperator, y as DateFormat, z as DateValue, I as DocumentFace, H as DocumentType, J as DocumentTypeConfig, aT as EffectivePermissions, a4 as File, dc as FileListOptions, co as FileService, K as FileVerificationConfig, a3 as FileVisibility, cg as FilesRepository, ak as FilterCombinator, am as FilterGroup, ae as FilterOperator, aj as FilterRule, al as FilterState, ai as FilterValue, aA as FlowRelation, az as FlowRowField, cr as FlowService, ay as FlowSlot, aB as FlowStatus, cj as FlowsRepository, b4 as FormTab, cU as FullSyncOptions, cT as FullSyncResult, aJ as GeocodingAdapter, aG as GeocodingAutocompleteParams, aI as GeocodingParams, cs as GeocodingService, aF as GeocodingSuggestion, cH as GetRelationOptionsParams, da as GlobalSearchOptions, db as GlobalSearchResultItem, ct as GlobalSearchService, c6 as HookContext, c7 as HookDefinition, c8 as HookHandler, cb as HookRegistry, c9 as HookType, d8 as ListOptions, E as LocationGranularity, ac as MultiselectFilterOperator, aw as NO_VALUE_OPERATORS, av as NoValueOperator, aK as NoopGeocodingAdapter, ca as NoopHookRegistry, a8 as NumberFilterOperator, x as NumberUnit, au as OPERATORS_BY_TYPE, aM as ObjectAttribute, aU as ObjectPermissions, aO as ObjectRecord, ch as ObjectRecordsRepository, cy as ObjectSchemaService, cx as ObjectSchemaServiceOptions, cd as ObjectsRepository, dk as OperationResult, aR as Permission, aP as PermissionScope, cA as PermissionService, cz as PermissionServiceOptions, cl as PermissionsRepository, ah as PhoneFilterValue, at as QueryState, cC as RecordService, cB as RecordServiceOptions, Q as RelationAttribute, ad as RelationFilterOperator, cF as RelationOption, cG as RelationOptionsResponse, cI as RelationService, cE as RelationValidationError, cD as RelationValidationResult, af as RelativeDateValue, aH as ReverseGeocodingParams, aQ as Role, d9 as SearchOptions, ab as SelectFilterOperator, ar as SortDirection, as as SortRule, v as StatusGroup, a2 as StorageProvider, cP as SyncOptions, cO as SyncResult, aV as SystemPermissions, b3 as TabType, b5 as TableTab, bd as TenantId, a7 as TextFilterOperator, aL as Timestamps, d5 as UpdateDBAttribute, dj as UpdateDBFlow, d1 as UpdateDBObject, df as UpdateDBView, a6 as UpdateFile, cq as UpdateFlowInput, cw as UpdateObjectInput, aX as UpdateRoleInput, b2 as UpdateUserProfile, cM as UpdateViewInput, d6 as UpsertDBAttribute, d2 as UpsertDBObject, dg as UpsertDBView, b0 as UserProfile, cK as UserProfileService, cJ as UserProfileServiceOptions, cf as UserProfilesRepository, a_ as UserRole, aS as UserRoleAssignment, a$ as UserStatus, bc as Uuid, bW as ValidationResult, cN as ViewService, dm as ViewSyncOptions, dl as ViewSyncResult, ci as ViewsRepository, by as attributeConfigSchemas, cm as buildAuditChanges, bl as checkboxConfigSchema, c3 as computeRecordStatus, bU as createAttributeValidator, bF as createCheckboxValidator, bI as createCurrencyValidator, bG as createDateValidator, b_ as createDraftValidator, bO as createFileValidator, bM as createLocationValidator, cc as createMockAdapter, bR as createMultiRelationValidator, bL as createMultiselectValidator, bE as createNumberValidator, bV as createObjectValidator, bH as createPhoneValidator, bT as createRatingValidator, bS as createRelationValidator, bK as createSelectValidator, bQ as createSingleRelationValidator, bJ as createStatusValidator, bD as createTextValidator, bN as createTimestampValidator, bP as createUserValidator, bo as currencyConfigSchema, bm as dateConfigSchema, c_ as enrichValuesWithSelectLabels, cZ as extractAttributeNames, bu as fileConfigSchema, be as generateId, bf as generatePrefixedId, bz as getAttributeConfigSchema, c1 as getMissingRequiredAttributes, cS as getSyncPreview, dq as getViewSyncPreview, bb as isActivityTab, ao as isAdvancedFilterState, ba as isCustomTab, aC as isFlowDefinition, aD as isFlowPublished, b8 as isFormTab, cY as isLabelExpression, ax as isNoValueOperator, c2 as isRecordComplete, aE as isSystemFlow, b9 as isTableTab, bq as locationConfigSchema, bt as multiselectConfigSchema, bk as numberConfigSchema, bB as parseAttributeConfig, bn as phoneConfigSchema, bx as ratingConfigSchema, bg as registry, bw as relationConfigSchema, cX as renderLabelExpression, bC as safeParseAttributeConfig, bs as selectConfigSchema, bp as statusConfigSchema, cV as syncAll, cQ as syncNativeObjects, dn as syncNativeViews, bi as textConfigSchema, bj as textareaConfigSchema, br as timestampConfigSchema, ap as toAdvancedFilterState, aq as toSimpleFilterState, bv as userConfigSchema, bX as validateAttribute, bA as validateAttributeConfig, b$ as validateDraft, c0 as validateDraftOrThrow, bY as validateObject, bZ as validateObjectOrThrow, cR as verifyNativeObjectsSync, dp as verifyNativeViewsSync, bh as viewRegistry } from './runtime--rp-TG-h.mjs';
3
+ import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
4
4
  import 'zod';
5
5
 
6
6
  /**
@@ -300,6 +300,45 @@ type ExtractAttributes<TBuilder> = TBuilder extends {
300
300
  };
301
301
  } ? A : never;
302
302
 
303
+ /**
304
+ * Default empty value placeholder
305
+ */
306
+ declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
307
+ /**
308
+ * Format an attribute value for display
309
+ *
310
+ * This function converts raw attribute values into human-readable strings
311
+ * based on the attribute type and configuration.
312
+ *
313
+ * @param value - The raw value to format
314
+ * @param attribute - The attribute definition
315
+ * @returns Formatted string representation
316
+ *
317
+ * @example
318
+ * ```typescript
319
+ * // Text attribute
320
+ * formatAttributeValue("Hello", textAttr);
321
+ * // → "Hello"
322
+ *
323
+ * // Currency attribute
324
+ * formatAttributeValue({ value: 1500, code: "EUR" }, currencyAttr);
325
+ * // → "1,500.00 EUR"
326
+ *
327
+ * // Select attribute with options
328
+ * formatAttributeValue("active", statusAttr);
329
+ * // → "Active" (label from options)
330
+ *
331
+ * // Location with city granularity
332
+ * formatAttributeValue({ city: "Paris", country: "FRA" }, locationAttr);
333
+ * // → "Paris, FRA"
334
+ *
335
+ * // Empty value
336
+ * formatAttributeValue(null, textAttr);
337
+ * // → "—"
338
+ * ```
339
+ */
340
+ declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
341
+
303
342
  /**
304
343
  * System resources that can be managed through permissions.
305
344
  */
@@ -917,6 +956,231 @@ type ExtractAttributeRequired<T> = T extends {
917
956
  };
918
957
  } ? R : false;
919
958
 
959
+ /**
960
+ * Builder for creating flow rows with fields
961
+ */
962
+ declare class FlowRowBuilder {
963
+ private pageBuilder;
964
+ private rowData;
965
+ /** @internal */
966
+ constructor(pageBuilder: FlowPageBuilder, id: string, order: number);
967
+ /**
968
+ * Add a field to the current row
969
+ *
970
+ * @param slotId - Reference to a slot defined with .slot()
971
+ * @param attribute - Attribute name on the object
972
+ * @param options - Optional field configuration
973
+ *
974
+ * @example
975
+ * ```typescript
976
+ * .row("row-1")
977
+ * .field("mr", "firstName")
978
+ * .field("mr", "lastName")
979
+ * ```
980
+ */
981
+ field(slotId: string, attribute: string, options?: {
982
+ label?: string;
983
+ required?: boolean;
984
+ }): this;
985
+ /**
986
+ * Start a new row on the same page
987
+ */
988
+ row(id: string): FlowRowBuilder;
989
+ /**
990
+ * Start a new page
991
+ */
992
+ page(id: string, label: string, description?: string): FlowPageBuilder;
993
+ /**
994
+ * Build the final flow definition
995
+ */
996
+ build(): FlowDefinition;
997
+ }
998
+ /**
999
+ * Builder for creating flow pages with rows
1000
+ */
1001
+ declare class FlowPageBuilder {
1002
+ private flow;
1003
+ private pageData;
1004
+ private rowOrder;
1005
+ /** @internal */
1006
+ constructor(flow: FlowBuilder, id: string, label: string, description?: string);
1007
+ /**
1008
+ * Add a row to the current page
1009
+ *
1010
+ * @param id - Unique row identifier
1011
+ *
1012
+ * @example
1013
+ * ```typescript
1014
+ * .page("identity", "Identité")
1015
+ * .row("name-row")
1016
+ * .field("mr", "firstName")
1017
+ * .field("mr", "lastName")
1018
+ * .row("email-row")
1019
+ * .field("mr", "email")
1020
+ * ```
1021
+ */
1022
+ row(id: string): FlowRowBuilder;
1023
+ /**
1024
+ * Start a new page
1025
+ */
1026
+ page(id: string, label: string, description?: string): FlowPageBuilder;
1027
+ /**
1028
+ * Build the final flow definition
1029
+ */
1030
+ build(): FlowDefinition;
1031
+ /** @internal */
1032
+ _finalizeRow(row: FlowRow): this;
1033
+ /** @internal */
1034
+ _getFlow(): FlowBuilder;
1035
+ /** @internal */
1036
+ _getPageData(): FlowPage;
1037
+ }
1038
+ /**
1039
+ * Fluent builder for creating FlowDefinition with validation
1040
+ *
1041
+ * @example
1042
+ * ```typescript
1043
+ * const COUPLE_FLOW = flow("couple-creation", "Création Couple")
1044
+ * .description("Create a couple with company")
1045
+ * .slot("mr", "contacts", "Monsieur", { color: "blue" })
1046
+ * .slot("mme", "contacts", "Madame", { color: "pink" })
1047
+ * .slot("company", "companies", "Entreprise", { color: "green" })
1048
+ * .relation("mr", "company", "company")
1049
+ * .relation("mme", "company", "company")
1050
+ * .page("identity", "Identité")
1051
+ * .row("mr-name")
1052
+ * .field("mr", "firstName")
1053
+ * .field("mr", "lastName")
1054
+ * .row("mme-name")
1055
+ * .field("mme", "firstName")
1056
+ * .field("mme", "lastName")
1057
+ * .page("company", "Entreprise")
1058
+ * .row("company-name")
1059
+ * .field("company", "name")
1060
+ * .row("company-siret")
1061
+ * .field("company", "siret")
1062
+ * .build();
1063
+ * ```
1064
+ */
1065
+ declare class FlowBuilder {
1066
+ private data;
1067
+ constructor(name: string, label: string);
1068
+ /**
1069
+ * Set flow description
1070
+ */
1071
+ description(value: string): this;
1072
+ /**
1073
+ * Set flow icon
1074
+ */
1075
+ icon(value: IconName): this;
1076
+ /**
1077
+ * Set extensible metadata
1078
+ */
1079
+ metadata(value: Record<string, unknown>): this;
1080
+ /**
1081
+ * Add a slot (object to create in the flow)
1082
+ *
1083
+ * @param id - Unique slot identifier (used to reference in fields and relations)
1084
+ * @param objectName - Name of the object to create
1085
+ * @param label - Display label for the slot
1086
+ * @param options - Optional slot configuration
1087
+ *
1088
+ * @example
1089
+ * ```typescript
1090
+ * .slot("mr", "contacts", "Monsieur", { color: "blue", icon: "user" })
1091
+ * .slot("company", "companies", "Entreprise", { color: "green" })
1092
+ * ```
1093
+ */
1094
+ slot(id: string, objectName: string, label: string, options?: {
1095
+ color?: ColorId;
1096
+ icon?: IconName;
1097
+ }): this;
1098
+ /**
1099
+ * Define a relation between two slots
1100
+ * The source slot will be linked to the target slot via the specified attribute
1101
+ *
1102
+ * @param sourceSlotId - Slot that has the relation attribute
1103
+ * @param sourceAttribute - Relation attribute name on the source
1104
+ * @param targetSlotId - Target slot to link to
1105
+ *
1106
+ * @example
1107
+ * ```typescript
1108
+ * // mr.company → company (the contact's company field will be set to the created company)
1109
+ * .relation("mr", "company", "company")
1110
+ * ```
1111
+ */
1112
+ relation(sourceSlotId: string, sourceAttribute: string, targetSlotId: string): this;
1113
+ /**
1114
+ * Start a new page/step in the flow
1115
+ *
1116
+ * @param id - Unique page identifier
1117
+ * @param label - Display label
1118
+ * @param description - Optional description
1119
+ *
1120
+ * @example
1121
+ * ```typescript
1122
+ * .page("identity", "Identité", "Informations personnelles")
1123
+ * .row("name")
1124
+ * .field("mr", "firstName")
1125
+ * .field("mr", "lastName")
1126
+ * ```
1127
+ */
1128
+ page(id: string, label: string, description?: string): FlowPageBuilder;
1129
+ /**
1130
+ * Build and validate the flow definition
1131
+ *
1132
+ * @throws Error if validation fails
1133
+ */
1134
+ build(): FlowDefinition;
1135
+ /**
1136
+ * Validate that required data is present
1137
+ */
1138
+ private validateRequiredData;
1139
+ /**
1140
+ * Validate that all field slotId references exist
1141
+ */
1142
+ private validateFieldReferences;
1143
+ /**
1144
+ * Validate that all relation references exist and are valid
1145
+ */
1146
+ private validateRelationReferences;
1147
+ /**
1148
+ * @internal Used by FlowPageBuilder to finalize a page
1149
+ */
1150
+ _finalizePage(page: FlowPage): this;
1151
+ /**
1152
+ * Validate flow name format (kebab-case)
1153
+ */
1154
+ private validateName;
1155
+ /**
1156
+ * Validate that there are no circular dependencies in relations
1157
+ * Uses DFS to detect cycles in the dependency graph
1158
+ */
1159
+ private validateNoCircularDependencies;
1160
+ }
1161
+ /**
1162
+ * Create a new flow builder
1163
+ *
1164
+ * @param name - Flow name (kebab-case)
1165
+ * @param label - Display label
1166
+ *
1167
+ * @example
1168
+ * ```typescript
1169
+ * const COUPLE_FLOW = flow("couple-creation", "Création Couple")
1170
+ * .slot("mr", "contacts", "Monsieur")
1171
+ * .slot("mme", "contacts", "Madame")
1172
+ * .page("identity", "Identité")
1173
+ * .row("mr-name")
1174
+ * .field("mr", "firstName")
1175
+ * .field("mr", "lastName")
1176
+ * .row("mme-name")
1177
+ * .field("mme", "firstName")
1178
+ * .field("mme", "lastName")
1179
+ * .build();
1180
+ * ```
1181
+ */
1182
+ declare function flow(name: string, label: string): FlowBuilder;
1183
+
920
1184
  /**
921
1185
  * Extract attribute info from a builder instance
922
1186
  */
@@ -1397,4 +1661,4 @@ declare function view(name: string, label: string): ViewBuilder;
1397
1661
  */
1398
1662
  declare function group(id: string, label: string): GroupBuilder;
1399
1663
 
1400
- export { ALL_SYSTEM_RESOURCES, type AddAttribute$1 as AddAttribute, type AnyAttributeBuilder, Attribute, AttributeGroupField, AttributeInUseError, type AttributeMap, AttributeNotFoundError, type AttributeSchema, type AttributeUsage, type BuilderConfig, CheckboxAttribute, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DuplicateError, type ExtractAttributeName, type ExtractAttributeRequired, type ExtractAttributes, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, Field, FileAttribute, FileNotFoundError, ForbiddenError, Group, GroupBuilder, type InferAttributeValue, type InferRecord, type InferRecordFromSchema, type InferRecordInput, type InferRecordUpdate, type InferRecordWithRequirements, Location, LocationAttribute, MultiRelationAttribute, MultiselectAttribute, NotFoundError, NotSystemObjectError, NumberAttribute, ObjectAction, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, ObjectReferencedError, Option, Phone, PhoneAttribute, ProtectedResourceError, ProtectedRoleError, RatingAttribute, RecordNotFoundError, type RecordReference, RecordReferencedError, RelationTarget, RoleNotFoundError, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, SelectAttribute, SingleRelationAttribute, StatusAttribute, SyncError, SystemAction, SystemResource, Tab, TabBuilder, TableTabConfig, TextAreaAttribute, TextAttribute, TimestampAttribute, type TypedAttribute, type TypedBuilderConfig, UserAttribute, UserProfileNotFoundError, ValidationError, type ValidationErrorDetail, ViewBuilder, ViewDefinition, type WithCustomAttributes, checkbox, currency, date, file, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isValidationError, location, multiselect, number, object, phone, rating, relation, select, status, text, textarea, timestamp, user, view };
1664
+ export { ALL_SYSTEM_RESOURCES, type AddAttribute$1 as AddAttribute, type AnyAttributeBuilder, Attribute, AttributeGroupField, AttributeInUseError, type AttributeMap, AttributeNotFoundError, type AttributeSchema, type AttributeUsage, type BuilderConfig, CheckboxAttribute, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type ExtractAttributeName, type ExtractAttributeRequired, type ExtractAttributes, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, Field, FileAttribute, FileNotFoundError, FlowBuilder, FlowDefinition, FlowPage, FlowPageBuilder, FlowRow, FlowRowBuilder, ForbiddenError, Group, GroupBuilder, type InferAttributeValue, type InferRecord, type InferRecordFromSchema, type InferRecordInput, type InferRecordUpdate, type InferRecordWithRequirements, Location, LocationAttribute, MultiRelationAttribute, MultiselectAttribute, NotFoundError, NotSystemObjectError, NumberAttribute, ObjectAction, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, ObjectReferencedError, Option, Phone, PhoneAttribute, ProtectedResourceError, ProtectedRoleError, RatingAttribute, RecordNotFoundError, type RecordReference, RecordReferencedError, RelationTarget, RoleNotFoundError, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, SelectAttribute, SingleRelationAttribute, StatusAttribute, SyncError, SystemAction, SystemResource, Tab, TabBuilder, TableTabConfig, TextAreaAttribute, TextAttribute, TimestampAttribute, type TypedAttribute, type TypedBuilderConfig, UserAttribute, UserProfileNotFoundError, ValidationError, type ValidationErrorDetail, ViewBuilder, ViewDefinition, type WithCustomAttributes, checkbox, currency, date, file, flow, formatAttributeValue, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isValidationError, location, multiselect, number, object, phone, rating, relation, select, status, text, textarea, timestamp, user, view };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { A as Attribute, S as StatusAttribute, a as SelectAttribute, M as MultiselectAttribute, P as Phone, C as Currency, L as Location, b as SystemResource, c as SystemAction, O as ObjectAction, T as TextAttribute, d as TextAreaAttribute, N as NumberAttribute, e as CheckboxAttribute, D as DateAttribute, f as PhoneAttribute, g as CurrencyAttribute, h as Option, i as LocationAttribute, j as TimestampAttribute, F as FileAttribute, U as UserAttribute, k as SingleRelationAttribute, l as MultiRelationAttribute, R as RelationTarget, m as RatingAttribute, n as ObjectDefinition, o as Field, p as AttributeGroupField, G as Group, V as ViewDefinition, q as Tab } from './runtime-DUxWyRcq.js';
2
- export { cf as AddAttributeInput, ak as AdvancedFilterState, aP as AssignRoleInput, bV as AttributeChange, t as AttributeGroup, r as AttributeType, c2 as AttributesRepository, K as AuditAction, Q as AuditActorType, W as AuditChange, Z as AuditListOptions, X as AuditLogEntry, c7 as AuditRepository, J as AuditResourceType, ca as AuditService, _ as AuditServiceOptions, B as BaseAttribute, a6 as CheckboxFilterOperator, aD as CompletionStatus, Y as CreateAuditLogInput, ce as CreateCustomObjectInput, cP as CreateDBAttribute, cL as CreateDBObject, cZ as CreateDBView, a2 as CreateFile, cS as CreateObjectRecord, aO as CreatePermissionInput, aM as CreateRoleInput, aT as CreateUserProfile, cv as CreateViewInput, ad as CurrencyFilterValue, aY as CustomTab, cO as DBAttribute, cK as DBObject, cY as DBView, cG as DEFAULT_LABEL_FALLBACK, bU as DatabaseAdapter, a7 as DateFilterOperator, v as DateFormat, w as DateValue, z as DocumentFace, y as DocumentType, E as DocumentTypeConfig, aJ as EffectivePermissions, a1 as File, cX as FileListOptions, cb as FileService, H as FileVerificationConfig, a0 as FileVisibility, c4 as FilesRepository, ah as FilterCombinator, aj as FilterGroup, ab as FilterOperator, ag as FilterRule, ai as FilterState, af as FilterValue, aW as FormTab, cE as FullSyncOptions, cD as FullSyncResult, az as GeocodingAdapter, aw as GeocodingAutocompleteParams, ay as GeocodingParams, cc as GeocodingService, av as GeocodingSuggestion, cr as GetRelationOptionsParams, cV as GlobalSearchOptions, cW as GlobalSearchResultItem, cd as GlobalSearchService, bW as HookContext, bX as HookDefinition, bY as HookHandler, b$ as HookRegistry, bZ as HookType, cT as ListOptions, x as LocationGranularity, a9 as MultiselectFilterOperator, at as NO_VALUE_OPERATORS, as as NoValueOperator, aA as NoopGeocodingAdapter, b_ as NoopHookRegistry, a5 as NumberFilterOperator, u as NumberUnit, ar as OPERATORS_BY_TYPE, aC as ObjectAttribute, aK as ObjectPermissions, aE as ObjectRecord, c5 as ObjectRecordsRepository, ci as ObjectSchemaService, ch as ObjectSchemaServiceOptions, c1 as ObjectsRepository, d0 as OperationResult, aH as Permission, aF as PermissionScope, ck as PermissionService, cj as PermissionServiceOptions, c8 as PermissionsRepository, ae as PhoneFilterValue, aq as QueryState, cm as RecordService, cl as RecordServiceOptions, I as RelationAttribute, aa as RelationFilterOperator, cp as RelationOption, cq as RelationOptionsResponse, cs as RelationService, co as RelationValidationError, cn as RelationValidationResult, ac as RelativeDateValue, ax as ReverseGeocodingParams, aG as Role, cU as SearchOptions, a8 as SelectFilterOperator, ao as SortDirection, ap as SortRule, s as StatusGroup, $ as StorageProvider, cz as SyncOptions, cy as SyncResult, aL as SystemPermissions, aV as TabType, aX as TableTab, b1 as TenantId, a4 as TextFilterOperator, aB as Timestamps, cQ as UpdateDBAttribute, cM as UpdateDBObject, c_ as UpdateDBView, a3 as UpdateFile, cg as UpdateObjectInput, aN as UpdateRoleInput, aU as UpdateUserProfile, cw as UpdateViewInput, cR as UpsertDBAttribute, cN as UpsertDBObject, c$ as UpsertDBView, aS as UserProfile, cu as UserProfileService, ct as UserProfileServiceOptions, c3 as UserProfilesRepository, aQ as UserRole, aI as UserRoleAssignment, aR as UserStatus, b0 as Uuid, bK as ValidationResult, cx as ViewService, d2 as ViewSyncOptions, d1 as ViewSyncResult, c6 as ViewsRepository, bm as attributeConfigSchemas, c9 as buildAuditChanges, b9 as checkboxConfigSchema, bT as computeRecordStatus, bI as createAttributeValidator, bt as createCheckboxValidator, bw as createCurrencyValidator, bu as createDateValidator, bO as createDraftValidator, bC as createFileValidator, bA as createLocationValidator, c0 as createMockAdapter, bF as createMultiRelationValidator, bz as createMultiselectValidator, bs as createNumberValidator, bJ as createObjectValidator, bv as createPhoneValidator, bH as createRatingValidator, bG as createRelationValidator, by as createSelectValidator, bE as createSingleRelationValidator, bx as createStatusValidator, br as createTextValidator, bB as createTimestampValidator, bD as createUserValidator, bc as currencyConfigSchema, ba as dateConfigSchema, cJ as extractAttributeNames, bi as fileConfigSchema, b2 as generateId, b3 as generatePrefixedId, bn as getAttributeConfigSchema, bR as getMissingRequiredAttributes, cC as getSyncPreview, d5 as getViewSyncPreview, al as isAdvancedFilterState, a$ as isCustomTab, aZ as isFormTab, cI as isLabelExpression, au as isNoValueOperator, bS as isRecordComplete, a_ as isTableTab, be as locationConfigSchema, bh as multiselectConfigSchema, b8 as numberConfigSchema, bp as parseAttributeConfig, bb as phoneConfigSchema, bl as ratingConfigSchema, b4 as registry, bk as relationConfigSchema, cH as renderLabelExpression, bq as safeParseAttributeConfig, bg as selectConfigSchema, bd as statusConfigSchema, cF as syncAll, cA as syncNativeObjects, d3 as syncNativeViews, b6 as textConfigSchema, b7 as textareaConfigSchema, bf as timestampConfigSchema, am as toAdvancedFilterState, an as toSimpleFilterState, bj as userConfigSchema, bL as validateAttribute, bo as validateAttributeConfig, bP as validateDraft, bQ as validateDraftOrThrow, bM as validateObject, bN as validateObjectOrThrow, cB as verifyNativeObjectsSync, d4 as verifyNativeViewsSync, b5 as viewRegistry } from './runtime-DUxWyRcq.js';
3
- import { IconName, CountryIso3, CurrencyCode, MimeType } from '@stndrds/constants';
1
+ import { A as Attribute, S as StatusAttribute, a as SelectAttribute, M as MultiselectAttribute, P as Phone, C as Currency, L as Location, b as SystemResource, c as SystemAction, O as ObjectAction, T as TextAttribute, d as TextAreaAttribute, N as NumberAttribute, e as CheckboxAttribute, D as DateAttribute, f as PhoneAttribute, g as CurrencyAttribute, h as Option, i as LocationAttribute, j as TimestampAttribute, F as FileAttribute, U as UserAttribute, k as SingleRelationAttribute, l as MultiRelationAttribute, R as RelationTarget, m as RatingAttribute, n as FlowDefinition, o as FlowPage, p as FlowRow, q as ObjectDefinition, r as Field, s as AttributeGroupField, G as Group, V as ViewDefinition, t as Tab } from './runtime--rp-TG-h.js';
2
+ export { b7 as ActivityTab, cv as AddAttributeInput, an as AdvancedFilterState, aZ as AssignRoleInput, c5 as AttributeChange, w as AttributeGroup, u as AttributeType, ce as AttributesRepository, X as AuditAction, Y as AuditActorType, Z as AuditChange, a0 as AuditListOptions, _ as AuditLogEntry, ck as AuditRepository, W as AuditResourceType, cn as AuditService, a1 as AuditServiceOptions, B as BaseAttribute, a9 as CheckboxFilterOperator, aN as CompletionStatus, $ as CreateAuditLogInput, cu as CreateCustomObjectInput, d4 as CreateDBAttribute, di as CreateDBFlow, d0 as CreateDBObject, de as CreateDBView, a5 as CreateFile, cp as CreateFlowInput, d7 as CreateObjectRecord, aY as CreatePermissionInput, aW as CreateRoleInput, b1 as CreateUserProfile, cL as CreateViewInput, ag as CurrencyFilterValue, b6 as CustomTab, d3 as DBAttribute, dh as DBFlow, c$ as DBObject, dd as DBView, cW as DEFAULT_LABEL_FALLBACK, c4 as DatabaseAdapter, aa as DateFilterOperator, y as DateFormat, z as DateValue, I as DocumentFace, H as DocumentType, J as DocumentTypeConfig, aT as EffectivePermissions, a4 as File, dc as FileListOptions, co as FileService, K as FileVerificationConfig, a3 as FileVisibility, cg as FilesRepository, ak as FilterCombinator, am as FilterGroup, ae as FilterOperator, aj as FilterRule, al as FilterState, ai as FilterValue, aA as FlowRelation, az as FlowRowField, cr as FlowService, ay as FlowSlot, aB as FlowStatus, cj as FlowsRepository, b4 as FormTab, cU as FullSyncOptions, cT as FullSyncResult, aJ as GeocodingAdapter, aG as GeocodingAutocompleteParams, aI as GeocodingParams, cs as GeocodingService, aF as GeocodingSuggestion, cH as GetRelationOptionsParams, da as GlobalSearchOptions, db as GlobalSearchResultItem, ct as GlobalSearchService, c6 as HookContext, c7 as HookDefinition, c8 as HookHandler, cb as HookRegistry, c9 as HookType, d8 as ListOptions, E as LocationGranularity, ac as MultiselectFilterOperator, aw as NO_VALUE_OPERATORS, av as NoValueOperator, aK as NoopGeocodingAdapter, ca as NoopHookRegistry, a8 as NumberFilterOperator, x as NumberUnit, au as OPERATORS_BY_TYPE, aM as ObjectAttribute, aU as ObjectPermissions, aO as ObjectRecord, ch as ObjectRecordsRepository, cy as ObjectSchemaService, cx as ObjectSchemaServiceOptions, cd as ObjectsRepository, dk as OperationResult, aR as Permission, aP as PermissionScope, cA as PermissionService, cz as PermissionServiceOptions, cl as PermissionsRepository, ah as PhoneFilterValue, at as QueryState, cC as RecordService, cB as RecordServiceOptions, Q as RelationAttribute, ad as RelationFilterOperator, cF as RelationOption, cG as RelationOptionsResponse, cI as RelationService, cE as RelationValidationError, cD as RelationValidationResult, af as RelativeDateValue, aH as ReverseGeocodingParams, aQ as Role, d9 as SearchOptions, ab as SelectFilterOperator, ar as SortDirection, as as SortRule, v as StatusGroup, a2 as StorageProvider, cP as SyncOptions, cO as SyncResult, aV as SystemPermissions, b3 as TabType, b5 as TableTab, bd as TenantId, a7 as TextFilterOperator, aL as Timestamps, d5 as UpdateDBAttribute, dj as UpdateDBFlow, d1 as UpdateDBObject, df as UpdateDBView, a6 as UpdateFile, cq as UpdateFlowInput, cw as UpdateObjectInput, aX as UpdateRoleInput, b2 as UpdateUserProfile, cM as UpdateViewInput, d6 as UpsertDBAttribute, d2 as UpsertDBObject, dg as UpsertDBView, b0 as UserProfile, cK as UserProfileService, cJ as UserProfileServiceOptions, cf as UserProfilesRepository, a_ as UserRole, aS as UserRoleAssignment, a$ as UserStatus, bc as Uuid, bW as ValidationResult, cN as ViewService, dm as ViewSyncOptions, dl as ViewSyncResult, ci as ViewsRepository, by as attributeConfigSchemas, cm as buildAuditChanges, bl as checkboxConfigSchema, c3 as computeRecordStatus, bU as createAttributeValidator, bF as createCheckboxValidator, bI as createCurrencyValidator, bG as createDateValidator, b_ as createDraftValidator, bO as createFileValidator, bM as createLocationValidator, cc as createMockAdapter, bR as createMultiRelationValidator, bL as createMultiselectValidator, bE as createNumberValidator, bV as createObjectValidator, bH as createPhoneValidator, bT as createRatingValidator, bS as createRelationValidator, bK as createSelectValidator, bQ as createSingleRelationValidator, bJ as createStatusValidator, bD as createTextValidator, bN as createTimestampValidator, bP as createUserValidator, bo as currencyConfigSchema, bm as dateConfigSchema, c_ as enrichValuesWithSelectLabels, cZ as extractAttributeNames, bu as fileConfigSchema, be as generateId, bf as generatePrefixedId, bz as getAttributeConfigSchema, c1 as getMissingRequiredAttributes, cS as getSyncPreview, dq as getViewSyncPreview, bb as isActivityTab, ao as isAdvancedFilterState, ba as isCustomTab, aC as isFlowDefinition, aD as isFlowPublished, b8 as isFormTab, cY as isLabelExpression, ax as isNoValueOperator, c2 as isRecordComplete, aE as isSystemFlow, b9 as isTableTab, bq as locationConfigSchema, bt as multiselectConfigSchema, bk as numberConfigSchema, bB as parseAttributeConfig, bn as phoneConfigSchema, bx as ratingConfigSchema, bg as registry, bw as relationConfigSchema, cX as renderLabelExpression, bC as safeParseAttributeConfig, bs as selectConfigSchema, bp as statusConfigSchema, cV as syncAll, cQ as syncNativeObjects, dn as syncNativeViews, bi as textConfigSchema, bj as textareaConfigSchema, br as timestampConfigSchema, ap as toAdvancedFilterState, aq as toSimpleFilterState, bv as userConfigSchema, bX as validateAttribute, bA as validateAttributeConfig, b$ as validateDraft, c0 as validateDraftOrThrow, bY as validateObject, bZ as validateObjectOrThrow, cR as verifyNativeObjectsSync, dp as verifyNativeViewsSync, bh as viewRegistry } from './runtime--rp-TG-h.js';
3
+ import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
4
4
  import 'zod';
5
5
 
6
6
  /**
@@ -300,6 +300,45 @@ type ExtractAttributes<TBuilder> = TBuilder extends {
300
300
  };
301
301
  } ? A : never;
302
302
 
303
+ /**
304
+ * Default empty value placeholder
305
+ */
306
+ declare const EMPTY_VALUE_PLACEHOLDER = "\u2014";
307
+ /**
308
+ * Format an attribute value for display
309
+ *
310
+ * This function converts raw attribute values into human-readable strings
311
+ * based on the attribute type and configuration.
312
+ *
313
+ * @param value - The raw value to format
314
+ * @param attribute - The attribute definition
315
+ * @returns Formatted string representation
316
+ *
317
+ * @example
318
+ * ```typescript
319
+ * // Text attribute
320
+ * formatAttributeValue("Hello", textAttr);
321
+ * // → "Hello"
322
+ *
323
+ * // Currency attribute
324
+ * formatAttributeValue({ value: 1500, code: "EUR" }, currencyAttr);
325
+ * // → "1,500.00 EUR"
326
+ *
327
+ * // Select attribute with options
328
+ * formatAttributeValue("active", statusAttr);
329
+ * // → "Active" (label from options)
330
+ *
331
+ * // Location with city granularity
332
+ * formatAttributeValue({ city: "Paris", country: "FRA" }, locationAttr);
333
+ * // → "Paris, FRA"
334
+ *
335
+ * // Empty value
336
+ * formatAttributeValue(null, textAttr);
337
+ * // → "—"
338
+ * ```
339
+ */
340
+ declare function formatAttributeValue(value: unknown, attribute: Attribute): string;
341
+
303
342
  /**
304
343
  * System resources that can be managed through permissions.
305
344
  */
@@ -917,6 +956,231 @@ type ExtractAttributeRequired<T> = T extends {
917
956
  };
918
957
  } ? R : false;
919
958
 
959
+ /**
960
+ * Builder for creating flow rows with fields
961
+ */
962
+ declare class FlowRowBuilder {
963
+ private pageBuilder;
964
+ private rowData;
965
+ /** @internal */
966
+ constructor(pageBuilder: FlowPageBuilder, id: string, order: number);
967
+ /**
968
+ * Add a field to the current row
969
+ *
970
+ * @param slotId - Reference to a slot defined with .slot()
971
+ * @param attribute - Attribute name on the object
972
+ * @param options - Optional field configuration
973
+ *
974
+ * @example
975
+ * ```typescript
976
+ * .row("row-1")
977
+ * .field("mr", "firstName")
978
+ * .field("mr", "lastName")
979
+ * ```
980
+ */
981
+ field(slotId: string, attribute: string, options?: {
982
+ label?: string;
983
+ required?: boolean;
984
+ }): this;
985
+ /**
986
+ * Start a new row on the same page
987
+ */
988
+ row(id: string): FlowRowBuilder;
989
+ /**
990
+ * Start a new page
991
+ */
992
+ page(id: string, label: string, description?: string): FlowPageBuilder;
993
+ /**
994
+ * Build the final flow definition
995
+ */
996
+ build(): FlowDefinition;
997
+ }
998
+ /**
999
+ * Builder for creating flow pages with rows
1000
+ */
1001
+ declare class FlowPageBuilder {
1002
+ private flow;
1003
+ private pageData;
1004
+ private rowOrder;
1005
+ /** @internal */
1006
+ constructor(flow: FlowBuilder, id: string, label: string, description?: string);
1007
+ /**
1008
+ * Add a row to the current page
1009
+ *
1010
+ * @param id - Unique row identifier
1011
+ *
1012
+ * @example
1013
+ * ```typescript
1014
+ * .page("identity", "Identité")
1015
+ * .row("name-row")
1016
+ * .field("mr", "firstName")
1017
+ * .field("mr", "lastName")
1018
+ * .row("email-row")
1019
+ * .field("mr", "email")
1020
+ * ```
1021
+ */
1022
+ row(id: string): FlowRowBuilder;
1023
+ /**
1024
+ * Start a new page
1025
+ */
1026
+ page(id: string, label: string, description?: string): FlowPageBuilder;
1027
+ /**
1028
+ * Build the final flow definition
1029
+ */
1030
+ build(): FlowDefinition;
1031
+ /** @internal */
1032
+ _finalizeRow(row: FlowRow): this;
1033
+ /** @internal */
1034
+ _getFlow(): FlowBuilder;
1035
+ /** @internal */
1036
+ _getPageData(): FlowPage;
1037
+ }
1038
+ /**
1039
+ * Fluent builder for creating FlowDefinition with validation
1040
+ *
1041
+ * @example
1042
+ * ```typescript
1043
+ * const COUPLE_FLOW = flow("couple-creation", "Création Couple")
1044
+ * .description("Create a couple with company")
1045
+ * .slot("mr", "contacts", "Monsieur", { color: "blue" })
1046
+ * .slot("mme", "contacts", "Madame", { color: "pink" })
1047
+ * .slot("company", "companies", "Entreprise", { color: "green" })
1048
+ * .relation("mr", "company", "company")
1049
+ * .relation("mme", "company", "company")
1050
+ * .page("identity", "Identité")
1051
+ * .row("mr-name")
1052
+ * .field("mr", "firstName")
1053
+ * .field("mr", "lastName")
1054
+ * .row("mme-name")
1055
+ * .field("mme", "firstName")
1056
+ * .field("mme", "lastName")
1057
+ * .page("company", "Entreprise")
1058
+ * .row("company-name")
1059
+ * .field("company", "name")
1060
+ * .row("company-siret")
1061
+ * .field("company", "siret")
1062
+ * .build();
1063
+ * ```
1064
+ */
1065
+ declare class FlowBuilder {
1066
+ private data;
1067
+ constructor(name: string, label: string);
1068
+ /**
1069
+ * Set flow description
1070
+ */
1071
+ description(value: string): this;
1072
+ /**
1073
+ * Set flow icon
1074
+ */
1075
+ icon(value: IconName): this;
1076
+ /**
1077
+ * Set extensible metadata
1078
+ */
1079
+ metadata(value: Record<string, unknown>): this;
1080
+ /**
1081
+ * Add a slot (object to create in the flow)
1082
+ *
1083
+ * @param id - Unique slot identifier (used to reference in fields and relations)
1084
+ * @param objectName - Name of the object to create
1085
+ * @param label - Display label for the slot
1086
+ * @param options - Optional slot configuration
1087
+ *
1088
+ * @example
1089
+ * ```typescript
1090
+ * .slot("mr", "contacts", "Monsieur", { color: "blue", icon: "user" })
1091
+ * .slot("company", "companies", "Entreprise", { color: "green" })
1092
+ * ```
1093
+ */
1094
+ slot(id: string, objectName: string, label: string, options?: {
1095
+ color?: ColorId;
1096
+ icon?: IconName;
1097
+ }): this;
1098
+ /**
1099
+ * Define a relation between two slots
1100
+ * The source slot will be linked to the target slot via the specified attribute
1101
+ *
1102
+ * @param sourceSlotId - Slot that has the relation attribute
1103
+ * @param sourceAttribute - Relation attribute name on the source
1104
+ * @param targetSlotId - Target slot to link to
1105
+ *
1106
+ * @example
1107
+ * ```typescript
1108
+ * // mr.company → company (the contact's company field will be set to the created company)
1109
+ * .relation("mr", "company", "company")
1110
+ * ```
1111
+ */
1112
+ relation(sourceSlotId: string, sourceAttribute: string, targetSlotId: string): this;
1113
+ /**
1114
+ * Start a new page/step in the flow
1115
+ *
1116
+ * @param id - Unique page identifier
1117
+ * @param label - Display label
1118
+ * @param description - Optional description
1119
+ *
1120
+ * @example
1121
+ * ```typescript
1122
+ * .page("identity", "Identité", "Informations personnelles")
1123
+ * .row("name")
1124
+ * .field("mr", "firstName")
1125
+ * .field("mr", "lastName")
1126
+ * ```
1127
+ */
1128
+ page(id: string, label: string, description?: string): FlowPageBuilder;
1129
+ /**
1130
+ * Build and validate the flow definition
1131
+ *
1132
+ * @throws Error if validation fails
1133
+ */
1134
+ build(): FlowDefinition;
1135
+ /**
1136
+ * Validate that required data is present
1137
+ */
1138
+ private validateRequiredData;
1139
+ /**
1140
+ * Validate that all field slotId references exist
1141
+ */
1142
+ private validateFieldReferences;
1143
+ /**
1144
+ * Validate that all relation references exist and are valid
1145
+ */
1146
+ private validateRelationReferences;
1147
+ /**
1148
+ * @internal Used by FlowPageBuilder to finalize a page
1149
+ */
1150
+ _finalizePage(page: FlowPage): this;
1151
+ /**
1152
+ * Validate flow name format (kebab-case)
1153
+ */
1154
+ private validateName;
1155
+ /**
1156
+ * Validate that there are no circular dependencies in relations
1157
+ * Uses DFS to detect cycles in the dependency graph
1158
+ */
1159
+ private validateNoCircularDependencies;
1160
+ }
1161
+ /**
1162
+ * Create a new flow builder
1163
+ *
1164
+ * @param name - Flow name (kebab-case)
1165
+ * @param label - Display label
1166
+ *
1167
+ * @example
1168
+ * ```typescript
1169
+ * const COUPLE_FLOW = flow("couple-creation", "Création Couple")
1170
+ * .slot("mr", "contacts", "Monsieur")
1171
+ * .slot("mme", "contacts", "Madame")
1172
+ * .page("identity", "Identité")
1173
+ * .row("mr-name")
1174
+ * .field("mr", "firstName")
1175
+ * .field("mr", "lastName")
1176
+ * .row("mme-name")
1177
+ * .field("mme", "firstName")
1178
+ * .field("mme", "lastName")
1179
+ * .build();
1180
+ * ```
1181
+ */
1182
+ declare function flow(name: string, label: string): FlowBuilder;
1183
+
920
1184
  /**
921
1185
  * Extract attribute info from a builder instance
922
1186
  */
@@ -1397,4 +1661,4 @@ declare function view(name: string, label: string): ViewBuilder;
1397
1661
  */
1398
1662
  declare function group(id: string, label: string): GroupBuilder;
1399
1663
 
1400
- export { ALL_SYSTEM_RESOURCES, type AddAttribute$1 as AddAttribute, type AnyAttributeBuilder, Attribute, AttributeGroupField, AttributeInUseError, type AttributeMap, AttributeNotFoundError, type AttributeSchema, type AttributeUsage, type BuilderConfig, CheckboxAttribute, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DuplicateError, type ExtractAttributeName, type ExtractAttributeRequired, type ExtractAttributes, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, Field, FileAttribute, FileNotFoundError, ForbiddenError, Group, GroupBuilder, type InferAttributeValue, type InferRecord, type InferRecordFromSchema, type InferRecordInput, type InferRecordUpdate, type InferRecordWithRequirements, Location, LocationAttribute, MultiRelationAttribute, MultiselectAttribute, NotFoundError, NotSystemObjectError, NumberAttribute, ObjectAction, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, ObjectReferencedError, Option, Phone, PhoneAttribute, ProtectedResourceError, ProtectedRoleError, RatingAttribute, RecordNotFoundError, type RecordReference, RecordReferencedError, RelationTarget, RoleNotFoundError, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, SelectAttribute, SingleRelationAttribute, StatusAttribute, SyncError, SystemAction, SystemResource, Tab, TabBuilder, TableTabConfig, TextAreaAttribute, TextAttribute, TimestampAttribute, type TypedAttribute, type TypedBuilderConfig, UserAttribute, UserProfileNotFoundError, ValidationError, type ValidationErrorDetail, ViewBuilder, ViewDefinition, type WithCustomAttributes, checkbox, currency, date, file, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isValidationError, location, multiselect, number, object, phone, rating, relation, select, status, text, textarea, timestamp, user, view };
1664
+ export { ALL_SYSTEM_RESOURCES, type AddAttribute$1 as AddAttribute, type AnyAttributeBuilder, Attribute, AttributeGroupField, AttributeInUseError, type AttributeMap, AttributeNotFoundError, type AttributeSchema, type AttributeUsage, type BuilderConfig, CheckboxAttribute, Currency, CurrencyAttribute, type CustomAttributeValue, CustomTabConfig, DEFAULT_ROLES, DEFAULT_ROLE_DESCRIPTIONS, DEFAULT_ROLE_LABELS, DEFAULT_ROLE_PERMISSIONS, DateAttribute, type DefaultRoleName, type DefaultRolePermissionConfig, DuplicateError, EMPTY_VALUE_PLACEHOLDER, type ExtractAttributeName, type ExtractAttributeRequired, type ExtractAttributes, type ExtractRecord, type ExtractRecordInput, type ExtractRecordInputStrict, type ExtractRecordStrict, type ExtractRecordUpdate, type ExtractRecordUpdateStrict, Field, FileAttribute, FileNotFoundError, FlowBuilder, FlowDefinition, FlowPage, FlowPageBuilder, FlowRow, FlowRowBuilder, ForbiddenError, Group, GroupBuilder, type InferAttributeValue, type InferRecord, type InferRecordFromSchema, type InferRecordInput, type InferRecordUpdate, type InferRecordWithRequirements, Location, LocationAttribute, MultiRelationAttribute, MultiselectAttribute, NotFoundError, NotSystemObjectError, NumberAttribute, ObjectAction, ObjectBuilder, ObjectDefinition, ObjectNotFoundError, ObjectReferencedError, Option, Phone, PhoneAttribute, ProtectedResourceError, ProtectedRoleError, RatingAttribute, RecordNotFoundError, type RecordReference, RecordReferencedError, RelationTarget, RoleNotFoundError, SYSTEM_RESOURCES, SYSTEM_RESOURCE_LABELS, SchemaError, SchemaErrorCode, SelectAttribute, SingleRelationAttribute, StatusAttribute, SyncError, SystemAction, SystemResource, Tab, TabBuilder, TableTabConfig, TextAreaAttribute, TextAttribute, TimestampAttribute, type TypedAttribute, type TypedBuilderConfig, UserAttribute, UserProfileNotFoundError, ValidationError, type ValidationErrorDetail, ViewBuilder, ViewDefinition, type WithCustomAttributes, checkbox, currency, date, file, flow, formatAttributeValue, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isValidationError, location, multiselect, number, object, phone, rating, relation, select, status, text, textarea, timestamp, user, view };