@almadar/runtime 6.75.0 → 6.76.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-Buvz7dd7.d.ts → OrbitalServerRuntime-eSaLgPR6.d.ts} +13 -3
- package/dist/OrbitalServerRuntime.d.ts +1 -1
- package/dist/OrbitalServerRuntime.js +30 -15
- package/dist/{chunk-CEYC3Z2O.js → chunk-KAGXDW33.js} +54 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +2 -2
- package/package.json +3 -3
|
@@ -1635,12 +1635,22 @@ declare class OrbitalServerRuntime {
|
|
|
1635
1635
|
* entity, its auxiliary entities, then other registered orbitals' primary
|
|
1636
1636
|
* entities (cross-orbital binds like a membership rail in the chat page). */
|
|
1637
1637
|
private isSharedEntity;
|
|
1638
|
+
/** Resolve an entity by name the same way `isSharedEntity` does: the
|
|
1639
|
+
* orbital's own entity, its auxiliary entities, then other registered
|
|
1640
|
+
* orbitals' primary entities (cross-orbital binds like a membership rail
|
|
1641
|
+
* in the chat page). The one entity-resolution walk shared by every
|
|
1642
|
+
* field-level lookup (`intrinsicFieldNames`, `entityFieldsFor`) so a new
|
|
1643
|
+
* lookup never grows a second copy of this walk. */
|
|
1644
|
+
private resolveEntityByName;
|
|
1638
1645
|
/** Names of an entity's `@intrinsic` fields — trait-owned view state
|
|
1639
1646
|
* (`ChatMessage.activeChannel`, `ChannelMember.pendingChannelId`, …) that
|
|
1640
|
-
* is NEVER a persisted column.
|
|
1641
|
-
* `isSharedEntity` does: the orbital's own entity, its auxiliary
|
|
1642
|
-
* entities, then other registered orbitals' primary entities. */
|
|
1647
|
+
* is NEVER a persisted column. */
|
|
1643
1648
|
private intrinsicFieldNames;
|
|
1649
|
+
/** Full declared field list for an entity — the schema source `persist
|
|
1650
|
+
* create`'s required-column check reads (`EffectExecutor.
|
|
1651
|
+
* resolveEntityFields`), via the same `resolveEntityByName` walk
|
|
1652
|
+
* `intrinsicFieldNames` uses. */
|
|
1653
|
+
private entityFieldsFor;
|
|
1644
1654
|
/**
|
|
1645
1655
|
* Process an event for an orbital
|
|
1646
1656
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
export { K as ClientEffectTuple, M as ClientNavigateBackTuple, N as ClientNavigateTuple, Q as ClientRenderUITuple, e as InMemoryPersistence, T as LiveBroadcastItem, V as LoaderConfig, O as OrbitalEventRequest, g as OrbitalEventResponse, W as OrbitalServerRuntime, h as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, m as RuntimeOrbital, n as RuntimeOrbitalSchema, o as RuntimeTrait, X as RuntimeTraitTick, r as collectDeclaredConfigDefaults, Y as createOrbitalServerRuntime } from './OrbitalServerRuntime-
|
|
2
|
+
export { K as ClientEffectTuple, M as ClientNavigateBackTuple, N as ClientNavigateTuple, Q as ClientRenderUITuple, e as InMemoryPersistence, T as LiveBroadcastItem, V as LoaderConfig, O as OrbitalEventRequest, g as OrbitalEventResponse, W as OrbitalServerRuntime, h as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, m as RuntimeOrbital, n as RuntimeOrbitalSchema, o as RuntimeTrait, X as RuntimeTraitTick, r as collectDeclaredConfigDefaults, Y as createOrbitalServerRuntime } from './OrbitalServerRuntime-eSaLgPR6.js';
|
|
3
3
|
import './types-BO4tbEPp.js';
|
|
4
4
|
import '@almadar/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createTickScheduler, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, normalizeCallSiteConfigToValues, StateMachineManager, parseDurationString, validateEventPayload, formatPayloadValidationError, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, EffectExecutor, LIFECYCLE_EVENTS } from './chunk-
|
|
2
|
-
export { InMemoryPersistence, collectDeclaredConfigDefaults } from './chunk-
|
|
1
|
+
import { createTickScheduler, EventBus, createUnifiedLoader, MockPersistenceAdapter, InMemoryPersistence, preprocessSchema, normalizeCallSiteConfigToValues, StateMachineManager, parseDurationString, validateEventPayload, formatPayloadValidationError, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, EffectExecutor, LIFECYCLE_EVENTS } from './chunk-KAGXDW33.js';
|
|
2
|
+
export { InMemoryPersistence, collectDeclaredConfigDefaults } from './chunk-KAGXDW33.js';
|
|
3
3
|
import { isValidCronExpression } from './chunk-OU3ITB5S.js';
|
|
4
4
|
import { createContextFromBindings, checkMutationAccess, applyRowAccess, accessDeniedMessage } from './chunk-ZWAOJT6R.js';
|
|
5
5
|
import './chunk-T4VDAB4C.js';
|
|
@@ -1266,23 +1266,36 @@ var OrbitalServerRuntime = class {
|
|
|
1266
1266
|
}
|
|
1267
1267
|
return false;
|
|
1268
1268
|
}
|
|
1269
|
-
/**
|
|
1270
|
-
*
|
|
1271
|
-
*
|
|
1272
|
-
*
|
|
1273
|
-
*
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
if (registered.entity.name === entityName) return
|
|
1269
|
+
/** Resolve an entity by name the same way `isSharedEntity` does: the
|
|
1270
|
+
* orbital's own entity, its auxiliary entities, then other registered
|
|
1271
|
+
* orbitals' primary entities (cross-orbital binds like a membership rail
|
|
1272
|
+
* in the chat page). The one entity-resolution walk shared by every
|
|
1273
|
+
* field-level lookup (`intrinsicFieldNames`, `entityFieldsFor`) so a new
|
|
1274
|
+
* lookup never grows a second copy of this walk. */
|
|
1275
|
+
resolveEntityByName(registered, entityName) {
|
|
1276
|
+
if (registered.entity.name === entityName) return registered.entity;
|
|
1277
1277
|
for (const aux of registered.schema.auxiliaryEntities ?? []) {
|
|
1278
1278
|
if (typeof aux === "object" && !isEntityCall(aux) && aux.name === entityName) {
|
|
1279
|
-
return
|
|
1279
|
+
return aux;
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
1282
|
for (const other of this.orbitals.values()) {
|
|
1283
|
-
if (other.entity.name === entityName) return
|
|
1283
|
+
if (other.entity.name === entityName) return other.entity;
|
|
1284
1284
|
}
|
|
1285
|
-
return
|
|
1285
|
+
return void 0;
|
|
1286
|
+
}
|
|
1287
|
+
/** Names of an entity's `@intrinsic` fields — trait-owned view state
|
|
1288
|
+
* (`ChatMessage.activeChannel`, `ChannelMember.pendingChannelId`, …) that
|
|
1289
|
+
* is NEVER a persisted column. */
|
|
1290
|
+
intrinsicFieldNames(registered, entityName) {
|
|
1291
|
+
return this.entityFieldsFor(registered, entityName).filter((field) => field.intrinsic === true && typeof field.name === "string").map((field) => field.name);
|
|
1292
|
+
}
|
|
1293
|
+
/** Full declared field list for an entity — the schema source `persist
|
|
1294
|
+
* create`'s required-column check reads (`EffectExecutor.
|
|
1295
|
+
* resolveEntityFields`), via the same `resolveEntityByName` walk
|
|
1296
|
+
* `intrinsicFieldNames` uses. */
|
|
1297
|
+
entityFieldsFor(registered, entityName) {
|
|
1298
|
+
return this.resolveEntityByName(registered, entityName)?.fields ?? [];
|
|
1286
1299
|
}
|
|
1287
1300
|
/**
|
|
1288
1301
|
* Process an event for an orbital
|
|
@@ -1982,7 +1995,8 @@ var OrbitalServerRuntime = class {
|
|
|
1982
1995
|
// Same render-time marker boundary as the outer executor
|
|
1983
1996
|
// (including the [shared]-defers-regardless-of-persistence rule).
|
|
1984
1997
|
deferRenderBindings: registered.entity === void 0 || isRuntimeEntity(registered.entity) || registered.entity.shared === true,
|
|
1985
|
-
resolveIntrinsicFields: (type) => this.intrinsicFieldNames(registered, type)
|
|
1998
|
+
resolveIntrinsicFields: (type) => this.intrinsicFieldNames(registered, type),
|
|
1999
|
+
resolveEntityFields: (type) => this.entityFieldsFor(registered, type)
|
|
1986
2000
|
});
|
|
1987
2001
|
for (const innerEffect of atomicEffects) {
|
|
1988
2002
|
if (atomicFailed) break;
|
|
@@ -2142,7 +2156,8 @@ var OrbitalServerRuntime = class {
|
|
|
2142
2156
|
// the eager clobber pinned the chat composer's controlled input to
|
|
2143
2157
|
// the server's flush-time "" on every keystroke round-trip.
|
|
2144
2158
|
deferRenderBindings: registered.entity === void 0 || isRuntimeEntity(registered.entity) || registered.entity.shared === true,
|
|
2145
|
-
resolveIntrinsicFields: (type) => this.intrinsicFieldNames(registered, type)
|
|
2159
|
+
resolveIntrinsicFields: (type) => this.intrinsicFieldNames(registered, type),
|
|
2160
|
+
resolveEntityFields: (type) => this.entityFieldsFor(registered, type)
|
|
2146
2161
|
});
|
|
2147
2162
|
await executor.executeAll(effects);
|
|
2148
2163
|
}
|
|
@@ -6,7 +6,7 @@ import { createLogger, setNamespaceLevel } from '@almadar/logger';
|
|
|
6
6
|
import { evaluateGuard, SExpressionEvaluator } from '@almadar/evaluator';
|
|
7
7
|
import { omitFrameFields, OrbitalSchemaSchema, isInlineTrait, isEntityCall, isEntityReference, parseEntityRef, parseImportedTraitRef, isPageReference, isPageReferenceString, isPageReferenceObject, parsePageRef, parseOrbitalRef, overrideDeclaredKnobs, asTraitId, asEntityId, asPageId, asOrbitalId, deriveId, isReferenceConfigType, configRefEventKnob, normalizeCallSiteConfigToValues, resolveConfigRefEventName, isCallSiteConfigDeclaration, asEventId, ledgerRename, idPrefix, eventListPropsOf } from '@almadar/core';
|
|
8
8
|
export { normalizeCallSiteConfigToValues } from '@almadar/core';
|
|
9
|
-
import { sampleRowCount, linkSelfRelationField, sampleRow, identityEntitiesOf, roleVocabularyOf } from '@almadar/core/mock';
|
|
9
|
+
import { RESERVED_FIELD_NAMES, sampleRowCount, linkSelfRelationField, sampleRow, identityEntitiesOf, roleVocabularyOf } from '@almadar/core/mock';
|
|
10
10
|
|
|
11
11
|
var log = createLogger("almadar:runtime:eventbus");
|
|
12
12
|
var EventBus = class {
|
|
@@ -989,6 +989,7 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
989
989
|
evaluator;
|
|
990
990
|
deferRenderBindings;
|
|
991
991
|
resolveIntrinsicFields;
|
|
992
|
+
resolveEntityFields;
|
|
992
993
|
constructor(options) {
|
|
993
994
|
this.handlers = options.handlers;
|
|
994
995
|
this.bindings = options.bindings;
|
|
@@ -999,6 +1000,7 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
999
1000
|
this.evaluator = options.evaluator;
|
|
1000
1001
|
this.deferRenderBindings = options.deferRenderBindings ?? false;
|
|
1001
1002
|
this.resolveIntrinsicFields = options.resolveIntrinsicFields;
|
|
1003
|
+
this.resolveEntityFields = options.resolveEntityFields;
|
|
1002
1004
|
}
|
|
1003
1005
|
/**
|
|
1004
1006
|
* `@intrinsic` fields are NEVER a persisted column — strips them from
|
|
@@ -1015,6 +1017,36 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1015
1017
|
const intrinsicFields = this.resolveIntrinsicFields(entityType);
|
|
1016
1018
|
return intrinsicFields.length > 0 ? omitFrameFields(data, intrinsicFields) : data;
|
|
1017
1019
|
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Names of `data`'s missing REQUIRED columns for a `persist create` —
|
|
1022
|
+
* shared with the Rust kernel's definition: an entity field with
|
|
1023
|
+
* `required: true`, excluding the framework-stamped columns
|
|
1024
|
+
* (`RESERVED_FIELD_NAMES` — id/audit timestamps the store mints, the
|
|
1025
|
+
* same set `@almadar/core`'s mock synthesis and `MockPersistenceAdapter`
|
|
1026
|
+
* already exempt), any `@intrinsic` field, any field declaring a
|
|
1027
|
+
* `default` (the store fills it in), and any field carrying `mergedFrom`
|
|
1028
|
+
* (a rebind-merged field's `required` is the imported atom's own write
|
|
1029
|
+
* contract, never this host writer's). "Missing" is key-absent or
|
|
1030
|
+
* `undefined`/`null`/`''`. A no-op (`[]`) when no schema was supplied
|
|
1031
|
+
* (`resolveEntityFields` absent).
|
|
1032
|
+
*/
|
|
1033
|
+
missingRequiredFields(entityType, data) {
|
|
1034
|
+
if (!this.resolveEntityFields) return [];
|
|
1035
|
+
const row = data ?? {};
|
|
1036
|
+
const missing = [];
|
|
1037
|
+
for (const field of this.resolveEntityFields(entityType)) {
|
|
1038
|
+
if (field.required !== true || !field.name) continue;
|
|
1039
|
+
if (RESERVED_FIELD_NAMES.has(field.name)) continue;
|
|
1040
|
+
if (field.intrinsic === true) continue;
|
|
1041
|
+
if (field.default !== void 0) continue;
|
|
1042
|
+
if (field.mergedFrom !== void 0) continue;
|
|
1043
|
+
const value = row[field.name];
|
|
1044
|
+
if (value === void 0 || value === null || value === "") {
|
|
1045
|
+
missing.push(field.name);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
return missing;
|
|
1049
|
+
}
|
|
1018
1050
|
_evaluator;
|
|
1019
1051
|
getEvaluator() {
|
|
1020
1052
|
if (this.evaluator) return this.evaluator;
|
|
@@ -1428,11 +1460,14 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1428
1460
|
}
|
|
1429
1461
|
try {
|
|
1430
1462
|
if (action === "batch") {
|
|
1463
|
+
const requiredMissing = [];
|
|
1431
1464
|
const operations = args[1].map((op) => {
|
|
1432
1465
|
if (!Array.isArray(op) || op.length < 2) return op;
|
|
1433
1466
|
const [opAction, opEntityType, ...opRest] = op;
|
|
1434
1467
|
if (opAction === "create") {
|
|
1435
1468
|
const stripped = this.stripFrameFields(opEntityType, opRest[0]);
|
|
1469
|
+
const missing = this.missingRequiredFields(opEntityType, stripped);
|
|
1470
|
+
if (missing.length > 0) requiredMissing.push({ entityType: opEntityType, missing });
|
|
1436
1471
|
return [opAction, opEntityType, stripped, ...opRest.slice(1)];
|
|
1437
1472
|
}
|
|
1438
1473
|
if (opAction === "update") {
|
|
@@ -1441,6 +1476,12 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1441
1476
|
}
|
|
1442
1477
|
return op;
|
|
1443
1478
|
});
|
|
1479
|
+
if (requiredMissing.length > 0) {
|
|
1480
|
+
persistLog.error("persist:required-missing", { action, entityType: "batch", requiredMissing });
|
|
1481
|
+
const missingError = requiredMissing.map(({ entityType: t, missing }) => `persist create ${t}: required field(s) ${missing.join(", ")} missing`).join("; ");
|
|
1482
|
+
this.emitFailure(emitCfg, new Error(missingError));
|
|
1483
|
+
return { failed: true, error: missingError };
|
|
1484
|
+
}
|
|
1444
1485
|
const batchSummary = await this.handlers.persist("batch", "", {
|
|
1445
1486
|
operations
|
|
1446
1487
|
});
|
|
@@ -1460,6 +1501,15 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1460
1501
|
} else {
|
|
1461
1502
|
const entityType = args[1];
|
|
1462
1503
|
const data = action === "create" || action === "update" ? this.stripFrameFields(entityType, args[2]) : args[2];
|
|
1504
|
+
if (action === "create") {
|
|
1505
|
+
const missing = this.missingRequiredFields(entityType, data);
|
|
1506
|
+
if (missing.length > 0) {
|
|
1507
|
+
persistLog.error("persist:required-missing", { entityType, missing });
|
|
1508
|
+
const missingError = `persist create ${entityType}: required field(s) ${missing.join(", ")} missing`;
|
|
1509
|
+
this.emitFailure(emitCfg, new Error(missingError), { entityType });
|
|
1510
|
+
return { failed: true, error: missingError };
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1463
1513
|
const persisted = await this.handlers.persist(action, entityType, data);
|
|
1464
1514
|
if (persisted === void 0) {
|
|
1465
1515
|
const attemptedId = typeof data === "string" ? data : data && typeof data === "object" ? data.id : void 0;
|
|
@@ -2592,7 +2642,7 @@ var MockPersistenceAdapter = class _MockPersistenceAdapter {
|
|
|
2592
2642
|
const store = this.stores.get(storeKey);
|
|
2593
2643
|
if (!store) return;
|
|
2594
2644
|
const candidates = schema.fields.filter(
|
|
2595
|
-
(f) => f.name
|
|
2645
|
+
(f) => f.name === void 0 || !RESERVED_FIELD_NAMES.has(f.name)
|
|
2596
2646
|
);
|
|
2597
2647
|
if (candidates.length === 0) return;
|
|
2598
2648
|
let index = 0;
|
|
@@ -2767,7 +2817,7 @@ var MockPersistenceAdapter = class _MockPersistenceAdapter {
|
|
|
2767
2817
|
if (!schema) return data;
|
|
2768
2818
|
const result = { ...data };
|
|
2769
2819
|
for (const field of schema.fields) {
|
|
2770
|
-
if (field.name
|
|
2820
|
+
if (field.name !== void 0 && RESERVED_FIELD_NAMES.has(field.name)) continue;
|
|
2771
2821
|
if (result[field.name] !== void 0) continue;
|
|
2772
2822
|
if (field.default === void 0) continue;
|
|
2773
2823
|
result[field.name] = field.default === "@now" ? (/* @__PURE__ */ new Date()).toISOString() : field.default;
|
|
@@ -5435,6 +5485,7 @@ function mergeImportedEntityFields(callerEntity, importedEntity, intrinsicOnly,
|
|
|
5435
5485
|
if (existingNames.has(field.name)) continue;
|
|
5436
5486
|
const cloned = structuredClone(field);
|
|
5437
5487
|
rewriteSelfRelationTarget(cloned, oldName, newName, newId);
|
|
5488
|
+
cloned.mergedFrom = oldName;
|
|
5438
5489
|
callerEntity.fields.push(cloned);
|
|
5439
5490
|
}
|
|
5440
5491
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h as RuntimePatternValue, B as BindingContext, f as EvaluationContextExtensions, P as PatternProps, E as EffectHandlers, g as EffectContext, i as ExecutionEnvironment, j as EffectResult, T as TraitDefinition } from './types-BO4tbEPp.js';
|
|
2
2
|
export { k as BrowserFileMeta, l as BrowserFilePickerOptions, m as BrowserGeolocationOptions, n as BrowserGeolocationPosition, C as ConfigContext, o as Effect, a as EventListener, H as HANDLER_MANIFEST, I as IEventBus, b as RuntimeConfig, R as RuntimeEvent, d as TraitState, c as TransitionObserver, e as TransitionResult, U as Unsubscribe } from './types-BO4tbEPp.js';
|
|
3
|
-
import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital, P as PersistenceAdapter } from './OrbitalServerRuntime-
|
|
4
|
-
export { C as CreateServerEffectHandlersOptions, E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, e as InMemoryPersistence, f as LIFECYCLE_EVENTS, O as OrbitalEventRequest, g as OrbitalEventResponse, h as OrbitalServerRuntimeConfig, i as PreprocessOptions, j as PreprocessResult, k as PreprocessedSchema, l as ProcessEventOptions, R as RegisteredOrbital, m as RuntimeOrbital, n as RuntimeOrbitalSchema, o as RuntimeTrait, p as ServerEffectResult, q as StateMachineManager, r as collectDeclaredConfigDefaults, s as collectDeclaredEntityDefaults, t as createInitialTraitState, u as createServerEffectHandlers, v as findInitialState, w as findTransition, x as getIsolatedCollectionName, y as getNamespacedEvent, z as isBrowser, A as isElectron, B as isNamespacedEvent, D as isNode, F as normalizeEventKey, G as parseNamespacedEvent, H as preprocessSchema, J as processEvent } from './OrbitalServerRuntime-
|
|
3
|
+
import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital, P as PersistenceAdapter } from './OrbitalServerRuntime-eSaLgPR6.js';
|
|
4
|
+
export { C as CreateServerEffectHandlersOptions, E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, e as InMemoryPersistence, f as LIFECYCLE_EVENTS, O as OrbitalEventRequest, g as OrbitalEventResponse, h as OrbitalServerRuntimeConfig, i as PreprocessOptions, j as PreprocessResult, k as PreprocessedSchema, l as ProcessEventOptions, R as RegisteredOrbital, m as RuntimeOrbital, n as RuntimeOrbitalSchema, o as RuntimeTrait, p as ServerEffectResult, q as StateMachineManager, r as collectDeclaredConfigDefaults, s as collectDeclaredEntityDefaults, t as createInitialTraitState, u as createServerEffectHandlers, v as findInitialState, w as findTransition, x as getIsolatedCollectionName, y as getNamespacedEvent, z as isBrowser, A as isElectron, B as isNamespacedEvent, D as isNode, F as normalizeEventKey, G as parseNamespacedEvent, H as preprocessSchema, J as processEvent } from './OrbitalServerRuntime-eSaLgPR6.js';
|
|
5
5
|
import { EvaluationContext, SExpressionEvaluator } from '@almadar/evaluator';
|
|
6
6
|
export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
|
|
7
|
-
import { RenderBindingMarker, SExpr, RuntimeValue, EventPayload, PatternConfig, EntityId,
|
|
7
|
+
import { RenderBindingMarker, SExpr, RuntimeValue, EntityField, EventPayload, PatternConfig, EntityId, EntityRow, EntityPersistence, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
|
8
8
|
export { EntityField, normalizeCallSiteConfigToValues } from '@almadar/core';
|
|
9
9
|
export { AccessBindings, applyRowAccess, checkMutationAccess } from './entityAccess.js';
|
|
10
10
|
export { ServerBridgeConfig, ServerBridgeState } from './ServerBridge.js';
|
|
@@ -363,6 +363,16 @@ interface EffectExecutorOptions {
|
|
|
363
363
|
* persist writes verbatim exactly as before.
|
|
364
364
|
*/
|
|
365
365
|
resolveIntrinsicFields?: (entityType: string) => readonly string[];
|
|
366
|
+
/**
|
|
367
|
+
* Full declared field list for an entity, keyed by entity type. Supplied
|
|
368
|
+
* by the same caller as `resolveIntrinsicFields` (`OrbitalServerRuntime`,
|
|
369
|
+
* via the same entity-resolution walk — no second lookup path); the
|
|
370
|
+
* `persist create` case uses it to fail a write missing a REQUIRED
|
|
371
|
+
* column before it reaches the store, mirroring the Rust kernel's check.
|
|
372
|
+
* Absent means "no schema available", in which case `persist create`
|
|
373
|
+
* writes verbatim exactly as before.
|
|
374
|
+
*/
|
|
375
|
+
resolveEntityFields?: (entityType: string) => readonly EntityField[];
|
|
366
376
|
}
|
|
367
377
|
/**
|
|
368
378
|
* EffectExecutor - Routes effects to handlers.
|
|
@@ -400,6 +410,7 @@ declare class EffectExecutor {
|
|
|
400
410
|
private evaluator?;
|
|
401
411
|
private deferRenderBindings;
|
|
402
412
|
private resolveIntrinsicFields?;
|
|
413
|
+
private resolveEntityFields?;
|
|
403
414
|
constructor(options: EffectExecutorOptions);
|
|
404
415
|
/**
|
|
405
416
|
* `@intrinsic` fields are NEVER a persisted column — strips them from
|
|
@@ -412,6 +423,20 @@ declare class EffectExecutor {
|
|
|
412
423
|
* intrinsic fields.
|
|
413
424
|
*/
|
|
414
425
|
private stripFrameFields;
|
|
426
|
+
/**
|
|
427
|
+
* Names of `data`'s missing REQUIRED columns for a `persist create` —
|
|
428
|
+
* shared with the Rust kernel's definition: an entity field with
|
|
429
|
+
* `required: true`, excluding the framework-stamped columns
|
|
430
|
+
* (`RESERVED_FIELD_NAMES` — id/audit timestamps the store mints, the
|
|
431
|
+
* same set `@almadar/core`'s mock synthesis and `MockPersistenceAdapter`
|
|
432
|
+
* already exempt), any `@intrinsic` field, any field declaring a
|
|
433
|
+
* `default` (the store fills it in), and any field carrying `mergedFrom`
|
|
434
|
+
* (a rebind-merged field's `required` is the imported atom's own write
|
|
435
|
+
* contract, never this host writer's). "Missing" is key-absent or
|
|
436
|
+
* `undefined`/`null`/`''`. A no-op (`[]`) when no schema was supplied
|
|
437
|
+
* (`resolveEntityFields` absent).
|
|
438
|
+
*/
|
|
439
|
+
private missingRequiredFields;
|
|
415
440
|
private _evaluator?;
|
|
416
441
|
private getEvaluator;
|
|
417
442
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EffectExecutor } from './chunk-
|
|
2
|
-
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, LIFECYCLE_EVENTS, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, createInitialTraitState, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-
|
|
1
|
+
import { EffectExecutor } from './chunk-KAGXDW33.js';
|
|
2
|
+
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, LIFECYCLE_EVENTS, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, createInitialTraitState, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-KAGXDW33.js';
|
|
3
3
|
export { cronMatches, cronMinuteKey, isValidCronExpression, parseCron, parseCronField } from './chunk-OU3ITB5S.js';
|
|
4
4
|
import { createContextFromBindings, applyRowAccess, checkMutationAccess, accessDeniedMessage } from './chunk-ZWAOJT6R.js';
|
|
5
5
|
export { applyRowAccess, checkMutationAccess, containsBindings, createContextFromBindings, createMinimalContext, deferEntityBindings, extractBindings, interpolateProps, interpolateValue } from './chunk-ZWAOJT6R.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/runtime",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.76.0",
|
|
4
4
|
"description": "Interpreted runtime for Almadar orbital applications (OrbitalServerRuntime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@almadar/core": "^10.
|
|
60
|
+
"@almadar/core": "^10.91.0",
|
|
61
61
|
"@almadar/evaluator": "^2.45.0",
|
|
62
62
|
"@almadar/logger": "^1.12.0",
|
|
63
63
|
"@almadar/server": "^2.41.0",
|
|
64
|
-
"@almadar/std": "^16.
|
|
64
|
+
"@almadar/std": "^16.212.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"express": "^5.0.0"
|