chyz 2.0.0-rc.8 → 2.0.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/BaseChyz.d.ts +73 -56
  2. package/BaseChyz.d.ts.map +1 -1
  3. package/BaseChyz.js +569 -404
  4. package/README.md +1 -1
  5. package/base/ActionFilter.d.ts +32 -32
  6. package/base/ActionFilter.d.ts.map +1 -1
  7. package/base/ActionFilter.js +82 -82
  8. package/base/BadRequestHttpException.d.ts +6 -0
  9. package/base/BadRequestHttpException.d.ts.map +1 -0
  10. package/base/BadRequestHttpException.js +17 -0
  11. package/base/BaseError.d.ts +43 -10
  12. package/base/BaseError.d.ts.map +1 -1
  13. package/base/BaseError.js +58 -26
  14. package/base/Behavior.d.ts +3 -3
  15. package/base/Behavior.js +7 -7
  16. package/base/CBaseObject.d.ts +4 -4
  17. package/base/CBaseObject.d.ts.map +1 -1
  18. package/base/CBaseObject.js +16 -16
  19. package/base/CEvents.d.ts +13 -0
  20. package/base/CEvents.d.ts.map +1 -0
  21. package/base/CEvents.js +24 -0
  22. package/base/CRequest.d.ts +1 -1
  23. package/base/CRequest.js +10 -10
  24. package/base/CWebController.d.ts +43 -43
  25. package/base/CWebController.d.ts.map +1 -1
  26. package/base/CWebController.js +81 -74
  27. package/base/Component.d.ts +20 -20
  28. package/base/Component.d.ts.map +1 -1
  29. package/base/Component.js +57 -57
  30. package/base/Configurable.d.ts +2 -2
  31. package/base/Configurable.js +8 -8
  32. package/base/DataErrorDbException.d.ts +5 -5
  33. package/base/DataErrorDbException.d.ts.map +1 -1
  34. package/base/DataErrorDbException.js +17 -17
  35. package/base/DbConnection.d.ts +12 -12
  36. package/base/DbConnection.js +53 -53
  37. package/base/ForbiddenHttpException.d.ts +4 -4
  38. package/base/ForbiddenHttpException.d.ts.map +1 -1
  39. package/base/ForbiddenHttpException.js +16 -16
  40. package/base/InvalidArgumentException.d.ts +5 -5
  41. package/base/InvalidArgumentException.d.ts.map +1 -1
  42. package/base/InvalidArgumentException.js +17 -17
  43. package/base/InvalidConfigException.d.ts +5 -5
  44. package/base/InvalidConfigException.d.ts.map +1 -1
  45. package/base/InvalidConfigException.js +17 -17
  46. package/base/Logs.d.ts +21 -21
  47. package/base/Logs.d.ts.map +1 -1
  48. package/base/Logs.js +57 -57
  49. package/base/Model.d.ts +301 -298
  50. package/base/Model.d.ts.map +1 -1
  51. package/base/Model.js +545 -507
  52. package/base/ModelManager.d.ts +1 -1
  53. package/base/ModelManager.js +19 -19
  54. package/base/NotFoundHttpException.d.ts +5 -5
  55. package/base/NotFoundHttpException.d.ts.map +1 -1
  56. package/base/NotFoundHttpException.js +17 -17
  57. package/base/RestClient.d.ts +6 -6
  58. package/base/RestClient.d.ts.map +1 -1
  59. package/base/RestClient.js +25 -25
  60. package/base/UnauthorizedHttpException.d.ts +5 -5
  61. package/base/UnauthorizedHttpException.d.ts.map +1 -1
  62. package/base/UnauthorizedHttpException.js +17 -17
  63. package/base/ValidationHttpException.d.ts +5 -5
  64. package/base/ValidationHttpException.d.ts.map +1 -1
  65. package/base/ValidationHttpException.js +17 -17
  66. package/base/db/Exception.d.ts +6 -6
  67. package/base/db/Exception.js +15 -15
  68. package/base/index.d.ts +19 -18
  69. package/base/index.d.ts.map +1 -1
  70. package/base/index.js +41 -39
  71. package/decorator/Middleware.d.ts +3 -3
  72. package/decorator/Middleware.js +11 -11
  73. package/decorator/controller.d.ts +2 -2
  74. package/decorator/controller.js +24 -24
  75. package/decorator/delete.d.ts +3 -0
  76. package/decorator/delete.d.ts.map +1 -0
  77. package/decorator/delete.js +36 -0
  78. package/decorator/enums/ControllerDecoratorParams.d.ts +5 -5
  79. package/decorator/enums/ControllerDecoratorParams.js +9 -9
  80. package/decorator/get.d.ts +2 -2
  81. package/decorator/get.js +36 -36
  82. package/decorator/index.d.ts +5 -3
  83. package/decorator/index.d.ts.map +1 -1
  84. package/decorator/index.js +13 -9
  85. package/decorator/post.d.ts +2 -2
  86. package/decorator/post.js +36 -36
  87. package/decorator/put.d.ts +3 -0
  88. package/decorator/put.d.ts.map +1 -0
  89. package/decorator/put.js +36 -0
  90. package/filters/AccessControl.d.ts +12 -12
  91. package/filters/AccessControl.d.ts.map +1 -1
  92. package/filters/AccessControl.js +83 -83
  93. package/filters/AccessRule.d.ts +82 -82
  94. package/filters/AccessRule.d.ts.map +1 -1
  95. package/filters/AccessRule.js +136 -137
  96. package/filters/auth/AuthInterface.d.ts +25 -25
  97. package/filters/auth/AuthInterface.js +2 -2
  98. package/filters/auth/AuthMethod.d.ts +37 -37
  99. package/filters/auth/AuthMethod.d.ts.map +1 -1
  100. package/filters/auth/AuthMethod.js +82 -82
  101. package/filters/auth/HttpBasicAuth.d.ts +23 -22
  102. package/filters/auth/HttpBasicAuth.d.ts.map +1 -1
  103. package/filters/auth/HttpBasicAuth.js +78 -72
  104. package/filters/auth/HttpBearerAuth.d.ts +17 -17
  105. package/filters/auth/HttpBearerAuth.d.ts.map +1 -1
  106. package/filters/auth/HttpBearerAuth.js +33 -32
  107. package/filters/auth/HttpHeaderAuth.d.ts +18 -14
  108. package/filters/auth/HttpHeaderAuth.d.ts.map +1 -1
  109. package/filters/auth/HttpHeaderAuth.js +64 -57
  110. package/filters/auth/JwtHttpBearerAuth.d.ts +20 -20
  111. package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -1
  112. package/filters/auth/JwtHttpBearerAuth.js +87 -81
  113. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +22 -22
  114. package/filters/auth/KeyCloakHttpBearerAuth.js +116 -116
  115. package/filters/auth/index.d.ts +4 -4
  116. package/filters/auth/index.js +11 -11
  117. package/filters/index.d.ts +2 -2
  118. package/filters/index.js +7 -7
  119. package/index.d.ts +28 -21
  120. package/index.d.ts.map +1 -1
  121. package/index.js +71 -60
  122. package/model/RouteDefinition.d.ts +6 -6
  123. package/model/RouteDefinition.js +8 -8
  124. package/package.json +22 -24
  125. package/rbac/AuthAssignment.d.ts +18 -18
  126. package/rbac/AuthAssignment.js +44 -44
  127. package/rbac/AuthItem.d.ts +26 -26
  128. package/rbac/AuthItem.js +51 -51
  129. package/rbac/AuthItemChild.d.ts +18 -18
  130. package/rbac/AuthItemChild.js +43 -43
  131. package/rbac/AuthManager.d.ts +111 -111
  132. package/rbac/AuthManager.d.ts.map +1 -1
  133. package/rbac/AuthManager.js +356 -355
  134. package/rbac/index.d.ts +5 -0
  135. package/rbac/index.d.ts.map +1 -0
  136. package/rbac/index.js +28 -0
  137. package/requiments/Glob.d.ts +2 -2
  138. package/requiments/Glob.js +10 -10
  139. package/requiments/ReflectUtil.js +24 -24
  140. package/requiments/Utils.d.ts +1 -8
  141. package/requiments/Utils.d.ts.map +1 -1
  142. package/requiments/Utils.js +115 -112
  143. package/validators/BooleanValidator.js +1 -1
  144. package/validators/CompareValidator.js +1 -1
  145. package/validators/DateValidator.js +1 -1
  146. package/validators/EmailValidator.js +1 -1
  147. package/validators/Validator.d.ts +17 -17
  148. package/validators/Validator.js +27 -27
  149. package/web/IdentityInterface.d.ts +55 -54
  150. package/web/IdentityInterface.d.ts.map +1 -1
  151. package/web/IdentityInterface.js +8 -8
  152. package/web/WebUser.d.ts +71 -71
  153. package/web/WebUser.js +165 -165
@@ -1,112 +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 {};
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
112
  //# sourceMappingURL=AuthManager.d.ts.map
@@ -1 +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,qBA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