chyz 1.2.5-rc.2 → 2.0.0-rc.4

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 (223) hide show
  1. package/BaseChyz.d.ts +61 -0
  2. package/BaseChyz.d.ts.map +1 -0
  3. package/BaseChyz.js +11 -15
  4. package/base/ActionFilter.d.ts +33 -0
  5. package/base/ActionFilter.d.ts.map +1 -0
  6. package/base/ActionFilter.js +18 -14
  7. package/base/BaseError.d.ts +11 -0
  8. package/base/BaseError.d.ts.map +1 -0
  9. package/base/BaseError.js +0 -1
  10. package/base/Behavior.d.ts +4 -0
  11. package/base/Behavior.d.ts.map +1 -0
  12. package/base/Behavior.js +2 -3
  13. package/base/CBaseObject.d.ts +5 -0
  14. package/base/CBaseObject.d.ts.map +1 -0
  15. package/base/CBaseObject.js +16 -0
  16. package/base/CWebController.d.ts +44 -0
  17. package/base/CWebController.d.ts.map +1 -0
  18. package/base/CWebController.js +0 -1
  19. package/base/Component.d.ts +21 -0
  20. package/base/Component.d.ts.map +1 -0
  21. package/base/Component.js +5 -6
  22. package/base/Configurable.d.ts +3 -0
  23. package/base/Configurable.d.ts.map +1 -0
  24. package/base/Configurable.js +0 -1
  25. package/base/DataErrorDbException.d.ts +6 -0
  26. package/base/DataErrorDbException.d.ts.map +1 -0
  27. package/base/DataErrorDbException.js +0 -1
  28. package/base/DbConnection.d.ts +13 -0
  29. package/base/DbConnection.d.ts.map +1 -0
  30. package/base/DbConnection.js +1 -2
  31. package/base/ForbiddenHttpException.d.ts +5 -0
  32. package/base/ForbiddenHttpException.d.ts.map +1 -0
  33. package/base/ForbiddenHttpException.js +0 -1
  34. package/base/InvalidArgumentException.d.ts +6 -0
  35. package/base/InvalidArgumentException.d.ts.map +1 -0
  36. package/base/InvalidArgumentException.js +0 -1
  37. package/base/InvalidConfigException.d.ts +6 -0
  38. package/base/InvalidConfigException.d.ts.map +1 -0
  39. package/base/InvalidConfigException.js +0 -1
  40. package/base/Logger.d.ts +18 -0
  41. package/base/Logger.d.ts.map +1 -0
  42. package/base/Logger.js +49 -0
  43. package/base/Model.d.ts +299 -0
  44. package/base/Model.d.ts.map +1 -0
  45. package/base/Model.js +0 -1
  46. package/base/ModelManager.d.ts +2 -0
  47. package/base/ModelManager.d.ts.map +1 -0
  48. package/base/ModelManager.js +11 -1
  49. package/base/NotFoundHttpException.d.ts +6 -0
  50. package/base/NotFoundHttpException.d.ts.map +1 -0
  51. package/base/NotFoundHttpException.js +0 -1
  52. package/base/RestClient.d.ts +9 -0
  53. package/base/RestClient.d.ts.map +1 -0
  54. package/base/RestClient.js +0 -1
  55. package/base/UnauthorizedHttpException.d.ts +6 -0
  56. package/base/UnauthorizedHttpException.d.ts.map +1 -0
  57. package/base/UnauthorizedHttpException.js +0 -1
  58. package/base/ValidationHttpException.d.ts +6 -0
  59. package/base/ValidationHttpException.d.ts.map +1 -0
  60. package/base/ValidationHttpException.js +0 -1
  61. package/base/db/Exception.d.ts +7 -0
  62. package/base/db/Exception.d.ts.map +1 -0
  63. package/base/db/Exception.js +0 -1
  64. package/base/index.d.ts +18 -0
  65. package/base/index.d.ts.map +1 -0
  66. package/base/index.js +3 -6
  67. package/decorator/Middleware.d.ts +4 -0
  68. package/decorator/Middleware.d.ts.map +1 -0
  69. package/decorator/Middleware.js +0 -1
  70. package/decorator/controller.d.ts +3 -0
  71. package/decorator/controller.d.ts.map +1 -0
  72. package/decorator/controller.js +0 -1
  73. package/decorator/enums/ControllerDecoratorParams.d.ts +6 -0
  74. package/decorator/enums/ControllerDecoratorParams.d.ts.map +1 -0
  75. package/decorator/enums/ControllerDecoratorParams.js +0 -1
  76. package/decorator/get.d.ts +3 -0
  77. package/decorator/get.d.ts.map +1 -0
  78. package/decorator/get.js +0 -1
  79. package/decorator/index.d.ts +4 -0
  80. package/decorator/index.d.ts.map +1 -0
  81. package/decorator/index.js +0 -1
  82. package/decorator/post.d.ts +3 -0
  83. package/decorator/post.d.ts.map +1 -0
  84. package/decorator/post.js +0 -1
  85. package/filters/AccessControl.d.ts +13 -0
  86. package/filters/AccessControl.d.ts.map +1 -0
  87. package/filters/AccessControl.js +4 -5
  88. package/filters/AccessRule.d.ts +83 -0
  89. package/filters/AccessRule.d.ts.map +1 -0
  90. package/filters/AccessRule.js +2 -2
  91. package/filters/auth/AuthInterface.d.ts +26 -0
  92. package/filters/auth/AuthInterface.d.ts.map +1 -0
  93. package/filters/auth/AuthInterface.js +0 -1
  94. package/filters/auth/AuthMethod.d.ts +38 -0
  95. package/filters/auth/AuthMethod.d.ts.map +1 -0
  96. package/filters/auth/AuthMethod.js +12 -1
  97. package/filters/auth/HttpBasicAuth.d.ts +23 -0
  98. package/filters/auth/HttpBasicAuth.d.ts.map +1 -0
  99. package/filters/auth/HttpBasicAuth.js +0 -1
  100. package/filters/auth/HttpBearerAuth.d.ts +18 -0
  101. package/filters/auth/HttpBearerAuth.d.ts.map +1 -0
  102. package/filters/auth/HttpBearerAuth.js +0 -1
  103. package/filters/auth/HttpHeaderAuth.d.ts +15 -0
  104. package/filters/auth/HttpHeaderAuth.d.ts.map +1 -0
  105. package/filters/auth/HttpHeaderAuth.js +0 -1
  106. package/filters/auth/JwtHttpBearerAuth.d.ts +21 -0
  107. package/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -0
  108. package/filters/auth/JwtHttpBearerAuth.js +0 -1
  109. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +23 -0
  110. package/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +1 -0
  111. package/filters/auth/KeyCloakHttpBearerAuth.js +0 -1
  112. package/filters/auth/index.d.ts +5 -0
  113. package/filters/auth/index.d.ts.map +1 -0
  114. package/filters/auth/index.js +0 -1
  115. package/filters/index.d.ts +3 -0
  116. package/filters/index.d.ts.map +1 -0
  117. package/filters/index.js +0 -1
  118. package/index.d.ts +17 -0
  119. package/index.d.ts.map +1 -0
  120. package/index.js +21 -17
  121. package/model/RouteDefinition.d.ts +7 -0
  122. package/model/RouteDefinition.d.ts.map +1 -0
  123. package/model/RouteDefinition.js +0 -1
  124. package/package.json +12 -10
  125. package/rbac/AuthAssignment.d.ts +19 -0
  126. package/rbac/AuthAssignment.d.ts.map +1 -0
  127. package/rbac/AuthAssignment.js +0 -1
  128. package/rbac/AuthItem.d.ts +27 -0
  129. package/rbac/AuthItem.d.ts.map +1 -0
  130. package/rbac/AuthItem.js +0 -1
  131. package/rbac/AuthItemChild.d.ts +19 -0
  132. package/rbac/AuthItemChild.d.ts.map +1 -0
  133. package/rbac/AuthItemChild.js +0 -1
  134. package/rbac/AuthManager.d.ts +112 -0
  135. package/rbac/AuthManager.d.ts.map +1 -0
  136. package/rbac/AuthManager.js +0 -1
  137. package/requiments/Glob.d.ts +3 -0
  138. package/requiments/Glob.d.ts.map +1 -0
  139. package/requiments/Glob.js +0 -1
  140. package/requiments/ReflectUtil.d.ts +1 -0
  141. package/requiments/ReflectUtil.d.ts.map +1 -0
  142. package/requiments/ReflectUtil.js +0 -1
  143. package/requiments/Utils.d.ts +3 -0
  144. package/requiments/Utils.d.ts.map +1 -0
  145. package/requiments/Utils.js +7 -1
  146. package/validators/BooleanValidator.d.ts +1 -0
  147. package/validators/BooleanValidator.d.ts.map +1 -0
  148. package/validators/BooleanValidator.js +0 -1
  149. package/validators/CompareValidator.d.ts +1 -0
  150. package/validators/CompareValidator.d.ts.map +1 -0
  151. package/validators/CompareValidator.js +0 -1
  152. package/validators/DateValidator.d.ts +1 -0
  153. package/validators/DateValidator.d.ts.map +1 -0
  154. package/validators/DateValidator.js +0 -1
  155. package/validators/EmailValidator.d.ts +1 -0
  156. package/validators/EmailValidator.d.ts.map +1 -0
  157. package/validators/EmailValidator.js +0 -1
  158. package/validators/Validator.d.ts +18 -0
  159. package/validators/Validator.d.ts.map +1 -0
  160. package/validators/Validator.js +0 -1
  161. package/web/IdentityInterface.d.ts +55 -0
  162. package/web/IdentityInterface.d.ts.map +1 -0
  163. package/web/IdentityInterface.js +0 -1
  164. package/web/WebUser.d.ts +72 -0
  165. package/web/WebUser.d.ts.map +1 -0
  166. package/web/WebUser.js +0 -1
  167. package/BaseChyz.js.map +0 -1
  168. package/Chyz.js +0 -15
  169. package/Chyz.js.map +0 -1
  170. package/base/ActionFilter.js.map +0 -1
  171. package/base/BaseError.js.map +0 -1
  172. package/base/BaseObject.js +0 -20
  173. package/base/BaseObject.js.map +0 -1
  174. package/base/Behavior.js.map +0 -1
  175. package/base/CWebController.js.map +0 -1
  176. package/base/Component.js.map +0 -1
  177. package/base/Configurable.js.map +0 -1
  178. package/base/DataErrorDbException.js.map +0 -1
  179. package/base/DbConnection.js.map +0 -1
  180. package/base/ForbiddenHttpException.js.map +0 -1
  181. package/base/InvalidArgumentException.js.map +0 -1
  182. package/base/InvalidConfigException.js.map +0 -1
  183. package/base/Model.js.map +0 -1
  184. package/base/ModelManager.js.map +0 -1
  185. package/base/NotFoundHttpException.js.map +0 -1
  186. package/base/RestClient.js.map +0 -1
  187. package/base/UnauthorizedHttpException.js.map +0 -1
  188. package/base/ValidationHttpException.js.map +0 -1
  189. package/base/db/Exception.js.map +0 -1
  190. package/base/index.js.map +0 -1
  191. package/decorator/Middleware.js.map +0 -1
  192. package/decorator/controller.js.map +0 -1
  193. package/decorator/enums/ControllerDecoratorParams.js.map +0 -1
  194. package/decorator/get.js.map +0 -1
  195. package/decorator/index.js.map +0 -1
  196. package/decorator/post.js.map +0 -1
  197. package/filters/AccessControl.js.map +0 -1
  198. package/filters/AccessRule.js.map +0 -1
  199. package/filters/auth/AuthInterface.js.map +0 -1
  200. package/filters/auth/AuthMethod.js.map +0 -1
  201. package/filters/auth/HttpBasicAuth.js.map +0 -1
  202. package/filters/auth/HttpBearerAuth.js.map +0 -1
  203. package/filters/auth/HttpHeaderAuth.js.map +0 -1
  204. package/filters/auth/JwtHttpBearerAuth.js.map +0 -1
  205. package/filters/auth/KeyCloakHttpBearerAuth.js.map +0 -1
  206. package/filters/auth/index.js.map +0 -1
  207. package/filters/index.js.map +0 -1
  208. package/index.js.map +0 -1
  209. package/model/RouteDefinition.js.map +0 -1
  210. package/rbac/AuthAssignment.js.map +0 -1
  211. package/rbac/AuthItem.js.map +0 -1
  212. package/rbac/AuthItemChild.js.map +0 -1
  213. package/rbac/AuthManager.js.map +0 -1
  214. package/requiments/Glob.js.map +0 -1
  215. package/requiments/ReflectUtil.js.map +0 -1
  216. package/requiments/Utils.js.map +0 -1
  217. package/validators/BooleanValidator.js.map +0 -1
  218. package/validators/CompareValidator.js.map +0 -1
  219. package/validators/DateValidator.js.map +0 -1
  220. package/validators/EmailValidator.js.map +0 -1
  221. package/validators/Validator.js.map +0 -1
  222. package/web/IdentityInterface.js.map +0 -1
  223. package/web/WebUser.js.map +0 -1
