chyz 1.2.5-rc.2 → 2.0.0-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 (223) hide show
  1. package/BaseChyz.d.ts +61 -0
  2. package/BaseChyz.d.ts.map +1 -0
  3. package/BaseChyz.js +11 -15
  4. package/base/ActionFilter.d.ts +33 -0
  5. package/base/ActionFilter.d.ts.map +1 -0
  6. package/base/ActionFilter.js +18 -14
  7. package/base/BaseError.d.ts +11 -0
  8. package/base/BaseError.d.ts.map +1 -0
  9. package/base/BaseError.js +0 -1
  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/CWebController.d.ts +44 -0
  17. package/base/CWebController.d.ts.map +1 -0
  18. package/base/CWebController.js +0 -1
  19. package/base/Component.d.ts +21 -0
  20. package/base/Component.d.ts.map +1 -0
  21. package/base/Component.js +5 -6
  22. package/base/Configurable.d.ts +3 -0
  23. package/base/Configurable.d.ts.map +1 -0
  24. package/base/Configurable.js +0 -1
  25. package/base/DataErrorDbException.d.ts +6 -0
  26. package/base/DataErrorDbException.d.ts.map +1 -0
  27. package/base/DataErrorDbException.js +0 -1
  28. package/base/DbConnection.d.ts +13 -0
  29. package/base/DbConnection.d.ts.map +1 -0
  30. package/base/DbConnection.js +1 -2
  31. package/base/ForbiddenHttpException.d.ts +5 -0
  32. package/base/ForbiddenHttpException.d.ts.map +1 -0
  33. package/base/ForbiddenHttpException.js +0 -1
  34. package/base/InvalidArgumentException.d.ts +6 -0
  35. package/base/InvalidArgumentException.d.ts.map +1 -0
  36. package/base/InvalidArgumentException.js +0 -1
  37. package/base/InvalidConfigException.d.ts +6 -0
  38. package/base/InvalidConfigException.d.ts.map +1 -0
  39. package/base/InvalidConfigException.js +0 -1
  40. package/base/Logger.d.ts +18 -0
  41. package/base/Logger.d.ts.map +1 -0
  42. package/base/Logger.js +49 -0
  43. package/base/Model.d.ts +299 -0
  44. package/base/Model.d.ts.map +1 -0
  45. package/base/Model.js +0 -1
  46. package/base/ModelManager.d.ts +2 -0
  47. package/base/ModelManager.d.ts.map +1 -0
  48. package/base/ModelManager.js +11 -1
  49. package/base/NotFoundHttpException.d.ts +6 -0
  50. package/base/NotFoundHttpException.d.ts.map +1 -0
  51. package/base/NotFoundHttpException.js +0 -1
  52. package/base/RestClient.d.ts +9 -0
  53. package/base/RestClient.d.ts.map +1 -0
  54. package/base/RestClient.js +0 -1
  55. package/base/UnauthorizedHttpException.d.ts +6 -0
  56. package/base/UnauthorizedHttpException.d.ts.map +1 -0
  57. package/base/UnauthorizedHttpException.js +0 -1
  58. package/base/ValidationHttpException.d.ts +6 -0
  59. package/base/ValidationHttpException.d.ts.map +1 -0
  60. package/base/ValidationHttpException.js +0 -1
  61. package/base/db/Exception.d.ts +7 -0
  62. package/base/db/Exception.d.ts.map +1 -0
  63. package/base/db/Exception.js +0 -1
  64. package/base/index.d.ts +18 -0
  65. package/base/index.d.ts.map +1 -0
  66. package/base/index.js +3 -6
  67. package/decorator/Middleware.d.ts +4 -0
  68. package/decorator/Middleware.d.ts.map +1 -0
  69. package/decorator/Middleware.js +0 -1
  70. package/decorator/controller.d.ts +3 -0
  71. package/decorator/controller.d.ts.map +1 -0
  72. package/decorator/controller.js +0 -1
  73. package/decorator/enums/ControllerDecoratorParams.d.ts +6 -0
  74. package/decorator/enums/ControllerDecoratorParams.d.ts.map +1 -0
  75. package/decorator/enums/ControllerDecoratorParams.js +0 -1
  76. package/decorator/get.d.ts +3 -0
  77. package/decorator/get.d.ts.map +1 -0
  78. package/decorator/get.js +0 -1
  79. package/decorator/index.d.ts +4 -0
  80. package/decorator/index.d.ts.map +1 -0
  81. package/decorator/index.js +0 -1
  82. package/decorator/post.d.ts +3 -0
  83. package/decorator/post.d.ts.map +1 -0
  84. package/decorator/post.js +0 -1
  85. package/filters/AccessControl.d.ts +13 -0
  86. package/filters/AccessControl.d.ts.map +1 -0
  87. package/filters/AccessControl.js +4 -5
  88. package/filters/AccessRule.d.ts +83 -0
  89. package/filters/AccessRule.d.ts.map +1 -0
  90. package/filters/AccessRule.js +2 -2
  91. package/filters/auth/AuthInterface.d.ts +26 -0
  92. package/filters/auth/AuthInterface.d.ts.map +1 -0
  93. package/filters/auth/AuthInterface.js +0 -1
  94. package/filters/auth/AuthMethod.d.ts +38 -0
  95. package/filters/auth/AuthMethod.d.ts.map +1 -0
  96. package/filters/auth/AuthMethod.js +12 -1
  97. package/filters/auth/HttpBasicAuth.d.ts +23 -0
  98. package/filters/auth/HttpBasicAuth.d.ts.map +1 -0
  99. package/filters/auth/HttpBasicAuth.js +0 -1
  100. package/filters/auth/HttpBearerAuth.d.ts +18 -0
  101. package/filters/auth/HttpBearerAuth.d.ts.map +1 -0
  102. package/filters/auth/HttpBearerAuth.js +0 -1
  103. package/filters/auth/HttpHeaderAuth.d.ts +15 -0
  104. package/filters/auth/HttpHeaderAuth.d.ts.map +1 -0
  105. package/filters/auth/HttpHeaderAuth.js +0 -1
  106. package/filters/auth/JwtHttpBearerAuth.d.ts +21 -0
  107. package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -0
  108. package/filters/auth/JwtHttpBearerAuth.js +0 -1
  109. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +23 -0
  110. package/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +1 -0
  111. package/filters/auth/KeyCloakHttpBearerAuth.js +0 -1
  112. package/filters/auth/index.d.ts +5 -0
  113. package/filters/auth/index.d.ts.map +1 -0
  114. package/filters/auth/index.js +0 -1
  115. package/filters/index.d.ts +3 -0
  116. package/filters/index.d.ts.map +1 -0
  117. package/filters/index.js +0 -1
  118. package/index.d.ts +17 -0
  119. package/index.d.ts.map +1 -0
  120. package/index.js +21 -17
  121. package/model/RouteDefinition.d.ts +7 -0
  122. package/model/RouteDefinition.d.ts.map +1 -0
  123. package/model/RouteDefinition.js +0 -1
  124. package/package.json +12 -10
  125. package/rbac/AuthAssignment.d.ts +19 -0
  126. package/rbac/AuthAssignment.d.ts.map +1 -0
  127. package/rbac/AuthAssignment.js +0 -1
  128. package/rbac/AuthItem.d.ts +27 -0
  129. package/rbac/AuthItem.d.ts.map +1 -0
  130. package/rbac/AuthItem.js +0 -1
  131. package/rbac/AuthItemChild.d.ts +19 -0
  132. package/rbac/AuthItemChild.d.ts.map +1 -0
  133. package/rbac/AuthItemChild.js +0 -1
  134. package/rbac/AuthManager.d.ts +112 -0
  135. package/rbac/AuthManager.d.ts.map +1 -0
  136. package/rbac/AuthManager.js +0 -1
  137. package/requiments/Glob.d.ts +3 -0
  138. package/requiments/Glob.d.ts.map +1 -0
  139. package/requiments/Glob.js +0 -1
  140. package/requiments/ReflectUtil.d.ts +1 -0
  141. package/requiments/ReflectUtil.d.ts.map +1 -0
  142. package/requiments/ReflectUtil.js +0 -1
  143. package/requiments/Utils.d.ts +3 -0
  144. package/requiments/Utils.d.ts.map +1 -0
  145. package/requiments/Utils.js +7 -1
  146. package/validators/BooleanValidator.d.ts +1 -0
  147. package/validators/BooleanValidator.d.ts.map +1 -0
  148. package/validators/BooleanValidator.js +0 -1
  149. package/validators/CompareValidator.d.ts +1 -0
  150. package/validators/CompareValidator.d.ts.map +1 -0
  151. package/validators/CompareValidator.js +0 -1
  152. package/validators/DateValidator.d.ts +1 -0
  153. package/validators/DateValidator.d.ts.map +1 -0
  154. package/validators/DateValidator.js +0 -1
  155. package/validators/EmailValidator.d.ts +1 -0
  156. package/validators/EmailValidator.d.ts.map +1 -0
  157. package/validators/EmailValidator.js +0 -1
  158. package/validators/Validator.d.ts +18 -0
  159. package/validators/Validator.d.ts.map +1 -0
  160. package/validators/Validator.js +0 -1
  161. package/web/IdentityInterface.d.ts +55 -0
  162. package/web/IdentityInterface.d.ts.map +1 -0
  163. package/web/IdentityInterface.js +0 -1
  164. package/web/WebUser.d.ts +72 -0
  165. package/web/WebUser.d.ts.map +1 -0
  166. package/web/WebUser.js +0 -1
  167. package/BaseChyz.js.map +0 -1
  168. package/Chyz.js +0 -15
  169. package/Chyz.js.map +0 -1
  170. package/base/ActionFilter.js.map +0 -1
  171. package/base/BaseError.js.map +0 -1
  172. package/base/BaseObject.js +0 -20
  173. package/base/BaseObject.js.map +0 -1
  174. package/base/Behavior.js.map +0 -1
  175. package/base/CWebController.js.map +0 -1
  176. package/base/Component.js.map +0 -1
  177. package/base/Configurable.js.map +0 -1
  178. package/base/DataErrorDbException.js.map +0 -1
  179. package/base/DbConnection.js.map +0 -1
  180. package/base/ForbiddenHttpException.js.map +0 -1
  181. package/base/InvalidArgumentException.js.map +0 -1
  182. package/base/InvalidConfigException.js.map +0 -1
  183. package/base/Model.js.map +0 -1
  184. package/base/ModelManager.js.map +0 -1
  185. package/base/NotFoundHttpException.js.map +0 -1
  186. package/base/RestClient.js.map +0 -1
  187. package/base/UnauthorizedHttpException.js.map +0 -1
  188. package/base/ValidationHttpException.js.map +0 -1
  189. package/base/db/Exception.js.map +0 -1
  190. package/base/index.js.map +0 -1
  191. package/decorator/Middleware.js.map +0 -1
  192. package/decorator/controller.js.map +0 -1
  193. package/decorator/enums/ControllerDecoratorParams.js.map +0 -1
  194. package/decorator/get.js.map +0 -1
  195. package/decorator/index.js.map +0 -1
  196. package/decorator/post.js.map +0 -1
  197. package/filters/AccessControl.js.map +0 -1
  198. package/filters/AccessRule.js.map +0 -1
  199. package/filters/auth/AuthInterface.js.map +0 -1
  200. package/filters/auth/AuthMethod.js.map +0 -1
  201. package/filters/auth/HttpBasicAuth.js.map +0 -1
  202. package/filters/auth/HttpBearerAuth.js.map +0 -1
  203. package/filters/auth/HttpHeaderAuth.js.map +0 -1
  204. package/filters/auth/JwtHttpBearerAuth.js.map +0 -1
  205. package/filters/auth/KeyCloakHttpBearerAuth.js.map +0 -1
  206. package/filters/auth/index.js.map +0 -1
  207. package/filters/index.js.map +0 -1
  208. package/index.js.map +0 -1
  209. package/model/RouteDefinition.js.map +0 -1
  210. package/rbac/AuthAssignment.js.map +0 -1
  211. package/rbac/AuthItem.js.map +0 -1
  212. package/rbac/AuthItemChild.js.map +0 -1
  213. package/rbac/AuthManager.js.map +0 -1
  214. package/requiments/Glob.js.map +0 -1
  215. package/requiments/ReflectUtil.js.map +0 -1
  216. package/requiments/Utils.js.map +0 -1
  217. package/validators/BooleanValidator.js.map +0 -1
  218. package/validators/CompareValidator.js.map +0 -1
  219. package/validators/DateValidator.js.map +0 -1
  220. package/validators/EmailValidator.js.map +0 -1
  221. package/validators/Validator.js.map +0 -1
  222. package/web/IdentityInterface.js.map +0 -1
  223. package/web/WebUser.js.map +0 -1
