chyz 1.2.5-rc.2 → 2.0.0-rc.12

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 (226) hide show
  1. package/BaseChyz.d.ts +63 -0
  2. package/BaseChyz.d.ts.map +1 -0
  3. package/BaseChyz.js +128 -80
  4. package/base/ActionFilter.d.ts +33 -0
  5. package/base/ActionFilter.d.ts.map +1 -0
  6. package/base/ActionFilter.js +21 -20
  7. package/base/BaseError.d.ts +11 -0
  8. package/base/BaseError.d.ts.map +1 -0
  9. package/base/BaseError.js +2 -6
  10. package/base/Behavior.d.ts +4 -0
  11. package/base/Behavior.d.ts.map +1 -0
  12. package/base/Behavior.js +2 -3
  13. package/base/CBaseObject.d.ts +5 -0
  14. package/base/CBaseObject.d.ts.map +1 -0
  15. package/base/CBaseObject.js +16 -0
  16. package/base/CRequest.d.ts +2 -0
  17. package/base/CRequest.d.ts.map +1 -0
  18. package/base/CRequest.js +10 -0
  19. package/base/CWebController.d.ts +44 -0
  20. package/base/CWebController.d.ts.map +1 -0
  21. package/base/CWebController.js +0 -1
  22. package/base/Component.d.ts +21 -0
  23. package/base/Component.d.ts.map +1 -0
  24. package/base/Component.js +7 -11
  25. package/base/Configurable.d.ts +3 -0
  26. package/base/Configurable.d.ts.map +1 -0
  27. package/base/Configurable.js +0 -1
  28. package/base/DataErrorDbException.d.ts +6 -0
  29. package/base/DataErrorDbException.d.ts.map +1 -0
  30. package/base/DataErrorDbException.js +0 -1
  31. package/base/DbConnection.d.ts +13 -0
  32. package/base/DbConnection.d.ts.map +1 -0
  33. package/base/DbConnection.js +1 -2
  34. package/base/ForbiddenHttpException.d.ts +5 -0
  35. package/base/ForbiddenHttpException.d.ts.map +1 -0
  36. package/base/ForbiddenHttpException.js +0 -1
  37. package/base/InvalidArgumentException.d.ts +6 -0
  38. package/base/InvalidArgumentException.d.ts.map +1 -0
  39. package/base/InvalidArgumentException.js +0 -1
  40. package/base/InvalidConfigException.d.ts +6 -0
  41. package/base/InvalidConfigException.d.ts.map +1 -0
  42. package/base/InvalidConfigException.js +0 -1
  43. package/base/Logs.d.ts +22 -0
  44. package/base/Logs.d.ts.map +1 -0
  45. package/base/Logs.js +57 -0
  46. package/base/Model.d.ts +299 -0
  47. package/base/Model.d.ts.map +1 -0
  48. package/base/Model.js +4 -5
  49. package/base/ModelManager.d.ts +2 -0
  50. package/base/ModelManager.d.ts.map +1 -0
  51. package/base/ModelManager.js +11 -1
  52. package/base/NotFoundHttpException.d.ts +6 -0
  53. package/base/NotFoundHttpException.d.ts.map +1 -0
  54. package/base/NotFoundHttpException.js +0 -1
  55. package/base/RestClient.d.ts +7 -0
  56. package/base/RestClient.d.ts.map +1 -0
  57. package/base/RestClient.js +0 -2
  58. package/base/UnauthorizedHttpException.d.ts +6 -0
  59. package/base/UnauthorizedHttpException.d.ts.map +1 -0
  60. package/base/UnauthorizedHttpException.js +0 -1
  61. package/base/ValidationHttpException.d.ts +6 -0
  62. package/base/ValidationHttpException.d.ts.map +1 -0
  63. package/base/ValidationHttpException.js +0 -1
  64. package/base/db/Exception.d.ts +7 -0
  65. package/base/db/Exception.d.ts.map +1 -0
  66. package/base/db/Exception.js +0 -1
  67. package/base/index.d.ts +19 -0
  68. package/base/index.d.ts.map +1 -0
  69. package/base/index.js +5 -6
  70. package/decorator/Middleware.d.ts +4 -0
  71. package/decorator/Middleware.d.ts.map +1 -0
  72. package/decorator/Middleware.js +0 -1
  73. package/decorator/controller.d.ts +3 -0
  74. package/decorator/controller.d.ts.map +1 -0
  75. package/decorator/controller.js +0 -1
  76. package/decorator/enums/ControllerDecoratorParams.d.ts +6 -0
  77. package/decorator/enums/ControllerDecoratorParams.d.ts.map +1 -0
  78. package/decorator/enums/ControllerDecoratorParams.js +0 -1
  79. package/decorator/get.d.ts +3 -0
  80. package/decorator/get.d.ts.map +1 -0
  81. package/decorator/get.js +0 -1
  82. package/decorator/index.d.ts +4 -0
  83. package/decorator/index.d.ts.map +1 -0
  84. package/decorator/index.js +0 -1
  85. package/decorator/post.d.ts +3 -0
  86. package/decorator/post.d.ts.map +1 -0
  87. package/decorator/post.js +0 -1
  88. package/filters/AccessControl.d.ts +13 -0
  89. package/filters/AccessControl.d.ts.map +1 -0
  90. package/filters/AccessControl.js +6 -10
  91. package/filters/AccessRule.d.ts +83 -0
  92. package/filters/AccessRule.d.ts.map +1 -0
  93. package/filters/AccessRule.js +9 -12
  94. package/filters/auth/AuthInterface.d.ts +26 -0
  95. package/filters/auth/AuthInterface.d.ts.map +1 -0
  96. package/filters/auth/AuthInterface.js +0 -1
  97. package/filters/auth/AuthMethod.d.ts +38 -0
  98. package/filters/auth/AuthMethod.d.ts.map +1 -0
  99. package/filters/auth/AuthMethod.js +12 -1
  100. package/filters/auth/HttpBasicAuth.d.ts +23 -0
  101. package/filters/auth/HttpBasicAuth.d.ts.map +1 -0
  102. package/filters/auth/HttpBasicAuth.js +0 -1
  103. package/filters/auth/HttpBearerAuth.d.ts +18 -0
  104. package/filters/auth/HttpBearerAuth.d.ts.map +1 -0
  105. package/filters/auth/HttpBearerAuth.js +0 -1
  106. package/filters/auth/HttpHeaderAuth.d.ts +15 -0
  107. package/filters/auth/HttpHeaderAuth.d.ts.map +1 -0
  108. package/filters/auth/HttpHeaderAuth.js +2 -6
  109. package/filters/auth/JwtHttpBearerAuth.d.ts +21 -0
  110. package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -0
  111. package/filters/auth/JwtHttpBearerAuth.js +0 -1
  112. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +23 -0
  113. package/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +1 -0
  114. package/filters/auth/KeyCloakHttpBearerAuth.js +0 -1
  115. package/filters/auth/index.d.ts +5 -0
  116. package/filters/auth/index.d.ts.map +1 -0
  117. package/filters/auth/index.js +0 -1
  118. package/filters/index.d.ts +3 -0
  119. package/filters/index.d.ts.map +1 -0
  120. package/filters/index.js +0 -1
  121. package/index.d.ts +22 -0
  122. package/index.d.ts.map +1 -0
  123. package/index.js +24 -31
  124. package/model/RouteDefinition.d.ts +7 -0
  125. package/model/RouteDefinition.d.ts.map +1 -0
  126. package/model/RouteDefinition.js +0 -1
  127. package/package.json +10 -10
  128. package/rbac/AuthAssignment.d.ts +19 -0
  129. package/rbac/AuthAssignment.d.ts.map +1 -0
  130. package/rbac/AuthAssignment.js +0 -1
  131. package/rbac/AuthItem.d.ts +27 -0
  132. package/rbac/AuthItem.d.ts.map +1 -0
  133. package/rbac/AuthItem.js +0 -1
  134. package/rbac/AuthItemChild.d.ts +19 -0
  135. package/rbac/AuthItemChild.d.ts.map +1 -0
  136. package/rbac/AuthItemChild.js +0 -1
  137. package/rbac/AuthManager.d.ts +112 -0
  138. package/rbac/AuthManager.d.ts.map +1 -0
  139. package/rbac/AuthManager.js +9 -13
  140. package/requiments/Glob.d.ts +3 -0
  141. package/requiments/Glob.d.ts.map +1 -0
  142. package/requiments/Glob.js +0 -1
  143. package/requiments/ReflectUtil.d.ts +1 -0
  144. package/requiments/ReflectUtil.d.ts.map +1 -0
  145. package/requiments/ReflectUtil.js +0 -1
  146. package/requiments/Utils.d.ts +9 -0
  147. package/requiments/Utils.d.ts.map +1 -0
  148. package/requiments/Utils.js +11 -3
  149. package/validators/BooleanValidator.d.ts +1 -0
  150. package/validators/BooleanValidator.d.ts.map +1 -0
  151. package/validators/BooleanValidator.js +0 -1
  152. package/validators/CompareValidator.d.ts +1 -0
  153. package/validators/CompareValidator.d.ts.map +1 -0
  154. package/validators/CompareValidator.js +0 -1
  155. package/validators/DateValidator.d.ts +1 -0
  156. package/validators/DateValidator.d.ts.map +1 -0
  157. package/validators/DateValidator.js +0 -1
  158. package/validators/EmailValidator.d.ts +1 -0
  159. package/validators/EmailValidator.d.ts.map +1 -0
  160. package/validators/EmailValidator.js +0 -1
  161. package/validators/Validator.d.ts +18 -0
  162. package/validators/Validator.d.ts.map +1 -0
  163. package/validators/Validator.js +0 -1
  164. package/web/IdentityInterface.d.ts +55 -0
  165. package/web/IdentityInterface.d.ts.map +1 -0
  166. package/web/IdentityInterface.js +0 -1
  167. package/web/WebUser.d.ts +72 -0
  168. package/web/WebUser.d.ts.map +1 -0
  169. package/web/WebUser.js +2 -3
  170. package/BaseChyz.js.map +0 -1
  171. package/Chyz.js +0 -15
  172. package/Chyz.js.map +0 -1
  173. package/base/ActionFilter.js.map +0 -1
  174. package/base/BaseError.js.map +0 -1
  175. package/base/BaseObject.js +0 -20
  176. package/base/BaseObject.js.map +0 -1
  177. package/base/Behavior.js.map +0 -1
  178. package/base/CWebController.js.map +0 -1
  179. package/base/Component.js.map +0 -1
  180. package/base/Configurable.js.map +0 -1
  181. package/base/DataErrorDbException.js.map +0 -1
  182. package/base/DbConnection.js.map +0 -1
  183. package/base/ForbiddenHttpException.js.map +0 -1
  184. package/base/InvalidArgumentException.js.map +0 -1
  185. package/base/InvalidConfigException.js.map +0 -1
  186. package/base/Model.js.map +0 -1
  187. package/base/ModelManager.js.map +0 -1
  188. package/base/NotFoundHttpException.js.map +0 -1
  189. package/base/RestClient.js.map +0 -1
  190. package/base/UnauthorizedHttpException.js.map +0 -1
  191. package/base/ValidationHttpException.js.map +0 -1
  192. package/base/db/Exception.js.map +0 -1
  193. package/base/index.js.map +0 -1
  194. package/decorator/Middleware.js.map +0 -1
  195. package/decorator/controller.js.map +0 -1
  196. package/decorator/enums/ControllerDecoratorParams.js.map +0 -1
  197. package/decorator/get.js.map +0 -1
  198. package/decorator/index.js.map +0 -1
  199. package/decorator/post.js.map +0 -1
  200. package/filters/AccessControl.js.map +0 -1
  201. package/filters/AccessRule.js.map +0 -1
  202. package/filters/auth/AuthInterface.js.map +0 -1
  203. package/filters/auth/AuthMethod.js.map +0 -1
  204. package/filters/auth/HttpBasicAuth.js.map +0 -1
  205. package/filters/auth/HttpBearerAuth.js.map +0 -1
  206. package/filters/auth/HttpHeaderAuth.js.map +0 -1
  207. package/filters/auth/JwtHttpBearerAuth.js.map +0 -1
  208. package/filters/auth/KeyCloakHttpBearerAuth.js.map +0 -1
  209. package/filters/auth/index.js.map +0 -1
  210. package/filters/index.js.map +0 -1
  211. package/index.js.map +0 -1
  212. package/model/RouteDefinition.js.map +0 -1
  213. package/rbac/AuthAssignment.js.map +0 -1
  214. package/rbac/AuthItem.js.map +0 -1
  215. package/rbac/AuthItemChild.js.map +0 -1
  216. package/rbac/AuthManager.js.map +0 -1
  217. package/requiments/Glob.js.map +0 -1
  218. package/requiments/ReflectUtil.js.map +0 -1
  219. package/requiments/Utils.js.map +0 -1
  220. package/validators/BooleanValidator.js.map +0 -1
  221. package/validators/CompareValidator.js.map +0 -1
  222. package/validators/DateValidator.js.map +0 -1
  223. package/validators/EmailValidator.js.map +0 -1
  224. package/validators/Validator.js.map +0 -1
  225. package/web/IdentityInterface.js.map +0 -1
  226. package/web/WebUser.js.map +0 -1
