sentry-vir 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +7 -5
  2. package/dist/cjs/auto.d.ts +15 -0
  3. package/dist/cjs/auto.js +63 -0
  4. package/dist/cjs/browser.d.ts +93 -0
  5. package/dist/cjs/browser.js +48 -0
  6. package/dist/cjs/env/execution-env.d.ts +2 -170
  7. package/dist/cjs/env/execution-env.js +1 -38
  8. package/dist/cjs/event-context/event-context.d.ts +1 -1
  9. package/dist/cjs/index.d.ts +5 -5
  10. package/dist/cjs/index.js +5 -5
  11. package/dist/cjs/init-sentry/base-sentry-init.d.ts +38 -0
  12. package/dist/cjs/init-sentry/{init-sentry.js → base-sentry-init.js} +7 -8
  13. package/dist/cjs/node.d.ts +82 -0
  14. package/dist/cjs/node.js +48 -0
  15. package/dist/cjs/{init-sentry → processing}/event-processor.d.ts +1 -1
  16. package/dist/cjs/{init-sentry → processing}/sentry-config.js +2 -0
  17. package/dist/cjs/{init-sentry → processing}/sentry-logger.js +50 -33
  18. package/dist/esm/auto.d.ts +15 -0
  19. package/dist/esm/auto.js +36 -0
  20. package/dist/esm/browser.d.ts +93 -0
  21. package/dist/esm/browser.js +21 -0
  22. package/dist/esm/env/execution-env.d.ts +13 -0
  23. package/dist/esm/env/execution-env.js +0 -13
  24. package/dist/{types → esm}/event-context/event-context.d.ts +1 -1
  25. package/dist/{types → esm}/index.d.ts +5 -5
  26. package/dist/esm/index.js +5 -5
  27. package/dist/esm/init-sentry/base-sentry-init.d.ts +38 -0
  28. package/dist/esm/init-sentry/{init-sentry.js → base-sentry-init.js} +5 -6
  29. package/dist/esm/node.d.ts +82 -0
  30. package/dist/esm/node.js +21 -0
  31. package/dist/{types/init-sentry → esm/processing}/event-processor.d.ts +1 -1
  32. package/dist/esm/{init-sentry → processing}/sentry-config.js +2 -0
  33. package/dist/esm/{init-sentry → processing}/sentry-logger.js +50 -33
  34. package/package.json +6 -3
  35. package/dist/cjs/init-sentry/init-sentry.d.ts +0 -194
  36. package/dist/types/env/execution-env.d.ts +0 -181
  37. package/dist/types/init-sentry/init-sentry.d.ts +0 -194
  38. /package/dist/cjs/{init-sentry → processing}/event-processor.js +0 -0
  39. /package/dist/cjs/{init-sentry → processing}/handle-sentry-send.d.ts +0 -0
  40. /package/dist/cjs/{init-sentry → processing}/handle-sentry-send.js +0 -0
  41. /package/dist/cjs/{init-sentry → processing}/sentry-config.d.ts +0 -0
  42. /package/dist/cjs/{init-sentry → processing}/sentry-logger.d.ts +0 -0
  43. /package/dist/{types → esm}/env/release-env.d.ts +0 -0
  44. /package/dist/{types → esm}/event-context/event-severity.d.ts +0 -0
  45. /package/dist/{types → esm}/event-context/extra-context.error.d.ts +0 -0
  46. /package/dist/{types → esm}/event-context/extra-event-context.d.ts +0 -0
  47. /package/dist/esm/{init-sentry → processing}/event-processor.js +0 -0
  48. /package/dist/{types/init-sentry → esm/processing}/handle-sentry-send.d.ts +0 -0
  49. /package/dist/esm/{init-sentry → processing}/handle-sentry-send.js +0 -0
  50. /package/dist/{types/init-sentry → esm/processing}/sentry-config.d.ts +0 -0
  51. /package/dist/{types/init-sentry → esm/processing}/sentry-logger.d.ts +0 -0
