@almadar/runtime 6.45.0 → 6.46.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.
|
@@ -1348,6 +1348,15 @@ declare class OrbitalServerRuntime {
|
|
|
1348
1348
|
setDefaultUser(user: UserContext | undefined): void;
|
|
1349
1349
|
/** The viewer a dev host is currently presenting the app as. */
|
|
1350
1350
|
getDefaultUser(): UserContext | undefined;
|
|
1351
|
+
/**
|
|
1352
|
+
* The registered app's declared persona roster: the live rows of its
|
|
1353
|
+
* `[identity]` entity, mapped onto viewers (`Almadar_LOLO_Identity.md` §4.3).
|
|
1354
|
+
* Live-store rows rather than a re-derivation, so the roster carries the ids
|
|
1355
|
+
* ownership scoping actually compares `@user.id` against. Empty when no
|
|
1356
|
+
* schema is registered or the app declares no `[identity]` entity — there is
|
|
1357
|
+
* no global fallback roster by design.
|
|
1358
|
+
*/
|
|
1359
|
+
getIdentityRoster(): Promise<UserContext[]>;
|
|
1351
1360
|
/**
|
|
1352
1361
|
* `traitFieldStates` key for one trait: its own name, or — when its linked
|
|
1353
1362
|
* entity is `[shared]` — `$shared::<entityName>` so every trait bound to
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
export { F as ClientEffectTuple, G as ClientNavigateTuple, H as ClientNotifyTuple, J as ClientRenderUITuple, K as EffectResult, e as InMemoryPersistence, M as LiveBroadcastItem, N as LoaderConfig, O as OrbitalEventRequest, f as OrbitalEventResponse, Q as OrbitalServerRuntime, g as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, l as RuntimeOrbital, m as RuntimeOrbitalSchema, n as RuntimeTrait, T as RuntimeTraitTick, p as collectDeclaredConfigDefaults, V as createOrbitalServerRuntime } from './OrbitalServerRuntime-
|
|
2
|
+
export { F as ClientEffectTuple, G as ClientNavigateTuple, H as ClientNotifyTuple, J as ClientRenderUITuple, K as EffectResult, e as InMemoryPersistence, M as LiveBroadcastItem, N as LoaderConfig, O as OrbitalEventRequest, f as OrbitalEventResponse, Q as OrbitalServerRuntime, g as OrbitalServerRuntimeConfig, P as PersistenceAdapter, R as RegisteredOrbital, l as RuntimeOrbital, m as RuntimeOrbitalSchema, n as RuntimeTrait, T as RuntimeTraitTick, p as collectDeclaredConfigDefaults, V as createOrbitalServerRuntime } from './OrbitalServerRuntime-e-5490xl.js';
|
|
3
3
|
import './types-CL03tjGU.js';
|
|
4
4
|
import '@almadar/core';
|
|
@@ -7,7 +7,7 @@ import './chunk-MLKGABMK.js';
|
|
|
7
7
|
import { createLogger } from '@almadar/logger';
|
|
8
8
|
import * as nodeModule from 'module';
|
|
9
9
|
import { evaluateListenPayloadExpr, evaluateGuard, evaluate } from '@almadar/evaluator';
|
|
10
|
-
import { DEFAULT_VIEWER, buildResolvedTraitConfigs, isInlineTrait, isEntityCall, applyListenPayloadMapping, normalizeUserContext, isRuntimeEntity } from '@almadar/core';
|
|
10
|
+
import { DEFAULT_VIEWER, buildResolvedTraitConfigs, isInlineTrait, isEntityCall, applyListenPayloadMapping, personaFromIdentityRow, normalizeUserContext, isRuntimeEntity } from '@almadar/core';
|
|
11
11
|
import { ownerFieldsFromSchema, identityEntityName } from '@almadar/core/mock';
|
|
12
12
|
|
|
13
13
|
// src/identity/routing.ts
|
|
@@ -922,6 +922,22 @@ var OrbitalServerRuntime = class {
|
|
|
922
922
|
getDefaultUser() {
|
|
923
923
|
return this.config.defaultUser;
|
|
924
924
|
}
|
|
925
|
+
/**
|
|
926
|
+
* The registered app's declared persona roster: the live rows of its
|
|
927
|
+
* `[identity]` entity, mapped onto viewers (`Almadar_LOLO_Identity.md` §4.3).
|
|
928
|
+
* Live-store rows rather than a re-derivation, so the roster carries the ids
|
|
929
|
+
* ownership scoping actually compares `@user.id` against. Empty when no
|
|
930
|
+
* schema is registered or the app declares no `[identity]` entity — there is
|
|
931
|
+
* no global fallback roster by design.
|
|
932
|
+
*/
|
|
933
|
+
async getIdentityRoster() {
|
|
934
|
+
const schema = this.resolvedSchema;
|
|
935
|
+
if (!schema) return [];
|
|
936
|
+
const entityName = identityEntityName(schema);
|
|
937
|
+
if (!entityName) return [];
|
|
938
|
+
const rows = await this.persistence.list(entityName);
|
|
939
|
+
return rows.map((row) => personaFromIdentityRow(row)).filter((p) => p !== void 0);
|
|
940
|
+
}
|
|
925
941
|
// ==========================================================================
|
|
926
942
|
// Event Processing
|
|
927
943
|
// ==========================================================================
|
|
@@ -1134,6 +1150,15 @@ var OrbitalServerRuntime = class {
|
|
|
1134
1150
|
*/
|
|
1135
1151
|
async executeEffects(registered, traitName, effects, payload, entityData, entityId, emittedEvents, fetchedData, clientEffects, effectResults, user, clientEffectsByTrait, onPush, originClientId) {
|
|
1136
1152
|
const entityType = registered.entity.name;
|
|
1153
|
+
for (const eff of effects) {
|
|
1154
|
+
if (Array.isArray(eff) && eff[0] === "fetch") {
|
|
1155
|
+
xOrbitalLog.debug("fetch:pre-exec-keys", () => ({
|
|
1156
|
+
trait: traitName,
|
|
1157
|
+
entity: String(eff[1]),
|
|
1158
|
+
optKeys: Object.keys(eff[2] ?? {}).join("+")
|
|
1159
|
+
}));
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1137
1162
|
const pushClientEffect = (effect) => {
|
|
1138
1163
|
clientEffects.push(effect);
|
|
1139
1164
|
clientEffectsByTrait?.push({ traitName, effect });
|
|
@@ -1396,15 +1421,6 @@ var OrbitalServerRuntime = class {
|
|
|
1396
1421
|
},
|
|
1397
1422
|
fetch: async (fetchEntityType, options) => {
|
|
1398
1423
|
try {
|
|
1399
|
-
xOrbitalLog.info("fetch:enter", () => ({
|
|
1400
|
-
entityType: fetchEntityType,
|
|
1401
|
-
hasOptions: options !== void 0 && options !== null,
|
|
1402
|
-
optionsKeys: options ? Object.keys(options).join(",") : "",
|
|
1403
|
-
filterType: typeof options?.filter,
|
|
1404
|
-
filterIsArray: Array.isArray(options?.filter),
|
|
1405
|
-
filterJson: JSON.stringify(options?.filter ?? null).slice(0, 300),
|
|
1406
|
-
payloadJson: JSON.stringify(bindingsRef?.payload ?? null).slice(0, 300)
|
|
1407
|
-
}));
|
|
1408
1424
|
let result = null;
|
|
1409
1425
|
let total = 0;
|
|
1410
1426
|
if (options?.id) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { g as RuntimePatternValue, B as BindingContext, f as EvaluationContextExtensions, P as PatternProps, E as EffectHandlers, h as EffectContext, i as ExecutionEnvironment, j as EffectResult, T as TraitDefinition } from './types-CL03tjGU.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-CL03tjGU.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 { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, e as InMemoryPersistence, O as OrbitalEventRequest, f as OrbitalEventResponse, g as OrbitalServerRuntimeConfig, h as PreprocessOptions, i as PreprocessResult, j as PreprocessedSchema, k as ProcessEventOptions, R as RegisteredOrbital, l as RuntimeOrbital, m as RuntimeOrbitalSchema, n as RuntimeTrait, o as StateMachineManager, p as collectDeclaredConfigDefaults, q as collectDeclaredEntityDefaults, r as createInitialTraitState, s as findInitialState, t as findTransition, u as getIsolatedCollectionName, v as getNamespacedEvent, w as isBrowser, x as isElectron, y as isNamespacedEvent, z as isNode, A as normalizeEventKey, B as parseNamespacedEvent, C as preprocessSchema, D 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-e-5490xl.js';
|
|
4
|
+
export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, e as InMemoryPersistence, O as OrbitalEventRequest, f as OrbitalEventResponse, g as OrbitalServerRuntimeConfig, h as PreprocessOptions, i as PreprocessResult, j as PreprocessedSchema, k as ProcessEventOptions, R as RegisteredOrbital, l as RuntimeOrbital, m as RuntimeOrbitalSchema, n as RuntimeTrait, o as StateMachineManager, p as collectDeclaredConfigDefaults, q as collectDeclaredEntityDefaults, r as createInitialTraitState, s as findInitialState, t as findTransition, u as getIsolatedCollectionName, v as getNamespacedEvent, w as isBrowser, x as isElectron, y as isNamespacedEvent, z as isNode, A as normalizeEventKey, B as parseNamespacedEvent, C as preprocessSchema, D as processEvent } from './OrbitalServerRuntime-e-5490xl.js';
|
|
5
5
|
import { EvaluationContext, SExpressionEvaluator } from '@almadar/evaluator';
|
|
6
6
|
export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
|
|
7
7
|
import { RenderBindingMarker, SExpr, TraitConfigObject, EventPayload, PatternConfig, EntityId, EntityField, EntityRow, EntityPersistence, ServiceParams, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
|
package/dist/index.js
CHANGED
|
@@ -409,15 +409,6 @@ function createServerEffectHandlers(opts) {
|
|
|
409
409
|
},
|
|
410
410
|
fetch: async (fetchEntityType, options) => {
|
|
411
411
|
try {
|
|
412
|
-
effectLog.info("clientFetch:enter", () => ({
|
|
413
|
-
entityType: fetchEntityType,
|
|
414
|
-
hasOptions: options !== void 0 && options !== null,
|
|
415
|
-
optionsKeys: options ? Object.keys(options).join(",") : "",
|
|
416
|
-
filterType: typeof options?.filter,
|
|
417
|
-
filterIsArray: Array.isArray(options?.filter),
|
|
418
|
-
filterJson: JSON.stringify(options?.filter ?? null).slice(0, 300),
|
|
419
|
-
payloadJson: JSON.stringify(bindings?.payload ?? null).slice(0, 300)
|
|
420
|
-
}));
|
|
421
412
|
let result = null;
|
|
422
413
|
let total = 0;
|
|
423
414
|
if (options?.id) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/runtime",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.46.0",
|
|
4
4
|
"description": "Interpreted runtime for Almadar orbital applications (OrbitalServerRuntime)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@almadar/core": "^10.
|
|
55
|
+
"@almadar/core": "^10.44.0",
|
|
56
56
|
"@almadar/evaluator": "^2.38.0",
|
|
57
57
|
"@almadar/logger": "^1.10.0",
|
|
58
|
-
"@almadar/server": "^2.
|
|
59
|
-
"@almadar/std": "^16.
|
|
58
|
+
"@almadar/server": "^2.30.0",
|
|
59
|
+
"@almadar/std": "^16.154.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"express": "^5.0.0"
|