@stndrds/schema 0.1.0-alpha.21 → 0.1.0-alpha.23

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 (63) hide show
  1. package/dist/chunk-7GLSGSUP.mjs +9456 -0
  2. package/dist/chunk-AZTBTKHP.mjs +9861 -0
  3. package/dist/chunk-B74KNXDP.mjs +9457 -0
  4. package/dist/chunk-CVFKFFCX.mjs +9912 -0
  5. package/dist/chunk-DXVIUNQT.mjs +9881 -0
  6. package/dist/chunk-EJB2V42F.mjs +9778 -0
  7. package/dist/chunk-GP2BONBI.mjs +9493 -0
  8. package/dist/chunk-H2KOC7F5.mjs +9549 -0
  9. package/dist/chunk-HXLOIN36.mjs +9893 -0
  10. package/dist/chunk-HYW67ZP6.mjs +9500 -0
  11. package/dist/chunk-IKUIWNHZ.mjs +9460 -0
  12. package/dist/chunk-JAWKNHY6.mjs +9553 -0
  13. package/dist/chunk-KT4UPBZR.mjs +9892 -0
  14. package/dist/chunk-NBCCRCJB.mjs +9547 -0
  15. package/dist/chunk-NN7Y3B3A.mjs +9859 -0
  16. package/dist/chunk-SBEZDUNH.mjs +9549 -0
  17. package/dist/chunk-TTZ3TWYP.mjs +9583 -0
  18. package/dist/chunk-UTZTDUIK.mjs +9818 -0
  19. package/dist/index.d.mts +172 -17
  20. package/dist/index.d.ts +172 -17
  21. package/dist/index.js +977 -512
  22. package/dist/index.mjs +71 -23
  23. package/dist/runtime-BFOdkIqK.d.mts +7644 -0
  24. package/dist/runtime-BFOdkIqK.d.ts +7644 -0
  25. package/dist/runtime-BI_wXiVl.d.mts +8043 -0
  26. package/dist/runtime-BI_wXiVl.d.ts +8043 -0
  27. package/dist/runtime-BZZRu7A1.d.mts +7083 -0
  28. package/dist/runtime-BZZRu7A1.d.ts +7083 -0
  29. package/dist/runtime-BlcFbbeG.d.mts +8035 -0
  30. package/dist/runtime-BlcFbbeG.d.ts +8035 -0
  31. package/dist/runtime-BleOubTG.d.mts +7236 -0
  32. package/dist/runtime-BleOubTG.d.ts +7236 -0
  33. package/dist/runtime-CC4VRtUK.d.mts +7422 -0
  34. package/dist/runtime-CC4VRtUK.d.ts +7422 -0
  35. package/dist/runtime-CKLGO3Jk.d.mts +7632 -0
  36. package/dist/runtime-CKLGO3Jk.d.ts +7632 -0
  37. package/dist/runtime-CjhnsVyg.d.mts +7668 -0
  38. package/dist/runtime-CjhnsVyg.d.ts +7668 -0
  39. package/dist/runtime-CmYcicVr.d.mts +7083 -0
  40. package/dist/runtime-CmYcicVr.d.ts +7083 -0
  41. package/dist/runtime-D01tNFxT.d.mts +7418 -0
  42. package/dist/runtime-D01tNFxT.d.ts +7418 -0
  43. package/dist/runtime-DWCd3xCL.d.mts +7632 -0
  44. package/dist/runtime-DWCd3xCL.d.ts +7632 -0
  45. package/dist/runtime-DbryZGqb.d.mts +8037 -0
  46. package/dist/runtime-DbryZGqb.d.ts +8037 -0
  47. package/dist/runtime-DdkNFkKd.d.mts +7185 -0
  48. package/dist/runtime-DdkNFkKd.d.ts +7185 -0
  49. package/dist/runtime-DnnW72ZF.d.mts +7451 -0
  50. package/dist/runtime-DnnW72ZF.d.ts +7451 -0
  51. package/dist/runtime-DrrCWvBr.d.mts +7451 -0
  52. package/dist/runtime-DrrCWvBr.d.ts +7451 -0
  53. package/dist/runtime-UYkiPdud.d.mts +8047 -0
  54. package/dist/runtime-UYkiPdud.d.ts +8047 -0
  55. package/dist/runtime-g7XZnqGw.d.mts +7452 -0
  56. package/dist/runtime-g7XZnqGw.d.ts +7452 -0
  57. package/dist/runtime-jnV5WCS6.d.mts +8047 -0
  58. package/dist/runtime-jnV5WCS6.d.ts +8047 -0
  59. package/dist/runtime.d.mts +1 -1
  60. package/dist/runtime.d.ts +1 -1
  61. package/dist/runtime.js +855 -466
  62. package/dist/runtime.mjs +29 -3
  63. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -27,11 +27,15 @@ import {
27
27
  ObjectReferencedError,
28
28
  ObjectSchemaService,
29
29
  PermissionService,
30
+ PolicyRegistry,
31
+ PolicyViolationError,
30
32
  ProtectedResourceError,
31
33
  ProtectedRoleError,
32
34
  QueryBuilder,
33
35
  QueryMultipleResultsError,
34
36
  QueryNoResultError,
37
+ RELATION_TARGET_ANY,
38
+ RESERVED_ATTRIBUTE_NAMES,
35
39
  RecordNotFoundError,
36
40
  RecordReferencedError,
37
41
  RecordService,
@@ -41,17 +45,24 @@ import {
41
45
  RollupScheduler,
42
46
  RollupService,
43
47
  SHORTCUT_TO_FILTER_OPERATOR,
48
+ SYSTEM_ATTRIBUTES,
49
+ SYSTEM_FIELD_NAMES,
44
50
  SchemaError,
45
51
  SchemaErrorCode,
46
52
  SyncError,
47
53
  TabBuilder,
48
54
  TableTabConfig,
55
+ TenantAwareRepository,
56
+ TenantAwareService,
57
+ TenantContextError,
49
58
  UserProfileNotFoundError,
50
59
  UserProfileService,
51
60
  UserService,
52
61
  ValidationError,
53
62
  ViewBuilder,
54
63
  ViewService,
64
+ asTenantId,
65
+ asUserId,
55
66
  attributeConfigSchemas,
56
67
  buildAuditChanges,
57
68
  checkbox,
@@ -75,17 +86,19 @@ import {
75
86
  createQueryBuilder,
76
87
  createRatingValidator,
77
88
  createRelationValidator,
89
+ createRichtextValidator,
78
90
  createRollupValidator,
79
91
  createSelectValidator,
80
92
  createSingleRelationValidator,
81
93
  createStatusValidator,
94
+ createTextAreaValidator,
82
95
  createTextValidator,
83
- createTimestampValidator,
84
96
  createUserValidator,
85
97
  currency,
86
98
  currencyConfigSchema,
87
99
  date,
88
100
  dateConfigSchema,
101
+ defaultPolicyRegistry,
89
102
  enrichValuesWithSelectLabels,
90
103
  evaluateFormula,
91
104
  evaluateFormulaAttribute,
@@ -109,13 +122,18 @@ import {
109
122
  generateId,
110
123
  generatePrefixedId,
111
124
  getAttributeConfigSchema,
125
+ getContext,
112
126
  getMissingRequiredAttributes,
113
127
  getPathDepth,
114
128
  getRelationPath,
115
129
  getSyncPreview,
130
+ getSystemAttributeList,
116
131
  getTargetAttributeName,
132
+ getTenantId,
133
+ getUserId,
117
134
  getViewSyncPreview,
118
135
  group,
136
+ hasContext,
119
137
  hasRelationReferences,
120
138
  isForbiddenError,
121
139
  isLabelExpression,
@@ -123,11 +141,15 @@ import {
123
141
  isProtectedResourceError,
124
142
  isRecordComplete,
125
143
  isSchemaError,
144
+ isSystemAttribute,
145
+ isSystemAttributeObject,
146
+ isUniversalRelation,
126
147
  isValidationError,
127
148
  location,
128
149
  locationConfigSchema,
129
150
  multiselect,
130
151
  multiselectConfigSchema,
152
+ notesPolicy,
131
153
  number,
132
154
  numberConfigSchema,
133
155
  object,
@@ -144,8 +166,11 @@ import {
144
166
  renderLabelExpression,
145
167
  resolveMultiplePaths,
146
168
  resolveSingleValue,
169
+ richtext,
170
+ richtextConfigSchema,
147
171
  rollup,
148
172
  rollupConfigSchema,
173
+ runWithContext,
149
174
  safeParseAttributeConfig,
150
175
  select,
151
176
  selectConfigSchema,
@@ -158,8 +183,6 @@ import {
158
183
  textConfigSchema,
159
184
  textarea,
160
185
  textareaConfigSchema,
161
- timestamp,
162
- timestampConfigSchema,
163
186
  traversePath,
164
187
  user,
165
188
  userConfigSchema,
@@ -173,8 +196,9 @@ import {
173
196
  validatePath,
174
197
  verifyNativeObjectsSync,
175
198
  verifyNativeViewsSync,
176
- view
177
- } from "./chunk-F27AKBTL.mjs";
199
+ view,
200
+ withTenantContext
201
+ } from "./chunk-KT4UPBZR.mjs";
178
202
  import {
179
203
  ALL_SYSTEM_RESOURCES,
180
204
  DEFAULT_ROLES,
@@ -236,6 +260,7 @@ var OPERATORS_BY_TYPE = {
236
260
  "is_empty",
237
261
  "is_not_empty"
238
262
  ],
263
+ richtext: ["is_empty", "is_not_empty"],
239
264
  number: ["eq", "neq", "lt", "gt", "lte", "gte", "is_empty", "is_not_empty"],
240
265
  checkbox: ["is_checked", "is_not_checked"],
241
266
  date: [
@@ -249,17 +274,6 @@ var OPERATORS_BY_TYPE = {
249
274
  "is_empty",
250
275
  "is_not_empty"
251
276
  ],
252
- timestamp: [
253
- "is",
254
- "is_not",
255
- "before",
256
- "after",
257
- "on_or_before",
258
- "on_or_after",
259
- "is_within",
260
- "is_empty",
261
- "is_not_empty"
262
- ],
263
277
  phone: ["is", "is_not", "contains", "not_contains", "is_empty", "is_not_empty"],
264
278
  currency: ["eq", "neq", "lt", "gt", "lte", "gte", "is_empty", "is_not_empty"],
265
279
  status: ["is", "is_not", "any_of", "none_of", "is_empty", "is_not_empty"],
@@ -309,9 +323,6 @@ function isSystemFlow(flow2) {
309
323
  return flow2.system === true;
310
324
  }
311
325
 
312
- // src/types/inference.ts
313
- var SYSTEM_FIELD_NAMES = ["id", "createdAt", "updatedAt"];
314
-
315
326
  // src/types/views.ts
316
327
  function isFormTab(tab) {
317
328
  return tab.type === "form";
@@ -325,6 +336,18 @@ function isCustomTab(tab) {
325
336
  function isActivityTab(tab) {
326
337
  return tab.type === "activity";
327
338
  }
339
+ function isNotesTab(tab) {
340
+ return tab.type === "notes";
341
+ }
342
+
343
+ // src/native/notes.ts
344
+ var NOTES = object({ name: "notes", label: "Note" }).pluralLabel("Notes").icon("file-text").description("Notes that can be linked to any record or used globally").system().labelExpression("{{ title }}").attribute(text({ name: "title", label: "Title" }).placeholder("Untitled").required()).attribute(richtext({ name: "content", label: "Content" }).required()).attribute(
345
+ select({ name: "visibility", label: "Visibility" }).options([
346
+ { id: "private", label: "Private", value: "private", icon: "lock" },
347
+ { id: "shared", label: "Shared", value: "shared", icon: "users" }
348
+ ]).defaultValue("private").required()
349
+ ).attribute(relation({ name: "linkedTo", label: "Linked To" }).toAny());
350
+ registry.register(NOTES);
328
351
 
329
352
  // src/views/registry.ts
330
353
  var ViewRegistry = class {
@@ -488,6 +511,7 @@ export {
488
511
  GroupBuilder,
489
512
  InvalidPathError,
490
513
  MaxDepthExceededError,
514
+ NOTES,
491
515
  NO_VALUE_OPERATORS,
492
516
  NoopGeocodingAdapter,
493
517
  NoopHookRegistry,
@@ -499,11 +523,15 @@ export {
499
523
  ObjectReferencedError,
500
524
  ObjectSchemaService,
501
525
  PermissionService,
526
+ PolicyRegistry,
527
+ PolicyViolationError,
502
528
  ProtectedResourceError,
503
529
  ProtectedRoleError,
504
530
  QueryBuilder,
505
531
  QueryMultipleResultsError,
506
532
  QueryNoResultError,
533
+ RELATION_TARGET_ANY,
534
+ RESERVED_ATTRIBUTE_NAMES,
507
535
  RecordNotFoundError,
508
536
  RecordReferencedError,
509
537
  RecordService,
@@ -513,6 +541,7 @@ export {
513
541
  RollupScheduler,
514
542
  RollupService,
515
543
  SHORTCUT_TO_FILTER_OPERATOR,
544
+ SYSTEM_ATTRIBUTES,
516
545
  SYSTEM_FIELD_NAMES,
517
546
  SYSTEM_RESOURCES,
518
547
  SYSTEM_RESOURCE_LABELS,
@@ -521,12 +550,17 @@ export {
521
550
  SyncError,
522
551
  TabBuilder,
523
552
  TableTabConfig,
553
+ TenantAwareRepository,
554
+ TenantAwareService,
555
+ TenantContextError,
524
556
  UserProfileNotFoundError,
525
557
  UserProfileService,
526
558
  UserService,
527
559
  ValidationError,
528
560
  ViewBuilder,
529
561
  ViewService,
562
+ asTenantId,
563
+ asUserId,
530
564
  attributeConfigSchemas,
531
565
  buildAuditChanges,
532
566
  checkbox,
@@ -550,17 +584,19 @@ export {
550
584
  createQueryBuilder,
551
585
  createRatingValidator,
552
586
  createRelationValidator,
587
+ createRichtextValidator,
553
588
  createRollupValidator,
554
589
  createSelectValidator,
555
590
  createSingleRelationValidator,
556
591
  createStatusValidator,
592
+ createTextAreaValidator,
557
593
  createTextValidator,
558
- createTimestampValidator,
559
594
  createUserValidator,
560
595
  currency,
561
596
  currencyConfigSchema,
562
597
  date,
563
598
  dateConfigSchema,
599
+ defaultPolicyRegistry,
564
600
  enrichValuesWithSelectLabels,
565
601
  evaluateFormula,
566
602
  evaluateFormulaAttribute,
@@ -584,13 +620,18 @@ export {
584
620
  generateId,
585
621
  generatePrefixedId,
586
622
  getAttributeConfigSchema,
623
+ getContext,
587
624
  getMissingRequiredAttributes,
588
625
  getPathDepth,
589
626
  getRelationPath,
590
627
  getSyncPreview,
628
+ getSystemAttributeList,
591
629
  getTargetAttributeName,
630
+ getTenantId,
631
+ getUserId,
592
632
  getViewSyncPreview,
593
633
  group,
634
+ hasContext,
594
635
  hasRelationReferences,
595
636
  isActivityTab,
596
637
  isAdvancedFilterState,
@@ -603,16 +644,21 @@ export {
603
644
  isLabelExpression,
604
645
  isNoValueOperator,
605
646
  isNotFoundError,
647
+ isNotesTab,
606
648
  isProtectedResourceError,
607
649
  isRecordComplete,
608
650
  isSchemaError,
651
+ isSystemAttribute,
652
+ isSystemAttributeObject,
609
653
  isSystemFlow,
610
654
  isTableTab,
655
+ isUniversalRelation,
611
656
  isValidationError,
612
657
  location,
613
658
  locationConfigSchema,
614
659
  multiselect,
615
660
  multiselectConfigSchema,
661
+ notesPolicy,
616
662
  number,
617
663
  numberConfigSchema,
618
664
  object,
@@ -629,8 +675,11 @@ export {
629
675
  renderLabelExpression,
630
676
  resolveMultiplePaths,
631
677
  resolveSingleValue,
678
+ richtext,
679
+ richtextConfigSchema,
632
680
  rollup,
633
681
  rollupConfigSchema,
682
+ runWithContext,
634
683
  safeParseAttributeConfig,
635
684
  select,
636
685
  selectConfigSchema,
@@ -643,8 +692,6 @@ export {
643
692
  textConfigSchema,
644
693
  textarea,
645
694
  textareaConfigSchema,
646
- timestamp,
647
- timestampConfigSchema,
648
695
  toAdvancedFilterState,
649
696
  toSimpleFilterState,
650
697
  traversePath,
@@ -661,5 +708,6 @@ export {
661
708
  verifyNativeObjectsSync,
662
709
  verifyNativeViewsSync,
663
710
  view,
664
- viewRegistry
711
+ viewRegistry,
712
+ withTenantContext
665
713
  };