@sigloch/graph-api-core 5.10.0 → 5.10.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.
@@ -1,7 +1,11 @@
1
1
  import { SE_FORMAT_E_CODEC } from './format-e-door.js';
2
- /** Die Zeilen EINES Knotens, wie der Codec sie schreibt — ohne `## Nodes` und `### TYPE`. */
3
- function knotenZeilen(node, roundTrip) {
4
- return SE_FORMAT_E_CODEC.serialize({ nodes: [node], edges: [] }, { roundTrip }).split('\n').slice(2);
2
+ /**
3
+ * Die Zeilen EINES Knotens, wie der Codec sie schreibt — ohne `## Nodes` und `### TYPE`. Ohne die
4
+ * Rundlauf-Validierung: der Serialisierer urteilt nicht. Ein unbekannter Typ wird geschrieben, und
5
+ * das Urteil faellt beim Lesen, am Gate — auditiert, mit der echten Ursache (CR-SM-381).
6
+ */
7
+ function knotenZeilen(node) {
8
+ return SE_FORMAT_E_CODEC.serialize({ nodes: [node], edges: [] }).split('\n').slice(2);
5
9
  }
6
10
  export function commandsToFormatE(commands, typeOf = () => undefined) {
7
11
  const angelegt = new Map();
@@ -26,13 +30,17 @@ export function commandsToFormatE(commands, typeOf = () => undefined) {
26
30
  const merges = [];
27
31
  for (const c of commands) {
28
32
  switch (c.op) {
29
- case 'add-node':
30
- zeilenFuer(c.node.type).push(...knotenZeilen({ ...c.node, attributes: c.node.attributes ?? {} }, true));
33
+ case 'add-node': {
34
+ // `__name` wie im Rundlauf — der Name reist als Attribut; eine leere Beschreibung braucht den Pipe.
35
+ const [kopf, ...folge] = knotenZeilen({ ...c.node, attributes: { ...(c.node.attributes ?? {}), __name: c.node.name } });
36
+ const zeile = c.node.description ? kopf : kopf.replace(`+ ${c.node.uid}`, `+ ${c.node.uid}|`);
37
+ zeilenFuer(c.node.type).push(zeile, ...folge);
31
38
  break;
39
+ }
32
40
  case 'update-node': {
33
41
  const { uid, name, description } = c.node;
34
42
  const attributes = { ...(c.node.attributes ?? {}), ...(name !== undefined ? { __name: name } : {}) };
35
- const [kopf, ...folge] = knotenZeilen({ uid, type: typ(uid, c.node.type), name: name ?? uid, description: description ?? '', attributes }, false);
43
+ const [kopf, ...folge] = knotenZeilen({ uid, type: typ(uid, c.node.type), name: name ?? uid, description: description ?? '', attributes });
36
44
  // Eine explizit leere Beschreibung braucht den Pipe — ohne ihn hiesse die Zeile „unveraendert".
37
45
  const zeile = description === '' ? kopf.replace(`+ ${uid}`, `~ ${uid}|`) : kopf.replace(/^\+ /, '~ ');
38
46
  zeilenFuer(typ(uid, c.node.type)).push(zeile, ...folge);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigloch/graph-api-core",
3
- "version": "5.10.0",
3
+ "version": "5.10.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,7 +43,7 @@
43
43
  "access": "public"
44
44
  },
45
45
  "peerDependencies": {
46
- "@sigloch/contracts": ">=10.11 <11",
46
+ "@sigloch/contracts": ">=10.11 <12",
47
47
  "kuzu-wasm": "^0.11.3"
48
48
  },
49
49
  "peerDependenciesMeta": {
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@sigloch/contracts": ">=10.11 <11",
55
+ "@sigloch/contracts": ">=10.11 <12",
56
56
  "kuzu-wasm": "^0.11.3"
57
57
  }
58
58
  }