@@ -0,0 +1,82 @@
1
+ import { InitSentryInput } from './init-sentry/base-sentry-init';
2
+ /**
3
+ * Base Sentry init. Requires the Sentry module to already have been imported. Setup a sentry client
4
+ * with all the default sentry-vir integrations and configs.
5
+ *
6
+ * To override any default sentry-vir settings, include them in the userConfig input.
7
+ */
8
+ export declare function initSentry({ dsn, releaseEnv, releaseName, sentryConfigOverrides, createUniversalContext, }: Omit<InitSentryInput, 'executionEnv'>): Promise<{
9
+ default: typeof import("@sentry/node");
10
+ addGlobalEventProcessor: typeof import("@sentry/node").addGlobalEventProcessor;
11
+ addBreadcrumb: typeof import("@sentry/node").addBreadcrumb;
12
+ captureException: typeof import("@sentry/node").captureException;
13
+ captureEvent: typeof import("@sentry/node").captureEvent;
14
+ captureMessage: typeof import("@sentry/node").captureMessage;
15
+ close: typeof import("@sentry/node").close;
16
+ configureScope: typeof import("@sentry/node").configureScope;
17
+ createTransport: typeof import("@sentry/node").createTransport;
18
+ extractTraceparentData: typeof import("@sentry/node").extractTraceparentData;
19
+ flush: typeof import("@sentry/node").flush;
20
+ getActiveTransaction: typeof import("@sentry/node").getActiveTransaction;
21
+ getHubFromCarrier: typeof import("@sentry/node").getHubFromCarrier;
22
+ getCurrentHub: typeof import("@sentry/node").getCurrentHub;
23
+ Hub: typeof import("@sentry/node").Hub;
24
+ lastEventId: typeof import("@sentry/node").lastEventId;
25
+ makeMain: typeof import("@sentry/node").makeMain;
26
+ runWithAsyncContext: typeof import("@sentry/node").runWithAsyncContext;
27
+ Scope: typeof import("@sentry/node").Scope;
28
+ startTransaction: typeof import("@sentry/node").startTransaction;
29
+ SDK_VERSION: "7.73.0";
30
+ setContext: typeof import("@sentry/node").setContext;
31
+ setExtra: typeof import("@sentry/node").setExtra;
32
+ setExtras: typeof import("@sentry/node").setExtras;
33
+ setTag: typeof import("@sentry/node").setTag;
34
+ setTags: typeof import("@sentry/node").setTags;
35
+ setUser: typeof import("@sentry/node").setUser;
36
+ spanStatusfromHttpCode: typeof import("@sentry/node").spanStatusfromHttpCode;
37
+ trace: typeof import("@sentry/node").trace;
38
+ withScope: typeof import("@sentry/node").withScope;
39
+ captureCheckIn: typeof import("@sentry/node").captureCheckIn;
40
+ setMeasurement: typeof import("@sentry/node").setMeasurement;
41
+ getActiveSpan: typeof import("@sentry/node").getActiveSpan;
42
+ startSpan: typeof import("@sentry/node").startSpan;
43
+ startActiveSpan: typeof import("@sentry/node").startSpan;
44
+ startInactiveSpan: typeof import("@sentry/node").startInactiveSpan;
45
+ startSpanManual: typeof import("@sentry/node").startSpanManual;
46
+ autoDiscoverNodePerformanceMonitoringIntegrations: typeof import("@sentry/node").autoDiscoverNodePerformanceMonitoringIntegrations;
47
+ NodeClient: typeof import("@sentry/node").NodeClient;
48
+ makeNodeTransport: typeof import("@sentry/node").makeNodeTransport;
49
+ defaultIntegrations: (import("@sentry/core").InboundFilters | import("@sentry/core").FunctionToString | import("@sentry/node/types/integrations").OnUncaughtException | import("@sentry/node/types/integrations").OnUnhandledRejection | import("@sentry/node/types/integrations").ContextLines | import("@sentry/node/types/integrations").Context | import("@sentry/node/types/integrations").Console | import("@sentry/node/types/integrations").Http | import("@sentry/node/types/integrations").LinkedErrors | import("@sentry/node/types/integrations").Modules | import("@sentry/node/types/integrations").RequestData | import("@sentry/node/types/integrations").LocalVariables | import("@sentry/node/types/integrations").Undici)[];
50
+ init: typeof import("@sentry/node").init;
51
+ defaultStackParser: import("@sentry/types").StackParser;
52
+ getSentryRelease: typeof import("@sentry/node").getSentryRelease;
53
+ addRequestDataToEvent: typeof import("@sentry/node").addRequestDataToEvent;
54
+ DEFAULT_USER_INCLUDES: string[];
55
+ extractRequestData: typeof import("@sentry/node").extractRequestData;
56
+ deepReadDirSync: typeof import("@sentry/node").deepReadDirSync;
57
+ getModuleFromFilename: typeof import("@sentry/node").getModuleFromFilename;
58
+ enableAnrDetection: typeof import("@sentry/node").enableAnrDetection;
59
+ Integrations: {
60
+ Apollo: typeof import("@sentry-internal/tracing").Apollo;
61
+ Express: typeof import("@sentry-internal/tracing").Express;
62
+ GraphQL: typeof import("@sentry-internal/tracing").GraphQL;
63
+ Mongo: typeof import("@sentry-internal/tracing").Mongo;
64
+ Mysql: typeof import("@sentry-internal/tracing").Mysql;
65
+ Postgres: typeof import("@sentry-internal/tracing").Postgres;
66
+ Prisma: typeof import("@sentry-internal/tracing").Prisma;
67
+ Console: typeof import("@sentry/node/types/integrations").Console;
68
+ Http: typeof import("@sentry/node/types/integrations").Http;
69
+ OnUncaughtException: typeof import("@sentry/node/types/integrations").OnUncaughtException;
70
+ OnUnhandledRejection: typeof import("@sentry/node/types/integrations").OnUnhandledRejection;
71
+ LinkedErrors: typeof import("@sentry/node/types/integrations").LinkedErrors;
72
+ Modules: typeof import("@sentry/node/types/integrations").Modules;
73
+ ContextLines: typeof import("@sentry/node/types/integrations").ContextLines;
74
+ Context: typeof import("@sentry/node/types/integrations").Context;
75
+ RequestData: typeof import("@sentry/node/types/integrations").RequestData;
76
+ LocalVariables: typeof import("@sentry/node/types/integrations").LocalVariables;
77
+ Undici: typeof import("@sentry/node/types/integrations").Undici;
78
+ FunctionToString: typeof import("@sentry/core").FunctionToString;
79
+ InboundFilters: typeof import("@sentry/core").InboundFilters;
80
+ };
81
+ Handlers: typeof import("@sentry/node/types/handlers");
82
+ }>;
@@ -0,0 +1,21 @@
1
+ import { SentryExecutionEnvEnum } from './env/execution-env';
2
+ import { processSentryEvent } from './processing/event-processor';
3
+ import { createSentryConfig } from './processing/sentry-config';
4
+ /**
5
+ * Base Sentry init. Requires the Sentry module to already have been imported. Setup a sentry client
6
+ * with all the default sentry-vir integrations and configs.
7
+ *
8
+ * To override any default sentry-vir settings, include them in the userConfig input.
9
+ */
10
+ /* c8 ignore next */
11
+ export async function initSentry({ dsn, releaseEnv, releaseName, sentryConfigOverrides, createUniversalContext, }) {
12
+ const sentryDep = await import('@sentry/node');
13
+ const finalSentryConfig = await createSentryConfig(SentryExecutionEnvEnum.Node, sentryDep, {
14
+ dsn,
15
+ environment: releaseEnv,
16
+ release: releaseName,
17
+ }, sentryConfigOverrides, releaseEnv);
18
+ sentryDep.init(finalSentryConfig);
19
+ sentryDep.addGlobalEventProcessor((event, hint) => processSentryEvent(event, hint, createUniversalContext));
20
+ return sentryDep;
21
+ }
@@ -1,4 +1,4 @@
1
- import { EventHint, Event as SentryEvent } from '@sentry/types';
1
+ import type { EventHint, Event as SentryEvent } from '@sentry/types';
2
2
  import { EventExtraContextCreator } from '../event-context/event-context';
