@stndrds/schema 0.1.0-alpha.18 → 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.
package/dist/index.mjs CHANGED
@@ -16,6 +16,8 @@ import {
16
16
  GeocodingService,
17
17
  GlobalSearchService,
18
18
  GroupBuilder,
19
+ InvalidPathError,
20
+ MaxDepthExceededError,
19
21
  NoopGeocodingAdapter,
20
22
  NoopHookRegistry,
21
23
  NotFoundError,
@@ -30,8 +32,11 @@ import {
30
32
  RecordNotFoundError,
31
33
  RecordReferencedError,
32
34
  RecordService,
35
+ RelationResolverService,
33
36
  RelationService,
34
37
  RoleNotFoundError,
38
+ RollupScheduler,
39
+ RollupService,
35
40
  SchemaError,
36
41
  SchemaErrorCode,
37
42
  SyncError,
@@ -54,6 +59,7 @@ import {
54
59
  createDateValidator,
55
60
  createDraftValidator,
56
61
  createFileValidator,
62
+ createFormulaValidator,
57
63
  createLocationValidator,
58
64
  createMockAdapter,
59
65
  createMultiRelationValidator,
@@ -63,6 +69,8 @@ import {
63
69
  createPhoneValidator,
64
70
  createRatingValidator,
65
71
  createRelationValidator,
72
+ createRollupHooks,
73
+ createRollupValidator,
66
74
  createSelectValidator,
67
75
  createSingleRelationValidator,
68
76
  createStatusValidator,
@@ -74,18 +82,34 @@ import {
74
82
  date,
75
83
  dateConfigSchema,
76
84
  enrichValuesWithSelectLabels,
85
+ evaluateFormula,
86
+ evaluateFormulaAttribute,
87
+ evaluateFormulaAttributeWithRelations,
88
+ evaluateFormulaWithRelations,
89
+ evaluateFormulaWithResult,
77
90
  extractAttributeNames,
91
+ extractFormulaVariables,
92
+ extractRelationNames,
93
+ extractRelationReferences,
78
94
  file,
79
95
  fileConfigSchema,
96
+ flattenRelationsForEval,
80
97
  flow,
81
98
  formatAttributeValue,
99
+ formatFormulaResult,
100
+ formula,
101
+ formulaConfigSchema,
82
102
  generateId,
83
103
  generatePrefixedId,
84
104
  getAttributeConfigSchema,
85
105
  getMissingRequiredAttributes,
106
+ getPathDepth,
107
+ getRelationPath,
86
108
  getSyncPreview,
109
+ getTargetAttributeName,
87
110
  getViewSyncPreview,
88
111
  group,
112
+ hasRelationReferences,
89
113
  isForbiddenError,
90
114
  isLabelExpression,
91
115
  isNotFoundError,
@@ -101,14 +125,21 @@ import {
101
125
  numberConfigSchema,
102
126
  object,
103
127
  parseAttributeConfig,
128
+ parsePath,
129
+ pathHasManyCardinality,
104
130
  phone,
105
131
  phoneConfigSchema,
106
132
  rating,
107
133
  ratingConfigSchema,
134
+ registerAllRollupHooks,
108
135
  registry,
109
136
  relation,
110
137
  relationConfigSchema,
111
138
  renderLabelExpression,
139
+ resolveMultiplePaths,
140
+ resolveSingleValue,
141
+ rollup,
142
+ rollupConfigSchema,
112
143
  safeParseAttributeConfig,
113
144
  select,
114
145
  selectConfigSchema,
@@ -123,18 +154,21 @@ import {
123
154
  textareaConfigSchema,
124
155
  timestamp,
125
156
  timestampConfigSchema,
157
+ traversePath,
126
158
  user,
127
159
  userConfigSchema,
128
160
  validateAttribute,
129
161
  validateAttributeConfig,
130
162
  validateDraft,
131
163
  validateDraftOrThrow,
164
+ validateFormulaExpression,
132
165
  validateObject,
133
166
  validateObjectOrThrow,
167
+ validatePath,
134
168
  verifyNativeObjectsSync,
135
169
  verifyNativeViewsSync,
136
170
  view
137
- } from "./chunk-EWNSOD22.mjs";
171
+ } from "./chunk-JD2MVLTW.mjs";
138
172
  import {
139
173
  ALL_SYSTEM_RESOURCES,
140
174
  DEFAULT_ROLES,
@@ -229,7 +263,24 @@ var OPERATORS_BY_TYPE = {
229
263
  file: ["is_empty", "is_not_empty"],
230
264
  user: ["contains", "not_contains", "is_empty", "is_not_empty"],
231
265
  relation: ["any_of", "none_of", "contains", "not_contains", "is_empty", "is_not_empty"],
232
- rating: ["eq", "neq", "lt", "gt", "lte", "gte", "is_empty", "is_not_empty"]
266
+ rating: ["eq", "neq", "lt", "gt", "lte", "gte", "is_empty", "is_not_empty"],
267
+ // Formula: operators depend on returnType, but we provide a general set
268
+ formula: [
269
+ "is",
270
+ "is_not",
271
+ "eq",
272
+ "neq",
273
+ "lt",
274
+ "gt",
275
+ "lte",
276
+ "gte",
277
+ "contains",
278
+ "not_contains",
279
+ "is_empty",
280
+ "is_not_empty"
281
+ ],
282
+ // Rollup: typically numeric aggregations
283
+ rollup: ["eq", "neq", "lt", "gt", "lte", "gte", "is_empty", "is_not_empty"]
233
284
  };
234
285
  var NO_VALUE_OPERATORS = [
235
286
  "is_empty",
@@ -426,6 +477,8 @@ export {
426
477
  GeocodingService,
427
478
  GlobalSearchService,
428
479
  GroupBuilder,
480
+ InvalidPathError,
481
+ MaxDepthExceededError,
429
482
  NO_VALUE_OPERATORS,
430
483
  NoopGeocodingAdapter,
431
484
  NoopHookRegistry,
@@ -442,8 +495,11 @@ export {
442
495
  RecordNotFoundError,
443
496
  RecordReferencedError,
444
497
  RecordService,
498
+ RelationResolverService,
445
499
  RelationService,
446
500
  RoleNotFoundError,
501
+ RollupScheduler,
502
+ RollupService,
447
503
  SYSTEM_RESOURCES,
448
504
  SYSTEM_RESOURCE_LABELS,
449
505
  SchemaError,
@@ -468,6 +524,7 @@ export {
468
524
  createDateValidator,
469
525
  createDraftValidator,
470
526
  createFileValidator,
527
+ createFormulaValidator,
471
528
  createLocationValidator,
472
529
  createMockAdapter,
473
530
  createMultiRelationValidator,
@@ -477,6 +534,8 @@ export {
477
534
  createPhoneValidator,
478
535
  createRatingValidator,
479
536
  createRelationValidator,
537
+ createRollupHooks,
538
+ createRollupValidator,
480
539
  createSelectValidator,
481
540
  createSingleRelationValidator,
482
541
  createStatusValidator,
@@ -488,18 +547,34 @@ export {
488
547
  date,
489
548
  dateConfigSchema,
490
549
  enrichValuesWithSelectLabels,
550
+ evaluateFormula,
551
+ evaluateFormulaAttribute,
552
+ evaluateFormulaAttributeWithRelations,
553
+ evaluateFormulaWithRelations,
554
+ evaluateFormulaWithResult,
491
555
  extractAttributeNames,
556
+ extractFormulaVariables,
557
+ extractRelationNames,
558
+ extractRelationReferences,
492
559
  file,
493
560
  fileConfigSchema,
561
+ flattenRelationsForEval,
494
562
  flow,
495
563
  formatAttributeValue,
564
+ formatFormulaResult,
565
+ formula,
566
+ formulaConfigSchema,
496
567
  generateId,
497
568
  generatePrefixedId,
498
569
  getAttributeConfigSchema,
499
570
  getMissingRequiredAttributes,
571
+ getPathDepth,
572
+ getRelationPath,
500
573
  getSyncPreview,
574
+ getTargetAttributeName,
501
575
  getViewSyncPreview,
502
576
  group,
577
+ hasRelationReferences,
503
578
  isActivityTab,
504
579
  isAdvancedFilterState,
505
580
  isCustomTab,
@@ -525,14 +600,21 @@ export {
525
600
  numberConfigSchema,
526
601
  object,
527
602
  parseAttributeConfig,
603
+ parsePath,
604
+ pathHasManyCardinality,
528
605
  phone,
529
606
  phoneConfigSchema,
530
607
  rating,
531
608
  ratingConfigSchema,
609
+ registerAllRollupHooks,
532
610
  registry,
533
611
  relation,
534
612
  relationConfigSchema,
535
613
  renderLabelExpression,
614
+ resolveMultiplePaths,
615
+ resolveSingleValue,
616
+ rollup,
617
+ rollupConfigSchema,
536
618
  safeParseAttributeConfig,
537
619
  select,
538
620
  selectConfigSchema,
@@ -549,14 +631,17 @@ export {
549
631
  timestampConfigSchema,
550
632
  toAdvancedFilterState,
551
633
  toSimpleFilterState,
634
+ traversePath,
552
635
  user,
553
636
  userConfigSchema,
554
637
  validateAttribute,
555
638
  validateAttributeConfig,
556
639
  validateDraft,
557
640
  validateDraftOrThrow,
641
+ validateFormulaExpression,
558
642
  validateObject,
559
643
  validateObjectOrThrow,
644
+ validatePath,
560
645
  verifyNativeObjectsSync,
561
646
  verifyNativeViewsSync,
562
647
  view,