workers-sentinel 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 +21 -0
- package/README.md +341 -0
- package/dist/README.md +1 -0
- package/dist/dashboard/assets/EventDetail-DgqYLyiF.js +1 -0
- package/dist/dashboard/assets/IssueDetail-CjG-J6cD.js +1 -0
- package/dist/dashboard/assets/Issues-Cfnqb_a0.js +33 -0
- package/dist/dashboard/assets/Layout-Edli6x7p.js +1 -0
- package/dist/dashboard/assets/Login-DHYJjZXJ.js +1 -0
- package/dist/dashboard/assets/ProjectCreate-D5GeKxHe.js +33 -0
- package/dist/dashboard/assets/ProjectSettings-6OwGPcir.js +1 -0
- package/dist/dashboard/assets/Projects-Bth0OyBs.js +1 -0
- package/dist/dashboard/assets/Register-C3zVYtDV.js +1 -0
- package/dist/dashboard/assets/index-7dRN2NZv.js +30 -0
- package/dist/dashboard/assets/index-JMAa_1Q2.css +1 -0
- package/dist/dashboard/assets/projects-BUj8O17i.js +1 -0
- package/dist/dashboard/index.html +14 -0
- package/dist/durable-objects/auth-state.d.ts +28 -0
- package/dist/durable-objects/auth-state.d.ts.map +1 -0
- package/dist/durable-objects/project-state.d.ts +23 -0
- package/dist/durable-objects/project-state.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4774 -0
- package/dist/index.js.map +8 -0
- package/dist/lib/envelope-parser.d.ts +38 -0
- package/dist/lib/envelope-parser.d.ts.map +1 -0
- package/dist/lib/fingerprint.d.ts +23 -0
- package/dist/lib/fingerprint.d.ts.map +1 -0
- package/dist/middleware/auth.d.ts +10 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/routes/auth.d.ts +6 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/events.d.ts +11 -0
- package/dist/routes/events.d.ts.map +1 -0
- package/dist/routes/ingestion.d.ts +6 -0
- package/dist/routes/ingestion.d.ts.map +1 -0
- package/dist/routes/issues.d.ts +11 -0
- package/dist/routes/issues.d.ts.map +1 -0
- package/dist/routes/projects.d.ts +11 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/rpc.d.ts +59 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/types.d.ts +166 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ParsedEnvelope, SentryEvent } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Parse a Sentry envelope.
|
|
4
|
+
* Envelope format:
|
|
5
|
+
* ```
|
|
6
|
+
* {header_json}\n
|
|
7
|
+
* {item_header_json}\n
|
|
8
|
+
* {item_payload_json}\n
|
|
9
|
+
* {item_header_json}\n
|
|
10
|
+
* {item_payload_json}\n
|
|
11
|
+
* ...
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseEnvelope(body: string): ParsedEnvelope;
|
|
15
|
+
/**
|
|
16
|
+
* Parse DSN from various sources.
|
|
17
|
+
* DSN format: https://{public_key}@{host}/{project_id}
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseDSN(dsn: string): {
|
|
20
|
+
protocol: string;
|
|
21
|
+
publicKey: string;
|
|
22
|
+
host: string;
|
|
23
|
+
projectId: string;
|
|
24
|
+
} | null;
|
|
25
|
+
/**
|
|
26
|
+
* Extract public key from Sentry auth header.
|
|
27
|
+
* Format: Sentry sentry_version=7, sentry_key={key}, ...
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractKeyFromAuthHeader(header: string): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Validate and extract event items from an envelope.
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractEvents(envelope: ParsedEnvelope): SentryEvent[];
|
|
34
|
+
/**
|
|
35
|
+
* Decompress gzip-encoded body if necessary.
|
|
36
|
+
*/
|
|
37
|
+
export declare function maybeDecompress(body: ArrayBuffer, contentEncoding: string | null): Promise<string>;
|
|
38
|
+
//# sourceMappingURL=envelope-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope-parser.d.ts","sourceRoot":"","sources":["../../src/lib/envelope-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE1F;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAuE1D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAoBP;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CActE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,WAAW,EAAE,CAsBrE;AAED;;GAEG;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,WAAW,EACjB,eAAe,EAAE,MAAM,GAAG,IAAI,GAC5B,OAAO,CAAC,MAAM,CAAC,CAQjB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IssueMetadata, SentryEvent } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a fingerprint for grouping events into issues.
|
|
4
|
+
* Priority:
|
|
5
|
+
* 1. Explicit fingerprint from SDK (if not default)
|
|
6
|
+
* 2. Exception-based grouping (type + message + top frames)
|
|
7
|
+
* 3. Message-based grouping
|
|
8
|
+
* 4. Fallback to event ID (no grouping)
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateFingerprint(event: SentryEvent): string;
|
|
11
|
+
/**
|
|
12
|
+
* Extract the title for an issue from an event.
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractTitle(event: SentryEvent): string;
|
|
15
|
+
/**
|
|
16
|
+
* Extract the culprit (location) from an event.
|
|
17
|
+
*/
|
|
18
|
+
export declare function extractCulprit(event: SentryEvent): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Extract metadata for quick display.
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractMetadata(event: SentryEvent): IssueMetadata;
|
|
23
|
+
//# sourceMappingURL=fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprint.d.ts","sourceRoot":"","sources":["../../src/lib/fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAA0B,MAAM,UAAU,CAAC;AAEnF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAsC9D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAiBvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAiChE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,CAsBjE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuthContext, Env } from '../types';
|
|
2
|
+
type Variables = {
|
|
3
|
+
auth?: AuthContext;
|
|
4
|
+
};
|
|
5
|
+
export declare const authMiddleware: import("hono").MiddlewareHandler<{
|
|
6
|
+
Bindings: Env;
|
|
7
|
+
Variables: Variables;
|
|
8
|
+
}, string, {}, Response>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEjD,KAAK,SAAS,GAAG;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc;cAChB,GAAG;eACF,SAAS;wBAkCnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/routes/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,UAAU;cAAwB,GAAG;yCAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import type { AuthContext, Env } from '../types';
|
|
3
|
+
type Variables = {
|
|
4
|
+
auth?: AuthContext;
|
|
5
|
+
};
|
|
6
|
+
export declare const eventRoutes: Hono<{
|
|
7
|
+
Bindings: Env;
|
|
8
|
+
Variables: Variables;
|
|
9
|
+
}, import("hono/types").BlankSchema, "/">;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/routes/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAW,MAAM,UAAU,CAAC;AAE1D,KAAK,SAAS,GAAG;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;CACnB,CAAC;AAIF,eAAO,MAAM,WAAW;cAAwB,GAAG;eAAa,SAAS;yCAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingestion.d.ts","sourceRoot":"","sources":["../../src/routes/ingestion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAO1C,OAAO,KAAK,EAAE,GAAG,EAAW,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,eAAe;cAAwB,GAAG;yCAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import type { AuthContext, Env } from '../types';
|
|
3
|
+
type Variables = {
|
|
4
|
+
auth?: AuthContext;
|
|
5
|
+
};
|
|
6
|
+
export declare const issueRoutes: Hono<{
|
|
7
|
+
Bindings: Env;
|
|
8
|
+
Variables: Variables;
|
|
9
|
+
}, import("hono/types").BlankSchema, "/">;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=issues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/routes/issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAW,MAAM,UAAU,CAAC;AAE1D,KAAK,SAAS,GAAG;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;CACnB,CAAC;AAIF,eAAO,MAAM,WAAW;cAAwB,GAAG;eAAa,SAAS;yCAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import type { AuthContext, Env } from '../types';
|
|
3
|
+
type Variables = {
|
|
4
|
+
auth?: AuthContext;
|
|
5
|
+
};
|
|
6
|
+
export declare const projectRoutes: Hono<{
|
|
7
|
+
Bindings: Env;
|
|
8
|
+
Variables: Variables;
|
|
9
|
+
}, import("hono/types").BlankSchema, "/">;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/routes/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEjD,KAAK,SAAS,GAAG;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,aAAa;cAAwB,GAAG;eAAa,SAAS;yCAAK,CAAC"}
|
package/dist/rpc.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
2
|
+
import type { Env } from './types';
|
|
3
|
+
type SentryEnvelope = [Record<string, unknown>, Array<[Record<string, unknown>, unknown]>];
|
|
4
|
+
/**
|
|
5
|
+
* RPC entrypoint for Workers Sentinel.
|
|
6
|
+
*
|
|
7
|
+
* Allows other Cloudflare Workers to send events via service binding RPC
|
|
8
|
+
* instead of HTTP, reducing latency.
|
|
9
|
+
*
|
|
10
|
+
* Usage in target worker:
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // wrangler.jsonc
|
|
14
|
+
* {
|
|
15
|
+
* "services": [{ "binding": "SENTINEL", "service": "workers-sentinel", "entrypoint": "SentinelRpc" }]
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* // index.ts
|
|
19
|
+
* import * as Sentry from "@sentry/cloudflare";
|
|
20
|
+
* import { waitUntil } from "cloudflare:workers";
|
|
21
|
+
*
|
|
22
|
+
* const DSN = "https://<public_key>@sentinel/<project_id>";
|
|
23
|
+
*
|
|
24
|
+
* export default Sentry.withSentry(
|
|
25
|
+
* (env) => ({
|
|
26
|
+
* dsn: DSN,
|
|
27
|
+
* transport: () => ({
|
|
28
|
+
* send: async (envelope) => {
|
|
29
|
+
* const rpcPromise = env.SENTINEL.captureEnvelope(DSN, envelope);
|
|
30
|
+
* waitUntil(rpcPromise);
|
|
31
|
+
* const result = await rpcPromise;
|
|
32
|
+
* return { statusCode: result.status };
|
|
33
|
+
* },
|
|
34
|
+
* flush: async () => true,
|
|
35
|
+
* }),
|
|
36
|
+
* }),
|
|
37
|
+
* { async fetch(request, env, ctx) { ... } }
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class SentinelRpc extends WorkerEntrypoint<Env> {
|
|
42
|
+
/**
|
|
43
|
+
* Capture a Sentry envelope.
|
|
44
|
+
*
|
|
45
|
+
* @param dsn - The full DSN string (e.g., "https://publicKey@host/projectId")
|
|
46
|
+
* @param envelope - The Sentry envelope object (not serialized)
|
|
47
|
+
* @returns Object with status code and optional event ID
|
|
48
|
+
*/
|
|
49
|
+
captureEnvelope(dsn: string, envelope: SentryEnvelope): Promise<{
|
|
50
|
+
status: number;
|
|
51
|
+
eventId?: string;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Handle fetch requests (fallback for non-RPC calls)
|
|
55
|
+
*/
|
|
56
|
+
fetch(): Promise<Response>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAgB,GAAG,EAAW,MAAM,SAAS,CAAC;AAG1D,KAAK,cAAc,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,WAAY,SAAQ,gBAAgB,CAAC,GAAG,CAAC;IACrD;;;;;;OAMG;IACG,eAAe,CACpB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,cAAc,GACtB,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAmFhD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;CAGhC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export interface Env {
|
|
2
|
+
AUTH_STATE: DurableObjectNamespace;
|
|
3
|
+
PROJECT_STATE: DurableObjectNamespace;
|
|
4
|
+
ASSETS?: Fetcher;
|
|
5
|
+
}
|
|
6
|
+
export interface User {
|
|
7
|
+
id: string;
|
|
8
|
+
email: string;
|
|
9
|
+
name: string;
|
|
10
|
+
role: 'admin' | 'member';
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Session {
|
|
15
|
+
id: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
expiresAt: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Project {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
platform: string;
|
|
25
|
+
publicKey: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
createdBy: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ProjectMember {
|
|
30
|
+
projectId: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
role: 'owner' | 'admin' | 'member';
|
|
33
|
+
createdAt: string;
|
|
34
|
+
}
|
|
35
|
+
export interface Issue {
|
|
36
|
+
id: string;
|
|
37
|
+
fingerprint: string;
|
|
38
|
+
title: string;
|
|
39
|
+
culprit: string | null;
|
|
40
|
+
level: 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
41
|
+
platform: string;
|
|
42
|
+
firstSeen: string;
|
|
43
|
+
lastSeen: string;
|
|
44
|
+
count: number;
|
|
45
|
+
userCount: number;
|
|
46
|
+
status: 'unresolved' | 'resolved' | 'ignored';
|
|
47
|
+
metadata: IssueMetadata;
|
|
48
|
+
}
|
|
49
|
+
export interface IssueMetadata {
|
|
50
|
+
type: string;
|
|
51
|
+
value: string;
|
|
52
|
+
filename?: string;
|
|
53
|
+
function?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface SentryEvent {
|
|
56
|
+
event_id: string;
|
|
57
|
+
timestamp: string;
|
|
58
|
+
platform: string;
|
|
59
|
+
level?: 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
60
|
+
logger?: string;
|
|
61
|
+
transaction?: string;
|
|
62
|
+
server_name?: string;
|
|
63
|
+
release?: string;
|
|
64
|
+
dist?: string;
|
|
65
|
+
environment?: string;
|
|
66
|
+
tags?: Record<string, string>;
|
|
67
|
+
extra?: Record<string, unknown>;
|
|
68
|
+
user?: EventUser;
|
|
69
|
+
contexts?: Record<string, unknown>;
|
|
70
|
+
request?: RequestContext;
|
|
71
|
+
exception?: ExceptionInterface;
|
|
72
|
+
breadcrumbs?: Breadcrumb[];
|
|
73
|
+
sdk?: SdkInfo;
|
|
74
|
+
fingerprint?: string[];
|
|
75
|
+
message?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface EventUser {
|
|
78
|
+
id?: string;
|
|
79
|
+
email?: string;
|
|
80
|
+
ip_address?: string;
|
|
81
|
+
username?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface RequestContext {
|
|
84
|
+
url?: string;
|
|
85
|
+
method?: string;
|
|
86
|
+
headers?: Record<string, string>;
|
|
87
|
+
query_string?: string;
|
|
88
|
+
data?: unknown;
|
|
89
|
+
env?: Record<string, string>;
|
|
90
|
+
}
|
|
91
|
+
export interface ExceptionInterface {
|
|
92
|
+
values: ExceptionValue[];
|
|
93
|
+
}
|
|
94
|
+
export interface ExceptionValue {
|
|
95
|
+
type: string;
|
|
96
|
+
value: string;
|
|
97
|
+
module?: string;
|
|
98
|
+
stacktrace?: Stacktrace;
|
|
99
|
+
mechanism?: Mechanism;
|
|
100
|
+
}
|
|
101
|
+
export interface Stacktrace {
|
|
102
|
+
frames: StackFrame[];
|
|
103
|
+
}
|
|
104
|
+
export interface StackFrame {
|
|
105
|
+
filename?: string;
|
|
106
|
+
function?: string;
|
|
107
|
+
module?: string;
|
|
108
|
+
lineno?: number;
|
|
109
|
+
colno?: number;
|
|
110
|
+
abs_path?: string;
|
|
111
|
+
context_line?: string;
|
|
112
|
+
pre_context?: string[];
|
|
113
|
+
post_context?: string[];
|
|
114
|
+
in_app?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface Mechanism {
|
|
117
|
+
type: string;
|
|
118
|
+
handled?: boolean;
|
|
119
|
+
synthetic?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export interface Breadcrumb {
|
|
122
|
+
type?: string;
|
|
123
|
+
category?: string;
|
|
124
|
+
message?: string;
|
|
125
|
+
data?: Record<string, unknown>;
|
|
126
|
+
level?: string;
|
|
127
|
+
timestamp?: string;
|
|
128
|
+
}
|
|
129
|
+
export interface SdkInfo {
|
|
130
|
+
name: string;
|
|
131
|
+
version: string;
|
|
132
|
+
integrations?: string[];
|
|
133
|
+
packages?: Array<{
|
|
134
|
+
name: string;
|
|
135
|
+
version: string;
|
|
136
|
+
}>;
|
|
137
|
+
}
|
|
138
|
+
export interface EnvelopeHeader {
|
|
139
|
+
event_id?: string;
|
|
140
|
+
dsn?: string;
|
|
141
|
+
sdk?: SdkInfo;
|
|
142
|
+
sent_at?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface EnvelopeItem {
|
|
145
|
+
type: 'event' | 'session' | 'attachment' | 'transaction' | 'client_report';
|
|
146
|
+
payload: unknown;
|
|
147
|
+
}
|
|
148
|
+
export interface ParsedEnvelope {
|
|
149
|
+
header: EnvelopeHeader;
|
|
150
|
+
items: EnvelopeItem[];
|
|
151
|
+
}
|
|
152
|
+
export interface ApiError {
|
|
153
|
+
error: string;
|
|
154
|
+
message: string;
|
|
155
|
+
status: number;
|
|
156
|
+
}
|
|
157
|
+
export interface PaginatedResponse<T> {
|
|
158
|
+
data: T[];
|
|
159
|
+
nextCursor?: string;
|
|
160
|
+
hasMore: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface AuthContext {
|
|
163
|
+
user: User;
|
|
164
|
+
session: Session;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IACnB,UAAU,EAAE,sBAAsB,CAAC;IACnC,aAAa,EAAE,sBAAsB,CAAC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAGD,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,KAAK;IACrB,EAAE,EAAE,M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B,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,YAAY,EAAE,CAAC;CACtB;AAGD,MAAM,WAAW,QAAQ;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CACjB;AAGD,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CACjB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workers-sentinel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A self-hosted, Sentry-compatible error tracking system running on Cloudflare Workers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "wrangler dev",
|
|
14
|
+
"build": "cd ../dashboard && npm run build && cp -r ../dashboard/dist dist/dashboard",
|
|
15
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
16
|
+
"prepublishOnly": "pnpm build:types",
|
|
17
|
+
"deploy": "wrangler deploy",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"cf-typegen": "wrangler types",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"test:ui": "vitest --ui"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"cloudflare",
|
|
26
|
+
"workers",
|
|
27
|
+
"sentry",
|
|
28
|
+
"error-tracking",
|
|
29
|
+
"monitoring",
|
|
30
|
+
"durable-objects",
|
|
31
|
+
"self-hosted"
|
|
32
|
+
],
|
|
33
|
+
"author": "Gabriel Massadas",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/G4brym/workers-sentinel.git",
|
|
38
|
+
"directory": "packages/workers-sentinel"
|
|
39
|
+
},
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/G4brym/workers-sentinel/issues"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/G4brym/workers-sentinel#readme",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"hono": "^4.6.14"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@cloudflare/vitest-pool-workers": "^0.12.4",
|
|
49
|
+
"@cloudflare/workers-types": "^4.20260118.0",
|
|
50
|
+
"wrangler": "^4.59.2"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@cloudflare/workers-types": ">=4.0.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"@cloudflare/workers-types": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|