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
@@ -0,0 +1,5 @@
1
+ export * from "./AuthManager";
2
+ export * from "./AuthItem";
3
+ export * from "./AuthAssignment";
4
+ export * from "./AuthItemChild";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -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);
@@ -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
@@ -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
- var args = Array.prototype.slice.call(arguments, 1);
17
- var 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
- };
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
+ };
@@ -1,9 +1,2 @@
1
- /**
2
- *
3
- * @param text
4
- */
5
- declare const t: (text: string) => string;
6
- export declare const Utils: any;
7
- export { t };
8
- export default t;
1
+ export declare const Utils: any;
9
2
  //# sourceMappingURL=Utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/requiments/Utils.ts"],"names":[],"mappings":"AAkGA;;;GAGG;AACH,QAAA,MAAM,CAAC,SAAmB,MAAM,WAE/B,CAAA;AAED,eAAO,MAAM,KAAK,KAOjB,CAAA;AACD,OAAO,EAAC,CAAC,EAAC,CAAA;AACV,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/requiments/Utils.ts"],"names":[],"mappings":"AA+GA,eAAO,MAAM,KAAK,KAQjB,CAAA"}
@@ -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.t = exports.Utils = void 0;
11
- const _ = require('lodash');
12
- /**
13
- *
14
- * @param prefix
15
- * @param val
16
- * @param top
17
- */
18
- var 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
- var 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
- *
101
- * @param text
102
- */
103
- const t = function (text) {
104
- return text;
105
- };
106
- exports.t = t;
107
- exports.Utils = Object.assign({ findKeyValue,
108
- createObject,
109
- sleep,
110
- matchWildcard,
111
- toQuery }, _);
112
- exports.default = t;
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
@@ -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
- exports.Validator = Validator;
24
- Validator.builtInValidators = {
25
- 'boolean': '',
26
- 'email': '',
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
- findIdentityByAccessToken(token: any, type: string): any;
20
- /**
21
- * Returns an ID that can uniquely identify a user identity.
22
- * @return string|int an ID that uniquely identifies a user identity.
23
- */
24
- getId(): number;
25
- /**
26
- * Returns a key that can be used to check the validity of a given identity ID.
27
- *
28
- * The key should be unique for each individual user, and should be persistent
29
- * so that it can be used to check the validity of the user identity.
30
- *
31
- * The space of such keys should be big enough to defeat potential identity attacks.
32
- *
33
- * The returned key is used to validate session and auto-login (if [[User::enableAutoLogin]] is enabled).
34
- *
35
- * Make sure to invalidate earlier issued authKeys when you implement force user logout, password change and
36
- * other scenarios, that require forceful access revocation for old sessions.
37
- *
38
- * @return string|null a key that is used to check the validity of a given identity ID.
39
- * @see validateAuthKey()
40
- */
41
- getAuthKey(): string;
42
- /**
43
- * Validates the given auth key.
44
- *
45
- * @param string $authKey the given auth key
46
- * @return bool|null whether the given auth key is valid.
47
- * @see getAuthKey()
48
- */
49
- validateAuthKey(authKey: string): (boolean | null);
50
- /**
51
- *
52
- */
53
- can(permissionName: string, params: any[], allowCaching: boolean): Promise<(boolean | null)>;
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;;;;;;;;OAQG;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,EAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,EAAI,YAAY,EAAE,OAAO,GAAI,OAAO,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAE;CAEnG"}
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"}
@@ -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 });