@cobol-ts/characteristics-express 0.0.22 → 0.0.23

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.
Files changed (2) hide show
  1. package/README.md +10 -3
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -18,12 +18,12 @@ HAL-style root-relative links let consumers navigate without embedding the host
18
18
  - `GET /api/sorted`: topological generations JSON, identical to `cobolts cel sorted`.
19
19
  - `GET /api/planned`: numbered downstream graph JSON, identical to `cobolts cel planned`.
20
20
 
21
- Response objects use the existing `characteristics` collection field rather than full HAL `_embedded`. The CLI binds only to `127.0.0.1`; there is no authentication. Do not expose it outside the trusted machine.
21
+ Response objects use the existing `characteristics` collection field rather than full HAL `_embedded`. The CLI binds to `127.0.0.1` by default (`serve api --host` can override it); there is no authentication. Do not expose it outside the trusted machine.
22
22
 
23
23
  The four graph routes are registered only when a `GraphInspection` callback is
24
24
  injected. They return the original CLI JSON without envelopes or reserialization;
25
25
  graph preparation errors return HTTP 422 with `{ "errors": [...] }`. The
26
- `characteristics serve` CLI command injects its existing `celInspect` operation
26
+ `serve api` (or combined `serve`) CLI command injects its existing `celInspect` operation
27
27
  with the selected project and optional `--graph` filename. HTTP clients cannot
28
28
  pass arbitrary filesystem paths.
29
29
 
@@ -42,6 +42,13 @@ no production graph, accumulator or plan is changed.
42
42
 
43
43
  The output collection advertises `_links.lookup`. Lookup uses exact names; there is no ambiguous matching between input and output characteristics.
44
44
 
45
+ ## Graph neighbourhood queries
46
+
47
+ - `GET /api/graph/neighbourhood/:name` — combined upstream/downstream neighbourhood for one node; unknown nodes return 404.
48
+ - `POST /api/graph/neighbourhood` — body `{ "names": ["C7030"] }`; supports multiple roots, deduplicates names and reports missing nodes. A malformed names array returns 400; graph preparation errors return 422.
49
+
50
+ Both operate on the canonical display graph and return `roots`, `missing`, `upstream`, `downstream` and `nodes`. The API root advertises `_links.graphNeighbourhood`.
51
+
45
52
  ## Composition data queries
46
53
 
47
54
  When the CLI injects `CompositionDataQueries`, `/api` advertises `_links.compositions`.
@@ -53,4 +60,4 @@ When the CLI injects `CompositionDataQueries`, `/api` advertises `_links.composi
53
60
 
54
61
  - `GET /api/compositions/:name/run/:index` — evaluate one zero-based stream position and return `{id,index,accumulatorIn,accumulatorOut,periodicity}`; invalid indices return 400, missing records return 404, and execution errors return 422. The graph is the same graph configured for the server. The selected composition supplies the execution periodicity, returned in the response; clients do not supply an override.
55
62
 
56
- The CLI scans only the master for ID pages and scans the composition once per bulk request. IDs are strings, and the page cursor is a zero-based offset for a stable dataset. Projection failures are inline `ERROR: ...` strings and entries in the path-keyed `errors` map. Absent optional members are null; joined arrays retain occurrence order. Only the run endpoint executes the graph; it uses the configured initial or historical accumulator, skips preceding records, snapshots all available node values, and does not persist the result. Encrypted validation datasets are not exposed by these routes. The server remains localhost-only; use authorised data.
63
+ The CLI scans only the master for ID pages and scans the composition once per bulk request. IDs are strings, and the page cursor is a zero-based offset for a stable dataset. Projection failures are inline `ERROR: ...` strings and entries in the path-keyed `errors` map. Absent optional members are null; joined arrays retain occurrence order. Only the run endpoint executes the graph; it uses the configured initial or historical accumulator, skips preceding records, snapshots all available node values, and does not persist the result. Encrypted validation datasets are not exposed by these routes. The server defaults to localhost; use authorised data and restrict network exposure.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cobol-ts/characteristics-express",
3
3
  "description": "Read-only Express adapter for characteristic metadata queries",
4
- "version": "0.0.22",
4
+ "version": "0.0.23",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index",
7
7
  "browserslist": {
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "express": "^4.21.2",
21
- "@cobol-ts/characteristics": "0.0.22",
22
- "@cobol-ts/graph_utils": "0.0.22"
21
+ "@cobol-ts/characteristics": "0.0.23",
22
+ "@cobol-ts/graph_utils": "0.0.23"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/express": "^4.17.21",