chyz 1.0.13-rc.19 → 1.0.13-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.
Files changed (211) hide show
  1. package/{dist/BaseChyz.js → BaseChyz.js} +8 -46
  2. package/BaseChyz.js.map +1 -0
  3. package/{dist/Chyz.js → Chyz.js} +0 -0
  4. package/{dist/Chyz.js.map → Chyz.js.map} +0 -0
  5. package/README.md +16 -267
  6. package/{dist/base → base}/ActionFilter.js +1 -1
  7. package/{dist/base → base}/ActionFilter.js.map +1 -1
  8. package/{dist/base → base}/BaseError.js +1 -5
  9. package/base/BaseError.js.map +1 -0
  10. package/{dist/base → base}/BaseObject.js +0 -0
  11. package/{dist/base → base}/BaseObject.js.map +0 -0
  12. package/{dist/base → base}/Behavior.js +0 -0
  13. package/{dist/base → base}/Behavior.js.map +0 -0
  14. package/{dist/base → base}/Component.js +0 -0
  15. package/{dist/base → base}/Component.js.map +0 -0
  16. package/{dist/base → base}/Configurable.js +0 -0
  17. package/{dist/base → base}/Configurable.js.map +0 -0
  18. package/{dist/base → base}/Controller.js +0 -0
  19. package/{dist/base → base}/Controller.js.map +0 -0
  20. package/{dist/base → base}/DataErrorDbException.js +0 -0
  21. package/{dist/base → base}/DataErrorDbException.js.map +0 -0
  22. package/{dist/base → base}/DbConnection.js +0 -0
  23. package/{dist/base → base}/DbConnection.js.map +0 -0
  24. package/{dist/base → base}/ForbiddenHttpException.js +0 -0
  25. package/{dist/base → base}/ForbiddenHttpException.js.map +0 -0
  26. package/{dist/base → base}/InvalidConfigException.js +0 -0
  27. package/{dist/base → base}/InvalidConfigException.js.map +0 -0
  28. package/{dist/base → base}/Model.js +30 -37
  29. package/base/Model.js.map +1 -0
  30. package/{dist/base → base}/NotFoundHttpException.js +0 -0
  31. package/{dist/base → base}/NotFoundHttpException.js.map +0 -0
  32. package/{dist/base → base}/RestClient.js +4 -4
  33. package/base/RestClient.js.map +1 -0
  34. package/{dist/base → base}/UnauthorizedHttpException.js +0 -0
  35. package/{dist/base → base}/UnauthorizedHttpException.js.map +0 -0
  36. package/{dist/base → base}/ValidationHttpException.js +1 -1
  37. package/{dist/base → base}/ValidationHttpException.js.map +0 -0
  38. package/{dist/base → base}/db/Exception.js +0 -0
  39. package/{dist/base → base}/db/Exception.js.map +0 -0
  40. package/{dist/base → base}/index.js +0 -2
  41. package/{dist/base → base}/index.js.map +1 -1
  42. package/{dist/decorator → decorator}/Middleware.js +0 -0
  43. package/{dist/decorator → decorator}/Middleware.js.map +0 -0
  44. package/{dist/decorator → decorator}/controller.js +0 -0
  45. package/{dist/decorator → decorator}/controller.js.map +0 -0
  46. package/{dist/decorator → decorator}/enums/ControllerDecoratorParams.js +0 -0
  47. package/{dist/decorator → decorator}/enums/ControllerDecoratorParams.js.map +0 -0
  48. package/{dist/decorator → decorator}/get.js +0 -0
  49. package/{dist/decorator → decorator}/get.js.map +0 -0
  50. package/{dist/decorator → decorator}/index.js +0 -0
  51. package/{dist/decorator → decorator}/index.js.map +0 -0
  52. package/{dist/decorator → decorator}/post.js +0 -0
  53. package/{dist/decorator → decorator}/post.js.map +0 -0
  54. package/{dist/filters → filters}/AccessControl.js +3 -15
  55. package/filters/AccessControl.js.map +1 -0
  56. package/filters/AccessRule.js +79 -0
  57. package/filters/AccessRule.js.map +1 -0
  58. package/{dist/filters → filters}/auth/AuthInterface.js +0 -0
  59. package/{dist/filters → filters}/auth/AuthInterface.js.map +0 -0
  60. package/{dist/filters → filters}/auth/AuthMethod.js +0 -0
  61. package/{dist/filters → filters}/auth/AuthMethod.js.map +0 -0
  62. package/{requiments/Glob.ts → filters/auth/HttpBasicAuth.js} +2 -3
  63. package/filters/auth/HttpBasicAuth.js.map +1 -0
  64. package/{dist/filters → filters}/auth/HttpBearerAuth.js +0 -0
  65. package/{dist/filters → filters}/auth/HttpBearerAuth.js.map +0 -0
  66. package/{dist/filters → filters}/auth/HttpHeaderAuth.js +0 -0
  67. package/{dist/filters → filters}/auth/HttpHeaderAuth.js.map +0 -0
  68. package/{dist/filters → filters}/auth/JwtHttpBearerAuth.js +1 -1
  69. package/filters/auth/JwtHttpBearerAuth.js.map +1 -0
  70. package/{dist/filters → filters}/auth/KeyCloakHttpBearerAuth.js +0 -0
  71. package/{dist/filters → filters}/auth/KeyCloakHttpBearerAuth.js.map +0 -0
  72. package/{dist/filters → filters}/auth/index.js +0 -1
  73. package/{dist/filters → filters}/auth/index.js.map +1 -1
  74. package/{dist/filters → filters}/index.js +0 -0
  75. package/{dist/filters → filters}/index.js.map +0 -0
  76. package/{dist/index.js → index.js} +0 -0
  77. package/{dist/index.js.map → index.js.map} +0 -0
  78. package/{dist/model → model}/RouteDefinition.js +0 -0
  79. package/{dist/model → model}/RouteDefinition.js.map +0 -0
  80. package/package.json +7 -6
  81. package/{dist/requiments → requiments}/Glob.js +0 -0
  82. package/{dist/requiments → requiments}/Glob.js.map +0 -0
  83. package/{dist/requiments → requiments}/ReflectUtil.js +0 -0
  84. package/{dist/requiments → requiments}/ReflectUtil.js.map +0 -0
  85. package/{dist/requiments → requiments}/Utils.js +0 -0
  86. package/{dist/requiments → requiments}/Utils.js.map +0 -0
  87. package/{dist/validators → validators}/BooleanValidator.js +0 -0
  88. package/{dist/validators → validators}/BooleanValidator.js.map +0 -0
  89. package/{dist/validators → validators}/CompareValidator.js +0 -0
  90. package/{dist/validators → validators}/CompareValidator.js.map +0 -0
  91. package/{dist/validators → validators}/DateValidator.js +0 -0
  92. package/{dist/validators → validators}/DateValidator.js.map +0 -0
  93. package/{dist/validators → validators}/EmailValidator.js +0 -0
  94. package/{dist/validators → validators}/EmailValidator.js.map +0 -0
  95. package/{dist/validators → validators}/Validator.js +0 -0
  96. package/{dist/validators → validators}/Validator.js.map +0 -0
  97. package/{dist/web → web}/IdentityInterface.js +0 -0
  98. package/{dist/web → web}/IdentityInterface.js.map +0 -0
  99. package/web/WebUser.js +88 -0
  100. package/web/WebUser.js.map +1 -0
  101. package/BaseChyz.ts +0 -399
  102. package/Chyz.ts +0 -11
  103. package/Doc/Moel kullanma.md +0 -13
  104. package/Examples/Controllers/ApiController.ts +0 -140
  105. package/Examples/Controllers/BasicApiController.ts +0 -121
  106. package/Examples/Controllers/KeyCloakController.ts +0 -100
  107. package/Examples/Controllers/PublicController.ts +0 -42
  108. package/Examples/Controllers/SiteController.ts +0 -149
  109. package/Examples/Models/AuthAssignment.ts +0 -50
  110. package/Examples/Models/AuthItem.ts +0 -59
  111. package/Examples/Models/AuthItemChild.ts +0 -49
  112. package/Examples/Models/Categories.ts +0 -47
  113. package/Examples/Models/Customer.ts +0 -115
  114. package/Examples/Models/KeycloakUser.ts +0 -70
  115. package/Examples/Models/Order.ts +0 -64
  116. package/Examples/Models/OrderItem.ts +0 -27
  117. package/Examples/Models/ProductModels.ts +0 -49
  118. package/Examples/Models/ProductToCategories.ts +0 -46
  119. package/Examples/Models/Products.ts +0 -50
  120. package/Examples/Models/Stocks.ts +0 -60
  121. package/Examples/Models/User.ts +0 -107
  122. package/Examples/Models/UserPermission.ts +0 -37
  123. package/Examples/Models/index.ts +0 -19
  124. package/Examples/index-keycloack.ts +0 -78
  125. package/Examples/index.ts +0 -45
  126. package/Examples/keycloak.json +0 -7
  127. package/Examples/log/access.log +0 -0
  128. package/Examples/log/app.log +0 -10379
  129. package/Examples/log/errors.log +0 -1984
  130. package/Examples/package.json +0 -46
  131. package/Examples/tsconfig.json +0 -21
  132. package/base/ActionFilter.ts +0 -71
  133. package/base/BaseError.ts +0 -28
  134. package/base/BaseObject.ts +0 -19
  135. package/base/Behavior.ts +0 -6
  136. package/base/Component.ts +0 -66
  137. package/base/Configurable.ts +0 -10
  138. package/base/Controller.ts +0 -84
  139. package/base/DataErrorDbException.ts +0 -16
  140. package/base/DbConnection.ts +0 -51
  141. package/base/ForbiddenHttpException.ts +0 -15
  142. package/base/InvalidArgumentException.ts +0 -16
  143. package/base/InvalidConfigException.ts +0 -16
  144. package/base/Model.ts +0 -363
  145. package/base/ModelManager.ts +0 -19
  146. package/base/NotFoundHttpException.ts +0 -14
  147. package/base/RestClient.ts +0 -28
  148. package/base/UnauthorizedHttpException.ts +0 -17
  149. package/base/ValidationHttpException.ts +0 -14
  150. package/base/db/Exception.ts +0 -14
  151. package/base/index.ts +0 -18
  152. package/decorator/Middleware.ts +0 -9
  153. package/decorator/controller.ts +0 -22
  154. package/decorator/enums/ControllerDecoratorParams.ts +0 -5
  155. package/decorator/get.ts +0 -37
  156. package/decorator/index.ts +0 -3
  157. package/decorator/post.ts +0 -36
  158. package/dist/BaseChyz.js.map +0 -1
  159. package/dist/base/BaseError.js.map +0 -1
  160. package/dist/base/InvalidArgumentException.js +0 -18
  161. package/dist/base/InvalidArgumentException.js.map +0 -1
  162. package/dist/base/Model.js.map +0 -1
  163. package/dist/base/ModelManager.js +0 -9
  164. package/dist/base/ModelManager.js.map +0 -1
  165. package/dist/base/RestClient.js.map +0 -1
  166. package/dist/filters/AccessControl.js.map +0 -1
  167. package/dist/filters/AccessRule.js +0 -140
  168. package/dist/filters/AccessRule.js.map +0 -1
  169. package/dist/filters/auth/HttpBasicAuth.js +0 -73
  170. package/dist/filters/auth/HttpBasicAuth.js.map +0 -1
  171. package/dist/filters/auth/JwtHttpBearerAuth.js.map +0 -1
  172. package/dist/log/config/log4js.json +0 -55
  173. package/dist/package.json +0 -55
  174. package/dist/rbac/AuthAssignment.js +0 -45
  175. package/dist/rbac/AuthAssignment.js.map +0 -1
  176. package/dist/rbac/AuthItem.js +0 -52
  177. package/dist/rbac/AuthItem.js.map +0 -1
  178. package/dist/rbac/AuthItemChild.js +0 -44
  179. package/dist/rbac/AuthItemChild.js.map +0 -1
  180. package/dist/rbac/AuthManager.js +0 -359
  181. package/dist/rbac/AuthManager.js.map +0 -1
  182. package/dist/web/WebUser.js +0 -166
  183. package/dist/web/WebUser.js.map +0 -1
  184. package/filters/AccessControl.ts +0 -77
  185. package/filters/AccessRule.ts +0 -182
  186. package/filters/auth/AuthInterface.ts +0 -34
  187. package/filters/auth/AuthMethod.ts +0 -88
  188. package/filters/auth/HttpBasicAuth.ts +0 -75
  189. package/filters/auth/HttpBearerAuth.ts +0 -31
  190. package/filters/auth/HttpHeaderAuth.ts +0 -53
  191. package/filters/auth/JwtHttpBearerAuth.ts +0 -80
  192. package/filters/auth/KeyCloakHttpBearerAuth.ts +0 -115
  193. package/filters/auth/index.ts +0 -4
  194. package/filters/index.ts +0 -2
  195. package/index.ts +0 -14
  196. package/model/RouteDefinition.ts +0 -18
  197. package/package-lock.json +0 -5259
  198. package/rbac/AuthAssignment.ts +0 -50
  199. package/rbac/AuthItem.ts +0 -57
  200. package/rbac/AuthItemChild.ts +0 -50
  201. package/rbac/AuthManager.ts +0 -398
  202. package/requiments/ReflectUtil.ts +0 -26
  203. package/requiments/Utils.ts +0 -57
  204. package/tsconfig.json +0 -18
  205. package/validators/BooleanValidator.ts +0 -0
  206. package/validators/CompareValidator.ts +0 -0
  207. package/validators/DateValidator.ts +0 -0
  208. package/validators/EmailValidator.ts +0 -0
  209. package/validators/Validator.ts +0 -27
  210. package/web/IdentityInterface.ts +0 -68
  211. package/web/WebUser.ts +0 -187
