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

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 (39) hide show
  1. package/dist/chunk-2PBQNUTS.mjs +7400 -0
  2. package/dist/chunk-4D476S25.mjs +7713 -0
  3. package/dist/chunk-BKOV4XVX.mjs +8816 -0
  4. package/dist/chunk-CWPOGEK2.mjs +7707 -0
  5. package/dist/chunk-DPOXIK3M.mjs +8816 -0
  6. package/dist/chunk-DU2HLOQH.mjs +8813 -0
  7. package/dist/chunk-EWNSOD22.mjs +7707 -0
  8. package/dist/chunk-JD2MVLTW.mjs +8814 -0
  9. package/dist/chunk-KZSM5546.mjs +7706 -0
  10. package/dist/chunk-L7AQ7SZC.mjs +7432 -0
  11. package/dist/chunk-LZW2MI43.mjs +7404 -0
  12. package/dist/chunk-SD2UXOSF.mjs +8814 -0
  13. package/dist/chunk-V5QXU2OK.mjs +82 -0
  14. package/dist/chunk-XMGMXAHW.mjs +7706 -0
  15. package/dist/chunk-YLVZT3H4.mjs +8793 -0
  16. package/dist/default-roles-AKWIWTLE.mjs +20 -0
  17. package/dist/index.d.mts +127 -8
  18. package/dist/index.d.ts +127 -8
  19. package/dist/index.js +1787 -182
  20. package/dist/index.mjs +90 -3
  21. package/dist/runtime-CPggQqoW.d.mts +6428 -0
  22. package/dist/runtime-CPggQqoW.d.ts +6428 -0
  23. package/dist/runtime-DSMMZRLE.d.mts +6430 -0
  24. package/dist/runtime-DSMMZRLE.d.ts +6430 -0
  25. package/dist/runtime-DWhSpnn4.d.mts +5256 -0
  26. package/dist/runtime-DWhSpnn4.d.ts +5256 -0
  27. package/dist/runtime-Dw2exb5q.d.mts +5601 -0
  28. package/dist/runtime-Dw2exb5q.d.ts +5601 -0
  29. package/dist/runtime-DySuNV6Y.d.mts +5245 -0
  30. package/dist/runtime-DySuNV6Y.d.ts +5245 -0
  31. package/dist/runtime-DzdsFCyL.d.mts +5601 -0
  32. package/dist/runtime-DzdsFCyL.d.ts +5601 -0
  33. package/dist/runtime-uXhTgSIx.d.mts +5260 -0
  34. package/dist/runtime-uXhTgSIx.d.ts +5260 -0
  35. package/dist/runtime.d.mts +1 -1
  36. package/dist/runtime.d.ts +1 -1
  37. package/dist/runtime.js +1520 -59
  38. package/dist/runtime.mjs +59 -1
  39. package/package.json +4 -3
