@netkitty/analysis 1.1.0 → 1.2.0
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/CHANGELOG.md +11 -0
- package/README.md +6 -0
- package/README.zh-CN.md +6 -0
- package/dist/Analysis.js +2 -1
- package/dist/errors/AnalysisStateError.d.ts +6 -0
- package/dist/errors/AnalysisStateError.js +13 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.2.0](https://github.com/myq1991/netkitty/compare/@netkitty/analysis@1.1.0...@netkitty/analysis@1.2.0) (2026-07-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **errors:** route pcap-core/pcap/analysis/replay/capture errors through NetKittyError ([19b0888](https://github.com/myq1991/netkitty/commit/19b08886f490afaeec3620745e545eb2446b4f83))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 1.1.0 (2026-07-22)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
<img src="https://raw.githubusercontent.com/myq1991/netkitty/main/assets/NetKittyLogo.webp" alt="NetKitty" width="180">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@netkitty/analysis"><img src="https://img.shields.io/npm/v/@netkitty/analysis?style=flat-square&labelColor=162032&color=2979ff&logo=npm&logoColor=white" alt="npm version"></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/@netkitty/analysis"><img src="https://img.shields.io/npm/dm/@netkitty/analysis?style=flat-square&labelColor=162032&color=22c55e&logo=npm&logoColor=white" alt="npm downloads"></a>
|
|
8
|
+
<a href="https://github.com/myq1991/netkitty/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@netkitty/analysis?style=flat-square&labelColor=162032&color=2979ff" alt="license"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
5
11
|
# @netkitty/analysis
|
|
6
12
|
|
|
7
13
|
Streaming, cross-packet analysis for capture files — a programmable, Wireshark-style front door over
|
package/README.zh-CN.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
<img src="https://raw.githubusercontent.com/myq1991/netkitty/main/assets/NetKittyLogo.webp" alt="NetKitty" width="180">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@netkitty/analysis"><img src="https://img.shields.io/npm/v/@netkitty/analysis?style=flat-square&labelColor=162032&color=2979ff&logo=npm&logoColor=white" alt="npm version"></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/@netkitty/analysis"><img src="https://img.shields.io/npm/dm/@netkitty/analysis?style=flat-square&labelColor=162032&color=22c55e&logo=npm&logoColor=white" alt="npm downloads"></a>
|
|
8
|
+
<a href="https://github.com/myq1991/netkitty/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@netkitty/analysis?style=flat-square&labelColor=162032&color=2979ff" alt="license"></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
5
11
|
# @netkitty/analysis
|
|
6
12
|
|
|
7
13
|
对抓包文件做流式的跨包分析——一个可编程的、类似 Wireshark 的 pcap/pcapng 入口。同一个 `Analysis` 类
|
package/dist/Analysis.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Analysis = void 0;
|
|
4
|
+
const AnalysisStateError_1 = require("./errors/AnalysisStateError");
|
|
4
5
|
//How many frames to pull per replay batch — bounds memory and back-pressures the worker naturally.
|
|
5
6
|
const REPLAY_BATCH = 512;
|
|
6
7
|
/**
|
|
@@ -145,7 +146,7 @@ class Analysis {
|
|
|
145
146
|
}
|
|
146
147
|
#require() {
|
|
147
148
|
if (!this.#channel)
|
|
148
|
-
throw new
|
|
149
|
+
throw new AnalysisStateError_1.AnalysisStateError('Analysis has no open source; call open() or watch() first');
|
|
149
150
|
return this.#channel;
|
|
150
151
|
}
|
|
151
152
|
#emit(event, ...args) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalysisStateError = void 0;
|
|
4
|
+
const errors_1 = require("@netkitty/errors");
|
|
5
|
+
/** Thrown when an Analysis method is used before a source is open — call open() or watch() first. */
|
|
6
|
+
class AnalysisStateError extends errors_1.NetKittyError {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.errno = errors_1.ErrorCode.E_ANALYSIS_STATE.errno;
|
|
10
|
+
this.code = errors_1.ErrorCode.E_ANALYSIS_STATE.code;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.AnalysisStateError = AnalysisStateError;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,3 +28,7 @@ export type { RttSample, TcpStreamDiagnostic } from './reducers/TcpStreamReducer
|
|
|
28
28
|
export { reduceReducer, groupByReducer } from './reducers/ReducerFactories';
|
|
29
29
|
export { parseFilter, matchesFilter, matchesIndexed, indexableEval } from './filter/FilterExpression';
|
|
30
30
|
export type { FilterExpression, FilterPredicate } from './filter/FilterExpression';
|
|
31
|
+
/**
|
|
32
|
+
* Error classes (all extend NetKittyError)
|
|
33
|
+
*/
|
|
34
|
+
export { AnalysisStateError } from './errors/AnalysisStateError';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.indexableEval = exports.matchesIndexed = exports.matchesFilter = exports.parseFilter = exports.groupByReducer = exports.reduceReducer = exports.TcpStreamReducer = exports.EndpointsReducer = exports.ConversationsReducer = exports.Analysis = void 0;
|
|
3
|
+
exports.AnalysisStateError = exports.indexableEval = exports.matchesIndexed = exports.matchesFilter = exports.parseFilter = exports.groupByReducer = exports.reduceReducer = exports.TcpStreamReducer = exports.EndpointsReducer = exports.ConversationsReducer = exports.Analysis = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Streaming capture-file analysis — the Analysis facade over a single worker, pluggable reducers, a
|
|
6
6
|
* display filter, and the pluggable backend seams. node (worker_threads) and browser (Web Worker)
|
|
@@ -25,3 +25,8 @@ Object.defineProperty(exports, "parseFilter", { enumerable: true, get: function
|
|
|
25
25
|
Object.defineProperty(exports, "matchesFilter", { enumerable: true, get: function () { return FilterExpression_1.matchesFilter; } });
|
|
26
26
|
Object.defineProperty(exports, "matchesIndexed", { enumerable: true, get: function () { return FilterExpression_1.matchesIndexed; } });
|
|
27
27
|
Object.defineProperty(exports, "indexableEval", { enumerable: true, get: function () { return FilterExpression_1.indexableEval; } });
|
|
28
|
+
/**
|
|
29
|
+
* Error classes (all extend NetKittyError)
|
|
30
|
+
*/
|
|
31
|
+
var AnalysisStateError_1 = require("./errors/AnalysisStateError");
|
|
32
|
+
Object.defineProperty(exports, "AnalysisStateError", { enumerable: true, get: function () { return AnalysisStateError_1.AnalysisStateError; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netkitty/analysis",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Streaming cross-packet network analysis over the netkitty codec: TCP stream reassembly, flow tracking and Wireshark-style follow-stream, off a worker.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,8 +51,9 @@
|
|
|
51
51
|
"typescript": "^5.8.2"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@netkitty/codec": "^1.
|
|
55
|
-
"@netkitty/
|
|
54
|
+
"@netkitty/codec": "^1.2.0",
|
|
55
|
+
"@netkitty/errors": "^1.2.0",
|
|
56
|
+
"@netkitty/pcap-core": "^1.2.0"
|
|
56
57
|
},
|
|
57
58
|
"repository": {
|
|
58
59
|
"type": "git",
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
},
|
|
62
63
|
"homepage": "https://github.com/myq1991/netkitty/tree/main/packages/analysis#readme",
|
|
63
64
|
"bugs": "https://github.com/myq1991/netkitty/issues",
|
|
64
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "52958b705354ac379a1a6d90a3955773c190d65a"
|
|
65
66
|
}
|