nodecommons-rest
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -6,4 +6,4 @@ import { TPropertyObject } from 'tscommons-core'; | ||
private path; | ||
constructor(restServer: CommonsRestServer, path: string, namespace: string, hook: string); | ||
constructor(restServer: CommonsRestServer, path: string, hook: string, namespace?: string); | ||
protected abstract handle(data: TPropertyObject): Promise<string | never>; | ||
} |
@@ -16,6 +16,6 @@ "use strict"; | ||
class CommonsRestWebhookApi extends commons_rest_api_1.CommonsRestApi { | ||
constructor(restServer, path, namespace, hook) { | ||
constructor(restServer, path, hook, namespace) { | ||
super(restServer); | ||
this.path = path; | ||
super.getHandler(`${this.path}${namespace}/${hook}`, (req, _res) => __awaiter(this, void 0, void 0, function* () { | ||
super.getHandler(`${this.path}${namespace ? `${namespace}/` : ''}${hook}`, (req, _res) => __awaiter(this, void 0, void 0, function* () { | ||
if (!tscommons_core_1.CommonsType.hasPropertyString(req.query, 'challenge')) { | ||
@@ -28,3 +28,3 @@ return commons_rest_api_1.CommonsRestApi.badRequest('No challenge supplied'); | ||
})); | ||
super.postHandler(`${this.path}${namespace}/${hook}`, (req, _res) => __awaiter(this, void 0, void 0, function* () { | ||
super.postHandler(`${this.path}${namespace ? `${namespace}/` : ''}${hook}`, (req, _res) => __awaiter(this, void 0, void 0, function* () { | ||
if (!tscommons_core_1.CommonsType.hasPropertyObject(req, 'body')) { | ||
@@ -31,0 +31,0 @@ return commons_rest_api_1.CommonsRestApi.badRequest('No JSON body supplied'); |
{ | ||
"name": "nodecommons-rest", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
65658