@volter/twin-sentry 0.1.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/LICENSE +202 -0
- package/README.md +142 -0
- package/client/sentry-mirror.css +99 -0
- package/client/sentry-mirror.tsx +352 -0
- package/dist/client/sentry-mirror.bundle.js +321 -0
- package/dist/client/sentry-mirror.css +99 -0
- package/dist/client/sentry-mirror.d.ts +17 -0
- package/dist/client/sentry-mirror.js +156 -0
- package/dist/client/sentry-mirror.tsx +352 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +36 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.js +75 -0
- package/dist/src/sentry-budget.d.ts +50 -0
- package/dist/src/sentry-budget.js +145 -0
- package/dist/src/sentry-capabilities.d.ts +3 -0
- package/dist/src/sentry-capabilities.js +1180 -0
- package/dist/src/sentry-conformance.d.ts +22 -0
- package/dist/src/sentry-conformance.js +97 -0
- package/dist/src/sentry-connector.d.ts +77 -0
- package/dist/src/sentry-connector.js +226 -0
- package/dist/src/sentry-events.d.ts +54 -0
- package/dist/src/sentry-events.js +131 -0
- package/dist/src/sentry-ingest.d.ts +137 -0
- package/dist/src/sentry-ingest.js +387 -0
- package/dist/src/sentry-mirror-ui.d.ts +38 -0
- package/dist/src/sentry-mirror-ui.js +162 -0
- package/dist/src/sentry-perform-harness.d.ts +9 -0
- package/dist/src/sentry-perform-harness.js +20 -0
- package/dist/src/sentry-server.d.ts +14 -0
- package/dist/src/sentry-server.js +27 -0
- package/dist/src/sentry-twin.d.ts +17 -0
- package/dist/src/sentry-twin.js +1739 -0
- package/dist/test-fixtures/sentry-openapi-operations.SOURCE.md +24 -0
- package/dist/test-fixtures/sentry-openapi-operations.json +1837 -0
- package/package.json +75 -0
- package/src/cli.ts +34 -0
- package/src/index.ts +145 -0
- package/src/sentry-budget.ts +171 -0
- package/src/sentry-capabilities.ts +1222 -0
- package/src/sentry-conformance.ts +110 -0
- package/src/sentry-connector.ts +260 -0
- package/src/sentry-events.ts +171 -0
- package/src/sentry-ingest.ts +471 -0
- package/src/sentry-mirror-ui.ts +162 -0
- package/src/sentry-perform-harness.ts +19 -0
- package/src/sentry-server.ts +35 -0
- package/src/sentry-twin.ts +1615 -0
- package/test-fixtures/sentry-openapi-operations.SOURCE.md +24 -0
- package/test-fixtures/sentry-openapi-operations.json +1837 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Sentry twin HTTP server — serve the full Sentry twin handler over HTTP so the real
|
|
2
|
+
// `@sentry/node` SDK (pointed at a twin DSN whose host is this server) POSTs captured
|
|
3
|
+
// events to /api/:projectId/envelope/ and they become grouped issues, AND the Web API
|
|
4
|
+
// (/api/0/...) answers reads/writes. Writable by default; pass readOnly to reject writes.
|
|
5
|
+
// No real Sentry is ever contacted (D4) — fully local + offline.
|
|
6
|
+
//
|
|
7
|
+
// FETCH-FIRST (runtime contract R12b): the serve path is the plain fetch below, built from the
|
|
8
|
+
// kernel's ONE adaptation (`createTwinFetchFromHandler`); this file contributes only VALUES. The
|
|
9
|
+
// vendor's 204 deletes return `{ status: 204, body: null }`, which the adapter's null-body rule
|
|
10
|
+
// serves as a genuinely empty response. The server is one line of Bun.serve around that closure.
|
|
11
|
+
import { serveHttp } from '@volter/world-core';
|
|
12
|
+
import { handleSentryTwinRequest } from './sentry-twin.ts';
|
|
13
|
+
import { createTwinFetchFromHandler, statefulTwinManifest } from '@volter/world-core';
|
|
14
|
+
|
|
15
|
+
/** Options every Sentry-twin HTTP surface needs, independent of who owns the socket. */
|
|
16
|
+
export interface SentryTwinFetchOptions {
|
|
17
|
+
root?: string;
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function createSentryTwinFetch(options: SentryTwinFetchOptions = {}): (request: Request) => Promise<Response> {
|
|
22
|
+
return createTwinFetchFromHandler(handleSentryTwinRequest, {
|
|
23
|
+
...options,
|
|
24
|
+
manifest: statefulTwinManifest({ vendor: 'sentry', twinOf: 'the Sentry error-monitoring API', stores: 'ingested error/transaction envelopes, readable back per project' }),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function createSentryTwinServer(options: { root?: string; port?: number; readOnly?: boolean } = {}): Promise<{ port: number; stop: () => void }> {
|
|
29
|
+
const server = await serveHttp({
|
|
30
|
+
port: options.port ?? 0,
|
|
31
|
+
idleTimeout: 60,
|
|
32
|
+
fetch: createSentryTwinFetch(options),
|
|
33
|
+
});
|
|
34
|
+
return { port: server.port ?? options.port ?? 0, stop: () => server.stop(true) };
|
|
35
|
+
}
|