@@ -0,0 +1,299 @@
1
+ import { Component } from "./Component";
2
+ import { Model as SModel } from "sequelize";
3
+ export { DataTypes, NOW } from "sequelize";
4
+ export interface Relation {
5
+ type: "hasOne" | "hasMany" | "belongsToMany" | "belongsTo";
6
+ allowNull?: boolean;
7
+ sourceKey?: string;
8
+ model: SModel;
9
+ foreignKey: string;
10
+ name?: string;
11
+ through?: any;
12
+ as?: string;
13
+ }
14
+ /**
15
+ * ValidateMe.init({
16
+ bar: {
17
+ type: Sequelize.STRING,
18
+ validate: {
19
+ is: ["^[a-z]+$",'i'], // will only allow letters
20
+ is: /^[a-z]+$/i, // same as the previous example using real RegExp
21
+ not: ["[a-z]",'i'], // will not allow letters
22
+ isEmail: true, // checks for email format (foo@bar.com)
23
+ isUrl: true, // checks for url format (http://foo.com)
24
+ isIP: true, // checks for IPv4 (129.89.23.1) or IPv6 format
25
+ isIPv4: true, // checks for IPv4 (129.89.23.1)
26
+ isIPv6: true, // checks for IPv6 format
27
+ isAlpha: true, // will only allow letters
28
+ isAlphanumeric: true, // will only allow alphanumeric characters, so "_abc" will fail
29
+ isNumeric: true, // will only allow numbers
30
+ isInt: true, // checks for valid integers
31
+ isFloat: true, // checks for valid floating point numbers
32
+ isDecimal: true, // checks for any numbers
33
+ isLowercase: true, // checks for lowercase
34
+ isUppercase: true, // checks for uppercase
35
+ notNull: true, // won't allow null
36
+ isNull: true, // only allows null
37
+ notEmpty: true, // don't allow empty strings
38
+ equals: 'specific value', // only allow a specific value
39
+ contains: 'foo', // force specific substrings
40
+ notIn: [['foo', 'bar']], // check the value is not one of these
41
+ isIn: [['foo', 'bar']], // check the value is one of these
42
+ notContains: 'bar', // don't allow specific substrings
43
+ len: [2,10], // only allow values with length between 2 and 10
44
+ isUUID: 4, // only allow uuids
45
+ isDate: true, // only allow date strings
46
+ isAfter: "2011-11-05", // only allow date strings after a specific date
47
+ isBefore: "2011-11-05", // only allow date strings before a specific date
48
+ max: 23, // only allow values <= 23
49
+ min: 23, // only allow values >= 23
50
+ isCreditCard: true, // check for valid credit card numbers
51
+
52
+ // Examples of custom validators:
53
+ isEven(value) {
54
+ if (parseInt(value) % 2 !== 0) {
55
+ throw new Error('Only even values are allowed!');
56
+ }
57
+ }
58
+ isGreaterThanOtherField(value) {
59
+ if (parseInt(value) <= parseInt(this.otherField)) {
60
+ throw new Error('Bar must be greater than otherField.');
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }, { sequelize });
66
+ */
67
+ export declare class Model extends Component {
68
+ _sequelize: any;
69
+ _register: any;
70
+ private _tableName;
71
+ private _model;
72
+ private _attributes;
73
+ private _errors;
74
+ constructor(sequelize?: IDBDatabase);
75
+ /**
76
+ * Returns the database connection used by this AR class.
77
+ * By default, the "db" application component is used as the database connection.
78
+ * You may override this method if you want to use a different database connection.
79
+ * @return Connection the database connection used by this AR class.
80
+ */
81
+ getDb(): any;
82
+ getDbConnection(): any;
83
+ get sequelize(): any;
84
+ set sequelize(value: any);
85
+ provider(): any;
86
+ /**
87
+ *
88
+ */
89
+ get errors(): any;
90
+ set errors(value: any);
91
+ init(): void;
92
+ alias(): string;
93
+ tableName(): string;
94
+ formName(): string;
95
+ rules(): never[];
96
+ setModel(value: any): void;
97
+ model(): any;
98
+ save(params?: {}, options?: {}): Promise<any>;
99
+ bulkCreate(params?: {}, options?: {}): Promise<any>;
100
+ update(params?: {}, options?: {}): any;
101
+ delete(params?: {}, options?: {}): any;
102
+ /**
103
+ * As there are often use cases in which it is just easier to execute raw / already prepared SQL queries, you can use the sequelize.query method.
104
+ *
105
+ * By default the function will return two arguments - a results array, and an object containing metadata (such as amount of affected rows, etc). Note that since this is a raw query, the metadata are dialect specific. Some dialects return the metadata "within" the results object (as properties on an array). However, two arguments will always be returned, but for MSSQL and MySQL it will be two references to the same object.
106
+ *
107
+ * const [results, metadata] = await sequelize.query("UPDATE users SET y = 42 WHERE x = 12");
108
+ * // Results will be an empty array and metadata will contain the number of affected rows.
109
+ *
110
+ * In cases where you don't need to access the metadata you can pass in a query type to tell sequelize how to format the results. For example, for a simple select query you could do:
111
+ *
112
+ * const { QueryTypes } = require('@sequelize/core');
113
+ * const users = await sequelize.query("SELECT * FROM `users`", { type: QueryTypes.SELECT });
114
+ * // We didn't need to destructure the result here - the results were returned directly
115
+ *
116
+ * Several other query types are available. Peek into the source for details.
117
+ *
118
+ * A second option is the model. If you pass a model the returned data will be instances of that model.
119
+ *
120
+ * // Callee is the model definition. This allows you to easily map a query to a predefined model
121
+ * const projects = await sequelize.query('SELECT * FROM projects', {
122
+ * model: Projects,
123
+ * mapToModel: true // pass true here if you have any mapped fields
124
+ * });
125
+ * // Each element of `projects` is now an instance of Project
126
+ *
127
+ * See more options in the query API reference. Some examples:
128
+ * ``
129
+ * const { QueryTypes } = require('@sequelize/core');
130
+ * await sequelize.query('SELECT 1', {
131
+ * // A function (or false) for logging your queries
132
+ * // Will get called for every SQL query that gets sent
133
+ * // to the server.
134
+ * logging: console.log,
135
+ *
136
+ * // If plain is true, then sequelize will only return the first
137
+ * // record of the result set. In case of false it will return all records.
138
+ * plain: false,
139
+ *
140
+ * // Set this to true if you don't have a model definition for your query.
141
+ * raw: false,
142
+ *
143
+ * // The type of query you are executing. The query type affects how results are formatted before they are passed back.
144
+ * type: QueryTypes.SELECT
145
+ * });
146
+ *``
147
+ * // Note the second argument being null!
148
+ * // Even if we declared a callee here, the raw: true would
149
+ * // supersede and return a raw object.
150
+ * console.log(await sequelize.query('SELECT * FROM projects', { raw: true }));
151
+ *
152
+ * ##"Dotted" attributes and the nest option
153
+ *
154
+ * If an attribute name of the table contains dots, the resulting objects can become nested objects by setting the nest: true option. This is achieved with dottie.js under the hood. See below:
155
+ *
156
+ * Without nest: true:
157
+ * ``
158
+ * const { QueryTypes } = require('@sequelize/core');
159
+ * const records = await sequelize.query('select 1 as `foo.bar.baz`', {
160
+ * type: QueryTypes.SELECT
161
+ * });
162
+ * console.log(JSON.stringify(records[0], null, 2));
163
+ *
164
+ * {
165
+ * "foo.bar.baz": 1
166
+ * }
167
+ *
168
+ * With nest: true:
169
+ *
170
+ * const { QueryTypes } = require('@sequelize/core');
171
+ * const records = await sequelize.query('select 1 as `foo.bar.baz`', {
172
+ * nest: true,
173
+ * type: QueryTypes.SELECT
174
+ * });
175
+ * console.log(JSON.stringify(records[0], null, 2));
176
+ *
177
+ * {
178
+ * "foo": {
179
+ * "bar": {
180
+ * "baz": 1
181
+ * }
182
+ * }
183
+ * }
184
+ * ``
185
+ * ##Replacements
186
+ *
187
+ * Replacements in a query can be done in two different ways, either using named parameters (starting with :), or unnamed, represented by a ?. Replacements are passed in the options object.
188
+ *
189
+ * If an array is passed, ? will be replaced in the order that they appear in the array
190
+ * If an object is passed, :key will be replaced with the keys from that object. If the object contains keys not found in the query or vice versa, an exception will be thrown.
191
+ * ``
192
+ * const { QueryTypes } = require('@sequelize/core');
193
+ *
194
+ * await sequelize.query(
195
+ * 'SELECT * FROM projects WHERE status = ?',
196
+ * {
197
+ * replacements: ['active'],
198
+ * type: QueryTypes.SELECT
199
+ * }
200
+ * );
201
+ *
202
+ * await sequelize.query(
203
+ * 'SELECT * FROM projects WHERE status = :status',
204
+ * {
205
+ * replacements: { status: 'active' },
206
+ * type: QueryTypes.SELECT
207
+ * }
208
+ * );
209
+ * ``
210
+ * Array replacements will automatically be handled, the following query searches for projects where the status matches an array of values.
211
+ * ``
212
+ * const { QueryTypes } = require('@sequelize/core');
213
+ *
214
+ * await sequelize.query(
215
+ * 'SELECT * FROM projects WHERE status IN(:status)',
216
+ * {
217
+ * replacements: { status: ['active', 'inactive'] },
218
+ * type: QueryTypes.SELECT
219
+ * }
220
+ * );
221
+ * ``
222
+ * To use the wildcard operator %, append it to your replacement. The following query matches users with names that start with 'ben'.
223
+ * ``
224
+ * const { QueryTypes } = require('@sequelize/core');
225
+ *
226
+ * await sequelize.query(
227
+ * 'SELECT * FROM users WHERE name LIKE :search_name',
228
+ * {
229
+ * replacements: { search_name: 'ben%' },
230
+ * type: QueryTypes.SELECT
231
+ * }
232
+ * ); ``
233
+ *
234
+ * ##Bind Parameter
235
+ *
236
+ * Bind parameters are like replacements. Except replacements are escaped and inserted into the query by sequelize before the query is sent to the database, while bind parameters are sent to the database outside the SQL query text. A query can have either bind parameters or replacements. Bind parameters are referred to by either $1, $2, ... (numeric) or $key (alpha-numeric). This is independent of the dialect.
237
+ *
238
+ * If an array is passed, $1 is bound to the 1st element in the array (bind[0])
239
+ * If an object is passed, $key is bound to object['key']. Each key must begin with a non-numeric char. $1 is not a valid key, even if object['1'] exists.
240
+ * In either case $$ can be used to escape a literal $ sign.
241
+ *
242
+ * The array or object must contain all bound values or Sequelize will throw an exception. This applies even to cases in which the database may ignore the bound parameter.
243
+ *
244
+ * The database may add further restrictions to this. Bind parameters cannot be SQL keywords, nor table or column names. They are also ignored in quoted text or data. In PostgreSQL it may also be needed to typecast them, if the type cannot be inferred from the context $1::varchar.
245
+ *``
246
+ * const { QueryTypes } = require('@sequelize/core');
247
+ *
248
+ * await sequelize.query(
249
+ * 'SELECT *, "text with literal $$1 and literal $$status" as t FROM projects WHERE status = $1',
250
+ * {
251
+ * bind: ['active'],
252
+ * type: QueryTypes.SELECT
253
+ * }
254
+ * ); ``
255
+ *
256
+ * `` await sequelize.query(
257
+ * 'SELECT *, "text with literal $$1 and literal $$status" as t FROM projects WHERE status = $status',
258
+ * {
259
+ * bind: { status: 'active' },
260
+ * type: QueryTypes.SELECT
261
+ * }
262
+ * );``
263
+ * @param query
264
+ */
265
+ rawQuery(query: string, options?: any): Promise<any>;
266
+ /**
267
+ *
268
+ * @param args
269
+ */
270
+ findOne(...args: any[]): any;
271
+ /**
272
+ *
273
+ * @param args
274
+ */
275
+ findAll(...args: any[]): any;
276
+ /**
277
+ * return {count : number , rows: any}
278
+ * @param args
279
+ */
280
+ findAndCountAll(...args: any[]): any;
281
+ validate(): void;
282
+ /**
283
+ *
284
+ * @param data
285
+ * @param formName
286
+ */
287
+ load(data: any, formName?: any): boolean;
288
+ bulkLoad(data: any, formName?: any): boolean;
289
+ setAttribute(values: any, safeOnly?: boolean): void;
290
+ attributes(): {};
291
+ /**
292
+ * relation return array
293
+ * [
294
+ *
295
+ * ]
296
+ */
297
+ relations(): Relation[];
298
+ }
299
+ //# sourceMappingURL=Model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Model.d.ts","sourceRoot":"","sources":["../../src/base/Model.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAqE,KAAK,IAAI,MAAM,EAAoE,MAAM,WAAW,CAAC;AAGjL,OAAO,EAAC,SAAS,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAGxC,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,eAAe,GAAG,WAAW,CAAC;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,qBAAa,KAAM,SAAQ,SAAS;IAChC,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,WAAW,CAAW;IAC9B,OAAO,CAAC,OAAO,CAAU;gBAGb,SAAS,CAAC,EAAE,WAAW;IA6BnC;;;;;OAKG;IACI,KAAK;IAIL,eAAe;IAItB,IAAI,SAAS,IAAI,GAAG,CAEnB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAEvB;IAEM,QAAQ;IAKf;;OAEG;IACH,IAAI,MAAM,IAAI,GAAG,CAEhB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,EAEpB;IAEM,IAAI;IAqCJ,KAAK;IAIL,SAAS;IAIT,QAAQ;IAIR,KAAK;IAKL,QAAQ,CAAC,KAAK,EAAE,GAAG;IAInB,KAAK;IAKC,IAAI,CAAC,MAAM,KAAK,EAAE,OAAO,KAAK;IAkC9B,UAAU,CAAC,MAAM,KAAK,EAAE,OAAO,KAAK;IAkC1C,MAAM,CAAC,MAAM,KAAK,EAAE,OAAO,KAAK;IAKhC,MAAM,CAAC,MAAM,KAAK,EAAE,OAAO,KAAK;IAKvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkKG;IACU,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,GAA2C;IAKzF;;;OAGG;IACI,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAI7B;;;OAGG;IACI,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAI7B;;;OAGG;IACI,eAAe,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAK9B,QAAQ;IAIf;;;;OAIG;IACI,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAE,GAAU;IAYpC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAE,GAAU;IAYxC,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,UAAO;IAazC,UAAU;IAIjB;;;;;OAKG;IACI,SAAS,IAAI,QAAQ,EAAE;CAKjC"}
package/base/Model.js CHANGED
@@ -505,4 +505,3 @@ class Model extends Component_1.Component {
505
505
  }
