@cyvest/cyvest-js 2.0.1

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/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @cyvest/cyvest-js
2
+
3
+ TypeScript utilities and generated types for working with serialized Cyvest investigations in JavaScript/Node or browser contexts.
4
+
5
+ ## What it does
6
+
7
+ - Validates Cyvest JSON payloads against the schema (AJV) and returns typed investigations.
8
+ - Ships generated TypeScript types plus helpers to query observables, checks, threat intel, and relationships.
9
+ - Builds lightweight graph representations for use in visualizers or custom tooling.
10
+
11
+ ## Install & build
12
+
13
+ ```bash
14
+ pnpm install # from repo root
15
+ pnpm --filter @cyvest/cyvest-js build
16
+ ```
17
+
18
+ Generate types from the latest Python schema if you change it:
19
+
20
+ ```bash
21
+ pnpm --filter @cyvest/cyvest-js run generate:types
22
+ ```
23
+
24
+ Run tests:
25
+
26
+ ```bash
27
+ pnpm --filter @cyvest/cyvest-js test
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```ts
33
+ import {
34
+ parseCyvest,
35
+ findRootObservables,
36
+ getObservableGraph,
37
+ type CyvestInvestigation,
38
+ } from "@cyvest/cyvest-js";
39
+ import raw from "./investigation.json";
40
+
41
+ const investigation: CyvestInvestigation = parseCyvest(raw);
42
+ const roots = findRootObservables(investigation);
43
+ const graph = getObservableGraph(investigation);
44
+
45
+ console.log(`Roots: ${roots.length} • Nodes: ${graph.nodes.length}`);
46
+ ```
47
+
48
+ ## Publishing / consumers
49
+
50
+ - The package ships CJS, ESM, and type definitions in `dist/`.
51
+ - Peer projects in this repo (`@cyvest/cyvest-vis`, `@cyvest/cyvest-app`) depend on it; keep exports stable.