chyz 2.0.0-rc.3 → 2.0.0-rc.30

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.
Files changed (142) hide show
  1. package/BaseChyz.d.ts +62 -60
  2. package/BaseChyz.d.ts.map +1 -1
  3. package/BaseChyz.js +488 -379
  4. package/base/ActionFilter.d.ts +32 -32
  5. package/base/ActionFilter.d.ts.map +1 -1
  6. package/base/ActionFilter.js +82 -85
  7. package/base/BadRequestHttpException.d.ts +6 -0
  8. package/base/BadRequestHttpException.d.ts.map +1 -0
  9. package/base/BadRequestHttpException.js +17 -0
  10. package/base/BaseError.d.ts +31 -10
  11. package/base/BaseError.d.ts.map +1 -1
  12. package/base/BaseError.js +47 -29
  13. package/base/Behavior.d.ts +3 -3
  14. package/base/Behavior.js +7 -7
  15. package/base/CBaseObject.d.ts +4 -4
  16. package/base/CBaseObject.d.ts.map +1 -1
  17. package/base/CBaseObject.js +16 -16
  18. package/base/CEvents.d.ts +13 -0
  19. package/base/CEvents.d.ts.map +1 -0
  20. package/base/CEvents.js +24 -0
  21. package/base/CRequest.d.ts +2 -0
  22. package/base/CRequest.d.ts.map +1 -0
  23. package/base/CRequest.js +10 -0
  24. package/base/CWebController.d.ts +43 -43
  25. package/base/CWebController.d.ts.map +1 -1
  26. package/base/CWebController.js +81 -74
  27. package/base/Component.d.ts +20 -20
  28. package/base/Component.d.ts.map +1 -1
  29. package/base/Component.js +57 -60
  30. package/base/Configurable.d.ts +2 -2
  31. package/base/Configurable.js +8 -8
  32. package/base/DataErrorDbException.d.ts +5 -5
  33. package/base/DataErrorDbException.js +17 -17
  34. package/base/DbConnection.d.ts +12 -12
  35. package/base/DbConnection.js +53 -53
  36. package/base/ForbiddenHttpException.d.ts +4 -4
  37. package/base/ForbiddenHttpException.js +16 -16
  38. package/base/InvalidArgumentException.d.ts +5 -5
  39. package/base/InvalidArgumentException.js +17 -17
  40. package/base/InvalidConfigException.d.ts +5 -5
  41. package/base/InvalidConfigException.js +17 -17
  42. package/base/Logs.d.ts +22 -0
  43. package/base/Logs.d.ts.map +1 -0
  44. package/base/Logs.js +57 -0
  45. package/base/Model.d.ts +298 -298
  46. package/base/Model.d.ts.map +1 -1
  47. package/base/Model.js +509 -507
  48. package/base/ModelManager.d.ts +1 -1
  49. package/base/ModelManager.js +19 -19
  50. package/base/NotFoundHttpException.d.ts +5 -5
  51. package/base/NotFoundHttpException.js +17 -17
  52. package/base/RestClient.d.ts +6 -8
  53. package/base/RestClient.d.ts.map +1 -1
  54. package/base/RestClient.js +25 -26
  55. package/base/UnauthorizedHttpException.d.ts +5 -5
  56. package/base/UnauthorizedHttpException.js +17 -17
  57. package/base/ValidationHttpException.d.ts +5 -5
  58. package/base/ValidationHttpException.js +17 -17
  59. package/base/db/Exception.d.ts +6 -6
  60. package/base/db/Exception.js +15 -15
  61. package/base/index.d.ts +19 -17
  62. package/base/index.d.ts.map +1 -1
  63. package/base/index.js +41 -37
  64. package/decorator/Middleware.d.ts +3 -3
  65. package/decorator/Middleware.js +11 -11
  66. package/decorator/controller.d.ts +2 -2
  67. package/decorator/controller.js +24 -24
  68. package/decorator/delete.d.ts +3 -0
  69. package/decorator/delete.d.ts.map +1 -0
  70. package/decorator/delete.js +36 -0
  71. package/decorator/enums/ControllerDecoratorParams.d.ts +5 -5
  72. package/decorator/enums/ControllerDecoratorParams.js +9 -9
  73. package/decorator/get.d.ts +2 -2
  74. package/decorator/get.js +36 -36
  75. package/decorator/index.d.ts +5 -3
  76. package/decorator/index.d.ts.map +1 -1
  77. package/decorator/index.js +13 -9
  78. package/decorator/post.d.ts +2 -2
  79. package/decorator/post.js +36 -36
  80. package/decorator/put.d.ts +3 -0
  81. package/decorator/put.d.ts.map +1 -0
  82. package/decorator/put.js +36 -0
  83. package/filters/AccessControl.d.ts +12 -12
  84. package/filters/AccessControl.d.ts.map +1 -1
  85. package/filters/AccessControl.js +83 -86
  86. package/filters/AccessRule.d.ts +82 -82
  87. package/filters/AccessRule.d.ts.map +1 -1
  88. package/filters/AccessRule.js +136 -140
  89. package/filters/auth/AuthInterface.d.ts +25 -25
  90. package/filters/auth/AuthInterface.js +2 -2
  91. package/filters/auth/AuthMethod.d.ts +37 -37
  92. package/filters/auth/AuthMethod.js +82 -82
  93. package/filters/auth/HttpBasicAuth.d.ts +22 -22
  94. package/filters/auth/HttpBasicAuth.js +72 -72
  95. package/filters/auth/HttpBearerAuth.d.ts +17 -17
  96. package/filters/auth/HttpBearerAuth.js +32 -32
  97. package/filters/auth/HttpHeaderAuth.d.ts +14 -14
  98. package/filters/auth/HttpHeaderAuth.js +57 -60
  99. package/filters/auth/JwtHttpBearerAuth.d.ts +20 -20
  100. package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -1
  101. package/filters/auth/JwtHttpBearerAuth.js +87 -81
  102. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +22 -22
  103. package/filters/auth/KeyCloakHttpBearerAuth.js +116 -116
  104. package/filters/auth/index.d.ts +4 -4
  105. package/filters/auth/index.js +11 -11
  106. package/filters/index.d.ts +2 -2
  107. package/filters/index.js +7 -7
  108. package/index.d.ts +21 -16
  109. package/index.d.ts.map +1 -1
  110. package/index.js +61 -71
  111. package/model/RouteDefinition.d.ts +6 -6
  112. package/model/RouteDefinition.js +8 -8
  113. package/package.json +22 -26
  114. package/rbac/AuthAssignment.d.ts +18 -18
  115. package/rbac/AuthAssignment.js +44 -44
  116. package/rbac/AuthItem.d.ts +26 -26
  117. package/rbac/AuthItem.js +51 -51
  118. package/rbac/AuthItemChild.d.ts +18 -18
  119. package/rbac/AuthItemChild.js +43 -43
  120. package/rbac/AuthManager.d.ts +111 -111
  121. package/rbac/AuthManager.d.ts.map +1 -1
  122. package/rbac/AuthManager.js +357 -358
  123. package/requiments/Glob.d.ts +2 -2
  124. package/requiments/Glob.js +10 -10
  125. package/requiments/ReflectUtil.js +24 -24
  126. package/requiments/Utils.d.ts +8 -2
  127. package/requiments/Utils.d.ts.map +1 -1
  128. package/requiments/Utils.js +125 -110
  129. package/validators/BooleanValidator.js +1 -1
  130. package/validators/CompareValidator.js +1 -1
  131. package/validators/DateValidator.js +1 -1
  132. package/validators/EmailValidator.js +1 -1
  133. package/validators/Validator.d.ts +17 -17
  134. package/validators/Validator.js +27 -27
  135. package/web/IdentityInterface.d.ts +54 -54
  136. package/web/IdentityInterface.d.ts.map +1 -1
  137. package/web/IdentityInterface.js +8 -8
  138. package/web/WebUser.d.ts +71 -71
  139. package/web/WebUser.js +165 -165
  140. package/base/Logger.d.ts +0 -18
  141. package/base/Logger.d.ts.map +0 -1
  142. package/base/Logger.js +0 -49