506
506
  }
507
507
  exports.Model = Model;
508
- //# sourceMappingURL=Model.js.map
@@ -0,0 +1,2 @@
1
+ export declare const ModelManager: any;
2
+ //# sourceMappingURL=ModelManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelManager.d.ts","sourceRoot":"","sources":["../../src/base/ModelManager.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY,EAAE,GAI1B,CAAA"}
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModelManager = void 0;
4
+ /*
5
+ *
6
+ * Copyright (c) 2021.. Chy Bilgisayar Bilisim
7
+ * Author: Cihan Ozturk
8
+ * E-mail: cihan@chy.com.tr
9
+ * Github:https://github.com/cihan53/
10
+ *
11
+ */
12
+ // interface ObjectConstructor {
13
+ // _register(o: Model): void;
14
+ // }
4
15
  exports.ModelManager = {
5
16
  _register(map) {
6
17
  Object.assign(this, map);
7
18
  }
8
19
  };
9
- //# sourceMappingURL=ModelManager.js.map
@@ -0,0 +1,6 @@
1
+ import { BaseError } from "./BaseError";
2
+ export declare class NotFoundHttpException extends BaseError {
3
+ message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=NotFoundHttpException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotFoundHttpException.d.ts","sourceRoot":"","sources":["../../src/base/NotFoundHttpException.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,qBAAsB,SAAQ,SAAS;IAC3B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAGvC"}
@@ -15,4 +15,3 @@ class NotFoundHttpException extends BaseError_1.BaseError {
15
15
  }
16
16
  }
