@aikidosec/runtime
Advanced tools
Comparing version 1.5.6 to 1.5.7
@@ -1,5 +0,5 @@ | ||
import type { APIGatewayProxyHandler } from "aws-lambda"; | ||
import type { HttpFunction } from "@google-cloud/functions-framework"; | ||
import { AsyncOrCallbackHandler, InputEvents } from "../sources/Lambda"; | ||
export declare function protect(): void; | ||
export declare function lambda(): (handler: APIGatewayProxyHandler) => APIGatewayProxyHandler; | ||
export declare function lambda(): (handler: AsyncOrCallbackHandler<InputEvents, unknown>) => AsyncOrCallbackHandler<InputEvents, unknown>; | ||
export declare function cloudFunction(): (handler: HttpFunction) => HttpFunction; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (handler: import("aws-lambda").APIGatewayProxyHandler) => import("aws-lambda").APIGatewayProxyHandler; | ||
declare const _default: (handler: import("../sources/Lambda").AsyncOrCallbackHandler<import("../sources/Lambda").InputEvents, unknown>) => import("../sources/Lambda").AsyncOrCallbackHandler<import("../sources/Lambda").InputEvents, unknown>; | ||
export = _default; |
@@ -1,6 +0,23 @@ | ||
import type { APIGatewayProxyEvent, APIGatewayProxyResult, Callback, Context, Handler } from "aws-lambda"; | ||
import type { Callback, Context, Handler } from "aws-lambda"; | ||
type CallbackHandler<TEvent, TResult> = (event: TEvent, context: Context, callback: Callback<TResult>) => void; | ||
type AsyncHandler<TEvent, TResult> = (event: TEvent, context: Context) => Promise<TResult>; | ||
type AsyncOrCallbackHandler<TEvent, TResult> = AsyncHandler<TEvent, TResult> | CallbackHandler<TEvent, TResult>; | ||
export declare function createLambdaWrapper<TEvent extends APIGatewayProxyEvent, TResult extends APIGatewayProxyResult>(handler: AsyncOrCallbackHandler<TEvent, TResult>): Handler<TEvent, TResult>; | ||
export type AsyncOrCallbackHandler<TEvent, TResult> = AsyncHandler<TEvent, TResult> | CallbackHandler<TEvent, TResult>; | ||
export type APIGatewayProxyEvent = { | ||
httpMethod: string; | ||
headers: Record<string, string | undefined>; | ||
queryStringParameters?: Record<string, string>; | ||
requestContext?: { | ||
identity?: { | ||
sourceIp?: string; | ||
}; | ||
}; | ||
body?: string; | ||
}; | ||
export type SQSEvent = { | ||
Records: Array<{ | ||
body: string; | ||
}>; | ||
}; | ||
export type InputEvents = APIGatewayProxyEvent | SQSEvent; | ||
export declare function createLambdaWrapper<TEvent extends InputEvents, TResult>(handler: AsyncOrCallbackHandler<TEvent, TResult>): Handler<TEvent, TResult>; | ||
export {}; |
{ | ||
"name": "@aikidosec/runtime", | ||
"version": "1.5.6", | ||
"version": "1.5.7", | ||
"description": "Aikido runtime protects your application against NoSQL injections and more", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/AikidoSec/runtime-node", |
168707
3594