1 |
|
2 | import { Event } from '@sentry/types';
|
3 | import * as http from 'http';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare function tracingHandler(): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
|
9 | declare type TransactionTypes = 'path' | 'methodPath' | 'handler';
|
10 |
|
11 |
|
12 |
|
13 | interface ParseRequestOptions {
|
14 | ip?: boolean;
|
15 | request?: boolean | string[];
|
16 | serverName?: boolean;
|
17 | transaction?: boolean | TransactionTypes;
|
18 | user?: boolean | string[];
|
19 | version?: boolean;
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export declare function parseRequest(event: Event, req: {
|
30 | [key: string]: any;
|
31 | user?: {
|
32 | [key: string]: any;
|
33 | };
|
34 | ip?: string;
|
35 | connection?: {
|
36 | remoteAddress?: string;
|
37 | };
|
38 | }, options?: ParseRequestOptions): Event;
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export declare function requestHandler(options?: ParseRequestOptions & {
|
44 | flushTimeout?: number;
|
45 | }): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
|
46 |
|
47 | interface MiddlewareError extends Error {
|
48 | status?: number | string;
|
49 | statusCode?: number | string;
|
50 | status_code?: number | string;
|
51 | output?: {
|
52 | statusCode?: number | string;
|
53 | };
|
54 | }
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | export declare function errorHandler(options?: {
|
60 | |
61 |
|
62 |
|
63 |
|
64 | shouldHandleError?(error: MiddlewareError): boolean;
|
65 | }): (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
|
66 |
|
67 |
|
68 |
|
69 | export declare function logAndExitProcess(error: Error): void;
|
70 | export {};
|
71 |
|
\ | No newline at end of file |