@@ -0,0 +1,83 @@
1
+ import { WebUser } from "../web/WebUser";
2
+ import { Component } from "../base/Component";
3
+ import { Request } from "express";
4
+ export declare class AccessRule extends Component {
5
+ /**
6
+ * @var bool whether this is an 'allow' rule or 'deny' rule.
7
+ */
8
+ allow: any;
9
+ /**
10
+ * @var array list of action IDs that this rule applies to. The comparison is case-sensitive.
11
+ * If not set or empty, it means this rule applies to all actions.
12
+ */
13
+ actions: any;
14
+ /**
15
+ * @var array list of the controller IDs that this rule applies to.
16
+ */
17
+ controllers: any;
18
+ /**
19
+ * - `?`: matches a guest user (not authenticated yet)
20
+ * - `@`: matches an authenticated user
21
+ */
22
+ roles: any;
23
+ /**
24
+ * @var array list of RBAC (Role-Based Access Control) permissions that this rules applies to.
25
+ */
26
+ permissions: any;
27
+ /**
28
+ * @var array|Closure parameters to pass to the [[User::can()]] function for evaluating
29
+ * user permissions in [[$roles]].
30
+ *
31
+ * If this is an array, it will be passed directly to [[User::can()]]. For example for passing an
32
+ * ID from the current request, you may use the following:
33
+ *
34
+ * ```php
35
+ * ['postId' => Yii::$app->request->get('id')]
36
+ * ```
37
+ *
38
+ * You may also specify a closure that returns an array. This can be used to
39
+ * evaluate the array values only if they are needed, for example when a model needs to be
40
+ * loaded like in the following code:
41
+ *
42
+ * ```php
43
+ * 'rules' => [
44
+ * [
45
+ * 'allow' => true,
46
+ * 'actions' => ['update'],
47
+ * 'roles' => ['updatePost'],
48
+ * 'roleParams' => function($rule) {
49
+ * return ['post' => Post::findOne(Yii::$app->request->get('id'))];
50
+ * },
51
+ * ],
52
+ * ],
53
+ * ```
54
+ *
55
+ * A reference to the [[AccessRule]] instance will be passed to the closure as the first parameter.
56
+ *
57
+ * @see roles
58
+ * @since 2.0.12
59
+ */
60
+ roleParams: any;
61
+ /**
62
+ * @var array list of user IP addresses that this rule applies to. An IP address
63
+ * can contain the wildcard `*` at the end so that it matches IP addresses with the same prefix.
64
+ * For example, '192.168.*' matches all IP addresses in the segment '192.168.'.
65
+ * It may also contain a pattern/mask like '172.16.0.0/12' which would match all IPs from the
66
+ * 20-bit private network block in RFC1918.
67
+ * If not set or empty, it means this rule applies to all IP addresses.
68
+ */
69
+ ips: any;
70
+ allows(action: any, user: WebUser, request: Request): Promise<any>;
71
+ /**
72
+ * @param Action $action the action
73
+ * @return bool whether the rule applies to the action
74
+ */
75
+ protected matchAction(action: any): any;
76
+ /**
77
+ * @param Controller $controller the controller
78
+ * @return bool whether the rule applies to the controller
79
+ */
80
+ protected matchController(controller: any): boolean;
81
+ protected matchRole(user: WebUser): Promise<boolean>;
82
+ }
83
+ //# sourceMappingURL=AccessRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessRule.d.ts","sourceRoot":"","sources":["../../src/filters/AccessRule.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAKhC,qBAAa,UAAW,SAAQ,SAAS;IAErC;;OAEG;IACI,KAAK,EAAE,GAAG,CAAC;IAClB;;;OAGG;IACI,OAAO,EAAE,GAAG,CAAC;IAEpB;;OAEG;IACI,WAAW,EAAE,GAAG,CAAC;IAExB;;;OAGG;IAEI,KAAK,EAAE,GAAG,CAAC;IAElB;;OAEG;IACI,WAAW,EAAE,GAAG,CAAC;IAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACI,UAAU,EAAE,GAAG,CAAM;IAG5B;;;;;;;OAOG;IACI,GAAG,EAAE,GAAG,CAAC;IAGH,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;IAoBhE;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG;IAIjC;;;OAGG;IACH,SAAS,CAAC,eAAe,CAAC,UAAU,EAAE,GAAG;cAezB,SAAS,CAAC,IAAI,EAAE,OAAO;CA6C1C"}
@@ -13,10 +13,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.AccessRule = void 0;
16
- var _ = require('lodash');
17
16
  const Component_1 = require("../base/Component");
