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

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 (60) hide show
  1. package/authAssignment-B6rhOsb-.d.ts +146 -0
  2. package/authItem-CRUblP_g.d.ts +85 -0
  3. package/databases/models/index.ts +2 -0
  4. package/databases/models/menu.ts +14 -0
  5. package/databases/models/users.ts +15 -0
  6. package/databases/schema/authAssignment.ts +72 -0
  7. package/databases/schema/authItem.ts +93 -0
  8. package/databases/schema/authItemChild.ts +34 -0
  9. package/databases/schema/authRole.ts +66 -0
  10. package/databases/schema/authRoleChild.ts +37 -0
  11. package/databases/schema/index.ts +10 -0
  12. package/databases/schema/mdContent.ts +139 -0
  13. package/databases/schema/mdContentGroup.ts +73 -0
  14. package/databases/schema/menu.ts +108 -0
  15. package/databases/schema/msModule.ts +66 -0
  16. package/databases/schema/users.ts +186 -0
  17. package/databases/tables/authAssignment.d.ts +2 -0
  18. package/databases/tables/authAssignment.js +499 -0
  19. package/databases/tables/authItem.d.ts +2 -0
  20. package/databases/tables/authItem.js +294 -0
  21. package/databases/tables/authItemChild.d.ts +2 -0
  22. package/databases/tables/authItemChild.js +296 -0
  23. package/databases/tables/authRole.d.ts +2 -0
  24. package/databases/tables/authRole.js +501 -0
  25. package/databases/{models → tables}/authRoleChild.js +1 -1
  26. package/databases/tables/index.d.ts +4 -0
  27. package/databases/{models → tables}/index.js +433 -346
  28. package/databases/tables/mdContent.d.ts +2 -0
  29. package/databases/tables/mdContent.js +499 -0
  30. package/databases/tables/mdContentGroup.d.ts +2 -0
  31. package/databases/tables/mdContentGroup.js +501 -0
  32. package/databases/tables/menu.d.ts +2 -0
  33. package/databases/tables/menu.js +294 -0
  34. package/databases/tables/msModule.d.ts +2 -0
  35. package/databases/tables/msModule.js +296 -0
  36. package/databases/tables/users.d.ts +2 -0
  37. package/databases/tables/users.js +499 -0
  38. package/middleware/authenticate-token.js +35 -24
  39. package/middleware/error-handler.js +1 -1
  40. package/package.json +4 -2
  41. package/databases/models/authAssignment.d.ts +0 -20
  42. package/databases/models/authAssignment.js +0 -88
  43. package/databases/models/authItem.d.ts +0 -26
  44. package/databases/models/authItem.js +0 -104
  45. package/databases/models/authItemChild.d.ts +0 -12
  46. package/databases/models/authItemChild.js +0 -58
  47. package/databases/models/authRole.d.ts +0 -20
  48. package/databases/models/authRole.js +0 -86
  49. package/databases/models/index.d.ts +0 -11
  50. package/databases/models/mdContent.d.ts +0 -38
  51. package/databases/models/mdContent.js +0 -146
  52. package/databases/models/mdContentGroup.d.ts +0 -22
  53. package/databases/models/mdContentGroup.js +0 -92
  54. package/databases/models/menu.d.ts +0 -26
  55. package/databases/models/menu.js +0 -106
  56. package/databases/models/msModule.d.ts +0 -20
  57. package/databases/models/msModule.js +0 -86
  58. package/databases/models/users.d.ts +0 -50
  59. package/databases/models/users.js +0 -185
  60. /package/databases/{models → tables}/authRoleChild.d.ts +0 -0
