chyz 2.0.1-rc.0 → 2.0.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseChyz.js +3 -3
- package/base/ActionFilter.d.ts.map +1 -1
- package/base/ActionFilter.js +5 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/BaseChyz.js
CHANGED
|
@@ -349,7 +349,7 @@ class BaseChyz {
|
|
|
349
349
|
}
|
|
350
350
|
beforeMiddleware(req, res, next, instance, route) {
|
|
351
351
|
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
-
BaseChyz.debug(`${instance.id
|
|
352
|
+
BaseChyz.debug(`${instance.id}/${route.path}->beforeMiddleware trigger`);
|
|
353
353
|
http_request_body("Request body " + JSON.stringify(req.body));
|
|
354
354
|
http_request_headers("Request header " + JSON.stringify(req.headers));
|
|
355
355
|
try {
|
|
@@ -370,7 +370,7 @@ class BaseChyz {
|
|
|
370
370
|
}
|
|
371
371
|
responseHandler(req, res, next, instance, route) {
|
|
372
372
|
return __awaiter(this, void 0, void 0, function* () {
|
|
373
|
-
BaseChyz.debug(`${instance.id
|
|
373
|
+
BaseChyz.debug(`${instance.id}/${route.path}->responseHandler trigger`);
|
|
374
374
|
try {
|
|
375
375
|
// @ts-ignore
|
|
376
376
|
yield instance[route.methodName](req, res, next);
|
|
@@ -390,7 +390,7 @@ class BaseChyz {
|
|
|
390
390
|
}
|
|
391
391
|
afterMiddleware(req, res, next, instance, route) {
|
|
392
392
|
return __awaiter(this, void 0, void 0, function* () {
|
|
393
|
-
BaseChyz.debug(`${instance.id
|
|
393
|
+
BaseChyz.debug(`${instance.id}/${route.path}->afterMiddleware trigger`);
|
|
394
394
|
try {
|
|
395
395
|
yield instance.afterAction(route, req, res);
|
|
396
396
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionFilter.d.ts","sourceRoot":"","sources":["../../src/base/ActionFilter.ts"],"names":[],"mappings":";AAMA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AAEzC,qBAAa,YAAa,SAAQ,WAAW;IAElC,IAAI,EAAE,GAAG,CAAC;IAEjB;;;OAGG;IACI,MAAM,UAAM;IAGZ,IAAI;IAIX;;;;;OAKG;IACU,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"ActionFilter.d.ts","sourceRoot":"","sources":["../../src/base/ActionFilter.ts"],"names":[],"mappings":";AAMA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AAEzC,qBAAa,YAAa,SAAQ,WAAW;IAElC,IAAI,EAAE,GAAG,CAAC;IAEjB;;;OAGG;IACI,MAAM,UAAM;IAGZ,IAAI;IAIX;;;;;OAKG;IACU,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IASjE;;;;;OAKG;IACU,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAIjE;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG;CA8BjC"}
|
package/base/ActionFilter.js
CHANGED
|
@@ -31,6 +31,7 @@ class ActionFilter extends CBaseObject_1.CBaseObject {
|
|
|
31
31
|
*/
|
|
32
32
|
beforeFilter(route, req, res) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
console.log("route ", route);
|
|
34
35
|
if (!this.isActive(route)) {
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
@@ -71,7 +72,10 @@ class ActionFilter extends CBaseObject_1.CBaseObject {
|
|
|
71
72
|
}
|
|
72
73
|
for (const exceptKey in this.except) {
|
|
73
74
|
let pattern = this.except[exceptKey];
|
|
74
|
-
let
|
|
75
|
+
let reg = new RegExp(`${pattern}$`, "g");
|
|
76
|
+
let match = id.match(reg);
|
|
77
|
+
// let match = id.startsWith(pattern);
|
|
78
|
+
console.log(id, pattern, match, this.except);
|
|
75
79
|
if (match && match.length > 0) {
|
|
76
80
|
exceptMatch = true;
|
|
77
81
|
}
|
package/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare module "express-serve-static-core" {
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
export declare const Chyz_Version = "2.0.1-rc.
|
|
16
|
+
export declare const Chyz_Version = "2.0.1-rc.2";
|
|
17
17
|
declare const Chyz: BaseChyz;
|
|
18
18
|
export { Request, Response, NextFunction } from "./base/CRequest";
|
|
19
19
|
export { RouteDefinition } from "./model/RouteDefinition";
|
package/index.js
CHANGED
|
@@ -41,7 +41,7 @@ String.prototype.tokenReplace = function (obj) {
|
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
|
-
exports.Chyz_Version = "2.0.1-rc.
|
|
44
|
+
exports.Chyz_Version = "2.0.1-rc.2";
|
|
45
45
|
const Chyz = new BaseChyz_1.default();
|
|
46
46
|
var WebUser_1 = require("./web/WebUser");
|
|
47
47
|
Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
|