UNPKG

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