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 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare function parseRequest(event: Event, req: {
|
20 | [key: string]: any;
|
21 | }, options?: {
|
22 | request?: boolean | string[];
|
23 | serverName?: boolean;
|
24 | transaction?: boolean | TransactionTypes;
|
25 | user?: boolean | string[];
|
26 | version?: boolean;
|
27 | }): Event;
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare function requestHandler(options?: {
|
33 | request?: boolean;
|
34 | serverName?: boolean;
|
35 | transaction?: boolean | TransactionTypes;
|
36 | user?: boolean | string[];
|
37 | version?: boolean;
|
38 | flushTimeout?: number;
|
39 | }): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
|
40 |
|
41 | interface MiddlewareError extends Error {
|
42 | status?: number | string;
|
43 | statusCode?: number | string;
|
44 | status_code?: number | string;
|
45 | output?: {
|
46 | statusCode?: number | string;
|
47 | };
|
48 | }
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export declare function errorHandler(options?: {
|
54 | |
55 |
|
56 |
|
57 |
|
58 | shouldHandleError?(error: MiddlewareError): boolean;
|
59 | }): (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
|
60 |
|
61 |
|
62 |
|
63 | export declare function logAndExitProcess(error: Error): void;
|
64 | export {};
|
65 |
|
\ | No newline at end of file |