@almadar/core 10.48.0 → 10.49.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-C0QwW3G2.js';
2
- export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessTable } from '../entityAccess-OjD7XSBO.js';
3
- import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-DiHGegt9.js';
4
- import '../trait-pw49W-zL.js';
1
+ import { O as OrbitalSchema } from '../schema-1bzTH92n.js';
2
+ export { E as EntityAccessPolicies, e as entityAccessPolicies, a as entityAccessTable } from '../entityAccess-dYpx6Ipw.js';
3
+ import { a as EntityPersistence, E as EntityField, F as FieldValue, f as EntityRow } from '../effect-DjMRX8sI.js';
4
+ import '../trait-DkMVtmED.js';
5
5
  import '../expression-Yf7qvvOs.js';
6
6
  import 'zod';
7
7
 
@@ -205,8 +205,12 @@ function inlineEntities2(schema) {
205
205
  }
206
206
  return out;
207
207
  }
208
+ function isDeclared(p) {
209
+ return p.read !== void 0 || p.create !== void 0 || p.update !== void 0 || p.delete !== void 0;
210
+ }
208
211
  function entityAccessTable(schema) {
209
212
  const table = /* @__PURE__ */ new Map();
213
+ const collectionOf = /* @__PURE__ */ new Map();
210
214
  for (const def of inlineEntities2(schema)) {
211
215
  table.set(def.name, {
212
216
  read: def.read_policy,
@@ -214,6 +218,20 @@ function entityAccessTable(schema) {
214
218
  update: def.update_policy,
215
219
  delete: def.delete_policy
216
220
  });
221
+ if (def.collection) collectionOf.set(def.name, def.collection);
222
+ }
223
+ const byCollection = /* @__PURE__ */ new Map();
224
+ for (const [name, policies] of table) {
225
+ const collection = collectionOf.get(name);
226
+ if (collection && isDeclared(policies) && !byCollection.has(collection)) {
227
+ byCollection.set(collection, policies);
228
+ }
229
+ }
230
+ for (const [name, policies] of table) {
231
+ if (isDeclared(policies)) continue;
232
+ const collection = collectionOf.get(name);
233
+ const inherited = collection ? byCollection.get(collection) : void 0;
234
+ if (inherited) table.set(name, { ...inherited });
217
235
  }
218
236
  return table;
219
237
  }
@@ -526,7 +544,7 @@ var ScenePosSchema = z.object({
526
544
  y: z.number(),
527
545
  z: z.number().optional()
528
546
  });
529
- var CAMERA_MODES = ["isometric", "perspective", "top-down", "follow", "chase"];
547
+ var CAMERA_MODES = ["isometric", "perspective", "top-down", "front", "follow", "chase"];
530
548
  var CameraModeSchema = z.enum(CAMERA_MODES);
531
549
  z.object({
532
550
  pos: ScenePosSchema.optional(),