@@ -24,6 +24,12 @@ class AuthMethod extends ActionFilter_1.ActionFilter {
24
24
  super(...arguments);
25
25
  this.optional = [];
26
26
  }
27
+ /**
28
+ *
29
+ * @param action
30
+ * @param request
31
+ * @param response
32
+ */
27
33
  beforeAction(action, request, response) {
28
34
  var _a;
29
35
  return __awaiter(this, void 0, void 0, function* () {
@@ -38,6 +44,12 @@ class AuthMethod extends ActionFilter_1.ActionFilter {
38
44
  return false;
39
45
  });
40
46
  }
47
+ /**
48
+ *
49
+ * @param user
50
+ * @param request
51
+ * @param response
52
+ */
41
53
  authenticate(user, request, response) {
42
54
  }
43
55
  // @ts-ignore
@@ -68,4 +80,3 @@ class AuthMethod extends ActionFilter_1.ActionFilter {
68
80
  }
69
81
  }
70
82
  exports.AuthMethod = AuthMethod;
71
- //# sourceMappingURL=AuthMethod.js.map
@@ -0,0 +1,23 @@
1
+ import { Request, Response } from "express";
2
+ import { WebUser } from "../../web/WebUser";
3
+ import { AuthMethod } from "./AuthMethod";
4
+ export declare class HttpBasicAuth extends AuthMethod {
5
+ /**
6
+ * @var string the HTTP header name
7
+ */
8
+ header: string;
9
+ /**
10
+ * @var string a pattern to use to extract the HTTP authentication value
11
+ */
12
+ pattern: RegExp;
13
+ /**
14
+ * @throws InvalidConfigException
15
+ */
16
+ init(): void;
17
+ authenticate(user: WebUser, request: Request, response: Response): Promise<any>;
18
+ /**
19
+ * @throws UnauthorizedHttpException
20
+ */
21
+ fail(response: Response): void;
22
+ }
23
+ //# sourceMappingURL=HttpBasicAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpBasicAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpBasicAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAIxC,qBAAa,aAAc,SAAQ,UAAU;IAEzC;;OAEG;IACI,MAAM,SAAmB;IAGhC;;OAEG;IAEI,OAAO,SAAqB;IAGnC;;OAEG;IACI,IAAI,IAAI,IAAI;IAWb,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,QAAQ;IAuBpE;;OAEG;IACI,IAAI,CAAC,QAAQ,EAAC,QAAQ,GAAG,IAAI;CAIvC"}
@@ -70,4 +70,3 @@ class HttpBasicAuth extends AuthMethod_1.AuthMethod {
70
70
  }
