this example works only in AWS
- DynamoDB
- S3
- SNS
- Event
- (ApiGateway)
@dynamoTable({ tableName: '%ClassName%-table' })
export class Items extends DynamoDB { }@eventSource(Items)
export class CaptureDynamoEvent extends FunctionalService {
public static async handle( @param dynamodb) {
...
}
}there are specific parameters for eventSource data
- DynamoDB => dynamodb
- SNS => Sns
- S3 => s3
example (you can rename your property):
public static async handle( @param dynamodb) {}
public static async handle( @param('dynamodb') p1) {}you can resolve deep object properties with param decorator
public static async handle( @param('Sns.Subject') subject, @param('Sns.Message') message) {}there is an event decorator which return the original parameters
public static async handle( @serviceParams rawData) {
console.log(rawData.event)
console.log(rawData.context)
}