17
17
  exports.NotFoundHttpException = NotFoundHttpException;
18
- //# sourceMappingURL=NotFoundHttpException.js.map
@@ -0,0 +1,9 @@
1
+ import { Component } from "./Component";
2
+ export declare class RestClient extends Component {
3
+ post(url: string, args: any[], headers?: any): any;
4
+ get(url: string, args: any[], headers?: any): any;
5
+ Rest(params: any): any;
6
+ }
7
+ declare const _default: RestClient;
8
+ export default _default;
9
+ //# sourceMappingURL=RestClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RestClient.d.ts","sourceRoot":"","sources":["../../src/base/RestClient.ts"],"names":[],"mappings":"AAUA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAItC,qBAAa,UAAW,SAAQ,SAAS;IAC9B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,OAAO,GAAC,GAAM;IAI5C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAC,OAAO,GAAC,GAAM;IAI3C,IAAI,CAAC,MAAM,EAAE,GAAG;CAG1B;;AACD,wBAAgC"}
@@ -24,4 +24,3 @@ class RestClient extends Component_1.Component {
24
24
  }
25
25
  exports.RestClient = RestClient;
26
26
  exports.default = new RestClient();
27
- //# sourceMappingURL=RestClient.js.map
@@ -0,0 +1,6 @@
1
+ import { BaseError } from "./BaseError";
2
+ export declare class UnauthorizedHttpException extends BaseError {
3
+ message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=UnauthorizedHttpException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnauthorizedHttpException.d.ts","sourceRoot":"","sources":["../../src/base/UnauthorizedHttpException.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,yBAA0B,SAAQ,SAAS;IAC/B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAIvC"}
@@ -15,4 +15,3 @@ class UnauthorizedHttpException extends BaseError_1.BaseError {
15
15
  }
16
16
  }