71
71
  }
72
72
  exports.HttpBasicAuth = HttpBasicAuth;
73
- //# sourceMappingURL=HttpBasicAuth.js.map
@@ -0,0 +1,18 @@
1
+ import { HttpHeaderAuth } from "./HttpHeaderAuth";
2
+ import { Response } from "express";
3
+ export declare class HttpBearerAuth extends HttpHeaderAuth {
4
+ /**
5
+ * {@inheritdoc}
6
+ */
7
+ header: string;
8
+ pattern: RegExp;
9
+ /**
10
+ * @var string the HTTP authentication realm
11
+ */
12
+ realm: string;
13
+ /**
14
+ * {@inheritdoc}
15
+ */
16
+ challenge(response: Response): void;
17
+ }
18
+ //# sourceMappingURL=HttpBearerAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,qBAAa,cAAe,SAAQ,cAAc;IAE9C;;OAEG;IACI,MAAM,SAAmB;IAEzB,OAAO,SAAsB;IACpC;;OAEG;IACI,KAAK,SAAS;IAGrB;;OAEG;IACI,SAAS,CAAC,QAAQ,EAAE,QAAQ;CAGtC"}
@@ -30,4 +30,3 @@ class HttpBearerAuth extends HttpHeaderAuth_1.HttpHeaderAuth {
30
30
  }