18
17
  const InvalidConfigException_1 = require("../base/InvalidConfigException");
19
18
  const Utils_1 = __importDefault(require("../requiments/Utils"));
19
+ var _ = require('lodash');
20
20
  class AccessRule extends Component_1.Component {
21
21
  constructor() {
22
22
  super(...arguments);
@@ -109,6 +109,7 @@ class AccessRule extends Component_1.Component {
109
109
  if (!user) {
110
110
  throw new InvalidConfigException_1.InvalidConfigException('The user application component must be available to specify roles in AccessRule.');
111
111
  }
112
+ // @ts-ignore
112
113
  let roleParams = [];
113
114
  for (const itemsKey in items) {
114
115
  let item = items[itemsKey];
@@ -137,4 +138,3 @@ class AccessRule extends Component_1.Component {
137
138
  }
138
139
  }
139
140
  exports.AccessRule = AccessRule;
140
- //# sourceMappingURL=AccessRule.js.map
@@ -0,0 +1,26 @@
1
+ import { Request, Response } from "express";
2
+ export interface AuthInterface {
3
+ /**
4
+ * Authenticates the current user.
5
+ * @param User $user
6
+ * @param Request $request
7
+ * @param Response $response
8
+ * @return IdentityInterface the authenticated user identity. If authentication information is not provided, null will be returned.
9
+ * @throws UnauthorizedHttpException if authentication information is provided but is invalid.
10
+ */
11
+ authenticate(user: any, request: Request, response: Response): any;
12
+ /**
13
+ * Generates challenges upon authentication failure.
14
+ * For example, some appropriate HTTP headers may be generated.
15
+ * @param Response $response
16
+ */
17
+ challenge(response: Response): Response;
18
+ /**
19
+ * Handles authentication failure.
20
+ * The implementation should normally throw UnauthorizedHttpException to indicate authentication failure.
21
+ * @param Response $response
22
+ * @throws UnauthorizedHttpException
23
+ */
24
+ handleFailure(response: Response): Response;
25
+ }
26
+ //# sourceMappingURL=AuthInterface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthInterface.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/AuthInterface.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC1B;;;;;;;OAOG;IACF,YAAY,CAAC,IAAI,EAAC,GAAG,EAAE,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,QAAQ,GAAE,GAAG,CAAC;IAEhE;;;;OAIG;IACF,SAAS,CAAC,QAAQ,EAAC,QAAQ,GAAE,QAAQ,CAAC;IAEvC;;;;;OAKG;IACF,aAAa,CAAC,QAAQ,EAAC,QAAQ,GAAE,QAAQ,CAAC;CAC9C"}
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AuthInterface.js.map
@@ -0,0 +1,38 @@
1
+ import { ActionFilter } from "../../base/ActionFilter";
2
+ import { AuthInterface } from "./AuthInterface";
3
+ import { WebUser } from "../../web/WebUser";
4
+ import { Request, Response } from "express";
5
+ export declare abstract class AuthMethod extends ActionFilter implements AuthInterface {
6
+ /**
7
+ * @var User the user object representing the user authentication status. If not set, the `user` application component will be used.
8
+ */
9
+ user: WebUser | undefined;
10
+ /**
11
+ * @var Request the current request. If not set, the `request` application component will be used.
12
+ */
13
+ request: Request | undefined;
14
+ /**
15
+ * @var Response the response to be sent. If not set, the `response` application component will be used.
16
+ */
17
+ response: Response | undefined;
18
+ optional: never[];
19
+ /**
20
+ *
21
+ * @param action
22
+ * @param request
23
+ * @param response
24
+ */
25
+ beforeAction(action: any, request: Request, response: Response): Promise<boolean>;
26
+ /**
27
+ *
28
+ * @param user
29
+ * @param request
30
+ * @param response
31
+ */
32
+ authenticate(user: WebUser, request: Request, response: Response): void;
33
+ challenge(response: Response): void;
34
+ handleFailure(response: Response): void;
35
+ getHeaderByKey(headers: any, findKey: any): any;
36
+ patternCheck(headerText: any, pattern: RegExp): any;
37
+ }
38
+ //# sourceMappingURL=AuthMethod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthMethod.d.ts","sourceRoot":"","sources":["../../../src/filters/auth/AuthMethod.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAE1C,8BAAsB,UAAW,SAAQ,YAAa,YAAW,aAAa;IAE1E;;OAEG;IACI,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACI,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAEpC;;OAEG;IACI,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAG/B,QAAQ,UAAM;IAErB;;;;;OAKG;IACU,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAoB3E;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAKhE,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAKnC,aAAa,CAAC,QAAQ,EAAE,QAAQ;IAIhC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;IASzC,YAAY,CAAC,UAAU,EAAC,GAAG,EAAE,OAAO,EAAC,MAAM;CAY9C"}
@@ -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"}
@@ -58,4 +58,3 @@ class HttpHeaderAuth extends AuthMethod_1.AuthMethod {
58
58
  }
59
59
  }
60
60
  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,17 @@
1
+ import RestClient from "./base/RestClient";
2
+ import BaseChyz from "./BaseChyz";
3
+ /**
4
+ *
5
+ */
6
+ declare const Chyz: BaseChyz;
7
+ export { Request, Response, NextFunction } from "express";
8
+ export { RouteDefinition } from "./model/RouteDefinition";
9
+ export { WebUser } from "./web/WebUser";
10
+ export { BaseChyz, RestClient };
11
+ export { ActionFilter, BaseError, Behavior, Component, Configurable, CWebController, DbConnection, ForbiddenHttpException, InvalidConfigException, InvalidArgumentException, NotFoundHttpException, UnauthorizedHttpException, DataErrorDbException, ValidationHttpException, Model, ModelManager, } from "./base";
12
+ export * from "./filters";
13
+ export * from "./filters/auth";
14
+ export * from "./decorator";
15
+ export * as utils from "./requiments/Utils";
16
+ export default Chyz;
17
+ //# 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":"AASA,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC;;GAEG;AACH,QAAA,MAAM,IAAI,UAAiB,CAAC;AAC5B,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACxD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,QAAQ,EAAC,UAAU,EAAC,CAAA;AAC5B,OAAO,EACH,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,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAC5C,eAAe,IAAI,CAAC"}
package/index.js CHANGED
@@ -1,7 +1,19 @@
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];
@@ -11,6 +23,9 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
11
23
  }) : function(o, v) {
12
24
  o["default"] = v;
13
25
  });
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
14
29
  var __importStar = (this && this.__importStar) || function (mod) {
15
30
  if (mod && mod.__esModule) return mod;
16
31
  var result = {};
@@ -22,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
38
  };
