@almadar/core 10.73.0 → 10.75.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-CDlk_DCx.js';
2
- export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessTable } from '../entityAccess-BaGu3lyD.js';
3
- import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-B7xqqEFo.js';
4
- import '../trait-Cc-SAgVU.js';
1
+ import { O as OrbitalSchema } from '../schema-DlTrByoG.js';
2
+ export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessPoliciesByStoreKey, b as entityAccessTable } from '../entityAccess-B-de_0a8.js';
3
+ import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-CK1NMWES.js';
4
+ import '../trait-Cm9H3lHN.js';
5
5
  import '../expression-Fk8bQWef.js';
6
6
  import 'zod';
7
7
 
@@ -283,6 +283,18 @@ function entityAccessTable(schema) {
283
283
  function entityAccessPolicies(schema, entityName) {
284
284
  return entityAccessTable(schema).get(entityName);
285
285
  }
286
+ function entityAccessPoliciesByStoreKey(schema) {
287
+ const collectionOf = /* @__PURE__ */ new Map();
288
+ for (const def of inlineEntities2(schema)) {
289
+ if (def.collection) collectionOf.set(def.name, def.collection);
290
+ }
291
+ const byKey = /* @__PURE__ */ new Map();
292
+ for (const [name, policies] of entityAccessTable(schema)) {
293
+ const key = collectionOf.get(name) ?? name.toLowerCase();
294
+ if (!byKey.has(key) && isDeclared(policies)) byKey.set(key, policies);
295
+ }
296
+ return byKey;
297
+ }
286
298
  var ID_PREFIXES = {
287
299
  orbital: "orb_",
288
300
  entity: "ent_",
@@ -383,7 +395,8 @@ var FIELD_TYPES = [
383
395
  "trait",
384
396
  "slot",
385
397
  "pattern",
386
- "node"
398
+ "node",
399
+ "event"
387
400
  ];
388
401
  z.enum(FIELD_TYPES);
389
402
  var RelationCardinalitySchema = z.enum([
@@ -476,6 +489,7 @@ var EntityFieldSchema = z.lazy(() => {
476
489
  scalarVariant("slot"),
477
490
  scalarVariant("pattern"),
478
491
  scalarVariant("node"),
492
+ scalarVariant("event"),
479
493
  scalarVariant("money"),
480
494
  scalarVariant("file"),
481
495
  // Enum variant — REQUIRES non-empty values.
@@ -902,6 +916,6 @@ function sampleRows(entity, count, strategy) {
902
916
  return rows;
903
917
  }
904
918
 
905
- export { IMAGE_FIELD_NAMES, entityAccessPolicies, entityAccessTable, identityEntityName, isDeclaredDefaultHonored, ownerFieldsFromSchema, randomAnytimeDate, randomArrayElement, randomBoolean, randomColor, randomEmail, randomFloat, randomInt, randomPassword, randomPastDate, randomPhone, randomRecentDate, randomSentence, randomStraddlingDate, randomUrl, randomUuid, randomWords, sampleFieldValue, sampleImageUrl, sampleRow, sampleRowCount, sampleRows, seedRandom, shuffleArray };
919
+ export { IMAGE_FIELD_NAMES, entityAccessPolicies, entityAccessPoliciesByStoreKey, entityAccessTable, identityEntityName, isDeclaredDefaultHonored, ownerFieldsFromSchema, randomAnytimeDate, randomArrayElement, randomBoolean, randomColor, randomEmail, randomFloat, randomInt, randomPassword, randomPastDate, randomPhone, randomRecentDate, randomSentence, randomStraddlingDate, randomUrl, randomUuid, randomWords, sampleFieldValue, sampleImageUrl, sampleRow, sampleRowCount, sampleRows, seedRandom, shuffleArray };
906
920
  //# sourceMappingURL=index.js.map
907
921
  //# sourceMappingURL=index.js.map