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
@@ -1,23 +1,23 @@
1
- import { HttpBearerAuth } from "./HttpBearerAuth";
2
- import { Request, Response } from "express";
3
- import { WebUser } from "../../web/WebUser";
4
- export declare class KeyCloakHttpBearerAuth extends HttpBearerAuth {
5
- /**
6
- * @var string|array<string, mixed>|Jwt application component ID of the JWT handler, configuration array, or JWT handler object
7
- * itself. By default it's assumes that component of ID "jwt" has been configured.
8
- */
9
- jwt: string;
10
- auth: any;
11
- keycloak: any;
12
- /**
13
- * @throws InvalidConfigException
14
- */
15
- init(): void;
16
- KeyCloakCheck(token: string, request: Request, response: Response): Promise<any>;
17
- authenticate(user: WebUser, request: Request, response: Response): Promise<any>;
18
- /**
19
- * @throws UnauthorizedHttpException
20
- */
21
- fail(response: Response): void;
22
- }
1
+ import { HttpBearerAuth } from "./HttpBearerAuth";
2
+ import { Request, Response } from "express";
3
+ import { WebUser } from "../../web/WebUser";
4
+ export declare class KeyCloakHttpBearerAuth extends HttpBearerAuth {
5
+ /**
6
+ * @var string|array<string, mixed>|Jwt application component ID of the JWT handler, configuration array, or JWT handler object
7
+ * itself. By default it's assumes that component of ID "jwt" has been configured.
8
+ */
9
+ jwt: string;
10
+ auth: any;
11
+ keycloak: any;
12
+ /**
13
+ * @throws InvalidConfigException
14
+ */
15
+ init(): void;
16
+ KeyCloakCheck(token: string, request: Request, response: Response): Promise<any>;
17
+ authenticate(user: WebUser, request: Request, response: Response): Promise<any>;
18
+ /**
19
+ * @throws UnauthorizedHttpException
20
+ */
21
+ fail(response: Response): void;
22
+ }
23
23
  //# sourceMappingURL=KeyCloakHttpBearerAuth.d.ts.map
