chyz 2.0.1-rc.3 → 2.0.1-rc.4

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 CHANGED
@@ -51,15 +51,15 @@ const weekOfYear_1 = __importDefault(require("dayjs/plugin/weekOfYear"));
51
51
  const isTomorrow_1 = __importDefault(require("dayjs/plugin/isTomorrow"));
52
52
  const bodyParser = require("body-parser");
53
53
  const fs = require("fs");
54
- const http_request = require('debug')('http:request');
55
- const http_request_body = http_request.extend('body');
56
- const http_request_headers = http_request.extend('headers');
57
- const compression = require('compression');
54
+ // const http_request = require('debug')('http:request')
55
+ // const http_request_body = http_request.extend('body')
56
+ // const http_request_headers = http_request.extend('headers')
57
+ const compression_1 = __importDefault(require("compression"));
58
58
  // const fs = require('fs');
59
- const ip = require('ip');
59
+ const ip_1 = __importDefault(require("ip"));
60
+ const cors_1 = __importDefault(require("cors"));
60
61
  const methodOverride = require('method-override');
61
62
  const Server = (0, express_1.default)();
62
- const cors = require('cors');
63
63
  const emitter = require('events').EventEmitter;
64
64
  const em = new emitter();
65
65
  /**
@@ -350,8 +350,8 @@ class BaseChyz {
350
350
  beforeMiddleware(req, res, next, instance, route) {
351
351
  return __awaiter(this, void 0, void 0, function* () {
352
352
  BaseChyz.debug(`${instance.id}/${route.path}->beforeMiddleware trigger`);
353
- http_request_body("Request body " + JSON.stringify(req.body));
354
- http_request_headers("Request header " + JSON.stringify(req.headers));
353
+ // http_request_body("Request body " + JSON.stringify(req.body))
354
+ // http_request_headers("Request header " + JSON.stringify(req.headers))
355
355
  try {
356
356
  yield instance.beforeAction(route, req, res);
357
357
  next();
@@ -486,7 +486,7 @@ class BaseChyz {
486
486
  BaseChyz.propvider.use(bodyParser.json({ limit: '1mb' }));
487
487
  BaseChyz.propvider.use(bodyParser.urlencoded({ limit: '1mb', extended: true })); // support encoded bodies
488
488
  BaseChyz.propvider.use(methodOverride());
489
- BaseChyz.propvider.use(cors());
489
+ BaseChyz.propvider.use((0, cors_1.default)());
490
490
  //
491
491
  // // CORS
492
492
  // BaseChyz.express.use(function (req: any, res: Response, next: any) {
@@ -507,9 +507,9 @@ class BaseChyz {
507
507
  return false;
508
508
  }
509
509
  // use compression filter function
510
- return compression.filter(req, res);
510
+ return compression_1.default.filter(req, res);
511
511
  };
512
- BaseChyz.propvider.use(compression({ filter: shouldCompress }));
512
+ BaseChyz.propvider.use((0, compression_1.default)({ filter: shouldCompress }));
513
513
  //
514
514
  // //static file path
515
515
  if (this.config.staticFilePath) {
@@ -541,7 +541,7 @@ class BaseChyz {
541
541
  BaseChyz.info("Express Server Start ");
542
542
  BaseChyz.info(`Liten Port ${this._port}`);
543
543
  BaseChyz.info(`https://localhost:${this._port}`);
544
- BaseChyz.info(`https://${ip.address()}:${this._port}`);
544
+ BaseChyz.info(`https://${ip_1.default.address()}:${this._port}`);
545
545
  BaseChyz.EventEmitter.emit(base_1.CEvents.ON_START, this);
546
546
  });
547
547
  }
@@ -551,7 +551,7 @@ class BaseChyz {
551
551
  BaseChyz.info("Express Server Start ");
552
552
  BaseChyz.info(`Liten Port ${this._port}`);
553
553
  BaseChyz.info(`http://localhost:${this._port}`);
554
- BaseChyz.info(`http://${ip.address()}:${this._port}`);
554
+ BaseChyz.info(`http://${ip_1.default.address()}:${this._port}`);
555
555
  BaseChyz.EventEmitter.emit(base_1.CEvents.ON_START, this);
556
556
  });
557
557
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="express" />
2
1
  import { Request, Response } from "../index";
3
2
  import { CBaseObject } from "./CBaseObject";
4
3
  export declare class ActionFilter extends CBaseObject {
@@ -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;AAGzC,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;IAUjE;;;;;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"}
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;AAGzC,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;IAUjE;;;;;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"}
@@ -1,4 +1,3 @@
1
- /// <reference types="express" />
2
1
  import { Request, Response } from "../index";
3
2
  import { ActionFilter } from "../base";
4
3
  import { WebUser } from "../web/WebUser";
@@ -1 +1 @@
1
- {"version":3,"file":"AccessControl.d.ts","sourceRoot":"","sources":["../../src/filters/AccessControl.ts"],"names":[],"mappings":";AAMA,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAU,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAIvC,qBAAa,aAAc,SAAQ,YAAY;IAEpC,IAAI,EAAE,GAAG,CAAQ;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,GAAG,CAAQ;IAEzB,IAAI;IAgBE,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAC,GAAG,EAAC,QAAQ;IAiC7D,UAAU,CAAC,IAAI,EAAE,OAAO;CAMlC"}
1
+ {"version":3,"file":"AccessControl.d.ts","sourceRoot":"","sources":["../../src/filters/AccessControl.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAU,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAIvC,qBAAa,aAAc,SAAQ,YAAY;IAEpC,IAAI,EAAE,GAAG,CAAQ;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,GAAG,CAAQ;IAEzB,IAAI;IAgBE,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAC,GAAG,EAAC,QAAQ;IAiC7D,UAAU,CAAC,IAAI,EAAE,OAAO;CAMlC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": "2.0.1-rc.3",
3
+ "version": "2.0.1-rc.4",
4
4
  "description": "Nodejs Micro service Framework",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
19
19
  "dependencies": {
20
+ "@types/compression": "^1.7.5",
20
21
  "axios": "^1.3.5",
21
22
  "babel-plugin-transform-decorators-legacy": "^1.3.5",
22
23
  "body-parser": "^1.20.2",
@@ -49,7 +50,7 @@
49
50
  "nodemon": "^2.0.22",
50
51
  "ts-node": "^10.9.1",
51
52
  "typescript": "^5.0.4"
52
- } ,
53
+ },
53
54
  "keywords": [
54
55
  "Framework",
55
56
  "RespAPI",