@@ -0,0 +1,20 @@
1
+ import {
2
+ ALL_SYSTEM_RESOURCES,
3
+ DEFAULT_ROLES,
4
+ DEFAULT_ROLE_DESCRIPTIONS,
5
+ DEFAULT_ROLE_LABELS,
6
+ DEFAULT_ROLE_PERMISSIONS,
7
+ SYSTEM_RESOURCES,
8
+ SYSTEM_RESOURCE_LABELS,
9
+ isDefaultRole
10
+ } from "./chunk-V5QXU2OK.mjs";
11
+ export {
12
+ ALL_SYSTEM_RESOURCES,
13
+ DEFAULT_ROLES,
14
+ DEFAULT_ROLE_DESCRIPTIONS,
15
+ DEFAULT_ROLE_LABELS,
16
+ DEFAULT_ROLE_PERMISSIONS,
17
+ SYSTEM_RESOURCES,
18
+ SYSTEM_RESOURCE_LABELS,
19
+ isDefaultRole
20
+ };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
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';
1
+ import { A as Attribute, S as StatusAttribute, a as SelectAttribute, M as MultiselectAttribute, P as Phone, C as Currency, L as Location, F as FormulaAttribute, R as RollupAttribute, 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, k as FileAttribute, U as UserAttribute, l as SingleRelationAttribute, m as MultiRelationAttribute, n as RelationTarget, o as RatingAttribute, p as FormulaReturnType, q as RollupFunction, r as FlowDefinition, s as FlowPage, t as FlowRow, u as ObjectDefinition, v as Field, w as AttributeGroupField, G as Group, V as ViewDefinition, x as Tab } from './runtime-DSMMZRLE.mjs';
2
+ export { bb as ActivityTab, d9 as AddAttributeInput, ar as AdvancedFilterState, b1 as AssignRoleInput, cH as AttributeChange, B as AttributeGroup, y as AttributeType, cT as AttributesRepository, $ as AuditAction, a0 as AuditActorType, a1 as AuditChange, a4 as AuditListOptions, a2 as AuditLogEntry, cZ as AuditRepository, _ as AuditResourceType, d0 as AuditService, a5 as AuditServiceOptions, E as BaseAttribute, ad as CheckboxFilterOperator, aR as CompletionStatus, a3 as CreateAuditLogInput, d8 as CreateCustomObjectInput, d_ as CreateDBAttribute, ec as CreateDBFlow, dW as CreateDBObject, e8 as CreateDBView, a9 as CreateFile, d3 as CreateFlowInput, e1 as CreateObjectRecord, b0 as CreatePermissionInput, a_ as CreateRoleInput, b5 as CreateUserProfile, dz as CreateViewInput, ak as CurrencyFilterValue, ba as CustomTab, dZ as DBAttribute, eb as DBFlow, dV as DBObject, e7 as DBView, dQ as DEFAULT_LABEL_FALLBACK, cc as DatabaseAdapter, ae as DateFilterOperator, I as DateFormat, J as DateValue, W as DocumentFace, Q as DocumentType, X as DocumentTypeConfig, aX as EffectivePermissions, a8 as File, dC as FileContent, e6 as FileListOptions, d2 as FileService, d1 as FileServiceOptions, Y as FileVerificationConfig, a7 as FileVisibility, cV as FilesRepository, ao as FilterCombinator, aq as FilterGroup, ai as FilterOperator, an as FilterRule, ap as FilterState, am as FilterValue, aE as FlowRelation, aD as FlowRowField, d5 as FlowService, aC as FlowSlot, aF as FlowStatus, cY as FlowsRepository, b8 as FormTab, cp as FormulaResult, dO as FullSyncOptions, dN as FullSyncResult, aN as GeocodingAdapter, aK as GeocodingAutocompleteParams, aM as GeocodingParams, d6 as GeocodingService, aJ as GeocodingSuggestion, dl as GetRelationOptionsParams, e4 as GlobalSearchOptions, e5 as GlobalSearchResultItem, d7 as GlobalSearchService, cI as HookContext, cJ as HookDefinition, cK as HookHandler, cN as HookRegistry, cL as HookType, ct as InvalidPathError, e2 as ListOptions, K as LocationGranularity, cu as MaxDepthExceededError, ag as MultiselectFilterOperator, aA as NO_VALUE_OPERATORS, az as NoValueOperator, aO as NoopGeocodingAdapter, cM as NoopHookRegistry, ac as NumberFilterOperator, H as NumberUnit, ay as OPERATORS_BY_TYPE, aQ as ObjectAttribute, aY as ObjectPermissions, aS as ObjectRecord, cW as ObjectRecordsRepository, dc as ObjectSchemaService, db as ObjectSchemaServiceOptions, cS as ObjectsRepository, ee as OperationResult, cy as PathCardinality, cz as PathSegment, cA as PathSegmentType, aV as Permission, aT as PermissionScope, de as PermissionService, dd as PermissionServiceOptions, c_ as PermissionsRepository, al as PhoneFilterValue, ax as QueryState, dg as RecordService, df as RecordServiceOptions, Z as RelationAttribute, ah as RelationFilterOperator, dj as RelationOption, dk as RelationOptionsResponse, dp as RelationResolverService, dm as RelationService, di as RelationValidationError, dh as RelationValidationResult, aj as RelativeDateValue, dn as ResolvedRelations, aL as ReverseGeocodingParams, aU as Role, cQ as RollupHooksConfig, dq as RollupResult, dt as RollupScheduler, ds as RollupSchedulerOptions, dr as RollupService, cB as SchemaResolver, e3 as SearchOptions, af as SelectFilterOperator, dF as SignedUrlOptions, av as SortDirection, aw as SortRule, z as StatusGroup, dG as StorageAdapter, a6 as StorageProvider, dD as StorageUploadInput, dE as StorageUploadResult, dJ as SyncOptions, dI as SyncResult, aZ as SystemPermissions, b7 as TabType, b9 as TableTab, bh as TenantId, ab as TextFilterOperator, aP as Timestamps, cF as TraversalOptions, cG as TraversalResult, d$ as UpdateDBAttribute, ed as UpdateDBFlow, dX as UpdateDBObject, e9 as UpdateDBView, aa as UpdateFile, d4 as UpdateFlowInput, da as UpdateObjectInput, a$ as UpdateRoleInput, b6 as UpdateUserProfile, dA as UpdateViewInput, dH as UploadFileInput, e0 as UpsertDBAttribute, dY as UpsertDBObject, ea as UpsertDBView, b4 as UserProfile, dv as UserProfileService, du as UserProfileServiceOptions, cU as UserProfilesRepository, b2 as UserRole, aW as UserRoleAssignment, dy as UserService, b3 as UserStatus, dx as UserValidationError, dw as UserValidationResult, bg as Uuid, c2 as ValidationResult, dB as ViewService, eg as ViewSyncOptions, ef as ViewSyncResult, cX as ViewsRepository, bE as attributeConfigSchemas, c$ as buildAuditChanges, bp as checkboxConfigSchema, cb as computeRecordStatus, c0 as createAttributeValidator, bL as createCheckboxValidator, bO as createCurrencyValidator, bM as createDateValidator, c6 as createDraftValidator, bU as createFileValidator, b_ as createFormulaValidator, bS as createLocationValidator, cR as createMockAdapter, bX as createMultiRelationValidator, bR as createMultiselectValidator, bK as createNumberValidator, c1 as createObjectValidator, bN as createPhoneValidator, bZ as createRatingValidator, bY as createRelationValidator, cO as createRollupHooks, b$ as createRollupValidator, bQ as createSelectValidator, bW as createSingleRelationValidator, bP as createStatusValidator, bJ as createTextValidator, bT as createTimestampValidator, bV as createUserValidator, bs as currencyConfigSchema, bq as dateConfigSchema, dU as enrichValuesWithSelectLabels, cd as evaluateFormula, ce as evaluateFormulaAttribute, cf as evaluateFormulaAttributeWithRelations, cg as evaluateFormulaWithRelations, ch as evaluateFormulaWithResult, dT as extractAttributeNames, ci as extractFormulaVariables, cj as extractRelationNames, ck as extractRelationReferences, by as fileConfigSchema, cl as flattenRelationsForEval, cm as formatFormulaResult, bC as formulaConfigSchema, bi as generateId, bj as generatePrefixedId, bF as getAttributeConfigSchema, c9 as getMissingRequiredAttributes, cq as getPathDepth, cr as getRelationPath, dM as getSyncPreview, cs as getTargetAttributeName, ej as getViewSyncPreview, cn as hasRelationReferences, bf as isActivityTab, as as isAdvancedFilterState, be as isCustomTab, aG as isFlowDefinition, aH as isFlowPublished, bc as isFormTab, dS as isLabelExpression, aB as isNoValueOperator, ca as isRecordComplete, aI as isSystemFlow, bd as isTableTab, bu as locationConfigSchema, bx as multiselectConfigSchema, bo as numberConfigSchema, bH as parseAttributeConfig, cv as parsePath, cw as pathHasManyCardinality, br as phoneConfigSchema, bB as ratingConfigSchema, cP as registerAllRollupHooks, bk as registry, bA as relationConfigSchema, dR as renderLabelExpression, cC as resolveMultiplePaths, cD as resolveSingleValue, bD as rollupConfigSchema, bI as safeParseAttributeConfig, bw as selectConfigSchema, bt as statusConfigSchema, dP as syncAll, dK as syncNativeObjects, eh as syncNativeViews, bm as textConfigSchema, bn as textareaConfigSchema, bv as timestampConfigSchema, at as toAdvancedFilterState, au as toSimpleFilterState, cE as traversePath, bz as userConfigSchema, c3 as validateAttribute, bG as validateAttributeConfig, c7 as validateDraft, c8 as validateDraftOrThrow, co as validateFormulaExpression, c4 as validateObject, c5 as validateObjectOrThrow, cx as validatePath, dL as verifyNativeObjectsSync, ei as verifyNativeViewsSync, bl as viewRegistry } from './runtime-DSMMZRLE.mjs';
3
3
  import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
