UNPKG

@bitblit/ratchet-epsilon-common

Version:

Tiny adapter to simplify building API gateway Lambda APIS

26 lines (25 loc) 1.8 kB
import { APIGatewayEvent, Context, ProxyResult, SNSEvent } from 'aws-lambda'; import { IncomingMessage, RequestListener, Server, ServerResponse } from 'http'; import { EpsilonGlobalHandler } from './epsilon-global-handler.js'; import { LocalServerOptions } from './config/local-server/local-server-options.js'; import { BackgroundEntry } from './background/background-entry.js'; export declare class LocalServer { private globalHandler; private server; private options; constructor(globalHandler: EpsilonGlobalHandler, inOpts?: LocalServerOptions); runServer(): Promise<boolean>; static createNodeServer(opts: LocalServerOptions, requestHandler: RequestListener): Server; requestHandler(request: IncomingMessage, response: ServerResponse): Promise<any>; static parseEpsilonBackgroundTriggerAsTask(evt: APIGatewayEvent): BackgroundEntry<any>; static bodyAsBase64String(request: IncomingMessage): Promise<string>; static messageToApiGatewayEvent(request: IncomingMessage, context: Context, options: LocalServerOptions): Promise<APIGatewayEvent>; static createBackgroundSNSEvent(entry: BackgroundEntry<any>): SNSEvent; static isProxyResult(val: any): boolean; static summarizeResponse(proxyResult: ProxyResult, sourceEvent: APIGatewayEvent): Record<string, any>; static writeProxyResultToServerResponse(proxyResult: ProxyResult, response: ServerResponse, sourceEvent: APIGatewayEvent, options: LocalServerOptions): Promise<boolean>; static parseQueryParamsFromUrlString(urlString: string): Record<string, string>; static runSampleBatchOnlyServerFromCliArgs(_args: string[]): Promise<void>; static runSampleLocalServerFromCliArgs(_args: string[]): Promise<void>; static buildBackgroundTriggerFormHtml(names?: string[]): string; }