@compas/server
Advanced tools
Comparing version 0.0.185 to 0.0.186
{ | ||
"name": "@compas/server", | ||
"version": "0.0.185", | ||
"version": "0.0.186", | ||
"description": "Koa server and common middleware", | ||
@@ -18,3 +18,3 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@compas/stdlib": "0.0.185", | ||
"@compas/stdlib": "0.0.186", | ||
"@types/formidable": "2.0.4", | ||
@@ -21,0 +21,0 @@ "@types/koa": "2.13.4", |
@@ -16,3 +16,2 @@ /** | ||
): BodyParserPair; | ||
export type Middleware = import("koa").Middleware; | ||
export type KoaBodyOptions = { | ||
@@ -33,6 +32,6 @@ urlencoded?: boolean | undefined; | ||
export type BodyParserPair = { | ||
bodyParser: Middleware; | ||
multipartBodyParser: Middleware; | ||
bodyParser: import("koa").Middleware; | ||
multipartBodyParser: import("koa").Middleware; | ||
}; | ||
import formidable from "formidable"; | ||
//# sourceMappingURL=body.d.ts.map |
@@ -6,6 +6,2 @@ import { AppError } from "@compas/stdlib"; | ||
/** | ||
* @typedef {import("koa").Middleware} Middleware | ||
*/ | ||
/** | ||
* @typedef {object} KoaBodyOptions | ||
@@ -25,4 +21,4 @@ * @property {boolean|undefined} [urlencoded] | ||
* @typedef {object} BodyParserPair | ||
* @property {Middleware} bodyParser | ||
* @property {Middleware} multipartBodyParser | ||
* @property {import("koa").Middleware} bodyParser | ||
* @property {import("koa").Middleware} multipartBodyParser | ||
*/ | ||
@@ -140,3 +136,3 @@ | ||
* @param {formidable.Options} opts | ||
* @returns {Middleware} | ||
* @returns {import("koa").Middleware} | ||
*/ | ||
@@ -143,0 +139,0 @@ function koaFormidable(opts = {}) { |
/** | ||
* @typedef {import("koa").Middleware} Middleware | ||
*/ | ||
/** | ||
* Compose `middleware` returning of all those which are passed. | ||
@@ -9,7 +6,8 @@ * | ||
* | ||
* @param {Middleware[]} middleware | ||
* @returns {Middleware} | ||
* @param {import("koa").Middleware[]} middleware | ||
* @returns {import("koa").Middleware} | ||
*/ | ||
export function compose(middleware: Middleware[]): Middleware; | ||
export type Middleware = import("koa").Middleware; | ||
export function compose( | ||
middleware: import("koa").Middleware[], | ||
): import("koa").Middleware; | ||
//# sourceMappingURL=compose.d.ts.map |
@@ -9,6 +9,2 @@ /* | ||
/** | ||
* @typedef {import("koa").Middleware} Middleware | ||
*/ | ||
/** | ||
* Compose `middleware` returning of all those which are passed. | ||
@@ -18,4 +14,4 @@ * | ||
* | ||
* @param {Middleware[]} middleware | ||
* @returns {Middleware} | ||
* @param {import("koa").Middleware[]} middleware | ||
* @returns {import("koa").Middleware} | ||
*/ | ||
@@ -22,0 +18,0 @@ export function compose(middleware) { |
/** | ||
* Handle any upstream errors | ||
* | ||
* @param {ErrorHandlerOptions} opts | ||
* @param {import("../app").ErrorHandlerOptions} opts | ||
* @returns {Middleware} | ||
*/ | ||
export function errorHandler(opts: ErrorHandlerOptions): Middleware; | ||
export type ErrorHandlerOptions = import("../app").ErrorHandlerOptions; | ||
export function errorHandler( | ||
opts: import("../app").ErrorHandlerOptions, | ||
): Middleware; | ||
//# sourceMappingURL=error.d.ts.map |
import { AppError, isStaging } from "@compas/stdlib"; | ||
/** | ||
* @typedef {import("../app").ErrorHandlerOptions} ErrorHandlerOptions | ||
*/ | ||
/** | ||
* @type {NonNullable<ErrorHandlerOptions["onError"]>} | ||
* @type {NonNullable<import("../app").ErrorHandlerOptions["onError"]>} | ||
* Default onError handler that doesn't handle anything | ||
@@ -14,3 +10,3 @@ */ | ||
/** | ||
* @type {NonNullable<ErrorHandlerOptions["onAppError"]>} | ||
* @type {NonNullable<import("../app").ErrorHandlerOptions["onAppError"]>} | ||
* Default onAppError handler that builds a simple object with key, message and info. | ||
@@ -23,3 +19,3 @@ */ | ||
* | ||
* @param {ErrorHandlerOptions} opts | ||
* @param {import("../app").ErrorHandlerOptions} opts | ||
* @returns {Middleware} | ||
@@ -26,0 +22,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45558
1192
+ Added@compas/stdlib@0.0.186(transitive)
+ Added@types/node@17.0.18(transitive)
+ Addedpino@7.8.0(transitive)
- Removed@compas/stdlib@0.0.185(transitive)
- Removed@types/node@17.0.16(transitive)
- Removedpino@7.6.5(transitive)
Updated@compas/stdlib@0.0.186