4
4
  import 'zod';
5
5
 
@@ -214,8 +214,9 @@ type InferRecordUpdate<TMap extends AttributeMap> = Partial<InferRecordFromSchem
214
214
  /**
215
215
  * Base type for custom attribute values added via UI
216
216
  * Supports all possible attribute value types
217
+ * Formula and Rollup attributes don't have defaultValue, so we exclude them
217
218
  */
218
- type CustomAttributeValue = Attribute["defaultValue"] | undefined;
219
+ type CustomAttributeValue = Exclude<Attribute, FormulaAttribute | RollupAttribute>["defaultValue"] | undefined;
219
220
  /**
220
221
  * Adds support for custom attributes (added via UI) to a record type
221
222
  * Preserves autocompletion for known attributes while allowing additional properties
@@ -353,6 +354,8 @@ declare const SYSTEM_RESOURCES: {
353
354
  readonly SETTINGS: "settings";
354
355
  /** Audit logs and activity trail */
355
356
  readonly AUDIT: "audit";
357
+ /** File uploads and storage management */
358
+ readonly FILES: "files";
356
359
  };
357
360
  /**
358
361
  * All system resources as an array (for iteration)
@@ -427,6 +430,7 @@ declare const SchemaErrorCode: {
427
430
  readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
428
431
  readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
429
432
  readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
433
+ readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
430
434
  readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
431
435
  readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
432
436
  readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
@@ -513,10 +517,10 @@ declare class ValidationError extends SchemaError {
513
517
  * Error thrown when attempting to modify a protected (system) resource
514
518
  */
515
519
  declare class ProtectedResourceError extends SchemaError {
516
- readonly resourceType: "object" | "attribute";
520
+ readonly resourceType: "object" | "attribute" | "view";
517
521
  readonly resourceName: string;
518
522
  readonly operation: "delete" | "modify";
519
- constructor(resourceType: "object" | "attribute", resourceName: string, operation: "delete" | "modify");
523
+ constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
520
524
  }
521
525
  /**
522
526
  * Error thrown during native object synchronization
@@ -606,7 +610,7 @@ declare abstract class BaseAttributeBuilder<TAttr extends Attribute> {
606
610
  description(value: string): this;
607
611
  icon(value: IconName): this;
608
612
  order(value: number): this;
609
- defaultValue(value: TAttr["defaultValue"]): this;
613
+ defaultValue(value: "defaultValue" extends keyof TAttr ? TAttr["defaultValue"] : never): this;
610
614
  metadata(value: Record<string, unknown>): this;
611
615
  build(): TAttr;
612
616
  }
@@ -813,6 +817,10 @@ declare class FileAttributeBuilder<TName extends string, TRequired extends boole
813
817
  maxSize(bytes: number): this;
814
818
  allowedTypes(types: MimeType[] | readonly MimeType[]): this;
815
819
  verification(config: FileAttribute["verification"]): this;
820
+ /**
821
+ * Allow multiple files to be uploaded
822
+ */
823
+ multiple(): this;
816
824
  required(): FileAttributeBuilder<TName, true>;
