-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathindex.ts
More file actions
45 lines (39 loc) · 1.58 KB
/
index.ts
File metadata and controls
45 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// import/export got a false positive, and affects most of our index barrel files
// can be removed once following issue is fixed: https://github.com/import-js/eslint-plugin-import/issues/703
/* eslint-disable import/export */
import type { TanStackMiddlewareBase } from '../common/types';
import type { CreateSentryTunnelRouteOptions } from '../server/tunnelRoute';
export * from '@sentry/react';
export { init } from './sdk';
/**
* No-op stub for client-side builds.
* The actual implementation is server-only, but this stub is needed to prevent build errors.
*/
export function wrapMiddlewaresWithSentry<T extends TanStackMiddlewareBase>(middlewares: Record<string, T>): T[] {
return Object.values(middlewares);
}
/**
* No-op stub for client-side builds.
* The actual implementation is server-only, but this stub is needed to prevent rendering errors.
*/
export const sentryGlobalRequestMiddleware: TanStackMiddlewareBase = { '~types': undefined, options: {} };
/**
* No-op stub for client-side builds.
* The actual implementation is server-only, but this stub is needed to prevent rendering errors.
*/
export const sentryGlobalFunctionMiddleware: TanStackMiddlewareBase = { '~types': undefined, options: {} };
/**
* No-op stub for client-side builds.
* The actual implementation is server-only, but this stub is needed to prevent rendering errors.
*/
export function createSentryTunnelRoute(_options: CreateSentryTunnelRouteOptions): {
handlers: {
POST: () => Promise<Response>;
};
} {
return {
handlers: {
POST: async () => new Response(null, { status: 500 }),
},
};
}