/
index.ts
69 lines (62 loc) · 1.54 KB
/
index.ts
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export {
Breadcrumb,
BreadcrumbHint,
Request,
SdkInfo,
Event,
EventHint,
Exception,
Response,
Severity,
StackFrame,
Stacktrace,
Status,
Thread,
User,
} from '@sentry/types';
export {
addGlobalEventProcessor,
addBreadcrumb,
captureException,
captureEvent,
captureMessage,
configureScope,
getHubFromCarrier,
getCurrentHub,
Hub,
makeMain,
Scope,
startTransaction,
setContext,
setExtra,
setExtras,
setTag,
setTags,
setUser,
withScope,
} from '@sentry/core';
export { NodeOptions } from './backend';
export { NodeClient } from './client';
export { defaultIntegrations, init, lastEventId, flush, close } from './sdk';
export { SDK_NAME, SDK_VERSION } from './version';
import { Integrations as CoreIntegrations } from '@sentry/core';
import { getMainCarrier } from '@sentry/hub';
import * as domain from 'domain';
import * as Handlers from './handlers';
import * as NodeIntegrations from './integrations';
import * as Transports from './transports';
const INTEGRATIONS = {
...CoreIntegrations,
...NodeIntegrations,
};
export { INTEGRATIONS as Integrations, Transports, Handlers };
// We need to patch domain on the global __SENTRY__ object to make it work for node
// if we don't do this, browser bundlers will have troubles resolving require('domain')
const carrier = getMainCarrier();
if (carrier.__SENTRY__) {
carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
if (!carrier.__SENTRY__.extensions.domain) {
// @ts-ignore
carrier.__SENTRY__.extensions.domain = domain;
}
}