@mcma/api
Advanced tools
Comparing version 0.14.0 to 0.14.1
@@ -13,4 +13,5 @@ import { ConfigVariables, Logger, LoggerProvider, McmaResource, McmaTracker } from "@mcma/core"; | ||
setResponseBody(body: any): void; | ||
setResponseStatusCode(statusCode: number): void; | ||
setResponseResourceCreated(resource: McmaResource): void; | ||
setResponseError(code: number, message?: string): void; | ||
setResponseError(statusCode: number, message?: string): void; | ||
setResponseBadRequestDueToMissingBody(): void; | ||
@@ -17,0 +18,0 @@ setResponseResourceNotFound(): void; |
@@ -24,2 +24,5 @@ "use strict"; | ||
} | ||
setResponseStatusCode(statusCode) { | ||
this.response.statusCode = statusCode; | ||
} | ||
setResponseResourceCreated(resource) { | ||
@@ -30,7 +33,7 @@ this.response.headers["Location"] = resource.id; | ||
} | ||
setResponseError(code, message) { | ||
if (code < 400 || code > 599) { | ||
setResponseError(statusCode, message) { | ||
if (statusCode < 400 || statusCode > 599) { | ||
throw new core_1.McmaException("McmaApiRequestContext.setResponseError can only be used to handle 4xx or 5xx errors"); | ||
} | ||
this.response.statusCode = code; | ||
this.response.statusCode = statusCode; | ||
this.response.errorMessage = message; | ||
@@ -37,0 +40,0 @@ } |
{ | ||
"name": "@mcma/api", | ||
"version": "0.14.0", | ||
"version": "0.14.1", | ||
"description": "Node module for building APIs based on the EBU MCMA framework", | ||
@@ -40,12 +40,12 @@ "engines": { | ||
"peerDependencies": { | ||
"@mcma/client": "0.14.0", | ||
"@mcma/core": "0.14.0", | ||
"@mcma/data": "0.14.0", | ||
"@mcma/worker-invoker": "0.14.0" | ||
"@mcma/client": "0.14.1", | ||
"@mcma/core": "0.14.1", | ||
"@mcma/data": "0.14.1", | ||
"@mcma/worker-invoker": "0.14.1" | ||
}, | ||
"devDependencies": { | ||
"@mcma/client": "0.14.0", | ||
"@mcma/core": "0.14.0", | ||
"@mcma/data": "0.14.0", | ||
"@mcma/worker-invoker": "0.14.0", | ||
"@mcma/client": "0.14.1", | ||
"@mcma/core": "0.14.1", | ||
"@mcma/data": "0.14.1", | ||
"@mcma/worker-invoker": "0.14.1", | ||
"@types/node": "^14.17.22", | ||
@@ -52,0 +52,0 @@ "@types/pluralize": "0.0.29", |
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
61400
1283