31
31
  }
32
32
  exports.HttpBearerAuth = HttpBearerAuth;
33
- //# sourceMappingURL=HttpBearerAuth.js.map
@@ -0,0 +1,15 @@
1
+ import { AuthMethod } from "./AuthMethod";
2
+ import { WebUser } from "../../web/WebUser";
3
+ import { Request, Response } from "express";
4
+ export declare class HttpHeaderAuth extends AuthMethod {
5
+ /**
6
+ * @var string the HTTP header name
7
+ */
8
+ header: string;
9
+ /**
10
+ * @var string a pattern to use to extract the HTTP authentication value
11
+ */
12
+ pattern: string;
13
+ authenticate(user: WebUser, request: Request, response: Response): Promise<any>;
14
+ }
15
+ //# sourceMappingURL=HttpHeaderAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpHeaderAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/HttpHeaderAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE1C,qBAAa,cAAe,SAAQ,UAAU;IAC1C;;OAEG;IACI,MAAM,SAAe;IAG5B;;OAEG;IAEI,OAAO,EAAG,MAAM,CAAC;IAGlB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,QAAQ;CA0BvE"}
@@ -14,13 +14,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
14
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
15
  });
16
16
  };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
17
  Object.defineProperty(exports, "__esModule", { value: true });
21
18
  exports.HttpHeaderAuth = void 0;
22
19
  const AuthMethod_1 = require("./AuthMethod");
