@almadar/runtime 4.0.0 → 4.0.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.
- package/dist/{OrbitalServerRuntime-CXfyKGAS.d.ts → OrbitalServerRuntime-DMe0zqCc.d.ts} +1 -1
- package/dist/OrbitalServerRuntime.d.ts +2 -2
- package/dist/OrbitalServerRuntime.js +61 -7
- package/dist/OrbitalServerRuntime.js.map +1 -1
- package/dist/ServerBridge.d.ts +1 -1
- package/dist/{chunk-WIWVHE3P.js → chunk-7WP4AE6X.js} +13 -5
- package/dist/chunk-7WP4AE6X.js.map +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1 -1
- package/dist/{types-B8OfRFfV.d.ts → types-CVSBlnzV.d.ts} +15 -2
- package/package.json +1 -1
- package/dist/chunk-WIWVHE3P.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BindingContext, E as EvaluationContextExtensions, P as PatternProps, a as EffectHandlers, b as EffectContext, c as ExecutionEnvironment, d as EffectResult, T as TraitDefinition } from './types-
|
|
2
|
-
export { e as Effect, f as EventListener, H as HANDLER_MANIFEST, I as IEventBus, R as RuntimeConfig, g as RuntimeEvent, h as TraitState, i as TransitionObserver, j as TransitionResult, U as Unsubscribe } from './types-
|
|
3
|
-
import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital } from './OrbitalServerRuntime-
|
|
4
|
-
export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, O as OrbitalEventRequest, e as OrbitalEventResponse, f as OrbitalServerRuntimeConfig, P as PersistenceAdapter, g as PreprocessOptions, h as PreprocessResult, i as PreprocessedSchema, j as ProcessEventOptions, R as RegisteredOrbital, k as RuntimeOrbital, l as RuntimeOrbitalSchema, m as RuntimeTrait, n as StateMachineManager, o as createInitialTraitState, p as findInitialState, q as findTransition, r as getIsolatedCollectionName, s as getNamespacedEvent, t as isBrowser, u as isElectron, v as isNamespacedEvent, w as isNode, x as normalizeEventKey, y as parseNamespacedEvent, z as preprocessSchema, A as processEvent } from './OrbitalServerRuntime-
|
|
1
|
+
import { B as BindingContext, E as EvaluationContextExtensions, P as PatternProps, a as EffectHandlers, b as EffectContext, c as ExecutionEnvironment, d as EffectResult, T as TraitDefinition } from './types-CVSBlnzV.js';
|
|
2
|
+
export { e as Effect, f as EventListener, H as HANDLER_MANIFEST, I as IEventBus, R as RuntimeConfig, g as RuntimeEvent, h as TraitState, i as TransitionObserver, j as TransitionResult, U as Unsubscribe } from './types-CVSBlnzV.js';
|
|
3
|
+
import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital } from './OrbitalServerRuntime-DMe0zqCc.js';
|
|
4
|
+
export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, O as OrbitalEventRequest, e as OrbitalEventResponse, f as OrbitalServerRuntimeConfig, P as PersistenceAdapter, g as PreprocessOptions, h as PreprocessResult, i as PreprocessedSchema, j as ProcessEventOptions, R as RegisteredOrbital, k as RuntimeOrbital, l as RuntimeOrbitalSchema, m as RuntimeTrait, n as StateMachineManager, o as createInitialTraitState, p as findInitialState, q as findTransition, r as getIsolatedCollectionName, s as getNamespacedEvent, t as isBrowser, u as isElectron, v as isNamespacedEvent, w as isNode, x as normalizeEventKey, y as parseNamespacedEvent, z as preprocessSchema, A as processEvent } from './OrbitalServerRuntime-DMe0zqCc.js';
|
|
5
5
|
import { EvaluationContext } from '@almadar/evaluator';
|
|
6
6
|
export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
|
|
7
7
|
import { EventPayload, EntityRow, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
|
@@ -290,6 +290,8 @@ declare class EffectExecutor {
|
|
|
290
290
|
*/
|
|
291
291
|
executeWithResults(effects: unknown[]): Promise<EffectResult[]>;
|
|
292
292
|
private extractEmitConfig;
|
|
293
|
+
/** Build the source metadata stamp for an emit fired from this trait. */
|
|
294
|
+
private sourceStamp;
|
|
293
295
|
private emitSuccess;
|
|
294
296
|
private emitFailure;
|
|
295
297
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent } from './chunk-
|
|
1
|
+
export { EffectExecutor, EventBus, HANDLER_MANIFEST, StateMachineManager, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent } from './chunk-7WP4AE6X.js';
|
|
2
2
|
import { __export } from './chunk-PZ5AY32C.js';
|
|
3
3
|
import { isInlineTrait } from '@almadar/core';
|
|
4
4
|
|
|
@@ -115,8 +115,16 @@ interface TraitDefinition {
|
|
|
115
115
|
* Server: Express, database, integrators
|
|
116
116
|
*/
|
|
117
117
|
interface EffectHandlers {
|
|
118
|
-
/**
|
|
119
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Emit an event to the event bus.
|
|
120
|
+
*
|
|
121
|
+
* `source` carries the emitter's identity (orbital + trait) so that
|
|
122
|
+
* source-scoped listeners (`TraitName EVENT -> TRIGGER` and
|
|
123
|
+
* `Orbital.TraitName EVENT -> TRIGGER` in .lolo) can filter incoming
|
|
124
|
+
* events by their originating trait. Omitted when the emit is
|
|
125
|
+
* synthesized by a non-trait context (e.g. test harness).
|
|
126
|
+
*/
|
|
127
|
+
emit: (event: string, payload?: EventPayload, source?: RuntimeEvent['source']) => void;
|
|
120
128
|
/** Persist data (create/update/delete/batch) */
|
|
121
129
|
persist: (action: 'create' | 'update' | 'delete' | 'batch', entityType: string, data?: EntityRow) => Promise<void>;
|
|
122
130
|
/** Set a field value on an entity */
|
|
@@ -235,6 +243,11 @@ type Effect = [string, ...unknown[]];
|
|
|
235
243
|
interface EffectContext {
|
|
236
244
|
/** Trait name */
|
|
237
245
|
traitName: string;
|
|
246
|
+
/** Orbital that owns the firing trait. Used to stamp the source
|
|
247
|
+
* metadata on emits so source-scoped listens (`TraitName EVENT` for
|
|
248
|
+
* intra-orbital, `Orbital.TraitName EVENT` for cross-orbital) can
|
|
249
|
+
* filter by emitter identity. */
|
|
250
|
+
orbitalName?: string;
|
|
238
251
|
/** Current state */
|
|
239
252
|
state: string;
|
|
240
253
|
/** Transition description */
|