chyz 2.0.1-rc.3 → 2.0.1-rc.36
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.
- package/BaseChyz.ts +623 -0
- package/README.md +518 -518
- package/base/ActionFilter.ts +88 -0
- package/base/BadRequestHttpException.ts +14 -0
- package/base/{BaseError.js → BaseError.ts} +26 -18
- package/base/Behavior.ts +6 -0
- package/base/CBaseObject.ts +17 -0
- package/base/CEvents.ts +24 -0
- package/base/{CRequest.js → CRequest.ts} +6 -2
- package/base/CWebController.ts +90 -0
- package/base/Component.ts +66 -0
- package/{model/RouteDefinition.js → base/Configurable.ts} +4 -2
- package/base/DataErrorDbException.ts +16 -0
- package/base/DbConnection.ts +55 -0
- package/base/ForbiddenHttpException.ts +15 -0
- package/base/InvalidArgumentException.ts +16 -0
- package/base/InvalidConfigException.ts +16 -0
- package/base/{Logs.js → Logs.ts} +41 -24
- package/base/{Model.js → Model.ts} +225 -158
- package/base/{ModelManager.js → ModelManager.ts} +7 -7
- package/base/NotFoundHttpException.ts +14 -0
- package/base/RestClient.ts +26 -0
- package/base/UnauthorizedHttpException.ts +17 -0
- package/base/ValidationHttpException.ts +14 -0
- package/base/db/Exception.ts +14 -0
- package/base/index.ts +19 -0
- package/decorator/Middleware.ts +9 -0
- package/decorator/{controller.js → controller.ts} +7 -9
- package/decorator/{delete.js → delete.ts} +9 -9
- package/decorator/enums/ControllerDecoratorParams.ts +5 -0
- package/decorator/{get.js → get.ts} +11 -10
- package/decorator/index.ts +5 -0
- package/decorator/{post.js → post.ts} +10 -10
- package/decorator/{put.js → put.ts} +9 -9
- package/filters/AccessControl.ts +74 -0
- package/filters/AccessRule.ts +182 -0
- package/filters/auth/{AuthInterface.d.ts → AuthInterface.ts} +15 -7
- package/filters/auth/AuthMethod.ts +100 -0
- package/filters/auth/HttpBasicAuth.ts +79 -0
- package/filters/auth/HttpBearerAuth.ts +34 -0
- package/filters/auth/HttpHeaderAuth.ts +61 -0
- package/filters/auth/JwtHttpBearerAuth.ts +83 -0
- package/filters/auth/KeyCloakHttpBearerAuth.ts +114 -0
- package/filters/auth/index.ts +4 -0
- package/filters/index.ts +2 -0
- package/index.ts +80 -0
- package/log/config/log4js.json +55 -55
- package/model/RouteDefinition.ts +18 -0
- package/package.json +63 -61
- package/rbac/AuthAssignment.ts +50 -0
- package/rbac/{AuthItem.js → AuthItem.ts} +22 -16
- package/rbac/{AuthItemChild.js → AuthItemChild.ts} +21 -14
- package/rbac/AuthManager.ts +399 -0
- package/rbac/index.ts +12 -0
- package/{web/IdentityInterface.js → requiments/Glob.ts} +3 -2
- package/requiments/{ReflectUtil.js → ReflectUtil.ts} +6 -4
- package/requiments/{Utils.js → Utils.ts} +40 -34
- package/validators/BooleanValidator.ts +0 -0
- package/validators/CompareValidator.ts +0 -0
- package/validators/DateValidator.ts +0 -0
- package/validators/EmailValidator.ts +0 -0
- package/validators/Validator.ts +27 -0
- package/web/{IdentityInterface.d.ts → IdentityInterface.ts} +15 -2
- package/web/WebUser.ts +187 -0
- package/BaseChyz.d.ts +0 -74
- package/BaseChyz.d.ts.map +0 -1
- package/BaseChyz.js +0 -569
- package/base/ActionFilter.d.ts +0 -33
- package/base/ActionFilter.d.ts.map +0 -1
- package/base/ActionFilter.js +0 -90
- package/base/BadRequestHttpException.d.ts +0 -6
- package/base/BadRequestHttpException.d.ts.map +0 -1
- package/base/BadRequestHttpException.js +0 -17
- package/base/BaseError.d.ts +0 -44
- package/base/BaseError.d.ts.map +0 -1
- package/base/Behavior.d.ts +0 -4
- package/base/Behavior.d.ts.map +0 -1
- package/base/Behavior.js +0 -7
- package/base/CBaseObject.d.ts +0 -5
- package/base/CBaseObject.d.ts.map +0 -1
- package/base/CBaseObject.js +0 -16
- package/base/CEvents.d.ts +0 -13
- package/base/CEvents.d.ts.map +0 -1
- package/base/CEvents.js +0 -24
- package/base/CRequest.d.ts +0 -2
- package/base/CRequest.d.ts.map +0 -1
- package/base/CWebController.d.ts +0 -44
- package/base/CWebController.d.ts.map +0 -1
- package/base/CWebController.js +0 -81
- package/base/Component.d.ts +0 -21
- package/base/Component.d.ts.map +0 -1
- package/base/Component.js +0 -57
- package/base/Configurable.d.ts +0 -3
- package/base/Configurable.d.ts.map +0 -1
- package/base/Configurable.js +0 -8
- package/base/DataErrorDbException.d.ts +0 -6
- package/base/DataErrorDbException.d.ts.map +0 -1
- package/base/DataErrorDbException.js +0 -17
- package/base/DbConnection.d.ts +0 -13
- package/base/DbConnection.d.ts.map +0 -1
- package/base/DbConnection.js +0 -53
- package/base/ForbiddenHttpException.d.ts +0 -5
- package/base/ForbiddenHttpException.d.ts.map +0 -1
- package/base/ForbiddenHttpException.js +0 -16
- package/base/InvalidArgumentException.d.ts +0 -6
- package/base/InvalidArgumentException.d.ts.map +0 -1
- package/base/InvalidArgumentException.js +0 -17
- package/base/InvalidConfigException.d.ts +0 -6
- package/base/InvalidConfigException.d.ts.map +0 -1
- package/base/InvalidConfigException.js +0 -17
- package/base/Logs.d.ts +0 -22
- package/base/Logs.d.ts.map +0 -1
- package/base/Model.d.ts +0 -302
- package/base/Model.d.ts.map +0 -1
- package/base/ModelManager.d.ts +0 -2
- package/base/ModelManager.d.ts.map +0 -1
- package/base/NotFoundHttpException.d.ts +0 -6
- package/base/NotFoundHttpException.d.ts.map +0 -1
- package/base/NotFoundHttpException.js +0 -17
- package/base/RestClient.d.ts +0 -7
- package/base/RestClient.d.ts.map +0 -1
- package/base/RestClient.js +0 -25
- package/base/UnauthorizedHttpException.d.ts +0 -6
- package/base/UnauthorizedHttpException.d.ts.map +0 -1
- package/base/UnauthorizedHttpException.js +0 -17
- package/base/ValidationHttpException.d.ts +0 -6
- package/base/ValidationHttpException.d.ts.map +0 -1
- package/base/ValidationHttpException.js +0 -17
- package/base/db/Exception.d.ts +0 -7
- package/base/db/Exception.d.ts.map +0 -1
- package/base/db/Exception.js +0 -15
- package/base/index.d.ts +0 -20
- package/base/index.d.ts.map +0 -1
- package/base/index.js +0 -41
- package/decorator/Middleware.d.ts +0 -4
- package/decorator/Middleware.d.ts.map +0 -1
- package/decorator/Middleware.js +0 -11
- package/decorator/controller.d.ts +0 -3
- package/decorator/controller.d.ts.map +0 -1
- package/decorator/delete.d.ts +0 -3
- package/decorator/delete.d.ts.map +0 -1
- package/decorator/enums/ControllerDecoratorParams.d.ts +0 -6
- package/decorator/enums/ControllerDecoratorParams.d.ts.map +0 -1
- package/decorator/enums/ControllerDecoratorParams.js +0 -9
- package/decorator/get.d.ts +0 -3
- package/decorator/get.d.ts.map +0 -1
- package/decorator/index.d.ts +0 -6
- package/decorator/index.d.ts.map +0 -1
- package/decorator/index.js +0 -13
- package/decorator/post.d.ts +0 -3
- package/decorator/post.d.ts.map +0 -1
- package/decorator/put.d.ts +0 -3
- package/decorator/put.d.ts.map +0 -1
- package/filters/AccessControl.d.ts +0 -13
- package/filters/AccessControl.d.ts.map +0 -1
- package/filters/AccessControl.js +0 -83
- package/filters/AccessRule.d.ts +0 -83
- package/filters/AccessRule.d.ts.map +0 -1
- package/filters/AccessRule.js +0 -136
- package/filters/auth/AuthInterface.d.ts.map +0 -1
- package/filters/auth/AuthInterface.js +0 -2
- package/filters/auth/AuthMethod.d.ts +0 -38
- package/filters/auth/AuthMethod.d.ts.map +0 -1
- package/filters/auth/AuthMethod.js +0 -82
- package/filters/auth/HttpBasicAuth.d.ts +0 -24
- package/filters/auth/HttpBasicAuth.d.ts.map +0 -1
- package/filters/auth/HttpBasicAuth.js +0 -78
- package/filters/auth/HttpBearerAuth.d.ts +0 -18
- package/filters/auth/HttpBearerAuth.d.ts.map +0 -1
- package/filters/auth/HttpBearerAuth.js +0 -33
- package/filters/auth/HttpHeaderAuth.d.ts +0 -19
- package/filters/auth/HttpHeaderAuth.d.ts.map +0 -1
- package/filters/auth/HttpHeaderAuth.js +0 -64
- package/filters/auth/JwtHttpBearerAuth.d.ts +0 -21
- package/filters/auth/JwtHttpBearerAuth.d.ts.map +0 -1
- package/filters/auth/JwtHttpBearerAuth.js +0 -87
- package/filters/auth/KeyCloakHttpBearerAuth.d.ts +0 -23
- package/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +0 -1
- package/filters/auth/KeyCloakHttpBearerAuth.js +0 -116
- package/filters/auth/index.d.ts +0 -5
- package/filters/auth/index.d.ts.map +0 -1
- package/filters/auth/index.js +0 -11
- package/filters/index.d.ts +0 -3
- package/filters/index.d.ts.map +0 -1
- package/filters/index.js +0 -7
- package/index.d.ts +0 -26
- package/index.d.ts.map +0 -1
- package/index.js +0 -72
- package/model/RouteDefinition.d.ts +0 -7
- package/model/RouteDefinition.d.ts.map +0 -1
- package/rbac/AuthAssignment.d.ts +0 -19
- package/rbac/AuthAssignment.d.ts.map +0 -1
- package/rbac/AuthAssignment.js +0 -44
- package/rbac/AuthItem.d.ts +0 -27
- package/rbac/AuthItem.d.ts.map +0 -1
- package/rbac/AuthItemChild.d.ts +0 -19
- package/rbac/AuthItemChild.d.ts.map +0 -1
- package/rbac/AuthManager.d.ts +0 -112
- package/rbac/AuthManager.d.ts.map +0 -1
- package/rbac/AuthManager.js +0 -356
- package/rbac/index.d.ts +0 -5
- package/rbac/index.d.ts.map +0 -1
- package/rbac/index.js +0 -28
- package/requiments/Glob.d.ts +0 -3
- package/requiments/Glob.d.ts.map +0 -1
- package/requiments/Glob.js +0 -10
- package/requiments/ReflectUtil.d.ts +0 -1
- package/requiments/ReflectUtil.d.ts.map +0 -1
- package/requiments/Utils.d.ts +0 -2
- package/requiments/Utils.d.ts.map +0 -1
- package/validators/BooleanValidator.d.ts +0 -1
- package/validators/BooleanValidator.d.ts.map +0 -1
- package/validators/BooleanValidator.js +0 -1
- package/validators/CompareValidator.d.ts +0 -1
- package/validators/CompareValidator.d.ts.map +0 -1
- package/validators/CompareValidator.js +0 -1
- package/validators/DateValidator.d.ts +0 -1
- package/validators/DateValidator.d.ts.map +0 -1
- package/validators/DateValidator.js +0 -1
- package/validators/EmailValidator.d.ts +0 -1
- package/validators/EmailValidator.d.ts.map +0 -1
- package/validators/EmailValidator.js +0 -1
- package/validators/Validator.d.ts +0 -18
- package/validators/Validator.d.ts.map +0 -1
- package/validators/Validator.js +0 -27
- package/web/IdentityInterface.d.ts.map +0 -1
- package/web/WebUser.d.ts +0 -72
- package/web/WebUser.d.ts.map +0 -1
- package/web/WebUser.js +0 -165
package/rbac/AuthManager.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { Component } from "../base";
|
|
2
|
-
interface Role {
|
|
3
|
-
type: number;
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
ruleName: string;
|
|
7
|
-
data: string;
|
|
8
|
-
params: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class AuthManager extends Component {
|
|
11
|
-
static readonly TYPE_ROLE = 1;
|
|
12
|
-
static readonly TYPE_PERMISSION = 2;
|
|
13
|
-
init(): void;
|
|
14
|
-
/**
|
|
15
|
-
* @var Item[] all auth items (name => Item)
|
|
16
|
-
*/
|
|
17
|
-
protected items: any;
|
|
18
|
-
checkAccessAssignments: any;
|
|
19
|
-
defaultRoles: any;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
checkAccess(userId: number, permissionName: string, params?: any[]): Promise<boolean>;
|
|
24
|
-
checkAccessFromCache(): Promise<void>;
|
|
25
|
-
checkAccessRecursive(user: string | number, itemname: string, params: any[], assignments: any): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param name
|
|
29
|
-
*/
|
|
30
|
-
getItem(name: string): Promise<any>;
|
|
31
|
-
getItems(type: number): Promise<any>;
|
|
32
|
-
getRolesByUser(userId: number): Promise<any>;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param roleName
|
|
36
|
-
*/
|
|
37
|
-
getChildRoles(roleName: string): Promise<any>;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @param roleName
|
|
41
|
-
*/
|
|
42
|
-
getPermissionsByRole(roleName: string): Promise<any>;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param userId
|
|
46
|
-
*/
|
|
47
|
-
getPermissionsByUser(userId: number): Promise<any>;
|
|
48
|
-
/**
|
|
49
|
-
* Returns all permissions that are directly assigned to user.
|
|
50
|
-
* @return Permission[] all direct permissions that the user has. The array is indexed by the permission names.
|
|
51
|
-
*/
|
|
52
|
-
protected getDirectPermissionsByUser(userId: number): Promise<any>;
|
|
53
|
-
protected getInheritedPermissionsByUser(userId: number): Promise<any>;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @param userId
|
|
57
|
-
*/
|
|
58
|
-
getItemsByUser(userId: number): Promise<any>;
|
|
59
|
-
/**
|
|
60
|
-
* Returns all role assignment information for the specified role.
|
|
61
|
-
* @param $roleName
|
|
62
|
-
*/
|
|
63
|
-
getUserIdsByRole(roleName: number): Promise<any>;
|
|
64
|
-
/**
|
|
65
|
-
* {@inheritdoc}
|
|
66
|
-
*/
|
|
67
|
-
getRole(name: string): Promise<Role | null>;
|
|
68
|
-
/**
|
|
69
|
-
* {@inheritdoc}
|
|
70
|
-
*/
|
|
71
|
-
getRoles(): Promise<any>;
|
|
72
|
-
/**
|
|
73
|
-
* Recursively finds all children and grand children of the specified item.
|
|
74
|
-
* @param string $name the name of the item whose children are to be looked for.
|
|
75
|
-
* @param array $childrenList the child list built via [[getChildrenList()]]
|
|
76
|
-
* @param array $result the children and grand children (in array keys)
|
|
77
|
-
*/
|
|
78
|
-
protected getChildrenRecursive(name: string, childrenList: any, model: any): void;
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @param roleName
|
|
82
|
-
* @param userId
|
|
83
|
-
*/
|
|
84
|
-
getAssignment(roleName: string, userId: string): any;
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
getAssignments(userId: number): Promise<any>;
|
|
89
|
-
/**
|
|
90
|
-
* Returns the children for every parent.
|
|
91
|
-
* @return array the children list. Each array key is a parent item name,
|
|
92
|
-
* and the corresponding array value is a list of child item names.
|
|
93
|
-
*/
|
|
94
|
-
protected getChildrenList(): Promise<any>;
|
|
95
|
-
/**
|
|
96
|
-
* Check whether $userId is empty.
|
|
97
|
-
* @param mixed $userId
|
|
98
|
-
* @return bool
|
|
99
|
-
* @since 2.0.26
|
|
100
|
-
*/
|
|
101
|
-
protected isEmptyUserId(userId: string): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Checks whether array of $assignments is empty and [[defaultRoles]] property is empty as well.
|
|
104
|
-
*
|
|
105
|
-
* @param Assignment[] $assignments array of user's assignments
|
|
106
|
-
* @return bool whether array of $assignments is empty and [[defaultRoles]] property is empty as well
|
|
107
|
-
* @since 2.0.11
|
|
108
|
-
*/
|
|
109
|
-
protected hasNoAssignments(assignments: any): any;
|
|
110
|
-
}
|
|
111
|
-
export {};
|
|
112
|
-
//# sourceMappingURL=AuthManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthManager.d.ts","sourceRoot":"","sources":["../../src/rbac/AuthManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAuC,MAAM,SAAS,CAAC;AAKxE,UAAU,IAAI;IACV,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAYD,qBAAa,WAAY,SAAQ,SAAS;IACtC,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK;IAC9B,MAAM,CAAC,QAAQ,CAAC,eAAe,KAAK;IAEpC,IAAI;IAIJ;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;IACrB,sBAAsB,EAAE,GAAG,CAAK;IAChC,YAAY,EAAE,GAAG,CAAK;IAGtB;;OAEG;IAEU,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAE,GAAG,EAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBhG,oBAAoB;IAKb,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IA4B7H;;;OAGG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM;IAOpB,QAAQ,CAAC,IAAI,EAAE,MAAM;IAYrB,cAAc,CAAC,MAAM,EAAE,MAAM;IAyB1C;;;OAGG;IACU,aAAa,CAAC,QAAQ,EAAE,MAAM;IAoB3C;;;OAGG;IACU,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IAuBlD;;;OAGG;IACU,oBAAoB,CAAC,MAAM,EAAE,MAAM;IAYhD;;;OAGG;cACa,0BAA0B,CAAC,MAAM,EAAE,MAAM;cAuBzC,6BAA6B,CAAC,MAAM,EAAE,MAAM;IA4B5D;;;OAGG;IACU,cAAc,CAAC,MAAM,EAAE,MAAM;IAY1C;;;OAGG;IACU,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAO9C;;OAEG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM;IAMjC;;OAEG;IACI,QAAQ;IAIf;;;;;OAKG;IACH,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG;IAW1E;;;;OAIG;IACI,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQrD;;OAEG;IACU,cAAc,CAAC,MAAM,EAAE,MAAM;IAkB1C;;;;OAIG;cACa,eAAe;IAU/B;;;;;OAKG;IACH,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;IAItC;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG;CAG9C"}
|
package/rbac/AuthManager.js
DELETED
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AuthManager = void 0;
|
|
13
|
-
const base_1 = require("../base");
|
|
14
|
-
const index_1 = require("../index");
|
|
15
|
-
const Utils_1 = require("../requiments/Utils");
|
|
16
|
-
class AuthManager extends base_1.Component {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.checkAccessAssignments = {};
|
|
20
|
-
this.defaultRoles = {};
|
|
21
|
-
}
|
|
22
|
-
init() {
|
|
23
|
-
index_1.BaseChyz.info("Auth Manager init....");
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
checkAccess(userId, permissionName, params = []) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
let assignments;
|
|
31
|
-
if (!userId)
|
|
32
|
-
return false;
|
|
33
|
-
if (!this.checkAccessAssignments[userId.toString()]) {
|
|
34
|
-
assignments = yield this.getAssignments(userId);
|
|
35
|
-
this.checkAccessAssignments[userId.toString()] = assignments;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
assignments = this.checkAccessAssignments[userId.toString()];
|
|
39
|
-
}
|
|
40
|
-
// BaseChyz.info("assignments",assignments)
|
|
41
|
-
if (this.hasNoAssignments(assignments)) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
return yield this.checkAccessRecursive(userId, permissionName, params, assignments);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
checkAccessFromCache() {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
checkAccessRecursive(user, itemname, params, assignments) {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
let item = yield this.getItem(itemname);
|
|
54
|
-
if (!item)
|
|
55
|
-
return false;
|
|
56
|
-
/**
|
|
57
|
-
* @todo
|
|
58
|
-
* Rule test edilmeli
|
|
59
|
-
*/
|
|
60
|
-
if (assignments[itemname] || Utils_1.Utils.find(this.defaultRoles, itemname)) {
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* item child
|
|
65
|
-
*/
|
|
66
|
-
let parents = yield base_1.ModelManager.AuthItemChild.findAll({ attributes: ["parent"], where: { child: itemname } });
|
|
67
|
-
for (const parent of parents) {
|
|
68
|
-
let r = yield this.checkAccessRecursive(user, parent.parent, params, assignments);
|
|
69
|
-
if (r) {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
* @param name
|
|
79
|
-
*/
|
|
80
|
-
getItem(name) {
|
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
if (!name)
|
|
83
|
-
return null;
|
|
84
|
-
return yield base_1.ModelManager.AuthItem.findOne({ where: { name: name } });
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
getItems(type) {
|
|
88
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
let items = {};
|
|
90
|
-
let _items = yield base_1.ModelManager.AuthItem.findAll({ where: { type: type } });
|
|
91
|
-
if (_items)
|
|
92
|
-
_items.forEach((item) => {
|
|
93
|
-
items[item["name"]] = item.dataValues;
|
|
94
|
-
});
|
|
95
|
-
return items;
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
getRolesByUser(userId) {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
if (this.isEmptyUserId(userId.toString())) {
|
|
101
|
-
return [];
|
|
102
|
-
}
|
|
103
|
-
let roles = {};
|
|
104
|
-
let items = yield base_1.ModelManager.AuthAssignment.findAll({
|
|
105
|
-
where: {
|
|
106
|
-
user_id: userId.toString(),
|
|
107
|
-
'$AuthItemClasses.type$': AuthManager.TYPE_ROLE
|
|
108
|
-
},
|
|
109
|
-
include: [{
|
|
110
|
-
model: base_1.ModelManager.AuthItem.model()
|
|
111
|
-
}]
|
|
112
|
-
});
|
|
113
|
-
for (const item of items) {
|
|
114
|
-
for (const i of item.AuthItemClasses)
|
|
115
|
-
roles[i["name"]] = i.dataValues;
|
|
116
|
-
}
|
|
117
|
-
return roles;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
122
|
-
* @param roleName
|
|
123
|
-
*/
|
|
124
|
-
getChildRoles(roleName) {
|
|
125
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
let role = yield this.getRole(roleName);
|
|
127
|
-
if (role === null) {
|
|
128
|
-
throw new index_1.InvalidArgumentException(`Role "${roleName}" not found.`);
|
|
129
|
-
}
|
|
130
|
-
const result = { result: {} };
|
|
131
|
-
yield this.getChildrenRecursive(roleName, yield this.getChildrenList(), result);
|
|
132
|
-
let roles = {};
|
|
133
|
-
roles[roleName] = role;
|
|
134
|
-
let _roles = yield this.getRoles();
|
|
135
|
-
let _r = {};
|
|
136
|
-
Utils_1.Utils.forEach(_roles, (item) => {
|
|
137
|
-
if (result.result[item.name])
|
|
138
|
-
_r[item.name] = item;
|
|
139
|
-
});
|
|
140
|
-
return Utils_1.Utils.merge(roles, _r);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
* @param roleName
|
|
146
|
-
*/
|
|
147
|
-
getPermissionsByRole(roleName) {
|
|
148
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
let childrenList = this.getChildrenList();
|
|
150
|
-
const result = { result: {} };
|
|
151
|
-
let permissions = {};
|
|
152
|
-
yield this.getChildrenRecursive(roleName, childrenList, result);
|
|
153
|
-
if (Utils_1.Utils.isEmpty(result.result)) {
|
|
154
|
-
return {};
|
|
155
|
-
}
|
|
156
|
-
let itemResult = yield base_1.ModelManager.AuthItem.findAll({
|
|
157
|
-
where: {
|
|
158
|
-
type: AuthManager.TYPE_PERMISSION,
|
|
159
|
-
name: Object.keys(result.result)
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
for (const itemElement of itemResult) {
|
|
163
|
-
permissions[itemElement["name"]] = itemElement.dataValues;
|
|
164
|
-
}
|
|
165
|
-
return permissions;
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
*
|
|
170
|
-
* @param userId
|
|
171
|
-
*/
|
|
172
|
-
getPermissionsByUser(userId) {
|
|
173
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
-
if (this.isEmptyUserId(userId.toString())) {
|
|
175
|
-
return {};
|
|
176
|
-
}
|
|
177
|
-
let directPermission = yield this.getDirectPermissionsByUser(userId);
|
|
178
|
-
let inheritedPermission = yield this.getInheritedPermissionsByUser(userId);
|
|
179
|
-
return Utils_1.Utils.merge(directPermission, inheritedPermission);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Returns all permissions that are directly assigned to user.
|
|
184
|
-
* @return Permission[] all direct permissions that the user has. The array is indexed by the permission names.
|
|
185
|
-
*/
|
|
186
|
-
getDirectPermissionsByUser(userId) {
|
|
187
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
-
let permissions = {};
|
|
189
|
-
let result = yield base_1.ModelManager.AuthAssignment.findAll({
|
|
190
|
-
where: {
|
|
191
|
-
user_id: userId.toString(),
|
|
192
|
-
'$AuthItemClasses.type$': AuthManager.TYPE_PERMISSION
|
|
193
|
-
},
|
|
194
|
-
include: [
|
|
195
|
-
{
|
|
196
|
-
model: base_1.ModelManager.AuthItem.model()
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
});
|
|
200
|
-
for (const resultElement of result) {
|
|
201
|
-
for (const i of resultElement.AuthItemClasses)
|
|
202
|
-
permissions[i["name"]] = i.dataValues;
|
|
203
|
-
}
|
|
204
|
-
return permissions;
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
getInheritedPermissionsByUser(userId) {
|
|
208
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
-
let userAssignment = yield base_1.ModelManager.AuthAssignment.findAll({ where: { user_id: userId.toString() }, attributes: ["item_name"] });
|
|
210
|
-
let childrenList = yield this.getChildrenList();
|
|
211
|
-
const result = { result: {} };
|
|
212
|
-
let permissions = {};
|
|
213
|
-
for (const userAssignmentElement of userAssignment) {
|
|
214
|
-
this.getChildrenRecursive(userAssignmentElement.item_name, childrenList, result);
|
|
215
|
-
}
|
|
216
|
-
if (Utils_1.Utils.isEmpty(result.result)) {
|
|
217
|
-
return {};
|
|
218
|
-
}
|
|
219
|
-
let itemResult = yield base_1.ModelManager.AuthItem.findAll({
|
|
220
|
-
where: {
|
|
221
|
-
type: AuthManager.TYPE_PERMISSION,
|
|
222
|
-
name: Object.keys(result.result)
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
for (const itemElement of itemResult) {
|
|
226
|
-
permissions[itemElement["name"]] = itemElement.dataValues;
|
|
227
|
-
}
|
|
228
|
-
return permissions;
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
*
|
|
233
|
-
* @param userId
|
|
234
|
-
*/
|
|
235
|
-
getItemsByUser(userId) {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
return yield base_1.ModelManager.AuthAssignment.findAll({
|
|
238
|
-
where: {
|
|
239
|
-
user_id: userId.toString()
|
|
240
|
-
},
|
|
241
|
-
include: [{
|
|
242
|
-
model: base_1.ModelManager.AuthItem.model()
|
|
243
|
-
}]
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Returns all role assignment information for the specified role.
|
|
249
|
-
* @param $roleName
|
|
250
|
-
*/
|
|
251
|
-
getUserIdsByRole(roleName) {
|
|
252
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
-
if (!roleName)
|
|
254
|
-
return [];
|
|
255
|
-
return yield base_1.ModelManager.AuthAssignment.findAll({ where: { "item_name": roleName }, attributes: ["user_id"] });
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* {@inheritdoc}
|
|
260
|
-
*/
|
|
261
|
-
getRole(name) {
|
|
262
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
-
let item = yield this.getItem(name);
|
|
264
|
-
return item && item.type == AuthManager.TYPE_ROLE ? item : null;
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* {@inheritdoc}
|
|
269
|
-
*/
|
|
270
|
-
getRoles() {
|
|
271
|
-
return this.getItems(AuthManager.TYPE_ROLE);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Recursively finds all children and grand children of the specified item.
|
|
275
|
-
* @param string $name the name of the item whose children are to be looked for.
|
|
276
|
-
* @param array $childrenList the child list built via [[getChildrenList()]]
|
|
277
|
-
* @param array $result the children and grand children (in array keys)
|
|
278
|
-
*/
|
|
279
|
-
getChildrenRecursive(name, childrenList, model) {
|
|
280
|
-
if (childrenList[name]) {
|
|
281
|
-
for (const child of childrenList[name]) {
|
|
282
|
-
model.result[child] = true;
|
|
283
|
-
this.getChildrenRecursive(child, childrenList, model);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
*
|
|
289
|
-
* @param roleName
|
|
290
|
-
* @param userId
|
|
291
|
-
*/
|
|
292
|
-
getAssignment(roleName, userId) {
|
|
293
|
-
if (this.isEmptyUserId(userId)) {
|
|
294
|
-
return [];
|
|
295
|
-
}
|
|
296
|
-
return base_1.ModelManager.AuthAssignment.findAll({ where: { user_id: userId, items_name: roleName } });
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
*
|
|
300
|
-
*/
|
|
301
|
-
getAssignments(userId) {
|
|
302
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
303
|
-
if (this.isEmptyUserId(userId.toString())) {
|
|
304
|
-
return {};
|
|
305
|
-
}
|
|
306
|
-
let assignments = {};
|
|
307
|
-
try {
|
|
308
|
-
let as = yield base_1.ModelManager.AuthAssignment.findAll({ where: { user_id: userId.toString() } });
|
|
309
|
-
for (const a of as) {
|
|
310
|
-
assignments[a["item_name"]] = a;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
catch (e) {
|
|
314
|
-
throw new base_1.InvalidConfigException('The user application component must be available to specify roles in AccessRule.');
|
|
315
|
-
}
|
|
316
|
-
return assignments;
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Returns the children for every parent.
|
|
321
|
-
* @return array the children list. Each array key is a parent item name,
|
|
322
|
-
* and the corresponding array value is a list of child item names.
|
|
323
|
-
*/
|
|
324
|
-
getChildrenList() {
|
|
325
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
326
|
-
let items = yield base_1.ModelManager.AuthItemChild.findAll();
|
|
327
|
-
let parents = {};
|
|
328
|
-
for (const item of items) {
|
|
329
|
-
parents[item["parent"]] = Utils_1.Utils.concat(parents[item["parent"]] || [], [item["child"]]);
|
|
330
|
-
}
|
|
331
|
-
return parents;
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Check whether $userId is empty.
|
|
336
|
-
* @param mixed $userId
|
|
337
|
-
* @return bool
|
|
338
|
-
* @since 2.0.26
|
|
339
|
-
*/
|
|
340
|
-
isEmptyUserId(userId) {
|
|
341
|
-
return !userId || userId === '';
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Checks whether array of $assignments is empty and [[defaultRoles]] property is empty as well.
|
|
345
|
-
*
|
|
346
|
-
* @param Assignment[] $assignments array of user's assignments
|
|
347
|
-
* @return bool whether array of $assignments is empty and [[defaultRoles]] property is empty as well
|
|
348
|
-
* @since 2.0.11
|
|
349
|
-
*/
|
|
350
|
-
hasNoAssignments(assignments) {
|
|
351
|
-
return Utils_1.Utils.isEmpty(assignments) && Utils_1.Utils.isEmpty(this.defaultRoles);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
AuthManager.TYPE_ROLE = 1;
|
|
355
|
-
AuthManager.TYPE_PERMISSION = 2;
|
|
356
|
-
exports.AuthManager = AuthManager;
|
package/rbac/index.d.ts
DELETED
package/rbac/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rbac/index.ts"],"names":[],"mappings":"AAQA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
package/rbac/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/*
|
|
18
|
-
*
|
|
19
|
-
* Copyright (c) 2023.. Chy Bilgisayar Bilisim
|
|
20
|
-
* Author: Cihan Ozturk
|
|
21
|
-
* E-mail: cihan@chy.com.tr
|
|
22
|
-
* Github:https://github.com/cihan53/
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
__exportStar(require("./AuthManager"), exports);
|
|
26
|
-
__exportStar(require("./AuthItem"), exports);
|
|
27
|
-
__exportStar(require("./AuthAssignment"), exports);
|
|
28
|
-
__exportStar(require("./AuthItemChild"), exports);
|
package/requiments/Glob.d.ts
DELETED
package/requiments/Glob.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Glob.d.ts","sourceRoot":"","sources":["../../src/requiments/Glob.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,IAAI,KAAkB,CAAC;AAC7B,eAAe,IAAI,CAAC"}
|
package/requiments/Glob.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
|
-
* Author: Cihan Ozturk
|
|
5
|
-
* E-mail: cihan@chy.com.tr
|
|
6
|
-
* Github:https://github.com/cihan53/
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const Glob = require("glob");
|
|
10
|
-
exports.default = Glob;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=ReflectUtil.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReflectUtil.d.ts","sourceRoot":"","sources":["../../src/requiments/ReflectUtil.ts"],"names":[],"mappings":""}
|
package/requiments/Utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/requiments/Utils.ts"],"names":[],"mappings":"AA+GA,eAAO,MAAM,KAAK,KAQjB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=BooleanValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanValidator.d.ts","sourceRoot":"","sources":["../../src/validators/BooleanValidator.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=CompareValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CompareValidator.d.ts","sourceRoot":"","sources":["../../src/validators/CompareValidator.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=DateValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DateValidator.d.ts","sourceRoot":"","sources":["../../src/validators/DateValidator.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=EmailValidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmailValidator.d.ts","sourceRoot":"","sources":["../../src/validators/EmailValidator.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Component } from "../base";
|
|
2
|
-
export declare class Validator extends Component {
|
|
3
|
-
static builtInValidators: {
|
|
4
|
-
boolean: string;
|
|
5
|
-
email: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @var array|string attributes to be validated by this validator. For multiple attributes,
|
|
9
|
-
* please specify them as an array; for single attribute, you may use either a string or an array.
|
|
10
|
-
*/
|
|
11
|
-
attributes: never[];
|
|
12
|
-
message: string;
|
|
13
|
-
except: never[];
|
|
14
|
-
isEmpty: never[];
|
|
15
|
-
init(): void;
|
|
16
|
-
static createValidator(type: any, model: any, attributes: any, params?: never[]): void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=Validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../src/validators/Validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAElC,qBAAa,SAAU,SAAQ,SAAS;IACpC,OAAc,iBAAiB;;;MAG9B;IAGD;;;OAGG;IACI,UAAU,UAAM;IAChB,OAAO,EAAE,MAAM,CAAM;IAErB,MAAM,UAAM;IACZ,OAAO,UAAM;IAEb,IAAI;WAIG,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAK;CAGpF"}
|
package/validators/Validator.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Validator = void 0;
|
|
4
|
-
const base_1 = require("../base");
|
|
5
|
-
class Validator extends base_1.Component {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
/**
|
|
9
|
-
* @var array|string attributes to be validated by this validator. For multiple attributes,
|
|
10
|
-
* please specify them as an array; for single attribute, you may use either a string or an array.
|
|
11
|
-
*/
|
|
12
|
-
this.attributes = [];
|
|
13
|
-
this.message = "";
|
|
14
|
-
this.except = [];
|
|
15
|
-
this.isEmpty = [];
|
|
16
|
-
}
|
|
17
|
-
init() {
|
|
18
|
-
super.init();
|
|
19
|
-
}
|
|
20
|
-
static createValidator(type, model, attributes, params = []) {
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
Validator.builtInValidators = {
|
|
24
|
-
'boolean': '',
|
|
25
|
-
'email': '',
|
|
26
|
-
};
|
|
27
|
-
exports.Validator = Validator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityInterface.d.ts","sourceRoot":"","sources":["../../src/web/IdentityInterface.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAC9B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAAA;IAE7B;;;;;;;;;OASG;IACH,yBAAyB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;IAEzD;;;OAGG;IACH,KAAK,IAAI,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;OAeG;IACH,UAAU,IAAI,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAGnD;;OAEG;IACH,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC;CAEhG"}
|