AwsSimpleAdapter
@h4ad/serverless-adapter > AwsSimpleAdapter
(class) AwsSimpleAdapter
The abstract adapter to use to implement other simple AWS adapters
Signature:
export declare abstract class AwsSimpleAdapter<TEvent> implements AdapterContract<TEvent, Context, AWSSimpleAdapterResponseType>
Implements: AdapterContract <TEvent, Context, AWSSimpleAdapterResponseType >
(constructor)
Default constructor
Signature:
constructor(options: AWSSimpleAdapterOptions);
Parameters
Parameter | Type | Description |
---|---|---|
options | The options to customize the AwsSimpleAdapter |
(method) canHandle
Signature:
canHandle(_: unknown): _ is TEvent;
Parameters
Parameter | Type | Description |
---|---|---|
_ | unknown |
Returns:
_ is TEvent
(method) getAdapterName
Signature:
getAdapterName(): string;
Returns:
string
(method) getRequest
Signature:
getRequest(event: TEvent): AdapterRequest;
Parameters
Parameter | Type | Description |
---|---|---|
event | TEvent |
Returns:
(method) getResponse
Signature:
getResponse(\{ body, headers, isBase64Encoded, event, statusCode, }: GetResponseAdapterProps<TEvent>): AWSSimpleAdapterResponseType;
Parameters
Parameter | Type | Description |
---|---|---|
{ body, headers, isBase64Encoded, event, statusCode, } | GetResponseAdapterProps <TEvent> |
Returns:
(method) hasInvalidStatusCode
Check if the status code is invalid
Signature:
protected hasInvalidStatusCode(statusCode: number): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
statusCode | number | The status code |
Returns:
boolean
(method) onErrorWhileForwarding
Signature:
onErrorWhileForwarding(\{ error, delegatedResolver, }: OnErrorProps<TEvent, AWSSimpleAdapterResponseType>): void;
Parameters
Parameter | Type | Description |
---|---|---|
{ error, delegatedResolver, } | OnErrorProps <TEvent, AWSSimpleAdapterResponseType > |
Returns:
void
(property) options
Signature:
protected readonly options: AWSSimpleAdapterOptions;