817
825
  optional(): FileAttributeBuilder<TName, false>;
818
826
  }
@@ -825,6 +833,10 @@ declare class UserAttributeBuilder<TName extends string, TRequired extends boole
825
833
  };
826
834
  constructor(name: TName, label: string);
827
835
  allowedRoles(roles: string[]): this;
836
+ /**
837
+ * Allow multiple users to be selected
838
+ */
839
+ multiple(): this;
828
840
  required(): UserAttributeBuilder<TName, true>;
829
841
  optional(): UserAttributeBuilder<TName, false>;
830
842
  }
@@ -935,10 +947,117 @@ declare class RatingAttributeBuilder<TName extends string, TRequired extends boo
935
947
  optional(): RatingAttributeBuilder<TName, false>;
936
948
  }
937
949
  declare function rating<TName extends string>(config: TypedBuilderConfig<TName>): RatingAttributeBuilder<TName, false>;
950
+ /**
951
+ * Builder for formula attributes (computed values)
952
+ *
953
+ * Formula attributes are always read-only and cannot be required.
954
+ */
955
+ declare class FormulaAttributeBuilder<TName extends string> extends BaseAttributeBuilder<FormulaAttribute> {
956
+ readonly _types: {
957
+ name: TName;
958
+ attribute: FormulaAttribute;
959
+ required: false;
960
+ };
961
+ constructor(name: TName, label: string);
962
+ /**
963
+ * Set the formula expression
964
+ * @param expr - Expression to evaluate (e.g., "price * quantity")
965
+ */
966
+ expression(expr: string): this;
967
+ /**
968
+ * Set the expected return type for formatting
969
+ * @param type - Return type: "text", "number", "boolean", or "date"
970
+ */
971
+ returns(type: FormulaReturnType): this;
972
+ /**
973
+ * Set decimal places for number results
974
+ */
975
+ decimals(value: number): this;
976
+ required(): any;
977
+ optional(): any;
978
+ }
979
+ /**
980
+ * Create a formula attribute builder
981
+ *
982
+ * @example Simple calculation
983
+ * ```typescript
984
+ * formula({ name: "total", label: "Total" })
985
+ * .expression("price * quantity")
986
+ * .returns("number")
987
+ * .decimals(2)
988
+ * ```
989
+ *
990
+ * @example With functions
991
+ * ```typescript
992
+ * formula({ name: "fullName", label: "Full Name" })
993
+ * .expression("CONCAT(firstName, ' ', lastName)")
994
+ * .returns("text")
995
+ * ```
996
+ */
997
+ declare function formula<TName extends string>(config: TypedBuilderConfig<TName>): FormulaAttributeBuilder<TName>;
998
+ /**
999
+ * Builder for rollup attributes (aggregations from related records)
1000
+ *
1001
+ * Rollup attributes are always read-only and cannot be required.
1002
+ */
1003
+ declare class RollupAttributeBuilder<TName extends string> extends BaseAttributeBuilder<RollupAttribute> {
1004
+ readonly _types: {
1005
+ name: TName;
1006
+ attribute: RollupAttribute;
1007
+ required: false;
1008
+ };
1009
+ constructor(name: TName, label: string);
1010
+ /**
1011
+ * Set the relation attribute to aggregate from
1012
+ * @param relationName - Name of the relation attribute on this object
1013
+ */
1014
+ from(relationName: string): this;
1015
+ /**
1016
+ * Set the target attribute to aggregate
1017
+ * @param attrName - Name of the attribute on the related object
1018
+ */
1019
+ aggregate(attrName: string): this;
1020
+ /**
1021
+ * Set the aggregation function
1022
+ */
1023
+ using(fn: RollupFunction): this;
1024
+ /**
1025
+ * Set decimal places for numeric results
1026
+ */
1027
+ decimals(value: number): this;
1028
+ /**
1029
+ * Set multi-level path for traversing nested relations (Phase 4+)
1030
+ * @param path - Dot notation path (e.g., "orders.items")
1031
+ */
1032
+ path(relationPath: string): this;
1033
+ required(): any;
1034
+ optional(): any;
1035
+ }
1036
+ /**
1037
+ * Create a rollup attribute builder
1038
+ *
1039
+ * @example Sum of related amounts
1040
+ * ```typescript
1041
+ * rollup({ name: "totalOrders", label: "Total Orders" })
1042
+ * .from("orders") // relation attribute name
1043
+ * .aggregate("amount") // target attribute to sum
1044
+ * .using("sum")
1045
+ * .decimals(2)
1046
+ * ```
1047
+ *
1048
+ * @example Count of related records
1049
+ * ```typescript
1050
+ * rollup({ name: "orderCount", label: "Number of Orders" })
1051
+ * .from("orders")
1052
+ * .aggregate("id") // any attribute works for count
1053
+ * .using("count")
1054
+ * ```
1055
+ */
1056
+ declare function rollup<TName extends string>(config: TypedBuilderConfig<TName>): RollupAttributeBuilder<TName>;
938
1057
  /**
939
1058
  * Union of all attribute builder types
940
1059
  */