@@ -1,116 +1,116 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.KeyCloakHttpBearerAuth = void 0;
16
- /*
17
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
18
- * Author: Cihan Ozturk
19
- * E-mail: cihan@chy.com.tr
20
- * Github:https://github.com/cihan53/
21
- */
22
- const BaseChyz_1 = __importDefault(require("../../BaseChyz"));
23
- const HttpBearerAuth_1 = require("./HttpBearerAuth");
24
- const InvalidConfigException_1 = require("../../base/InvalidConfigException");
25
- const JsonWebToken = require("jsonwebtoken");
26
- class KeyCloakHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
27
- constructor() {
28
- super(...arguments);
29
- /**
30
- * @var string|array<string, mixed>|Jwt application component ID of the JWT handler, configuration array, or JWT handler object
31
- * itself. By default it's assumes that component of ID "jwt" has been configured.
32
- */
33
- this.jwt = 'jwt';
34
- this.auth = null;
35
- this.keycloak = null;
36
- }
37
- /**
38
- * @throws InvalidConfigException
39
- */
40
- init() {
41
- var _a, _b;
42
- super.init();
43
- if (!this.pattern) {
44
- throw new InvalidConfigException_1.InvalidConfigException('You must provide pattern to use to extract the HTTP authentication value!');
45
- }
46
- this.keycloak = (_a = BaseChyz_1.default.getMiddlewares("keycloak").keycloak) !== null && _a !== void 0 ? _a : null;
47
- this.user = (_b = BaseChyz_1.default.getComponent("user")) !== null && _b !== void 0 ? _b : null;
48
- this.auth = this.KeyCloakCheck;
49
- }
50
- KeyCloakCheck(token, request, response) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- if (this.keycloak == null)
53
- return false;
54
- // return await this.keycloak.protect('realm:user')(request, response, () => true /*next*/)
55
- return yield this.keycloak.protect()(request, response, () => true /*next*/);
56
- });
57
- }
58
- authenticate(user, request, response) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- let identity = null;
61
- let token = null;
62
- let autHeader = this.getHeaderByKey(request.headers, this.header);
63
- if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
64
- return null;
65
- }
66
- token = JsonWebToken.decode(autHeader[1], { complete: true });
67
- if (!token) {
68
- BaseChyz_1.default.warning("Your request was made with invalid or expired JSON Web Token.");
69
- this.fail(response);
70
- }
71
- if (token !== null) {
72
- identity = yield this.KeyCloakCheck(autHeader[1], request, response);
73
- BaseChyz_1.default.debug("KeyCloakCheck Result:", identity);
74
- }
75
- if (identity == null || identity == false)
76
- this.fail(response);
77
- return identity;
78
- /* let autHeader = this.getHeaderByKey(request.headers, this.header)
79
- if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
80
- return null;
81
- }
82
-
83
- BaseChyz.debug("JSON Web Token.",autHeader);
84
- let identity = null;
85
- let token = null;
86
-
87
- token = JsonWebToken.decode(autHeader[1], {complete: true})
88
- if (!token) {
89
- BaseChyz.warning("Your request was made with invalid or expired JSON Web Token.");
90
- this.fail(response);
91
- }
92
-
93
- if (token !== null) {
94
- if (this.auth != null) {
95
- identity = await this.auth(autHeader[1])
96
- } else {
97
- identity = await user.loginByAccessToken(autHeader[1], "JwtHttpBearerAuth")
98
- }
99
- }
100
-
101
- if (identity == null) this.fail(response)
102
-
103
-
104
-
105
- return identity;*/
106
- });
107
- }
108
- /**
109
- * @throws UnauthorizedHttpException
110
- */
111
- fail(response) {
112
- // this.challenge(response)
113
- // this.handleFailure(response);
114
- }
115
- }
116
- exports.KeyCloakHttpBearerAuth = KeyCloakHttpBearerAuth;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.KeyCloakHttpBearerAuth = void 0;
16
+ /*
17
+ * Copyright (c) 2021. Chy Bilgisayar Bilisim
18
+ * Author: Cihan Ozturk
19
+ * E-mail: cihan@chy.com.tr
20
+ * Github:https://github.com/cihan53/
21
+ */
22
+ const BaseChyz_1 = __importDefault(require("../../BaseChyz"));
23
+ const HttpBearerAuth_1 = require("./HttpBearerAuth");
24
+ const InvalidConfigException_1 = require("../../base/InvalidConfigException");
25
+ const JsonWebToken = require("jsonwebtoken");
26
+ class KeyCloakHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
27
+ constructor() {
28
+ super(...arguments);
29
+ /**
30
+ * @var string|array<string, mixed>|Jwt application component ID of the JWT handler, configuration array, or JWT handler object
31
+ * itself. By default it's assumes that component of ID "jwt" has been configured.
32
+ */
33
+ this.jwt = 'jwt';
34
+ this.auth = null;
35
+ this.keycloak = null;
36
+ }
37
+ /**
38
+ * @throws InvalidConfigException
39
+ */
40
+ init() {
41
+ var _a, _b;
42
+ super.init();
43
+ if (!this.pattern) {
44
+ throw new InvalidConfigException_1.InvalidConfigException('You must provide pattern to use to extract the HTTP authentication value!');
45
+ }
46
+ this.keycloak = (_a = BaseChyz_1.default.getMiddlewares("keycloak").keycloak) !== null && _a !== void 0 ? _a : null;
47
+ this.user = (_b = BaseChyz_1.default.getComponent("user")) !== null && _b !== void 0 ? _b : null;
48
+ this.auth = this.KeyCloakCheck;
49
+ }
50
+ KeyCloakCheck(token, request, response) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ if (this.keycloak == null)
53
+ return false;
54
+ // return await this.keycloak.protect('realm:user')(request, response, () => true /*next*/)
55
+ return yield this.keycloak.protect()(request, response, () => true /*next*/);
56
+ });
57
+ }
58
+ authenticate(user, request, response) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ let identity = null;
61
+ let token = null;
62
+ let autHeader = this.getHeaderByKey(request.headers, this.header);
63
+ if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
64
+ return this.fail(response);
65
+ }
66
+ token = JsonWebToken.decode(autHeader[1], { complete: true });
67
+ if (!token) {
68
+ BaseChyz_1.default.warning("Your request was made with invalid or expired JSON Web Token.");
69
+ this.fail(response);
70
+ }
71
+ if (token !== null) {
72
+ identity = yield this.KeyCloakCheck(autHeader[1], request, response);
73
+ BaseChyz_1.default.debug("KeyCloakCheck Result:", identity);
74
+ }
75
+ if (identity == null || identity == false)
76
+ this.fail(response);
77
+ return identity;
78
+ /* let autHeader = this.getHeaderByKey(request.headers, this.header)
79
+ if (autHeader == null || (autHeader = this.patternCheck(autHeader, this.pattern)) == null) {
80
+ return null;
81
+ }
82
+
83
+ BaseChyz.debug("JSON Web Token.",autHeader);
84
+ let identity = null;
85
+ let token = null;
86
+
87
+ token = JsonWebToken.decode(autHeader[1], {complete: true})
88
+ if (!token) {
89
+ BaseChyz.warning("Your request was made with invalid or expired JSON Web Token.");
90
+ this.fail(response);
91
+ }
92
+
93
+ if (token !== null) {
94
+ if (this.auth != null) {
95
+ identity = await this.auth(autHeader[1])
96
+ } else {
97
+ identity = await user.loginByAccessToken(autHeader[1], "JwtHttpBearerAuth")
98
+ }
99
+ }
100
+
101
+ if (identity == null) this.fail(response)
102
+
103
+
104
+
105
+ return identity;*/
106
+ });
107
+ }
108
+ /**
109
+ * @throws UnauthorizedHttpException
110
+ */
111
+ fail(response) {
112
+ // this.challenge(response)
113
+ this.handleFailure(response);
114
+ }
115
+ }
116
+ exports.KeyCloakHttpBearerAuth = KeyCloakHttpBearerAuth;
@@ -1,5 +1,5 @@
1
- export { JwtHttpBearerAuth } from "./JwtHttpBearerAuth";
2
- export { HttpBearerAuth } from "./HttpBearerAuth";
3
- export { HttpHeaderAuth } from "./HttpHeaderAuth";
4
- export { HttpBasicAuth } from "./HttpBasicAuth";
1
+ export { JwtHttpBearerAuth } from "./JwtHttpBearerAuth";
2
+ export { HttpBearerAuth } from "./HttpBearerAuth";
3
+ export { HttpHeaderAuth } from "./HttpHeaderAuth";
4
+ export { HttpBasicAuth } from "./HttpBasicAuth";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1,11 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpBasicAuth = exports.HttpHeaderAuth = exports.HttpBearerAuth = exports.JwtHttpBearerAuth = void 0;
4
- var JwtHttpBearerAuth_1 = require("./JwtHttpBearerAuth");
5
- Object.defineProperty(exports, "JwtHttpBearerAuth", { enumerable: true, get: function () { return JwtHttpBearerAuth_1.JwtHttpBearerAuth; } });
6
- var HttpBearerAuth_1 = require("./HttpBearerAuth");
7
- Object.defineProperty(exports, "HttpBearerAuth", { enumerable: true, get: function () { return HttpBearerAuth_1.HttpBearerAuth; } });
8
- var HttpHeaderAuth_1 = require("./HttpHeaderAuth");
9
- Object.defineProperty(exports, "HttpHeaderAuth", { enumerable: true, get: function () { return HttpHeaderAuth_1.HttpHeaderAuth; } });
10
- var HttpBasicAuth_1 = require("./HttpBasicAuth");
11
- Object.defineProperty(exports, "HttpBasicAuth", { enumerable: true, get: function () { return HttpBasicAuth_1.HttpBasicAuth; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpBasicAuth = exports.HttpHeaderAuth = exports.HttpBearerAuth = exports.JwtHttpBearerAuth = void 0;
4
+ var JwtHttpBearerAuth_1 = require("./JwtHttpBearerAuth");
5
+ Object.defineProperty(exports, "JwtHttpBearerAuth", { enumerable: true, get: function () { return JwtHttpBearerAuth_1.JwtHttpBearerAuth; } });
6
+ var HttpBearerAuth_1 = require("./HttpBearerAuth");
7
+ Object.defineProperty(exports, "HttpBearerAuth", { enumerable: true, get: function () { return HttpBearerAuth_1.HttpBearerAuth; } });
8
+ var HttpHeaderAuth_1 = require("./HttpHeaderAuth");
9
+ Object.defineProperty(exports, "HttpHeaderAuth", { enumerable: true, get: function () { return HttpHeaderAuth_1.HttpHeaderAuth; } });
10
+ var HttpBasicAuth_1 = require("./HttpBasicAuth");
11
+ Object.defineProperty(exports, "HttpBasicAuth", { enumerable: true, get: function () { return HttpBasicAuth_1.HttpBasicAuth; } });
@@ -1,3 +1,3 @@
1
- export { AccessControl } from "./AccessControl";
2
- export { AccessRule } from "./AccessRule";
1
+ export { AccessControl } from "./AccessControl";
2
+ export { AccessRule } from "./AccessRule";
3
3
  //# sourceMappingURL=index.d.ts.map
package/filters/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccessRule = exports.AccessControl = void 0;
4
- var AccessControl_1 = require("./AccessControl");
5
- Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return AccessControl_1.AccessControl; } });
6
- var AccessRule_1 = require("./AccessRule");
7
- Object.defineProperty(exports, "AccessRule", { enumerable: true, get: function () { return AccessRule_1.AccessRule; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccessRule = exports.AccessControl = void 0;
4
+ var AccessControl_1 = require("./AccessControl");
5
+ Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return AccessControl_1.AccessControl; } });
6
+ var AccessRule_1 = require("./AccessRule");
7
+ Object.defineProperty(exports, "AccessRule", { enumerable: true, get: function () { return AccessRule_1.AccessRule; } });
package/index.d.ts CHANGED
@@ -1,22 +1,29 @@
1
- declare module "express-serve-static-core" {
2
- interface Request {
3
- identity: any;
4
- }
5
- }
6
- import { RestClient } from "./base/RestClient";
7
- import BaseChyz from "./BaseChyz";
8
- /**
9
- *
10
- */
11
- declare const Chyz: BaseChyz;
12
- export { Request, Response, NextFunction } from "./base/CRequest";
13
- export { RouteDefinition } from "./model/RouteDefinition";
14
- export { WebUser } from "./web/WebUser";
15
- export { BaseChyz, RestClient };
16
- export { Logs, ActionFilter, BaseError, Behavior, Component, Configurable, CWebController, DbConnection, ForbiddenHttpException, InvalidConfigException, InvalidArgumentException, NotFoundHttpException, UnauthorizedHttpException, DataErrorDbException, ValidationHttpException, Model, ModelManager, } from "./base";
17
- export * from "./filters";
18
- export * from "./filters/auth";
19
- export * from "./decorator";
20
- export * from "./requiments/Utils";
21
- export default Chyz;
1
+ declare global {
2
+ interface String {
3
+ tokenReplace(obj: any): string;
4
+ }
5
+ }
6
+ import BaseChyz from "./BaseChyz";
7
+ import { RestClient } from "./base";
8
+ declare module "express-serve-static-core" {
9
+ interface Request {
10
+ identity: any;
11
+ }
12
+ }
13
+ /**
14
+ *
15
+ */
16
+ export declare const Chyz_Version = "2.0.1-rc.1";
17
+ declare const Chyz: BaseChyz;
18
+ export { Request, Response, NextFunction } from "./base/CRequest";
19
+ export { RouteDefinition } from "./model/RouteDefinition";
20
+ export { WebUser } from "./web/WebUser";
21
+ export { BaseChyz, RestClient };
22
+ export { Logs, ActionFilter, BaseError, Behavior, Component, Configurable, CWebController, DbConnection, ForbiddenHttpException, InvalidConfigException, InvalidArgumentException, NotFoundHttpException, UnauthorizedHttpException, DataErrorDbException, ValidationHttpException, Model, ModelManager, CEvents } from "./base";
23
+ export * from "./filters";
24
+ export * from "./filters/auth";
25
+ export * from "./rbac/";
26
+ export * from "./decorator";
27
+ export * from "./requiments/Utils";
28
+ export default Chyz;
22
29
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb,QAAQ,EAAE,GAAG,CAAC;KACjB;CACJ;AAGD,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC;;GAEG;AACH,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,GACf,MAAM,QAAQ,CAAC;AAChB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,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;AAElC,OAAO,QAAQ,2BAA2B,CAAC;IACvC,UAAU,OAAO;QACb,QAAQ,EAAE,GAAG,CAAC;KACjB;CACJ;AAYD;;GAEG;AACH,eAAQ,MAAM,YAAY,eAAa,CAAC;AACxC,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
@@ -1,60 +1,71 @@
1
- "use strict";
2
- /*
3
- *
4
- * Copyright (c) 2022.. Chy Bilgisayar Bilisim
5
- * Author: Cihan Ozturk
6
- * E-mail: cihan@chy.com.tr
7
- * Github:https://github.com/cihan53/
8
- *
9
- */
10
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- var desc = Object.getOwnPropertyDescriptor(m, k);
13
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
- desc = { enumerable: true, get: function() { return m[k]; } };
15
- }
16
- Object.defineProperty(o, k2, desc);
17
- }) : (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- o[k2] = m[k];
20
- }));
21
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
- };
24
- var __importDefault = (this && this.__importDefault) || function (mod) {
25
- return (mod && mod.__esModule) ? mod : { "default": mod };
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.ModelManager = exports.Model = exports.ValidationHttpException = exports.DataErrorDbException = exports.UnauthorizedHttpException = exports.NotFoundHttpException = exports.InvalidArgumentException = exports.InvalidConfigException = exports.ForbiddenHttpException = exports.DbConnection = exports.CWebController = exports.Component = exports.Behavior = exports.BaseError = exports.ActionFilter = exports.Logs = exports.RestClient = exports.BaseChyz = exports.WebUser = void 0;
29
- const RestClient_1 = require("./base/RestClient");
30
- Object.defineProperty(exports, "RestClient", { enumerable: true, get: function () { return RestClient_1.RestClient; } });
31
- const BaseChyz_1 = __importDefault(require("./BaseChyz"));
32
- exports.BaseChyz = BaseChyz_1.default;
33
- /**
34
- *
35
- */
36
- const Chyz = new BaseChyz_1.default();
37
- var WebUser_1 = require("./web/WebUser");
38
- Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
39
- var base_1 = require("./base");
40
- Object.defineProperty(exports, "Logs", { enumerable: true, get: function () { return base_1.Logs; } });
41
- Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return base_1.ActionFilter; } });
42
- Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return base_1.BaseError; } });
43
- Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return base_1.Behavior; } });
44
- Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return base_1.Component; } });
45
- Object.defineProperty(exports, "CWebController", { enumerable: true, get: function () { return base_1.CWebController; } });
46
- Object.defineProperty(exports, "DbConnection", { enumerable: true, get: function () { return base_1.DbConnection; } });
47
- Object.defineProperty(exports, "ForbiddenHttpException", { enumerable: true, get: function () { return base_1.ForbiddenHttpException; } });
48
- Object.defineProperty(exports, "InvalidConfigException", { enumerable: true, get: function () { return base_1.InvalidConfigException; } });
49
- Object.defineProperty(exports, "InvalidArgumentException", { enumerable: true, get: function () { return base_1.InvalidArgumentException; } });
50
- Object.defineProperty(exports, "NotFoundHttpException", { enumerable: true, get: function () { return base_1.NotFoundHttpException; } });
51
- Object.defineProperty(exports, "UnauthorizedHttpException", { enumerable: true, get: function () { return base_1.UnauthorizedHttpException; } });
52
- Object.defineProperty(exports, "DataErrorDbException", { enumerable: true, get: function () { return base_1.DataErrorDbException; } });
53
- Object.defineProperty(exports, "ValidationHttpException", { enumerable: true, get: function () { return base_1.ValidationHttpException; } });
54
- Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return base_1.Model; } });
55
- Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return base_1.ModelManager; } });
56
- __exportStar(require("./filters"), exports);
57
- __exportStar(require("./filters/auth"), exports);
58
- __exportStar(require("./decorator"), exports);
59
- __exportStar(require("./requiments/Utils"), exports);
60
- exports.default = Chyz;
1
+ "use strict";
2
+ /*
3
+ *
4
+ * Copyright (c) 2022.. Chy Bilgisayar Bilisim
5
+ * Author: Cihan Ozturk
6
+ * E-mail: cihan@chy.com.tr
7
+ * Github:https://github.com/cihan53/
8
+ *
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.CEvents = exports.ModelManager = exports.Model = exports.ValidationHttpException = exports.DataErrorDbException = exports.UnauthorizedHttpException = exports.NotFoundHttpException = exports.InvalidArgumentException = exports.InvalidConfigException = exports.ForbiddenHttpException = exports.DbConnection = exports.CWebController = exports.Component = exports.Behavior = exports.BaseError = exports.ActionFilter = exports.Logs = exports.RestClient = exports.BaseChyz = exports.WebUser = exports.Chyz_Version = void 0;
29
+ const BaseChyz_1 = __importDefault(require("./BaseChyz"));
30
+ exports.BaseChyz = BaseChyz_1.default;
31
+ const base_1 = require("./base");
32
+ Object.defineProperty(exports, "RestClient", { enumerable: true, get: function () { return base_1.RestClient; } });
33
+ String.prototype.tokenReplace = function (obj) {
34
+ let retStr = this;
35
+ for (let x in obj) {
36
+ // @ts-ignore
37
+ retStr = retStr.replace(new RegExp("\\:" + x, 'g'), obj[x]).toString();
38
+ }
39
+ return retStr;
40
+ };
41
+ /**
42
+ *
43
+ */
44
+ exports.Chyz_Version = "2.0.1-rc.1";
45
+ const Chyz = new BaseChyz_1.default();
46
+ var WebUser_1 = require("./web/WebUser");
47
+ Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
48
+ var base_2 = require("./base");
49
+ Object.defineProperty(exports, "Logs", { enumerable: true, get: function () { return base_2.Logs; } });
50
+ Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return base_2.ActionFilter; } });
51
+ Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return base_2.BaseError; } });
52
+ Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return base_2.Behavior; } });
53
+ Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return base_2.Component; } });
54
+ Object.defineProperty(exports, "CWebController", { enumerable: true, get: function () { return base_2.CWebController; } });
55
+ Object.defineProperty(exports, "DbConnection", { enumerable: true, get: function () { return base_2.DbConnection; } });
56
+ Object.defineProperty(exports, "ForbiddenHttpException", { enumerable: true, get: function () { return base_2.ForbiddenHttpException; } });
57
+ Object.defineProperty(exports, "InvalidConfigException", { enumerable: true, get: function () { return base_2.InvalidConfigException; } });
58
+ Object.defineProperty(exports, "InvalidArgumentException", { enumerable: true, get: function () { return base_2.InvalidArgumentException; } });
59
+ Object.defineProperty(exports, "NotFoundHttpException", { enumerable: true, get: function () { return base_2.NotFoundHttpException; } });
60
+ Object.defineProperty(exports, "UnauthorizedHttpException", { enumerable: true, get: function () { return base_2.UnauthorizedHttpException; } });
61
+ Object.defineProperty(exports, "DataErrorDbException", { enumerable: true, get: function () { return base_2.DataErrorDbException; } });
62
+ Object.defineProperty(exports, "ValidationHttpException", { enumerable: true, get: function () { return base_2.ValidationHttpException; } });
63
+ Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return base_2.Model; } });
64
+ Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return base_2.ModelManager; } });
65
+ Object.defineProperty(exports, "CEvents", { enumerable: true, get: function () { return base_2.CEvents; } });
66
+ __exportStar(require("./filters"), exports);
67
+ __exportStar(require("./filters/auth"), exports);
68
+ __exportStar(require("./rbac/"), exports);
69
+ __exportStar(require("./decorator"), exports);
70
+ __exportStar(require("./requiments/Utils"), exports);
71
+ exports.default = Chyz;
@@ -1,7 +1,7 @@
1
- export interface RouteDefinition {
2
- id: string;
3
- path: string;
4
- requestMethod: 'get' | 'post' | 'delete' | 'options' | 'put';
5
- methodName: string;
6
- }
1
+ export interface RouteDefinition {
2
+ id: string;
3
+ path: string;
4
+ requestMethod: 'get' | 'post' | 'delete' | 'options' | 'put';
5
+ methodName: string;
6
+ }
7
7
  //# sourceMappingURL=RouteDefinition.d.ts.map
@@ -1,8 +1,8 @@
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 });
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 });