UNPKG

@webda/aws

Version:

Webda AWS Services implementation

69 lines (68 loc) 1.78 kB
import { Lambda } from "@aws-sdk/client-lambda"; import { AsyncAction, JobInfo, Runner, RunnerParameters } from "@webda/async"; import { ServiceParameters } from "@webda/core"; export interface LambdaAsyncJobEvent { eventSource: string; jobInfo: JobInfo; } declare const LambdaCallerParameters_base: { new (...args: any[]): { endpoint?: string; credentials?: { accessKeyId: string; secretAccessKey: string; sessionToken?: string; }; region?: string; type: string; url?: string; openapi?: import("@webda/core/lib/router").OpenAPIWebdaDefinition; }; } & typeof RunnerParameters; /** * */ declare class LambdaCallerParameters extends LambdaCallerParameters_base { /** * Default ARN to use */ arn: string; } export interface LambdaCommandEvent { command: "launch"; service: string; method: string; args?: string[]; } /** * A service that calls a Lambda function and retrieve its result * * @WebdaModda */ declare class LambdaCaller<T extends LambdaCallerParameters = LambdaCallerParameters> extends Runner<T> { /** * @inheritdoc */ launchAction(action: AsyncAction, info: JobInfo): Promise<any>; /** * Lambda client */ protected client: Lambda; /** * @inheritdoc */ loadParameters(params: any): ServiceParameters; /** * @inheritdoc */ resolve(): this; /** * Execute the Lambda function * @param params for the call * @param async wait for Lambda result * @param arn function to call default to the one from configuration * @returns */ execute(params?: any, async?: boolean, arn?: string): Promise<any>; } export { LambdaCaller };