941
- type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | TimestampAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean>;
1060
+ type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | TimestampAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean> | FormulaAttributeBuilder<string> | RollupAttributeBuilder<string>;
942
1061
  /**
943
1062
  * Extract the attribute name from a builder
944
1063
  */
@@ -1661,4 +1780,4 @@ declare function view(name: string, label: string): ViewBuilder;
1661
1780
  */
1662
1781
  declare function group(id: string, label: string): GroupBuilder;
1663
1782
 
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 };
1783
+ 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, FormulaAttribute, FormulaReturnType, 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, RollupAttribute, RollupFunction, 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, formula, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isValidationError, location, multiselect, number, object, phone, rating, relation, rollup, select, status, text, textarea, timestamp, user, view };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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';
1
+ import { A as Attribute, S as StatusAttribute, a as SelectAttribute, M as MultiselectAttribute, P as Phone, C as Currency, L as Location, F as FormulaAttribute, R as RollupAttribute, 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, k as FileAttribute, U as UserAttribute, l as SingleRelationAttribute, m as MultiRelationAttribute, n as RelationTarget, o as RatingAttribute, p as FormulaReturnType, q as RollupFunction, r as FlowDefinition, s as FlowPage, t as FlowRow, u as ObjectDefinition, v as Field, w as AttributeGroupField, G as Group, V as ViewDefinition, x as Tab } from './runtime-DSMMZRLE.js';
2
+ export { bb as ActivityTab, d9 as AddAttributeInput, ar as AdvancedFilterState, b1 as AssignRoleInput, cH as AttributeChange, B as AttributeGroup, y as AttributeType, cT as AttributesRepository, $ as AuditAction, a0 as AuditActorType, a1 as AuditChange, a4 as AuditListOptions, a2 as AuditLogEntry, cZ as AuditRepository, _ as AuditResourceType, d0 as AuditService, a5 as AuditServiceOptions, E as BaseAttribute, ad as CheckboxFilterOperator, aR as CompletionStatus, a3 as CreateAuditLogInput, d8 as CreateCustomObjectInput, d_ as CreateDBAttribute, ec as CreateDBFlow, dW as CreateDBObject, e8 as CreateDBView, a9 as CreateFile, d3 as CreateFlowInput, e1 as CreateObjectRecord, b0 as CreatePermissionInput, a_ as CreateRoleInput, b5 as CreateUserProfile, dz as CreateViewInput, ak as CurrencyFilterValue, ba as CustomTab, dZ as DBAttribute, eb as DBFlow, dV as DBObject, e7 as DBView, dQ as DEFAULT_LABEL_FALLBACK, cc as DatabaseAdapter, ae as DateFilterOperator, I as DateFormat, J as DateValue, W as DocumentFace, Q as DocumentType, X as DocumentTypeConfig, aX as EffectivePermissions, a8 as File, dC as FileContent, e6 as FileListOptions, d2 as FileService, d1 as FileServiceOptions, Y as FileVerificationConfig, a7 as FileVisibility, cV as FilesRepository, ao as FilterCombinator, aq as FilterGroup, ai as FilterOperator, an as FilterRule, ap as FilterState, am as FilterValue, aE as FlowRelation, aD as FlowRowField, d5 as FlowService, aC as FlowSlot, aF as FlowStatus, cY as FlowsRepository, b8 as FormTab, cp as FormulaResult, dO as FullSyncOptions, dN as FullSyncResult, aN as GeocodingAdapter, aK as GeocodingAutocompleteParams, aM as GeocodingParams, d6 as GeocodingService, aJ as GeocodingSuggestion, dl as GetRelationOptionsParams, e4 as GlobalSearchOptions, e5 as GlobalSearchResultItem, d7 as GlobalSearchService, cI as HookContext, cJ as HookDefinition, cK as HookHandler, cN as HookRegistry, cL as HookType, ct as InvalidPathError, e2 as ListOptions, K as LocationGranularity, cu as MaxDepthExceededError, ag as MultiselectFilterOperator, aA as NO_VALUE_OPERATORS, az as NoValueOperator, aO as NoopGeocodingAdapter, cM as NoopHookRegistry, ac as NumberFilterOperator, H as NumberUnit, ay as OPERATORS_BY_TYPE, aQ as ObjectAttribute, aY as ObjectPermissions, aS as ObjectRecord, cW as ObjectRecordsRepository, dc as ObjectSchemaService, db as ObjectSchemaServiceOptions, cS as ObjectsRepository, ee as OperationResult, cy as PathCardinality, cz as PathSegment, cA as PathSegmentType, aV as Permission, aT as PermissionScope, de as PermissionService, dd as PermissionServiceOptions, c_ as PermissionsRepository, al as PhoneFilterValue, ax as QueryState, dg as RecordService, df as RecordServiceOptions, Z as RelationAttribute, ah as RelationFilterOperator, dj as RelationOption, dk as RelationOptionsResponse, dp as RelationResolverService, dm as RelationService, di as RelationValidationError, dh as RelationValidationResult, aj as RelativeDateValue, dn as ResolvedRelations, aL as ReverseGeocodingParams, aU as Role, cQ as RollupHooksConfig, dq as RollupResult, dt as RollupScheduler, ds as RollupSchedulerOptions, dr as RollupService, cB as SchemaResolver, e3 as SearchOptions, af as SelectFilterOperator, dF as SignedUrlOptions, av as SortDirection, aw as SortRule, z as StatusGroup, dG as StorageAdapter, a6 as StorageProvider, dD as StorageUploadInput, dE as StorageUploadResult, dJ as SyncOptions, dI as SyncResult, aZ as SystemPermissions, b7 as TabType, b9 as TableTab, bh as TenantId, ab as TextFilterOperator, aP as Timestamps, cF as TraversalOptions, cG as TraversalResult, d$ as UpdateDBAttribute, ed as UpdateDBFlow, dX as UpdateDBObject, e9 as UpdateDBView, aa as UpdateFile, d4 as UpdateFlowInput, da as UpdateObjectInput, a$ as UpdateRoleInput, b6 as UpdateUserProfile, dA as UpdateViewInput, dH as UploadFileInput, e0 as UpsertDBAttribute, dY as UpsertDBObject, ea as UpsertDBView, b4 as UserProfile, dv as UserProfileService, du as UserProfileServiceOptions, cU as UserProfilesRepository, b2 as UserRole, aW as UserRoleAssignment, dy as UserService, b3 as UserStatus, dx as UserValidationError, dw as UserValidationResult, bg as Uuid, c2 as ValidationResult, dB as ViewService, eg as ViewSyncOptions, ef as ViewSyncResult, cX as ViewsRepository, bE as attributeConfigSchemas, c$ as buildAuditChanges, bp as checkboxConfigSchema, cb as computeRecordStatus, c0 as createAttributeValidator, bL as createCheckboxValidator, bO as createCurrencyValidator, bM as createDateValidator, c6 as createDraftValidator, bU as createFileValidator, b_ as createFormulaValidator, bS as createLocationValidator, cR as createMockAdapter, bX as createMultiRelationValidator, bR as createMultiselectValidator, bK as createNumberValidator, c1 as createObjectValidator, bN as createPhoneValidator, bZ as createRatingValidator, bY as createRelationValidator, cO as createRollupHooks, b$ as createRollupValidator, bQ as createSelectValidator, bW as createSingleRelationValidator, bP as createStatusValidator, bJ as createTextValidator, bT as createTimestampValidator, bV as createUserValidator, bs as currencyConfigSchema, bq as dateConfigSchema, dU as enrichValuesWithSelectLabels, cd as evaluateFormula, ce as evaluateFormulaAttribute, cf as evaluateFormulaAttributeWithRelations, cg as evaluateFormulaWithRelations, ch as evaluateFormulaWithResult, dT as extractAttributeNames, ci as extractFormulaVariables, cj as extractRelationNames, ck as extractRelationReferences, by as fileConfigSchema, cl as flattenRelationsForEval, cm as formatFormulaResult, bC as formulaConfigSchema, bi as generateId, bj as generatePrefixedId, bF as getAttributeConfigSchema, c9 as getMissingRequiredAttributes, cq as getPathDepth, cr as getRelationPath, dM as getSyncPreview, cs as getTargetAttributeName, ej as getViewSyncPreview, cn as hasRelationReferences, bf as isActivityTab, as as isAdvancedFilterState, be as isCustomTab, aG as isFlowDefinition, aH as isFlowPublished, bc as isFormTab, dS as isLabelExpression, aB as isNoValueOperator, ca as isRecordComplete, aI as isSystemFlow, bd as isTableTab, bu as locationConfigSchema, bx as multiselectConfigSchema, bo as numberConfigSchema, bH as parseAttributeConfig, cv as parsePath, cw as pathHasManyCardinality, br as phoneConfigSchema, bB as ratingConfigSchema, cP as registerAllRollupHooks, bk as registry, bA as relationConfigSchema, dR as renderLabelExpression, cC as resolveMultiplePaths, cD as resolveSingleValue, bD as rollupConfigSchema, bI as safeParseAttributeConfig, bw as selectConfigSchema, bt as statusConfigSchema, dP as syncAll, dK as syncNativeObjects, eh as syncNativeViews, bm as textConfigSchema, bn as textareaConfigSchema, bv as timestampConfigSchema, at as toAdvancedFilterState, au as toSimpleFilterState, cE as traversePath, bz as userConfigSchema, c3 as validateAttribute, bG as validateAttributeConfig, c7 as validateDraft, c8 as validateDraftOrThrow, co as validateFormulaExpression, c4 as validateObject, c5 as validateObjectOrThrow, cx as validatePath, dL as verifyNativeObjectsSync, ei as verifyNativeViewsSync, bl as viewRegistry } from './runtime-DSMMZRLE.js';
3
3
  import { IconName, CountryIso3, CurrencyCode, MimeType, ColorId } from '@stndrds/constants';