17
17
  exports.UnauthorizedHttpException = UnauthorizedHttpException;
18
- //# sourceMappingURL=UnauthorizedHttpException.js.map
@@ -0,0 +1,6 @@
1
+ import { BaseError } from "./BaseError";
2
+ export declare class ValidationHttpException extends BaseError {
3
+ message: string;
4
+ constructor(message: string);
5
+ }
6
+ //# sourceMappingURL=ValidationHttpException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationHttpException.d.ts","sourceRoot":"","sources":["../../src/base/ValidationHttpException.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,uBAAwB,SAAQ,SAAS;IAC7B,OAAO,EAAE,MAAM;gBAAf,OAAO,EAAE,MAAM;CAGvC"}
@@ -15,4 +15,3 @@ class ValidationHttpException extends BaseError_1.BaseError {
15
15
  }
16
16
  }
17
17
  exports.ValidationHttpException = ValidationHttpException;
18
- //# sourceMappingURL=ValidationHttpException.js.map
@@ -0,0 +1,7 @@
1
+ import { BaseError } from "../BaseError";
2
+ export declare class Exception extends BaseError {
3
+ errorInfo: never[];
4
+ protected code: string;
5
+ constructor(message: string, errorInfo?: any, code?: string, previous?: null);
6
+ }
7
+ //# sourceMappingURL=Exception.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exception.d.ts","sourceRoot":"","sources":["../../../src/base/db/Exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAEvC,qBAAa,SAAU,SAAQ,SAAS;IAC7B,SAAS,UAAM;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,SAAS,GAAC,GAAQ,EAAE,IAAI,SAAK,EAAE,QAAQ,OAAO;CAO9E"}
@@ -13,4 +13,3 @@ class Exception extends BaseError_1.BaseError {
13
13
  }