24
39
  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;
40
+ exports.utils = 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.RestClient = exports.BaseChyz = exports.WebUser = void 0;
26
41
  const RestClient_1 = __importDefault(require("./base/RestClient"));
27
42
  exports.RestClient = RestClient_1.default;
28
43
  const BaseChyz_1 = __importDefault(require("./BaseChyz"));
@@ -33,10 +48,8 @@ exports.BaseChyz = BaseChyz_1.default;
33
48
  const Chyz = new BaseChyz_1.default();
34
49
  var WebUser_1 = require("./web/WebUser");
35
50
  Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
36
- exports.default = Chyz;
37
51
  var base_1 = require("./base");
38
52
  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
53
  Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return base_1.BaseError; } });
41
54
  Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return base_1.Behavior; } });
42
55
  Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return base_1.Component; } });
@@ -51,17 +64,8 @@ Object.defineProperty(exports, "DataErrorDbException", { enumerable: true, get:
51
64
  Object.defineProperty(exports, "ValidationHttpException", { enumerable: true, get: function () { return base_1.ValidationHttpException; } });
52
65
  Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return base_1.Model; } });
53
66
  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; } });
67
+ __exportStar(require("./filters"), exports);
68
+ __exportStar(require("./filters/auth"), exports);
69
+ __exportStar(require("./decorator"), exports);
66
70
  exports.utils = __importStar(require("./requiments/Utils"));
