@almadar/core 10.78.0 → 10.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { O as OrbitalSchema } from '../schema-BG7mDO7m.js';
2
- export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessPoliciesByStoreKey, b as entityAccessTable } from '../entityAccess-B-CK9j-I.js';
3
- import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-CW3s399G.js';
4
- import '../trait-jWk0BInU.js';
1
+ import { O as OrbitalSchema } from '../schema-Cma07_18.js';
2
+ export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessPoliciesByStoreKey, b as entityAccessTable } from '../entityAccess-BMKFgmsc.js';
3
+ import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-C4uehm-r.js';
4
+ import '../trait-BXkQKZbO.js';
5
5
  import '../expression-Fk8bQWef.js';
6
6
  import 'zod';
7
7
 
@@ -758,6 +758,7 @@ function indexUuid(index) {
758
758
  return `00000000-0000-4000-8000-${index.toString(16).padStart(12, "0").slice(-12)}`;
759
759
  }
760
760
  function declaredValues(field) {
761
+ if (field.type === "union") return void 0;
761
762
  const values = "values" in field ? field.values : void 0;
762
763
  return values && values.length > 0 ? values : void 0;
763
764
  }
@@ -821,6 +822,16 @@ function sampleObject(field, ctx) {
821
822
  }
822
823
  return out;
823
824
  }
825
+ function sampleUnion(field, ctx) {
826
+ const depth = ctx.depth ?? 0;
827
+ if (!field.properties || field.values.length === 0 || depth >= MAX_NESTED_DEPTH) {
828
+ return void 0;
829
+ }
830
+ const firstVariant = field.properties[field.values[0]];
831
+ if (!firstVariant) return void 0;
832
+ const child = { ...firstVariant, name: field.name };
833
+ return sampleFieldValue(child, { ...ctx, depth: depth + 1 });
834
+ }
824
835
  function sampleFieldValue(field, ctx) {
825
836
  const honoredDefault = field.default !== void 0 && isFieldValue(field.default) ? field.default : void 0;
826
837
  if (field.intrinsic === true) return honoredDefault;
@@ -892,6 +903,8 @@ function sampleFieldValue(field, ctx) {
892
903
  return sampleArray(field, ctx);
893
904
  case "object":
894
905
  return sampleObject(field, ctx);
906
+ case "union":
907
+ return sampleUnion(field, ctx);
895
908
  case "trait":
896
909
  case "slot":
897
910
  case "pattern":