14
14
  }
15
15
  exports.Exception = Exception;
16
- //# sourceMappingURL=Exception.js.map
@@ -0,0 +1,18 @@
1
+ export { BaseError } from "./BaseError";
2
+ export { ActionFilter } from "./ActionFilter";
3
+ export { Behavior } from "./Behavior";
4
+ export { Component } from "./Component";
5
+ export { Configurable } from "./Configurable";
6
+ export { CWebController } from "./CWebController";
7
+ export { DbConnection } from "./DbConnection";
8
+ export { ForbiddenHttpException } from "./ForbiddenHttpException";
9
+ export { InvalidConfigException } from "./InvalidConfigException";
10
+ export { InvalidArgumentException } from "./InvalidArgumentException";
11
+ export { NotFoundHttpException } from "./NotFoundHttpException";
12
+ export { UnauthorizedHttpException } from "./UnauthorizedHttpException";
13
+ export { DataErrorDbException } from "./DataErrorDbException";
14
+ export { ValidationHttpException } from "./ValidationHttpException";
15
+ export { Model, Relation, DataTypes, NOW } from "./Model";
16
+ export { RestClient } from "./RestClient";
17
+ export { ModelManager } from "./ModelManager";
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AACnC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAC,yBAAyB,EAAC,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,SAAS,CAAA;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA"}
package/base/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModelManager = exports.RestClient = exports.NOW = exports.DataTypes = exports.Model = exports.ValidationHttpException = exports.DataErrorDbException = exports.UnauthorizedHttpException = exports.NotFoundHttpException = exports.InvalidArgumentException = exports.InvalidConfigException = exports.ForbiddenHttpException = exports.DbConnection = exports.CWebController = exports.Component = exports.Behavior = exports.BaseError = exports.BaseObject = exports.ActionFilter = void 0;
4
- var ActionFilter_1 = require("./ActionFilter");
5
- Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return ActionFilter_1.ActionFilter; } });
6
- var BaseObject_1 = require("./BaseObject");
7
- Object.defineProperty(exports, "BaseObject", { enumerable: true, get: function () { return BaseObject_1.BaseObject; } });
3
+ exports.ModelManager = exports.RestClient = exports.NOW = exports.DataTypes = exports.Model = exports.ValidationHttpException = exports.DataErrorDbException = exports.UnauthorizedHttpException = exports.NotFoundHttpException = exports.InvalidArgumentException = exports.InvalidConfigException = exports.ForbiddenHttpException = exports.DbConnection = exports.CWebController = exports.Component = exports.Behavior = exports.ActionFilter = exports.BaseError = void 0;
8
4
  var BaseError_1 = require("./BaseError");
