Skip to content

Releases: jeremydaly/lambda-api

v1.4.0

06 Jun 15:05
6993f0c

Choose a tag to compare

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/Response typing for routesMiddleware, ErrorHandlingMiddleware, and HandlerFunction now accept <TRequest, TResponse> generics, and every route method (get, post, put, patch, delete, options, head, any, METHOD) plus use carries them through to your handlers. Response<TBody> enforces the response payload shape on send, json, and jsonp. Fully backward compatible — generics default to today's Request/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 from for-in to for-of, so enumerable Array.prototype methods added by third-party libraries can no longer leak into the args scan and trigger a spurious ConfigurationError: Middleware must have 3 or 4 parameters. (#321)

🐛 Bug Fixes

  • Middleware inheritance for base-pathed root (/) routes — when an API is configured with a base path, 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_dispatch trigger allows publishing a specific version on demand. (#318)

Full Changelog: v1.3.0...v1.4.0

v1.3.0

01 Jun 18:04
3d4ea7a

Choose a tag to compare

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

05 Apr 17:32
76dc359

Choose a tag to compare

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

06 Feb 16:49
ff4f496

Choose a tag to compare

What's Changed

Full Changelog: v1.1.1...v1.1.2

v1.1.1

05 Feb 19:46
1f9c70c

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.1.0...v1.1.1

v1.1.0

10 Jun 19:17
b2eb0a2

Choose a tag to compare

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

Full Changelog: v1.0.3...v1.1.0

v1.0.3

11 Jul 21:24
ba18dcd

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.2...v1.0.3

v1.0.2

03 Jun 14:23
4ed0676

Choose a tag to compare

What's Changed

  • fix(s3-service/getObject): resolve wrong output type received in #236
  • fix(type-defs): resolve middleware missing in route methods in #238

Full Changelog: v1.0.1...v1.0.2

v1.0.1

12 Mar 23:56
09f195d

Choose a tag to compare

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

Full Changelog: v1.0.0...v1.0.1

v1.0.0

09 Mar 15:24
98912bb

Choose a tag to compare

What's Changed

Full Changelog: v0.12.0...v1.0.0