Typedef
Static Public Summary | ||
public |
this typedef is experimental. Future versions may allow a more abstract model for endpoints.
Interacting directly with and endpoint or its metadata may cause breaking
changes.
An endpoint is a prototype method in a Handler subclass. |
since 2.0.0 |
public |
this typedef is experimental. The properties of this are likely to change.
|
since 2.0.0 |
public |
The Handler can be customized to inspect different values for the operation and payload within the event. |
since 2.0.0 |
public |
Object bound as |
since 2.0.0 |
Static Public
public Endpoint: Function since 2.0.0 source
An endpoint is a prototype method in a Handler subclass. It's so-called because it is the end destination to which an event is dispatched. In the current version, an endpoint is simply a function with attached EndpointMetadata. In future versions, this may not be the case.
Properties:
Name | Type | Attribute | Description |
_λ6_metadata | EndpointMetadata | attached handler metadata |
Example:
@operation
testEndpoint() { return 'testEndpoint is an endpoint'; }
public EndpointMetadata: Object since 2.0.0 source
Endpoint metadata is what Handler uses to inspect an an Endpoint to determine if it's eligible to handle a given operation. Operations are "whitelisted" so that properties (own or inherited) of the handler don't get exposed as operation endpoints where they aren't meant to.
public HandlerOptions: Object since 2.0.0 source
The Handler can be customized to inspect different values for the operation and payload within the event. Currently, deep gets are not supported for key values, so the data must reside as a direct child of the root JSON object (event).
TODO:
- Add support deep gets for operation and payload keys.
public InvocationContext: Object since 2.0.0 source
Object bound as this
value when an Endpoint is invoked as the
last stage of the event-handling lifecycle. There are a few reasons for
binding to the new context:
- Provide only the invoked Endpoint with
event
andcontext
without needing to make these values universally available. - Allow parameters passed to the endpoint to be only those that are
locally relevant, such as the
payload
. In the future, this may include providing additional filters or middleware. - Implement a more functional approach with no shared state so that
the handler has no real side effects to the
context
orevent
. This enables future event handling schemes such as fanning out the event to multiple endpoints.
Properties:
Name | Type | Attribute | Description |
metadata | EndpointMetadata | metadata of current endpoint |
|
operation | string | number | operation key of current endpoint |
|
event | Object | the event being handled |
|
context | AWSLambdaContext |
|
the AWS Lambda context |