@almadar/runtime 4.2.7 → 4.4.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.
- package/dist/{OrbitalServerRuntime-FxB6n8uS.d.ts → OrbitalServerRuntime-DS7Zs5x1.d.ts} +1 -1
- package/dist/OrbitalServerRuntime.d.ts +2 -2
- package/dist/OrbitalServerRuntime.js +1 -1
- package/dist/ServerBridge.d.ts +1 -1
- package/dist/{chunk-ZIDFSYMT.js → chunk-QKH3SGBA.js} +56 -6
- package/dist/chunk-QKH3SGBA.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{types-BxxO5BCJ.d.ts → types-DwDhc9Jt.d.ts} +9 -20
- package/package.json +2 -2
- package/dist/chunk-ZIDFSYMT.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
|
-
import { I as IEventBus, g as RuntimeEvent, f as EventListener, U as Unsubscribe, T as TraitDefinition, R as RuntimeConfig, i as TransitionObserver, h as TraitState, j as TransitionResult, E as EvaluationContextExtensions, a as EffectHandlers } from './types-
|
|
2
|
+
import { I as IEventBus, g as RuntimeEvent, f as EventListener, U as Unsubscribe, T as TraitDefinition, R as RuntimeConfig, i as TransitionObserver, h as TraitState, j as TransitionResult, E as EvaluationContextExtensions, a as EffectHandlers } from './types-DwDhc9Jt.js';
|
|
3
3
|
import { EventPayload, EntityRow, OrbitalSchema, Orbital, Trait, OrbitalDefinition, Entity, TraitConfig, TraitTick } from '@almadar/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
export { B as EffectResult, C as LoaderConfig, D as LocalPersistenceAdapter, O as OrbitalEventRequest, e as OrbitalEventResponse, F as OrbitalServerRuntime, f as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, k as RuntimeOrbital, l as RuntimeOrbitalSchema, m as RuntimeTrait, G as RuntimeTraitTick, H as createOrbitalServerRuntime } from './OrbitalServerRuntime-
|
|
3
|
-
import './types-
|
|
2
|
+
export { B as EffectResult, C as LoaderConfig, D as LocalPersistenceAdapter, O as OrbitalEventRequest, e as OrbitalEventResponse, F as OrbitalServerRuntime, f as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, k as RuntimeOrbital, l as RuntimeOrbitalSchema, m as RuntimeTrait, G as RuntimeTraitTick, H as createOrbitalServerRuntime } from './OrbitalServerRuntime-DS7Zs5x1.js';
|
|
3
|
+
import './types-DwDhc9Jt.js';
|
|
4
4
|
import '@almadar/core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventBus, createUnifiedLoader, preprocessSchema, StateMachineManager, createContextFromBindings, EffectExecutor } from './chunk-
|
|
1
|
+
import { EventBus, createUnifiedLoader, preprocessSchema, StateMachineManager, createContextFromBindings, EffectExecutor } from './chunk-QKH3SGBA.js';
|
|
2
2
|
import './chunk-PZ5AY32C.js';
|
|
3
3
|
import { Router } from 'express';
|
|
4
4
|
import * as fs from 'fs';
|
package/dist/ServerBridge.d.ts
CHANGED
|
@@ -2071,15 +2071,65 @@ var UnifiedLoader = class {
|
|
|
2071
2071
|
function createUnifiedLoader(options) {
|
|
2072
2072
|
return new UnifiedLoader(options);
|
|
2073
2073
|
}
|
|
2074
|
+
function renameEventsInRenderUiConfig(node, rename) {
|
|
2075
|
+
if (node === null || node === void 0) return node;
|
|
2076
|
+
if (Array.isArray(node)) {
|
|
2077
|
+
return node.map((item) => renameEventsInRenderUiConfig(item, rename));
|
|
2078
|
+
}
|
|
2079
|
+
if (typeof node !== "object") return node;
|
|
2080
|
+
const obj = node;
|
|
2081
|
+
const next = { ...obj };
|
|
2082
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
2083
|
+
if (key === "action" && typeof value === "string" && !value.startsWith("@")) {
|
|
2084
|
+
next[key] = rename(value) ?? value;
|
|
2085
|
+
continue;
|
|
2086
|
+
}
|
|
2087
|
+
if (/^on[A-Z]/.test(key) && typeof value === "string" && !value.startsWith("@")) {
|
|
2088
|
+
next[key] = rename(value) ?? value;
|
|
2089
|
+
continue;
|
|
2090
|
+
}
|
|
2091
|
+
if (key.endsWith("Event") && typeof value === "string" && !value.startsWith("@")) {
|
|
2092
|
+
next[key] = rename(value) ?? value;
|
|
2093
|
+
continue;
|
|
2094
|
+
}
|
|
2095
|
+
if ((key === "actions" || key === "itemActions") && Array.isArray(value)) {
|
|
2096
|
+
const rewrittenArray = value.map((entry) => {
|
|
2097
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) return entry;
|
|
2098
|
+
const action = entry;
|
|
2099
|
+
if (typeof action.event === "string" && !action.event.startsWith("@")) {
|
|
2100
|
+
return { ...action, event: rename(action.event) ?? action.event };
|
|
2101
|
+
}
|
|
2102
|
+
return action;
|
|
2103
|
+
});
|
|
2104
|
+
next[key] = rewrittenArray;
|
|
2105
|
+
continue;
|
|
2106
|
+
}
|
|
2107
|
+
next[key] = renameEventsInRenderUiConfig(value, rename);
|
|
2108
|
+
}
|
|
2109
|
+
return next;
|
|
2110
|
+
}
|
|
2111
|
+
function renameEventsInEffects(effects, rename) {
|
|
2112
|
+
return effects.map((effect) => {
|
|
2113
|
+
if (!Array.isArray(effect)) return effect;
|
|
2114
|
+
if (effect[0] === "render-ui" && effect.length >= 3) {
|
|
2115
|
+
const slot = effect[1];
|
|
2116
|
+
const config = effect[2];
|
|
2117
|
+
const nextConfig = renameEventsInRenderUiConfig(config, rename);
|
|
2118
|
+
return [effect[0], slot, nextConfig, ...effect.slice(3)];
|
|
2119
|
+
}
|
|
2120
|
+
return effect;
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2074
2123
|
function applyEventRenames(trait, renames) {
|
|
2075
2124
|
if (!renames || Object.keys(renames).length === 0) return trait;
|
|
2076
2125
|
const rename = (k) => k !== void 0 && k in renames ? renames[k] : k;
|
|
2077
2126
|
const sm = trait.stateMachine;
|
|
2078
2127
|
if (!sm) return trait;
|
|
2079
|
-
const nextTransitions = (sm.transitions ?? []).map((t) =>
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2128
|
+
const nextTransitions = (sm.transitions ?? []).map((t) => {
|
|
2129
|
+
const nextEvent = rename(t.event) ?? t.event;
|
|
2130
|
+
const nextEffects = t.effects ? renameEventsInEffects(t.effects, rename) : t.effects;
|
|
2131
|
+
return { ...t, event: nextEvent, effects: nextEffects };
|
|
2132
|
+
});
|
|
2083
2133
|
const nextEvents = (sm.events ?? []).map((e) => {
|
|
2084
2134
|
const newKey = rename(e.key);
|
|
2085
2135
|
if (newKey === e.key) return e;
|
|
@@ -2733,5 +2783,5 @@ function parseNamespacedEvent(eventName) {
|
|
|
2733
2783
|
}
|
|
2734
2784
|
|
|
2735
2785
|
export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent };
|
|
2736
|
-
//# sourceMappingURL=chunk-
|
|
2737
|
-
//# sourceMappingURL=chunk-
|
|
2786
|
+
//# sourceMappingURL=chunk-QKH3SGBA.js.map
|
|
2787
|
+
//# sourceMappingURL=chunk-QKH3SGBA.js.map
|