@@ -1,64 +0,0 @@
1
- import {DataTypes, Model, Relation} from "../../base";
2
- import {OrderItemClass} from "./OrderItem";
3
-
4
- export class OrderClass extends Model {
5
- [x: string]: any;
6
-
7
- tableName() {
8
- return 'order';
9
- }
10
-
11
-
12
- attributes() {
13
-
14
- return {
15
- customer_id: {
16
- allowNull: false,
17
- type: DataTypes.INTEGER,
18
- },
19
-
20
- crm_order_id: {
21
- allowNull: false,
22
- type: DataTypes.INTEGER,
23
- },
24
-
25
- total: {
26
- allowNull: false,
27
- type: DataTypes.FLOAT,
28
- },
29
-
30
- created_date: {
31
- allowNull: false,
32
- type: DataTypes.DATE,
33
- // @ts-ignore
34
- defaultValue: Model.NOW
35
- },
36
- status: {
37
- type: DataTypes.BOOLEAN,
38
- allowNull: false,
39
- validate: {
40
- isBoolean: true
41
- }
42
- }
43
- }
44
- }
45
-
46
-
47
- relation(): Relation[] {
48
- return [
49
- {
50
- type: "hasOne",
51
- sourceKey: "order_id",
52
- foreignKey: "id",
53
- model: (new OrderItemClass()).model()
54
- }
55
- ]
56
- }
57
- }
58
-
59
- // const Order = new OrderClass()
60
- // export {Order};
61
- //
62
-
63
-
64
-
@@ -1,27 +0,0 @@
1
- import {DataTypes, Model} from "../../base";
2
-
3
- export class OrderItemClass extends Model {
4
- [x: string]: any;
5
-
6
- public tableName() {
7
- return 'order_items';
8
- }
9
-
10
- public attributes() {
11
- return {
12
-
13
- status: {
14
- type: DataTypes.BOOLEAN,
15
- validate: {
16
- isBoolean: true
17
- }
18
- }
19
- }
20
- }
21
-
22
- }
23
- // const OrderItem = new OrderItemClass()
24
- // export { OrderItem };
25
-
26
-
27
-
@@ -1,49 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
- import {DataTypes, ModelManager, Model, Relation} from "../../base";
8
-
9
- export class ProductModelsClass extends Model {
10
- [x: string]: any;
11
-
12
- tableName() {
13
- return 'models';
14
- }
15
-
16
-
17
- attributes() {
18
- return {
19
- // Model attributes are defined here
20
- title: {
21
- type: DataTypes.STRING,
22
- allowNull: false
23
- },
24
- stock_code: {
25
- type: DataTypes.STRING,
26
- allowNull: false
27
- },
28
- properties: {
29
- type: DataTypes.STRING,
30
- allowNull: false
31
- }
32
-
33
- }
34
- }
35
-
36
- relation(): Relation[] {
37
- return [
38
- {
39
- type: "hasOne",
40
- foreignKey: "id",
41
- sourceKey: "category_id",
42
- model: ModelManager.Products.model()
43
- }
44
- ]
45
- }
46
- }
47
-
48
- // const ProductModels = new ProductModelsClass();
49
- // export {ProductModels}
@@ -1,46 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
- import {DataTypes, ModelManager, Model, Relation} from "../../base";
8
-
9
- export class ProductToCategoriesClass extends Model {
10
- [x: string]: any;
11
-
12
- tableName() {
13
- return 'product_to_categories';
14
- }
15
-
16
-
17
- attributes() {
18
- return {
19
- // Model attributes are defined here
20
- product_id: {
21
- type: DataTypes.INTEGER,
22
- allowNull: false
23
- },
24
- category_id: {
25
- type: DataTypes.INTEGER,
26
- allowNull: false
27
- }
28
-
29
- }
30
- }
31
-
32
- // relations(): Relation[] {
33
- // return [
34
- // {
35
- // type: "hasMany",
36
- // foreignKey: "category_id",
37
- // sourceKey: "id",
38
- // model: ModelManager.Categories.model(),
39
- // }
40
- // ]
41
- // }
42
-
43
- }
44
-
45
- // const ProductToCategories = new ProductToCategoriesClass()
46
- // export {ProductToCategories}
@@ -1,50 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
- import {DataTypes, ModelManager, Model, Relation} from "../../base";
8
-
9
-
10
- export class ProductsClass extends Model {
11
- [x: string]: any;
12
-
13
- tableName() {
14
- return 'products';
15
- }
16
-
17
- attributes() {
18
- return {
19
- // Model attributes are defined here
20
- title: {
21
- type: DataTypes.STRING,
22
- allowNull: false
23
- },
24
- model_id: {
25
- type: DataTypes.INTEGER,
26
- allowNull: false
27
- },
28
- properties: {
29
- type: DataTypes.STRING,
30
- allowNull: false
31
- }
32
-
33
- }
34
- }
35
-
36
- relations(): Relation[] {
37
- return [
38
- {
39
- type: "belongsToMany",
40
- foreignKey: "product_id",
41
- sourceKey: "id",
42
- model: ModelManager.Categories.model(),
43
- through: ModelManager.ProductToCategories.model()
44
- }
45
- ]
46
- }
47
- }
48
-
49
- // const Products = new ProductsClass()
50
- // export {Products}
@@ -1,60 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
- import {DataTypes, Model} from "../../base";
8
-
9
- export class StocksClass extends Model {
10
- [x: string]: any;
11
-
12
- public tableName() {
13
- return 'stock';
14
- }
15
-
16
- /**
17
- * product_id int4
18
- * properties jsonb
19
- * status int2
20
- * barcode string(20)
21
- * stock_code string(20)
22
- * model_id int4
23
- */
24
- public attributes() {
25
- return {
26
- // Model attributes are defined here
27
- product_id: {
28
- type: DataTypes.INTEGER,
29
- allowNull: false
30
- },
31
-
32
- barcode: {
33
- type: DataTypes.STRING,
34
- allowNull: false,
35
- validate: {
36
- len: 20
37
- }
38
- },
39
- stock_code: {
40
- type: DataTypes.STRING,
41
- allowNull: false,
42
- validate: {
43
- len: 20
44
- }
45
- },
46
- model_id: {
47
- type: DataTypes.INTEGER,
48
- allowNull: false
49
- },
50
- status: {
51
- type: DataTypes.INTEGER,
52
- allowNull: false
53
- }
54
-
55
- }
56
- }
57
- }
58
-
59
- // const Stocks = new StocksClass();
60
- // export {Stocks}
@@ -1,107 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
- // @ts-ignore
8
-
9
-
10
- import {IdentityInterface} from "../../web/IdentityInterface";
11
- import {DataTypes, Model} from "../../base";
12
- import {BaseChyz} from "../../index";
13
-
14
- const JsonWebToken = require("jsonwebtoken");
15
-
16
- export class User extends Model implements IdentityInterface {
17
- [x: string]: any;
18
-
19
- public tableName() {
20
- return 'users';
21
- }
22
-
23
- findIdentity(id: number) {
24
- throw new Error("Method not implemented.");
25
- }
26
-
27
- getId(): number {
28
- throw new Error("Method not implemented.");
29
- }
30
-
31
- can(permissionName: string, params: any[], allowCaching: boolean): boolean | null {
32
- throw new Error("Method not implemented.");
33
- }
34
-
35
-
36
- getAuthKey(): string {
37
- throw new Error("Method not implemented.");
38
- }
39
-
40
- validateAuthKey(authKey: string): boolean {
41
- throw new Error("Method not implemented.");
42
- }
43
-
44
- public attributes() {
45
- return {
46
- // Model attributes are defined here
47
- name: {
48
- type: DataTypes.STRING,
49
- allowNull: false
50
- },
51
- username: {
52
- type: DataTypes.STRING,
53
- allowNull: false
54
- },
55
- password: {
56
- type: DataTypes.STRING,
57
- allowNull: false
58
- },
59
- email: {
60
- type: DataTypes.STRING,
61
- allowNull: false
62
- },
63
- permissions_id: {
64
- type: DataTypes.INTEGER,
65
- allowNull: false
66
- },
67
- authkey: {
68
- type: DataTypes.STRING
69
- // allowNull defaults to true
70
- },
71
- status: {
72
- type: DataTypes.STRING
73
- // allowNull defaults to true
74
- }
75
- }
76
- }
77
-
78
- async findIdentityByAccessToken(token, type) {
79
-
80
- let decoded = JsonWebToken.decode(token, {complete: true})
81
- if(!decoded.payload.user) {
82
- return null;
83
- }
84
-
85
- let identity = await this.findOne({where: {id: parseInt(decoded.payload.user)}});
86
- if (identity) {
87
- BaseChyz.debug("Find Identity By AccessToken: User Found", decoded.payload)
88
- try {
89
- JsonWebToken.verify(token, identity.authkey);
90
- BaseChyz.debug("Find Identity By AccessToken: User Verify Success")
91
- return identity;
92
- } catch (err) {
93
- if (err.name == "TokenExpiredError")
94
- BaseChyz.debug("Find Identity By AccessToken: Token Expired")
95
- else
96
- BaseChyz.debug("Find Identity By AccessToken: User Verify Failed")
97
- return null;
98
- }
99
- }
100
- BaseChyz.debug("Find Identity By AccessToken: User Verify Failed")
101
- return null;
102
- }
103
-
104
-
105
-
106
-
107
- }
@@ -1,37 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
- // @ts-ignore
8
-
9
-
10
- import {DataTypes, Model} from "../../base";
11
-
12
- export class UserPermissionClass extends Model {
13
- [x: string]: any;
14
-
15
- public tableName() {
16
- return 'user_permissions';
17
- }
18
-
19
-
20
- public attributes() {
21
- return {
22
- // Model attributes are defined here
23
- object_type: {
24
- type: DataTypes.STRING,
25
- allowNull: false
26
- },
27
- object_value: {
28
- type: DataTypes.STRING,
29
- allowNull: false
30
- }
31
-
32
- }
33
- }
34
- }
35
-
36
- // const UserPermission = new UserPermissionClass();
37
- // export {UserPermission}
@@ -1,19 +0,0 @@
1
- /*
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
- */
9
- import {ModelManager} from "../../base";
10
- // import {Order, OrderClass} from "./Order";
11
- // import {Customer, CustomerClass} from "./Customer";
12
- // import {Products} from "./Products";
13
- // import {ProductModels} from "./ProductModels";
14
- // import {Categories} from "./Categories";
15
- // import {ProductToCategories} from "./ProductToCategories";
16
- //
17
- // Dependencies._register({Order, Customer,CustomerClass,OrderClass, Products, ProductModels, Categories, ProductToCategories});
18
- //
19
- // console.log("denmemem")
@@ -1,78 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
-
8
-
9
- require('dotenv-flow').config();
10
-
11
- process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
12
-
13
- import Chyz from "../Chyz";
14
- import {WebUser} from "../web/WebUser";
15
- import {KeycloakUser as Identity} from "./Models/KeycloakUser";
16
- // @ts-ignore
17
- import {DbConnection} from "../base/DbConnection";
18
-
19
- var Keycloak = require('keycloak-connect');
20
- var session = require('express-session');
21
- var memoryStore = new session.MemoryStore();
22
-
23
-
24
- var keycloakConfig = {
25
- "realm": "CameraBox",
26
- "auth-server-url": "https://keycloak.hubbox.io:8080/auth/",
27
- //"ssl-required": "external",
28
- "resource": "izanami",
29
- "verify-token-audience": true,
30
- "bearerOnly": true,
31
- "confidential-port":0,
32
- "policy-enforcer":{},
33
- "credentials": {
34
- "secret": "0b476571-28ab-49b1-9968-90fce6294d5a"
35
- }
36
-
37
- };
38
-
39
-
40
-
41
- Keycloak.prototype.accessDenied = function () {
42
- return null;
43
- }
44
-
45
- var keycloak = new Keycloak({scope: 'offline_access'}, keycloakConfig);
46
-
47
-
48
- let config = {
49
- port: 3000,
50
- controllerpath: "C:\\PROJELER\\github\\Chy-Nodejs-Framework\\Examples\\Controllers",
51
- components: {
52
- db: {
53
- class: DbConnection,
54
- database: process.env.DBDATABASE,
55
- username: process.env.DBUSER,
56
- password: process.env.DBPASS,
57
- options: {
58
- host: process.env.DBHOST,
59
- dialect: 'postgres', /* one of 'mysql' | 'mariadb' | 'postgres' | 'mssql' */
60
- // disable logging; default: console.log
61
- logging: false
62
- }
63
- },
64
- user: {
65
- 'class': WebUser,
66
- 'identityClass': Identity
67
- }
68
- },
69
- middlewares: {
70
- keycloak: {
71
- keycloak: keycloak,
72
- config: {
73
- logout: '/logout'
74
- }
75
- }
76
- }
77
- }
78
- Chyz.app(config).Start();
package/Examples/index.ts DELETED
@@ -1,45 +0,0 @@
1
- /*
2
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
3
- * Author: Cihan Ozturk
4
- * E-mail: cihan@chy.com.tr
5
- * Github:https://github.com/cihan53/
6
- */
7
-
8
-
9
- import {BaseChyz} from "../index";
10
-
11
- require('dotenv-flow').config();
12
- import Chyz from "../Chyz";
13
- import {WebUser} from "../web/WebUser";
14
- import {User} from "./Models/User";
15
- import {DbConnection} from "../base";
16
- import {AuthManager} from "../rbac/AuthManager";
17
-
18
-
19
- let config = {
20
- port: process.env.PORT,
21
- controllerpath: "C:\\PROJELER\\github\\Chy-Nodejs-Framework\\Examples\\Controllers",
22
- components: {
23
- authManager: {
24
- class: AuthManager,
25
- },
26
- db: {
27
- class: DbConnection,
28
- database: process.env.DBDATABASE,
29
- username: process.env.DBUSER,
30
- password: process.env.DBPASS,
31
- options: {
32
- host: process.env.DBHOST,
33
- dialect: 'postgres', /* one of 'mysql' | 'mariadb' | 'postgres' | 'mssql' */
34
- // disable logging; default: console.log
35
- logging: (msg: any) => BaseChyz.debug(msg)
36
- }
37
- },
38
- user: {
39
- 'class': WebUser,
40
- 'identityClass': User
41
- }
42
- }
43
-
44
- }
45
- Chyz.app(config).Start();
@@ -1,7 +0,0 @@
1
- {
2
- "realm": "quickstart",
3
- "bearer-only": true,
4
- "auth-server-url": "http://localhost:8180/auth",
5
- "ssl-required": "external",
6
- "resource": "service-nodejs"
7
- }
File without changes