23
- const Utils_1 = __importDefault(require("../../requiments/Utils"));
20
+ const Utils_1 = require("../../requiments/Utils");
24
21
  class HttpHeaderAuth extends AuthMethod_1.AuthMethod {
25
22
  constructor() {
26
23
  super(...arguments);
@@ -34,7 +31,7 @@ class HttpHeaderAuth extends AuthMethod_1.AuthMethod {
34
31
  let key = Object.keys(request.headers).find(key => key.toLowerCase() === this.header.toLowerCase());
35
32
  if (key) {
36
33
  let authHeader = request.headers[key];
37
- if (!Utils_1.default.isEmpty(authHeader)) {
34
+ if (!Utils_1.Utils.isEmpty(authHeader)) {
38
35
  if (this.pattern) {
39
36
  //preg_match
40
37
  let matches = authHeader.match(this.pattern);
@@ -58,4 +55,3 @@ class HttpHeaderAuth extends AuthMethod_1.AuthMethod {
58
55
  }
59
56
  }
60
57
  exports.HttpHeaderAuth = HttpHeaderAuth;
61
- //# sourceMappingURL=HttpHeaderAuth.js.map
@@ -0,0 +1,21 @@
1
+ import { HttpBearerAuth } from "./HttpBearerAuth";
2
+ import { Response, Request } from "express";
3
+ import { WebUser } from "../../web/WebUser";
4
+ export declare class JwtHttpBearerAuth 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
+ /**
12
+ * @throws InvalidConfigException
13
+ */
14
+ init(): void;
15
+ authenticate(user: WebUser, request: Request, response: Response): Promise<any>;
16
+ /**
17
+ * @throws UnauthorizedHttpException
18
+ */
19
+ fail(response: Response): void;
20
+ }
21
+ //# sourceMappingURL=JwtHttpBearerAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JwtHttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/JwtHttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAC,QAAQ,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAI1C,qBAAa,iBAAkB,SAAQ,cAAc;IACjD;;;OAGG;IACI,GAAG,SAAQ;IACX,IAAI,EAAC,GAAG,CAAQ;IAGvB;;OAEG;IACI,IAAI,IAAI,IAAI;IAWN,YAAY,CAAC,IAAI,EAAC,OAAO,EAAE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,QAAQ;IAiC1E;;OAEG;IACI,IAAI,CAAC,QAAQ,EAAC,QAAQ,GAAG,IAAI;CAKvC"}
@@ -79,4 +79,3 @@ class JwtHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
79
79
  }
80
80
  }
81
81
  exports.JwtHttpBearerAuth = JwtHttpBearerAuth;
82
- //# sourceMappingURL=JwtHttpBearerAuth.js.map
@@ -0,0 +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
+ }
23
+ //# sourceMappingURL=KeyCloakHttpBearerAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyCloakHttpBearerAuth.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/KeyCloakHttpBearerAuth.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAI1C,qBAAa,sBAAuB,SAAQ,cAAc;IACtD;;;OAGG;IACI,GAAG,SAAQ;IACX,IAAI,EAAE,GAAG,CAAQ;IACjB,QAAQ,EAAE,GAAG,CAAQ;IAG5B;;OAEG;IACI,IAAI,IAAI,IAAI;IAcN,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAOjE,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAyD7E;;OAEG;IACI,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAKxC"}
@@ -114,4 +114,3 @@ class KeyCloakHttpBearerAuth extends HttpBearerAuth_1.HttpBearerAuth {
114
114
  }
115
115
  }
116
116
  exports.KeyCloakHttpBearerAuth = KeyCloakHttpBearerAuth;
117
- //# sourceMappingURL=KeyCloakHttpBearerAuth.js.map
@@ -0,0 +1,5 @@
1
+ export { JwtHttpBearerAuth } from "./JwtHttpBearerAuth";
2
+ export { HttpBearerAuth } from "./HttpBearerAuth";
3
+ export { HttpHeaderAuth } from "./HttpHeaderAuth";
4
+ export { HttpBasicAuth } from "./HttpBasicAuth";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA"}
@@ -9,4 +9,3 @@ var HttpHeaderAuth_1 = require("./HttpHeaderAuth");
9
9
  Object.defineProperty(exports, "HttpHeaderAuth", { enumerable: true, get: function () { return HttpHeaderAuth_1.HttpHeaderAuth; } });
10
10
  var HttpBasicAuth_1 = require("./HttpBasicAuth");
11
11
  Object.defineProperty(exports, "HttpBasicAuth", { enumerable: true, get: function () { return HttpBasicAuth_1.HttpBasicAuth; } });
12
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ export { AccessControl } from "./AccessControl";
2
+ export { AccessRule } from "./AccessRule";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA"}
package/filters/index.js CHANGED
@@ -5,4 +5,3 @@ var AccessControl_1 = require("./AccessControl");
5
5
  Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return AccessControl_1.AccessControl; } });
6
6
  var AccessRule_1 = require("./AccessRule");
7
7
  Object.defineProperty(exports, "AccessRule", { enumerable: true, get: function () { return AccessRule_1.AccessRule; } });
