@almadar/runtime 6.8.0 → 6.9.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/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L a
|
|
|
4
4
|
export { d as EntitySharingMap, e as EventBus, f as EventNamespaceMap, O as OrbitalEventRequest, j as OrbitalEventResponse, l as OrbitalServerRuntimeConfig, P as PreprocessOptions, m as PreprocessResult, n as PreprocessedSchema, o as ProcessEventOptions, R as RegisteredOrbital, p as RuntimeOrbital, q as RuntimeOrbitalSchema, r as RuntimeTrait, t as StateMachineManager, u as collectDeclaredConfigDefaults, v as createInitialTraitState, x as findInitialState, y as findTransition, z as getIsolatedCollectionName, A as getNamespacedEvent, B as isBrowser, D as isElectron, F as isNamespacedEvent, G as isNode, H as normalizeEventKey, J as parseNamespacedEvent, K as preprocessSchema, M as processEvent } from './OrbitalServerRuntime-CzUrdroI.js';
|
|
5
5
|
import { EvaluationContext } from '@almadar/evaluator';
|
|
6
6
|
export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
|
|
7
|
-
import { EventPayload, EntityRow, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
|
7
|
+
import { EventPayload, EntityField, EntityRow, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
|
8
|
+
export { EntityField } from '@almadar/core';
|
|
8
9
|
import { P as PersistenceAdapter } from './PersistenceAdapter-B6dQCbbU.js';
|
|
9
10
|
export { I as InMemoryPersistence } from './PersistenceAdapter-B6dQCbbU.js';
|
|
10
11
|
export { ServerBridgeConfig, ServerBridgeState } from './ServerBridge.js';
|
|
@@ -382,22 +383,16 @@ declare function createClientEffectHandlers(options: CreateClientEffectHandlersO
|
|
|
382
383
|
* @packageDocumentation
|
|
383
384
|
*/
|
|
384
385
|
|
|
385
|
-
|
|
386
|
+
/** EntityField narrowed to require `name`. The canonical type makes `name`
|
|
387
|
+
* optional (it's omitted on nested `items` / `properties` descriptors), but
|
|
388
|
+
* the seed loop iterates by name. Callers filter for name-having fields
|
|
389
|
+
* at the registerEntity boundary. */
|
|
390
|
+
type NamedEntityField = EntityField & {
|
|
386
391
|
name: string;
|
|
387
|
-
|
|
388
|
-
required?: boolean;
|
|
389
|
-
values?: string[];
|
|
390
|
-
default?: unknown;
|
|
391
|
-
/** Validation format: email/url/phone/date/datetime/uuid. Drives mock-value shape without name heuristics. */
|
|
392
|
-
format?: 'email' | 'url' | 'phone' | 'date' | 'datetime' | 'uuid' | 'image' | 'avatar' | 'thumbnail';
|
|
393
|
-
/** Element schema for `type: 'array'`. When omitted, arrays default to []. Mirrors `ArrayEntityField.items` in @almadar/core. */
|
|
394
|
-
items?: EntityField;
|
|
395
|
-
/** Property schemas for `type: 'object'` (or array-of-object via `items.properties`). Mirrors `EntityFieldBase.properties` in @almadar/core. */
|
|
396
|
-
properties?: Record<string, EntityField>;
|
|
397
|
-
}
|
|
392
|
+
};
|
|
398
393
|
interface EntitySchema {
|
|
399
394
|
name: string;
|
|
400
|
-
fields:
|
|
395
|
+
fields: NamedEntityField[];
|
|
401
396
|
/** Pre-authored instance data from the schema (used instead of faker generation) */
|
|
402
397
|
seedData?: EntityRow[];
|
|
403
398
|
}
|
|
@@ -432,6 +427,20 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
|
|
|
432
427
|
* Otherwise, random mock data is generated with faker.
|
|
433
428
|
*/
|
|
434
429
|
registerEntity(schema: EntitySchema, seedCount?: number): void;
|
|
430
|
+
/**
|
|
431
|
+
* Walk every row of every registered entity and fill in `type: "relation"`
|
|
432
|
+
* fields with real IDs from the target entity's store. Without this pass,
|
|
433
|
+
* relation fields stay as placeholder `[]` / `""` and `populateRelations`
|
|
434
|
+
* in OrbitalServerRuntime has nothing to hydrate — catalog/preview demos
|
|
435
|
+
* of nested-tree atoms (e.g. std-thread-comments-linear with ThreadPost.
|
|
436
|
+
* replies → [ThreadPost]) render empty reply cards.
|
|
437
|
+
*
|
|
438
|
+
* For self-referential relations, each row gets 2–4 sibling IDs (excluding
|
|
439
|
+
* self). For cross-entity relations, IDs are picked from the target store.
|
|
440
|
+
* The runtime caps recursion at depth=2 in `populateRelations`, so
|
|
441
|
+
* grandparent-of-self cycles render two levels deep then stop.
|
|
442
|
+
*/
|
|
443
|
+
linkRelationFields(): void;
|
|
435
444
|
/**
|
|
436
445
|
* Seed an entity with pre-authored instance data.
|
|
437
446
|
*/
|
|
@@ -444,6 +453,13 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
|
|
|
444
453
|
* Generate a single mock item based on field schemas.
|
|
445
454
|
*/
|
|
446
455
|
private generateMockItem;
|
|
456
|
+
/** Max nesting depth for recursive array/object schemas (e.g. a Comment
|
|
457
|
+
* entity whose `replies: [Comment]` field references itself). Without
|
|
458
|
+
* this guard, generateArrayValue → generateObjectValue → generateArray…
|
|
459
|
+
* recurses until stack overflow on every recursive type. Three levels
|
|
460
|
+
* is enough to render a useful thread depth (parent → reply → sub-reply)
|
|
461
|
+
* in catalog/preview without blowing the fixture. */
|
|
462
|
+
private static MAX_NESTED_DEPTH;
|
|
447
463
|
/**
|
|
448
464
|
* Generate a mock value for a field based on its schema.
|
|
449
465
|
*/
|
|
@@ -886,4 +902,4 @@ declare namespace index {
|
|
|
886
902
|
export { type index_ComposeBehaviorsInput as ComposeBehaviorsInput, type index_ComposeBehaviorsResult as ComposeBehaviorsResult, type index_EventWiringEntry as EventWiringEntry, type index_LayoutStrategy as LayoutStrategy, type index_PipeStep as PipeStep, index_applyEventWiring as applyEventWiring, index_composeBehaviors as composeBehaviors, index_detectLayoutStrategy as detectLayoutStrategy, index_pipeBehaviors as pipeBehaviors };
|
|
887
903
|
}
|
|
888
904
|
|
|
889
|
-
export { BindingContext, type ClientEventBus, type ComposeBehaviorsInput, type ComposeBehaviorsResult, type CreateClientEffectHandlersOptions, type CreateServerEffectHandlersOptions, EffectContext, EffectExecutor, type EffectExecutorOptions, EffectHandlers, EffectResult, type
|
|
905
|
+
export { BindingContext, type ClientEventBus, type ComposeBehaviorsInput, type ComposeBehaviorsResult, type CreateClientEffectHandlersOptions, type CreateServerEffectHandlersOptions, EffectContext, EffectExecutor, type EffectExecutorOptions, EffectHandlers, EffectResult, type EntitySchema, type EventWiringEntry, ExecutionEnvironment, ImportChainLike, type LayoutStrategy, LoadResult, LoadedOrbital, LoadedSchema, MockPersistenceAdapter, type MockPersistenceConfig, type PayloadMismatch, type PayloadValidationFailure, PersistenceAdapter, type PipeStep, SchemaLoader, type ServerEffectResult, type SlotSetter, TraitDefinition, UnifiedLoaderOptions, applyEventWiring, buildEmitsFromTraits, composeBehaviors, index as composition, containsBindings, createClientEffectHandlers, createContextFromBindings, createMockPersistence, createServerEffectHandlers, createTestExecutor, createUnifiedLoader, detectLayoutStrategy, extractBindings, formatPayloadValidationError, interpolateProps, interpolateValue, pipeBehaviors, validateEventPayload, validatePayloadShapes };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EffectExecutor, createContextFromBindings } from './chunk-
|
|
2
|
-
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-
|
|
1
|
+
import { EffectExecutor, createContextFromBindings } from './chunk-TNK77RLG.js';
|
|
2
|
+
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, buildEmitsFromTraits, collectDeclaredConfigDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, normalizeEventKey, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-TNK77RLG.js';
|
|
3
3
|
import { __export } from './chunk-PZ5AY32C.js';
|
|
4
4
|
import { createLogger } from '@almadar/logger';
|
|
5
5
|
import { evaluate } from '@almadar/evaluator';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/runtime",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.0",
|
|
4
4
|
"description": "Interpreted runtime for Almadar orbital applications (OrbitalServerRuntime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@almadar/core": "^
|
|
45
|
+
"@almadar/core": "^9.2.0",
|
|
46
46
|
"@almadar/evaluator": ">=2.9.2",
|
|
47
47
|
"@almadar/logger": "^1.0.0",
|
|
48
48
|
"@almadar/std": ">=7.2.4",
|