chyz 2.0.1-rc.36 → 2.0.1-rc.37
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/dist/BaseChyz.d.ts +74 -0
- package/dist/BaseChyz.d.ts.map +1 -0
- package/dist/BaseChyz.js +586 -0
- package/dist/base/ActionFilter.d.ts +32 -0
- package/dist/base/ActionFilter.d.ts.map +1 -0
- package/dist/base/ActionFilter.js +90 -0
- package/dist/base/BadRequestHttpException.d.ts +6 -0
- package/dist/base/BadRequestHttpException.d.ts.map +1 -0
- package/dist/base/BadRequestHttpException.js +17 -0
- package/dist/base/BaseError.d.ts +44 -0
- package/dist/base/BaseError.d.ts.map +1 -0
- package/{base/BaseError.ts → dist/base/BaseError.js} +18 -26
- package/dist/base/Behavior.d.ts +4 -0
- package/dist/base/Behavior.d.ts.map +1 -0
- package/dist/base/Behavior.js +7 -0
- package/dist/base/CBaseObject.d.ts +5 -0
- package/dist/base/CBaseObject.d.ts.map +1 -0
- package/dist/base/CBaseObject.js +16 -0
- package/dist/base/CEvents.d.ts +13 -0
- package/dist/base/CEvents.d.ts.map +1 -0
- package/dist/base/CEvents.js +24 -0
- package/dist/base/CRequest.d.ts +2 -0
- package/dist/base/CRequest.d.ts.map +1 -0
- package/{base/CRequest.ts → dist/base/CRequest.js} +2 -6
- package/dist/base/CWebController.d.ts +44 -0
- package/dist/base/CWebController.d.ts.map +1 -0
- package/dist/base/CWebController.js +81 -0
- package/dist/base/Component.d.ts +21 -0
- package/dist/base/Component.d.ts.map +1 -0
- package/dist/base/Component.js +57 -0
- package/dist/base/Configurable.d.ts +3 -0
- package/dist/base/Configurable.d.ts.map +1 -0
- package/{requiments/Glob.ts → dist/base/Configurable.js} +2 -3
- package/dist/base/DataErrorDbException.d.ts +6 -0
- package/dist/base/DataErrorDbException.d.ts.map +1 -0
- package/dist/base/DataErrorDbException.js +17 -0
- package/dist/base/DbConnection.d.ts +13 -0
- package/dist/base/DbConnection.d.ts.map +1 -0
- package/dist/base/DbConnection.js +53 -0
- package/dist/base/ForbiddenHttpException.d.ts +5 -0
- package/dist/base/ForbiddenHttpException.d.ts.map +1 -0
- package/dist/base/ForbiddenHttpException.js +16 -0
- package/dist/base/InvalidArgumentException.d.ts +6 -0
- package/dist/base/InvalidArgumentException.d.ts.map +1 -0
- package/dist/base/InvalidArgumentException.js +17 -0
- package/dist/base/InvalidConfigException.d.ts +6 -0
- package/dist/base/InvalidConfigException.d.ts.map +1 -0
- package/dist/base/InvalidConfigException.js +17 -0
- package/dist/base/Logs.d.ts +22 -0
- package/dist/base/Logs.d.ts.map +1 -0
- package/{base/Logs.ts → dist/base/Logs.js} +24 -41
- package/dist/base/Model.d.ts +302 -0
- package/dist/base/Model.d.ts.map +1 -0
- package/{base/Model.ts → dist/base/Model.js} +158 -225
- package/dist/base/ModelManager.d.ts +2 -0
- package/dist/base/ModelManager.d.ts.map +1 -0
- package/{base/ModelManager.ts → dist/base/ModelManager.js} +7 -7
- package/dist/base/NotFoundHttpException.d.ts +6 -0
- package/dist/base/NotFoundHttpException.d.ts.map +1 -0
- package/dist/base/NotFoundHttpException.js +17 -0
- package/dist/base/RestClient.d.ts +7 -0
- package/dist/base/RestClient.d.ts.map +1 -0
- package/dist/base/RestClient.js +25 -0
- package/dist/base/UnauthorizedHttpException.d.ts +6 -0
- package/dist/base/UnauthorizedHttpException.d.ts.map +1 -0
- package/dist/base/UnauthorizedHttpException.js +17 -0
- package/dist/base/ValidationHttpException.d.ts +6 -0
- package/dist/base/ValidationHttpException.d.ts.map +1 -0
- package/dist/base/ValidationHttpException.js +17 -0
- package/dist/base/db/Exception.d.ts +7 -0
- package/dist/base/db/Exception.d.ts.map +1 -0
- package/dist/base/db/Exception.js +15 -0
- package/dist/base/index.d.ts +20 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +41 -0
- package/dist/decorator/Middleware.d.ts +4 -0
- package/dist/decorator/Middleware.d.ts.map +1 -0
- package/dist/decorator/Middleware.js +10 -0
- package/dist/decorator/controller.d.ts +3 -0
- package/dist/decorator/controller.d.ts.map +1 -0
- package/{decorator/controller.ts → dist/decorator/controller.js} +9 -7
- package/dist/decorator/delete.d.ts +3 -0
- package/dist/decorator/delete.d.ts.map +1 -0
- package/{decorator/delete.ts → dist/decorator/delete.js} +9 -9
- package/dist/decorator/enums/ControllerDecoratorParams.d.ts +6 -0
- package/dist/decorator/enums/ControllerDecoratorParams.d.ts.map +1 -0
- package/dist/decorator/enums/ControllerDecoratorParams.js +9 -0
- package/dist/decorator/get.d.ts +3 -0
- package/dist/decorator/get.d.ts.map +1 -0
- package/{decorator/get.ts → dist/decorator/get.js} +10 -11
- package/dist/decorator/index.d.ts +6 -0
- package/dist/decorator/index.d.ts.map +1 -0
- package/dist/decorator/index.js +13 -0
- package/dist/decorator/post.d.ts +3 -0
- package/dist/decorator/post.d.ts.map +1 -0
- package/{decorator/post.ts → dist/decorator/post.js} +10 -10
- package/dist/decorator/put.d.ts +3 -0
- package/dist/decorator/put.d.ts.map +1 -0
- package/{decorator/put.ts → dist/decorator/put.js} +9 -9
- package/dist/filters/AccessControl.d.ts +12 -0
- package/dist/filters/AccessControl.d.ts.map +1 -0
- package/dist/filters/AccessControl.js +83 -0
- package/dist/filters/AccessRule.d.ts +83 -0
- package/dist/filters/AccessRule.d.ts.map +1 -0
- package/dist/filters/AccessRule.js +136 -0
- package/{filters/auth/AuthInterface.ts → dist/filters/auth/AuthInterface.d.ts} +7 -15
- package/dist/filters/auth/AuthInterface.d.ts.map +1 -0
- package/dist/filters/auth/AuthInterface.js +2 -0
- package/dist/filters/auth/AuthMethod.d.ts +38 -0
- package/dist/filters/auth/AuthMethod.d.ts.map +1 -0
- package/dist/filters/auth/AuthMethod.js +82 -0
- package/dist/filters/auth/HttpBasicAuth.d.ts +24 -0
- package/dist/filters/auth/HttpBasicAuth.d.ts.map +1 -0
- package/dist/filters/auth/HttpBasicAuth.js +79 -0
- package/dist/filters/auth/HttpBearerAuth.d.ts +18 -0
- package/dist/filters/auth/HttpBearerAuth.d.ts.map +1 -0
- package/dist/filters/auth/HttpBearerAuth.js +33 -0
- package/dist/filters/auth/HttpHeaderAuth.d.ts +19 -0
- package/dist/filters/auth/HttpHeaderAuth.d.ts.map +1 -0
- package/dist/filters/auth/HttpHeaderAuth.js +64 -0
- package/dist/filters/auth/JwtHttpBearerAuth.d.ts +21 -0
- package/dist/filters/auth/JwtHttpBearerAuth.d.ts.map +1 -0
- package/dist/filters/auth/JwtHttpBearerAuth.js +88 -0
- package/dist/filters/auth/KeyCloakHttpBearerAuth.d.ts +23 -0
- package/dist/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +1 -0
- package/dist/filters/auth/KeyCloakHttpBearerAuth.js +116 -0
- package/dist/filters/auth/index.d.ts +5 -0
- package/dist/filters/auth/index.d.ts.map +1 -0
- package/dist/filters/auth/index.js +11 -0
- package/dist/filters/index.d.ts +3 -0
- package/dist/filters/index.d.ts.map +1 -0
- package/dist/filters/index.js +7 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/log/log/config/log4js.json +55 -0
- package/dist/model/RouteDefinition.d.ts +7 -0
- package/dist/model/RouteDefinition.d.ts.map +1 -0
- package/{base/Configurable.ts → dist/model/RouteDefinition.js} +2 -4
- package/dist/package.json +63 -0
- package/dist/rbac/AuthAssignment.d.ts +19 -0
- package/dist/rbac/AuthAssignment.d.ts.map +1 -0
- package/dist/rbac/AuthAssignment.js +44 -0
- package/dist/rbac/AuthItem.d.ts +27 -0
- package/dist/rbac/AuthItem.d.ts.map +1 -0
- package/{rbac/AuthItem.ts → dist/rbac/AuthItem.js} +16 -22
- package/dist/rbac/AuthItemChild.d.ts +19 -0
- package/dist/rbac/AuthItemChild.d.ts.map +1 -0
- package/{rbac/AuthItemChild.ts → dist/rbac/AuthItemChild.js} +14 -21
- package/dist/rbac/AuthManager.d.ts +112 -0
- package/dist/rbac/AuthManager.d.ts.map +1 -0
- package/dist/rbac/AuthManager.js +356 -0
- package/dist/rbac/index.d.ts +5 -0
- package/dist/rbac/index.d.ts.map +1 -0
- package/dist/rbac/index.js +28 -0
- package/dist/requiments/Glob.d.ts +3 -0
- package/dist/requiments/Glob.d.ts.map +1 -0
- package/dist/requiments/Glob.js +10 -0
- package/dist/requiments/ReflectUtil.d.ts +1 -0
- package/dist/requiments/ReflectUtil.d.ts.map +1 -0
- package/{requiments/ReflectUtil.ts → dist/requiments/ReflectUtil.js} +4 -6
- package/dist/requiments/Utils.d.ts +2 -0
- package/dist/requiments/Utils.d.ts.map +1 -0
- package/{requiments/Utils.ts → dist/requiments/Utils.js} +34 -40
- package/dist/validators/BooleanValidator.d.ts +1 -0
- package/dist/validators/BooleanValidator.d.ts.map +1 -0
- package/dist/validators/BooleanValidator.js +1 -0
- package/dist/validators/CompareValidator.d.ts +1 -0
- package/dist/validators/CompareValidator.d.ts.map +1 -0
- package/dist/validators/CompareValidator.js +1 -0
- package/dist/validators/DateValidator.d.ts +1 -0
- package/dist/validators/DateValidator.d.ts.map +1 -0
- package/dist/validators/DateValidator.js +1 -0
- package/dist/validators/EmailValidator.d.ts +1 -0
- package/dist/validators/EmailValidator.d.ts.map +1 -0
- package/dist/validators/EmailValidator.js +1 -0
- package/dist/validators/Validator.d.ts +18 -0
- package/dist/validators/Validator.d.ts.map +1 -0
- package/dist/validators/Validator.js +27 -0
- package/{web/IdentityInterface.ts → dist/web/IdentityInterface.d.ts} +2 -15
- package/dist/web/IdentityInterface.d.ts.map +1 -0
- package/dist/web/IdentityInterface.js +8 -0
- package/dist/web/WebUser.d.ts +72 -0
- package/dist/web/WebUser.d.ts.map +1 -0
- package/dist/web/WebUser.js +165 -0
- package/package.json +16 -56
- package/BaseChyz.ts +0 -623
- package/base/ActionFilter.ts +0 -88
- package/base/BadRequestHttpException.ts +0 -14
- package/base/Behavior.ts +0 -6
- package/base/CBaseObject.ts +0 -17
- package/base/CEvents.ts +0 -24
- package/base/CWebController.ts +0 -90
- package/base/Component.ts +0 -66
- package/base/DataErrorDbException.ts +0 -16
- package/base/DbConnection.ts +0 -55
- package/base/ForbiddenHttpException.ts +0 -15
- package/base/InvalidArgumentException.ts +0 -16
- package/base/InvalidConfigException.ts +0 -16
- package/base/NotFoundHttpException.ts +0 -14
- package/base/RestClient.ts +0 -26
- package/base/UnauthorizedHttpException.ts +0 -17
- package/base/ValidationHttpException.ts +0 -14
- package/base/db/Exception.ts +0 -14
- package/base/index.ts +0 -19
- package/decorator/Middleware.ts +0 -9
- package/decorator/enums/ControllerDecoratorParams.ts +0 -5
- package/decorator/index.ts +0 -5
- package/filters/AccessControl.ts +0 -74
- package/filters/AccessRule.ts +0 -182
- package/filters/auth/AuthMethod.ts +0 -100
- package/filters/auth/HttpBasicAuth.ts +0 -79
- package/filters/auth/HttpBearerAuth.ts +0 -34
- package/filters/auth/HttpHeaderAuth.ts +0 -61
- package/filters/auth/JwtHttpBearerAuth.ts +0 -83
- package/filters/auth/KeyCloakHttpBearerAuth.ts +0 -114
- package/filters/auth/index.ts +0 -4
- package/filters/index.ts +0 -2
- package/index.ts +0 -80
- package/model/RouteDefinition.ts +0 -18
- package/rbac/AuthAssignment.ts +0 -50
- package/rbac/AuthManager.ts +0 -399
- package/rbac/index.ts +0 -12
- package/validators/BooleanValidator.ts +0 -0
- package/validators/CompareValidator.ts +0 -0
- package/validators/DateValidator.ts +0 -0
- package/validators/EmailValidator.ts +0 -0
- package/validators/Validator.ts +0 -27
- package/web/WebUser.ts +0 -187
- /package/{README.md → dist/README.md} +0 -0
- /package/{log → dist/log}/config/log4js.json +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Request, Response } from "../index";
|
|
2
|
+
import { CBaseObject } from "./CBaseObject";
|
|
3
|
+
export declare class ActionFilter extends CBaseObject {
|
|
4
|
+
only: any;
|
|
5
|
+
/**
|
|
6
|
+
* @var array list of action IDs that this filter should not apply to.
|
|
7
|
+
* @see only
|
|
8
|
+
*/
|
|
9
|
+
except: never[];
|
|
10
|
+
init(): void;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param route
|
|
14
|
+
* @param req
|
|
15
|
+
* @param res
|
|
16
|
+
*/
|
|
17
|
+
beforeFilter(route: any, req: Request, res: Response): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* This method is invoked right before an action is to be executed (after all possible filters.)
|
|
20
|
+
* You may override this method to do last-minute preparation for the action.
|
|
21
|
+
* @param Action $action the action to be executed.
|
|
22
|
+
* @return bool whether the action should continue to be executed.
|
|
23
|
+
*/
|
|
24
|
+
beforeAction(route: any, req: Request, res: Response): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param action
|
|
28
|
+
* @protected
|
|
29
|
+
*/
|
|
30
|
+
protected isActive(action: any): boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ActionFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionFilter.d.ts","sourceRoot":"","sources":["../../src/base/ActionFilter.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AAGzC,qBAAa,YAAa,SAAQ,WAAW;IAElC,IAAI,EAAE,GAAG,CAAC;IAEjB;;;OAGG;IACI,MAAM,UAAM;IAGZ,IAAI;IAIX;;;;;OAKG;IACU,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAUjE;;;;;OAKG;IACU,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAIjE;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG;CA8BjC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ActionFilter = void 0;
|
|
16
|
+
const Utils_1 = require("../requiments/Utils");
|
|
17
|
+
const CBaseObject_1 = require("./CBaseObject");
|
|
18
|
+
const BaseChyz_1 = __importDefault(require("../BaseChyz"));
|
|
19
|
+
class ActionFilter extends CBaseObject_1.CBaseObject {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
/**
|
|
23
|
+
* @var array list of action IDs that this filter should not apply to.
|
|
24
|
+
* @see only
|
|
25
|
+
*/
|
|
26
|
+
this.except = [];
|
|
27
|
+
}
|
|
28
|
+
init() {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param route
|
|
33
|
+
* @param req
|
|
34
|
+
* @param res
|
|
35
|
+
*/
|
|
36
|
+
beforeFilter(route, req, res) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
BaseChyz_1.default.debug("Controller->ActionFilter->beforeFilter ", JSON.stringify(route));
|
|
39
|
+
if (!this.isActive(route)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
yield this.beforeAction(route, req, res);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* This method is invoked right before an action is to be executed (after all possible filters.)
|
|
47
|
+
* You may override this method to do last-minute preparation for the action.
|
|
48
|
+
* @param Action $action the action to be executed.
|
|
49
|
+
* @return bool whether the action should continue to be executed.
|
|
50
|
+
*/
|
|
51
|
+
beforeAction(route, req, res) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
return true;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @param action
|
|
59
|
+
* @protected
|
|
60
|
+
*/
|
|
61
|
+
isActive(action) {
|
|
62
|
+
let id = action.id;
|
|
63
|
+
let onlyMatch = false;
|
|
64
|
+
let exceptMatch = false;
|
|
65
|
+
if (Utils_1.Utils.isEmpty(this.only)) {
|
|
66
|
+
onlyMatch = true;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
onlyMatch = false;
|
|
70
|
+
for (const onlyKey of this.only) {
|
|
71
|
+
if (Utils_1.Utils.matchWildcard(action.id, onlyKey)) {
|
|
72
|
+
onlyMatch = true;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const exceptKey in this.except) {
|
|
78
|
+
let pattern = this.except[exceptKey];
|
|
79
|
+
let reg = new RegExp(`${pattern}$`, "g");
|
|
80
|
+
let match = id.match(reg);
|
|
81
|
+
// let match = id.startsWith(pattern);
|
|
82
|
+
BaseChyz_1.default.debug("Controller->ActionFilter->isActive ", "id:", id, "patern:", pattern, "match:", match, JSON.stringify(this.except));
|
|
83
|
+
if (match && match.length > 0) {
|
|
84
|
+
exceptMatch = true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return !exceptMatch && onlyMatch;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.ActionFilter = ActionFilter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BadRequestHttpException.d.ts","sourceRoot":"","sources":["../../src/base/BadRequestHttpException.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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
exports.BadRequestHttpException = void 0;
|
|
10
|
+
const BaseError_1 = require("./BaseError");
|
|
11
|
+
class BadRequestHttpException extends BaseError_1.BaseError {
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(message, 400);
|
|
14
|
+
this.message = message;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.BadRequestHttpException = BadRequestHttpException;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 10.4 Client Error 4xx ............................................65
|
|
3
|
+
* 10.4.1 400 Bad Request .........................................65
|
|
4
|
+
* 10.4.2 401 Unauthorized ........................................66
|
|
5
|
+
* 10.4.3 402 Payment Required ....................................66
|
|
6
|
+
* 10.4.4 403 Forbidden ...........................................66
|
|
7
|
+
* 10.4.5 404 Not Found ...........................................66
|
|
8
|
+
* 10.4.6 405 Method Not Allowed ..................................66
|
|
9
|
+
* 10.4.7 406 Not Acceptable ......................................67
|
|
10
|
+
* 10.4.8 407 Proxy Authentication Required .......................67
|
|
11
|
+
* 10.4.9 408 Request Timeout .....................................67
|
|
12
|
+
* 10.4.10 409 Conflict ............................................67
|
|
13
|
+
* 10.4.11 410 Gone ................................................68
|
|
14
|
+
* 10.4.12 411 Length Required .....................................68
|
|
15
|
+
* 10.4.13 412 Precondition Failed .................................68
|
|
16
|
+
* 10.4.14 413 Request Entity Too Large ............................69
|
|
17
|
+
* 10.4.15 414 Request-URI Too Long ................................69
|
|
18
|
+
* 10.4.16 415 Unsupported Media Type ..............................69
|
|
19
|
+
* 10.4.17 416 Requested Range Not Satisfiable .....................69
|
|
20
|
+
* 10.4.18 417 Expectation Failed ..................................70
|
|
21
|
+
*/
|
|
22
|
+
export declare class BaseError extends Error {
|
|
23
|
+
statusCode: number;
|
|
24
|
+
orginal: any;
|
|
25
|
+
private readonly success;
|
|
26
|
+
constructor(message: any, statusCode?: number);
|
|
27
|
+
toString(): string;
|
|
28
|
+
toJSON(): {
|
|
29
|
+
success: boolean;
|
|
30
|
+
code: number;
|
|
31
|
+
name: string;
|
|
32
|
+
message: string;
|
|
33
|
+
stack: string | undefined;
|
|
34
|
+
orginal: any;
|
|
35
|
+
} | {
|
|
36
|
+
success: boolean;
|
|
37
|
+
code: number;
|
|
38
|
+
name: string;
|
|
39
|
+
message: string;
|
|
40
|
+
stack?: undefined;
|
|
41
|
+
orginal?: undefined;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=BaseError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseError.d.ts","sourceRoot":"","sources":["../../src/base/BaseError.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,OAAO,EAAE,GAAG,EAAE,UAAU,SAAM;IAW1C,QAAQ;IAIR,MAAM;;;;;;;;;;;;;;;CAcT"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
3
4
|
* Author: Cihan Ozturk
|
|
4
5
|
* E-mail: cihan@chy.com.tr
|
|
5
6
|
* Github:https://github.com/cihan53/
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BaseError = void 0;
|
|
10
|
+
const Utils_1 = require("../requiments/Utils");
|
|
10
11
|
/**
|
|
11
12
|
* 10.4 Client Error 4xx ............................................65
|
|
12
13
|
* 10.4.1 400 Bad Request .........................................65
|
|
@@ -28,39 +29,30 @@ import {Utils} from "../requiments/Utils";
|
|
|
28
29
|
* 10.4.17 416 Requested Range Not Satisfiable .....................69
|
|
29
30
|
* 10.4.18 417 Expectation Failed ..................................70
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
-
statusCode
|
|
33
|
-
orginal: any;
|
|
34
|
-
private readonly success: boolean;
|
|
35
|
-
|
|
36
|
-
constructor(message: any, statusCode = 500) {
|
|
32
|
+
class BaseError extends Error {
|
|
33
|
+
constructor(message, statusCode = 500) {
|
|
37
34
|
super(message);
|
|
38
|
-
|
|
39
35
|
this.success = false;
|
|
40
|
-
this.message = Utils.isString(message) ? message : JSON.stringify(message);
|
|
41
|
-
this.name = this.constructor.name // good practice
|
|
42
|
-
this.statusCode = statusCode // error code for responding to client
|
|
36
|
+
this.message = Utils_1.Utils.isString(message) ? message : JSON.stringify(message);
|
|
37
|
+
this.name = this.constructor.name; // good practice
|
|
38
|
+
this.statusCode = statusCode; // error code for responding to client
|
|
43
39
|
//Error.captureStackTrace(this)
|
|
44
|
-
this.orginal = Utils.isString(message) ? message : message
|
|
40
|
+
this.orginal = Utils_1.Utils.isString(message) ? message : message;
|
|
45
41
|
}
|
|
46
|
-
|
|
47
42
|
toString() {
|
|
48
|
-
return `${this.name}[${this.statusCode}] ${this.message}
|
|
43
|
+
return `${this.name}[${this.statusCode}] ${this.message}`;
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
toJSON() {
|
|
52
46
|
if (process.env.NODE_ENV == "development" || process.env.NODE_ENV == "dev") {
|
|
53
|
-
return {success: this.success, code: this
|
|
47
|
+
return { success: this.success, code: this === null || this === void 0 ? void 0 : this.statusCode, name: this.name.toString(),
|
|
54
48
|
message: this.message.toString(),
|
|
55
49
|
stack: this.stack,
|
|
56
|
-
orginal: this.orginal
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return {success: this.success, code: this
|
|
60
|
-
message: this.message.toString()
|
|
61
|
-
}
|
|
50
|
+
orginal: this.orginal };
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return { success: this.success, code: this === null || this === void 0 ? void 0 : this.statusCode, name: this.name.toString(),
|
|
54
|
+
message: this.message.toString() };
|
|
62
55
|
}
|
|
63
|
-
|
|
64
56
|
}
|
|
65
57
|
}
|
|
66
|
-
|
|
58
|
+
exports.BaseError = BaseError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Behavior.d.ts","sourceRoot":"","sources":["../../src/base/Behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,qBAAa,QAAS,SAAQ,WAAW;CAGxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CBaseObject.d.ts","sourceRoot":"","sources":["../../src/base/CBaseObject.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAG5C,qBAAa,WAAY,YAAW,YAAY;IAErC,IAAI;CAGd"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
exports.CBaseObject = void 0;
|
|
10
|
+
const index_1 = require("../index");
|
|
11
|
+
class CBaseObject {
|
|
12
|
+
init() {
|
|
13
|
+
index_1.BaseChyz.debug("BaseObject init.....");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CBaseObject = CBaseObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum CEvents {
|
|
2
|
+
ON_INIT_BEFORE = "oninitbefore",
|
|
3
|
+
ON_INIT_AFTER = "oninitafter",
|
|
4
|
+
ON_MIDDLEWARE = "onmiddleware",
|
|
5
|
+
ON_BEFORE_START = "onbeforestart",
|
|
6
|
+
ON_AFTER_START = "onafterestart",
|
|
7
|
+
ON_START = "onstart",
|
|
8
|
+
ON_BEFORE_ACTION = "onbeferoaction",
|
|
9
|
+
ON_AFTER_ACTION = "onafteraction",
|
|
10
|
+
ON_DB_CONNECTION = "ondbconnection",
|
|
11
|
+
ON_DB_DISCONNECT = "ondbdisconnect"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=CEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CEvents.d.ts","sourceRoot":"","sources":["../../src/base/CEvents.ts"],"names":[],"mappings":"AAQA,oBAAY,OAAO;IACf,cAAc,iBAAe;IAC7B,aAAa,gBAAc;IAC3B,aAAa,iBAAe;IAC5B,eAAe,kBAAkB;IACjC,cAAc,kBAAkB;IAChC,QAAQ,YAAY;IAEpB,gBAAgB,mBAAmB;IACnC,eAAe,kBAAkB;IAEjC,gBAAgB,mBAAiB;IACjC,gBAAgB,mBAAiB;CAGpC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CEvents = void 0;
|
|
4
|
+
/*
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2023.. Chy Bilgisayar Bilisim
|
|
7
|
+
* Author: Cihan Ozturk
|
|
8
|
+
* E-mail: cihan@chy.com.tr
|
|
9
|
+
* Github:https://github.com/cihan53/
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
var CEvents;
|
|
13
|
+
(function (CEvents) {
|
|
14
|
+
CEvents["ON_INIT_BEFORE"] = "oninitbefore";
|
|
15
|
+
CEvents["ON_INIT_AFTER"] = "oninitafter";
|
|
16
|
+
CEvents["ON_MIDDLEWARE"] = "onmiddleware";
|
|
17
|
+
CEvents["ON_BEFORE_START"] = "onbeforestart";
|
|
18
|
+
CEvents["ON_AFTER_START"] = "onafterestart";
|
|
19
|
+
CEvents["ON_START"] = "onstart";
|
|
20
|
+
CEvents["ON_BEFORE_ACTION"] = "onbeferoaction";
|
|
21
|
+
CEvents["ON_AFTER_ACTION"] = "onafteraction";
|
|
22
|
+
CEvents["ON_DB_CONNECTION"] = "ondbconnection";
|
|
23
|
+
CEvents["ON_DB_DISCONNECT"] = "ondbdisconnect";
|
|
24
|
+
})(CEvents || (exports.CEvents = CEvents = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CRequest.d.ts","sourceRoot":"","sources":["../../src/base/CRequest.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
*
|
|
3
4
|
* Copyright (c) 2022.. Chy Bilgisayar Bilisim
|
|
@@ -6,9 +7,4 @@
|
|
|
6
7
|
* Github:https://github.com/cihan53/
|
|
7
8
|
*
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
-
export {Request ,Response, NextFunction} from "express";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component } from "./Component";
|
|
2
|
+
import { RouteDefinition } from "../model/RouteDefinition";
|
|
3
|
+
import { Request, Response } from "express";
|
|
4
|
+
export declare class CWebController extends Component {
|
|
5
|
+
/**
|
|
6
|
+
* @var string the ID of this controller.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
defaultAction: string;
|
|
10
|
+
constructor(config: any);
|
|
11
|
+
init(): void;
|
|
12
|
+
/**
|
|
13
|
+
* This method is invoked right before an action is executed.
|
|
14
|
+
* @param $action
|
|
15
|
+
*/
|
|
16
|
+
beforeAction(route: RouteDefinition, req: Request, res: Response): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* This method is invoked right after an action is executed.
|
|
19
|
+
* @param action
|
|
20
|
+
*/
|
|
21
|
+
afterAction(action: any, req: Request, res: Response): void;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
|
|
25
|
+
Checks the privilege of the current user.
|
|
26
|
+
|
|
27
|
+
This method should be overridden to check whether the current user has the privilege to run the specified action against the specified data model. If the user does not have access, a yii\web\ForbiddenHttpException should be thrown.
|
|
28
|
+
|
|
29
|
+
*/
|
|
30
|
+
checkAccess(action: any, model?: null, params?: any): void;
|
|
31
|
+
/**
|
|
32
|
+
* Send data formatted as JSON.
|
|
33
|
+
|
|
34
|
+
This method is a shortcut for sending data formatted as JSON. It will return the response application component after configuring the format and setting the data that should be formatted. A common usage will b
|
|
35
|
+
*/
|
|
36
|
+
asJson(data: any): void;
|
|
37
|
+
/**
|
|
38
|
+
* Send data formatted as XML.
|
|
39
|
+
|
|
40
|
+
This method is a shortcut for sending data formatted as XML. It will return the response application component after configuring the format and setting the data that should be formatted. A common usage will be:
|
|
41
|
+
*/
|
|
42
|
+
asXml(data: any): void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=CWebController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CWebController.d.ts","sourceRoot":"","sources":["../../src/base/CWebController.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI1C,qBAAa,cAAe,SAAQ,SAAS;IAGzC;;OAEG;IACI,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,SAAW;gBAEnB,MAAM,EAAE,GAAG;IAKhB,IAAI;IAKX;;;OAGG;IACU,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAc7E;;;OAGG;IACI,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAK3D;;;;;;;OAOG;IACI,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,GAAE,GAAQ;IAI9D;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,GAAG;IAIhB;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,GAAG;CAIlB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.CWebController = void 0;
|
|
22
|
+
const Component_1 = require("./Component");
|
|
23
|
+
const BaseChyz_1 = __importDefault(require("../BaseChyz"));
|
|
24
|
+
const CEvents_1 = require("./CEvents");
|
|
25
|
+
class CWebController extends Component_1.Component {
|
|
26
|
+
constructor(config) {
|
|
27
|
+
super();
|
|
28
|
+
this.defaultAction = 'index';
|
|
29
|
+
this.id = this.constructor.name.replace("Controller", "").toLowerCase();
|
|
30
|
+
}
|
|
31
|
+
init() {
|
|
32
|
+
super.init();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* This method is invoked right before an action is executed.
|
|
36
|
+
* @param $action
|
|
37
|
+
*/
|
|
38
|
+
beforeAction(route, req, res) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (route.id == "" || route.id == "/")
|
|
41
|
+
this.id = this.defaultAction;
|
|
42
|
+
this.ensureBehaviors();
|
|
43
|
+
for (const name of Object.keys(this.getBehaviors)) {
|
|
44
|
+
yield this.getBehaviors[name].beforeFilter(route, req, res);
|
|
45
|
+
}
|
|
46
|
+
BaseChyz_1.default.EventEmitter.emit(CEvents_1.CEvents.ON_BEFORE_ACTION, this, req, res);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* This method is invoked right after an action is executed.
|
|
51
|
+
* @param action
|
|
52
|
+
*/
|
|
53
|
+
afterAction(action, req, res) {
|
|
54
|
+
BaseChyz_1.default.EventEmitter.emit(CEvents_1.CEvents.ON_AFTER_ACTION, this, req, res);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
|
|
59
|
+
Checks the privilege of the current user.
|
|
60
|
+
|
|
61
|
+
This method should be overridden to check whether the current user has the privilege to run the specified action against the specified data model. If the user does not have access, a yii\web\ForbiddenHttpException should be thrown.
|
|
62
|
+
|
|
63
|
+
*/
|
|
64
|
+
checkAccess(action, model = null, params = []) {
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Send data formatted as JSON.
|
|
68
|
+
|
|
69
|
+
This method is a shortcut for sending data formatted as JSON. It will return the response application component after configuring the format and setting the data that should be formatted. A common usage will b
|
|
70
|
+
*/
|
|
71
|
+
asJson(data) {
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Send data formatted as XML.
|
|
75
|
+
|
|
76
|
+
This method is a shortcut for sending data formatted as XML. It will return the response application component after configuring the format and setting the data that should be formatted. A common usage will be:
|
|
77
|
+
*/
|
|
78
|
+
asXml(data) {
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.CWebController = CWebController;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CBaseObject } from "./CBaseObject";
|
|
2
|
+
export declare class Component extends CBaseObject {
|
|
3
|
+
/**
|
|
4
|
+
* @var array the attached event handlers (event name => handlers)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @var Behavior[]|null the attached behaviors (behavior name => behavior). This is `null` when not initialized.
|
|
8
|
+
*/
|
|
9
|
+
private _behaviors;
|
|
10
|
+
/**
|
|
11
|
+
* Returns a list of behaviors that this component should behave as.
|
|
12
|
+
*/
|
|
13
|
+
behaviors(): any;
|
|
14
|
+
get getBehaviors(): any;
|
|
15
|
+
/**
|
|
16
|
+
* Makes sure that the behaviors declared in [[behaviors()]] are attached to this component.
|
|
17
|
+
*/
|
|
18
|
+
ensureBehaviors(): void;
|
|
19
|
+
private attachBehaviorInternal;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../src/base/Component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAA;AAIzC,qBAAa,SAAU,SAAQ,WAAW;IAEtC;;OAEG;IAIH;;OAEG;IAEH,OAAO,CAAC,UAAU,CAA2B;IAG7C;;OAEG;IACI,SAAS,IAAI,GAAG;IAKvB,IAAI,YAAY,IAAI,GAAG,CAEtB;IAED;;OAEG;IACI,eAAe;IAetB,OAAO,CAAC,sBAAsB;CASjC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
exports.Component = void 0;
|
|
10
|
+
const CBaseObject_1 = require("./CBaseObject");
|
|
11
|
+
const Utils_1 = require("../requiments/Utils");
|
|
12
|
+
class Component extends CBaseObject_1.CBaseObject {
|
|
13
|
+
constructor() {
|
|
14
|
+
/**
|
|
15
|
+
* @var array the attached event handlers (event name => handlers)
|
|
16
|
+
*/
|
|
17
|
+
// private _events = [];
|
|
18
|
+
super(...arguments);
|
|
19
|
+
/**
|
|
20
|
+
* @var Behavior[]|null the attached behaviors (behavior name => behavior). This is `null` when not initialized.
|
|
21
|
+
*/
|
|
22
|
+
this._behaviors = [];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns a list of behaviors that this component should behave as.
|
|
26
|
+
*/
|
|
27
|
+
behaviors() {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
get getBehaviors() {
|
|
31
|
+
return this._behaviors;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Makes sure that the behaviors declared in [[behaviors()]] are attached to this component.
|
|
35
|
+
*/
|
|
36
|
+
ensureBehaviors() {
|
|
37
|
+
if (this._behaviors.length == 0) {
|
|
38
|
+
this._behaviors = [];
|
|
39
|
+
if (this.behaviors().length > 0) {
|
|
40
|
+
this.behaviors().forEach((behavior) => {
|
|
41
|
+
Object.keys(behavior).forEach((name) => {
|
|
42
|
+
this.attachBehaviorInternal(name, behavior);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
attachBehaviorInternal(name, behavior) {
|
|
49
|
+
if (!this._behaviors.hasOwnProperty(name)) {
|
|
50
|
+
let beh = Utils_1.Utils.createObject(new behavior[name].class, behavior[name]);
|
|
51
|
+
beh.init();
|
|
52
|
+
this._behaviors[name] = beh;
|
|
53
|
+
}
|
|
54
|
+
return behavior;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.Component = Component;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configurable.d.ts","sourceRoot":"","sources":["../../src/base/Configurable.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;CAE5B"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/*
|
|
2
3
|
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
3
4
|
* Author: Cihan Ozturk
|
|
4
5
|
* E-mail: cihan@chy.com.tr
|
|
5
6
|
* Github:https://github.com/cihan53/
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
const Glob = require("glob");
|
|
9
|
-
export default Glob;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataErrorDbException.d.ts","sourceRoot":"","sources":["../../src/base/DataErrorDbException.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qBAAa,oBAAqB,SAAQ,SAAS;IAC1B,OAAO,EAAE,GAAG;gBAAZ,OAAO,EAAE,GAAG;CAGpC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
exports.DataErrorDbException = void 0;
|
|
10
|
+
const BaseError_1 = require("./BaseError");
|
|
11
|
+
class DataErrorDbException extends BaseError_1.BaseError {
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(message, 502);
|
|
14
|
+
this.message = message;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DataErrorDbException = DataErrorDbException;
|