chyz 2.0.1-rc.3 → 2.0.1-rc.36
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 +623 -0
- package/README.md +518 -518
- package/base/ActionFilter.ts +88 -0
- package/base/BadRequestHttpException.ts +14 -0
- package/base/{BaseError.js → BaseError.ts} +26 -18
- package/base/Behavior.ts +6 -0
- package/base/CBaseObject.ts +17 -0
- package/base/CEvents.ts +24 -0
- package/base/{CRequest.js → CRequest.ts} +6 -2
- package/base/CWebController.ts +90 -0
- package/base/Component.ts +66 -0
- package/{model/RouteDefinition.js → base/Configurable.ts} +4 -2
- package/base/DataErrorDbException.ts +16 -0
- package/base/DbConnection.ts +55 -0
- package/base/ForbiddenHttpException.ts +15 -0
- package/base/InvalidArgumentException.ts +16 -0
- package/base/InvalidConfigException.ts +16 -0
- package/base/{Logs.js → Logs.ts} +41 -24
- package/base/{Model.js → Model.ts} +225 -158
- package/base/{ModelManager.js → ModelManager.ts} +7 -7
- package/base/NotFoundHttpException.ts +14 -0
- package/base/RestClient.ts +26 -0
- package/base/UnauthorizedHttpException.ts +17 -0
- package/base/ValidationHttpException.ts +14 -0
- package/base/db/Exception.ts +14 -0
- package/base/index.ts +19 -0
- package/decorator/Middleware.ts +9 -0
- package/decorator/{controller.js → controller.ts} +7 -9
- package/decorator/{delete.js → delete.ts} +9 -9
- package/decorator/enums/ControllerDecoratorParams.ts +5 -0
- package/decorator/{get.js → get.ts} +11 -10
- package/decorator/index.ts +5 -0
- package/decorator/{post.js → post.ts} +10 -10
- package/decorator/{put.js → put.ts} +9 -9
- package/filters/AccessControl.ts +74 -0
- package/filters/AccessRule.ts +182 -0
- package/filters/auth/{AuthInterface.d.ts → AuthInterface.ts} +15 -7
- package/filters/auth/AuthMethod.ts +100 -0
- package/filters/auth/HttpBasicAuth.ts +79 -0
- package/filters/auth/HttpBearerAuth.ts +34 -0
- package/filters/auth/HttpHeaderAuth.ts +61 -0
- package/filters/auth/JwtHttpBearerAuth.ts +83 -0
- package/filters/auth/KeyCloakHttpBearerAuth.ts +114 -0
- package/filters/auth/index.ts +4 -0
- package/filters/index.ts +2 -0
- package/index.ts +80 -0
- package/log/config/log4js.json +55 -55
- package/model/RouteDefinition.ts +18 -0
- package/package.json +63 -61
- package/rbac/AuthAssignment.ts +50 -0
- package/rbac/{AuthItem.js → AuthItem.ts} +22 -16
- package/rbac/{AuthItemChild.js → AuthItemChild.ts} +21 -14
- package/rbac/AuthManager.ts +399 -0
- package/rbac/index.ts +12 -0
- package/{web/IdentityInterface.js → requiments/Glob.ts} +3 -2
- package/requiments/{ReflectUtil.js → ReflectUtil.ts} +6 -4
- package/requiments/{Utils.js → Utils.ts} +40 -34
- 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 +27 -0
- package/web/{IdentityInterface.d.ts → IdentityInterface.ts} +15 -2
- package/web/WebUser.ts +187 -0
- package/BaseChyz.d.ts +0 -74
- package/BaseChyz.d.ts.map +0 -1
- package/BaseChyz.js +0 -569
- package/base/ActionFilter.d.ts +0 -33
- package/base/ActionFilter.d.ts.map +0 -1
- package/base/ActionFilter.js +0 -90
- package/base/BadRequestHttpException.d.ts +0 -6
- package/base/BadRequestHttpException.d.ts.map +0 -1
- package/base/BadRequestHttpException.js +0 -17
- package/base/BaseError.d.ts +0 -44
- package/base/BaseError.d.ts.map +0 -1
- package/base/Behavior.d.ts +0 -4
- package/base/Behavior.d.ts.map +0 -1
- package/base/Behavior.js +0 -7
- package/base/CBaseObject.d.ts +0 -5
- package/base/CBaseObject.d.ts.map +0 -1
- package/base/CBaseObject.js +0 -16
- package/base/CEvents.d.ts +0 -13
- package/base/CEvents.d.ts.map +0 -1
- package/base/CEvents.js +0 -24
- package/base/CRequest.d.ts +0 -2
- package/base/CRequest.d.ts.map +0 -1
- package/base/CWebController.d.ts +0 -44
- package/base/CWebController.d.ts.map +0 -1
- package/base/CWebController.js +0 -81
- package/base/Component.d.ts +0 -21
- package/base/Component.d.ts.map +0 -1
- package/base/Component.js +0 -57
- package/base/Configurable.d.ts +0 -3
- package/base/Configurable.d.ts.map +0 -1
- package/base/Configurable.js +0 -8
- package/base/DataErrorDbException.d.ts +0 -6
- package/base/DataErrorDbException.d.ts.map +0 -1
- package/base/DataErrorDbException.js +0 -17
- package/base/DbConnection.d.ts +0 -13
- package/base/DbConnection.d.ts.map +0 -1
- package/base/DbConnection.js +0 -53
- package/base/ForbiddenHttpException.d.ts +0 -5
- package/base/ForbiddenHttpException.d.ts.map +0 -1
- package/base/ForbiddenHttpException.js +0 -16
- package/base/InvalidArgumentException.d.ts +0 -6
- package/base/InvalidArgumentException.d.ts.map +0 -1
- package/base/InvalidArgumentException.js +0 -17
- package/base/InvalidConfigException.d.ts +0 -6
- package/base/InvalidConfigException.d.ts.map +0 -1
- package/base/InvalidConfigException.js +0 -17
- package/base/Logs.d.ts +0 -22
- package/base/Logs.d.ts.map +0 -1
- package/base/Model.d.ts +0 -302
- package/base/Model.d.ts.map +0 -1
- package/base/ModelManager.d.ts +0 -2
- package/base/ModelManager.d.ts.map +0 -1
- package/base/NotFoundHttpException.d.ts +0 -6
- package/base/NotFoundHttpException.d.ts.map +0 -1
- package/base/NotFoundHttpException.js +0 -17
- package/base/RestClient.d.ts +0 -7
- package/base/RestClient.d.ts.map +0 -1
- package/base/RestClient.js +0 -25
- package/base/UnauthorizedHttpException.d.ts +0 -6
- package/base/UnauthorizedHttpException.d.ts.map +0 -1
- package/base/UnauthorizedHttpException.js +0 -17
- package/base/ValidationHttpException.d.ts +0 -6
- package/base/ValidationHttpException.d.ts.map +0 -1
- package/base/ValidationHttpException.js +0 -17
- package/base/db/Exception.d.ts +0 -7
- package/base/db/Exception.d.ts.map +0 -1
- package/base/db/Exception.js +0 -15
- package/base/index.d.ts +0 -20
- package/base/index.d.ts.map +0 -1
- package/base/index.js +0 -41
- package/decorator/Middleware.d.ts +0 -4
- package/decorator/Middleware.d.ts.map +0 -1
- package/decorator/Middleware.js +0 -11
- package/decorator/controller.d.ts +0 -3
- package/decorator/controller.d.ts.map +0 -1
- package/decorator/delete.d.ts +0 -3
- package/decorator/delete.d.ts.map +0 -1
- package/decorator/enums/ControllerDecoratorParams.d.ts +0 -6
- package/decorator/enums/ControllerDecoratorParams.d.ts.map +0 -1
- package/decorator/enums/ControllerDecoratorParams.js +0 -9
- package/decorator/get.d.ts +0 -3
- package/decorator/get.d.ts.map +0 -1
- package/decorator/index.d.ts +0 -6
- package/decorator/index.d.ts.map +0 -1
- package/decorator/index.js +0 -13
- package/decorator/post.d.ts +0 -3
- package/decorator/post.d.ts.map +0 -1
- package/decorator/put.d.ts +0 -3
- package/decorator/put.d.ts.map +0 -1
- package/filters/AccessControl.d.ts +0 -13
- package/filters/AccessControl.d.ts.map +0 -1
- package/filters/AccessControl.js +0 -83
- package/filters/AccessRule.d.ts +0 -83
- package/filters/AccessRule.d.ts.map +0 -1
- package/filters/AccessRule.js +0 -136
- package/filters/auth/AuthInterface.d.ts.map +0 -1
- package/filters/auth/AuthInterface.js +0 -2
- package/filters/auth/AuthMethod.d.ts +0 -38
- package/filters/auth/AuthMethod.d.ts.map +0 -1
- package/filters/auth/AuthMethod.js +0 -82
- package/filters/auth/HttpBasicAuth.d.ts +0 -24
- package/filters/auth/HttpBasicAuth.d.ts.map +0 -1
- package/filters/auth/HttpBasicAuth.js +0 -78
- package/filters/auth/HttpBearerAuth.d.ts +0 -18
- package/filters/auth/HttpBearerAuth.d.ts.map +0 -1
- package/filters/auth/HttpBearerAuth.js +0 -33
- package/filters/auth/HttpHeaderAuth.d.ts +0 -19
- package/filters/auth/HttpHeaderAuth.d.ts.map +0 -1
- package/filters/auth/HttpHeaderAuth.js +0 -64
- package/filters/auth/JwtHttpBearerAuth.d.ts +0 -21
- package/filters/auth/JwtHttpBearerAuth.d.ts.map +0 -1
- package/filters/auth/JwtHttpBearerAuth.js +0 -87
- package/filters/auth/KeyCloakHttpBearerAuth.d.ts +0 -23
- package/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +0 -1
- package/filters/auth/KeyCloakHttpBearerAuth.js +0 -116
- package/filters/auth/index.d.ts +0 -5
- package/filters/auth/index.d.ts.map +0 -1
- package/filters/auth/index.js +0 -11
- package/filters/index.d.ts +0 -3
- package/filters/index.d.ts.map +0 -1
- package/filters/index.js +0 -7
- package/index.d.ts +0 -26
- package/index.d.ts.map +0 -1
- package/index.js +0 -72
- package/model/RouteDefinition.d.ts +0 -7
- package/model/RouteDefinition.d.ts.map +0 -1
- package/rbac/AuthAssignment.d.ts +0 -19
- package/rbac/AuthAssignment.d.ts.map +0 -1
- package/rbac/AuthAssignment.js +0 -44
- package/rbac/AuthItem.d.ts +0 -27
- package/rbac/AuthItem.d.ts.map +0 -1
- package/rbac/AuthItemChild.d.ts +0 -19
- package/rbac/AuthItemChild.d.ts.map +0 -1
- package/rbac/AuthManager.d.ts +0 -112
- package/rbac/AuthManager.d.ts.map +0 -1
- package/rbac/AuthManager.js +0 -356
- package/rbac/index.d.ts +0 -5
- package/rbac/index.d.ts.map +0 -1
- package/rbac/index.js +0 -28
- package/requiments/Glob.d.ts +0 -3
- package/requiments/Glob.d.ts.map +0 -1
- package/requiments/Glob.js +0 -10
- package/requiments/ReflectUtil.d.ts +0 -1
- package/requiments/ReflectUtil.d.ts.map +0 -1
- package/requiments/Utils.d.ts +0 -2
- package/requiments/Utils.d.ts.map +0 -1
- package/validators/BooleanValidator.d.ts +0 -1
- package/validators/BooleanValidator.d.ts.map +0 -1
- package/validators/BooleanValidator.js +0 -1
- package/validators/CompareValidator.d.ts +0 -1
- package/validators/CompareValidator.d.ts.map +0 -1
- package/validators/CompareValidator.js +0 -1
- package/validators/DateValidator.d.ts +0 -1
- package/validators/DateValidator.d.ts.map +0 -1
- package/validators/DateValidator.js +0 -1
- package/validators/EmailValidator.d.ts +0 -1
- package/validators/EmailValidator.d.ts.map +0 -1
- package/validators/EmailValidator.js +0 -1
- package/validators/Validator.d.ts +0 -18
- package/validators/Validator.d.ts.map +0 -1
- package/validators/Validator.js +0 -27
- package/web/IdentityInterface.d.ts.map +0 -1
- package/web/WebUser.d.ts +0 -72
- package/web/WebUser.d.ts.map +0 -1
- package/web/WebUser.js +0 -165
package/package.json
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "chyz",
|
|
3
|
-
"version": "2.0.1-rc.
|
|
4
|
-
"description": "Nodejs Micro service Framework",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"postversion": "git push && git push --tags"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/cihan53/Chy-Nodejs-Framework.git"
|
|
12
|
-
},
|
|
13
|
-
"author": "Cihan Ozturk",
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
|
|
17
|
-
},
|
|
18
|
-
"homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"express
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"@types/
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "chyz",
|
|
3
|
+
"version": "2.0.1-rc.36",
|
|
4
|
+
"description": "Nodejs Micro service Framework",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"postversion": "git push && git push --tags"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/cihan53/Chy-Nodejs-Framework.git"
|
|
12
|
+
},
|
|
13
|
+
"author": "Cihan Ozturk",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/cihan53/Chy-Nodejs-Framework/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/cihan53/Chy-Nodejs-Framework#readme",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@types/compression": "^1.7.5",
|
|
21
|
+
"axios": "^1.3.5",
|
|
22
|
+
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
|
23
|
+
"body-parser": "^1.20.2",
|
|
24
|
+
"compression": "^1.7.4",
|
|
25
|
+
"core-js": "^3.30.1",
|
|
26
|
+
"cors": "^2.8.5",
|
|
27
|
+
"dayjs": "^1.11.7",
|
|
28
|
+
"dotenv-flow": "^3.2.0",
|
|
29
|
+
"express": "^4.18.2",
|
|
30
|
+
"express-session": "^1.17.3",
|
|
31
|
+
"glob": "^10.0.0",
|
|
32
|
+
"ip": "^1.1.8",
|
|
33
|
+
"jsonwebtoken": "^9.0.0",
|
|
34
|
+
"lodash": "^4.17.21",
|
|
35
|
+
"lodash-uuid": "^0.0.3",
|
|
36
|
+
"log4js": "^6.9.1",
|
|
37
|
+
"method-override": "^3.0.0",
|
|
38
|
+
"passport": "^0.6.0",
|
|
39
|
+
"pg": "^8.10.0",
|
|
40
|
+
"pg-hstore": "^2.3.4",
|
|
41
|
+
"reflect-metadata": "^0.1.13",
|
|
42
|
+
"sequelize": "^6.31.0",
|
|
43
|
+
"sequelize-transparent-cache": "^2.3.0",
|
|
44
|
+
"tslib": "^2.5.0",
|
|
45
|
+
"validate.js": "^0.13.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/express": "^4.17.17",
|
|
49
|
+
"@types/node": "^18.15.11",
|
|
50
|
+
"@types/validator": "^13.7.15",
|
|
51
|
+
"nodemon": "^2.0.22",
|
|
52
|
+
"ts-node": "^10.9.1",
|
|
53
|
+
"typescript": "^5.0.4"
|
|
54
|
+
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"Framework",
|
|
57
|
+
"RespAPI",
|
|
58
|
+
"microservice",
|
|
59
|
+
"micro service",
|
|
60
|
+
"easy configuration",
|
|
61
|
+
"Rbac support"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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,51 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
3
|
* Author: Cihan Ozturk
|
|
5
4
|
* E-mail: cihan@chy.com.tr
|
|
6
5
|
* Github:https://github.com/cihan53/
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class AuthItemClass extends
|
|
7
|
+
|
|
8
|
+
import {DataTypes, Model, ModelManager, Relation} from "../base";
|
|
9
|
+
|
|
10
|
+
export class AuthItemClass extends Model {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
|
|
12
13
|
tableName() {
|
|
13
14
|
return 'auth_item';
|
|
14
15
|
}
|
|
16
|
+
|
|
15
17
|
attributes() {
|
|
16
18
|
return {
|
|
17
19
|
// Model attributes are defined here
|
|
18
20
|
name: {
|
|
19
|
-
type:
|
|
20
|
-
primaryKey:
|
|
21
|
+
type: DataTypes.STRING,
|
|
22
|
+
primaryKey:true,
|
|
21
23
|
allowNull: false
|
|
22
24
|
},
|
|
23
25
|
type: {
|
|
24
|
-
type:
|
|
26
|
+
type: DataTypes.INTEGER,
|
|
25
27
|
allowNull: false
|
|
26
28
|
},
|
|
27
29
|
description: {
|
|
28
|
-
type:
|
|
30
|
+
type: DataTypes.STRING,
|
|
29
31
|
allowNull: false
|
|
30
32
|
},
|
|
31
33
|
rule_name: {
|
|
32
|
-
type:
|
|
34
|
+
type: DataTypes.STRING,
|
|
33
35
|
allowNull: false
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
|
|
38
|
+
}
|
|
36
39
|
}
|
|
40
|
+
|
|
37
41
|
init() {
|
|
38
42
|
super.init();
|
|
39
|
-
this.model().removeAttribute('id')
|
|
43
|
+
this.model().removeAttribute('id')
|
|
40
44
|
}
|
|
41
|
-
|
|
45
|
+
|
|
46
|
+
relations(): Relation[] {
|
|
42
47
|
return [
|
|
43
48
|
{
|
|
44
49
|
type: "hasOne",
|
|
45
50
|
foreignKey: "item_name",
|
|
46
|
-
model:
|
|
51
|
+
model: ModelManager.AuthAssignment.model()
|
|
47
52
|
}
|
|
48
|
-
]
|
|
53
|
+
]
|
|
49
54
|
}
|
|
55
|
+
|
|
50
56
|
}
|
|
51
|
-
|
|
57
|
+
|
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2021. Chy Bilgisayar Bilisim
|
|
4
3
|
* Author: Cihan Ozturk
|
|
5
4
|
* E-mail: cihan@chy.com.tr
|
|
6
5
|
* Github:https://github.com/cihan53/
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
import {DataTypes, Model, ModelManager, Relation} from "../base";
|
|
11
|
+
|
|
12
|
+
export class AuthItemChildClass extends Model {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
|
|
12
15
|
tableName() {
|
|
13
16
|
return 'auth_item_child';
|
|
14
17
|
}
|
|
18
|
+
|
|
15
19
|
attributes() {
|
|
16
20
|
return {
|
|
17
21
|
// Model attributes are defined here
|
|
18
22
|
parent: {
|
|
19
|
-
type:
|
|
20
|
-
primaryKey:
|
|
23
|
+
type: DataTypes.STRING,
|
|
24
|
+
primaryKey:true,
|
|
21
25
|
allowNull: false
|
|
22
26
|
},
|
|
23
27
|
child: {
|
|
24
|
-
type:
|
|
28
|
+
type: DataTypes.STRING,
|
|
25
29
|
allowNull: false
|
|
26
30
|
}
|
|
27
|
-
}
|
|
31
|
+
}
|
|
28
32
|
}
|
|
33
|
+
|
|
29
34
|
init() {
|
|
30
35
|
super.init();
|
|
31
|
-
this.model().removeAttribute('id')
|
|
36
|
+
this.model().removeAttribute('id')
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
|
|
39
|
+
relations(): Relation[] {
|
|
34
40
|
return [
|
|
35
41
|
{
|
|
36
42
|
type: "hasOne",
|
|
37
43
|
foreignKey: "item_name",
|
|
38
|
-
model:
|
|
44
|
+
model: ModelManager.AuthAssignment.model()
|
|
39
45
|
}
|
|
40
|
-
]
|
|
46
|
+
]
|
|
41
47
|
}
|
|
48
|
+
|
|
42
49
|
}
|
|
43
|
-
|
|
50
|
+
|