chyz 1.2.5-rc.0 → 2.0.0-rc.11

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 +60 -0
  2. package/BaseChyz.d.ts.map +1 -0
  3. package/BaseChyz.js +121 -82
  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 +7 -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 +26 -32
  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
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModelManager = void 0;
4
+ /*
5
+ *
6
+ * Copyright (c) 2021.. Chy Bilgisayar Bilisim
7
+ * Author: Cihan Ozturk
8
+ * E-mail: cihan@chy.com.tr
9
+ * Github:https://github.com/cihan53/
10
+ *
11
+ */
12
+ // interface ObjectConstructor {
13
+ // _register(o: Model): void;
14
+ // }
4
15
  exports.ModelManager = {
5
16
  _register(map) {
6
17
  Object.assign(this, map);
7
18
  }
8
19
  };
9
- //# sourceMappingURL=ModelManager.js.map
@@ -0,0 +1,6 @@
1
+ import { BaseError } from "./BaseError";
2
+ export declare class NotFoundHttpException extends BaseError {
3
+ message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=NotFoundHttpException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotFoundHttpException.d.ts","sourceRoot":"","sources":["../../src/base/NotFoundHttpException.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,qBAAsB,SAAQ,SAAS;IAC3B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAGvC"}
@@ -15,4 +15,3 @@ class NotFoundHttpException extends BaseError_1.BaseError {
15
15
  }
16
16
  }
17
17
  exports.NotFoundHttpException = NotFoundHttpException;
18
- //# sourceMappingURL=NotFoundHttpException.js.map
@@ -0,0 +1,7 @@
1
+ import { Component } from "./Component";
2
+ export declare class RestClient extends Component {
3
+ post(url: string, args: any[], headers?: any): any;
4
+ get(url: string, args: any[], headers?: any): any;
5
+ Rest(params: any): any;
6
+ }
7
+ //# sourceMappingURL=RestClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RestClient.d.ts","sourceRoot":"","sources":["../../src/base/RestClient.ts"],"names":[],"mappings":"AAUA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAItC,qBAAa,UAAW,SAAQ,SAAS;IAC9B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,OAAO,GAAC,GAAM;IAI5C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,OAAO,GAAC,GAAM;IAI3C,IAAI,CAAC,MAAM,EAAE,GAAG;CAG1B"}
@@ -23,5 +23,3 @@ class RestClient extends Component_1.Component {
23
23
  }
24
24
  }
25
25
  exports.RestClient = RestClient;
26
- exports.default = new RestClient();
27
- //# sourceMappingURL=RestClient.js.map
@@ -0,0 +1,6 @@
1
+ import { BaseError } from "./BaseError";
2
+ export declare class UnauthorizedHttpException extends BaseError {
3
+ message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=UnauthorizedHttpException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnauthorizedHttpException.d.ts","sourceRoot":"","sources":["../../src/base/UnauthorizedHttpException.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,yBAA0B,SAAQ,SAAS;IAC/B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAIvC"}
@@ -15,4 +15,3 @@ class UnauthorizedHttpException extends BaseError_1.BaseError {
15
15
  }
16
16
  }
17
17
  exports.UnauthorizedHttpException = UnauthorizedHttpException;
18
- //# sourceMappingURL=UnauthorizedHttpException.js.map
@@ -0,0 +1,6 @@
1
+ import { BaseError } from "./BaseError";
2
+ export declare class ValidationHttpException extends BaseError {
3
+ message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=ValidationHttpException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationHttpException.d.ts","sourceRoot":"","sources":["../../src/base/ValidationHttpException.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,uBAAwB,SAAQ,SAAS;IAC7B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAGvC"}
@@ -15,4 +15,3 @@ class ValidationHttpException extends BaseError_1.BaseError {
15
15
  }
16
16
  }
17
17
  exports.ValidationHttpException = ValidationHttpException;
18
- //# sourceMappingURL=ValidationHttpException.js.map
@@ -0,0 +1,7 @@
1
+ import { BaseError } from "../BaseError";
2
+ export declare class Exception extends BaseError {
3
+ errorInfo: never[];
4
+ protected code: string;
5
+ constructor(message: string, errorInfo?: any, code?: string, previous?: null);
6
+ }
7
+ //# sourceMappingURL=Exception.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exception.d.ts","sourceRoot":"","sources":["../../../src/base/db/Exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAEvC,qBAAa,SAAU,SAAQ,SAAS;IAC7B,SAAS,UAAM;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,SAAS,GAAC,GAAQ,EAAE,IAAI,SAAK,EAAE,QAAQ,OAAO;CAO9E"}
@@ -13,4 +13,3 @@ class Exception extends BaseError_1.BaseError {
13
13
  }
