chyz 2.0.0-rc.8 → 2.0.1-rc.1

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 (153) hide show
  1. package/BaseChyz.d.ts +73 -56
  2. package/BaseChyz.d.ts.map +1 -1
  3. package/BaseChyz.js +569 -404
  4. package/README.md +1 -1
  5. package/base/ActionFilter.d.ts +32 -32
  6. package/base/ActionFilter.d.ts.map +1 -1
  7. package/base/ActionFilter.js +82 -82
  8. package/base/BadRequestHttpException.d.ts +6 -0
  9. package/base/BadRequestHttpException.d.ts.map +1 -0
  10. package/base/BadRequestHttpException.js +17 -0
  11. package/base/BaseError.d.ts +43 -10
  12. package/base/BaseError.d.ts.map +1 -1
  13. package/base/BaseError.js +58 -26
  14. package/base/Behavior.d.ts +3 -3
  15. package/base/Behavior.js +7 -7
  16. package/base/CBaseObject.d.ts +4 -4
  17. package/base/CBaseObject.d.ts.map +1 -1
  18. package/base/CBaseObject.js +16 -16
  19. package/base/CEvents.d.ts +13 -0
  20. package/base/CEvents.d.ts.map +1 -0
  21. package/base/CEvents.js +24 -0
  22. package/base/CRequest.d.ts +1 -1
  23. package/base/CRequest.js +10 -10
  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 -57
  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.d.ts.map +1 -1
  34. package/base/DataErrorDbException.js +17 -17
  35. package/base/DbConnection.d.ts +12 -12
  36. package/base/DbConnection.js +53 -53
  37. package/base/ForbiddenHttpException.d.ts +4 -4
  38. package/base/ForbiddenHttpException.d.ts.map +1 -1
  39. package/base/ForbiddenHttpException.js +16 -16
  40. package/base/InvalidArgumentException.d.ts +5 -5
  41. package/base/InvalidArgumentException.d.ts.map +1 -1
  42. package/base/InvalidArgumentException.js +17 -17
  43. package/base/InvalidConfigException.d.ts +5 -5
  44. package/base/InvalidConfigException.d.ts.map +1 -1
  45. package/base/InvalidConfigException.js +17 -17
  46. package/base/Logs.d.ts +21 -21
  47. package/base/Logs.d.ts.map +1 -1
  48. package/base/Logs.js +57 -57
  49. package/base/Model.d.ts +301 -298
  50. package/base/Model.d.ts.map +1 -1
  51. package/base/Model.js +545 -507
  52. package/base/ModelManager.d.ts +1 -1
  53. package/base/ModelManager.js +19 -19
  54. package/base/NotFoundHttpException.d.ts +5 -5
  55. package/base/NotFoundHttpException.d.ts.map +1 -1
  56. package/base/NotFoundHttpException.js +17 -17
  57. package/base/RestClient.d.ts +6 -6
  58. package/base/RestClient.d.ts.map +1 -1
  59. package/base/RestClient.js +25 -25
  60. package/base/UnauthorizedHttpException.d.ts +5 -5
  61. package/base/UnauthorizedHttpException.d.ts.map +1 -1
  62. package/base/UnauthorizedHttpException.js +17 -17
  63. package/base/ValidationHttpException.d.ts +5 -5
  64. package/base/ValidationHttpException.d.ts.map +1 -1
  65. package/base/ValidationHttpException.js +17 -17
  66. package/base/db/Exception.d.ts +6 -6
  67. package/base/db/Exception.js +15 -15
  68. package/base/index.d.ts +19 -18
  69. package/base/index.d.ts.map +1 -1
  70. package/base/index.js +41 -39
  71. package/decorator/Middleware.d.ts +3 -3
  72. package/decorator/Middleware.js +11 -11
  73. package/decorator/controller.d.ts +2 -2
  74. package/decorator/controller.js +24 -24
  75. package/decorator/delete.d.ts +3 -0
  76. package/decorator/delete.d.ts.map +1 -0
  77. package/decorator/delete.js +36 -0
  78. package/decorator/enums/ControllerDecoratorParams.d.ts +5 -5
  79. package/decorator/enums/ControllerDecoratorParams.js +9 -9
  80. package/decorator/get.d.ts +2 -2
  81. package/decorator/get.js +36 -36
  82. package/decorator/index.d.ts +5 -3
  83. package/decorator/index.d.ts.map +1 -1
  84. package/decorator/index.js +13 -9
  85. package/decorator/post.d.ts +2 -2
  86. package/decorator/post.js +36 -36
  87. package/decorator/put.d.ts +3 -0
  88. package/decorator/put.d.ts.map +1 -0
  89. package/decorator/put.js +36 -0
  90. package/filters/AccessControl.d.ts +12 -12
  91. package/filters/AccessControl.d.ts.map +1 -1
  92. package/filters/AccessControl.js +83 -83
  93. package/filters/AccessRule.d.ts +82 -82
  94. package/filters/AccessRule.d.ts.map +1 -1
  95. package/filters/AccessRule.js +136 -137
  96. package/filters/auth/AuthInterface.d.ts +25 -25
  97. package/filters/auth/AuthInterface.js +2 -2
  98. package/filters/auth/AuthMethod.d.ts +37 -37
  99. package/filters/auth/AuthMethod.d.ts.map +1 -1
  100. package/filters/auth/AuthMethod.js +82 -82
  101. package/filters/auth/HttpBasicAuth.d.ts +23 -22
  102. package/filters/auth/HttpBasicAuth.d.ts.map +1 -1
  103. package/filters/auth/HttpBasicAuth.js +78 -72
  104. package/filters/auth/HttpBearerAuth.d.ts +17 -17
  105. package/filters/auth/HttpBearerAuth.d.ts.map +1 -1
  106. package/filters/auth/HttpBearerAuth.js +33 -32
  107. package/filters/auth/HttpHeaderAuth.d.ts +18 -14
  108. package/filters/auth/HttpHeaderAuth.d.ts.map +1 -1
  109. package/filters/auth/HttpHeaderAuth.js +64 -57
  110. package/filters/auth/JwtHttpBearerAuth.d.ts +20 -20
  111. package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -1
  112. package/filters/auth/JwtHttpBearerAuth.js +87 -81
  113. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +22 -22
  114. package/filters/auth/KeyCloakHttpBearerAuth.js +116 -116
  115. package/filters/auth/index.d.ts +4 -4
  116. package/filters/auth/index.js +11 -11
  117. package/filters/index.d.ts +2 -2
  118. package/filters/index.js +7 -7
  119. package/index.d.ts +28 -21
  120. package/index.d.ts.map +1 -1
  121. package/index.js +71 -60
  122. package/model/RouteDefinition.d.ts +6 -6
  123. package/model/RouteDefinition.js +8 -8
  124. package/package.json +22 -24
  125. package/rbac/AuthAssignment.d.ts +18 -18
  126. package/rbac/AuthAssignment.js +44 -44
  127. package/rbac/AuthItem.d.ts +26 -26
  128. package/rbac/AuthItem.js +51 -51
  129. package/rbac/AuthItemChild.d.ts +18 -18
  130. package/rbac/AuthItemChild.js +43 -43
  131. package/rbac/AuthManager.d.ts +111 -111
  132. package/rbac/AuthManager.d.ts.map +1 -1
  133. package/rbac/AuthManager.js +356 -355
  134. package/rbac/index.d.ts +5 -0
  135. package/rbac/index.d.ts.map +1 -0
  136. package/rbac/index.js +28 -0
  137. package/requiments/Glob.d.ts +2 -2
  138. package/requiments/Glob.js +10 -10
  139. package/requiments/ReflectUtil.js +24 -24
  140. package/requiments/Utils.d.ts +1 -8
  141. package/requiments/Utils.d.ts.map +1 -1
  142. package/requiments/Utils.js +115 -112
  143. package/validators/BooleanValidator.js +1 -1
  144. package/validators/CompareValidator.js +1 -1
  145. package/validators/DateValidator.js +1 -1
  146. package/validators/EmailValidator.js +1 -1
  147. package/validators/Validator.d.ts +17 -17
  148. package/validators/Validator.js +27 -27
  149. package/web/IdentityInterface.d.ts +55 -54
  150. package/web/IdentityInterface.d.ts.map +1 -1
  151. package/web/IdentityInterface.js +8 -8
  152. package/web/WebUser.d.ts +71 -71
  153. package/web/WebUser.js +165 -165
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": "2.0.0-rc.8",
3
+ "version": "2.0.1-rc.1",
4
4
  "description": "Nodejs Micro service Framework",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -16,42 +16,40 @@
