- add
server:created
event - add
getTests()
to IControllersResult interface
- add
noAutoEnd
to IControllerRouteOptions
- can define custom settings to setup IDs for Swagger operations
- add
parameterFormat
to IControllersOptions and IControllerRouteOptions interfaces npm update
s
- BREAKING CHANGE: module requires at least Node 18+ now
- add
deprecated
property to IControllerRouteOptions interface - add
noJSON
andnoYAML
to IControllersSwaggerOptions interface npm update
s, Swagger UI 5+- (bug-)fixes
- revert to version
0.61.x
npm update
s
- add ESM and CommonJS support
npm update
s- (bug-)fixes
- add
noAutoUpdate
to IValidateAjvOptions interface
- can export afterEach and beforeEach function in
.spec
files now - add
after
andbefore
props to ITestSettings interface - code cleanups and improvements
- (bug-)fixes
- BREAKING CHANGE: tests are sorted now the following way:
- by
sortBy
value of @Describe() decorator - then: by
name
argument of @Describe() decorator (case-insensitive) - then: by
sortBy
value of ITestSettings interface - then: by unescaped route path (case-insensitive)
- then: by HTTP method (case-insensitive)
- then: by
name
argument of @It() decorator (case-insensitive)
- by
- (bug-)fixes
- BREAKING CHANGE: props of IAfterAllTestsContext, IAfterEachTestContext, IBeforeAllTestsContext and IBeforeEachTestContext interfaces are marked as
readonly
now - add
session
prop to IAfterAllTestsContext, IAfterEachTestContext, IBeforeAllTestsContext, IBeforeEachTestContext and ITestEventHandlerContext interfaces
- BREAKING CHANGE: running tests will now execute
process.exit(1)
by default now on error - IHttpServer.test() method will now return a result value now
- BREAKING CHANGE: running tests will now execute
process.exit(0)
by default now on success - (bug-)fixes
- BREAKING CHANGE: remove
validate
prop from IControllersSwaggerOptions interface andSwaggerValidationError
class
- BREAKING CHANGE: controllers() method now returns an
IControllersResult
object instead of the service instance itself - add
tests
prop to IControllerMethodInfo interface
name
argument of @It() decorator now also supports the following placeholders:{{query}}
: list of query parameters{{query-parameter:myQueryParameter}}
: submitted value of query parametermyQueryParameter
- code cleanups and improvements
- add support for query parameters in tests
- fix use of ITestEventHandlerContext interface
- extend ITestSettingValueGetterContext interface
- replace all
.split().join()
workarrounds with replaceAll()
- BREAKING CHANGE: move
loadOpenAPIFiles
andrequiresDocumentationEverywhere
props from IControllersSwaggerOptions to IControllersOptions - (bug-)fixes
- BREAKING CHANGE: @Describe() decorator will throw an exception, if it is tried to be used more than once in a controller class
- improve constructor arguments of [@Describe() decorator][https://egomobile.github.io/node-http-server/functions/describe.html]
- (bug-)fixes
- BREAKING CHANGE: tests are sorted now the following way:
- by
sortBy
value of @Describe() decorator - then: by
name
argument of @Describe() decorator (case-insensitive) - then: by
sortBy
value of ITestSettings interface - then: by
name
argument of @It() decorator (case-insensitive)
- by
- update compiler options to
es2021
- deactivate building source maps
- add
sortBy
prop to ITestSettings interface - add
tag
prop to ITestSettings and ITestEventHandlerContext interfaces - add
groupTag
to ITestEventHandlerContext interface - @Describe() decorator now supports custom settings, represented by new
IDescribeOptions
interface - (bug-)fixes
- BREAKING CHANGE: replace
once()
method withon
in IHttpServer interface - BREAKING CHANGE:
ItSettingsOrValidator
type has been replaced withItArgument2
- improve @It() decorator with additional arguments and type definitions.
- (bug-)fixes
- add following placeholders for
name
argument of @It() decorator:{{parameters}}
: list of comma-separated parameter list, example:"param1" = "param1 value", "param2" = "param2 value"
- (bug-)fixes
name
argument of @It() decorator now supports templating with the following placeholders:{{body}}
: expected body{{header:my-header}}
: expected value for headermy-header
{{parameter:myParameter}}
: submitted value of URL parametermyParameter
{{status}}
: expected HTTP status code
- can implement / declare multiple tests / test settings in
.spec
files now - add
groupIndex
andref
props to ITestEventHandlerContext interface - add
ref
prop to ITestSettings interface
- add
isUIEnabled
property to ISwaggerInitializedEventArguments interface - (bug-)fixes
- BREAKING CHANGE: validateWithDocumentation property in IControllersOptions interface is
true
by default - (bug-)fixes
- add
loadOpenAPIFiles
to IControllerMethodInfo, which can load resources for a Swagger document, organized in.openapi
files - (bug-)fixes
- add
resourcePath
to IControllerMethodInfo, which can load resources for a Swagger document, organized in a strict structure - (bug-)fixes
- BREAKING CHANGE: module requires at least Node 16+ now
- BREAKING CHANGE: controller files are now sorted the following way:
- by number of parts, separated by path chars like
/
- then: all directories, starting with
@
, will be moved to the bottom - then: by directory path (case-insensitive)
- then: all files, starting with
@
, will be moved to the bottom - then: by file name (case-insensitive)
- by number of parts, separated by path chars like
- add
Describe()
andIt()
decorators, that can setup (unit-)tests for controller methods, e.g. - implement
validateAjv()
middleware - if Swagger documentation is activated, all endpoints have to be documented by default now ... this behavior can be controlled by new
requiresDocumentationEverywhere
prop of IControllersOptions interface npm update
s- code cleanups and improvements
- (bug-)fixes
- add
doesValidate
,doesValidateQuery
,hasAuthorize
andmiddlewares
properties to IDocumentationUpdaterContext interface - all build-in middlewares are now of new type
UniqueHttpMiddleware
, which is compatible to HttpMiddleware npm update
s
- add
use
property to IControllersSwaggerOptions interface npm update
s
- add
instance
property to IHttpServer interface npm update
s
- Swagger documents are validated with openapi-schema-validator module by default now ... this behavior can be changed, updating validate property
- implement
validateWithSwagger()
middleware and its representations inside the controller framework, like @GET() or @POST() decorators - code cleanups and improvements
- (bug-)fixes
- implement
@BodyParseErrorHandler()
decorator to handle parse errors in combination with schema validation, configured by decorators - add
onParsingFailed
prop to IControllerRouteWithBodyOptions and IHttpBodyParserOptions interfaces - add
onParsingFailed
andonSchemaValidationFailed
prop to IControllersOptions - also add
onControllerInitialized
,onControllerMethodInitialized
andonSwaggerInitialized
to IControllersOptions, which can help debugging - (bug-)fixes
- code cleanups and improvements
- implement decorators to import values into a request handler argument / parameter:
@Parameter()
: Generic way to import a value@Body()
: import request body@Headers()
: import HTTP request headers as key/value pair object@Query()
: import query parameters from URL as key/value pair object@Request()
: import request context@Response()
: import response context@Url()
: import URL parameters as key/value pair object
- HttpPathValidator can be asynchronious now
- fix typings
- apply new eslint-config-ego settings
- module requires at least Node 14+ now
- (bug-)fixes
npm update
s
- implement @Authorize() decorator and authorize options
- remove regexparam by Luke Edwards and use code directly to reduce dependencies
- remove mrmime by Luke Edwards to reduce dependencies
- improve compilation of handlers and middlewares
- fix minor typos
- improve and fix lang()
- improve Swagger features
- move following types to
internal
:Constructor
GetterFunc
- improve tests
- improve and fix lang() middleware
- @CONNECT() does not support input bodies anymore
- type checks for arguments in params() validator
- remove
prettyErrors()
error handler - other code cleanups and improvements
- (bug-)fixes
- replace use of substr() with substring()
- type check for
key
parameter of @Import() decorator - optimize serializer feature
- update Youch! to version
3.0.0
- add benchmarks to
benchmarks
sub folder - fix typos
- implement all() method
- implement validateQuery middleware
key
parameter of @Import() decorator is now optional, what means that, if no key is submitted, the name of the underlying property is used- (bug-)fixes
- add @Import() decorator, which can import values into a controller's property or provide them there
- BREAKING CHANGE:
Nilable<T>
,Nullable<T>
andOptional<T>
are not public anymore and internal types now
- BREAKING CHANGE: auth() and apiKey() using try-catch blocks now
- BREAKING CHANGE: buffer(), json(), text() and yaml() set body prop to
(null)
now, if HTTP method is notPATCH
,POST
orPUT
- add
notFoundHandler
property to IHttpServer - improve speed of internal helper functions
- fix typos
- implement basicAuth middleware
- code cleanups and improvements
- (bug-)fixes
- do not trim value in auth() middleware anymore
- improve auth() middleware
- implement auth middleware
- improve defaultApiKeyValidationFailedHandler and defaultParseErrorHandler
- code cleanups and improvements
- (bug-)fixes
- implement @Use() decorator
- replace mime-types with mrmime
- can download Swagger documentation over endpoints like
/swagger/yaml
now npm update
s- (bug-)fixes, like issue #11
- removed
bind()
calls - (bug-)fixes
- now bind
ValidationErrorHandler()
,ErrorHandler()
,Serializer
,DocumentationUpdater()
and controller methods to controller instance
- query() middleware is automatically added as 1st middleware to each controller by default now
- add
noQueryParams
to IControllerRouteOptions and IControllersOptions - add missing method check, if try to use schema validation in controller methods
- (bug-)fixes
- BREAKING CHANGE: DELETE(), HEAD(), OPTIONS() and TRACE() decorators do not support bodies anymore: https://specs.openstack.org/openstack/api-wg/guidelines/http/methods.html
- add
apiKey()
middleware - cleanup tests
- made versions in
package.json
explicit
- add missing export of
ValidationErrorHandler()
decorator npm update
- (bug-)fixes
- optimize
readStreamWithLimit()
function npm update
- add
yaml()
middleware - add optional
encoding
props for options ofjson()
andtext()
middlewares
- add
text()
middleware npm update
- fix, cleanup and improve documentation
- bugfixes
npm update
- implement
ValidationErrorHandler()
decorator - add VSCode debugger settings
- bugfixes
- implement controller framework, similar to
express-controllers:
- decorators for
CONNECT
,DELETE
,GET
,HEAD
,OPTIONS
,PATCH
,POST
,PUT
,TRACE
HTTP methods - decorators for setting up custom, controller-wide serializers and error handlers
- decorators for
- code cleanups and improvements
- bugfixes
- add
prettyErrors()
error handler - fix tests
- BREAKING CHANGE: replace use of querystring with URLSearchParams
- add
cookies()
andlang()
middlewares - cleanup documentation
- add optional
TBody
type parameter toIHttpRequest
interface to describe body property npm update
- add
validate()
middleware - add
schema
namespace as joi alias - fix documentation
- bugfixes
- add
query()
middleware - fix
params()
path validator - fix README
- fixes in path validation
- add
params()
middleware next()
function of a middleware can receive an error object now- make sure, that all handlers and middlewares are async functions now
- update type descriptions for handlers and middlewars
- (bug-)fixes
- initial release