4
4
  import 'zod';
5
5
 
@@ -214,8 +214,9 @@ type InferRecordUpdate<TMap extends AttributeMap> = Partial<InferRecordFromSchem
214
214
  /**
215
215
  * Base type for custom attribute values added via UI
216
216
  * Supports all possible attribute value types
217
+ * Formula and Rollup attributes don't have defaultValue, so we exclude them
217
218
  */
218
- type CustomAttributeValue = Attribute["defaultValue"] | undefined;
219
+ type CustomAttributeValue = Exclude<Attribute, FormulaAttribute | RollupAttribute>["defaultValue"] | undefined;
219
220
  /**
220
221
  * Adds support for custom attributes (added via UI) to a record type
221
222
  * Preserves autocompletion for known attributes while allowing additional properties
@@ -353,6 +354,8 @@ declare const SYSTEM_RESOURCES: {
353
354
  readonly SETTINGS: "settings";
354
355
  /** Audit logs and activity trail */
355
356
  readonly AUDIT: "audit";
357
+ /** File uploads and storage management */
358
+ readonly FILES: "files";
356
359
  };
357
360
  /**
358
361
  * All system resources as an array (for iteration)
@@ -427,6 +430,7 @@ declare const SchemaErrorCode: {
427
430
  readonly INVALID_OBJECT_NAME: "SCHEMA_INVALID_OBJECT_NAME";
428
431
  readonly PROTECTED_OBJECT: "SCHEMA_PROTECTED_OBJECT";
429
432
  readonly PROTECTED_ATTRIBUTE: "SCHEMA_PROTECTED_ATTRIBUTE";
433
+ readonly PROTECTED_VIEW: "SCHEMA_PROTECTED_VIEW";
430
434
  readonly PROTECTED_ROLE: "SCHEMA_PROTECTED_ROLE";
431
435
  readonly FORBIDDEN: "SCHEMA_FORBIDDEN";
432
436
  readonly SYNC_FAILED: "SCHEMA_SYNC_FAILED";
@@ -513,10 +517,10 @@ declare class ValidationError extends SchemaError {
513
517
  * Error thrown when attempting to modify a protected (system) resource
514
518
  */
