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.
- package/BaseChyz.d.ts +73 -56
- package/BaseChyz.d.ts.map +1 -1
- package/BaseChyz.js +569 -404
- package/README.md +1 -1
- package/base/ActionFilter.d.ts +32 -32
- package/base/ActionFilter.d.ts.map +1 -1
- package/base/ActionFilter.js +82 -82
- package/base/BadRequestHttpException.d.ts +6 -0
- package/base/BadRequestHttpException.d.ts.map +1 -0
- package/base/BadRequestHttpException.js +17 -0
- package/base/BaseError.d.ts +43 -10
- package/base/BaseError.d.ts.map +1 -1
- package/base/BaseError.js +58 -26
- package/base/Behavior.d.ts +3 -3
- package/base/Behavior.js +7 -7
- package/base/CBaseObject.d.ts +4 -4
- package/base/CBaseObject.d.ts.map +1 -1
- package/base/CBaseObject.js +16 -16
- package/base/CEvents.d.ts +13 -0
- package/base/CEvents.d.ts.map +1 -0
- package/base/CEvents.js +24 -0
- package/base/CRequest.d.ts +1 -1
- package/base/CRequest.js +10 -10
- package/base/CWebController.d.ts +43 -43
- package/base/CWebController.d.ts.map +1 -1
- package/base/CWebController.js +81 -74
- package/base/Component.d.ts +20 -20
- package/base/Component.d.ts.map +1 -1
- package/base/Component.js +57 -57
- package/base/Configurable.d.ts +2 -2
- package/base/Configurable.js +8 -8
- package/base/DataErrorDbException.d.ts +5 -5
- package/base/DataErrorDbException.d.ts.map +1 -1
- package/base/DataErrorDbException.js +17 -17
- package/base/DbConnection.d.ts +12 -12
- package/base/DbConnection.js +53 -53
- package/base/ForbiddenHttpException.d.ts +4 -4
- package/base/ForbiddenHttpException.d.ts.map +1 -1
- package/base/ForbiddenHttpException.js +16 -16
- package/base/InvalidArgumentException.d.ts +5 -5
- package/base/InvalidArgumentException.d.ts.map +1 -1
- package/base/InvalidArgumentException.js +17 -17
- package/base/InvalidConfigException.d.ts +5 -5
- package/base/InvalidConfigException.d.ts.map +1 -1
- package/base/InvalidConfigException.js +17 -17
- package/base/Logs.d.ts +21 -21
- package/base/Logs.d.ts.map +1 -1
- package/base/Logs.js +57 -57
- package/base/Model.d.ts +301 -298
- package/base/Model.d.ts.map +1 -1
- package/base/Model.js +545 -507
- package/base/ModelManager.d.ts +1 -1
- package/base/ModelManager.js +19 -19
- package/base/NotFoundHttpException.d.ts +5 -5
- package/base/NotFoundHttpException.d.ts.map +1 -1
- package/base/NotFoundHttpException.js +17 -17
- package/base/RestClient.d.ts +6 -6
- package/base/RestClient.d.ts.map +1 -1
- package/base/RestClient.js +25 -25
- package/base/UnauthorizedHttpException.d.ts +5 -5
- package/base/UnauthorizedHttpException.d.ts.map +1 -1
- package/base/UnauthorizedHttpException.js +17 -17
- package/base/ValidationHttpException.d.ts +5 -5
- package/base/ValidationHttpException.d.ts.map +1 -1
- package/base/ValidationHttpException.js +17 -17
- package/base/db/Exception.d.ts +6 -6
- package/base/db/Exception.js +15 -15
- package/base/index.d.ts +19 -18
- package/base/index.d.ts.map +1 -1
- package/base/index.js +41 -39
- package/decorator/Middleware.d.ts +3 -3
- package/decorator/Middleware.js +11 -11
- package/decorator/controller.d.ts +2 -2
- package/decorator/controller.js +24 -24
- package/decorator/delete.d.ts +3 -0
- package/decorator/delete.d.ts.map +1 -0
- package/decorator/delete.js +36 -0
- package/decorator/enums/ControllerDecoratorParams.d.ts +5 -5
- package/decorator/enums/ControllerDecoratorParams.js +9 -9
- package/decorator/get.d.ts +2 -2
- package/decorator/get.js +36 -36
- package/decorator/index.d.ts +5 -3
- package/decorator/index.d.ts.map +1 -1
- package/decorator/index.js +13 -9
- package/decorator/post.d.ts +2 -2
- package/decorator/post.js +36 -36
- package/decorator/put.d.ts +3 -0
- package/decorator/put.d.ts.map +1 -0
- package/decorator/put.js +36 -0
- package/filters/AccessControl.d.ts +12 -12
- package/filters/AccessControl.d.ts.map +1 -1
- package/filters/AccessControl.js +83 -83
- package/filters/AccessRule.d.ts +82 -82
- package/filters/AccessRule.d.ts.map +1 -1
- package/filters/AccessRule.js +136 -137
- package/filters/auth/AuthInterface.d.ts +25 -25
- package/filters/auth/AuthInterface.js +2 -2
- package/filters/auth/AuthMethod.d.ts +37 -37
- package/filters/auth/AuthMethod.d.ts.map +1 -1
- package/filters/auth/AuthMethod.js +82 -82
- package/filters/auth/HttpBasicAuth.d.ts +23 -22
- package/filters/auth/HttpBasicAuth.d.ts.map +1 -1
- package/filters/auth/HttpBasicAuth.js +78 -72
- package/filters/auth/HttpBearerAuth.d.ts +17 -17
- package/filters/auth/HttpBearerAuth.d.ts.map +1 -1
- package/filters/auth/HttpBearerAuth.js +33 -32
- package/filters/auth/HttpHeaderAuth.d.ts +18 -14
- package/filters/auth/HttpHeaderAuth.d.ts.map +1 -1
- package/filters/auth/HttpHeaderAuth.js +64 -57
- package/filters/auth/JwtHttpBearerAuth.d.ts +20 -20
- package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -1
- package/filters/auth/JwtHttpBearerAuth.js +87 -81
- package/filters/auth/KeyCloakHttpBearerAuth.d.ts +22 -22
- package/filters/auth/KeyCloakHttpBearerAuth.js +116 -116
- package/filters/auth/index.d.ts +4 -4
- package/filters/auth/index.js +11 -11
- package/filters/index.d.ts +2 -2
- package/filters/index.js +7 -7
- package/index.d.ts +28 -21
- package/index.d.ts.map +1 -1
- package/index.js +71 -60
- package/model/RouteDefinition.d.ts +6 -6
- package/model/RouteDefinition.js +8 -8
- package/package.json +22 -24
- package/rbac/AuthAssignment.d.ts +18 -18
- package/rbac/AuthAssignment.js +44 -44
- package/rbac/AuthItem.d.ts +26 -26
- package/rbac/AuthItem.js +51 -51
- package/rbac/AuthItemChild.d.ts +18 -18
- package/rbac/AuthItemChild.js +43 -43
- package/rbac/AuthManager.d.ts +111 -111
- package/rbac/AuthManager.d.ts.map +1 -1
- package/rbac/AuthManager.js +356 -355
- package/rbac/index.d.ts +5 -0
- package/rbac/index.d.ts.map +1 -0
- package/rbac/index.js +28 -0
- package/requiments/Glob.d.ts +2 -2
- package/requiments/Glob.js +10 -10
- package/requiments/ReflectUtil.js +24 -24
- package/requiments/Utils.d.ts +1 -8
- package/requiments/Utils.d.ts.map +1 -1
- package/requiments/Utils.js +115 -112
- package/validators/BooleanValidator.js +1 -1
- package/validators/CompareValidator.js +1 -1
- package/validators/DateValidator.js +1 -1
- package/validators/EmailValidator.js +1 -1
- package/validators/Validator.d.ts +17 -17
- package/validators/Validator.js +27 -27
- package/web/IdentityInterface.d.ts +55 -54
- package/web/IdentityInterface.d.ts.map +1 -1
- package/web/IdentityInterface.js +8 -8
- package/web/WebUser.d.ts +71 -71
- package/web/WebUser.js +165 -165
package/rbac/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const Glob: any;
|
|
2
|
-
export default Glob;
|
|
1
|
+
declare const Glob: any;
|
|
2
|
+
export default Glob;
|
|
3
3
|
//# sourceMappingURL=Glob.d.ts.map
|
package/requiments/Glob.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
+
"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,24 +1,24 @@
|
|
|
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
|
-
/**
|
|
9
|
-
* @param strClass:
|
|
10
|
-
* class name
|
|
11
|
-
* @param optionals:
|
|
12
|
-
* constructor arguments
|
|
13
|
-
*/
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
Reflect.newInstance = function (strClass) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const F = () => {
|
|
19
|
-
return clsClass.apply(this, args);
|
|
20
|
-
};
|
|
21
|
-
F.prototype = clsClass.prototype;
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
return new F();
|
|
24
|
-
};
|
|
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
|
+
/**
|
|
9
|
+
* @param strClass:
|
|
10
|
+
* class name
|
|
11
|
+
* @param optionals:
|
|
12
|
+
* constructor arguments
|
|
13
|
+
*/
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
Reflect.newInstance = function (strClass) {
|
|
16
|
+
const args = Array.prototype.slice.call(arguments, 1);
|
|
17
|
+
const clsClass = eval(strClass);
|
|
18
|
+
const F = () => {
|
|
19
|
+
return clsClass.apply(this, args);
|
|
20
|
+
};
|
|
21
|
+
F.prototype = clsClass.prototype;
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
return new F();
|
|
24
|
+
};
|
package/requiments/Utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/requiments/Utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/requiments/Utils.ts"],"names":[],"mappings":"AA+GA,eAAO,MAAM,KAAK,KAQjB,CAAA"}
|
package/requiments/Utils.js
CHANGED
|
@@ -1,112 +1,115 @@
|
|
|
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
|
-
// import _ from "lodash";
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
11
|
-
const _ = require('lodash');
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param prefix
|
|
15
|
-
* @param val
|
|
16
|
-
* @param top
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
if (_.isUndefined(top))
|
|
20
|
-
top = true;
|
|
21
|
-
if (_.isArray(val)) {
|
|
22
|
-
return _.map(val, function (value, key) {
|
|
23
|
-
return buildParams(top ? key : prefix + '[]', value, false);
|
|
24
|
-
}).join('&');
|
|
25
|
-
}
|
|
26
|
-
else if (_.isObject(val)) {
|
|
27
|
-
return _.map(val, function (value, key) {
|
|
28
|
-
return buildParams(top ? key : prefix + '[' + key + ']', value, false);
|
|
29
|
-
}).join('&');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return encodeURIComponent(prefix) + '=' + encodeURIComponent(val);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
*Creates a query string from a hash
|
|
37
|
-
* @param obj
|
|
38
|
-
*/
|
|
39
|
-
const toQuery = function (obj) {
|
|
40
|
-
return buildParams('', obj);
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @param object
|
|
45
|
-
* @param params
|
|
46
|
-
*/
|
|
47
|
-
const createObject = (object, params) => {
|
|
48
|
-
let newParams = {};
|
|
49
|
-
Object.keys(params).forEach((param) => {
|
|
50
|
-
newParams[param] = {};
|
|
51
|
-
Object.assign(newParams[param], {
|
|
52
|
-
writable: true,
|
|
53
|
-
configurable: true,
|
|
54
|
-
value: params[param]
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
return Object.create(object, newParams);
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
* @param object
|
|
62
|
-
* @param findKey
|
|
63
|
-
*/
|
|
64
|
-
const findKeyValue = (object, findKey) => {
|
|
65
|
-
let key = Object.keys(object).find(key => key.toLowerCase() === findKey.toLowerCase());
|
|
66
|
-
if (key) {
|
|
67
|
-
return object[key];
|
|
68
|
-
}
|
|
69
|
-
return null;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @param seconds
|
|
74
|
-
*/
|
|
75
|
-
const sleep = (seconds = 1) => {
|
|
76
|
-
|
|
77
|
-
while (waitTill > new Date()) {
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @param wildcard
|
|
83
|
-
* @param str
|
|
84
|
-
*/
|
|
85
|
-
function wildTest(wildcard, str) {
|
|
86
|
-
let w = wildcard.replace(/[.+^${}()|[\]\\]/g, '\\$&'); // regexp escape
|
|
87
|
-
const re = new RegExp(`^${w.replace(/\*/g, '.*').replace(/\?/g, '.')}$`, 'i');
|
|
88
|
-
return re.test(str); // remove last 'i' above to have case sensitive
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @param pattern
|
|
93
|
-
* @param string
|
|
94
|
-
* @param options
|
|
95
|
-
*/
|
|
96
|
-
const matchWildcard = (pattern, string, options = {}) => {
|
|
97
|
-
return wildTest(pattern, string);
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
* @param
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
+
// import _ from "lodash";
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Utils = void 0;
|
|
11
|
+
const _ = require('lodash');
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param prefix
|
|
15
|
+
* @param val
|
|
16
|
+
* @param top
|
|
17
|
+
*/
|
|
18
|
+
const buildParams = function (prefix, val, top) {
|
|
19
|
+
if (_.isUndefined(top))
|
|
20
|
+
top = true;
|
|
21
|
+
if (_.isArray(val)) {
|
|
22
|
+
return _.map(val, function (value, key) {
|
|
23
|
+
return buildParams(top ? key : prefix + '[]', value, false);
|
|
24
|
+
}).join('&');
|
|
25
|
+
}
|
|
26
|
+
else if (_.isObject(val)) {
|
|
27
|
+
return _.map(val, function (value, key) {
|
|
28
|
+
return buildParams(top ? key : prefix + '[' + key + ']', value, false);
|
|
29
|
+
}).join('&');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return encodeURIComponent(prefix) + '=' + encodeURIComponent(val);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
*Creates a query string from a hash
|
|
37
|
+
* @param obj
|
|
38
|
+
*/
|
|
39
|
+
const toQuery = function (obj) {
|
|
40
|
+
return buildParams('', obj);
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param object
|
|
45
|
+
* @param params
|
|
46
|
+
*/
|
|
47
|
+
const createObject = (object, params) => {
|
|
48
|
+
let newParams = {};
|
|
49
|
+
Object.keys(params).forEach((param) => {
|
|
50
|
+
newParams[param] = {};
|
|
51
|
+
Object.assign(newParams[param], {
|
|
52
|
+
writable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
value: params[param]
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
return Object.create(object, newParams);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param object
|
|
62
|
+
* @param findKey
|
|
63
|
+
*/
|
|
64
|
+
const findKeyValue = (object, findKey) => {
|
|
65
|
+
let key = Object.keys(object).find(key => key.toLowerCase() === findKey.toLowerCase());
|
|
66
|
+
if (key) {
|
|
67
|
+
return object[key];
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param seconds
|
|
74
|
+
*/
|
|
75
|
+
const sleep = (seconds = 1) => {
|
|
76
|
+
const waitTill = new Date(new Date().getTime() + seconds * 1000);
|
|
77
|
+
while (waitTill > new Date()) {
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param wildcard
|
|
83
|
+
* @param str
|
|
84
|
+
*/
|
|
85
|
+
function wildTest(wildcard, str) {
|
|
86
|
+
let w = wildcard.replace(/[.+^${}()|[\]\\]/g, '\\$&'); // regexp escape
|
|
87
|
+
const re = new RegExp(`^${w.replace(/\*/g, '.*').replace(/\?/g, '.')}$`, 'i');
|
|
88
|
+
return re.test(str); // remove last 'i' above to have case sensitive
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @param pattern
|
|
93
|
+
* @param string
|
|
94
|
+
* @param options
|
|
95
|
+
*/
|
|
96
|
+
const matchWildcard = (pattern, string, options = {}) => {
|
|
97
|
+
return wildTest(pattern, string);
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* random string genrate
|
|
101
|
+
* @param length
|
|
102
|
+
* @param randomString
|
|
103
|
+
*/
|
|
104
|
+
const generateRandomString = function (length, randomString = "") {
|
|
105
|
+
randomString += Math.random().toString(20).substring(2, length);
|
|
106
|
+
if (randomString.length > length)
|
|
107
|
+
return randomString.slice(0, length);
|
|
108
|
+
return generateRandomString(length, randomString);
|
|
109
|
+
};
|
|
110
|
+
exports.Utils = Object.assign({ findKeyValue,
|
|
111
|
+
createObject,
|
|
112
|
+
sleep,
|
|
113
|
+
matchWildcard,
|
|
114
|
+
toQuery,
|
|
115
|
+
generateRandomString }, _);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
@@ -1,18 +1,18 @@
|
|
|
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
|
-
}
|
|
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
18
|
//# sourceMappingURL=Validator.d.ts.map
|
package/validators/Validator.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
|
|
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,55 +1,56 @@
|
|
|
1
|
-
export interface IdentityInterface {
|
|
2
|
-
/**
|
|
3
|
-
* Finds an identity by the given ID.
|
|
4
|
-
* @param string|int $id the ID to be looked for
|
|
5
|
-
* @return IdentityInterface|null the identity object that matches the given ID.
|
|
6
|
-
* Null should be returned if such an identity cannot be found
|
|
7
|
-
* or the identity is not in an active state (disabled, deleted, etc.)
|
|
8
|
-
*/
|
|
9
|
-
findIdentity(id: number): any;
|
|
10
|
-
/**
|
|
11
|
-
* Finds an identity by the given token.
|
|
12
|
-
* For example, [[\yii\filters\auth\HttpBearerAuth]] will set this parameter to be `yii\filters\auth\HttpBearerAuth`.
|
|
13
|
-
* @return IdentityInterface|null the identity object that matches the given token.
|
|
14
|
-
* Null should be returned if such an identity cannot be found
|
|
15
|
-
* or the identity is not in an active state (disabled, deleted, etc.)
|
|
16
|
-
* @param token
|
|
17
|
-
* @param type
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* @
|
|
47
|
-
* @
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
export interface IdentityInterface {
|
|
2
|
+
/**
|
|
3
|
+
* Finds an identity by the given ID.
|
|
4
|
+
* @param string|int $id the ID to be looked for
|
|
5
|
+
* @return IdentityInterface|null the identity object that matches the given ID.
|
|
6
|
+
* Null should be returned if such an identity cannot be found
|
|
7
|
+
* or the identity is not in an active state (disabled, deleted, etc.)
|
|
8
|
+
*/
|
|
9
|
+
findIdentity(id: number): any;
|
|
10
|
+
/**
|
|
11
|
+
* Finds an identity by the given token.
|
|
12
|
+
* For example, [[\yii\filters\auth\HttpBearerAuth]] will set this parameter to be `yii\filters\auth\HttpBearerAuth`.
|
|
13
|
+
* @return IdentityInterface|null the identity object that matches the given token.
|
|
14
|
+
* Null should be returned if such an identity cannot be found
|
|
15
|
+
* or the identity is not in an active state (disabled, deleted, etc.)
|
|
16
|
+
* @param token
|
|
17
|
+
* @param type
|
|
18
|
+
* @param any
|
|
19
|
+
*/
|
|
20
|
+
findIdentityByAccessToken(token: any, type: string): any;
|
|
21
|
+
/**
|
|
22
|
+
* Returns an ID that can uniquely identify a user identity.
|
|
23
|
+
* @return string|int an ID that uniquely identifies a user identity.
|
|
24
|
+
*/
|
|
25
|
+
getId(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Returns a key that can be used to check the validity of a given identity ID.
|
|
28
|
+
*
|
|
29
|
+
* The key should be unique for each individual user, and should be persistent
|
|
30
|
+
* so that it can be used to check the validity of the user identity.
|
|
31
|
+
*
|
|
32
|
+
* The space of such keys should be big enough to defeat potential identity attacks.
|
|
33
|
+
*
|
|
34
|
+
* The returned key is used to validate session and auto-login (if [[User::enableAutoLogin]] is enabled).
|
|
35
|
+
*
|
|
36
|
+
* Make sure to invalidate earlier issued authKeys when you implement force user logout, password change and
|
|
37
|
+
* other scenarios, that require forceful access revocation for old sessions.
|
|
38
|
+
*
|
|
39
|
+
* @return string|null a key that is used to check the validity of a given identity ID.
|
|
40
|
+
* @see validateAuthKey()
|
|
41
|
+
*/
|
|
42
|
+
getAuthKey(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Validates the given auth key.
|
|
45
|
+
*
|
|
46
|
+
* @param string $authKey the given auth key
|
|
47
|
+
* @return bool|null whether the given auth key is valid.
|
|
48
|
+
* @see getAuthKey()
|
|
49
|
+
*/
|
|
50
|
+
validateAuthKey(authKey: string): (boolean | null);
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
can(permissionName: string, params: any[], allowCaching: boolean): Promise<(boolean | null)>;
|
|
55
|
+
}
|
|
55
56
|
//# sourceMappingURL=IdentityInterface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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"}
|
package/web/IdentityInterface.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 });
|
|
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 });
|