File tree 4 files changed +16
-11
lines changed
4 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 1
- import * as Sentry from './index ' ;
1
+ import { init , tryPatchHandler } from './awslambda ' ;
2
2
3
3
const lambdaTaskRoot = process . env . LAMBDA_TASK_ROOT ;
4
4
if ( lambdaTaskRoot ) {
@@ -7,11 +7,11 @@ if (lambdaTaskRoot) {
7
7
throw Error ( `LAMBDA_TASK_ROOT is non-empty(${ lambdaTaskRoot } ) but _HANDLER is not set` ) ;
8
8
}
9
9
10
- Sentry . AWSLambda . init ( {
10
+ init ( {
11
11
_invokedByLambdaLayer : true ,
12
12
} ) ;
13
13
14
- Sentry . AWSLambda . tryPatchHandler ( lambdaTaskRoot , handlerString ) ;
14
+ tryPatchHandler ( lambdaTaskRoot , handlerString ) ;
15
15
} else {
16
16
throw Error ( 'LAMBDA_TASK_ROOT environment variable is not set' ) ;
17
17
}
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ import { awsServicesIntegration } from './awsservices';
26
26
import { DEBUG_BUILD } from './debug-build' ;
27
27
import { markEventUnhandled } from './utils' ;
28
28
29
- export * from '@sentry/node' ;
30
-
31
29
const { isPromise } = types ;
32
30
33
31
// https://www.npmjs.com/package/aws-lambda-consumer
@@ -37,7 +35,7 @@ type SyncHandler<T extends Handler> = (
37
35
callback : Parameters < T > [ 2 ] ,
38
36
) => void ;
39
37
40
- export type AsyncHandler < T extends Handler > = (
38
+ type AsyncHandler < T extends Handler > = (
41
39
event : Parameters < T > [ 0 ] ,
42
40
context : Parameters < T > [ 1 ] ,
43
41
) => Promise < NonNullable < Parameters < Parameters < T > [ 2 ] > [ 1 ] > > ;
Original file line number Diff line number Diff line change 1
1
/** This file is used as the entrypoint for the lambda layer bundle, and is not included in the npm package. */
2
2
3
- // https://medium.com/unsplash/named-namespace-imports-7345212bbffb
4
- import * as AWSLambda from './awslambda' ;
5
- export { AWSLambda } ;
3
+ import { init as awsLambdaInit , tryPatchHandler , wrapHandler } from './awslambda' ;
4
+
5
+ export const AWSLambda = {
6
+ init : awsLambdaInit ,
7
+ wrapHandler,
8
+ tryPatchHandler,
9
+ } ;
6
10
7
11
export * from './awsservices' ;
8
12
export * from '@sentry/node' ;
Original file line number Diff line number Diff line change 1
1
export { awsServicesIntegration } from './awsservices' ;
2
-
3
- import { init as awsLambdaInit , wrapHandler } from './awslambda' ;
2
+ import { init as awsLambdaInit , tryPatchHandler , wrapHandler } from './awslambda' ;
4
3
import { init as gcpFunctionInit } from './gcpfunction' ;
5
4
6
5
const AWSLambda = {
7
6
init : awsLambdaInit ,
8
7
wrapHandler,
8
+ tryPatchHandler,
9
9
} ;
10
10
11
11
const GCPFunction = {
@@ -14,6 +14,9 @@ const GCPFunction = {
14
14
15
15
export { AWSLambda , GCPFunction } ;
16
16
17
+ import type { WrapperOptions as AWSWrapperOptions } from './awslambda' ;
18
+ export type { AWSWrapperOptions } ;
19
+
17
20
// TODO(v8): We have to explicitly export these because of the namespace exports
18
21
// above. This is because just doing `export * from '@sentry/node'` will not
19
22
// work with Node native esm while we also have namespace exports in a package.
You can’t perform that action at this time.
0 commit comments