chyz 1.0.13-rc.20 → 1.0.13-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseChyz.ts +4 -19
- package/Examples/Controllers/ApiController.ts +22 -22
- package/Examples/Controllers/SiteController.ts +8 -18
- package/Examples/Models/Categories.ts +2 -1
- package/Examples/Models/KeycloakUser.ts +0 -4
- package/Examples/Models/User.ts +1 -8
- package/Examples/index.ts +0 -5
- package/Examples/log/app.log +0 -4322
- package/Examples/log/errors.log +0 -458
- package/README.md +12 -265
- package/base/ActionFilter.ts +1 -1
- package/base/BaseError.ts +1 -3
- package/base/Model.ts +29 -43
- package/base/ModelManager.ts +1 -6
- package/base/RestClient.ts +4 -4
- package/base/ValidationHttpException.ts +1 -1
- package/base/index.ts +0 -1
- package/dist/BaseChyz.js +4 -17
- package/dist/BaseChyz.js.map +1 -1
- package/dist/base/ActionFilter.js +1 -1
- package/dist/base/ActionFilter.js.map +1 -1
- package/dist/base/BaseError.js +1 -5
- package/dist/base/BaseError.js.map +1 -1
- package/dist/base/Model.js +2 -12
- package/dist/base/Model.js.map +1 -1
- package/dist/base/ModelManager.js +8 -0
- package/dist/base/ModelManager.js.map +1 -1
- package/dist/base/RestClient.js +4 -4
- package/dist/base/RestClient.js.map +1 -1
- package/dist/base/ValidationHttpException.js +1 -1
- package/dist/base/index.js +0 -1
- package/dist/base/index.js.map +1 -1
- package/dist/filters/AccessControl.js +3 -15
- package/dist/filters/AccessControl.js.map +1 -1
- package/dist/filters/AccessRule.js +38 -99
- package/dist/filters/AccessRule.js.map +1 -1
- package/dist/filters/auth/HttpBasicAuth.js +0 -65
- package/dist/filters/auth/HttpBasicAuth.js.map +1 -1
- package/dist/filters/auth/JwtHttpBearerAuth.js +1 -1
- package/dist/filters/auth/JwtHttpBearerAuth.js.map +1 -1
- package/dist/filters/auth/index.js +0 -1
- package/dist/filters/auth/index.js.map +1 -1
- package/dist/package.json +5 -4
- package/dist/web/WebUser.js +0 -78
- package/dist/web/WebUser.js.map +1 -1
- package/filters/AccessControl.ts +6 -19
- package/filters/AccessRule.ts +16 -61
- package/filters/auth/HttpBasicAuth.ts +0 -68
- package/filters/auth/JwtHttpBearerAuth.ts +1 -1
- package/filters/auth/index.ts +0 -1
- package/package.json +5 -4
- package/web/IdentityInterface.ts +0 -6
- package/web/WebUser.ts +1 -88
- package/Doc/Moel kullanma.md +0 -13
- package/Examples/Controllers/BasicApiController.ts +0 -121
- package/Examples/Models/AuthAssignment.ts +0 -50
- package/Examples/Models/AuthItem.ts +0 -59
- package/Examples/Models/AuthItemChild.ts +0 -49
- package/base/InvalidArgumentException.ts +0 -16
- package/dist/base/InvalidArgumentException.js +0 -18
- package/dist/base/InvalidArgumentException.js.map +0 -1
- package/dist/rbac/AuthAssignment.js +0 -45
- package/dist/rbac/AuthAssignment.js.map +0 -1
- package/dist/rbac/AuthItem.js +0 -52
- package/dist/rbac/AuthItem.js.map +0 -1
- package/dist/rbac/AuthItemChild.js +0 -44
- package/dist/rbac/AuthItemChild.js.map +0 -1
- package/dist/rbac/AuthManager.js +0 -359
- package/dist/rbac/AuthManager.js.map +0 -1
- package/rbac/AuthAssignment.ts +0 -50
- package/rbac/AuthItem.ts +0 -57
- package/rbac/AuthItemChild.ts +0 -50
- package/rbac/AuthManager.ts +0 -398
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) 2021-2021.. Chy Bilgisayar Bilisim
|
|
4
|
-
* Author: Cihan Ozturk
|
|
5
|
-
* E-mail: cihan@chy.com.tr
|
|
6
|
-
* Github:https://github.com/cihan53/
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import {Controller, ForbiddenHttpException, ModelManager, ValidationHttpException} from "../../base";
|
|
11
|
-
import BaseChyz from "../../BaseChyz";
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
import {Request, Response} from "express";
|
|
14
|
-
import {controller, get, post} from "../../decorator";
|
|
15
|
-
import {ProductsClass} from "../Models/Products";
|
|
16
|
-
import {HttpBasicAuth} from "../../filters/auth/HttpBasicAuth";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@controller("/basic/api")
|
|
20
|
-
class ApiController extends Controller {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
public behaviors(): any[] {
|
|
25
|
-
|
|
26
|
-
return [{
|
|
27
|
-
'authenticator': {
|
|
28
|
-
"class": HttpBasicAuth,
|
|
29
|
-
// "auth": this.myCheck
|
|
30
|
-
}
|
|
31
|
-
}]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@get("/")
|
|
35
|
-
Index(req: Request, res: Response) {
|
|
36
|
-
|
|
37
|
-
BaseChyz.logs().info("Site Controller Burası", this.id)
|
|
38
|
-
return res.json({message: "index sayfası"})
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@post("orderCreate")
|
|
42
|
-
async Login(req: Request, res: Response) {
|
|
43
|
-
let data = req.body;
|
|
44
|
-
data.Customer.status = "true";
|
|
45
|
-
data.Customer["2fa"] = "true";
|
|
46
|
-
|
|
47
|
-
//Customer Model Create
|
|
48
|
-
let customer = ModelManager.Customer.save();
|
|
49
|
-
//Order Model Create
|
|
50
|
-
let order = ModelManager.Order;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
let transaction
|
|
54
|
-
try {
|
|
55
|
-
// get transaction
|
|
56
|
-
transaction = await BaseChyz.getComponent("db").transaction();
|
|
57
|
-
customer.load(data, "Customer");//load customer data
|
|
58
|
-
let cus: any = await customer.save({}, {transaction});
|
|
59
|
-
|
|
60
|
-
if (!cus) {
|
|
61
|
-
throw new ValidationHttpException(customer.errors);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
data.Order.customer_id = cus.id;
|
|
65
|
-
// data.Order.total = 0;
|
|
66
|
-
// data.Order.status = true;
|
|
67
|
-
order.load(data, "Order");
|
|
68
|
-
let res1 = await order.save({}, {transaction});
|
|
69
|
-
if (!res1) {
|
|
70
|
-
throw new ValidationHttpException(order.errors);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// commit
|
|
74
|
-
await transaction.commit();
|
|
75
|
-
|
|
76
|
-
} catch (e) {
|
|
77
|
-
if (transaction) {
|
|
78
|
-
await transaction.rollback();
|
|
79
|
-
BaseChyz.warn("Rollback transaction")
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (e instanceof ValidationHttpException)
|
|
83
|
-
throw new ValidationHttpException(e.message)
|
|
84
|
-
else
|
|
85
|
-
throw new ForbiddenHttpException(e.message)
|
|
86
|
-
}
|
|
87
|
-
return res.send("Post Controller")
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@get("order/list")
|
|
92
|
-
async listOrder(req: Request, res: Response) {
|
|
93
|
-
const {Products}: { Products: ProductsClass } = ModelManager;
|
|
94
|
-
let product = await Products.findAll({include: [ModelManager.ProductModels.model()]});
|
|
95
|
-
return res.json(product)
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@get("categories")
|
|
100
|
-
async Categories(req: Request, res: Response) {
|
|
101
|
-
let product = await ModelManager.Categories.findAll({
|
|
102
|
-
include: [
|
|
103
|
-
{
|
|
104
|
-
model: ModelManager.Products.model(),
|
|
105
|
-
// as: 'product',
|
|
106
|
-
// through: { attributes: [] } // Hide unwanted `PlayerGameTeam` nested object from results
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
});
|
|
110
|
-
return res.json(product)
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
error(req: Request, res: Response) {
|
|
116
|
-
BaseChyz.logs().info("Error Sayfası")
|
|
117
|
-
return res.send("Post Controller")
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
module.exports = ApiController
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
3
|
-
* Author: Cihan Ozturk
|
|
4
|
-
* E-mail: cihan@chy.com.tr
|
|
5
|
-
* Github:https://github.com/cihan53/
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import {DataTypes, Model, ModelManager, Relation} from "../../base";
|
|
9
|
-
|
|
10
|
-
export class AuthAssignmentClass extends Model {
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
|
|
13
|
-
tableName() {
|
|
14
|
-
return 'auth_assignment';
|
|
15
|
-
}
|
|
16
|
-
attributes() {
|
|
17
|
-
return {
|
|
18
|
-
|
|
19
|
-
// Model attributes are defined here
|
|
20
|
-
item_name: {
|
|
21
|
-
type: DataTypes.STRING,
|
|
22
|
-
primaryKey:true,
|
|
23
|
-
allowNull: false
|
|
24
|
-
},
|
|
25
|
-
user_id : {
|
|
26
|
-
type: DataTypes.STRING,
|
|
27
|
-
allowNull: false
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
init(){
|
|
34
|
-
super.init();
|
|
35
|
-
this.model().removeAttribute('id')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
relations(): Relation[] {
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
type: "hasMany",
|
|
42
|
-
foreignKey: "name",
|
|
43
|
-
sourceKey:'item_name',
|
|
44
|
-
model: ModelManager.AuthItem.model()
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
3
|
-
* Author: Cihan Ozturk
|
|
4
|
-
* E-mail: cihan@chy.com.tr
|
|
5
|
-
* Github:https://github.com/cihan53/
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {DataTypes, Model, ModelManager, Relation} from "../../base";
|
|
11
|
-
|
|
12
|
-
export class AuthItemClass extends Model {
|
|
13
|
-
[x: string]: any;
|
|
14
|
-
|
|
15
|
-
tableName() {
|
|
16
|
-
return 'auth_item';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
attributes() {
|
|
20
|
-
return {
|
|
21
|
-
// Model attributes are defined here
|
|
22
|
-
name: {
|
|
23
|
-
type: DataTypes.STRING,
|
|
24
|
-
primaryKey:true,
|
|
25
|
-
allowNull: false
|
|
26
|
-
},
|
|
27
|
-
type: {
|
|
28
|
-
type: DataTypes.INTEGER,
|
|
29
|
-
allowNull: false
|
|
30
|
-
},
|
|
31
|
-
description: {
|
|
32
|
-
type: DataTypes.STRING,
|
|
33
|
-
allowNull: false
|
|
34
|
-
},
|
|
35
|
-
rule_name: {
|
|
36
|
-
type: DataTypes.STRING,
|
|
37
|
-
allowNull: false
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
init() {
|
|
44
|
-
super.init();
|
|
45
|
-
this.model().removeAttribute('id')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
relations(): Relation[] {
|
|
49
|
-
return [
|
|
50
|
-
{
|
|
51
|
-
type: "hasOne",
|
|
52
|
-
foreignKey: "item_name",
|
|
53
|
-
model: ModelManager.AuthAssignment.model()
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
3
|
-
* Author: Cihan Ozturk
|
|
4
|
-
* E-mail: cihan@chy.com.tr
|
|
5
|
-
* Github:https://github.com/cihan53/
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {DataTypes, Model, ModelManager, Relation} from "../../base";
|
|
10
|
-
|
|
11
|
-
export class AuthItemChildClass extends Model {
|
|
12
|
-
[x: string]: any;
|
|
13
|
-
|
|
14
|
-
tableName() {
|
|
15
|
-
return 'auth_item_child';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
attributes() {
|
|
19
|
-
return {
|
|
20
|
-
// Model attributes are defined here
|
|
21
|
-
parent: {
|
|
22
|
-
type: DataTypes.STRING,
|
|
23
|
-
primaryKey: true,
|
|
24
|
-
allowNull: false
|
|
25
|
-
},
|
|
26
|
-
child: {
|
|
27
|
-
type: DataTypes.STRING,
|
|
28
|
-
allowNull: false
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
init() {
|
|
34
|
-
super.init();
|
|
35
|
-
this.model().removeAttribute('id')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
relations(): Relation[] {
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
type: "hasOne",
|
|
42
|
-
foreignKey: "item_name",
|
|
43
|
-
model: ModelManager.AuthAssignment.model()
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
3
|
-
* Author: Cihan Ozturk
|
|
4
|
-
* E-mail: cihan@chy.com.tr
|
|
5
|
-
* Github:https://github.com/cihan53/
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {BaseError} from "./BaseError";
|
|
11
|
-
|
|
12
|
-
export class InvalidArgumentException extends BaseError {
|
|
13
|
-
constructor ( public message: string) {
|
|
14
|
-
super(message,500);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
|
-
* Author: Cihan Ozturk
|
|
5
|
-
* E-mail: cihan@chy.com.tr
|
|
6
|
-
* Github:https://github.com/cihan53/
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.InvalidArgumentException = void 0;
|
|
10
|
-
const BaseError_1 = require("./BaseError");
|
|
11
|
-
class InvalidArgumentException extends BaseError_1.BaseError {
|
|
12
|
-
constructor(message) {
|
|
13
|
-
super(message, 500);
|
|
14
|
-
this.message = message;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.InvalidArgumentException = InvalidArgumentException;
|
|
18
|
-
//# sourceMappingURL=InvalidArgumentException.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidArgumentException.js","sourceRoot":"","sources":["../../base/InvalidArgumentException.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIH,2CAAsC;AAEtC,MAAa,wBAAyB,SAAQ,qBAAS;IACnD,YAAqB,OAAe;QAChC,KAAK,CAAC,OAAO,EAAC,GAAG,CAAC,CAAC;QADF,YAAO,GAAP,OAAO,CAAQ;IAEpC,CAAC;CACJ;AAJD,4DAIC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
|
-
* Author: Cihan Ozturk
|
|
5
|
-
* E-mail: cihan@chy.com.tr
|
|
6
|
-
* Github:https://github.com/cihan53/
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AuthAssignmentClass = void 0;
|
|
10
|
-
const base_1 = require("../base");
|
|
11
|
-
class AuthAssignmentClass extends base_1.Model {
|
|
12
|
-
tableName() {
|
|
13
|
-
return 'auth_assignment';
|
|
14
|
-
}
|
|
15
|
-
attributes() {
|
|
16
|
-
return {
|
|
17
|
-
// Model attributes are defined here
|
|
18
|
-
item_name: {
|
|
19
|
-
type: base_1.DataTypes.STRING,
|
|
20
|
-
primaryKey: true,
|
|
21
|
-
allowNull: false
|
|
22
|
-
},
|
|
23
|
-
user_id: {
|
|
24
|
-
type: base_1.DataTypes.STRING,
|
|
25
|
-
allowNull: false
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
init() {
|
|
30
|
-
super.init();
|
|
31
|
-
this.model().removeAttribute('id');
|
|
32
|
-
}
|
|
33
|
-
relations() {
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
type: "hasMany",
|
|
37
|
-
foreignKey: "name",
|
|
38
|
-
sourceKey: 'item_name',
|
|
39
|
-
model: base_1.ModelManager.AuthItem.model()
|
|
40
|
-
}
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.AuthAssignmentClass = AuthAssignmentClass;
|
|
45
|
-
//# sourceMappingURL=AuthAssignment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthAssignment.js","sourceRoot":"","sources":["../../rbac/AuthAssignment.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,kCAAiE;AAEjE,MAAa,mBAAoB,SAAQ,YAAK;IAG1C,SAAS;QACL,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IACD,UAAU;QACN,OAAO;YAEH,oCAAoC;YACpC,SAAS,EAAE;gBACP,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,UAAU,EAAC,IAAI;gBACf,SAAS,EAAE,KAAK;aACnB;YACD,OAAO,EAAG;gBACN,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,SAAS,EAAE,KAAK;aACnB;SAEJ,CAAA;IACL,CAAC;IAED,IAAI;QACA,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACtC,CAAC;IAED,SAAS;QACL,OAAO;YACH;gBACI,IAAI,EAAE,SAAS;gBACf,UAAU,EAAE,MAAM;gBAClB,SAAS,EAAC,WAAW;gBACrB,KAAK,EAAE,mBAAY,CAAC,QAAQ,CAAC,KAAK,EAAE;aACvC;SACJ,CAAA;IACL,CAAC;CAEJ;AAvCD,kDAuCC"}
|
package/dist/rbac/AuthItem.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
|
-
* Author: Cihan Ozturk
|
|
5
|
-
* E-mail: cihan@chy.com.tr
|
|
6
|
-
* Github:https://github.com/cihan53/
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AuthItemClass = void 0;
|
|
10
|
-
const base_1 = require("../base");
|
|
11
|
-
class AuthItemClass extends base_1.Model {
|
|
12
|
-
tableName() {
|
|
13
|
-
return 'auth_item';
|
|
14
|
-
}
|
|
15
|
-
attributes() {
|
|
16
|
-
return {
|
|
17
|
-
// Model attributes are defined here
|
|
18
|
-
name: {
|
|
19
|
-
type: base_1.DataTypes.STRING,
|
|
20
|
-
primaryKey: true,
|
|
21
|
-
allowNull: false
|
|
22
|
-
},
|
|
23
|
-
type: {
|
|
24
|
-
type: base_1.DataTypes.INTEGER,
|
|
25
|
-
allowNull: false
|
|
26
|
-
},
|
|
27
|
-
description: {
|
|
28
|
-
type: base_1.DataTypes.STRING,
|
|
29
|
-
allowNull: false
|
|
30
|
-
},
|
|
31
|
-
rule_name: {
|
|
32
|
-
type: base_1.DataTypes.STRING,
|
|
33
|
-
allowNull: false
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
init() {
|
|
38
|
-
super.init();
|
|
39
|
-
this.model().removeAttribute('id');
|
|
40
|
-
}
|
|
41
|
-
relations() {
|
|
42
|
-
return [
|
|
43
|
-
{
|
|
44
|
-
type: "hasOne",
|
|
45
|
-
foreignKey: "item_name",
|
|
46
|
-
model: base_1.ModelManager.AuthAssignment.model()
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.AuthItemClass = AuthItemClass;
|
|
52
|
-
//# sourceMappingURL=AuthItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthItem.js","sourceRoot":"","sources":["../../rbac/AuthItem.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,kCAAiE;AAEjE,MAAa,aAAc,SAAQ,YAAK;IAGpC,SAAS;QACL,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,UAAU;QACN,OAAO;YACH,oCAAoC;YACpC,IAAI,EAAE;gBACF,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,UAAU,EAAC,IAAI;gBACf,SAAS,EAAE,KAAK;aACnB;YACD,IAAI,EAAE;gBACF,IAAI,EAAE,gBAAS,CAAC,OAAO;gBACvB,SAAS,EAAE,KAAK;aACnB;YACD,WAAW,EAAE;gBACT,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,SAAS,EAAE,KAAK;aACnB;YACD,SAAS,EAAE;gBACP,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,SAAS,EAAE,KAAK;aACnB;SAEJ,CAAA;IACL,CAAC;IAED,IAAI;QACA,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACtC,CAAC;IAED,SAAS;QACL,OAAO;YACH;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,WAAW;gBACvB,KAAK,EAAE,mBAAY,CAAC,cAAc,CAAC,KAAK,EAAE;aAC7C;SACJ,CAAA;IACL,CAAC;CAEJ;AA9CD,sCA8CC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
|
-
* Author: Cihan Ozturk
|
|
5
|
-
* E-mail: cihan@chy.com.tr
|
|
6
|
-
* Github:https://github.com/cihan53/
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.AuthItemChildClass = void 0;
|
|
10
|
-
const base_1 = require("../base");
|
|
11
|
-
class AuthItemChildClass extends base_1.Model {
|
|
12
|
-
tableName() {
|
|
13
|
-
return 'auth_item_child';
|
|
14
|
-
}
|
|
15
|
-
attributes() {
|
|
16
|
-
return {
|
|
17
|
-
// Model attributes are defined here
|
|
18
|
-
parent: {
|
|
19
|
-
type: base_1.DataTypes.STRING,
|
|
20
|
-
primaryKey: true,
|
|
21
|
-
allowNull: false
|
|
22
|
-
},
|
|
23
|
-
child: {
|
|
24
|
-
type: base_1.DataTypes.STRING,
|
|
25
|
-
allowNull: false
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
init() {
|
|
30
|
-
super.init();
|
|
31
|
-
this.model().removeAttribute('id');
|
|
32
|
-
}
|
|
33
|
-
relations() {
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
type: "hasOne",
|
|
37
|
-
foreignKey: "item_name",
|
|
38
|
-
model: base_1.ModelManager.AuthAssignment.model()
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.AuthItemChildClass = AuthItemChildClass;
|
|
44
|
-
//# sourceMappingURL=AuthItemChild.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthItemChild.js","sourceRoot":"","sources":["../../rbac/AuthItemChild.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIH,kCAAiE;AAEjE,MAAa,kBAAmB,SAAQ,YAAK;IAGzC,SAAS;QACL,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAED,UAAU;QACN,OAAO;YACH,oCAAoC;YACpC,MAAM,EAAE;gBACJ,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,UAAU,EAAC,IAAI;gBACf,SAAS,EAAE,KAAK;aACnB;YACD,KAAK,EAAE;gBACH,IAAI,EAAE,gBAAS,CAAC,MAAM;gBACtB,SAAS,EAAE,KAAK;aACnB;SACJ,CAAA;IACL,CAAC;IAED,IAAI;QACA,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IACtC,CAAC;IAED,SAAS;QACL,OAAO;YACH;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,WAAW;gBACvB,KAAK,EAAE,mBAAY,CAAC,cAAc,CAAC,KAAK,EAAE;aAC7C;SACJ,CAAA;IACL,CAAC;CAEJ;AArCD,gDAqCC"}
|