chyz 2.0.1-rc.5 → 2.0.1-rc.7

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.
@@ -35,7 +35,7 @@ class ActionFilter extends CBaseObject_1.CBaseObject {
35
35
  */
36
36
  beforeFilter(route, req, res) {
37
37
  return __awaiter(this, void 0, void 0, function* () {
38
- BaseChyz_1.default.debug("Controller->beforeFilter ", route);
38
+ BaseChyz_1.default.debug("Controller->ActionFilter->beforeFilter ", JSON.stringify(route));
39
39
  if (!this.isActive(route)) {
40
40
  return;
41
41
  }
@@ -79,7 +79,7 @@ class ActionFilter extends CBaseObject_1.CBaseObject {
79
79
  let reg = new RegExp(`${pattern}$`, "g");
80
80
  let match = id.match(reg);
81
81
  // let match = id.startsWith(pattern);
82
- console.log(id, pattern, match, this.except);
82
+ BaseChyz_1.default.debug("Controller->ActionFilter->isActive ", "id:", id, "patern:", pattern, "match:", match, JSON.stringify(this.except));
83
83
  if (match && match.length > 0) {
84
84
  exceptMatch = true;
85
85
  }
package/base/CEvents.js CHANGED
@@ -21,4 +21,4 @@ var CEvents;
21
21
  CEvents["ON_AFTER_ACTION"] = "onafteraction";
22
22
  CEvents["ON_DB_CONNECTION"] = "ondbconnection";
23
23
  CEvents["ON_DB_DISCONNECT"] = "ondbdisconnect";
24
- })(CEvents = exports.CEvents || (exports.CEvents = {}));
24
+ })(CEvents || (exports.CEvents = CEvents = {}));
package/base/Model.js CHANGED
@@ -217,8 +217,8 @@ class Model extends Component_1.Component {
217
217
  model() {
218
218
  return this._model;
219
219
  }
220
- save(params = {}, options = {}) {
221
- return __awaiter(this, void 0, void 0, function* () {
220
+ save() {
221
+ return __awaiter(this, arguments, void 0, function* (params = {}, options = {}) {
222
222
  this.errors = {};
223
223
  // now instantiate an object
224
224
  let p = Object.assign(params, this._attributes);
@@ -251,8 +251,8 @@ class Model extends Component_1.Component {
251
251
  return result;
252
252
  });
253
253
  }
254
- bulkCreate(params = {}, options = {}) {
255
- return __awaiter(this, void 0, void 0, function* () {
254
+ bulkCreate() {
255
+ return __awaiter(this, arguments, void 0, function* (params = {}, options = {}) {
256
256
  this.errors = {};
257
257
  // now instantiate an object
258
258
  let p = Object.assign(params, this._attributes);
@@ -459,8 +459,8 @@ class Model extends Component_1.Component {
459
459
  * @param query
460
460
  * @param options
461
461
  */
462
- rawQuery(query, options = { type: sequelize_1.QueryTypes.SELECT, nest: true }) {
463
- return __awaiter(this, void 0, void 0, function* () {
462
+ rawQuery(query_1) {
463
+ return __awaiter(this, arguments, void 0, function* (query, options = { type: sequelize_1.QueryTypes.SELECT, nest: true }) {
464
464
  this.errors = {};
465
465
  return yield this.model().query(query, options);
466
466
  });
@@ -13,10 +13,10 @@ const Component_1 = require("./Component");
13
13
  const axios = require('axios');
14
14
  class RestClient extends Component_1.Component {
15
15
  post(url, args, headers) {
16
- return axios.post(url, args, headers);
16
+ return axios.post(url, Object.assign(Object.assign({}, args), { headers: headers }));
17
17
  }
18
18
  get(url, args, headers) {
19
- return axios.get(url, args, headers);
19
+ return axios.get(url, Object.assign(Object.assign({}, args), { headers: headers }));
20
20
  }
21
21
  Rest(params) {
22
22
  return axios(params);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Middleware = void 0;
3
+ exports.Middleware = Middleware;
4
4
  require("reflect-metadata");
5
5
  const ControllerDecoratorParams_1 = require("./enums/ControllerDecoratorParams");
6
6
  function Middleware(middlewares) {
@@ -8,4 +8,3 @@ function Middleware(middlewares) {
8
8
  Reflect.defineMetadata(ControllerDecoratorParams_1.ControllerDecoratorParams.Middleware, middlewares, target, propertyKey);
9
9
  };
10
10
  }
11
- exports.Middleware = Middleware;
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/decorator/controller.ts"],"names":[],"mappings":"AAQA,OAAQ,kBAAkB,CAAC;AAC3B,eAAO,MAAM,UAAU,YAAY,MAAM,KAAQ,cAYhD,CAAC"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/decorator/controller.ts"],"names":[],"mappings":"AAQA,OAAQ,kBAAkB,CAAC;AAC3B,eAAO,MAAM,UAAU,GAAI,SAAQ,MAAW,KAAG,cAYhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/decorator/delete.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,GAAG,SAAU,MAAM,KAAG,eAyBlC,CAAC"}
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/decorator/delete.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,eAyBlC,CAAC"}
@@ -6,4 +6,4 @@ var ControllerDecoratorParams;
6
6
  ControllerDecoratorParams["Path"] = "path";
7
7
  ControllerDecoratorParams["Method"] = "method";
8
8
  ControllerDecoratorParams["Middleware"] = "middleware";
9
- })(ControllerDecoratorParams = exports.ControllerDecoratorParams || (exports.ControllerDecoratorParams = {}));
9
+ })(ControllerDecoratorParams || (exports.ControllerDecoratorParams = ControllerDecoratorParams = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/decorator/get.ts"],"names":[],"mappings":"AAOA,OAAO,kBAAkB,CAAC;AAG1B,eAAO,MAAM,GAAG,SAAU,MAAM,KAAG,eA0BlC,CAAC"}
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/decorator/get.ts"],"names":[],"mappings":"AAOA,OAAO,kBAAkB,CAAC;AAG1B,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,eA0BlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/decorator/post.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,IAAI,SAAU,MAAM,KAAG,eAyBnC,CAAC"}
1
+ {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/decorator/post.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,eAyBnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"put.d.ts","sourceRoot":"","sources":["../../src/decorator/put.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,GAAG,SAAU,MAAM,KAAG,eAyBlC,CAAC"}
1
+ {"version":3,"file":"put.d.ts","sourceRoot":"","sources":["../../src/decorator/put.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,eAyBlC,CAAC"}
@@ -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;IA+B7D,UAAU,CAAC,IAAI,EAAE,OAAO;CAMlC"}
@@ -41,8 +41,8 @@ class AccessControl extends base_2.ActionFilter {
41
41
  });
42
42
  }
43
43
  beforeAction(action, request, res) {
44
- var _a, _b;
45
44
  return __awaiter(this, void 0, void 0, function* () {
45
+ var _a, _b;
46
46
  let allow;
47
47
  // @ts-ignore
48
48
  let user = (_a = request.user) !== null && _a !== void 0 ? _a : this.user;
@@ -31,8 +31,8 @@ class AuthMethod extends base_1.ActionFilter {
31
31
  * @param response
32
32
  */
33
33
  beforeAction(action, request, response) {
34
- var _a;
35
34
  return __awaiter(this, void 0, void 0, function* () {
35
+ var _a;
36
36
  let identity = yield this.authenticate((_a = this.user) !== null && _a !== void 0 ? _a : new WebUser_1.WebUser(), request, response);
37
37
  // @ts-ignore
38
38
  request.identity = identity;
@@ -47,7 +47,8 @@ class HttpBasicAuth extends AuthMethod_1.AuthMethod {
47
47
  this.user = (_a = BaseChyz_1.default.getComponent("user")) !== null && _a !== void 0 ? _a : null;
48
48
  }
49
49
  authenticate(user, request, response) {
50
- return __awaiter(this, arguments, void 0, function* () {
50
+ var arguments_1 = arguments;
51
+ return __awaiter(this, void 0, void 0, function* () {
51
52
  let autHeader = this.getHeaderByKey(request.headers, this.header);
52
53
  if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
53
54
  return this.fail(response);
@@ -57,7 +58,7 @@ class HttpBasicAuth extends AuthMethod_1.AuthMethod {
57
58
  let buff = new Buffer(autHeader[1], "base64");
58
59
  let basicauth = buff.toString().split(":");
59
60
  if (this.auth != null) {
60
- identity = yield this.auth(autHeader[1], ...arguments, basicauth);
61
+ identity = yield this.auth(autHeader[1], ...arguments_1, basicauth);
61
62
  }
62
63
  else {
63
64
  identity = yield user.loginByAccessToken(basicauth, "HttpBasicAuth");
@@ -45,7 +45,8 @@ class JwtHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
45
45
  this.user = (_a = BaseChyz_1.default.getComponent("user")) !== null && _a !== void 0 ? _a : null;
46
46
  }
47
47
  authenticate(user, request, response) {
48
- return __awaiter(this, arguments, void 0, function* () {
48
+ var arguments_1 = arguments;
49
+ return __awaiter(this, void 0, void 0, function* () {
49
50
  let autHeader = this.getHeaderByKey(request.headers, this.header);
50
51
  if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
51
52
  return null;
@@ -65,7 +66,7 @@ class JwtHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
65
66
  }
66
67
  if (token !== null) {
67
68
  if (this.auth != null) {
68
- identity = yield this.auth(autHeader[1], ...arguments);
69
+ identity = yield this.auth(autHeader[1], ...arguments_1);
69
70
  }
70
71
  else {
71
72
  identity = yield user.loginByAccessToken(autHeader[1], "JwtHttpBearerAuth");
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;KAClC;CACJ;AAQD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAGlC,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb,QAAQ,EAAE,GAAG,CAAC;KACjB;CACJ;AAgBD,eAAO,MAAM,YAAY,KAAgB,CAAC;AAC1C,QAAA,MAAM,IAAI,UAAiB,CAAC;AAC5B,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,CAAA;AAC7B,OAAO,EACH,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,EACL,YAAY,EACZ,OAAO,EACV,MAAM,QAAQ,CAAC;AAChB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;KAClC;CACJ;AAQD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAGlC,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb,QAAQ,EAAE,GAAG,CAAC;KACjB;CACJ;AAkBD,eAAO,MAAM,YAAY,KAAgB,CAAC;AAG1C,QAAA,MAAM,IAAI,UAAiB,CAAC;AAC5B,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,CAAA;AAC7B,OAAO,EACH,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,KAAK,EACL,YAAY,EACZ,OAAO,EACV,MAAM,QAAQ,CAAC;AAChB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AAExB,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,eAAe,IAAI,CAAC"}
package/index.js CHANGED
@@ -43,6 +43,7 @@ String.prototype.tokenReplace = function (obj) {
43
43
  */
44
44
  const pjson = require('./package.json');
45
45
  exports.Chyz_Version = pjson.version;
46
+ console.log(`BaseChyz Framework Version ${exports.Chyz_Version}`);
46
47
  const Chyz = new BaseChyz_1.default();
47
48
  var WebUser_1 = require("./web/WebUser");
48
49
  Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
@@ -1,55 +1,55 @@
1
- {
2
- "appenders": {
3
- "access": {
4
- "type": "dateFile",
5
- "filename": "log/access.log",
6
- "pattern": "-yyyy-MM-dd",
7
- "category": "http",
8
- "layout": {
9
- "type": "pattern",
10
- "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
11
- }
12
- },
13
- "app": {
14
- "type": "file",
15
- "filename": "log/app.log",
16
- "maxLogSize": 10485760,
17
- "numBackups": 3,
18
- "layout": {
19
- "type": "pattern",
20
- "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
21
- }
22
- },
23
- "errorFile": {
24
- "type": "file",
25
- "filename": "log/errors.log",
26
- "layout": {
27
- "type": "pattern",
28
- "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
29
- }
30
- },
31
- "errors": {
32
- "type": "logLevelFilter",
33
- "level": "ERROR",
34
- "appender": "errorFile",
35
- "layout": {
36
- "type": "pattern",
37
- "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
38
- }
39
- },
40
- "console": {
41
- "type": "stdout"
42
- }
43
- },
44
- "categories": {
45
- "default": {
46
- "appenders": ["console","app" ,"errors" ],
47
- "level": "INFO",
48
- "enableCallStack": true
49
- },
50
- "http": {
51
- "level": "INFO",
52
- "appenders": [ "access" ]
53
- }
54
- }
55
- }
1
+ {
2
+ "appenders": {
3
+ "access": {
4
+ "type": "dateFile",
5
+ "filename": "log/access.log",
6
+ "pattern": "-yyyy-MM-dd",
7
+ "category": "http",
8
+ "layout": {
9
+ "type": "pattern",
10
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
11
+ }
12
+ },
13
+ "app": {
14
+ "type": "file",
15
+ "filename": "log/app.log",
16
+ "maxLogSize": 10485760,
17
+ "numBackups": 3,
18
+ "layout": {
19
+ "type": "pattern",
20
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
21
+ }
22
+ },
23
+ "errorFile": {
24
+ "type": "file",
25
+ "filename": "log/errors.log",
26
+ "layout": {
27
+ "type": "pattern",
28
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
29
+ }
30
+ },
31
+ "errors": {
32
+ "type": "logLevelFilter",
33
+ "level": "ERROR",
34
+ "appender": "errorFile",
35
+ "layout": {
36
+ "type": "pattern",
37
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
38
+ }
39
+ },
40
+ "console": {
41
+ "type": "stdout"
42
+ }
43
+ },
44
+ "categories": {
45
+ "default": {
46
+ "appenders": ["console","app" ,"errors" ],
47
+ "level": "INFO",
48
+ "enableCallStack": true
49
+ },
50
+ "http": {
51
+ "level": "INFO",
52
+ "appenders": [ "access" ]
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "appenders": {
3
+ "access": {
4
+ "type": "dateFile",
5
+ "filename": "log/access.log",
6
+ "pattern": "-yyyy-MM-dd",
7
+ "category": "http",
8
+ "layout": {
9
+ "type": "pattern",
10
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
11
+ }
12
+ },
13
+ "app": {
14
+ "type": "file",
15
+ "filename": "log/app.log",
16
+ "maxLogSize": 10485760,
17
+ "numBackups": 3,
18
+ "layout": {
19
+ "type": "pattern",
20
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
21
+ }
22
+ },
23
+ "errorFile": {
24
+ "type": "file",
25
+ "filename": "log/errors.log",
26
+ "layout": {
27
+ "type": "pattern",
28
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
29
+ }
30
+ },
31
+ "errors": {
32
+ "type": "logLevelFilter",
33
+ "level": "ERROR",
34
+ "appender": "errorFile",
35
+ "layout": {
36
+ "type": "pattern",
37
+ "pattern": "[%d{yyyy-MM-ddThh.mm.ss.SSS}] [%p] %c [%l] [%f] - %m"
38
+ }
39
+ },
40
+ "console": {
41
+ "type": "stdout"
42
+ }
43
+ },
44
+ "categories": {
45
+ "default": {
46
+ "appenders": ["console","app" ,"errors" ],
47
+ "level": "INFO",
48
+ "enableCallStack": true
49
+ },
50
+ "http": {
51
+ "level": "INFO",
52
+ "appenders": [ "access" ]
53
+ }
54
+ }
55
+ }
package/package.json CHANGED
@@ -1,62 +1,63 @@
1
- {
2
- "name": "chyz",
3
- "version": "2.0.1-rc.5",
4
- "description": "Nodejs Micro service Framework",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1",
7
- "postversion": "git push && git push --tags"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/cihan53/Chy-Nodejs-Framework.git"
12
- },
13
- "author": "Cihan Ozturk",
14
- "license": "MIT",
15
- "bugs": {
16
- "url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
17
- },
18
- "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
19
- "dependencies": {
20
- "@types/compression": "^1.7.5",
21
- "axios": "^1.3.5",
22
- "babel-plugin-transform-decorators-legacy": "^1.3.5",
23
- "body-parser": "^1.20.2",
24
- "compression": "^1.7.4",
25
- "core-js": "^3.30.1",
26
- "cors": "^2.8.5",
27
- "dayjs": "^1.11.7",
28
- "dotenv-flow": "^3.2.0",
29
- "express": "^4.18.2",
30
- "express-session": "^1.17.3",
31
- "glob": "^10.0.0",
32
- "ip": "^1.1.8",
33
- "jsonwebtoken": "^9.0.0",
34
- "lodash": "^4.17.21",
35
- "log4js": "^6.9.1",
36
- "method-override": "^3.0.0",
37
- "passport": "^0.6.0",
38
- "pg": "^8.10.0",
39
- "pg-hstore": "^2.3.4",
40
- "reflect-metadata": "^0.1.13",
41
- "sequelize": "^6.31.0",
42
- "sequelize-transparent-cache": "^2.3.0",
43
- "tslib": "^2.5.0",
44
- "validate.js": "^0.13.1"
45
- },
46
- "devDependencies": {
47
- "@types/express": "^4.17.17",
48
- "@types/node": "^18.15.11",
49
- "@types/validator": "^13.7.15",
50
- "nodemon": "^2.0.22",
51
- "ts-node": "^10.9.1",
52
- "typescript": "^5.0.4"
53
- },
54
- "keywords": [
55
- "Framework",
56
- "RespAPI",
57
- "microservice",
58
- "micro service",
59
- "easy configuration",
60
- "Rbac support"
61
- ]
62
- }
1
+ {
2
+ "name": "chyz",
3
+ "version": "2.0.1-rc.7",
4
+ "description": "Nodejs Micro service Framework",
5
+ "scripts": {
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "postversion": "git push && git push --tags"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/cihan53/Chy-Nodejs-Framework.git"
12
+ },
13
+ "author": "Cihan Ozturk",
14
+ "license": "MIT",
15
+ "bugs": {
16
+ "url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
17
+ },
18
+ "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
19
+ "dependencies": {
20
+ "@types/compression": "^1.7.5",
21
+ "axios": "^1.3.5",
22
+ "babel-plugin-transform-decorators-legacy": "^1.3.5",
23
+ "body-parser": "^1.20.2",
24
+ "compression": "^1.7.4",
25
+ "core-js": "^3.30.1",
26
+ "cors": "^2.8.5",
27
+ "dayjs": "^1.11.7",
28
+ "dotenv-flow": "^3.2.0",
29
+ "express": "^4.18.2",
30
+ "express-session": "^1.17.3",
31
+ "glob": "^10.0.0",
32
+ "ip": "^1.1.8",
33
+ "jsonwebtoken": "^9.0.0",
34
+ "lodash": "^4.17.21",
35
+ "lodash-uuid": "^0.0.3",
36
+ "log4js": "^6.9.1",
37
+ "method-override": "^3.0.0",
38
+ "passport": "^0.6.0",
39
+ "pg": "^8.10.0",
40
+ "pg-hstore": "^2.3.4",
41
+ "reflect-metadata": "^0.1.13",
42
+ "sequelize": "^6.31.0",
43
+ "sequelize-transparent-cache": "^2.3.0",
44
+ "tslib": "^2.5.0",
45
+ "validate.js": "^0.13.1"
46
+ },
47
+ "devDependencies": {
48
+ "@types/express": "^4.17.17",
49
+ "@types/node": "^18.15.11",
50
+ "@types/validator": "^13.7.15",
51
+ "nodemon": "^2.0.22",
52
+ "ts-node": "^10.9.1",
53
+ "typescript": "^5.0.4"
54
+ },
55
+ "keywords": [
56
+ "Framework",
57
+ "RespAPI",
58
+ "microservice",
59
+ "micro service",
60
+ "easy configuration",
61
+ "Rbac support"
62
+ ]
63
+ }
@@ -25,8 +25,8 @@ class AuthManager extends base_1.Component {
25
25
  /**
26
26
  *
27
27
  */
28
- checkAccess(userId, permissionName, params = []) {
29
- return __awaiter(this, void 0, void 0, function* () {
28
+ checkAccess(userId_1, permissionName_1) {
29
+ return __awaiter(this, arguments, void 0, function* (userId, permissionName, params = []) {
30
30
  let assignments;
31
31
  if (!userId)
32
32
  return false;
@@ -351,6 +351,6 @@ class AuthManager extends base_1.Component {
351
351
  return Utils_1.Utils.isEmpty(assignments) && Utils_1.Utils.isEmpty(this.defaultRoles);
352
352
  }
353
353
  }
354
+ exports.AuthManager = AuthManager;
354
355
  AuthManager.TYPE_ROLE = 1;
355
356
  AuthManager.TYPE_PERMISSION = 2;
356
- exports.AuthManager = AuthManager;
@@ -20,8 +20,8 @@ class Validator extends base_1.Component {
20
20
  static createValidator(type, model, attributes, params = []) {
21
21
  }
22
22
  }
23
+ exports.Validator = Validator;
23
24
  Validator.builtInValidators = {
24
25
  'boolean': '',
25
26
  'email': '',
26
27
  };
27
- exports.Validator = Validator;
package/web/WebUser.js CHANGED
@@ -69,8 +69,8 @@ class WebUser extends Component_1.Component {
69
69
  * @param token
70
70
  * @param type
71
71
  */
72
- loginByAccessToken(token, type = null) {
73
- return __awaiter(this, void 0, void 0, function* () {
72
+ loginByAccessToken(token_1) {
73
+ return __awaiter(this, arguments, void 0, function* (token, type = null) {
74
74
  let $class = this.identityClass;
75
75
  if ($class.findIdentityByAccessToken) {
76
76
  this.identity = yield $class.findIdentityByAccessToken(token, type);
@@ -130,8 +130,8 @@ class WebUser extends Component_1.Component {
130
130
  //
131
131
  // return $access;
132
132
  // }
133
- can(permissionName, params = [], allowCaching = true) {
134
- return __awaiter(this, void 0, void 0, function* () {
133
+ can(permissionName_1) {
134
+ return __awaiter(this, arguments, void 0, function* (permissionName, params = [], allowCaching = true) {
135
135
  let access;
136
136
  let accessChecker;
137
137
  if ((accessChecker = this.getAccessChecker()) == null)