14
14
  }
15
15
  exports.Exception = Exception;
16
- //# sourceMappingURL=Exception.js.map
@@ -0,0 +1,19 @@
1
+ export { Logs } from "./Logs";
2
+ export { BaseError } from "./BaseError";
3
+ export { ActionFilter } from "./ActionFilter";
4
+ export { Behavior } from "./Behavior";
5
+ export { Component } from "./Component";
6
+ export { Configurable } from "./Configurable";
7
+ export { CWebController } from "./CWebController";
8
+ export { DbConnection } from "./DbConnection";
9
+ export { ForbiddenHttpException } from "./ForbiddenHttpException";
10
+ export { InvalidConfigException } from "./InvalidConfigException";
11
+ export { InvalidArgumentException } from "./InvalidArgumentException";
12
+ export { NotFoundHttpException } from "./NotFoundHttpException";
13
+ export { UnauthorizedHttpException } from "./UnauthorizedHttpException";
14
+ export { DataErrorDbException } from "./DataErrorDbException";
15
+ export { ValidationHttpException } from "./ValidationHttpException";
16
+ export { Model, Relation, DataTypes, NOW } from "./Model";
17
+ export { RestClient } from "./RestClient";
18
+ export { ModelManager } from "./ModelManager";
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACnC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,SAAS,CAAA;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA"}
package/base/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModelManager = exports.NOW = exports.DataTypes = 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 = void 0;
4
- var ActionFilter_1 = require("./ActionFilter");
5
- Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return ActionFilter_1.ActionFilter; } });
6
- var BaseObject_1 = require("./BaseObject");
7
- Object.defineProperty(exports, "BaseObject", { enumerable: true, get: function () { return BaseObject_1.BaseObject; } });
3
+ exports.ModelManager = exports.RestClient = exports.NOW = exports.DataTypes = 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.ActionFilter = exports.BaseError = exports.Logs = void 0;
4
+ var Logs_1 = require("./Logs");
5
+ Object.defineProperty(exports, "Logs", { enumerable: true, get: function () { return Logs_1.Logs; } });
8
6
  var BaseError_1 = require("./BaseError");
9
7
  Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return BaseError_1.BaseError; } });
8
+ var ActionFilter_1 = require("./ActionFilter");
9
+ Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return ActionFilter_1.ActionFilter; } });
10
10
  var Behavior_1 = require("./Behavior");
11
11
  Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return Behavior_1.Behavior; } });
12
12
  var Component_1 = require("./Component");
@@ -33,6 +33,7 @@ var Model_1 = require("./Model");
33
33
  Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return Model_1.Model; } });
34
34
  Object.defineProperty(exports, "DataTypes", { enumerable: true, get: function () { return Model_1.DataTypes; } });
35
35
  Object.defineProperty(exports, "NOW", { enumerable: true, get: function () { return Model_1.NOW; } });
36
+ var RestClient_1 = require("./RestClient");
37
+ Object.defineProperty(exports, "RestClient", { enumerable: true, get: function () { return RestClient_1.RestClient; } });
36
38
  var ModelManager_1 = require("./ModelManager");
37
39
  Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return ModelManager_1.ModelManager; } });
38
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import "reflect-metadata";
2
+ import { RequestHandler } from "express";
3
+ export declare function Middleware(middlewares: RequestHandler[]): Function;
4
+ //# sourceMappingURL=Middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Middleware.d.ts","sourceRoot":"","sources":["../../src/decorator/Middleware.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,UAAU,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,QAAQ,CAIlE"}
@@ -9,4 +9,3 @@ function Middleware(middlewares) {
9
9
  };
10
10
  }
11
11
  exports.Middleware = Middleware;
12
- //# sourceMappingURL=Middleware.js.map
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export declare const controller: (prefix?: string) => ClassDecorator;
3
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/decorator/controller.ts"],"names":[],"mappings":"AAQA,OAAQ,kBAAkB,CAAC;AAC3B,eAAO,MAAM,UAAU,YAAY,MAAM,KAAQ,cAYhD,CAAC"}
@@ -22,4 +22,3 @@ const controller = (prefix = '') => {
22
22
  };
23
23
  };
24
24
  exports.controller = controller;
