@middy/s3-object-response 3.1.1 → 3.2.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.
- package/index.d.ts +22 -4
- package/package.json +5 -4
package/index.d.ts
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
import S3 from 'aws-sdk/clients/s3'
|
|
2
1
|
import middy from '@middy/core'
|
|
3
2
|
import { Options as MiddyOptions } from '@middy/util'
|
|
3
|
+
import { Context as LambdaContext } from 'aws-lambda'
|
|
4
|
+
import S3 from 'aws-sdk/clients/s3'
|
|
5
|
+
import { ClientRequest } from 'http'
|
|
4
6
|
|
|
5
7
|
interface Options<S = S3>
|
|
6
|
-
extends Pick<
|
|
7
|
-
|
|
8
|
+
extends Pick<
|
|
9
|
+
MiddyOptions<S, S3.Types.ClientConfiguration>,
|
|
10
|
+
| 'AwsClient'
|
|
11
|
+
| 'awsClientOptions'
|
|
12
|
+
| 'awsClientAssumeRole'
|
|
13
|
+
| 'awsClientCapture'
|
|
14
|
+
| 'disablePrefetch'
|
|
15
|
+
> {
|
|
8
16
|
bodyType?: 'stream' | 'promise'
|
|
9
17
|
}
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
export type Context<TOptions extends Options | undefined> = LambdaContext & {
|
|
20
|
+
s3Object: TOptions extends { bodyType: 'stream' }
|
|
21
|
+
? ClientRequest
|
|
22
|
+
: TOptions extends { bodyType: 'promise' }
|
|
23
|
+
? Promise<any>
|
|
24
|
+
: never
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare function s3ObjectResponse<TOptions extends Options | undefined> (
|
|
28
|
+
options?: TOptions
|
|
29
|
+
): middy.MiddlewareObj<unknown, any, Error, Context<TOptions>>
|
|
12
30
|
|
|
13
31
|
export default s3ObjectResponse
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/s3-object-response",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "S3 object response handling middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -62,12 +62,13 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://middy.js.org",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@middy/util": "3.
|
|
65
|
+
"@middy/util": "3.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "3.
|
|
68
|
+
"@middy/core": "3.2.0",
|
|
69
|
+
"@types/aws-lambda": "^8.10.101",
|
|
69
70
|
"aws-sdk": "^2.939.0",
|
|
70
71
|
"aws-xray-sdk": "^3.3.3"
|
|
71
72
|
},
|
|
72
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "ac46270daa388b52a81472ae8f9b8808a0136940"
|
|
73
74
|
}
|