@admc-go-th/admc-library 1.0.13 → 1.0.14

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 (35) hide show
  1. package/authAssignment-B6rhOsb-.d.ts +146 -0
  2. package/authItem-23raYvdO.d.ts +39 -0
  3. package/databases/models/authAssignment.d.ts +2 -20
  4. package/databases/models/authAssignment.js +422 -11
  5. package/databases/models/authItem.d.ts +3 -26
  6. package/databases/models/authItem.js +194 -19
  7. package/databases/models/authItemChild.d.ts +3 -12
  8. package/databases/models/authItemChild.js +228 -5
  9. package/databases/models/authRole.d.ts +2 -20
  10. package/databases/models/authRole.js +422 -7
  11. package/databases/models/index.d.ts +3 -9
  12. package/databases/models/index.js +413 -341
  13. package/databases/models/mdContent.d.ts +2 -38
  14. package/databases/models/mdContent.js +383 -30
  15. package/databases/models/mdContentGroup.d.ts +2 -22
  16. package/databases/models/mdContentGroup.js +422 -13
  17. package/databases/models/menu.d.ts +2 -26
  18. package/databases/models/menu.js +81 -17
  19. package/databases/models/msModule.d.ts +2 -20
  20. package/databases/models/msModule.js +91 -7
  21. package/databases/models/users.d.ts +2 -50
  22. package/databases/models/users.js +355 -41
  23. package/databases/schema/authAssignment.ts +72 -0
  24. package/databases/schema/authItem.ts +93 -0
  25. package/databases/schema/authItemChild.ts +34 -0
  26. package/databases/schema/authRole.ts +66 -0
  27. package/databases/schema/authRoleChild.ts +37 -0
  28. package/databases/schema/index.ts +10 -0
  29. package/databases/schema/mdContent.ts +139 -0
  30. package/databases/schema/mdContentGroup.ts +73 -0
  31. package/databases/schema/menu.ts +93 -0
  32. package/databases/schema/msModule.ts +66 -0
  33. package/databases/schema/users.ts +186 -0
  34. package/menu-7H-HhIig.d.ts +45 -0
  35. package/package.json +4 -2