25
- //# sourceMappingURL=controller.js.map
@@ -0,0 +1,6 @@
1
+ export declare enum ControllerDecoratorParams {
2
+ Path = "path",
3
+ Method = "method",
4
+ Middleware = "middleware"
5
+ }
6
+ //# sourceMappingURL=ControllerDecoratorParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControllerDecoratorParams.d.ts","sourceRoot":"","sources":["../../../src/decorator/enums/ControllerDecoratorParams.ts"],"names":[],"mappings":"AAAA,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,UAAU,eAAe;CAC5B"}
@@ -7,4 +7,3 @@ var ControllerDecoratorParams;
7
7
  ControllerDecoratorParams["Method"] = "method";
8
8
  ControllerDecoratorParams["Middleware"] = "middleware";
9
9
  })(ControllerDecoratorParams = exports.ControllerDecoratorParams || (exports.ControllerDecoratorParams = {}));
10
- //# sourceMappingURL=ControllerDecoratorParams.js.map
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export declare const get: (path: string) => MethodDecorator;
3
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/decorator/get.ts"],"names":[],"mappings":"AAOA,OAAO,kBAAkB,CAAC;AAG1B,eAAO,MAAM,GAAG,SAAU,MAAM,KAAG,eA0BlC,CAAC"}
package/decorator/get.js CHANGED
@@ -34,4 +34,3 @@ const get = (path) => {
34
34
  };
35
35
  };
36
36
  exports.get = get;
37
- //# sourceMappingURL=get.js.map
@@ -0,0 +1,4 @@
1
+ export { controller } from "./controller";
2
+ export { get } from "./get";
3
+ export { post } from "./post";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA"}
@@ -7,4 +7,3 @@ var get_1 = require("./get");
7
7
  Object.defineProperty(exports, "get", { enumerable: true, get: function () { return get_1.get; } });
8
8
  var post_1 = require("./post");
9
9
  Object.defineProperty(exports, "post", { enumerable: true, get: function () { return post_1.post; } });
10
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export declare const post: (path: string) => MethodDecorator;
3
+ //# sourceMappingURL=post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/decorator/post.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,IAAI,SAAU,MAAM,KAAG,eAyBnC,CAAC"}
package/decorator/post.js CHANGED
@@ -34,4 +34,3 @@ const post = (path) => {
34
34
  };
35
35
  };
36
36
  exports.post = post;
37
- //# sourceMappingURL=post.js.map
@@ -0,0 +1,13 @@
1
+ /// <reference types="express" />
2
+ import { Request, Response } from "../index";
3
+ import { ActionFilter } from "../base/ActionFilter";
4
+ import { WebUser } from "../web/WebUser";
5
+ export declare class AccessControl extends ActionFilter {
6
+ user: any;
7
+ rules: any;
8
+ denyCallback: any;
9
+ init(): void;
10
+ beforeAction(action: any, request: Request, res: Response): Promise<boolean>;
11
+ denyAccess(user: WebUser): void;
12
+ }
13
+ //# sourceMappingURL=AccessControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessControl.d.ts","sourceRoot":"","sources":["../../src/filters/AccessControl.ts"],"names":[],"mappings":";AAMA,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAU,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAIvC,qBAAa,aAAc,SAAQ,YAAY;IAEpC,IAAI,EAAE,GAAG,CAAQ;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,GAAG,CAAQ;IAEzB,IAAI;IAeE,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAC,GAAG,EAAC,QAAQ;IAgC7D,UAAU,CAAC,IAAI,EAAE,OAAO;CAMlC"}
@@ -8,9 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.AccessControl = void 0;
16
13
  /*
@@ -19,12 +16,12 @@ exports.AccessControl = void 0;
19
16
  * E-mail: cihan@chy.com.tr
20
17
  * Github:https://github.com/cihan53/
21
18
  */
22
- const BaseChyz_1 = __importDefault(require("../BaseChyz"));
19
+ const index_1 = require("../index");
23
20
  const ForbiddenHttpException_1 = require("../base/ForbiddenHttpException");
24
21
  const ActionFilter_1 = require("../base/ActionFilter");
25
22
  const AccessRule_1 = require("./AccessRule");
26
23
  const WebUser_1 = require("../web/WebUser");
