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