- [FIXED] - regression of
1.6.0
which didn't considercharset
&boundary
directives while validating a request content-type header
- [FIXED] - regression of
1.6.0
release which would not expand content-type abbreviations likejson
&urlencoded
into valid media type thus requiring a request to definecontent-type
header with invalid (abbreviated) values
- [ADDED] -
Route.prototype.acceptsContentType
has been refactored so that it delegates validation ofcontent-type
header to internal route validation API instead of validating the data on its own - [FIXED] -
bi-service --help
cli command was failing to load shell commands from user-space as internalservice.$setup
procedure was being executed too early - [FIXED] - the logger was not given enough time for an error to be logged when a failure occurred while loading additional shell commands from user-space
- [FIXED] - built-in cli commands were ignoring the
--help/-h
switch
- [ADDED] -
ValidationError.API_CODE
static writable property (which defaults tovalidationFailure
) - setsapi_code
value for validation error http 400 response - [ADDED] - Ajv option
allErrors=true
is now supported. if enabled, validation response will include a collection of failures - [ADDED] -
bi-service test:config
command - [FIXED] - shell commands should print a short description of failure reason to stderr
- [ADDED] - http
Route
implementation supports a regular expression asurl
option value
- [ADDED] -
common/Route.prototype.acceptedContentTypes()
which returns a collection of supported request content mime types - [ADDED] - configurable
cluster
option ofbi-service run --cluster=<number>
where<number>
can be a percentage amount (from number of available cpu threads) of children to be forked in the case of floating point value, or explicit number of children when integer is provided - [FIXED] - make sure node process is properly aborted when service initialization fails. This was not the case when multiple
bluebird
packages were being used in one chain.
- [FIXED] -
moduleLoader.fileIterator
did not support explicit file paths alongside directory paths even though public API claimed it as supported - [FIXED] - custom
Ajv
keyword$toJSON
should support typeof string values which it should attempt to parse
- [ADDED] - new instance methods
has()
&remove()
of theResourceManager
- [ADDED] - new instance method
has()
of theRemoteServiceManager
- [ADDED] -
services.<name>
configuration section can now contain additionalBIServiceSDK
constructor options which the SDK will be instantiated with at the time ofremoteServiceManager.buildRemoteService()
call - [FIXED] -
service
static event ofService
constructor object should be emitted in the next event loop cycle to give plugins a chance to hook-up - [FIXED] -
Service.prototype.listen
waits till the next event loop tick to give bi-service plugins a chance to hook up
- [ADDED] - npm sdk packages do not have to expose strict data structure in order to be able to instantiate BIServiceSDK with the
RemoteServiceManager.prototype.buildRemoteService
method - [ADDED] -
name
instance public readonly property ofApp
- [FIXED] - updated dependencies: [email protected], [email protected]
- [FIXED] -
Route.prototype.validate
method should fail when we provide invalid arguments - [FIXED] - validation error messages include information about what data source validation has failed on (like query|body|headers etc..)
- [ADDED] - allow to set custom
Error
constructor forResponse
validation errors
- [FIXED] -
bi-service
executable - should not leak synchronous exceptions when executing a custom shell command. Those errors will be properly caught and printed to stderr before exit.
- [ADDED] - optional
context
object argument to theServiceError.prototype.buildFrom
method - [FIXED] -
Route
error handler.then()
clause has been creating "runaway" promise - [FIXED] - errors which are not instanceof
Error
are not supported. The case of eg.throw undefined
has not been properly handled.
- [FIXED] -
services.<service>.<app>.host
validation. IP addresses should be allowed
- [FIXED] -
Route
&Service
constructor
properties of parentprototype
objects were not referencing parent constructor function
- [CHANGED] - initialization procedure prior a shell command dispatching has been altered so that service resources are NOT inspected unless explicitly tagged with 'shell' label
- [ADDED] - support for optional custom application constructor argument in
Service.prototype.buildApp
- [ADDED] -
ResourceManager.prototype.tag
method which allows to tag resources and inspect a group of resources via the tag - [ADDED] - set project's
version
option onService
config object onService
instantiation - [CHANGED] - deprecate
App.prototype.useSession
method
- [FIXED] - errors were not being processed by express error handler middleware
- [FIXED] -
Service
projectroot
path should be determined fromprocess.cwd()
starting point by default
- [ADDED] -
App
config
is validated during the app initialization - [ADDED] - Default
App
&Router
&Route
classes which the module exports implements commonAppInterface
&RouterInterface
andRouteInterface
respectively - [ADDED] -
shell-cmd
event emitted onService
instance objects as well as onService
constructor (static event). Brings an interface for user defined commands.
- [ADDED] -
Route.prototype.step
is an alias ofRoute.prototype.addStep
- [FIXED] - generate documentation pages after successful travis ci build
- [FIXED] -
bi-service-sequelize-migrations
optional dependency has been renamed tobi-db-migrations
- [FIXED] -
Route.prototype.getUrl
output should be consistent (?
should not be appended if no query parameters are included) - [FIXED] -
res.setPaginationHeaders
should interpretlimit=0
option as unlimited limit
- [FIXED] - make sure req.body is always an object
- [FIXED] - throw an Error if a validator can not be found with the provided key to
Route.prototype.validate
- [ADDED] - custom ajv validator keyword
$toJSON
- [ADDED] -
res.setPaginationHeaders
method - [FIXED] - set req.body to an empty object if req body parser did not set the property
- [FIXED] -
requestContentType
parser should not require the parser function to be set, if no parser function is found, skip and continue request execution
- [FIXED] - Important!
Route
uids were being incorrectly constructed when an App run under a basePath in addition to a hostname
- [FIXED] - set executable flag on bin/bi-service.js
- [FIXED] - defer emitting of the
app
event on the bi-service static module once the app is initialized - [ADDED] - cli interface of
bi-service-sequelize-migrations
is loaded if installed
- [ADDED] -
Route.prototype.acceptsContentType
method - [ADDED] -
Route.prototype.rejectsContentType
method - [FIXED] - backports [email protected] fixes
- [FIXED] - validator middleware failed to compile ajv validator schema due to Ajv library misuse
- [FIXED] -
ResourceManager.prototype.inspectIntegrity
should not swallow Errors about failed assertions - [ADDED] -
Route.prototype.validate
will set expected root data type to 'object' if not set already
- [ADDED] -
bi-service
cli executable - [ADDED] -
ajv
validator support (replacement forbi-json-inspector
) - [REMOVED] -
bi-json-inspector
support - [REMOVED] -
couchbase
integration modules (use bi-service-couchbase plugin) - [REMOVED] -
loadORMmodels
method ofmoduleLoader
has been removed - equivalent functionality is provided bybi-service-sequelize
- [REMOVED] -
loadODMmodels
method ofmoduleLoader
usemoduleLoader.fileIterator
instead
- [FIXED] -
App
initialization procedure. Make surepost-init
event is emitted after the event listener is registered
- [ADDED] - adds request http method type: 'all' as a special type which binds the route to all http methods
- [CHANGED] - Allow to set
apiCode
option ofRequestError
even when code != 400 - [CHANGED] - Allow to set
apiCode
option ofUnauthorizedError
- [FIXED] - request UID should be generated before any other middleware is executed
- [FIXED] -
bi-service
module exported incorrect error constructor (ServiceError) undererror.ValidationError
instead of the actualValidationError
- [ADDED] -
AppManager.prototype.get
method - [FIXED] - make sure that an
App
can write to itsConfig
- [CHANGED] -
Service.prototype.start
method has been renamed tolisten
- [CHANGED] - use
bi-config
public interface toset
values in config store - [CHANGED] -
sequelize
support has been extracted to its ownbi-service-sequelize
package - [REMOVED] - fixed (locked) loading of
lib/validation/{name}AppDefinitions
module when no validations were received - [REMOVED] - fixed (locked) loading of
lib/app.js
module which may or may not be present. Responsibility of loading all application files is delegated to the user. - [ADDED] - Service#listening event - emitted once when all service apps are ready to receive connections
- [ADDED] - service configuration inspection before startup
- [ADDED] -
Service.prototype.close
aka. shutdown all service apps - [ADDED] -
App.prototype.close
aka. shutdown http server
- [FIXED] -
requestContentType
middleware should not fail when noContent-Type
header is received on GET request
- [FIXED] - service
set-up
events should be emitted before a file with app definitions is fetched - [ADDED] -
apps:$name:request:timeout
config option - [ADDED] -
port
option todatabase/sequelize
builder function - [ADDED] - req
Content-Type
validation - [REMOVED] - default (
ejs
)view engine
express option is not set
- [FIXED] -
ServiceError.prototype.toLogger
didnt return json object (always returned undefined)
- [REMOVED] -
App.prototype.clone
method - [REMOVED] -
App.prototype.useSDK
method - [REMOVED] -
App.prototype.useCouchbase
method - [REMOVED] -
App.prototype.useSequelize
method - [REMOVED] -
App.prototype.useCacheStore
method - [REMOVED] - bin/www module
- [ADDED] - a
ServiceError
is provided with route uid of a route which is called upon a request - [ADDED] -
Sequelize.prototype.inspectIntegrity
method - [ADDED] -
CouchbaseCluster.prototype.inspectIntegrity
method - [ADDED] -
Service
class - [ADDED] -
RemoteServiceManager
class - [ADDED] -
ResourceManager
class
- [FIXED] - bumped
[email protected]
which fixes security bug related to untrusted validation data source
- [FIXED] -
Route.prototype.getUrl
- express-like regex matching part of url segment should be stripped (/path/:id(\d+)
=>/path/:id
) - [FIXED] -
Route.prototype.getUrl
- incorrect url path segment substitution
- [REMOVED] -
Route.prototype.restrictByClient
- extracted to stand-alone packagebi-service-oauth-client
- [REMOVED] -
Route.prototype.restrictClientOrigin
- extracted to stand-alone packagebi-service-oauth-client
- [REMOVED] -
Route.prototype.restrictClientRedirect
- extracted to stand-alone packagebi-service-oauth-client
- [FIXED] - logging of sequelize sql queries was forced to be turned on
- [ADDED] -
App.prototype.getHost
- return$protocol+$host
url - [ADDED] -
Route.prototype.getAbsoluteUrl
- [FIXED] - export
ForbiddenError
from the module
- [FIXED] - fix hardcoded
postgres
dialect when checking integrity of sequelize (added support formysql
&mariadb
dialects)
- [CHANGED] -
clientMiddleware
requiresprivateDepot
SDK to be connected to an app - [ADDED] -
App.prototype.useCacheStore
method - [ADDED] - a service startup should fail when an app is in ERROR state after it's been initialized and is about to start listening on a port
- [ADDED] -
Route.prototype.getUrl
method - [ADDED] -
App.prototype.getRoute
method - [ADDED] -
getUrl
function for templates
- [FIXED] -
clientMiddleware
should search forclient-id
&client-secret
headers instead ofclient_id
&client_secret
- [ADDED] -
App.prototype.useSDK
method which integrates withservices
appconfig
section - [ADDED] -
Route
constructor takes new optionalsdkMethodName
option - [REMOVED] -
connect-flash
peer dependency. The module was being explicitly loaded during session initializationRoute.prototype.useSession
- [FIXED] - implementation of handling the
baseUrl
config value. Routers are now aware of the root base path value. This way we don't break API for modules which depend on it. - [ADDED] - http json response fallback when request fails and the custom
error-response
event listener is registered - [REMOVED] - startup availability check of dependent web services
- [ADDED] -
moduleLoader.loadModules
accepts optionalcb
function option which will be called and provided with each required module - [ADDED] -
serviceIntegrity.inspect
method accepts optionalinspectors
option
- [FIXED] -
baseUrl
path string was being parsed incorrectly which led to routers being bound to incorrect endpoint - [FIXED] -
connect-flash
package was being incorrectly initialized whenRoute.prototype.useSession
is called this led to a request hangup
- [FIXED] -
res.filter(data)
- should ensure nativeValidationError
ofjson-ispector
package is thrown when validation/filtering fails - [ADDED] - support
baseUrl
App config option value that contains path string eg.: '127.0.0.1/root/app/path'
- [FIXED] - client middleware - invalid api code key was being accessed when an error occured
- [FIXED] an
Error
is thrown when aRouter
is trying to register aRoute
with non-unique routeuid
.uid
should be unique in context of anApp
- [FIXED] an
Error
is thrown when a App defines non-uniquename
option - [FIXED] each
App
presents itself independently to thebi-depot
- this prevents service scope collision
- [FIXED]
restrictByClient
looks forbi-depot
settings underservices.privateDepot
key instead ofservices.private-depot
- [CHANGED] renamed
Route.prototype.restrictByOrigin
method torestrictClientOrigin
- [CHANGED] don't include
success=false
property in unsuccessful response (RequestError
) - [CHANGED]
epxress-session
module is not explicitly required anymore and has been setup as a peer dependency - [CHANGED] underlying format of route's response descriptors - route.description.responses[code] is an
array
instead ofobject
- [ADDED]
bi-api-errors
dependency - [ADDED]
AppManager.prototype.buildApp
emits abuild-app
event with a new App - [ADDED]
App.prototype.buildRouter
emits abuild-router
event with a new Router - [ADDED] new App
error-response
event which when registered, defers response of globally handled errors to an user defined logic. - [ADDED] automatically describe possible error response codes of "native" middlewares with the
Route.prototype.respondsWith
method - [ADDED]
Route.prototype.restrictClientRedirect
method - [ADDED]
serviceIntegrity
inspects that an app can connect to its dependent web services - [ADDED] support multiple calls to the
route.respondsWith
method with same type ofError
object (Error objects which all resolve to same response code). The errors are stacked and not overwritten - as it is for success response schema provided to the method. - [REMOVED]
Route.prototype.restrictByIp
method - [REMOVED]
restrictRedirect
option of therestrictByClient
method in favor ofRoute.prototype.restrictClientRedirect
method - [REMOVED] the module no longer exports optionally dependent
Couchbase
&CouchbaseODM
dependencies userequire('couchbase')
instead - [FIXED] request identifier should be set to an Error object before the err is logged
- [FIXED]
res.filter(data)
should not fail when we defined a response schema as reference to registered validator (route.respondsWith('#valName')
) - [FIXED]
json-inspector
required
option should be set tofalse
for response data filtering due to consistency among all schema definitions - [FIXED]
res.filter(data)
should not throw aTypeError
when we providenull
data
- [FIXED]
res.filter(data)
should convert the data object to json via data.toJSON if we provide non-plain data object - [FIXED]
Route.prototype.respondsWith
should accept json-inspector schema definition in form of a function - [FIXED] use
[email protected]
- fixes the issue with broken lodash compatibility in a patch version - [FIXED] failure of
serviceIntegrity.inspect
- tried require couchbase bindings even in the case when app doesn't use couchbase - [FIXED] export all custom Errors out of the module
- [FIXED]
staticData.loader
semantic error with variable declaration order
- [CHANGED] explicit
bi-service-cli
&bi-service-doc
(renamedbi-cli
&bi-docs
) dependencies has been removed. Individual projects should require the modules as a plugin. - [ADDED] emitter interface for the common initialization procedure of
bin/www
script
- [FIXED] explicit couchbase bindings should be required only when needed
- [FIXED] when we don't provide an
App
with odmClient
model, therouter.buildRoute
method should not fail because of that. #5
- [FIXED] invalid module required in underlying
bi-docs
module. - this fix allows patched versions to be installed
- [ADDED] automatic documentation server generation
- [ADDED]
Route
constructorsummary
&description
options for documentation purposes - [CHANGED] behavior of the
Route.prototype.respondsWith
behavior. The methods accepts singledescriptor
argument which can be eitherjson-inspector
schema orError
constructor & instance
- [FIXED] wrapped
res
object provided to route middlewares broke express res methods as they were being called with incorrect context
- [CHANGED] use private npm module
bi-json-inspector
instead of globaljson-inspector
- [ADDED] common bi-service app initialization procedure as
bi-service/bin/www
script - [ADDED]
Route.prototype.respondsWith
method - allows to describe data the route responds with - [ADDED]
res.filter
method, which filters provided data and returns custom response object which works only with the filtered data - [ADDED]
res
object provided to a route middlewares is simple wrapper object around the original expressres
object. That allows us implement additional methods, like theres.filter
method - [ADDED]
serviceIntegrity
debug points - [ADDED] CLI - new
inspect route
command - [ADDED] explicitly list
chalk
module as dependency (we have been already using it in bi-vantage) - [ADDED]
bi-json-stringifier
module dependency - [REMOVED]
route.stepsDict
hash table as it was unnecessary & unused
- [FIXED]
serviceIntegrity.inspectCouchbase
- if a bucket is not connected already, wait onconnect
orerror
event before the test get request is made - [FIXED] don't print warning to stdout when
SEQEULIZE_DEBUG
isundefined
- [FIXED]
moduleLoader
- don't load unsupported files... load only files with an extension fromrequire.extensions
- [FIXED]
staticData.loadSync
- convert stdout, stderr Buffers to strings (incorrect condition caused the buffers to NOT be converted) - [FIXED]
staticData.loader
- particular db settings is taken fromstorage.postgres.databases.staticData
config path - [FIXED]
clientMiddleware
- therestrictScope
&restrictRedirect
options were ignored + added tests for the middleware (tests requires >[email protected]) - [FIXED] fulfillment value (eg.: Response object) of the last route middleware was never being processed
- [FIXED] updated
kouchbase-odm
allowing versions greater than2.0.0-rc.1
- [FIXED] CLI -
ls -a
cmd should not crash when one of app servers is not running - [FIXED] database/sequelize.js - don't crash an app when invalid
SEQUELIZE_DEBUG
option is set. Log warning instead. - [FIXED]
sequelizeBuilder
don't ignore customlogging
(function) option
- [ADDED] common cli initialization procedure via new static
CLI.init
method - [ADDED] CLI - ls -r (aka. list routes) add additional column listing applied route's middlewares
- [ADDED] react on route middleware's fulfillment value. Allows to stop processing a request and respond to the request earlier.
- [FIXED] CLI -
vantage
remote authentication issues (authentication was made to work but has been disabled for now) - [FIXED] min.
bi-config
version dumped to0.7.1
- the version searches for config file name 'config.json5' by default - [FIXED]
staticData.loader
- takes db config fromstorage:postgres
config path instead ofstorage:sequelize
- [FIXED] CLI - support data logging to a remote cli console
- [FIXED] frozen CLI when we execute
integrity
cli command if no app is connected - [FIXED]
req
&res
objects memory leak. Incorrectreq
&res
objects were being provided to aRoute.prototype.catch
error handler function
- [FIXED] min required
pg
module version (if installed as peer dependency) - [ADDED] Route.prototype.catch method - reflects bluebirds Promise.catch method signature
- [ADDED] most of the
Route
methods were made chainable (main
,validate
,restrictByClient
,restrictByIp
,restrictByOrigin
,addStep
,catch
) - [ADDED] CLI
sort
&& filter options to thels
command - [FIXED] CLI error handling of synchronously thrown errors (without this fix, an app would crash with exit code != 0) on error
- [FIXED] Sequelize penetrator - don't load (require)
cache
module unless we want to penetrate cache support into a sequelize instance
- [CHANGED]
kouchbase-odm
,bi-config
,pg
,pg-hstore
,couchbase
,cookie-parser
,connect-flash
,memcached
,connect-memcached
modules are peer dependencies now - install what you need