@almadar/runtime 5.8.5 → 5.8.7

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,4 +1,4 @@
1
- export { InMemoryPersistence, OrbitalServerRuntime, collectDeclaredConfigDefaults, createOrbitalServerRuntime } from './chunk-C4YIYOJI.js';
1
+ export { InMemoryPersistence, OrbitalServerRuntime, collectDeclaredConfigDefaults, createOrbitalServerRuntime } from './chunk-7SMGB3XY.js';
2
2
  import './chunk-PZ5AY32C.js';
3
3
  //# sourceMappingURL=OrbitalServerRuntime.js.map
4
4
  //# sourceMappingURL=OrbitalServerRuntime.js.map
@@ -203,12 +203,24 @@ function interpolateProps(props, ctx) {
203
203
  const resolvedEntity = result["entity"];
204
204
  const resolvedRow = resolvedEntity !== null && typeof resolvedEntity === "object" && !Array.isArray(resolvedEntity) ? resolvedEntity : null;
205
205
  const ctxRow = ctx.payload["row"];
206
+ const ctxPayloadKeys = Object.keys(ctx.payload).join(",");
207
+ const payloadDataRaw = ctx.payload["data"];
208
+ const payloadDataLen = Array.isArray(payloadDataRaw) ? payloadDataRaw.length : null;
209
+ const ctxEntityRaw = ctx.entity;
210
+ const ctxEntityLen = Array.isArray(ctxEntityRaw) ? ctxEntityRaw.length : null;
211
+ const resolvedLen = Array.isArray(resolvedEntity) ? resolvedEntity.length : null;
206
212
  renderLog.debug("interpolateProps:entity", {
207
213
  patternType,
208
214
  entityBinding: entityBindingRaw,
209
215
  resolvedIsObject: resolvedRow !== null,
216
+ resolvedIsArray: Array.isArray(resolvedEntity),
217
+ resolvedLen,
210
218
  resolvedEqualsCtxRow: ctxRow !== void 0 && resolvedRow !== null && resolvedRow === ctxRow,
211
- resolvedRowId: resolvedRow?.id
219
+ resolvedRowId: resolvedRow?.id,
220
+ ctxPayloadKeys,
221
+ ctxPayloadDataLen: payloadDataLen,
222
+ ctxEntityIsArray: Array.isArray(ctxEntityRaw),
223
+ ctxEntityLen
212
224
  });
213
225
  }
214
226
  if (patternType === "form-section" || patternType === "form") {
@@ -4639,6 +4651,24 @@ var OrbitalServerRuntime = class {
4639
4651
  }
4640
4652
  } else {
4641
4653
  let entities = await this.persistence.list(fetchEntityType);
4654
+ if (options?.filter !== void 0 && options.filter !== null) {
4655
+ const predicate = options.filter;
4656
+ entities = entities.filter((entity) => {
4657
+ const ctx = createContextFromBindings(
4658
+ { entity, payload: bindingsRef?.payload, current: entity },
4659
+ false
4660
+ );
4661
+ try {
4662
+ return Boolean(evaluate(predicate, ctx));
4663
+ } catch (err) {
4664
+ console.error(
4665
+ `[OrbitalServerRuntime] fetch filter eval error for ${fetchEntityType}:`,
4666
+ err
4667
+ );
4668
+ return false;
4669
+ }
4670
+ });
4671
+ }
4642
4672
  if (options?.offset && options.offset > 0) {
4643
4673
  entities = entities.slice(options.offset);
4644
4674
  }
@@ -5271,5 +5301,5 @@ function buildMatcher(src, listenerOrbital) {
5271
5301
  }
5272
5302
 
5273
5303
  export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, OrbitalServerRuntime, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createLogger, createMockPersistence, createOrbitalServerRuntime, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes };
5274
- //# sourceMappingURL=chunk-C4YIYOJI.js.map
5275
- //# sourceMappingURL=chunk-C4YIYOJI.js.map
5304
+ //# sourceMappingURL=chunk-7SMGB3XY.js.map
5305
+ //# sourceMappingURL=chunk-7SMGB3XY.js.map