Releases: jeremydaly/lambda-api
v1.4.0
Highlights
Route-level generic request & response typing is the headline of this release: route handlers can now opt into strongly typed inputs and outputs that are enforced at compile time — with zero changes required to existing code.
✨ Features
-
Generic
Request/Responsetyping for routes —Middleware,ErrorHandlingMiddleware, andHandlerFunctionnow accept<TRequest, TResponse>generics, and every route method (get,post,put,patch,delete,options,head,any,METHOD) plususecarries them through to your handlers.Response<TBody>enforces the response payload shape onsend,json, andjsonp. Fully backward compatible — generics default to today'sRequest/Response. (#320)interface TypedRequest extends Request { params: { thingId: string }; } api.get<TypedRequest, Response<{ hello: string }>>('/typed', (req, res) => { res.json({ hello: req.params.thingId }); // payload shape checked at compile time });
🔒 Security
- Prototype pollution hardening in
use()— middleware argument iteration moved fromfor-intofor-of, so enumerableArray.prototypemethods added by third-party libraries can no longer leak into the args scan and trigger a spuriousConfigurationError: Middleware must have 3 or 4 parameters. (#321)
🐛 Bug Fixes
- Middleware inheritance for base-pathed root (
/) routes — when an API is configured with abasepath, handlers registered on/now correctly inherit wildcard middleware, making/base-path/behave consistently with its non-root siblings. (#319)
🔧 CI / Internal
- npm release workflow — the published version is now stamped at publish time from the release tag, and a manual
workflow_dispatchtrigger allows publishing a specific version on demand. (#318)
Full Changelog: v1.3.0...v1.4.0
v1.3.0
What's Changed
- fix(deps): mark S3 SDK peer deps as optional and raise floor by @naorpeled in #316
Full Changelog: v1.2.0...v1.3.0
v1.2.0
What's Changed
- test: cover index.d.ts with tests by @naorpeled in #283
- fix(error-handling-middleware): handle string error as ApiError by @naorpeled in #287
Full Changelog: v1.1.2...v1.2.0
v1.1.2
v1.1.1
What's Changed
- Correct type of multiValueHeaders by @jrgermain in #273
- Add TypeScript support for ALB related types by @vandrade-git in #276
New Contributors
- @jrgermain made their first contribution in #273
- @vandrade-git made their first contribution in #276
Full Changelog: v1.1.0...v1.1.1
v1.1.0
What's Changed
- (feat): Lazy load S3 client by @perpil in #255
- feat(Request/types): add multiValueHeaders type definition @guirisnik in #264
- feat(Response): add setHeader as header fn alias by @naorpeled in #265
- fix: invalid cookie parsing for the "=" character by @qgolsteyn in #271
New Contributors
- @guirisnik made their first contribution in #264
- @qgolsteyn made their first contribution in #271
Full Changelog: v1.0.3...v1.1.0
v1.0.3
What's Changed
- feat(s3-service): add custom config option by @chrisowebb in #240
New Contributors
- @chrisowebb made their first contribution in #240
Full Changelog: v1.0.2...v1.0.3
v1.0.2
v1.0.1
What's Changed
- Fixed typo in README.md by @muzucode in #230
- AWS SDK v3 packages are now peerDependencies and not devDependencies by @oieduardorabelo in #231
New Contributors
- @muzucode made their first contribution in #230
- @oieduardorabelo made their first contribution in #231
Full Changelog: v1.0.0...v1.0.1
v1.0.0
What's Changed
- feat(s3-service)!: move to AWS-SDK v3 by @AndrewBarba in #216
Full Changelog: v0.12.0...v1.0.0