@reqray/protocol 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +41 -2
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1308 -0
- package/dist/index.d.ts +1308 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruslan Kryklyvyi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @reqray/protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The contract of Reqray's panel API: the types a client sees on the wire. Types
|
|
4
|
+
only — the package emits no runtime code.
|
|
5
|
+
|
|
6
|
+
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request inspector for Node.js. It
|
|
7
|
+
instruments HTTP, SQL, outgoing calls and cache on its own, shows every
|
|
8
|
+
request as a waterfall, and finds N+1 down to the file and the line.
|
|
9
|
+
|
|
10
|
+
Install it to build your own client for a Reqray panel or collector — a
|
|
11
|
+
script, an editor extension, a bot. The web panel and
|
|
12
|
+
[`@reqray/cli`](https://www.npmjs.com/package/@reqray/cli) are both written
|
|
13
|
+
against it.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -D @reqray/protocol
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import type { RequestDetail, RequestsResponse } from '@reqray/protocol';
|
|
21
|
+
|
|
22
|
+
const base = 'http://localhost:3000/_reqray';
|
|
23
|
+
const list = (await (await fetch(`${base}/api/requests`)).json()) as RequestsResponse;
|
|
24
|
+
const slowest = list.requests.toSorted((a, b) => b.durationMs - a.durationMs)[0];
|
|
25
|
+
const detail = (await (await fetch(`${base}/api/requests/${slowest.id}`)).json()) as RequestDetail;
|
|
26
|
+
|
|
27
|
+
for (const finding of detail.findings) console.log(finding.title, finding.callsite);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
What it describes: request summaries and details, spans (`DbSpan`, `HttpSpan`,
|
|
31
|
+
`CacheSpan`), findings and their evidence, exception groups, per-route
|
|
32
|
+
statistics, time series, and the project report.
|
|
33
|
+
|
|
34
|
+
## More
|
|
35
|
+
|
|
36
|
+
Everything else — the detectors, security defaults, measured overhead and a
|
|
37
|
+
demo that runs with one command — is in the
|
|
38
|
+
[main README](https://github.com/reqray/reqray#readme).
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
[MIT](https://github.com/reqray/reqray/blob/main/LICENSE)
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var index_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(index_exports);
|
|
19
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@reqray/protocol` — the panel API contract.\n *\n * Types only: this package emits no runtime code, has no dependencies, and is\n * safe to install in a browser bundle, an editor plugin or a CLI. The server\n * side of the same contract lives in `@reqray/core`, which re-exports\n * everything here.\n */\n\nexport type {\n ApiError,\n BaselineResponse,\n DetectorSetting,\n DurationBaseline,\n HostPressure,\n HostPressureSide,\n PanelMeta,\n ReqrayMode,\n RequestDetail,\n RequestRow,\n RequestSort,\n RequestSummary,\n RequestsResponse,\n} from './api.js';\nexport type { ExceptionFrame, ExceptionGroup } from './exceptions.js';\nexport type {\n FiledPatternState,\n FindingPattern,\n FindingsResponse,\n PatternExample,\n PatternRoute,\n PatternState,\n StoredPatternState,\n} from './findings.js';\nexport type {\n DiagnosticEntry,\n GitHead,\n PoolReading,\n PoolStats,\n ProjectApp,\n ProjectLog,\n ProjectReport,\n ProjectReqray,\n ProjectRetention,\n ProjectRuntime,\n ProjectStorage,\n RetentionLimits,\n SamplingSettings,\n StackSettings,\n} from './project.js';\nexport type {\n BudgetEvidence,\n CacheOperation,\n CacheSpan,\n Callsite,\n DbSpan,\n DuplicateEvidence,\n Finding,\n FindingEvidence,\n FindingSeverity,\n HandlerSpan,\n HeavyResponseEvidence,\n HostState,\n HotFrame,\n HttpSpan,\n LabelSpanKind,\n LogEntry,\n MiddlewareSpan,\n NPlusOneEvidence,\n PoolWaitEvidence,\n RecordedBody,\n RecordedRequest,\n RequestCost,\n RequestTiming,\n RequestWeight,\n SequentialHttpEvidence,\n SlowCodeEvidence,\n Span,\n SpanError,\n SpanKind,\n TransactionEvidence,\n} from './record.js';\nexport type {\n RouteFinding,\n RouteSeries,\n RouteStats,\n RoutesReport,\n SeriesBucket,\n} from './routes.js';\nexport type {\n MetricSeries,\n SeriesMetric,\n SeriesResponse,\n SeriesTotals,\n} from './series.js';\nexport type {\n ActivityReport,\n Outlier,\n TimelineBucket,\n TimelineReport,\n} from './timeline.js';\nexport type {\n BlameLine,\n ExplainNote,\n ExplainPlanNode,\n ExplainResult,\n ReplayComparison,\n ReplayInput,\n ReplayMetrics,\n} from './tools.js';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|