All notable changes to this project will be documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- dropped node 14 and node 16 support
- dropped deprecated method
getServiceProxy
andgetDirectServiceProxy
, see the migration guide for further details.
- lc39: v8
- update axios to v1.6.7
- update axios to v1.6.0
- update @mia-platform/lc39 lib to v7.0.2 to fix the "fastify.close is not a function" error
- when returns stream, content-type
application/octet-stream
is not added by default anymore. So, you should add it on your own. See here for reference - upgrade lc39 to v7 and fastify to v4
- fix ts types
- merging of baseProperties with customProperties causing inconsistent microservices' env Variables schema
- add optional metrics on request duration. The metrics collection is enabled by mean of the variable
ENABLE_HTTP_CLIENT_METRICS
(default: false)
- fix the handle of env var required with a configured default
THIS VERSION CONTAINS A BREAKING CHANGES
This version contains a bug when it's configured a required env var with a default. The default is not handled before the default, so the service will not start.
- add property
duration
to the httpClient response
- issue-123: use if-then-else syntax at root level in json-schema of envs
- http client base options
- http client base options
- make
pino
a dependency
- fixed http client typings
- base url with path prefix
- httpsAgent in options
- upgrade lc39 to v6
- drop Node support <14
- add an http client method to replace deprecated
getServiceProxy
andgetDirectServiceProxy
(see all the features in the http client docs). Main breaking changes from the already existentgetServiceProxy
andgetDirectServiceProxy
:- streams respond with an object with headers, payload and statusCode. The payload has the stream interface
allowedStatusCodes
array of status codes is replaced by the functionvalidateStatus
(which accept by default 2xx)agent
to configure the proxy is renamed toproxy
and it is now an objectport
andprotocol
are now accepted only in url and baseUrl
- expose
getHeadersToProxy
function to calculate headers to proxy
- deprecate
getServiceProxy
andgetDirectServiceProxy
function. Please, substitute it with thegetHttpClient
function.
- fix Mia header propagation (resolved #161)
- upgrade dependencies
- Fixed typos and changed docs links inside
docs
directory - CVE-2022-0355
- Fixed error JSON.parse while passing both
returnAs:'BUFFER'
andallowedStatusCode:[204]
- Typings improvement
- Fixed PostDecoratorDecoratedRequest typing
- optional configuration object to customize ajv formats and vocabulary when defining the custom plugin function
- Change
addValidatorSchema
to add also schema usingfastify.addSchema
methods to correctly resolve swagger and serialization.
- It is now possible to use ajv instance to extend schema using
addValidatorSchema
. Use fastify addSchema feature is not supported because the validator compiler is overwritten. - Add new function
getValidatorSchema
to get schema added to the validator.
- @mia-platform/lc39 updated to v5
- OpenAPI 3 is now the default version. Read the official documentation for more
- Improved types definitions
- fix validation error message from other resource than body
- improve validation error message
-
ajv formats are no longer supported. Validation can now be achieved using a pattern field and specifying a regular expression.
This change is due to an incompatibility between fastify-env dependency env-schema and ajv formats. From ajv version 7.0.0 formats have been separated from the main package, requiring to be explicitly added. Visit ajv official documentation and env-schema official release page for further details regarding this topic.
-
Environment variables using default values cannot be required anymore (and viceversa).
Fastify-env dependency env-schema no longer support both required and default properties to be defined simultaneously. Please make sure your environment variables now respect this constraint. You can have further details regarding this issue here
- replaced expired test certificates with new ones that will expire on 3 September 3061
-
the
getDirectServiceProxy
function now can receive a complete url asserviceName
parameter -
update dependencies to fastify v3 and lc39 to v4.0.0
- update lc39 to 3.3.0
- added tls options in service proxies
- change charset from
utf8
toutf-8
- add
timeout
option to service builder to make requests - add
agent
option to service builder to make requests
- update lc39 to 3.1.4
- update lc39 to 3.1.3
- updated lc39 dependency to 3.1.2
- updated lc39 dependency to 3.1.1
-
Dropped support to Node 8
-
Update @mia-platform/lc39 2.2.2 -> 3.1.0.
This update bring this breaking change:
- Request and response logged information are now compliant with Mia-Platform logging guidelines. To see the guidelines, please check Mia Platform Docs. You can find the implementation details here
- Added
getUserProperties
to decoratedfastify.Request
, which returns the user properties
- Update ajv 6.10.2 -> 6.12.0
- Update fastify-plugin 1.6.0 -> 1.6.1
- Update simple-get 3.0.3 -> 3.1.0
- Add README
- advanced config in route
- Update @types/node 12.7.1 -> 12.7.4
- Moved URL construction from deprecated url.format to the new WHATWG API
- Update @mia-platform/lc39 2.2.0 -> 2.2.2
- Update @types/node 12.6.0 -> 12.7.1
- Update ajv 6.10.1 -> 6.10.2
- Update @mia-platform/lc39 2.1.2 -> 2.2.0
- Update @types/node 12.0.2 -> 12.6.0
- Update ajv 6.10.0 -> 6.10.1
- Update http-errors 1.7.2 -> 1.7.3
- Update fastify-env 0.6.2 -> 1.0.1
- Improved condition for hinding error messages to users to avoid false positives
### Added
- Add new flag for filtering mia header injection
- Add extra headers proxy during internal http calls
- Update repository to use lc39 and fastify 2
- Modify error message on status code validation failure
- Fix wrong dependencies in
package.json
file
- Fix wrong encapsulation from fastify for custom functions
- Update repository to use lc39 and fastify 2
- Modify error message on status code validation failure
- Add checks for
env
variables - Add response status code validation
- Add new way to create a service proxy
- Add support for proxy custom headers to the services pipeline
- Add support for proxy custom headers to other services
- Update fastify-cli 0.22.0 -> 0.24.0
- Add support for trusted proxies
- Update fastify 1.9.0 -> 1.12.1
- Update fastify-cli 0.19.0 -> 0.22.0
- Add more customization options for calling other services
Initial public release