Comparing version 0.29.0 to 0.30.1
@@ -27,7 +27,7 @@ import { | ||
declare namespace middy { | ||
interface Middy<T, R> extends Handler<T, R> { | ||
use: <C extends MiddlewareObject<T, R>>(middleware: C) => Middy<T, R>; | ||
before: (callbackFn: MiddlewareFunction<T, R>) => Middy<T, R>; | ||
after: (callbackFn: MiddlewareFunction<T, R>) => Middy<T, R>; | ||
onError: (callbackFn: MiddlewareFunction<T, R>) => Middy<T, R>; | ||
interface Middy<T, R, C extends Context = Context> extends Handler<T, R> { | ||
use: <M extends MiddlewareObject<T, R, C>>(middleware: M) => Middy<T, R, C>; | ||
before: (callbackFn: MiddlewareFunction<T, R, C>) => Middy<T, R, C>; | ||
after: (callbackFn: MiddlewareFunction<T, R, C>) => Middy<T, R, C>; | ||
onError: (callbackFn: MiddlewareFunction<T, R, C>) => Middy<T, R, C>; | ||
} | ||
@@ -37,18 +37,18 @@ | ||
interface MiddlewareObject<T, R> { | ||
before?: MiddlewareFunction<T, R>; | ||
after?: MiddlewareFunction<T, R>; | ||
onError?: MiddlewareFunction<T, R>; | ||
interface MiddlewareObject<T, R, C extends Context = Context> { | ||
before?: MiddlewareFunction<T, R, C>; | ||
after?: MiddlewareFunction<T, R, C>; | ||
onError?: MiddlewareFunction<T, R, C>; | ||
} | ||
type MiddlewareFunction<T, R> = (handler: HandlerLambda<T, R>, next: NextFunction) => void | Promise<any>; | ||
type MiddlewareFunction<T, R, C extends Context = Context> = (handler: HandlerLambda<T, R, C>, next: NextFunction) => void | Promise<any>; | ||
type NextFunction = (error?: any) => void; | ||
interface HandlerLambda<T = any, V = {}> { | ||
interface HandlerLambda<T = any, V = any, C extends Context = Context> { | ||
event: T; | ||
context: Context; | ||
context: C; | ||
response: V; | ||
error: Error; | ||
callback: Callback<T>; | ||
callback: Callback<V>; | ||
} | ||
@@ -55,0 +55,0 @@ } |
{ | ||
"name": "middy", | ||
"version": "0.29.0", | ||
"version": "0.30.1", | ||
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
189914