3
3
  /** Attach extra event data for a sentry event. */
4
4
  export declare function processSentryEvent(
@@ -2,6 +2,8 @@ import { mergeDeep } from '@augment-vir/common';
2
2
  import { SentryExecutionEnvEnum, } from '../env/execution-env';
3
3
  import { createSentryHandler } from './handle-sentry-send';
4
4
  /** Creates the sentry config used internally by sentry-vir. */
5
+ // can't test config creation because it depends on execution environment
6
+ /* c8 ignore next 60 */
5
7
  export async function createSentryConfig(env, sentryDep, requiredSentryOptions, userOverrides, releaseEnv) {
6
8
  const sharedSentryConfig = {
7
9
  beforeSend: createSentryHandler(releaseEnv),
@@ -26,31 +26,42 @@ export async function setSentryClientForLogging(client) {
26
26
  }
27
27
  function sendPrematureEvents() {
28
28
  while (prematureSentryEvents.length) {
29
- const prematureLog = prematureSentryEvents.pop();
30
- if (!prematureLog) {
31
- return;
29
+ try {
30
+ const prematureLog = prematureSentryEvents.pop();
31
+ if (!prematureLog) {
32
+ return;
33
+ }
34
+ prematureLog.entryPoint(...prematureLog.inputs);
35
+ }
36
+ catch (caught) {
37
+ console.error('error while trying to send sentry logs:', caught);
32
38
  }
33
- prematureLog.entryPoint(...prematureLog.inputs);
34
39
  }
35
40
  }
36
41
  /** Record an error to Sentry without throwing it. */
37
42
  export function handleError(error, extraContext) {
38
- if (!sentryClientForLogging) {
39
- prematureSentryEvents.push({
40
- entryPoint: handleError,
41
- inputs: [
42
- error,
43
- extraContext,
44
- ],
43
+ try {
44
+ if (!sentryClientForLogging) {
45
+ prematureSentryEvents.push({
46
+ entryPoint: handleError,
47
+ inputs: [
48
+ error,
49
+ extraContext,
50
+ ],
51
+ });
52
+ return undefined;
53
+ }
54
+ const scopeContext = convertEventDetailsToSentryContext({
55
+ extraContext,
56
+ severity: EventSeverityEnum.Error,
45
57
  });
58
+ const eventId = sentryClientForLogging.captureException(error, scopeContext);
59
+ return eventId;
60
+ }
61
+ catch (caught) {
62
+ console.error('error while trying to handle error:', caught);
46
63
  return undefined;
47
64
  }
48
- const scopeContext = convertEventDetailsToSentryContext({
49
- extraContext,
50
- severity: EventSeverityEnum.Error,
51
- });
52
- const eventId = sentryClientForLogging.captureException(error, scopeContext);
53
- return eventId;
54
65
  }
55
66
  /** Send non-error events to Sentry. */
56
67
  export const sendLog = {
@@ -70,22 +81,28 @@ function wrapLogWithSeverity(severity) {
70
81
  };
71
82
  }
72
83
  function sendLogToSentry(logInfo, eventDetails) {
73
- if (!sentryClientForLogging) {
74
- prematureSentryEvents.push({
75
- entryPoint: sendLogToSentry,
76
- inputs: [
77
- logInfo,
78
- eventDetails,
79
- ],
80
- });
84
+ try {
85
+ if (!sentryClientForLogging) {
86
+ prematureSentryEvents.push({
87
+ entryPoint: sendLogToSentry,
88
+ inputs: [
89
+ logInfo,
90
+ eventDetails,
91
+ ],
92
+ });
93
+ return undefined;
94
+ }
95
+ const scopeContext = convertEventDetailsToSentryContext(eventDetails);
96
+ const eventId = isRuntimeTypeOf(logInfo, 'string')
97
+ ? sentryClientForLogging.captureMessage(logInfo, scopeContext)
98
+ : sentryClientForLogging.captureEvent({
99
+ ...logInfo,
100
+ ...scopeContext,
101
+ });
102
+ return eventId;
103
+ }
104
+ catch (caught) {
105
+ console.error('error while trying to send log:', caught);
81
106
  return undefined;
82
107
  }
83
- const scopeContext = convertEventDetailsToSentryContext(eventDetails);
84
- const eventId = isRuntimeTypeOf(logInfo, 'string')
85
- ? sentryClientForLogging.captureMessage(logInfo, scopeContext)
86
- : sentryClientForLogging.captureEvent({
87
- ...logInfo,
88
- ...scopeContext,
89
- });
90
- return eventId;
91
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sentry-vir",
3
- "version": "0.0.3",
3
+ "version": "0.1.0",
4
4
  "keywords": [
5
5
  "config",
6
6
  "helper",
@@ -22,9 +22,12 @@
22
22
  },
23
23
  "main": "dist/cjs/index.js",
24
24
  "module": "dist/esm/index.js",
25
- "types": "dist/types/index.d.ts",
25
+ "types": "dist/esm/index.d.ts",
26
+ "workspaces": [
27
+ "./"
28
+ ],
26
29
  "scripts": {
27
- "compile": "rm -rf dist && tsc --project tsconfig.json && tsc --project tsconfig.cjs.json",
30
+ "compile": "rm -rf dist && tsc --project tsconfig.json && npm i && tsc --project tsconfig.cjs.json",
28
31
  "docs": "virmator docs",
29
32
  "format": "virmator format",
30
33
  "publish": "virmator publish \"npm run compile && npm run test:all\"",
@@ -1,194 +0,0 @@
1
- import type { Options } from '@sentry/types';
2
- import { SentryExecutionEnvEnum } from '../env/execution-env';
3
- import { SentryReleaseEnvEnum } from '../env/release-env';
4
- import { EventExtraContextCreator } from '../event-context/event-context';
5
- import { UserOverrides } from './sentry-config';
6
- /** Configuration for initializing Sentry. */
7
- export type InitSentryInput = {
8
- /**
9
- * The environment wherein the Sentry client will execute. Used to determine which Sentry client
10
- * to load: browser or node.
11
- */
12
- executionEnv: SentryExecutionEnvEnum;
13
- /**
14
- * The release environment, prod vs dev rather than browser vs node. In dev, events won't be
15
- * sent to sentry. In both options, all events will be logged to the local console.
16
- */
17
- releaseEnv: SentryReleaseEnvEnum;
18
- /** Name for the current release. */
19
- releaseName: Required<Options>['release'];
20
- /** DSN needed for Sentry to hook up to your sentry project. */
21
- dsn: Required<Options>['dsn'];
22
- /**
23
- * Optionally create extra context to be included in all Sentry events. This will execute for
24
- * each event that is processed.
25
- */
26
- createUniversalContext?: EventExtraContextCreator | undefined;
27
- /** Optionally override any Sentry config properties that this package sets. */
28
- sentryConfigOverrides?: UserOverrides;
29
- };
30
- /**
31
- * Setup a sentry client with all the default sentry-vir integrations and configs.
32
- *
33
- * To override any default sentry-vir settings, include them in the userConfig input.
34
- */
35
- export declare function initSentry({ executionEnv, dsn, releaseEnv, releaseName, sentryConfigOverrides, createUniversalContext, }: InitSentryInput): Promise<{
36
- default: typeof import("@sentry/browser");
37
- Integrations: {
38
- GlobalHandlers: typeof import("@sentry/browser").GlobalHandlers;
39
- TryCatch: typeof import("@sentry/browser").TryCatch;
40
- Breadcrumbs: typeof import("@sentry/browser").Breadcrumbs;
41
- LinkedErrors: typeof import("@sentry/browser").LinkedErrors;
42
- HttpContext: typeof import("@sentry/browser").HttpContext;
43
- Dedupe: typeof import("@sentry/browser").Dedupe;
44
- FunctionToString: typeof import("@sentry/core").FunctionToString;
45
- InboundFilters: typeof import("@sentry/core").InboundFilters;
46
- };
47
- Replay: typeof import("@sentry/replay").Replay;
48
- BrowserTracing: typeof import("@sentry-internal/tracing").BrowserTracing;
49
- defaultRequestInstrumentationOptions: import("@sentry-internal/tracing").RequestInstrumentationOptions;
50
- instrumentOutgoingRequests: typeof import("@sentry-internal/tracing").instrumentOutgoingRequests;
51
- addTracingExtensions: typeof import("@sentry/core").addTracingExtensions;
52
- setMeasurement: typeof import("@sentry/core").setMeasurement;
53
- extractTraceparentData: typeof import("@sentry/utils").extractTraceparentData;
54
- getActiveTransaction: typeof import("@sentry/core").getActiveTransaction;
55
- spanStatusfromHttpCode: typeof import("@sentry/core").spanStatusfromHttpCode;
56
- trace: typeof import("@sentry/core").trace;
57
- makeMultiplexedTransport: typeof import("@sentry/core").makeMultiplexedTransport;
58
- ModuleMetadata: typeof import("@sentry/core").ModuleMetadata;
59
- makeBrowserOfflineTransport: typeof import("@sentry/browser").makeBrowserOfflineTransport;
60
- onProfilingStartRouteTransaction: typeof import("@sentry/browser").onProfilingStartRouteTransaction;
61
- BrowserProfilingIntegration: typeof import("@sentry/browser").BrowserProfilingIntegration;
62
- addGlobalEventProcessor: typeof import("@sentry/core").addGlobalEventProcessor;
63
- addBreadcrumb: typeof import("@sentry/core").addBreadcrumb;
64
- captureException: typeof import("@sentry/core").captureException;
65
- captureEvent: typeof import("@sentry/core").captureEvent;
66
- captureMessage: typeof import("@sentry/core").captureMessage;
67
- close: typeof import("@sentry/core").close;
68
- configureScope: typeof import("@sentry/core").configureScope;
69
- createTransport: typeof import("@sentry/core").createTransport;
70
- flush: typeof import("@sentry/core").flush;
71
- getHubFromCarrier: typeof import("@sentry/core").getHubFromCarrier;
72
- getCurrentHub: typeof import("@sentry/core").getCurrentHub;
73
- Hub: typeof import("@sentry/core").Hub;
74
- lastEventId: typeof import("@sentry/core").lastEventId;
75
- makeMain: typeof import("@sentry/core").makeMain;
76
- Scope: typeof import("@sentry/core").Scope;
77
- startTransaction: typeof import("@sentry/core").startTransaction;
78
- getActiveSpan: typeof import("@sentry/core").getActiveSpan;
79
- startSpan: typeof import("@sentry/core").startSpan;
80
- startInactiveSpan: typeof import("@sentry/core").startInactiveSpan;
81
- startSpanManual: typeof import("@sentry/core").startSpanManual;
82
- SDK_VERSION: "7.73.0";
83
- setContext: typeof import("@sentry/core").setContext;
84
- setExtra: typeof import("@sentry/core").setExtra;
85
- setExtras: typeof import("@sentry/core").setExtras;
86
- setTag: typeof import("@sentry/core").setTag;
87
- setTags: typeof import("@sentry/core").setTags;
88
- setUser: typeof import("@sentry/core").setUser;
89
- withScope: typeof import("@sentry/core").withScope;
90
- FunctionToString: typeof import("@sentry/core").FunctionToString;
91
- InboundFilters: typeof import("@sentry/core").InboundFilters;
92
- WINDOW: import("@sentry/utils").InternalGlobal & Window;
93
- BrowserClient: typeof import("@sentry/browser").BrowserClient;
94
- makeFetchTransport: typeof import("@sentry/browser").makeFetchTransport;
95
- makeXHRTransport: typeof import("@sentry/browser").makeXHRTransport;
96
- defaultStackParser: import("@sentry/types").StackParser;
97
- defaultStackLineParsers: import("@sentry/types").StackLineParser[];
98
- chromeStackLineParser: import("@sentry/types").StackLineParser;
99
- geckoStackLineParser: import("@sentry/types").StackLineParser;
100
- opera10StackLineParser: import("@sentry/types").StackLineParser;
101
- opera11StackLineParser: import("@sentry/types").StackLineParser;
102
- winjsStackLineParser: import("@sentry/types").StackLineParser;
103
- eventFromException: typeof import("@sentry/browser").eventFromException;
104
- eventFromMessage: typeof import("@sentry/browser").eventFromMessage;
105
- exceptionFromError: typeof import("@sentry/browser").exceptionFromError;
106
- createUserFeedbackEnvelope: typeof import("@sentry/browser").createUserFeedbackEnvelope;
107
- defaultIntegrations: (import("@sentry/browser").HttpContext | import("@sentry/browser").Dedupe | import("@sentry/core").InboundFilters | import("@sentry/core").FunctionToString | import("@sentry/browser").GlobalHandlers | import("@sentry/browser").TryCatch | import("@sentry/browser").Breadcrumbs | import("@sentry/browser").LinkedErrors)[];
108
- forceLoad: typeof import("@sentry/browser").forceLoad;
109
- init: typeof import("@sentry/browser").init;
110
- onLoad: typeof import("@sentry/browser").onLoad;
111
- showReportDialog: typeof import("@sentry/browser").showReportDialog;
112
- captureUserFeedback: typeof import("@sentry/browser").captureUserFeedback;
113
- wrap: typeof import("@sentry/browser").wrap;
114
- GlobalHandlers: typeof import("@sentry/browser").GlobalHandlers;
115
- TryCatch: typeof import("@sentry/browser").TryCatch;
116
- Breadcrumbs: typeof import("@sentry/browser").Breadcrumbs;
117
- LinkedErrors: typeof import("@sentry/browser").LinkedErrors;
118
- HttpContext: typeof import("@sentry/browser").HttpContext;
119
- Dedupe: typeof import("@sentry/browser").Dedupe;
120
- } | {
121
- default: typeof import("@sentry/node");
122
- addGlobalEventProcessor: typeof import("@sentry/core").addGlobalEventProcessor;
123
- addBreadcrumb: typeof import("@sentry/core").addBreadcrumb;
124
- captureException: typeof import("@sentry/core").captureException;
125
- captureEvent: typeof import("@sentry/core").captureEvent;
126
- captureMessage: typeof import("@sentry/core").captureMessage;
127
- close: typeof import("@sentry/core").close;
128
- configureScope: typeof import("@sentry/core").configureScope;
129
- createTransport: typeof import("@sentry/core").createTransport;
130
- extractTraceparentData: typeof import("@sentry/utils").extractTraceparentData;
131
- flush: typeof import("@sentry/core").flush;
132
- getActiveTransaction: typeof import("@sentry/core").getActiveTransaction;
133
- getHubFromCarrier: typeof import("@sentry/core").getHubFromCarrier;
134
- getCurrentHub: typeof import("@sentry/core").getCurrentHub;
135
- Hub: typeof import("@sentry/core").Hub;
136
- lastEventId: typeof import("@sentry/core").lastEventId;
137
- makeMain: typeof import("@sentry/core").makeMain;
138
- runWithAsyncContext: typeof import("@sentry/core").runWithAsyncContext;
139
- Scope: typeof import("@sentry/core").Scope;
140
- startTransaction: typeof import("@sentry/core").startTransaction;
141
- SDK_VERSION: "7.73.0";
142
- setContext: typeof import("@sentry/core").setContext;
143
- setExtra: typeof import("@sentry/core").setExtra;
144
- setExtras: typeof import("@sentry/core").setExtras;
145
- setTag: typeof import("@sentry/core").setTag;
146
- setTags: typeof import("@sentry/core").setTags;
147
- setUser: typeof import("@sentry/core").setUser;
148
- spanStatusfromHttpCode: typeof import("@sentry/core").spanStatusfromHttpCode;
149
- trace: typeof import("@sentry/core").trace;
150
- withScope: typeof import("@sentry/core").withScope;
151
- captureCheckIn: typeof import("@sentry/core").captureCheckIn;
152
- setMeasurement: typeof import("@sentry/core").setMeasurement;
153
- getActiveSpan: typeof import("@sentry/core").getActiveSpan;
154
- startSpan: typeof import("@sentry/core").startSpan;
155
- startActiveSpan: typeof import("@sentry/core").startSpan;
156
- startInactiveSpan: typeof import("@sentry/core").startInactiveSpan;
157
- startSpanManual: typeof import("@sentry/core").startSpanManual;
158
- autoDiscoverNodePerformanceMonitoringIntegrations: typeof import("@sentry/node").autoDiscoverNodePerformanceMonitoringIntegrations;
159
- NodeClient: typeof import("@sentry/node").NodeClient;
160
- makeNodeTransport: typeof import("@sentry/node").makeNodeTransport;
161
- defaultIntegrations: (import("@sentry/core").InboundFilters | import("@sentry/core").FunctionToString | import("@sentry/node/types/integrations").OnUncaughtException | import("@sentry/node/types/integrations").OnUnhandledRejection | import("@sentry/node/types/integrations").ContextLines | import("@sentry/node/types/integrations").Context | import("@sentry/node/types/integrations").Console | import("@sentry/node/types/integrations").Http | import("@sentry/node/types/integrations").LinkedErrors | import("@sentry/node/types/integrations").Modules | import("@sentry/node/types/integrations").RequestData | import("@sentry/node/types/integrations").LocalVariables | import("@sentry/node/types/integrations").Undici)[];
162
- init: typeof import("@sentry/node").init;
163
- defaultStackParser: import("@sentry/types").StackParser;
164
- getSentryRelease: typeof import("@sentry/node").getSentryRelease;
165
- addRequestDataToEvent: typeof import("@sentry/node").addRequestDataToEvent;
166
- DEFAULT_USER_INCLUDES: string[];
167
- extractRequestData: typeof import("@sentry/node").extractRequestData;
168
- deepReadDirSync: typeof import("@sentry/node").deepReadDirSync;
169
- getModuleFromFilename: typeof import("@sentry/node").getModuleFromFilename;
170
- enableAnrDetection: typeof import("@sentry/node").enableAnrDetection;
171
- Integrations: {
172
- Apollo: typeof import("@sentry-internal/tracing").Apollo;
173
- Express: typeof import("@sentry-internal/tracing").Express;
174
- GraphQL: typeof import("@sentry-internal/tracing").GraphQL;
175
- Mongo: typeof import("@sentry-internal/tracing").Mongo;
176
- Mysql: typeof import("@sentry-internal/tracing").Mysql;
177
- Postgres: typeof import("@sentry-internal/tracing").Postgres;
178
- Prisma: typeof import("@sentry-internal/tracing").Prisma;
179
- Console: typeof import("@sentry/node/types/integrations").Console;
180
- Http: typeof import("@sentry/node/types/integrations").Http;
181
- OnUncaughtException: typeof import("@sentry/node/types/integrations").OnUncaughtException;
182
- OnUnhandledRejection: typeof import("@sentry/node/types/integrations").OnUnhandledRejection;
183
- LinkedErrors: typeof import("@sentry/node/types/integrations").LinkedErrors;
184
- Modules: typeof import("@sentry/node/types/integrations").Modules;
185
- ContextLines: typeof import("@sentry/node/types/integrations").ContextLines;
186
- Context: typeof import("@sentry/node/types/integrations").Context;
187
- RequestData: typeof import("@sentry/node/types/integrations").RequestData;
188
- LocalVariables: typeof import("@sentry/node/types/integrations").LocalVariables;
189
- Undici: typeof import("@sentry/node/types/integrations").Undici;
190
- FunctionToString: typeof import("@sentry/core").FunctionToString;
191
- InboundFilters: typeof import("@sentry/core").InboundFilters;
192
- };
193
- Handlers: typeof import("@sentry/node/types/handlers");
194
- }>;
@@ -1,181 +0,0 @@
1
- /** Used to determine which Sentry client dependency to import. */
2
- export declare enum SentryExecutionEnvEnum {
3
- Browser = "browser",
4
- Node = "node"
5
- }
6
- /** The sentry dep import for each execution env. */
7
- export declare const sentryDepByEnv: {
8
- /** Sentry client for the browser. */
9
- readonly browser: () => Promise<{
10
- default: typeof import("@sentry/browser");
11
- Integrations: {
12
- GlobalHandlers: typeof import("@sentry/browser").GlobalHandlers;
13
- TryCatch: typeof import("@sentry/browser").TryCatch;
14
- Breadcrumbs: typeof import("@sentry/browser").Breadcrumbs;
15
- LinkedErrors: typeof import("@sentry/browser").LinkedErrors;
16
- HttpContext: typeof import("@sentry/browser").HttpContext;
17
- Dedupe: typeof import("@sentry/browser").Dedupe;
18
- FunctionToString: typeof import("@sentry/browser").FunctionToString; /** Sentry client dependency used only in the browser. */
19
- InboundFilters: typeof import("@sentry/browser").InboundFilters;
20
- };
21
- Replay: typeof import("@sentry/browser").Replay;
22
- BrowserTracing: typeof import("@sentry/browser").BrowserTracing;
23
- defaultRequestInstrumentationOptions: import("@sentry/browser").RequestInstrumentationOptions;
24
- instrumentOutgoingRequests: typeof import("@sentry/browser").instrumentOutgoingRequests;
25
- addTracingExtensions: typeof import("@sentry/browser").addTracingExtensions;
26
- setMeasurement: typeof import("@sentry/browser").setMeasurement;
27
- extractTraceparentData: typeof import("@sentry/browser").extractTraceparentData;
28
- getActiveTransaction: typeof import("@sentry/browser").getActiveTransaction;
29
- spanStatusfromHttpCode: typeof import("@sentry/browser").spanStatusfromHttpCode;
30
- trace: typeof import("@sentry/browser").trace;
31
- makeMultiplexedTransport: typeof import("@sentry/browser").makeMultiplexedTransport;
32
- ModuleMetadata: typeof import("@sentry/browser").ModuleMetadata;
33
- makeBrowserOfflineTransport: typeof import("@sentry/browser").makeBrowserOfflineTransport;
34
- onProfilingStartRouteTransaction: typeof import("@sentry/browser").onProfilingStartRouteTransaction;
35
- BrowserProfilingIntegration: typeof import("@sentry/browser").BrowserProfilingIntegration;
36
- addGlobalEventProcessor: typeof import("@sentry/browser").addGlobalEventProcessor;
37
- addBreadcrumb: typeof import("@sentry/browser").addBreadcrumb;
38
- captureException: typeof import("@sentry/browser").captureException;
39
- captureEvent: typeof import("@sentry/browser").captureEvent;
40
- captureMessage: typeof import("@sentry/browser").captureMessage;
41
- close: typeof import("@sentry/browser").close;
42
- configureScope: typeof import("@sentry/browser").configureScope;
43
- createTransport: typeof import("@sentry/browser").createTransport;
44
- flush: typeof import("@sentry/browser").flush;
45
- getHubFromCarrier: typeof import("@sentry/browser").getHubFromCarrier;
46
- getCurrentHub: typeof import("@sentry/browser").getCurrentHub;
47
- Hub: typeof import("@sentry/browser").Hub;
48
- lastEventId: typeof import("@sentry/browser").lastEventId;
49
- makeMain: typeof import("@sentry/browser").makeMain;
50
- Scope: typeof import("@sentry/browser").Scope;
51
- startTransaction: typeof import("@sentry/browser").startTransaction;
52
- getActiveSpan: typeof import("@sentry/browser").getActiveSpan;
53
- startSpan: typeof import("@sentry/browser").startSpan;
54
- startInactiveSpan: typeof import("@sentry/browser").startInactiveSpan;
55
- startSpanManual: typeof import("@sentry/browser").startSpanManual;
56
- SDK_VERSION: "7.73.0";
57
- setContext: typeof import("@sentry/browser").setContext;
58
- setExtra: typeof import("@sentry/browser").setExtra;
59
- setExtras: typeof import("@sentry/browser").setExtras;
60
- setTag: typeof import("@sentry/browser").setTag;
61
- setTags: typeof import("@sentry/browser").setTags;
62
- setUser: typeof import("@sentry/browser").setUser;
63
- withScope: typeof import("@sentry/browser").withScope;
64
- FunctionToString: typeof import("@sentry/browser").FunctionToString;
65
- InboundFilters: typeof import("@sentry/browser").InboundFilters;
66
- WINDOW: import("@sentry/utils").InternalGlobal & Window;
67
- BrowserClient: typeof import("@sentry/browser").BrowserClient;
68
- makeFetchTransport: typeof import("@sentry/browser").makeFetchTransport;
69
- makeXHRTransport: typeof import("@sentry/browser").makeXHRTransport;
70
- defaultStackParser: import("@sentry/types").StackParser;
71
- defaultStackLineParsers: import("@sentry/types").StackLineParser[];
72
- chromeStackLineParser: import("@sentry/types").StackLineParser;
73
- geckoStackLineParser: import("@sentry/types").StackLineParser;
74
- opera10StackLineParser: import("@sentry/types").StackLineParser;
75
- opera11StackLineParser: import("@sentry/types").StackLineParser;
76
- winjsStackLineParser: import("@sentry/types").StackLineParser;
77
- eventFromException: typeof import("@sentry/browser").eventFromException;
78
- eventFromMessage: typeof import("@sentry/browser").eventFromMessage;
79
- exceptionFromError: typeof import("@sentry/browser").exceptionFromError;
80
- createUserFeedbackEnvelope: typeof import("@sentry/browser").createUserFeedbackEnvelope;
81
- defaultIntegrations: (import("@sentry/browser").HttpContext | import("@sentry/browser").Dedupe | import("@sentry/browser").InboundFilters | import("@sentry/browser").FunctionToString | import("@sentry/browser").GlobalHandlers | import("@sentry/browser").TryCatch | import("@sentry/browser").Breadcrumbs | import("@sentry/browser").LinkedErrors)[];
82
- forceLoad: typeof import("@sentry/browser").forceLoad;
83
- init: typeof import("@sentry/browser").init;
84
- onLoad: typeof import("@sentry/browser").onLoad;
85
- showReportDialog: typeof import("@sentry/browser").showReportDialog;
86
- captureUserFeedback: typeof import("@sentry/browser").captureUserFeedback;
87
- wrap: typeof import("@sentry/browser").wrap;
88
- GlobalHandlers: typeof import("@sentry/browser").GlobalHandlers;
89
- TryCatch: typeof import("@sentry/browser").TryCatch;
90
- Breadcrumbs: typeof import("@sentry/browser").Breadcrumbs;
91
- LinkedErrors: typeof import("@sentry/browser").LinkedErrors;
92
- HttpContext: typeof import("@sentry/browser").HttpContext;
93
- Dedupe: typeof import("@sentry/browser").Dedupe;
94
- }>;
95
- /** Sentry client for the Node.js. */
96
- readonly node: () => Promise<{
97
- default: typeof import("@sentry/node");
98
- addGlobalEventProcessor: typeof import("@sentry/browser").addGlobalEventProcessor;
99
- addBreadcrumb: typeof import("@sentry/browser").addBreadcrumb;
100
- captureException: typeof import("@sentry/browser").captureException;
101
- captureEvent: typeof import("@sentry/browser").captureEvent;
102
- captureMessage: typeof import("@sentry/browser").captureMessage;
103
- close: typeof import("@sentry/browser").close;
104
- configureScope: typeof import("@sentry/browser").configureScope;
105
- createTransport: typeof import("@sentry/browser").createTransport;
106
- extractTraceparentData: typeof import("@sentry/browser").extractTraceparentData;
107
- flush: typeof import("@sentry/browser").flush;
108
- getActiveTransaction: typeof import("@sentry/browser").getActiveTransaction;
109
- getHubFromCarrier: typeof import("@sentry/browser").getHubFromCarrier;
110
- getCurrentHub: typeof import("@sentry/browser").getCurrentHub;
111
- Hub: typeof import("@sentry/browser").Hub;
112
- lastEventId: typeof import("@sentry/browser").lastEventId;
113
- makeMain: typeof import("@sentry/browser").makeMain;
114
- runWithAsyncContext: typeof import("@sentry/node").runWithAsyncContext;
115
- Scope: typeof import("@sentry/browser").Scope;
116
- startTransaction: typeof import("@sentry/browser").startTransaction;
117
- SDK_VERSION: "7.73.0";
118
- setContext: typeof import("@sentry/browser").setContext;
119
- setExtra: typeof import("@sentry/browser").setExtra;
120
- setExtras: typeof import("@sentry/browser").setExtras;
121
- setTag: typeof import("@sentry/browser").setTag;
122
- setTags: typeof import("@sentry/browser").setTags;
123
- setUser: typeof import("@sentry/browser").setUser;
124
- spanStatusfromHttpCode: typeof import("@sentry/browser").spanStatusfromHttpCode;
125
- trace: typeof import("@sentry/browser").trace;
126
- withScope: typeof import("@sentry/browser").withScope;
127
- captureCheckIn: typeof import("@sentry/node").captureCheckIn;
128
- setMeasurement: typeof import("@sentry/browser").setMeasurement;
129
- getActiveSpan: typeof import("@sentry/browser").getActiveSpan;
130
- startSpan: typeof import("@sentry/browser").startSpan;
131
- startActiveSpan: typeof import("@sentry/browser").startSpan;
132
- startInactiveSpan: typeof import("@sentry/browser").startInactiveSpan;
133
- startSpanManual: typeof import("@sentry/browser").startSpanManual;
134
- autoDiscoverNodePerformanceMonitoringIntegrations: typeof import("@sentry/node").autoDiscoverNodePerformanceMonitoringIntegrations;
135
- NodeClient: typeof import("@sentry/node").NodeClient;
136
- makeNodeTransport: typeof import("@sentry/node").makeNodeTransport;
137
- defaultIntegrations: (import("@sentry/browser").InboundFilters | import("@sentry/browser").FunctionToString | import("@sentry/node/types/integrations").OnUncaughtException | import("@sentry/node/types/integrations").OnUnhandledRejection | import("@sentry/node/types/integrations").ContextLines | import("@sentry/node/types/integrations").Context | import("@sentry/node/types/integrations").Console | import("@sentry/node/types/integrations").Http | import("@sentry/node/types/integrations").LinkedErrors | import("@sentry/node/types/integrations").Modules | import("@sentry/node/types/integrations").RequestData | import("@sentry/node/types/integrations").LocalVariables | import("@sentry/node/types/integrations").Undici)[];
138
- init: typeof import("@sentry/node").init;
139
- defaultStackParser: import("@sentry/types").StackParser;
140
- getSentryRelease: typeof import("@sentry/node").getSentryRelease;
141
- addRequestDataToEvent: typeof import("@sentry/node").addRequestDataToEvent;
142
- DEFAULT_USER_INCLUDES: string[];
143
- extractRequestData: typeof import("@sentry/node").extractRequestData;
144
- deepReadDirSync: typeof import("@sentry/node").deepReadDirSync;
145
- getModuleFromFilename: typeof import("@sentry/node").getModuleFromFilename;
146
- enableAnrDetection: typeof import("@sentry/node").enableAnrDetection;
147
- Integrations: {
148
- Apollo: typeof import("@sentry-internal/tracing").Apollo;
149
- Express: typeof import("@sentry-internal/tracing").Express;
150
- GraphQL: typeof import("@sentry-internal/tracing").GraphQL;
151
- Mongo: typeof import("@sentry-internal/tracing").Mongo;
152
- Mysql: typeof import("@sentry-internal/tracing").Mysql;
153
- Postgres: typeof import("@sentry-internal/tracing").Postgres;
154
- Prisma: typeof import("@sentry-internal/tracing").Prisma;
155
- Console: typeof import("@sentry/node/types/integrations").Console;
156
- Http: typeof import("@sentry/node/types/integrations").Http;
157
- OnUncaughtException: typeof import("@sentry/node/types/integrations").OnUncaughtException;
158
- OnUnhandledRejection: typeof import("@sentry/node/types/integrations").OnUnhandledRejection;
159
- LinkedErrors: typeof import("@sentry/node/types/integrations").LinkedErrors;
160
- Modules: typeof import("@sentry/node/types/integrations").Modules;
161
- ContextLines: typeof import("@sentry/node/types/integrations").ContextLines;
162
- Context: typeof import("@sentry/node/types/integrations").Context;
163
- RequestData: typeof import("@sentry/node/types/integrations").RequestData;
164
- LocalVariables: typeof import("@sentry/node/types/integrations").LocalVariables;
165
- Undici: typeof import("@sentry/node/types/integrations").Undici;
166
- FunctionToString: typeof import("@sentry/browser").FunctionToString;
167
- InboundFilters: typeof import("@sentry/browser").InboundFilters;
168
- };
169
- Handlers: typeof import("@sentry/node/types/handlers");
170
- }>;
171
- };
172
- /** Sentry client dependency used only in the browser. */
173
- export type SentryBrowserDep = Awaited<ReturnType<(typeof sentryDepByEnv)[SentryExecutionEnvEnum.Browser]>>;
174
- /** Sentry client dependency used only in Node.js. */
175
- export type SentryNodeDep = Awaited<ReturnType<(typeof sentryDepByEnv)[SentryExecutionEnvEnum.Node]>>;
176
- /** Any of the Sentry client dependencies. */
177
- export type SentryDep = SentryBrowserDep | SentryNodeDep;
178
- /** Pick a Sentry client dependency based on the given environment. */
179
- export type SentryDepByEnv<Env extends SentryExecutionEnvEnum> = Env extends SentryExecutionEnvEnum.Browser ? SentryBrowserDep : SentryNodeDep;
180
- /** Determine which Sentry client dependency to use and then import it. */
181
- export declare function getSentryByEnv<const Env extends SentryExecutionEnvEnum>(env: Env): Promise<SentryDepByEnv<Env>>;