@@ -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
+ declare uuid: number;
42
+
43
+ @ForeignKey(() => mdContentGroup)
44
+ @Column({
45
+ field: "group_id",
46
+ allowNull: true,
47
+ type: DataType.INTEGER
48
+ })
49
+ declare groupId?: number;
50
+
51
+ @ForeignKey(() => users)
52
+ @Column({
53
+ field: "user_id",
54
+ type: DataType.INTEGER
55
+ })
56
+ declare userId: number;
57
+
58
+ @Column({
59
+ allowNull: true,
60
+ type: DataType.STRING(255)
61
+ })
62
+ declare title?: string;
63
+
64
+ @Column({
65
+ allowNull: true,
66
+ type: DataType.STRING
67
+ })
68
+ declare detail?: string;
69
+
70
+ @Column({
71
+ field: "meta_title",
72
+ allowNull: true,
73
+ type: DataType.STRING(255)
74
+ })
75
+ declare metaTitle?: string;
76
+
77
+ @Column({
78
+ field: "meta_keyword",
79
+ allowNull: true,
80
+ type: DataType.STRING(255)
81
+ })
82
+ declare metaKeyword?: string;
83
+
84
+ @Column({
85
+ field: "meta_description",
86
+ allowNull: true,
87
+ type: DataType.STRING(255)
88
+ })
89
+ declare metaDescription?: string;
90
+
91
+ @Column({
92
+ field: "image_cover",
93
+ allowNull: true,
94
+ type: DataType.STRING(255)
95
+ })
96
+ declare imageCover?: string;
97
+
98
+ @Column({
99
+ field: "image_gallery",
100
+ allowNull: true,
101
+ type: DataType.STRING
102
+ })
103
+ declare imageGallery?: string;
104
+
105
+ @Column({
106
+ field: "created_by",
107
+ allowNull: true,
108
+ type: DataType.STRING(60)
109
+ })
110
+ declare createdBy?: string;
111
+
112
+ @Column({
113
+ field: "created_date",
114
+ allowNull: true,
115
+ type: DataType.DATE
116
+ })
117
+ declare createdDate?: Date;
118
+
119
+ @Column({
120
+ field: "updated_by",
121
+ allowNull: true,
122
+ type: DataType.STRING(60)
123
+ })
124
+ declare updatedBy?: string;
125
+
126
+ @Column({
127
+ field: "updated_date",
128
+ allowNull: true,
129
+ type: DataType.DATE
130
+ })
131
+ declare updatedDate?: Date;
132
+
133
+ @BelongsTo(() => users)
134
+ declare user?: users;
135
+
136
+ @BelongsTo(() => mdContentGroup)
137
+ declare 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
+ declare name: string;
33
+
34
+ @Column({
35
+ allowNull: true,
36
+ type: DataType.STRING(255)
37
+ })
38
+ declare description?: string;
39
+
40
+ @Column({
41
+ field: "created_by",
42
+ allowNull: true,
43
+ type: DataType.STRING(60)
44
+ })
45
+ declare createdBy?: string;
46
+
47
+ @Column({
48
+ field: "created_date",
49
+ allowNull: true,
50
+ type: DataType.DATE
51
+ })
52
+ declare createdDate?: Date;
53
+
54
+ @Column({
55
+ field: "updated_by",
56
+ allowNull: true,
57
+ type: DataType.STRING(60)
58
+ })
59
+ declare updatedBy?: string;
60
+
61
+ @Column({
62
+ field: "updated_date",
63
+ allowNull: true,
64
+ type: DataType.DATE
65
+ })
66
+ declare updatedDate?: Date;
67
+
68
+ @HasMany(() => mdContent, {
69
+ sourceKey: "id"
70
+ })
71
+ declare mdContents?: mdContent[];
72
+
73
+ }
@@ -0,0 +1,108 @@
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
+ parentId?: number;
12
+ display?: string;
13
+ description?: string;
14
+ moduleId?: number;
15
+ createdBy?: string;
16
+ createdDate?: Date;
17
+ updatedBy?: string;
18
+ updatedDate?: Date;
19
+ }
20
+
21
+ @Table({
22
+ tableName: "menu",
23
+ timestamps: false
24
+ })
25
+ export class menu extends Model<menuAttributes, menuAttributes> implements menuAttributes {
26
+
27
+ @Column({
28
+ primaryKey: true,
29
+ autoIncrement: true,
30
+ type: DataType.INTEGER
31
+ })
32
+ declare id?: number;
33
+
34
+ @Column({
35
+ type: DataType.STRING(60)
36
+ })
37
+ declare uuid: string;
38
+
39
+ @ForeignKey(() => authItem)
40
+ @Column({
41
+ field: "item_name",
42
+ allowNull: true,
43
+ type: DataType.STRING(100)
44
+ })
45
+ declare itemName?: string;
46
+
47
+ @Column({
48
+ field: "parent_id",
49
+ allowNull: true,
50
+ type: DataType.INTEGER
51
+ })
52
+ declare parentId?: number;
53
+
54
+ @Column({
55
+ allowNull: true,
56
+ type: DataType.STRING(255)
57
+ })
58
+ declare display?: string;
59
+
60
+ @Column({
61
+ allowNull: true,
62
+ type: DataType.STRING(255)
63
+ })
64
+ declare description?: string;
65
+
66
+ @ForeignKey(() => msModule)
67
+ @Column({
68
+ field: "module_id",
69
+ allowNull: true,
70
+ type: DataType.INTEGER
71
+ })
72
+ declare moduleId?: number;
73
+
74
+ @Column({
75
+ field: "created_by",
76
+ allowNull: true,
77
+ type: DataType.STRING(60)
78
+ })
79
+ declare createdBy?: string;
80
+
81
+ @Column({
82
+ field: "created_date",
83
+ allowNull: true,
84
+ type: DataType.DATE
85
+ })
86
+ declare createdDate?: Date;
87
+
88
+ @Column({
89
+ field: "updated_by",
90
+ allowNull: true,
91
+ type: DataType.STRING(60)
92
+ })
93
+ declare updatedBy?: string;
94
+
95
+ @Column({
96
+ field: "updated_date",
97
+ allowNull: true,
98
+ type: DataType.DATE
99
+ })
100
+ declare updatedDate?: Date;
101
+
102
+ @BelongsTo(() => msModule)
103
+ declare msModule?: msModule;
104
+
105
+ @BelongsTo(() => authItem)
106
+ declare authItem?: authItem;
107
+
108
+ }
@@ -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
+ declare name: string;
32
+
33
+ @Column({
34
+ field: "created_by",
35
+ allowNull: true,
36
+ type: DataType.STRING(60)
37
+ })
38
+ declare createdBy?: string;
39
+
40
+ @Column({
41
+ field: "created_date",
42
+ allowNull: true,
43
+ type: DataType.DATE
44
+ })
45
+ declare createdDate?: Date;
46
+
47
+ @Column({
48
+ field: "updated_by",
49
+ allowNull: true,
50
+ type: DataType.STRING(60)
51
+ })
52
+ declare updatedBy?: string;
53
+
54
+ @Column({
55
+ field: "updated_date",
56
+ allowNull: true,
57
+ type: DataType.DATE
58
+ })
59
+ declare updatedDate?: Date;
60
+
61
+ @HasMany(() => menu, {
62
+ sourceKey: "id"
63
+ })
64
+ declare menus?: menu[];
65
+
66
+ }
@@ -0,0 +1,186 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, HasMany
3
+ } from "sequelize-typescript";
4
+ import { authAssignment } from "./authAssignment";
5
+ import { mdContent } from "./mdContent";
6
+
7
+ export interface usersAttributes {
8
+ id?: number;
9
+ uuid: string;
10
+ username: string;
11
+ passwordHash?: string;
12
+ passwordResetToken?: string;
13
+ verificationToken?: string;
14
+ email?: string;
15
+ authKey?: string;
16
+ accessToken?: string;
17
+ userLevel?: number;
18
+ userAuthen?: string;
19
+ userType?: number;
20
+ prefix?: string;
21
+ firstName?: string;
22
+ lastName?: string;
23
+ phone?: string;
24
+ status?: number;
25
+ createdBy?: string;
26
+ createdDate?: Date;
27
+ updatedBy?: string;
28
+ updatedDate?: Date;
29
+ }
30
+
31
+ @Table({
32
+ tableName: "users",
33
+ timestamps: false
34
+ })
35
+ export class users extends Model<usersAttributes, usersAttributes> implements usersAttributes {
36
+
37
+ @Column({
38
+ primaryKey: true,
39
+ autoIncrement: true,
40
+ type: DataType.INTEGER
41
+ })
42
+ declare id?: number;
43
+
44
+ @Column({
45
+ type: DataType.STRING(60)
46
+ })
47
+ declare uuid: string;
48
+
49
+ @Column({
50
+ type: DataType.STRING(100)
51
+ })
52
+ declare username: string;
53
+
54
+ @Column({
55
+ field: "password_hash",
56
+ allowNull: true,
57
+ type: DataType.STRING(255)
58
+ })
59
+ declare passwordHash?: string;
60
+
61
+ @Column({
62
+ field: "password_reset_token",
63
+ allowNull: true,
64
+ type: DataType.STRING(255)
65
+ })
66
+ declare passwordResetToken?: string;
67
+
68
+ @Column({
69
+ field: "verification_token",
70
+ allowNull: true,
71
+ type: DataType.STRING(255)
72
+ })
73
+ declare verificationToken?: string;
74
+
75
+ @Column({
76
+ allowNull: true,
77
+ type: DataType.STRING(255)
78
+ })
79
+ declare email?: string;
80
+
81
+ @Column({
82
+ field: "auth_key",
83
+ allowNull: true,
84
+ type: DataType.STRING(32)
85
+ })
86
+ declare authKey?: string;
87
+
88
+ @Column({
89
+ field: "access_token",
90
+ allowNull: true,
91
+ type: DataType.STRING
92
+ })
93
+ declare accessToken?: string;
94
+
95
+ @Column({
96
+ field: "user_level",
97
+ allowNull: true,
98
+ type: DataType.INTEGER
99
+ })
100
+ declare userLevel?: number;
101
+
102
+ @Column({
103
+ field: "user_authen",
104
+ allowNull: true,
105
+ type: DataType.STRING(64)
106
+ })
107
+ declare userAuthen?: string;
108
+
109
+ @Column({
110
+ field: "user_type",
111
+ allowNull: true,
112
+ type: DataType.INTEGER
113
+ })
114
+ declare userType?: number;
115
+
116
+ @Column({
117
+ allowNull: true,
118
+ type: DataType.STRING(10)
119
+ })
120
+ declare prefix?: string;
121
+
122
+ @Column({
123
+ field: "first_name",
124
+ allowNull: true,
125
+ type: DataType.STRING(100)
126
+ })
127
+ declare firstName?: string;
128
+
129
+ @Column({
130
+ field: "last_name",
131
+ allowNull: true,
132
+ type: DataType.STRING(100)
133
+ })
134
+ declare lastName?: string;
135
+
136
+ @Column({
137
+ allowNull: true,
138
+ type: DataType.STRING(20)
139
+ })
140
+ declare phone?: string;
141
+
142
+ @Column({
143
+ allowNull: true,
144
+ type: DataType.SMALLINT
145
+ })
146
+ declare status?: number;
147
+
148
+ @Column({
149
+ field: "created_by",
150
+ allowNull: true,
151
+ type: DataType.STRING(60)
152
+ })
153
+ declare createdBy?: string;
154
+
155
+ @Column({
156
+ field: "created_date",
157
+ allowNull: true,
158
+ type: DataType.DATE
159
+ })
160
+ declare createdDate?: Date;
161
+
162
+ @Column({
163
+ field: "updated_by",
164
+ allowNull: true,
165
+ type: DataType.STRING(60)
166
+ })
167
+ declare updatedBy?: string;
168
+
169
+ @Column({
170
+ field: "updated_date",
171
+ allowNull: true,
172
+ type: DataType.DATE
173
+ })
174
+ declare updatedDate?: Date;
175
+
176
+ @HasMany(() => authAssignment, {
177
+ sourceKey: "id"
178
+ })
179
+ declare authAssignments?: authAssignment[];
180
+
181
+ @HasMany(() => mdContent, {
182
+ sourceKey: "id"
183
+ })
184
+ declare mdContents?: mdContent[];
185
+
186
+ }
@@ -0,0 +1,2 @@
1
+ import 'sequelize-typescript';
2
+ export { b as authAssignment, a as authAssignmentAttributes } from '../../authAssignment-B6rhOsb-.js';