@almadar/runtime 5.8.7 → 5.9.1
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-
|
|
1
|
+
export { InMemoryPersistence, OrbitalServerRuntime, collectDeclaredConfigDefaults, createOrbitalServerRuntime } from './chunk-RONUCODN.js';
|
|
2
2
|
import './chunk-PZ5AY32C.js';
|
|
3
3
|
//# sourceMappingURL=OrbitalServerRuntime.js.map
|
|
4
4
|
//# sourceMappingURL=OrbitalServerRuntime.js.map
|
|
@@ -4004,6 +4004,29 @@ var OrbitalServerRuntime = class {
|
|
|
4004
4004
|
}
|
|
4005
4005
|
}
|
|
4006
4006
|
}
|
|
4007
|
+
const auxiliaryEntities = orbital.auxiliaryEntities;
|
|
4008
|
+
if (auxiliaryEntities !== void 0 && auxiliaryEntities.length > 0 && this.config.mode === "mock" && this.persistence instanceof MockPersistenceAdapter) {
|
|
4009
|
+
for (const auxRef of auxiliaryEntities) {
|
|
4010
|
+
if (typeof auxRef === "string" || isEntityCall(auxRef)) continue;
|
|
4011
|
+
const auxEntity = auxRef;
|
|
4012
|
+
if (!auxEntity.name || !auxEntity.fields) continue;
|
|
4013
|
+
const auxFields = auxEntity.fields.filter(
|
|
4014
|
+
(f) => typeof f.name === "string" && f.name.length > 0
|
|
4015
|
+
).map((f) => ({
|
|
4016
|
+
name: f.name,
|
|
4017
|
+
type: f.type,
|
|
4018
|
+
required: f.required,
|
|
4019
|
+
values: f.values,
|
|
4020
|
+
default: f.default
|
|
4021
|
+
}));
|
|
4022
|
+
this.persistence.registerEntity({ name: auxEntity.name, fields: auxFields });
|
|
4023
|
+
if (this.config.debug) {
|
|
4024
|
+
console.log(
|
|
4025
|
+
`[OrbitalRuntime] Seeded mock data for auxiliary entity: ${auxEntity.name}, count: ${this.persistence.count(auxEntity.name)}`
|
|
4026
|
+
);
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
}
|
|
4007
4030
|
if (this.config.debug) {
|
|
4008
4031
|
console.log(
|
|
4009
4032
|
`[OrbitalRuntime] Registered orbital: ${orbital.name} with ${(orbital.traits || []).length} trait(s)`
|
|
@@ -4880,15 +4903,27 @@ var OrbitalServerRuntime = class {
|
|
|
4880
4903
|
user
|
|
4881
4904
|
// @user bindings from Firebase auth
|
|
4882
4905
|
};
|
|
4883
|
-
const
|
|
4884
|
-
|
|
4885
|
-
);
|
|
4906
|
+
const traitDef = registered.traits.find((t) => t.name === traitName);
|
|
4907
|
+
const declaredDefaults = collectDeclaredConfigDefaults(traitDef);
|
|
4886
4908
|
const callSiteOverride = registered.configByTrait.get(traitName);
|
|
4887
4909
|
if (declaredDefaults || callSiteOverride) {
|
|
4888
4910
|
bindings.config = { ...declaredDefaults ?? {}, ...callSiteOverride ?? {} };
|
|
4889
4911
|
}
|
|
4912
|
+
if (traitDef?.scope === "collection" && entityType && !entityId) {
|
|
4913
|
+
try {
|
|
4914
|
+
const all = await this.persistence.list(entityType);
|
|
4915
|
+
if (Array.isArray(all) && all.length > 0) {
|
|
4916
|
+
const merged = Object.assign(
|
|
4917
|
+
[...all],
|
|
4918
|
+
all[0]
|
|
4919
|
+
);
|
|
4920
|
+
bindings.entity = merged;
|
|
4921
|
+
}
|
|
4922
|
+
} catch {
|
|
4923
|
+
}
|
|
4924
|
+
}
|
|
4890
4925
|
if (entityType) {
|
|
4891
|
-
bindings[entityType] = entityData;
|
|
4926
|
+
bindings[entityType] = bindings.entity ?? entityData;
|
|
4892
4927
|
}
|
|
4893
4928
|
bindingsRef = bindings;
|
|
4894
4929
|
const context = {
|
|
@@ -5301,5 +5336,5 @@ function buildMatcher(src, listenerOrbital) {
|
|
|
5301
5336
|
}
|
|
5302
5337
|
|
|
5303
5338
|
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 };
|
|
5304
|
-
//# sourceMappingURL=chunk-
|
|
5305
|
-
//# sourceMappingURL=chunk-
|
|
5339
|
+
//# sourceMappingURL=chunk-RONUCODN.js.map
|
|
5340
|
+
//# sourceMappingURL=chunk-RONUCODN.js.map
|