Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes TypeScript definition for http-router #1072

Conversation

AntonioAngelino
Copy link
Contributor

@AntonioAngelino AntonioAngelino commented Jun 30, 2023

This PR allows the writing of handlers that use APIGatewayProxyEventV2 / APIGatewayProxyResultV2 like the following one:

async function postHandler(event: APIGatewayProxyEventV2, context: any): Promise<APIGatewayProxyResultV2> {
  return {
    statusCode: 200,
    body: JSON.stringify({ message: 'POST event submitted successfully', post: event.body }),
  }
}

I've also added a dedicated TS def test.

@willfarrell
Copy link
Member

Awesome, thanks!

@willfarrell willfarrell merged commit bf5c4ce into middyjs:main Jun 30, 2023
7 checks passed
@AntonioAngelino AntonioAngelino deleted the antonioangelino-middy-fix-ts-router-interface branch June 30, 2023 19:02
mergify bot pushed a commit to SvenKirschbaum/aws-utils that referenced this pull request Jul 2, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@middy/core](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fcore/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/error-logger](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2ferror-logger/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-error-handler](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-error-handler/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-header-normalizer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-header-normalizer/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-response-serializer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-response-serializer/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>middyjs/middy (@&#8203;middy/core)</summary>

### [`v4.5.3`](https://togithub.com/middyjs/middy/releases/tag/4.5.3)

[Compare Source](https://togithub.com/middyjs/middy/compare/4.5.2...4.5.3)

#### What's Changed

-   docs: add content to powertools for aws page by [@&#8203;dreamorosi](https://togithub.com/dreamorosi) in [middyjs/middy#1067
-   docs: Fixes doc list typo by [@&#8203;JackSpagnoli](https://togithub.com/JackSpagnoli) in [middyjs/middy#1068
-   Fix readme for s3 middleware by [@&#8203;kevcube](https://togithub.com/kevcube) in [middyjs/middy#1070
-   Fixes TypeScript definition for http-router by [@&#8203;AntonioAngelino](https://togithub.com/AntonioAngelino) in [middyjs/middy#1072

#### New Contributors

-   [@&#8203;dreamorosi](https://togithub.com/dreamorosi) made their first contribution in [middyjs/middy#1067
-   [@&#8203;JackSpagnoli](https://togithub.com/JackSpagnoli) made their first contribution in [middyjs/middy#1068
-   [@&#8203;kevcube](https://togithub.com/kevcube) made their first contribution in [middyjs/middy#1070
-   [@&#8203;AntonioAngelino](https://togithub.com/AntonioAngelino) made their first contribution in [middyjs/middy#1072

**Full Changelog**: middyjs/middy@4.5.2...4.5.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on sunday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/SvenKirschbaum/aws-utils).
mergify bot pushed a commit to SvenKirschbaum/share.kirschbaum.cloud that referenced this pull request Jul 2, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@middy/core](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fcore/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fcore/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/error-logger](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2ferror-logger/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2ferror-logger/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-content-negotiation](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-content-negotiation/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-content-negotiation/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-content-negotiation/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-content-negotiation/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-content-negotiation/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-error-handler](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-error-handler/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-error-handler/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-header-normalizer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-header-normalizer/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-header-normalizer/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-json-body-parser](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-json-body-parser/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-json-body-parser/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-json-body-parser/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-json-body-parser/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-json-body-parser/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/http-response-serializer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fhttp-response-serializer/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fhttp-response-serializer/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |
| [@middy/validator](https://middy.js.org) ([source](https://togithub.com/middyjs/middy)) | [`4.5.2` -> `4.5.3`](https://renovatebot.com/diffs/npm/@middy%2fvalidator/4.5.2/4.5.3) | [![age](https://badges.renovateapi.com/packages/npm/@middy%2fvalidator/4.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@middy%2fvalidator/4.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@middy%2fvalidator/4.5.3/compatibility-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@middy%2fvalidator/4.5.3/confidence-slim/4.5.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>middyjs/middy (@&#8203;middy/core)</summary>

### [`v4.5.3`](https://togithub.com/middyjs/middy/releases/tag/4.5.3)

[Compare Source](https://togithub.com/middyjs/middy/compare/4.5.2...4.5.3)

##### What's Changed

-   docs: add content to powertools for aws page by [@&#8203;dreamorosi](https://togithub.com/dreamorosi) in [middyjs/middy#1067
-   docs: Fixes doc list typo by [@&#8203;JackSpagnoli](https://togithub.com/JackSpagnoli) in [middyjs/middy#1068
-   Fix readme for s3 middleware by [@&#8203;kevcube](https://togithub.com/kevcube) in [middyjs/middy#1070
-   Fixes TypeScript definition for http-router by [@&#8203;AntonioAngelino](https://togithub.com/AntonioAngelino) in [middyjs/middy#1072

##### New Contributors

-   [@&#8203;dreamorosi](https://togithub.com/dreamorosi) made their first contribution in [middyjs/middy#1067
-   [@&#8203;JackSpagnoli](https://togithub.com/JackSpagnoli) made their first contribution in [middyjs/middy#1068
-   [@&#8203;kevcube](https://togithub.com/kevcube) made their first contribution in [middyjs/middy#1070
-   [@&#8203;AntonioAngelino](https://togithub.com/AntonioAngelino) made their first contribution in [middyjs/middy#1072

**Full Changelog**: middyjs/middy@4.5.2...4.5.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on sunday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/SvenKirschbaum/share.kirschbaum.cloud).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants