Skip to content

Releases: Albert-Gao/micro-aws-lambda

v5.5.0

Choose a tag to compare

@Albert-Gao Albert-Gao released this 01 Jun 14:32

What's Changed

New Contributors

Full Changelog: v5.3.3...v5.5.0

v5.3.3

Choose a tag to compare

@Albert-Gao Albert-Gao released this 30 Jun 08:42

feat: console.log error to provide error info in CloudWatch

v5.3.2

Choose a tag to compare

@Albert-Gao Albert-Gao released this 26 Jun 03:37
  • Now JS error will be returned as 500 response

v5.2.2

Choose a tag to compare

@Albert-Gao Albert-Gao released this 13 Jun 03:37

fix: now log config will not throw on HTTP API
tweak: minor tweaked internal implementation

v5.2.0

Choose a tag to compare

@Albert-Gao Albert-Gao released this 10 Jun 22:54
  • Added:
    • HttpResponse.error()
    • HttpResponse.badRequest()
    • HttpResponse.unauthorized()
    • HttpResponse.forbidden()
    • HttpResponse.notFound()
    • HttpResponse.methodNotAllowed()
    • HttpResponse.notAcceptable()
    • HttpResponse.conflict()
    • HttpResponse.internalError()
    • HttpResponse.notImplemented()
    • HttpResponse.badGateway()
    • HttpResponse.serviceUnavailable()
    • HttpResponse.gatewayTimeout()
    • HttpResponse.networkAuthenticationRequire()
  • Removed:
    • success is not directly exported now, please use HttpResponse. success
    • badRequest is not directly exported now, please use HttpResponse. badRequest
    • httpError is not directly exported now, please use HttpResponse.error
    • internalError is not directly exported now, please use HttpResponse. internalError

v5.1.5

Choose a tag to compare

@Albert-Gao Albert-Gao released this 07 Jun 12:25
  • feat: added unauthorized() and notFound()
  • Either HttpResponse.unauthorized() or import unauthorized directly

v5.1.2

Choose a tag to compare

@Albert-Gao Albert-Gao released this 07 Jun 11:17
  • feat: make success(), badRequest() and interError() more easier to call

now you can just success({name: 'albert'}), a HTTP 200 with HTTP body {name:'albert'} will be returned
If you want to change the statusCode and headers, you can add an 2nd parameter when invoking like:
success({name:'albert'}, {statusCode: 201, headers: { hidden: 1 }})

v5.1.0

Choose a tag to compare

@Albert-Gao Albert-Gao released this 07 Jun 06:34
  • Swapped the Shared and Response in the Middleware type, so if you do not want to type check Response, no need to pass any
  • Updated the Middleware to APIGatewayProxyHandlerV2 from @types/aws-lambda, If you are using the Lambda Proxy mode, please import MiddlewareLegacy, otherwise,

v5.0.1

Choose a tag to compare

@Albert-Gao Albert-Gao released this 06 Jun 13:20

fixed: Typescript error
tweaked: HttpResponse.httpError is now HttpResponse.error
doc: updated Readme.md

BREAKING CHANGE

Choose a tag to compare

@Albert-Gao Albert-Gao released this 06 Jun 09:40
  • passDownObj has renamed to shared
  • return in a middleware STOPS the execution now, like throw, makes the flow easier to reason about!
  • all http helpers can be used under HttpResponse, just import this one alone