9
5
  Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return BaseError_1.BaseError; } });
6
+ var ActionFilter_1 = require("./ActionFilter");
7
+ Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return ActionFilter_1.ActionFilter; } });
10
8
  var Behavior_1 = require("./Behavior");
11
9
  Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return Behavior_1.Behavior; } });
12
10
  var Component_1 = require("./Component");
@@ -37,4 +35,3 @@ var RestClient_1 = require("./RestClient");
37
35
  Object.defineProperty(exports, "RestClient", { enumerable: true, get: function () { return RestClient_1.RestClient; } });
38
36
  var ModelManager_1 = require("./ModelManager");
39
37
  Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return ModelManager_1.ModelManager; } });
40
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import "reflect-metadata";
2
+ import { RequestHandler } from "express";
3
+ export declare function Middleware(middlewares: RequestHandler[]): Function;
4
+ //# sourceMappingURL=Middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Middleware.d.ts","sourceRoot":"","sources":["../../src/decorator/Middleware.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,UAAU,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,QAAQ,CAIlE"}
@@ -9,4 +9,3 @@ function Middleware(middlewares) {
9
9
  };
10
10
  }
11
11
  exports.Middleware = Middleware;
12
- //# sourceMappingURL=Middleware.js.map
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export declare const controller: (prefix?: string) => ClassDecorator;
3
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/decorator/controller.ts"],"names":[],"mappings":"AAQA,OAAQ,kBAAkB,CAAC;AAC3B,eAAO,MAAM,UAAU,YAAY,MAAM,KAAQ,cAYhD,CAAC"}
@@ -22,4 +22,3 @@ const controller = (prefix = '') => {
22
22
  };
23
23
  };
24
24
  exports.controller = controller;
25
- //# sourceMappingURL=controller.js.map
@@ -0,0 +1,6 @@
1
+ export declare enum ControllerDecoratorParams {
2
+ Path = "path",
3
+ Method = "method",
4
+ Middleware = "middleware"
5
+ }
6
+ //# sourceMappingURL=ControllerDecoratorParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ControllerDecoratorParams.d.ts","sourceRoot":"","sources":["../../../src/decorator/enums/ControllerDecoratorParams.ts"],"names":[],"mappings":"AAAA,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,UAAU,eAAe;CAC5B"}
@@ -7,4 +7,3 @@ var ControllerDecoratorParams;
7
7
  ControllerDecoratorParams["Method"] = "method";
