1 |
|
2 | import type { AddRequestDataToEventOptions } from '@sentry/utils';
|
3 | import type * as http from 'http';
|
4 | import type { ParseRequestOptions } from './requestDataDeprecated';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare function tracingHandler(): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
|
10 | export type RequestHandlerOptions = (ParseRequestOptions | AddRequestDataToEventOptions) & {
|
11 | flushTimeout?: number;
|
12 | };
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export declare function requestHandler(options?: RequestHandlerOptions): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
|
18 |
|
19 | interface MiddlewareError extends Error {
|
20 | status?: number | string;
|
21 | statusCode?: number | string;
|
22 | status_code?: number | string;
|
23 | output?: {
|
24 | statusCode?: number | string;
|
25 | };
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export declare function errorHandler(options?: {
|
32 | |
33 |
|
34 |
|
35 |
|
36 | shouldHandleError?(this: void, error: MiddlewareError): boolean;
|
37 | }): (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
|
38 | interface SentryTrpcMiddlewareOptions {
|
39 |
|
40 | attachRpcInput?: boolean;
|
41 | }
|
42 | interface TrpcMiddlewareArguments<T> {
|
43 | path: string;
|
44 | type: 'query' | 'mutation' | 'subscription';
|
45 | next: () => T;
|
46 | rawInput: unknown;
|
47 | }
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | export declare function trpcMiddleware(options?: SentryTrpcMiddlewareOptions): <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>) => T;
|
55 | export type { ParseRequestOptions, ExpressRequest } from './requestDataDeprecated';
|
56 | export { parseRequest, extractRequestData } from './requestDataDeprecated';
|
57 |
|
\ | No newline at end of file |