@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 +51 -0
- package/dist/index.d.mts +1210 -0
- package/dist/index.d.ts +1210 -0
- package/dist/index.js +1768 -0
- package/dist/index.mjs +1632 -0
- package/package.json +27 -0
- package/src/finders.ts +712 -0
- package/src/getters.ts +409 -0
- package/src/graph.ts +601 -0
- package/src/helpers.ts +31 -0
- package/src/index.ts +28 -0
- package/src/keys.ts +286 -0
- package/src/levels.ts +262 -0
- package/src/types.generated.ts +176 -0
- package/tests/getters-finders.test.ts +461 -0
- package/tests/graph.test.ts +398 -0
- package/tests/keys-levels.test.ts +298 -0
- package/tsconfig.json +4 -0
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.
|