@@ -0,0 +1,72 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, BelongsTo
3
+ } from "sequelize-typescript";
4
+ import { users } from "./users";
5
+ import { authRole } from "./authRole";
6
+
7
+ export interface authAssignmentAttributes {
8
+ roleId: number;
9
+ userId: number;
10
+ createdBy?: string;
11
+ createdDate?: Date;
12
+ updatedBy?: string;
13
+ updatedDate?: Date;
14
+ }
15
+
16
+ @Table({
17
+ tableName: "auth_assignment",
18
+ timestamps: false
19
+ })
20
+ export class authAssignment extends Model<authAssignmentAttributes, authAssignmentAttributes> implements authAssignmentAttributes {
21
+
22
+ @ForeignKey(() => authRole)
23
+ @Column({
24
+ field: "role_id",
25
+ primaryKey: true,
26
+ type: DataType.INTEGER
27
+ })
28
+ roleId!: number;
29
+
30
+ @ForeignKey(() => users)
31
+ @Column({
32
+ field: "user_id",
33
+ primaryKey: true,
34
+ type: DataType.INTEGER
35
+ })
36
+ userId!: number;
37
+
38
+ @Column({
39
+ field: "created_by",
40
+ allowNull: true,
41
+ type: DataType.STRING(60)
42
+ })
43
+ createdBy?: string;
44
+
45
+ @Column({
46
+ field: "created_date",
47
+ allowNull: true,
48
+ type: DataType.DATE
49
+ })
50
+ createdDate?: Date;
51
+
52
+ @Column({
53
+ field: "updated_by",
54
+ allowNull: true,
55
+ type: DataType.STRING(60)
56
+ })
57
+ updatedBy?: string;
58
+
59
+ @Column({
60
+ field: "updated_date",
61
+ allowNull: true,
62
+ type: DataType.DATE
63
+ })
64
+ updatedDate?: Date;
65
+
66
+ @BelongsTo(() => users)
67
+ user?: users;
68
+
69
+ @BelongsTo(() => authRole)
70
+ authRole?: authRole;
71
+
72
+ }
@@ -0,0 +1,93 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, HasMany
3
+ } from "sequelize-typescript";
4
+ import { menu } from "./menu";
5
+ import { authItemChild } from "./authItemChild";
6
+
7
+ export interface authItemAttributes {
8
+ keyName: string;
9
+ type: number;
10
+ display: string;
11
+ description?: string;
12
+ status?: number;
13
+ createdBy?: string;
14
+ createdDate?: Date;
15
+ updatedBy?: string;
16
+ updatedDate?: Date;
17
+ }
18
+
19
+ @Table({
20
+ tableName: "auth_item",
21
+ timestamps: false
22
+ })
23
+ export class authItem extends Model<authItemAttributes, authItemAttributes> implements authItemAttributes {
24
+
25
+ @Column({
26
+ field: "key_name",
27
+ primaryKey: true,
28
+ type: DataType.STRING(100)
29
+ })
30
+ keyName!: string;
31
+
32
+ @Column({
33
+ type: DataType.SMALLINT
34
+ })
35
+ type!: number;
36
+
37
+ @Column({
38
+ type: DataType.STRING(255)
39
+ })
40
+ display!: string;
41
+
42
+ @Column({
43
+ allowNull: true,
44
+ type: DataType.STRING
45
+ })
46
+ description?: string;
47
+
48
+ @Column({
49
+ allowNull: true,
50
+ type: DataType.INTEGER,
51
+ defaultValue: "1"
52
+ })
53
+ status?: number;
54
+
55
+ @Column({
56
+ field: "created_by",
57
+ allowNull: true,
58
+ type: DataType.STRING(60)
59
+ })
60
+ createdBy?: string;
61
+
62
+ @Column({
63
+ field: "created_date",
64
+ allowNull: true,
65
+ type: DataType.DATE
66
+ })
67
+ createdDate?: Date;
68
+
69
+ @Column({
70
+ field: "updated_by",
71
+ allowNull: true,
72
+ type: DataType.STRING(60)
73
+ })
74
+ updatedBy?: string;
75
+
76
+ @Column({
77
+ field: "updated_date",
78
+ allowNull: true,
79
+ type: DataType.DATE
80
+ })
81
+ updatedDate?: Date;
82
+
83
+ @HasMany(() => menu, {
84
+ sourceKey: "keyName"
85
+ })
86
+ menus?: menu[];
87
+
88
+ @HasMany(() => authItemChild, {
89
+ sourceKey: "keyName"
90
+ })
91
+ authItemChildren?: authItemChild[];
92
+
93
+ }
@@ -0,0 +1,34 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, BelongsTo
3
+ } from "sequelize-typescript";
4
+ import { authItem } from "./authItem";
5
+
6
+ export interface authItemChildAttributes {
7
+ parent: string;
8
+ child: string;
9
+ }
10
+
11
+ @Table({
12
+ tableName: "auth_item_child",
13
+ timestamps: false
14
+ })
15
+ export class authItemChild extends Model<authItemChildAttributes, authItemChildAttributes> implements authItemChildAttributes {
16
+
17
+ @ForeignKey(() => authItem)
18
+ @Column({
19
+ primaryKey: true,
20
+ type: DataType.STRING(64)
21
+ })
22
+ parent!: string;
23
+
24
+ @ForeignKey(() => authItem)
25
+ @Column({
26
+ primaryKey: true,
27
+ type: DataType.STRING(64)
28
+ })
29
+ child!: string;
30
+
31
+ @BelongsTo(() => authItem)
32
+ authItem?: authItem;
33
+
34
+ }
@@ -0,0 +1,66 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, HasMany
3
+ } from "sequelize-typescript";
4
+ import { authAssignment } from "./authAssignment";
5
+
6
+ export interface authRoleAttributes {
7
+ id?: number;
8
+ name: string;
9
+ createdBy?: string;
10
+ createdDate?: Date;
11
+ updatedBy?: string;
12
+ updatedDate?: Date;
13
+ }
14
+
15
+ @Table({
16
+ tableName: "auth_role",
17
+ timestamps: false
18
+ })
19
+ export class authRole extends Model<authRoleAttributes, authRoleAttributes> implements authRoleAttributes {
20
+
21
+ @Column({
22
+ primaryKey: true,
23
+ autoIncrement: true,
24
+ type: DataType.INTEGER
25
+ })
26
+ declare id?: number;
27
+
28
+ @Column({
29
+ type: DataType.STRING(255)
30
+ })
31
+ name!: string;
32
+
33
+ @Column({
34
+ field: "created_by",
35
+ allowNull: true,
36
+ type: DataType.STRING(60)
37
+ })
38
+ createdBy?: string;
39
+
40
+ @Column({
41
+ field: "created_date",
42
+ allowNull: true,
43
+ type: DataType.DATE
44
+ })
45
+ createdDate?: Date;
46
+
47
+ @Column({
48
+ field: "updated_by",
49
+ allowNull: true,
50
+ type: DataType.STRING(60)
51
+ })
52
+ updatedBy?: string;
53
+
54
+ @Column({
55
+ field: "updated_date",
56
+ allowNull: true,
57
+ type: DataType.DATE
58
+ })
59
+ updatedDate?: Date;
60
+
61
+ @HasMany(() => authAssignment, {
62
+ sourceKey: "id"
63
+ })
64
+ authAssignments?: authAssignment[];
65
+
66
+ }
@@ -0,0 +1,37 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey
3
+ } from "sequelize-typescript";
4
+
5
+ export interface authRoleChildAttributes {
6
+ roleId: number;
7
+ itemName: string;
8
+ permission?: object;
9
+ }
10
+
11
+ @Table({
12
+ tableName: "auth_role_child",
13
+ timestamps: false
14
+ })
15
+ export class authRoleChild extends Model<authRoleChildAttributes, authRoleChildAttributes> implements authRoleChildAttributes {
16
+
17
+ @Column({
18
+ field: "role_id",
19
+ primaryKey: true,
20
+ type: DataType.INTEGER
21
+ })
22
+ roleId!: number;
23
+
24
+ @Column({
25
+ field: "item_name",
26
+ primaryKey: true,
27
+ type: DataType.STRING(255)
28
+ })
29
+ itemName!: string;
30
+
31
+ @Column({
32
+ allowNull: true,
33
+ type: DataType.JSON
34
+ })
35
+ permission?: object;
36
+
37
+ }
@@ -0,0 +1,10 @@
1
+ export * from "./authAssignment";
2
+ export * from "./authItem";
3
+ export * from "./authItemChild";
4
+ export * from "./authRole";
5
+ export * from "./authRoleChild";
6
+ export * from "./mdContent";
7
+ export * from "./mdContentGroup";
8
+ export * from "./menu";
9
+ export * from "./msModule";
10
+ export * from "./users";
@@ -0,0 +1,139 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, BelongsTo
3
+ } from "sequelize-typescript";
4
+ import { users } from "./users";
5
+ import { mdContentGroup } from "./mdContentGroup";
6
+
7
+ export interface mdContentAttributes {
8
+ id?: number;
9
+ uuid: number;
10
+ groupId?: number;
11
+ userId: number;
12
+ title?: string;
13
+ detail?: string;
14
+ metaTitle?: string;
15
+ metaKeyword?: string;
16
+ metaDescription?: string;
17
+ imageCover?: string;
18
+ imageGallery?: string;
19
+ createdBy?: string;
20
+ createdDate?: Date;
21
+ updatedBy?: string;
22
+ updatedDate?: Date;
23
+ }
24
+
25
+ @Table({
26
+ tableName: "md_content",
27
+ timestamps: false
28
+ })
29
+ export class mdContent extends Model<mdContentAttributes, mdContentAttributes> implements mdContentAttributes {
30
+
31
+ @Column({
32
+ primaryKey: true,
33
+ autoIncrement: true,
34
+ type: DataType.INTEGER
35
+ })
36
+ declare id?: number;
37
+
38
+ @Column({
39
+ type: DataType.INTEGER
40
+ })
41
+ uuid!: number;
42
+
43
+ @ForeignKey(() => mdContentGroup)
44
+ @Column({
45
+ field: "group_id",
46
+ allowNull: true,
47
+ type: DataType.INTEGER
48
+ })
49
+ groupId?: number;
50
+
51
+ @ForeignKey(() => users)
52
+ @Column({
53
+ field: "user_id",
54
+ type: DataType.INTEGER
55
+ })
56
+ userId!: number;
57
+
58
+ @Column({
59
+ allowNull: true,
60
+ type: DataType.STRING(255)
61
+ })
62
+ title?: string;
63
+
64
+ @Column({
65
+ allowNull: true,
66
+ type: DataType.STRING
67
+ })
68
+ detail?: string;
69
+
70
+ @Column({
71
+ field: "meta_title",
72
+ allowNull: true,
73
+ type: DataType.STRING(255)
74
+ })
75
+ metaTitle?: string;
76
+
77
+ @Column({
78
+ field: "meta_keyword",
79
+ allowNull: true,
80
+ type: DataType.STRING(255)
81
+ })
82
+ metaKeyword?: string;
83
+
84
+ @Column({
85
+ field: "meta_description",
86
+ allowNull: true,
87
+ type: DataType.STRING(255)
88
+ })
89
+ metaDescription?: string;
90
+
91
+ @Column({
92
+ field: "image_cover",
93
+ allowNull: true,
94
+ type: DataType.STRING(255)
95
+ })
96
+ imageCover?: string;
97
+
98
+ @Column({
99
+ field: "image_gallery",
100
+ allowNull: true,
101
+ type: DataType.STRING
102
+ })
103
+ imageGallery?: string;
104
+
105
+ @Column({
106
+ field: "created_by",
107
+ allowNull: true,
108
+ type: DataType.STRING(60)
109
+ })
110
+ createdBy?: string;
111
+
112
+ @Column({
113
+ field: "created_date",
114
+ allowNull: true,
115
+ type: DataType.DATE
116
+ })
117
+ createdDate?: Date;
118
+
119
+ @Column({
120
+ field: "updated_by",
121
+ allowNull: true,
122
+ type: DataType.STRING(60)
123
+ })
124
+ updatedBy?: string;
125
+
126
+ @Column({
127
+ field: "updated_date",
128
+ allowNull: true,
129
+ type: DataType.DATE
130
+ })
131
+ updatedDate?: Date;
132
+
133
+ @BelongsTo(() => users)
134
+ user?: users;
135
+
136
+ @BelongsTo(() => mdContentGroup)
137
+ mdContentGroup?: mdContentGroup;
138
+
139
+ }
@@ -0,0 +1,73 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, HasMany
3
+ } from "sequelize-typescript";
4
+ import { mdContent } from "./mdContent";
5
+
6
+ export interface mdContentGroupAttributes {
7
+ id?: number;
8
+ name: string;
9
+ description?: string;
10
+ createdBy?: string;
11
+ createdDate?: Date;
12
+ updatedBy?: string;
13
+ updatedDate?: Date;
14
+ }
15
+
16
+ @Table({
17
+ tableName: "md_content_group",
18
+ timestamps: false
19
+ })
20
+ export class mdContentGroup extends Model<mdContentGroupAttributes, mdContentGroupAttributes> implements mdContentGroupAttributes {
21
+
22
+ @Column({
23
+ primaryKey: true,
24
+ autoIncrement: true,
25
+ type: DataType.INTEGER
26
+ })
27
+ declare id?: number;
28
+
29
+ @Column({
30
+ type: DataType.STRING(255)
31
+ })
32
+ name!: string;
33
+
34
+ @Column({
35
+ allowNull: true,
36
+ type: DataType.STRING(255)
37
+ })
38
+ description?: string;
39
+
40
+ @Column({
41
+ field: "created_by",
42
+ allowNull: true,
43
+ type: DataType.STRING(60)
44
+ })
45
+ createdBy?: string;
46
+
47
+ @Column({
48
+ field: "created_date",
49
+ allowNull: true,
50
+ type: DataType.DATE
51
+ })
52
+ createdDate?: Date;
53
+
54
+ @Column({
55
+ field: "updated_by",
56
+ allowNull: true,
57
+ type: DataType.STRING(60)
58
+ })
59
+ updatedBy?: string;
60
+
61
+ @Column({
62
+ field: "updated_date",
63
+ allowNull: true,
64
+ type: DataType.DATE
65
+ })
66
+ updatedDate?: Date;
67
+
68
+ @HasMany(() => mdContent, {
69
+ sourceKey: "id"
70
+ })
71
+ mdContents?: mdContent[];
72
+
73
+ }
@@ -0,0 +1,93 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, BelongsTo
3
+ } from "sequelize-typescript";
4
+ import { msModule } from "./msModule";
5
+ import { authItem } from "./authItem";
6
+
7
+ export interface menuAttributes {
8
+ id?: number;
9
+ uuid: string;
10
+ itemName?: string;
11
+ display?: string;
12
+ moduleId?: number;
13
+ createdBy?: string;
14
+ createdDate?: Date;
15
+ updatedBy?: string;
16
+ updatedDate?: Date;
17
+ }
18
+
19
+ @Table({
20
+ tableName: "menu",
21
+ timestamps: false
22
+ })
23
+ export class menu extends Model<menuAttributes, menuAttributes> implements menuAttributes {
24
+
25
+ @Column({
26
+ primaryKey: true,
27
+ autoIncrement: true,
28
+ type: DataType.INTEGER
29
+ })
30
+ declare id?: number;
31
+
32
+ @Column({
33
+ type: DataType.STRING(60)
34
+ })
35
+ uuid!: string;
36
+
37
+ //@ForeignKey(() => authItem)
38
+ @Column({
39
+ field: "item_name",
40
+ allowNull: true,
41
+ type: DataType.STRING(100)
42
+ })
43
+ itemName?: string;
44
+
45
+ @Column({
46
+ allowNull: true,
47
+ type: DataType.STRING(255)
48
+ })
49
+ display?: string;
50
+
51
+ @ForeignKey(() => msModule)
52
+ @Column({
53
+ field: "module_id",
54
+ allowNull: true,
55
+ type: DataType.INTEGER
56
+ })
57
+ moduleId?: number;
58
+
59
+ @Column({
60
+ field: "created_by",
61
+ allowNull: true,
62
+ type: DataType.STRING(60)
63
+ })
64
+ createdBy?: string;
65
+
66
+ @Column({
67
+ field: "created_date",
68
+ allowNull: true,
69
+ type: DataType.DATE
70
+ })
71
+ createdDate?: Date;
72
+
73
+ @Column({
74
+ field: "updated_by",
75
+ allowNull: true,
76
+ type: DataType.STRING(60)
77
+ })
78
+ updatedBy?: string;
79
+
80
+ @Column({
81
+ field: "updated_date",
82
+ allowNull: true,
83
+ type: DataType.DATE
84
+ })
85
+ updatedDate?: Date;
86
+
87
+ @BelongsTo(() => msModule)
88
+ msModule?: msModule;
89
+
90
+ /*@BelongsTo(() => authItem)
91
+ authItem?: authItem;*/
92
+
93
+ }
@@ -0,0 +1,66 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, HasMany
3
+ } from "sequelize-typescript";
4
+ import { menu } from "./menu";
5
+
6
+ export interface msModuleAttributes {
7
+ id?: number;
8
+ name: string;
9
+ createdBy?: string;
10
+ createdDate?: Date;
11
+ updatedBy?: string;
12
+ updatedDate?: Date;
13
+ }
14
+
15
+ @Table({
16
+ tableName: "ms_module",
17
+ timestamps: false
18
+ })
19
+ export class msModule extends Model<msModuleAttributes, msModuleAttributes> implements msModuleAttributes {
20
+
21
+ @Column({
22
+ primaryKey: true,
23
+ autoIncrement: true,
24
+ type: DataType.INTEGER
25
+ })
26
+ declare id?: number;
27
+
28
+ @Column({
29
+ type: DataType.STRING(100)
30
+ })
31
+ name!: string;
32
+
33
+ @Column({
34
+ field: "created_by",
35
+ allowNull: true,
36
+ type: DataType.STRING(60)
37
+ })
38
+ createdBy?: string;
39
+
40
+ @Column({
41
+ field: "created_date",
42
+ allowNull: true,
43
+ type: DataType.DATE
44
+ })
45
+ createdDate?: Date;
46
+
47
+ @Column({
48
+ field: "updated_by",
49
+ allowNull: true,
50
+ type: DataType.STRING(60)
51
+ })
52
+ updatedBy?: string;
53
+
54
+ @Column({
55
+ field: "updated_date",
56
+ allowNull: true,
57
+ type: DataType.DATE
58
+ })
59
+ updatedDate?: Date;
60
+
61
+ @HasMany(() => menu, {
62
+ sourceKey: "id"
63
+ })
64
+ menus?: menu[];
65
+
66
+ }