8
- //# sourceMappingURL=index.js.map
package/index.d.ts ADDED
@@ -0,0 +1,22 @@
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;
22
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +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"}
package/index.js CHANGED
@@ -1,30 +1,33 @@
1
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
+ */
2
10
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
11
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
17
  }) : (function(o, m, k, k2) {
6
18
  if (k2 === undefined) k2 = k;
7
19
  o[k2] = m[k];
8
20
  }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
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);
20
23
  };
21
24
  var __importDefault = (this && this.__importDefault) || function (mod) {
22
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
26
  };
24
27
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.utils = exports.post = exports.get = exports.controller = exports.HttpBasicAuth = exports.HttpHeaderAuth = exports.HttpBearerAuth = exports.JwtHttpBearerAuth = exports.AccessRule = exports.AccessControl = 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.BaseObject = exports.ActionFilter = exports.RestClient = exports.BaseChyz = exports.WebUser = void 0;
26
- const RestClient_1 = __importDefault(require("./base/RestClient"));
27
- exports.RestClient = RestClient_1.default;
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; } });
28
31
  const BaseChyz_1 = __importDefault(require("./BaseChyz"));
29
32
  exports.BaseChyz = BaseChyz_1.default;
30
33
  /**
@@ -33,10 +36,9 @@ exports.BaseChyz = BaseChyz_1.default;
33
36
  const Chyz = new BaseChyz_1.default();
34
37
  var WebUser_1 = require("./web/WebUser");
35
38
  Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
36
- exports.default = Chyz;
37
39
  var base_1 = require("./base");
40
+ Object.defineProperty(exports, "Logs", { enumerable: true, get: function () { return base_1.Logs; } });
38
41
  Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return base_1.ActionFilter; } });
39
- Object.defineProperty(exports, "BaseObject", { enumerable: true, get: function () { return base_1.BaseObject; } });
40
42
  Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return base_1.BaseError; } });
41
43
  Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return base_1.Behavior; } });
42
44
  Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return base_1.Component; } });
@@ -51,17 +53,8 @@ Object.defineProperty(exports, "DataErrorDbException", { enumerable: true, get:
51
53
  Object.defineProperty(exports, "ValidationHttpException", { enumerable: true, get: function () { return base_1.ValidationHttpException; } });
52
54
  Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return base_1.Model; } });
53
55
  Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return base_1.ModelManager; } });
54
- var filters_1 = require("./filters");
55
- Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return filters_1.AccessControl; } });
56
- Object.defineProperty(exports, "AccessRule", { enumerable: true, get: function () { return filters_1.AccessRule; } });
57
- var auth_1 = require("./filters/auth");
58
- Object.defineProperty(exports, "JwtHttpBearerAuth", { enumerable: true, get: function () { return auth_1.JwtHttpBearerAuth; } });
59
- Object.defineProperty(exports, "HttpBearerAuth", { enumerable: true, get: function () { return auth_1.HttpBearerAuth; } });
60
- Object.defineProperty(exports, "HttpHeaderAuth", { enumerable: true, get: function () { return auth_1.HttpHeaderAuth; } });
61
- Object.defineProperty(exports, "HttpBasicAuth", { enumerable: true, get: function () { return auth_1.HttpBasicAuth; } });
62
- var decorator_1 = require("./decorator");
63
- Object.defineProperty(exports, "controller", { enumerable: true, get: function () { return decorator_1.controller; } });
64
- Object.defineProperty(exports, "get", { enumerable: true, get: function () { return decorator_1.get; } });
65
- Object.defineProperty(exports, "post", { enumerable: true, get: function () { return decorator_1.post; } });
66
- exports.utils = __importStar(require("./requiments/Utils"));
67
- //# sourceMappingURL=index.js.map
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;
@@ -0,0 +1,7 @@
1
+ export interface RouteDefinition {
2
+ id: string;
3
+ path: string;
4
+ requestMethod: 'get' | 'post' | 'delete' | 'options' | 'put';
5
+ methodName: string;
6
+ }
7
+ //# sourceMappingURL=RouteDefinition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteDefinition.d.ts","sourceRoot":"","sources":["../../src/model/RouteDefinition.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,eAAe;IAE5B,EAAE,EAAC,MAAM,CAAC;IAEV,IAAI,EAAE,MAAM,CAAC;IAEb,aAAa,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IAE7D,UAAU,EAAE,MAAM,CAAC;CACtB"}
@@ -6,4 +6,3 @@
6
6
  * Github:https://github.com/cihan53/
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- //# sourceMappingURL=RouteDefinition.js.map
package/package.json CHANGED
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": "1.2.5-rc.2",
4
- "typings": "dist/index",
3
+ "version": "2.0.0-rc.12",
5
4
  "description": "Nodejs Micro service Framework",
6
5
  "scripts": {
7
- "dev": "nodemon -t --trace-warnings index.ts",
8
- "debug": "ts-node index.ts",
9
- "build": "rmdir /S /Q .\\dist && npx tsc && xcopy .\\log .\\dist\\log /e /i /h /Y && copy .\\package.json .\\dist\\package.json && copy .\\README.md .\\dist\\README.md",
10
6
  "test": "echo \"Error: no test specified\" && exit 1",
11
7
  "postversion": "git push && git push --tags"
12
8
  },
@@ -20,6 +16,9 @@
20
16
  "url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
21
17
  },
22
18
  "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
19
+ "resolutions": {
20
+ "ts-node": "^10.2.0"
21
+ },
23
22
  "dependencies": {
24
23
  "axios": "^0.23.0",
25
24
  "babel-plugin-transform-decorators-legacy": "^1.3.5",
@@ -45,13 +44,14 @@
45
44
  "validate.js": "^0.13.1"
46
45
  },
47
46
  "devDependencies": {
48
- "@types/express": "^4.17.13",
49
- "@types/node": "^16.6.1",
50
47
  "@types/validator": "^13.6.3",
51
- "nodemon": "^2.0.12",
52
- "ts-node": "^10.2.0",
53
- "typescript": "^4.3.5"
48
+ "@types/express": "^4.17.13",
49
+ "@types/node": "^18.6.5",
50
+ "nodemon": "^2.0.19",
51
+ "ts-node": "^10.9.1",
52
+ "typescript": "^4.7.4"
54
53
  },
54
+
55
55
  "keywords": [
56
56
  "Framework",
57
57
  "RespAPI",
@@ -0,0 +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
+ }
19
+ //# sourceMappingURL=AuthAssignment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthAssignment.d.ts","sourceRoot":"","sources":["../../src/rbac/AuthAssignment.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAgB,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjE,qBAAa,mBAAoB,SAAQ,KAAK;IAC1C,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEjB,SAAS;IAGT,UAAU;;;;;;;;;;;IAiBV,IAAI;IAKJ,SAAS,IAAI,QAAQ,EAAE;CAW1B"}
@@ -42,4 +42,3 @@ class AuthAssignmentClass extends base_1.Model {
42
42
  }
43
43
  }
44
44
  exports.AuthAssignmentClass = AuthAssignmentClass;
45
- //# sourceMappingURL=AuthAssignment.js.map
@@ -0,0 +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
+ }
27
+ //# sourceMappingURL=AuthItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthItem.d.ts","sourceRoot":"","sources":["../../src/rbac/AuthItem.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAgB,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjE,qBAAa,aAAc,SAAQ,KAAK;IACpC,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEjB,SAAS;IAIT,UAAU;;;;;;;;;;;;;;;;;;;IAwBV,IAAI;IAKJ,SAAS,IAAI,QAAQ,EAAE;CAU1B"}
package/rbac/AuthItem.js CHANGED
@@ -49,4 +49,3 @@ class AuthItemClass extends base_1.Model {
49
49
  }
50
50
  }
51
51
  exports.AuthItemClass = AuthItemClass;
52
- //# sourceMappingURL=AuthItem.js.map
@@ -0,0 +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
+ }
19
+ //# sourceMappingURL=AuthItemChild.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthItemChild.d.ts","sourceRoot":"","sources":["../../src/rbac/AuthItemChild.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAgB,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjE,qBAAa,kBAAmB,SAAQ,KAAK;IACzC,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAEjB,SAAS;IAIT,UAAU;;;;;;;;;;;IAeV,IAAI;IAKJ,SAAS,IAAI,QAAQ,EAAE;CAU1B"}
@@ -41,4 +41,3 @@ class AuthItemChildClass extends base_1.Model {
41
41
  }
42
42
  }
43
43
  exports.AuthItemChildClass = AuthItemChildClass;
44
- //# sourceMappingURL=AuthItemChild.js.map
@@ -0,0 +1,112 @@
1
+ import { Component } from "../base";
2
+ interface Role {
3
+ type: number;
4
+ name: string;
5
+ description: string;
6
+ ruleName: string;
7
+ data: string;
8
+ params: string;
9
+ }
10
+ export declare class AuthManager extends Component {
11
+ static readonly TYPE_ROLE = 1;
12
+ static readonly TYPE_PERMISSION = 2;
13
+ init(): void;
14
+ /**
15
+ * @var Item[] all auth items (name => Item)
16
+ */
17
+ protected items: any;
18
+ checkAccessAssignments: any;
19
+ defaultRoles: any;
20
+ /**
21
+ *
22
+ */
23
+ checkAccess(userId: number, permissionName: string, params?: any[]): Promise<boolean>;
24
+ checkAccessFromCache(): Promise<void>;
25
+ checkAccessRecursive(user: string | number, itemname: string, params: any[], assignments: any): Promise<boolean>;
26
+ /**
27
+ *
28
+ * @param name
29
+ */
30
+ getItem(name: string): Promise<any>;
31
+ getItems(type: number): Promise<any>;
32
+ getRolesByUser(userId: number): Promise<any>;
33
+ /**
34
+ *
35
+ * @param roleName
36
+ */
37
+ getChildRoles(roleName: string): Promise<any>;
38
+ /**
39
+ *
40
+ * @param roleName
41
+ */
42
+ getPermissionsByRole(roleName: string): Promise<any>;
43
+ /**
44
+ *
45
+ * @param userId
46
+ */
47
+ getPermissionsByUser(userId: number): Promise<any>;
48
+ /**
49
+ * Returns all permissions that are directly assigned to user.
50
+ * @return Permission[] all direct permissions that the user has. The array is indexed by the permission names.
51
+ */
52
+ protected getDirectPermissionsByUser(userId: number): Promise<any>;
53
+ protected getInheritedPermissionsByUser(userId: number): Promise<any>;
54
+ /**
55
+ *
56
+ * @param userId
57
+ */
58
+ getItemsByUser(userId: number): Promise<any>;
59
+ /**
60
+ * Returns all role assignment information for the specified role.
61
+ * @param $roleName
62
+ */
63
+ getUserIdsByRole(roleName: number): Promise<any>;
64
+ /**
65
+ * {@inheritdoc}
66
+ */
67
+ getRole(name: string): Promise<Role | null>;
68
+ /**
69
+ * {@inheritdoc}
70
+ */
71
+ getRoles(): Promise<any>;
72
+ /**
73
+ * Recursively finds all children and grand children of the specified item.
74
+ * @param string $name the name of the item whose children are to be looked for.
75
+ * @param array $childrenList the child list built via [[getChildrenList()]]
76
+ * @param array $result the children and grand children (in array keys)
77
+ */
78
+ protected getChildrenRecursive(name: string, childrenList: any, model: any): void;
79
+ /**
80
+ *
81
+ * @param roleName
82
+ * @param userId
83
+ */
84
+ getAssignment(roleName: string, userId: string): any;
85
+ /**
86
+ *
87
+ */
88
+ getAssignments(userId: number): Promise<any>;
89
+ /**
90
+ * Returns the children for every parent.
91
+ * @return array the children list. Each array key is a parent item name,
92
+ * and the corresponding array value is a list of child item names.
93
+ */
94
+ protected getChildrenList(): Promise<any>;
95
+ /**
96
+ * Check whether $userId is empty.
97
+ * @param mixed $userId
98
+ * @return bool
99
+ * @since 2.0.26
100
+ */
101
+ protected isEmptyUserId(userId: string): boolean;
102
+ /**
103
+ * Checks whether array of $assignments is empty and [[defaultRoles]] property is empty as well.
104
+ *
105
+ * @param Assignment[] $assignments array of user's assignments
106
+ * @return bool whether array of $assignments is empty and [[defaultRoles]] property is empty as well
107
+ * @since 2.0.11
108
+ */
109
+ protected hasNoAssignments(assignments: any): any;
110
+ }
111
+ export {};
112
+ //# sourceMappingURL=AuthManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthManager.d.ts","sourceRoot":"","sources":["../../src/rbac/AuthManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAuC,MAAM,SAAS,CAAC;AAKxE,UAAU,IAAI;IACV,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAYD,qBAAa,WAAY,SAAQ,SAAS;IACtC,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK;IAC9B,MAAM,CAAC,QAAQ,CAAC,eAAe,KAAK;IAEpC,IAAI;IAIJ;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACrB,sBAAsB,EAAE,GAAG,CAAK;IAChC,YAAY,EAAE,GAAG,CAAK;IAGtB;;OAEG;IAEU,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAE,GAAG,EAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBhG,oBAAoB;IAKb,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IA4B7H;;;OAGG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM;IAOpB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAYrB,cAAc,CAAC,MAAM,EAAE,MAAM;IAyB1C;;;OAGG;IACU,aAAa,CAAC,QAAQ,EAAE,MAAM;IAoB3C;;;OAGG;IACU,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IAuBlD;;;OAGG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAYhD;;;OAGG;cACa,0BAA0B,CAAC,MAAM,EAAE,MAAM;cAuBzC,6BAA6B,CAAC,MAAM,EAAE,MAAM;IA4B5D;;;OAGG;IACU,cAAc,CAAC,MAAM,EAAE,MAAM;IAc1C;;;OAGG;IACU,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAO9C;;OAEG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM;IAMjC;;OAEG;IACI,QAAQ;IAIf;;;;;OAKG;IACH,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;IAW1E;;;;OAIG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQrD;;OAEG;IACU,cAAc,CAAC,MAAM,EAAE,MAAM;IAkB1C;;;;OAIG;cACa,eAAe;IAU/B;;;;;OAKG;IACH,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;IAItC;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG;CAG9C"}