67
- //# sourceMappingURL=index.js.map
71
+ 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,10 @@
1
1
  {
2
2
  "name": "chyz",
3
- "version": "1.2.5-rc.2",
4
- "typings": "dist/index",
3
+ "version": "2.0.0-rc.4",
4
+ "main":"./index.js",
5
+ "type": "./index.d.ts",
5
6
  "description": "Nodejs Micro service Framework",
6
7
  "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
8
  "test": "echo \"Error: no test specified\" && exit 1",
11
9
  "postversion": "git push && git push --tags"
12
10
  },
@@ -20,6 +18,9 @@
20
18
  "url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
21
19
  },
22
20
  "homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
21
+ "resolutions": {
22
+ "ts-node": "^10.2.0"
23
+ },
23
24
  "dependencies": {
24
25
  "axios": "^0.23.0",
25
26
  "babel-plugin-transform-decorators-legacy": "^1.3.5",
@@ -45,13 +46,14 @@
45
46
  "validate.js": "^0.13.1"
46
47
  },
47
48
  "devDependencies": {
48
- "@types/express": "^4.17.13",
49
- "@types/node": "^16.6.1",
50
49
  "@types/validator": "^13.6.3",
51
- "nodemon": "^2.0.12",
52
- "ts-node": "^10.2.0",
53
- "typescript": "^4.3.5"
50
+ "@types/express": "^4.17.13",
51
+ "@types/node": "^18.6.5",
52
+ "nodemon": "^2.0.19",
53
+ "ts-node": "^10.9.1",
54
+ "typescript": "^4.7.4"
54
55
  },
56
+
55
57
  "keywords": [
56
58
  "Framework",
57
59
  "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"}