@sylphx/lens-server 1.3.0 → 1.3.2
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 +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/server/create.ts +7 -3
- package/src/state/graph-state-manager.ts +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { query, mutation, router, QueryBuilder, MutationBuilder, QueryDef as QueryDef2, MutationDef as MutationDef2, RouterDef as RouterDef2, RouterRoutes, ResolverFn, ResolverContext, InferRouterContext as InferRouterContext2 } from "@sylphx/lens-core";
|
|
2
2
|
import { ContextValue, EntityDef, EntityDefinition, EntityResolvers, EntityResolversDefinition, InferRouterContext, MutationDef, QueryDef, RelationDef, RelationTypeWithForeignKey, RouterDef } from "@sylphx/lens-core";
|
|
3
|
-
import {
|
|
3
|
+
import { ArrayOperation, EmitCommand, EntityKey, InternalFieldUpdate, Update } from "@sylphx/lens-core";
|
|
4
4
|
/** Client connection interface */
|
|
5
5
|
interface StateClient {
|
|
6
6
|
id: string;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/lens-server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Server runtime for Lens API framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "SylphxAI",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sylphx/lens-core": "^1.3.
|
|
32
|
+
"@sylphx/lens-core": "^1.3.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^5.9.3",
|
package/src/server/create.ts
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
12
|
type ContextValue,
|
|
13
|
-
type Emit,
|
|
14
13
|
type EmitCommand,
|
|
15
14
|
type EntityDef,
|
|
16
15
|
type EntityDefinition,
|
|
@@ -679,7 +678,10 @@ class LensServerImpl<
|
|
|
679
678
|
const entityName = this.getEntityNameFromOutput(queryDef._output);
|
|
680
679
|
if (entityName) {
|
|
681
680
|
// For entity-typed outputs, use GraphStateManager
|
|
682
|
-
const entities = this.extractEntities(
|
|
681
|
+
const entities = this.extractEntities(
|
|
682
|
+
entityName,
|
|
683
|
+
command.type === "full" ? command.data : {},
|
|
684
|
+
);
|
|
683
685
|
for (const { entity, id } of entities) {
|
|
684
686
|
this.stateManager.processCommand(entity, id, command);
|
|
685
687
|
}
|
|
@@ -1630,5 +1632,7 @@ export function createServer<
|
|
|
1630
1632
|
): LensServer & { _types: { queries: Q; mutations: M; context: TContext } } {
|
|
1631
1633
|
const server = new LensServerImpl(config) as LensServerImpl<Q, M, TContext>;
|
|
1632
1634
|
// Attach type marker for inference (stripped at runtime)
|
|
1633
|
-
return server as unknown as LensServer & {
|
|
1635
|
+
return server as unknown as LensServer & {
|
|
1636
|
+
_types: { queries: Q; mutations: M; context: TContext };
|
|
1637
|
+
};
|
|
1634
1638
|
}
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
|
-
type
|
|
14
|
-
type Update,
|
|
13
|
+
type ArrayOperation,
|
|
15
14
|
type EmitCommand,
|
|
15
|
+
type EntityKey,
|
|
16
16
|
type InternalFieldUpdate,
|
|
17
|
-
type
|
|
18
|
-
createUpdate,
|
|
17
|
+
type Update,
|
|
19
18
|
applyUpdate,
|
|
19
|
+
createUpdate,
|
|
20
20
|
makeEntityKey,
|
|
21
21
|
} from "@sylphx/lens-core";
|
|
22
22
|
|