8
8
  ControllerDecoratorParams["Middleware"] = "middleware";
9
9
  })(ControllerDecoratorParams = exports.ControllerDecoratorParams || (exports.ControllerDecoratorParams = {}));
10
- //# sourceMappingURL=ControllerDecoratorParams.js.map
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export declare const get: (path: string) => MethodDecorator;
3
+ //# sourceMappingURL=get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/decorator/get.ts"],"names":[],"mappings":"AAOA,OAAO,kBAAkB,CAAC;AAG1B,eAAO,MAAM,GAAG,SAAU,MAAM,KAAG,eA0BlC,CAAC"}
package/decorator/get.js CHANGED
@@ -34,4 +34,3 @@ const get = (path) => {
34
34
  };
35
35
  };
36
36
  exports.get = get;
37
- //# sourceMappingURL=get.js.map
@@ -0,0 +1,4 @@
1
+ export { controller } from "./controller";
2
+ export { get } from "./get";
3
+ export { post } from "./post";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA"}
@@ -7,4 +7,3 @@ var get_1 = require("./get");
7
7
  Object.defineProperty(exports, "get", { enumerable: true, get: function () { return get_1.get; } });
8
8
  var post_1 = require("./post");
9
9
  Object.defineProperty(exports, "post", { enumerable: true, get: function () { return post_1.post; } });
10
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export declare const post: (path: string) => MethodDecorator;
3
+ //# sourceMappingURL=post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../src/decorator/post.ts"],"names":[],"mappings":"AAOA,OAAQ,kBAAkB,CAAC;AAG3B,eAAO,MAAM,IAAI,SAAU,MAAM,KAAG,eAyBnC,CAAC"}
package/decorator/post.js CHANGED
@@ -34,4 +34,3 @@ const post = (path) => {
34
34
  };
35
35
  };
36
36
  exports.post = post;
37
- //# sourceMappingURL=post.js.map
@@ -0,0 +1,13 @@
1
+ /// <reference types="express" />
2
+ import { Request, Response } from "../index";
3
+ import { ActionFilter } from "../base/ActionFilter";
4
+ import { WebUser } from "../web/WebUser";
5
+ export declare class AccessControl extends ActionFilter {
6
+ user: any;
7
+ rules: any;
8
+ denyCallback: any;
9
+ init(): void;
10
+ beforeAction(action: any, request: Request, res: Response): Promise<boolean>;
11
+ denyAccess(user: WebUser): void;
12
+ }
13
+ //# sourceMappingURL=AccessControl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessControl.d.ts","sourceRoot":"","sources":["../../src/filters/AccessControl.ts"],"names":[],"mappings":";AAMA,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAU,MAAM,UAAU,CAAC;AAEnD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAIvC,qBAAa,aAAc,SAAQ,YAAY;IAEpC,IAAI,EAAE,GAAG,CAAQ;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,GAAG,CAAQ;IAEzB,IAAI;IAeE,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAC,GAAG,EAAC,QAAQ;IAgC7D,UAAU,CAAC,IAAI,EAAE,OAAO;CAMlC"}
@@ -19,7 +19,7 @@ exports.AccessControl = void 0;
19
19
  * E-mail: cihan@chy.com.tr
20
20
  * Github:https://github.com/cihan53/
21
21
  */
22
- const BaseChyz_1 = __importDefault(require("../BaseChyz"));
22
+ const index_1 = require("../index");
23
23
  const ForbiddenHttpException_1 = require("../base/ForbiddenHttpException");
24
24
  const ActionFilter_1 = require("../base/ActionFilter");
25
25
  const AccessRule_1 = require("./AccessRule");
@@ -35,7 +35,7 @@ class AccessControl extends ActionFilter_1.ActionFilter {
35
35
  var _a;
36
36
  super.init();
37
37
  if (this.user == undefined) {
38
- this.user = (_a = Utils_1.default.cloneDeep(BaseChyz_1.default.getComponent("user"))) !== null && _a !== void 0 ? _a : new WebUser_1.WebUser();
38
+ this.user = (_a = Utils_1.default.cloneDeep(index_1.BaseChyz.getComponent("user"))) !== null && _a !== void 0 ? _a : new WebUser_1.WebUser();
39
39
  }
40
40
  this.rules.forEach((rule, index) => {
41
41
  if (rule === Object(rule)) {
@@ -43,7 +43,7 @@ class AccessControl extends ActionFilter_1.ActionFilter {
43
43
  }
44
44
  });
45
45
  }
46
- beforeAction(action, request) {
46
+ beforeAction(action, request, res) {
47
47
  var _a, _b;
48
48
  return __awaiter(this, void 0, void 0, function* () {
49
49
  let allow;
@@ -80,8 +80,7 @@ class AccessControl extends ActionFilter_1.ActionFilter {
80
80
  user.loginRequired();
81
81
  }
82
82
  else
83
- throw new ForbiddenHttpException_1.ForbiddenHttpException(BaseChyz_1.default.t('You are not allowed to perform this action.'));
83
+ throw new ForbiddenHttpException_1.ForbiddenHttpException(index_1.BaseChyz.t('You are not allowed to perform this action.'));
84
84
  }
85
85
  }
86
86
  exports.AccessControl = AccessControl;
87
- //# sourceMappingURL=AccessControl.js.map