package/package.json CHANGED
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": "2.0.0-rc.3",
4
- "main":"./index.js",
5
- "type": "./index.d.ts",
3
+ "version": "2.0.0-rc.30",
6
4
  "description": "Nodejs Micro service Framework",
7
5
  "scripts": {
8
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -18,42 +16,40 @@
18
16
  "url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
19
17
  },
20
18
  "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
21
- "resolutions": {
22
- "ts-node": "^10.2.0"
23
- },
24
19
  "dependencies": {
25
- "axios": "^0.23.0",
20
+ "axios": "^1.3.5",
26
21
  "babel-plugin-transform-decorators-legacy": "^1.3.5",
27
- "body-parser": "^1.19.0",
22
+ "body-parser": "^1.20.2",
28
23
  "compression": "^1.7.4",
29
- "core-js": "^3.24.1",
24
+ "core-js": "^3.30.1",
25
+ "cors": "^2.8.5",
26
+ "dayjs": "^1.11.7",
30
27
  "dotenv-flow": "^3.2.0",
31
- "express": "^4.17.1",
32
- "express-session": "^1.17.2",
33
- "glob": "^7.1.7",
34
- "ip": "^1.1.5",
35
- "jsonwebtoken": "^8.5.1",
28
+ "express": "^4.18.2",
29
+ "express-session": "^1.17.3",
30
+ "glob": "^10.0.0",
31
+ "ip": "^1.1.8",
32
+ "jsonwebtoken": "^9.0.0",
36
33
  "lodash": "^4.17.21",
37
- "log4js": "^6.3.0",
34
+ "log4js": "^6.9.1",
38
35
  "method-override": "^3.0.0",
39
- "passport": "^0.4.1",
40
- "pg": "^8.7.1",
36
+ "passport": "^0.6.0",
37
+ "pg": "^8.10.0",
41
38
  "pg-hstore": "^2.3.4",
42
39
  "reflect-metadata": "^0.1.13",
43
- "sequelize": "^6.6.5",
40
+ "sequelize": "^6.31.0",
44
41
  "sequelize-transparent-cache": "^2.3.0",
45
- "tslib": "^2.4.0",
42
+ "tslib": "^2.5.0",
46
43
  "validate.js": "^0.13.1"
47
44
  },
