1 | import middy from '@middy/core'
|
2 | import { Options as MiddyOptions } from '@middy/util'
|
3 | import { Context as LambdaContext } from 'aws-lambda'
|
4 | import SecretsManager from 'aws-sdk/clients/secretsmanager'
|
5 |
|
6 | interface Options<SM = SecretsManager>
|
7 | extends MiddyOptions<SM, SecretsManager.Types.ClientConfiguration> {}
|
8 |
|
9 | export type Context<TOptions extends Options | undefined> = TOptions extends {
|
10 | setToContext: true
|
11 | }
|
12 | ? LambdaContext & Record<keyof TOptions['fetchData'], any>
|
13 | : LambdaContext
|
14 |
|
15 | declare function secretsManager<TOptions extends Options | undefined> (
|
16 | options?: TOptions
|
17 | ): middy.MiddlewareObj<unknown, any, Error, Context<TOptions>>
|
18 |
|
19 | export default secretsManager
|
20 |
|
\ | No newline at end of file |