@@ -3,14 +3,16 @@ import { hostname } from 'os';
3
3
import { basename , resolve } from 'path' ;
4
4
import { types } from 'util' ;
5
5
/* eslint-disable max-lines */
6
- import type { Scope } from '@sentry/node' ;
7
- import * as Sentry from '@sentry/node' ;
6
+ import type { NodeOptions , Scope } from '@sentry/node' ;
7
+ import { SDK_VERSION } from '@sentry/node' ;
8
8
import {
9
9
captureException ,
10
10
captureMessage ,
11
11
continueTrace ,
12
+ defaultIntegrations as nodeDefaultIntegrations ,
12
13
flush ,
13
14
getCurrentScope ,
15
+ init as initNode ,
14
16
startSpanManual ,
15
17
withScope ,
16
18
} from '@sentry/node' ;
@@ -63,9 +65,9 @@ export interface WrapperOptions {
63
65
startTrace : boolean ;
64
66
}
65
67
66
- export const defaultIntegrations : Integration [ ] = [ ...Sentry . defaultIntegrations , new AWSServices ( { optional : true } ) ] ;
68
+ export const defaultIntegrations : Integration [ ] = [ ...nodeDefaultIntegrations , new AWSServices ( { optional : true } ) ] ;
67
69
68
- interface AWSLambdaOptions extends Sentry . NodeOptions {
70
+ interface AWSLambdaOptions extends NodeOptions {
69
71
/**
70
72
* Internal field that is set to `true` when init() is called by the Sentry AWS Lambda layer.
71
73
*
@@ -74,7 +76,7 @@ interface AWSLambdaOptions extends Sentry.NodeOptions {
74
76
}
75
77
76
78
/**
77
- * @see {@link Sentry. init }
79
+ * @see {@link init }
78
80
*/
79
81
export function init ( options : AWSLambdaOptions = { } ) : void {
80
82
const opts = {
@@ -89,13 +91,13 @@ export function init(options: AWSLambdaOptions = {}): void {
89
91
packages : [
90
92
{
91
93
name : 'npm:@sentry/serverless' ,
92
- version : Sentry . SDK_VERSION ,
94
+ version : SDK_VERSION ,
93
95
} ,
94
96
] ,
95
- version : Sentry . SDK_VERSION ,
97
+ version : SDK_VERSION ,
96
98
} ;
97
99
98
- Sentry . init ( opts ) ;
100
+ initNode ( opts ) ;
99
101
}
100
102
101
103
/** */
0 commit comments