48
45
  "devDependencies": {
49
- "@types/validator": "^13.6.3",
50
- "@types/express": "^4.17.13",
51
- "@types/node": "^18.6.5",
52
- "nodemon": "^2.0.19",
46
+ "@types/express": "^4.17.17",
47
+ "@types/node": "^18.15.11",
48
+ "@types/validator": "^13.7.15",
49
+ "nodemon": "^2.0.22",
53
50
  "ts-node": "^10.9.1",
54
- "typescript": "^4.7.4"
55
- },
56
-
51
+ "typescript": "^5.0.4"
52
+ } ,
57
53
  "keywords": [
58
54
  "Framework",
59
55
  "RespAPI",
@@ -1,19 +1,19 @@
1
- import { DataTypes, Model, Relation } from "../base";
2
- export declare class AuthAssignmentClass extends Model {
3
- [x: string]: any;
4
- tableName(): string;
5
- attributes(): {
6
- item_name: {
7
- type: DataTypes.StringDataTypeConstructor;
8
- primaryKey: boolean;
9
- allowNull: boolean;
10
- };
11
- user_id: {
12
- type: DataTypes.StringDataTypeConstructor;
13
- allowNull: boolean;
14
- };
15
- };
16
- init(): void;
17
- relations(): Relation[];
18
- }
1
+ import { DataTypes, Model, Relation } from "../base";
2
+ export declare class AuthAssignmentClass extends Model {
3
+ [x: string]: any;
4
+ tableName(): string;
5
+ attributes(): {
6
+ item_name: {
7
+ type: DataTypes.StringDataTypeConstructor;
8
+ primaryKey: boolean;
9
+ allowNull: boolean;
10
+ };
11
+ user_id: {
12
+ type: DataTypes.StringDataTypeConstructor;
13
+ allowNull: boolean;
14
+ };
15
+ };
16
+ init(): void;
17
+ relations(): Relation[];
18
+ }
19
19
  //# sourceMappingURL=AuthAssignment.d.ts.map
@@ -1,44 +1,44 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
4
- * Author: Cihan Ozturk
5
- * E-mail: cihan@chy.com.tr
6
- * Github:https://github.com/cihan53/
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AuthAssignmentClass = void 0;
10
- const base_1 = require("../base");
11
- class AuthAssignmentClass extends base_1.Model {
12
- tableName() {
13
- return 'auth_assignment';
14
- }
15
- attributes() {
16
- return {
17
- // Model attributes are defined here
18
- item_name: {
19
- type: base_1.DataTypes.STRING,
20
- primaryKey: true,
21
- allowNull: false
22
- },
23
- user_id: {
24
- type: base_1.DataTypes.STRING,
25
- allowNull: false
26
- }
27
- };
28
- }
29
- init() {
30
- super.init();
31
- this.model().removeAttribute('id');
32
- }
33
- relations() {
34
- return [
35
- {
36
- type: "hasMany",
37
- foreignKey: "name",
38
- sourceKey: 'item_name',
39
- model: base_1.ModelManager.AuthItem.model()
40
- }
41
- ];
42
- }
43
- }
44
- exports.AuthAssignmentClass = AuthAssignmentClass;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2021. Chy Bilgisayar Bilisim
4
+ * Author: Cihan Ozturk
5
+ * E-mail: cihan@chy.com.tr
6
+ * Github:https://github.com/cihan53/
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AuthAssignmentClass = void 0;
10
+ const base_1 = require("../base");
11
+ class AuthAssignmentClass extends base_1.Model {
12
+ tableName() {
13
+ return 'auth_assignment';
14
+ }
15
+ attributes() {
16
+ return {
17
+ // Model attributes are defined here
18
+ item_name: {
19
+ type: base_1.DataTypes.STRING,
20
+ primaryKey: true,
21
+ allowNull: false
22
+ },
23
+ user_id: {
24
+ type: base_1.DataTypes.STRING,
25
+ allowNull: false
26
+ }
27
+ };
28
+ }
29
+ init() {
30
+ super.init();
31
+ this.model().removeAttribute('id');
32
+ }
33
+ relations() {
34
+ return [
35
+ {
36
+ type: "hasMany",
37
+ foreignKey: "name",
38
+ sourceKey: 'item_name',
39
+ model: base_1.ModelManager.AuthItem.model()
40
+ }
41
+ ];
42
+ }
43
+ }
44
+ exports.AuthAssignmentClass = AuthAssignmentClass;
@@ -1,27 +1,27 @@
1
- import { DataTypes, Model, Relation } from "../base";
2
- export declare class AuthItemClass extends Model {
3
- [x: string]: any;
4
- tableName(): string;
5
- attributes(): {
6
- name: {
7
- type: DataTypes.StringDataTypeConstructor;
8
- primaryKey: boolean;
9
- allowNull: boolean;
10
- };
11
- type: {
12
- type: DataTypes.IntegerDataTypeConstructor;
13
- allowNull: boolean;
14
- };
15
- description: {
16
- type: DataTypes.StringDataTypeConstructor;
17
- allowNull: boolean;
18
- };
19
- rule_name: {
20
- type: DataTypes.StringDataTypeConstructor;
21
- allowNull: boolean;
22
- };
23
- };
24
- init(): void;
25
- relations(): Relation[];
26
- }
1
+ import { DataTypes, Model, Relation } from "../base";
2
+ export declare class AuthItemClass extends Model {
3
+ [x: string]: any;
4
+ tableName(): string;
5
+ attributes(): {
6
+ name: {
7
+ type: DataTypes.StringDataTypeConstructor;
8
+ primaryKey: boolean;
9
+ allowNull: boolean;
10
+ };
11
+ type: {
12
+ type: DataTypes.IntegerDataTypeConstructor;
13
+ allowNull: boolean;
14
+ };
15
+ description: {
16
+ type: DataTypes.StringDataTypeConstructor;
17
+ allowNull: boolean;
18
+ };
19
+ rule_name: {
20
+ type: DataTypes.StringDataTypeConstructor;
21
+ allowNull: boolean;
22
+ };
23
+ };
24
+ init(): void;
25
+ relations(): Relation[];
26
+ }
27
27
  //# sourceMappingURL=AuthItem.d.ts.map
package/rbac/AuthItem.js CHANGED
@@ -1,51 +1,51 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
4
- * Author: Cihan Ozturk
5
- * E-mail: cihan@chy.com.tr
6
- * Github:https://github.com/cihan53/
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AuthItemClass = void 0;
10
- const base_1 = require("../base");
11
- class AuthItemClass extends base_1.Model {
12
- tableName() {
13
- return 'auth_item';
14
- }
15
- attributes() {
16
- return {
17
- // Model attributes are defined here
18
- name: {
19
- type: base_1.DataTypes.STRING,
20
- primaryKey: true,
21
- allowNull: false
22
- },
23
- type: {
24
- type: base_1.DataTypes.INTEGER,
25
- allowNull: false
26
- },
27
- description: {
28
- type: base_1.DataTypes.STRING,
29
- allowNull: false
30
- },
31
- rule_name: {
32
- type: base_1.DataTypes.STRING,
33
- allowNull: false
34
- }
35
- };
36
- }
37
- init() {
38
- super.init();
39
- this.model().removeAttribute('id');
40
- }
41
- relations() {
42
- return [
43
- {
44
- type: "hasOne",
45
- foreignKey: "item_name",
46
- model: base_1.ModelManager.AuthAssignment.model()
47
- }
48
- ];
49
- }
50
- }
51
- exports.AuthItemClass = AuthItemClass;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2021. Chy Bilgisayar Bilisim
4
+ * Author: Cihan Ozturk
5
+ * E-mail: cihan@chy.com.tr
6
+ * Github:https://github.com/cihan53/
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AuthItemClass = void 0;
10
+ const base_1 = require("../base");
11
+ class AuthItemClass extends base_1.Model {
12
+ tableName() {
13
+ return 'auth_item';
14
+ }
15
+ attributes() {
16
+ return {
17
+ // Model attributes are defined here
18
+ name: {
19
+ type: base_1.DataTypes.STRING,
20
+ primaryKey: true,
21
+ allowNull: false
22
+ },
23
+ type: {
24
+ type: base_1.DataTypes.INTEGER,
25
+ allowNull: false
26
+ },
27
+ description: {
28
+ type: base_1.DataTypes.STRING,
29
+ allowNull: false
30
+ },
31
+ rule_name: {
32
+ type: base_1.DataTypes.STRING,
33
+ allowNull: false
34
+ }
35
+ };
36
+ }
37
+ init() {
38
+ super.init();
39
+ this.model().removeAttribute('id');
40
+ }
41
+ relations() {
42
+ return [
43
+ {
44
+ type: "hasOne",
45
+ foreignKey: "item_name",
46
+ model: base_1.ModelManager.AuthAssignment.model()
47
+ }
48
+ ];
49
+ }
50
+ }
51
+ exports.AuthItemClass = AuthItemClass;
@@ -1,19 +1,19 @@
1
- import { DataTypes, Model, Relation } from "../base";
2
- export declare class AuthItemChildClass extends Model {
3
- [x: string]: any;
4
- tableName(): string;
5
- attributes(): {
6
- parent: {
7
- type: DataTypes.StringDataTypeConstructor;
8
- primaryKey: boolean;
9
- allowNull: boolean;
10
- };
11
- child: {
12
- type: DataTypes.StringDataTypeConstructor;
13
- allowNull: boolean;
14
- };
15
- };
16
- init(): void;
17
- relations(): Relation[];
18
- }
1
+ import { DataTypes, Model, Relation } from "../base";
2
+ export declare class AuthItemChildClass extends Model {
3
+ [x: string]: any;
4
+ tableName(): string;
5
+ attributes(): {
6
+ parent: {
7
+ type: DataTypes.StringDataTypeConstructor;
8
+ primaryKey: boolean;
9
+ allowNull: boolean;
10
+ };
11
+ child: {
12
+ type: DataTypes.StringDataTypeConstructor;
13
+ allowNull: boolean;
14
+ };
15
+ };
16
+ init(): void;
17
+ relations(): Relation[];
18
+ }
19
19
  //# sourceMappingURL=AuthItemChild.d.ts.map
@@ -1,43 +1,43 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
4
- * Author: Cihan Ozturk
5
- * E-mail: cihan@chy.com.tr
6
- * Github:https://github.com/cihan53/
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AuthItemChildClass = void 0;
10
- const base_1 = require("../base");
11
- class AuthItemChildClass extends base_1.Model {
12
- tableName() {
13
- return 'auth_item_child';
14
- }
15
- attributes() {
16
- return {
17
- // Model attributes are defined here
18
- parent: {
19
- type: base_1.DataTypes.STRING,
20
- primaryKey: true,
21
- allowNull: false
22
- },
23
- child: {
24
- type: base_1.DataTypes.STRING,
25
- allowNull: false
26
- }
27
- };
28
- }
29
- init() {
30
- super.init();
31
- this.model().removeAttribute('id');
32
- }
33
- relations() {
34
- return [
35
- {
36
- type: "hasOne",
37
- foreignKey: "item_name",
38
- model: base_1.ModelManager.AuthAssignment.model()
39
- }
40
- ];
41
- }
42
- }
43
- exports.AuthItemChildClass = AuthItemChildClass;
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2021. Chy Bilgisayar Bilisim
4
+ * Author: Cihan Ozturk
5
+ * E-mail: cihan@chy.com.tr
6
+ * Github:https://github.com/cihan53/
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AuthItemChildClass = void 0;
10
+ const base_1 = require("../base");
11
+ class AuthItemChildClass extends base_1.Model {
12
+ tableName() {
13
+ return 'auth_item_child';
14
+ }
15
+ attributes() {
16
+ return {
17
+ // Model attributes are defined here
18
+ parent: {
19
+ type: base_1.DataTypes.STRING,
20
+ primaryKey: true,
21
+ allowNull: false
22
+ },
23
+ child: {
24
+ type: base_1.DataTypes.STRING,
25
+ allowNull: false
26
+ }
27
+ };
28
+ }
29
+ init() {
30
+ super.init();
31
+ this.model().removeAttribute('id');
32
+ }
33
+ relations() {
34
+ return [
35
+ {
36
+ type: "hasOne",
37
+ foreignKey: "item_name",
38
+ model: base_1.ModelManager.AuthAssignment.model()
39
+ }
40
+ ];
41
+ }
42
+ }
43
+ exports.AuthItemChildClass = AuthItemChildClass;