Skip to content

Tags: swift-server/swift-aws-lambda-events

Tags

1.0.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add an encodable version of the APIGatewayResponse (#86)

Add a convenience initializer to the APIGatewayResponse v2 that accepts
an Encodable object

### Motivation:

Most Lambda developers will return a JSON object when exposing their
function through the API Gateway. The current initializer only accepts a
`String` body as per the AWS message definition.

This obliges all developers to write two lines of code + error handling
to encode their object and transform the `Data` to a string.

### Modifications:

Add a new initializer that accepts a `body` as `Encodable`

```swift
public init<Input: Encodable> (
        statusCode: HTTPResponse.Status,
        headers: HTTPHeaders? = nil,
        body: Input,
        isBase64Encoded: Bool? = nil,
        cookies: [String]? = nil
) throws { ... }
```

### Result:

Developers can now pass a Swift struct to the APIGatewayResponse.

```swift
let businessResponse = BusinessResponse(message: "Hello World", code: 200)
return APIGatewayV2Response(statusCode: .ok, body: businessResponse)
```

0.5.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add EventBridge S3Events notifications (#70)

0.4.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Cognito Triggers - PreSignUp, PostConfirmation, PostAuthentication, C…

…ustomMessage (#57)

* More Cognito events

- PostConfirmation
- PostAuthentication
- CustomMessage

0.3.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Use Swift HTTP types package for status and method (#47)

* Use Swift HTTP types package for status and method

* Fix formatting

0.2.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add support for AWS Lambda Authorizers (#42)

Add support for lambda authorizers

0.1.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Added the new AWS regions availables (#30)