@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,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
+ uuid!: string;
48
+
49
+ @Column({
50
+ type: DataType.STRING(100)
51
+ })
52
+ username!: string;
53
+
54
+ @Column({
55
+ field: "password_hash",
56
+ allowNull: true,
57
+ type: DataType.STRING(255)
58
+ })
59
+ passwordHash?: string;
60
+
61
+ @Column({
62
+ field: "password_reset_token",
63
+ allowNull: true,
64
+ type: DataType.STRING(255)
65
+ })
66
+ passwordResetToken?: string;
67
+
68
+ @Column({
69
+ field: "verification_token",
70
+ allowNull: true,
71
+ type: DataType.STRING(255)
72
+ })
73
+ verificationToken?: string;
74
+
75
+ @Column({
76
+ allowNull: true,
77
+ type: DataType.STRING(255)
78
+ })
79
+ email?: string;
80
+
81
+ @Column({
82
+ field: "auth_key",
83
+ allowNull: true,
84
+ type: DataType.STRING(32)
85
+ })
86
+ authKey?: string;
87
+
88
+ @Column({
89
+ field: "access_token",
90
+ allowNull: true,
91
+ type: DataType.STRING
92
+ })
93
+ accessToken?: string;
94
+
95
+ @Column({
96
+ field: "user_level",
97
+ allowNull: true,
98
+ type: DataType.INTEGER
99
+ })
100
+ userLevel?: number;
101
+
102
+ @Column({
103
+ field: "user_authen",
104
+ allowNull: true,
105
+ type: DataType.STRING(64)
106
+ })
107
+ userAuthen?: string;
108
+
109
+ @Column({
110
+ field: "user_type",
111
+ allowNull: true,
112
+ type: DataType.INTEGER
113
+ })
114
+ userType?: number;
115
+
116
+ @Column({
117
+ allowNull: true,
118
+ type: DataType.STRING(10)
119
+ })
120
+ prefix?: string;
121
+
122
+ @Column({
123
+ field: "first_name",
124
+ allowNull: true,
125
+ type: DataType.STRING(100)
126
+ })
127
+ firstName?: string;
128
+
129
+ @Column({
130
+ field: "last_name",
131
+ allowNull: true,
132
+ type: DataType.STRING(100)
133
+ })
134
+ lastName?: string;
135
+
136
+ @Column({
137
+ allowNull: true,
138
+ type: DataType.STRING(20)
139
+ })
140
+ phone?: string;
141
+
142
+ @Column({
143
+ allowNull: true,
144
+ type: DataType.SMALLINT
145
+ })
146
+ status?: number;
147
+
148
+ @Column({
149
+ field: "created_by",
150
+ allowNull: true,
151
+ type: DataType.STRING(60)
152
+ })
153
+ createdBy?: string;
154
+
155
+ @Column({
156
+ field: "created_date",
157
+ allowNull: true,
158
+ type: DataType.DATE
159
+ })
160
+ createdDate?: Date;
161
+
162
+ @Column({
163
+ field: "updated_by",
164
+ allowNull: true,
165
+ type: DataType.STRING(60)
166
+ })
167
+ updatedBy?: string;
168
+
169
+ @Column({
170
+ field: "updated_date",
171
+ allowNull: true,
172
+ type: DataType.DATE
173
+ })
174
+ updatedDate?: Date;
175
+
176
+ @HasMany(() => authAssignment, {
177
+ sourceKey: "id"
178
+ })
179
+ authAssignments?: authAssignment[];
180
+
181
+ @HasMany(() => mdContent, {
182
+ sourceKey: "id"
183
+ })
184
+ mdContents?: mdContent[];
185
+
186
+ }
@@ -0,0 +1,45 @@
1
+ import { Model } from 'sequelize-typescript';
2
+
3
+ interface msModuleAttributes {
4
+ id?: number;
5
+ name: string;
6
+ createdBy?: string;
7
+ createdDate?: Date;
8
+ updatedBy?: string;
9
+ updatedDate?: Date;
10
+ }
11
+ declare class msModule extends Model<msModuleAttributes, msModuleAttributes> implements msModuleAttributes {
12
+ id?: number;
13
+ name: string;
14
+ createdBy?: string;
15
+ createdDate?: Date;
16
+ updatedBy?: string;
17
+ updatedDate?: Date;
18
+ menus?: menu[];
19
+ }
20
+
21
+ interface menuAttributes {
22
+ id?: number;
23
+ uuid: string;
24
+ itemName?: string;
25
+ display?: string;
26
+ moduleId?: number;
27
+ createdBy?: string;
28
+ createdDate?: Date;
29
+ updatedBy?: string;
30
+ updatedDate?: Date;
31
+ }
32
+ declare class menu extends Model<menuAttributes, menuAttributes> implements menuAttributes {
33
+ id?: number;
34
+ uuid: string;
35
+ itemName?: string;
36
+ display?: string;
37
+ moduleId?: number;
38
+ createdBy?: string;
39
+ createdDate?: Date;
40
+ updatedBy?: string;
41
+ updatedDate?: Date;
42
+ msModule?: msModule;
43
+ }
44
+
45
+ export { menu as a, type msModuleAttributes as b, msModule as c, type menuAttributes as m };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@admc-go-th/admc-library",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsup",
9
- "postbuild": "npm-prepare-dist",
9
+ "postbuild": "npm-prepare-dist && npm run copy-model",
10
+ "copy-model": "shx mkdir -p dist/databases/schema && shx cp -r src/databases/models/* dist/databases/schema",
10
11
  "link-app": "npm run build && cd dist && npm link",
11
12
  "publish-app": "npm run build && cd dist && npm publish --access=public",
12
13
  "format": "prettier --write ."
@@ -34,6 +35,7 @@
34
35
  "dayjs": "^1.11.13",
35
36
  "express": "^5.1.0",
36
37
  "jsonwebtoken": "^9.0.2",
38
+ "sequelize": "^6.37.7",
37
39
  "sequelize-typescript": "^2.1.6"
38
40
  },
39
41
  "module": "./index.js"