27
- const Utils_1 = __importDefault(require("../requiments/Utils"));
24
+ const Utils_1 = require("../requiments/Utils");
28
25
  class AccessControl extends ActionFilter_1.ActionFilter {
29
26
  constructor() {
30
27
  super(...arguments);
@@ -35,15 +32,15 @@ class AccessControl extends ActionFilter_1.ActionFilter {
35
32
  var _a;
36
33
  super.init();
37
34
  if (this.user == undefined) {
38
- this.user = (_a = Utils_1.default.cloneDeep(BaseChyz_1.default.getComponent("user"))) !== null && _a !== void 0 ? _a : new WebUser_1.WebUser();
35
+ this.user = (_a = Utils_1.Utils.cloneDeep(index_1.BaseChyz.getComponent("user"))) !== null && _a !== void 0 ? _a : new WebUser_1.WebUser();
39
36
  }
40
37
  this.rules.forEach((rule, index) => {
41
38
  if (rule === Object(rule)) {
42
- this.rules[index] = Utils_1.default.createObject(new AccessRule_1.AccessRule(), rule);
39
+ this.rules[index] = Utils_1.Utils.createObject(new AccessRule_1.AccessRule(), rule);
43
40
  }
44
41
  });
45
42
  }
46
- beforeAction(action, request) {
43
+ beforeAction(action, request, res) {
47
44
  var _a, _b;
48
45
  return __awaiter(this, void 0, void 0, function* () {
49
46
  let allow;
@@ -80,8 +77,7 @@ class AccessControl extends ActionFilter_1.ActionFilter {
80
77
  user.loginRequired();
81
78
  }
82
79
  else
83
- throw new ForbiddenHttpException_1.ForbiddenHttpException(BaseChyz_1.default.t('You are not allowed to perform this action.'));
80
+ throw new ForbiddenHttpException_1.ForbiddenHttpException(index_1.BaseChyz.t('You are not allowed to perform this action.'));
84
81
  }
85
82
  }
86
83
  exports.AccessControl = AccessControl;
87
- //# sourceMappingURL=AccessControl.js.map
@@ -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"}
@@ -8,15 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.AccessRule = void 0;
16
- var _ = require('lodash');
17
13
  const Component_1 = require("../base/Component");
18
14
  const InvalidConfigException_1 = require("../base/InvalidConfigException");
19
- const Utils_1 = __importDefault(require("../requiments/Utils"));
15
+ const Utils_1 = require("../requiments/Utils");
16
+ var _ = require('lodash');
20
17
  class AccessRule extends Component_1.Component {
21
18
  constructor() {
22
19
  super(...arguments);
@@ -99,16 +96,17 @@ class AccessRule extends Component_1.Component {
99
96
  }
100
97
  matchRole(user) {
101
98
  return __awaiter(this, void 0, void 0, function* () {
102
- let items = Utils_1.default.isEmpty(this.roles) ? [] : this.roles;
103
- if (!Utils_1.default.isEmpty(this.permissions)) {
104
- items = Utils_1.default.merge(items, this.permissions);
99
+ let items = Utils_1.Utils.isEmpty(this.roles) ? [] : this.roles;
100
+ if (!Utils_1.Utils.isEmpty(this.permissions)) {
101
+ items = Utils_1.Utils.merge(items, this.permissions);
105
102
  }
106
- if (Utils_1.default.isEmpty(items)) {
103
+ if (Utils_1.Utils.isEmpty(items)) {
107
104
  return true;
108
105
  }
109
106
  if (!user) {
110
107
  throw new InvalidConfigException_1.InvalidConfigException('The user application component must be available to specify roles in AccessRule.');
111
108
  }
109
+ // @ts-ignore
112
110
  let roleParams = [];
113
111
  for (const itemsKey in items) {
114
112
  let item = items[itemsKey];
@@ -124,8 +122,8 @@ class AccessRule extends Component_1.Component {
124
122
  }
125
123
  else {
126
124
  //roleparams
127
- if (!Utils_1.default.isEmpty(this.roleParams)) {
128
- roleParams = !Utils_1.default.isArray(this.roleParams) ? this.roleParams.apply(this) : this.roleParams;
125
+ if (!Utils_1.Utils.isEmpty(this.roleParams)) {
126
+ roleParams = !Utils_1.Utils.isArray(this.roleParams) ? this.roleParams.apply(this) : this.roleParams;
129
127
  }
130
128
  if (yield user.can(item, this.roleParams)) {
131
129
  return true;
@@ -137,4 +135,3 @@ class AccessRule extends Component_1.Component {
137
135
  }
138
136
  }
139
137
  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