16
16
  "url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
17
17
  },
18
18
  "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
19
- "resolutions": {
20
- "ts-node": "^10.2.0"
21
- },
22
19
  "dependencies": {
23
- "axios": "^0.23.0",
20
+ "axios": "^1.3.5",
24
21
  "babel-plugin-transform-decorators-legacy": "^1.3.5",
25
- "body-parser": "^1.19.0",
22
+ "body-parser": "^1.20.2",
26
23
  "compression": "^1.7.4",
27
- "core-js": "^3.24.1",
24
+ "core-js": "^3.30.1",
25
+ "cors": "^2.8.5",
26
+ "dayjs": "^1.11.7",
28
27
  "dotenv-flow": "^3.2.0",
29
- "express": "^4.17.1",
30
- "express-session": "^1.17.2",
31
- "glob": "^7.1.7",
32
- "ip": "^1.1.5",
33
- "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",
34
33
  "lodash": "^4.17.21",
35
- "log4js": "^6.3.0",
34
+ "log4js": "^6.9.1",
36
35
  "method-override": "^3.0.0",
37
- "passport": "^0.4.1",
38
- "pg": "^8.7.1",
36
+ "passport": "^0.6.0",
37
+ "pg": "^8.10.0",
39
38
  "pg-hstore": "^2.3.4",
40
39
  "reflect-metadata": "^0.1.13",
41
- "sequelize": "^6.6.5",
40
+ "sequelize": "^6.31.0",
42
41
  "sequelize-transparent-cache": "^2.3.0",
43
- "tslib": "^2.4.0",
42
+ "tslib": "^2.5.0",
44
43
  "validate.js": "^0.13.1"
45
44
  },
46
45
  "devDependencies": {
47
- "@types/validator": "^13.6.3",
48
- "@types/express": "^4.17.13",
49
- "@types/node": "^18.6.5",
50
- "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",
51
50
  "ts-node": "^10.9.1",
52
- "typescript": "^4.7.4"
53
- },
54
-
51
+ "typescript": "^5.0.4"
52
+ } ,
55
53
  "keywords": [
56
54
  "Framework",
57
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;