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
fix: remove handler callback argument #1165
Conversation
Middy does not support callback handlers since 1.x, the third argument is actually the timeout signal.
Thanks for the PR! |
[![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/tree/HEAD/packages/core)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fcore/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fcore/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fcore/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fcore/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fcore/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/error-logger](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/error-logger)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2ferror-logger/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2ferror-logger/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2ferror-logger/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2ferror-logger/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2ferror-logger/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-content-negotiation](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-content-negotiation)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-content-negotiation/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-content-negotiation/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-content-negotiation/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-content-negotiation/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-content-negotiation/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-error-handler](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-error-handler)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-error-handler/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-error-handler/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-error-handler/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-error-handler/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-error-handler/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-header-normalizer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-header-normalizer)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-header-normalizer/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-header-normalizer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-header-normalizer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-header-normalizer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-header-normalizer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-json-body-parser](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-json-body-parser)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-json-body-parser/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-json-body-parser/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-json-body-parser/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-json-body-parser/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-json-body-parser/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-response-serializer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-response-serializer)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-response-serializer/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-response-serializer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-response-serializer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-response-serializer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-response-serializer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/validator](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/validator)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fvalidator/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fvalidator/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fvalidator/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fvalidator/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fvalidator/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>middyjs/middy (@​middy/core)</summary> ### [`v5.2.4`](https://togithub.com/middyjs/middy/releases/tag/5.2.4) [Compare Source](https://togithub.com/middyjs/middy/compare/5.2.3...5.2.4) #### What's Changed - Adds NHS FHIR Middy Error Handler to third-party.md by [@​JackSpagnoliNHS](https://togithub.com/JackSpagnoliNHS) in [middyjs/middy#1162 - fix: remove handler callback argument by [@​everett1992](https://togithub.com/everett1992) in [middyjs/middy#1165 - Moves NHS FHIR middleware to version 2-4 by [@​JackSpagnoliNHS](https://togithub.com/JackSpagnoliNHS) in [middyjs/middy#1166 - fix(website): broken links in the getting started section by [@​lmammino](https://togithub.com/lmammino) in [middyjs/middy#1169 - Set explicit import type by [@​willfarrell](https://togithub.com/willfarrell) in [middyjs/middy#1170 #### New Contributors - [@​JackSpagnoliNHS](https://togithub.com/JackSpagnoliNHS) made their first contribution in [middyjs/middy#1162 - [@​everett1992](https://togithub.com/everett1992) made their first contribution in [middyjs/middy#1165 **Full Changelog**: middyjs/middy@5.2.3...5.2.4 </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).
[![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/tree/HEAD/packages/core)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fcore/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fcore/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fcore/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fcore/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fcore/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/error-logger](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/error-logger)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2ferror-logger/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2ferror-logger/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2ferror-logger/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2ferror-logger/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2ferror-logger/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-error-handler](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-error-handler)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-error-handler/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-error-handler/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-error-handler/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-error-handler/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-error-handler/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-header-normalizer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-header-normalizer)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-header-normalizer/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-header-normalizer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-header-normalizer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-header-normalizer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-header-normalizer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@middy/http-response-serializer](https://middy.js.org) ([source](https://togithub.com/middyjs/middy/tree/HEAD/packages/http-response-serializer)) | [`5.2.3` -> `5.2.4`](https://renovatebot.com/diffs/npm/@middy%2fhttp-response-serializer/5.2.3/5.2.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@middy%2fhttp-response-serializer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@middy%2fhttp-response-serializer/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@middy%2fhttp-response-serializer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@middy%2fhttp-response-serializer/5.2.3/5.2.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>middyjs/middy (@​middy/core)</summary> ### [`v5.2.4`](https://togithub.com/middyjs/middy/releases/tag/5.2.4) [Compare Source](https://togithub.com/middyjs/middy/compare/5.2.3...5.2.4) #### What's Changed - Adds NHS FHIR Middy Error Handler to third-party.md by [@​JackSpagnoliNHS](https://togithub.com/JackSpagnoliNHS) in [middyjs/middy#1162 - fix: remove handler callback argument by [@​everett1992](https://togithub.com/everett1992) in [middyjs/middy#1165 - Moves NHS FHIR middleware to version 2-4 by [@​JackSpagnoliNHS](https://togithub.com/JackSpagnoliNHS) in [middyjs/middy#1166 - fix(website): broken links in the getting started section by [@​lmammino](https://togithub.com/lmammino) in [middyjs/middy#1169 - Set explicit import type by [@​willfarrell](https://togithub.com/willfarrell) in [middyjs/middy#1170 #### New Contributors - [@​JackSpagnoliNHS](https://togithub.com/JackSpagnoliNHS) made their first contribution in [middyjs/middy#1162 - [@​everett1992](https://togithub.com/everett1992) made their first contribution in [middyjs/middy#1165 **Full Changelog**: middyjs/middy@5.2.3...5.2.4 </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).
@willfarrell this commit breaks the typing. It's not possible to seamlessly use middy with Lambda handlers as the Lambda handler is expecting the third argument to be of type We're currently using The only solution I know of now is to unwrap the function and adjust the provided arguments as shown below, which might be considered a bit unrefined: export const handler = middy<APIGatewayProxyEvent>((event, context) => {
return lambdaHandler(event, context, () => undefined);
}); |
Middy does not support callback handlers since 1.x, the third argument is actually the timeout signal.
Fixes #1164