515
519
  declare class ProtectedResourceError extends SchemaError {
516
- readonly resourceType: "object" | "attribute";
520
+ readonly resourceType: "object" | "attribute" | "view";
517
521
  readonly resourceName: string;
518
522
  readonly operation: "delete" | "modify";
519
- constructor(resourceType: "object" | "attribute", resourceName: string, operation: "delete" | "modify");
523
+ constructor(resourceType: "object" | "attribute" | "view", resourceName: string, operation: "delete" | "modify");
520
524
  }
521
525
  /**
522
526
  * Error thrown during native object synchronization
@@ -606,7 +610,7 @@ declare abstract class BaseAttributeBuilder<TAttr extends Attribute> {
606
610
  description(value: string): this;
607
611
  icon(value: IconName): this;
608
612
  order(value: number): this;
609
- defaultValue(value: TAttr["defaultValue"]): this;
613
+ defaultValue(value: "defaultValue" extends keyof TAttr ? TAttr["defaultValue"] : never): this;
610
614
  metadata(value: Record<string, unknown>): this;
611
615
  build(): TAttr;
612
616
  }
@@ -813,6 +817,10 @@ declare class FileAttributeBuilder<TName extends string, TRequired extends boole
813
817
  maxSize(bytes: number): this;
814
818
  allowedTypes(types: MimeType[] | readonly MimeType[]): this;
815
819
  verification(config: FileAttribute["verification"]): this;
820
+ /**
821
+ * Allow multiple files to be uploaded
822
+ */
823
+ multiple(): this;
816
824
  required(): FileAttributeBuilder<TName, true>;
817
825
  optional(): FileAttributeBuilder<TName, false>;
818
826
  }
@@ -825,6 +833,10 @@ declare class UserAttributeBuilder<TName extends string, TRequired extends boole
825
833
  };
826
834
  constructor(name: TName, label: string);
827
835
  allowedRoles(roles: string[]): this;
836
+ /**
837
+ * Allow multiple users to be selected
838
+ */
839
+ multiple(): this;
828
840
  required(): UserAttributeBuilder<TName, true>;
829
841
  optional(): UserAttributeBuilder<TName, false>;
830
842
  }
@@ -935,10 +947,117 @@ declare class RatingAttributeBuilder<TName extends string, TRequired extends boo
935
947
  optional(): RatingAttributeBuilder<TName, false>;
936
948
  }
937
949
  declare function rating<TName extends string>(config: TypedBuilderConfig<TName>): RatingAttributeBuilder<TName, false>;
950
+ /**
951
+ * Builder for formula attributes (computed values)
952
+ *
953
+ * Formula attributes are always read-only and cannot be required.
954
+ */
955
+ declare class FormulaAttributeBuilder<TName extends string> extends BaseAttributeBuilder<FormulaAttribute> {
956
+ readonly _types: {
957
+ name: TName;
958
+ attribute: FormulaAttribute;
959
+ required: false;
960
+ };
961
+ constructor(name: TName, label: string);
962
+ /**
963
+ * Set the formula expression
964
+ * @param expr - Expression to evaluate (e.g., "price * quantity")
965
+ */
966
+ expression(expr: string): this;
967
+ /**
968
+ * Set the expected return type for formatting
969
+ * @param type - Return type: "text", "number", "boolean", or "date"
970
+ */
971
+ returns(type: FormulaReturnType): this;
972
+ /**
973
+ * Set decimal places for number results
974
+ */
975
+ decimals(value: number): this;
976
+ required(): any;
977
+ optional(): any;
978
+ }
979
+ /**
980
+ * Create a formula attribute builder
981
+ *
982
+ * @example Simple calculation
983
+ * ```typescript
984
+ * formula({ name: "total", label: "Total" })
985
+ * .expression("price * quantity")
986
+ * .returns("number")
987
+ * .decimals(2)
988
+ * ```
989
+ *
990
+ * @example With functions
991
+ * ```typescript
992
+ * formula({ name: "fullName", label: "Full Name" })
993
+ * .expression("CONCAT(firstName, ' ', lastName)")
994
+ * .returns("text")
995
+ * ```
996
+ */
997
+ declare function formula<TName extends string>(config: TypedBuilderConfig<TName>): FormulaAttributeBuilder<TName>;
998
+ /**
999
+ * Builder for rollup attributes (aggregations from related records)
1000
+ *
1001
+ * Rollup attributes are always read-only and cannot be required.
1002
+ */
1003
+ declare class RollupAttributeBuilder<TName extends string> extends BaseAttributeBuilder<RollupAttribute> {
1004
+ readonly _types: {
1005
+ name: TName;
1006
+ attribute: RollupAttribute;
1007
+ required: false;
1008
+ };
1009
+ constructor(name: TName, label: string);
1010
+ /**
1011
+ * Set the relation attribute to aggregate from
1012
+ * @param relationName - Name of the relation attribute on this object
1013
+ */
1014
+ from(relationName: string): this;
1015
+ /**
1016
+ * Set the target attribute to aggregate
1017
+ * @param attrName - Name of the attribute on the related object
1018
+ */
1019
+ aggregate(attrName: string): this;
1020
+ /**
1021
+ * Set the aggregation function
1022
+ */
1023
+ using(fn: RollupFunction): this;
1024
+ /**
1025
+ * Set decimal places for numeric results
1026
+ */
1027
+ decimals(value: number): this;
1028
+ /**
1029
+ * Set multi-level path for traversing nested relations (Phase 4+)
1030
+ * @param path - Dot notation path (e.g., "orders.items")
1031
+ */
1032
+ path(relationPath: string): this;
1033
+ required(): any;
1034
+ optional(): any;
1035
+ }
1036
+ /**
1037
+ * Create a rollup attribute builder
1038
+ *
1039
+ * @example Sum of related amounts
1040
+ * ```typescript
1041
+ * rollup({ name: "totalOrders", label: "Total Orders" })
1042
+ * .from("orders") // relation attribute name
1043
+ * .aggregate("amount") // target attribute to sum
1044
+ * .using("sum")
1045
+ * .decimals(2)
1046
+ * ```
1047
+ *
1048
+ * @example Count of related records
1049
+ * ```typescript
1050
+ * rollup({ name: "orderCount", label: "Number of Orders" })
1051
+ * .from("orders")
1052
+ * .aggregate("id") // any attribute works for count
1053
+ * .using("count")
1054
+ * ```
1055
+ */
1056
+ declare function rollup<TName extends string>(config: TypedBuilderConfig<TName>): RollupAttributeBuilder<TName>;
938
1057
  /**
939
1058
  * Union of all attribute builder types
940
1059
  */
941
- type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | TimestampAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean>;
1060
+ type AnyAttributeBuilder = TextAttributeBuilder<string, boolean> | TextAreaAttributeBuilder<string, boolean> | NumberAttributeBuilder<string, boolean> | CheckboxAttributeBuilder<string, boolean> | DateAttributeBuilder<string, boolean> | PhoneAttributeBuilder<string, boolean> | CurrencyAttributeBuilder<string, boolean> | StatusAttributeBuilder<string, readonly Option[], boolean> | SelectAttributeBuilder<string, readonly Option[], boolean> | MultiselectAttributeBuilder<string, readonly Option[], boolean> | LocationAttributeBuilder<string, boolean> | TimestampAttributeBuilder<string, boolean> | FileAttributeBuilder<string, boolean> | UserAttributeBuilder<string, boolean> | SingleRelationAttributeBuilder<string, boolean> | MultiRelationAttributeBuilder<string, boolean> | RatingAttributeBuilder<string, boolean> | FormulaAttributeBuilder<string> | RollupAttributeBuilder<string>;
942
1061
  /**
943
1062
  * Extract the attribute name from a builder
944
1063
  */
@@ -1661,4 +1780,4 @@ declare function view(name: string, label: string): ViewBuilder;
1661
1780
  */
1662
1781
  declare function group(id: string, label: string): GroupBuilder;
1663
1782
 
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 };
1783
+ 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, FormulaAttribute, FormulaReturnType, 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, RollupAttribute, RollupFunction, 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, formula, group, isDefaultRole, isForbiddenError, isNotFoundError, isProtectedResourceError, isSchemaError, isValidationError, location, multiselect, number, object, phone, rating, relation, rollup, select, status, text, textarea, timestamp, user, view };