@admc-go-th/admc-library 1.0.29 → 1.0.31

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 (33) hide show
  1. package/{authAssignment-BUrX9fXX.d.ts → authAssignment-CXVzntUT.d.ts} +44 -1
  2. package/databases/models/index.ts +2 -1
  3. package/databases/models/usersVerify.ts +25 -0
  4. package/databases/schema/index.ts +3 -1
  5. package/databases/schema/mdDownload.ts +24 -0
  6. package/databases/schema/mdQuestionnaire.ts +148 -0
  7. package/databases/schema/oauthAccessToken.ts +8 -0
  8. package/databases/schema/oauthRefreshToken.ts +8 -0
  9. package/databases/schema/users.ts +14 -0
  10. package/databases/schema/usersVerify.ts +70 -0
  11. package/databases/tables/authAssignment.d.ts +1 -1
  12. package/databases/tables/authAssignment.js +232 -93
  13. package/databases/tables/authRole.d.ts +1 -1
  14. package/databases/tables/authRole.js +232 -93
  15. package/databases/tables/index.d.ts +2 -1
  16. package/databases/tables/index.js +736 -498
  17. package/databases/tables/mdContent.d.ts +1 -1
  18. package/databases/tables/mdContent.js +258 -119
  19. package/databases/tables/mdContentGroup.d.ts +1 -1
  20. package/databases/tables/mdContentGroup.js +258 -119
  21. package/databases/tables/mdDownload.d.ts +6 -0
  22. package/databases/tables/mdDownload.js +21 -0
  23. package/databases/tables/mdQuestionnaire.d.ts +2 -0
  24. package/databases/tables/mdQuestionnaire.js +720 -0
  25. package/databases/tables/oauthAccessToken.d.ts +2 -0
  26. package/databases/tables/oauthAccessToken.js +7 -0
  27. package/databases/tables/oauthRefreshToken.d.ts +2 -0
  28. package/databases/tables/oauthRefreshToken.js +7 -0
  29. package/databases/tables/users.d.ts +1 -1
  30. package/databases/tables/users.js +191 -52
  31. package/databases/tables/usersVerify.d.ts +22 -0
  32. package/databases/tables/usersVerify.js +95 -0
  33. package/package.json +1 -1
@@ -69,6 +69,46 @@ declare class mdContent extends Model<mdContentAttributes, mdContentAttributes>
69
69
  mdContentGroup?: mdContentGroup;
70
70
  }
71
71
 
72
+ interface mdQuestionnaireAttributes {
73
+ id?: number;
74
+ uuid?: string;
75
+ keyName?: string;
76
+ userId?: number;
77
+ title?: string;
78
+ description?: string;
79
+ startDate?: Date;
80
+ expireDate?: Date;
81
+ forms?: object;
82
+ confirmMessage?: string;
83
+ submitter?: string;
84
+ sort?: number;
85
+ status?: number;
86
+ createdBy?: string;
87
+ createdDate?: Date;
88
+ updatedBy?: string;
89
+ updatedDate?: Date;
90
+ }
91
+ declare class mdQuestionnaire extends Model<mdQuestionnaireAttributes, mdQuestionnaireAttributes> implements mdQuestionnaireAttributes {
92
+ id?: number;
93
+ uuid?: string;
94
+ keyName?: string;
95
+ userId?: number;
96
+ title?: string;
97
+ description?: string;
98
+ startDate?: Date;
99
+ expireDate?: Date;
100
+ forms?: object;
101
+ confirmMessage?: string;
102
+ submitter?: string;
103
+ sort?: number;
104
+ status?: number;
105
+ createdBy?: string;
106
+ createdDate?: Date;
107
+ updatedBy?: string;
108
+ updatedDate?: Date;
109
+ user?: users;
110
+ }
111
+
72
112
  interface usersAttributes {
73
113
  id?: number;
74
114
  uuid: string;
@@ -95,6 +135,7 @@ interface usersAttributes {
95
135
  updatedDate?: Date;
96
136
  address?: string;
97
137
  other?: string;
138
+ isEmailVerified?: number;
98
139
  }
99
140
  declare class users extends Model<usersAttributes, usersAttributes> implements usersAttributes {
100
141
  id?: number;
@@ -122,8 +163,10 @@ declare class users extends Model<usersAttributes, usersAttributes> implements u
122
163
  updatedDate?: Date;
123
164
  address?: string;
124
165
  other?: string;
166
+ isEmailVerified?: number;
125
167
  authAssignments?: authAssignment[];
126
168
  mdContents?: mdContent[];
169
+ mdQuestionnaires?: mdQuestionnaire[];
127
170
  }
128
171
 
129
172
  interface authRoleAttributes {
@@ -169,4 +212,4 @@ declare class authAssignment extends Model<authAssignmentAttributes, authAssignm
169
212
  authRole?: authRole;
170
213
  }
171
214
 
172
- export { type authAssignmentAttributes as a, authAssignment as b, type authRoleAttributes as c, authRole as d, mdContent as e, type mdContentGroupAttributes as f, mdContentGroup as g, users as h, type mdContentAttributes as m, type usersAttributes as u };
215
+ export { type authAssignmentAttributes as a, authAssignment as b, type authRoleAttributes as c, authRole as d, mdContent as e, type mdContentGroupAttributes as f, mdContentGroup as g, type mdQuestionnaireAttributes as h, mdQuestionnaire as i, users as j, type mdContentAttributes as m, type usersAttributes as u };
@@ -5,4 +5,5 @@ export * from "./authRoleChlid";
5
5
  export * from "./oauthAccessToken";
6
6
  export * from "./oauthRefreshToken";
7
7
  export * from "./authItem";
8
- export * from "./userRoleV";
8
+ export * from "./userRoleV";
9
+ export * from "./usersVerify";
@@ -0,0 +1,25 @@
1
+ import { usersVerify as UsersVerify } from "../tables";
2
+ import { FindOptions } from "sequelize";
3
+
4
+ export class usersVerify extends UsersVerify {
5
+ static async findByCode(code: string, options?: Omit<FindOptions, 'where'>): Promise<usersVerify | null> {
6
+ return await this.findOne({
7
+ where: { code },
8
+ ...options,
9
+ });
10
+ }
11
+
12
+ static async findByReference(reference: string, options?: Omit<FindOptions, 'where'>): Promise<usersVerify | null> {
13
+ return await this.findOne({
14
+ where: { reference },
15
+ ...options,
16
+ });
17
+ }
18
+
19
+ static async findByUserId(userId: number, options?: Omit<FindOptions, 'where'>): Promise<usersVerify | null> {
20
+ return await this.findOne({
21
+ where: { userId },
22
+ ...options,
23
+ });
24
+ }
25
+ }
@@ -12,6 +12,7 @@ export * from "./mdDownload";
12
12
  export * from "./mdFaq";
13
13
  export * from "./mdFaqGroup";
14
14
  export * from "./mdLink";
15
+ export * from "./mdQuestionnaire";
15
16
  export * from "./mdSetting";
16
17
  export * from "./menu";
17
18
  export * from "./msModule";
@@ -19,4 +20,5 @@ export * from "./oauthAccessToken";
19
20
  export * from "./oauthRefreshToken";
20
21
  export * from "./userCenterV";
21
22
  export * from "./userRoleV";
22
- export * from "./users";
23
+ export * from "./users";
24
+ export * from "./usersVerify";
@@ -11,6 +11,9 @@ export interface mdDownloadAttributes {
11
11
  fileUuid?: string;
12
12
  totalDownload?: number;
13
13
  sort?: number;
14
+ hasExpire?: number;
15
+ startDate?: Date;
16
+ expireDate?: Date;
14
17
  status?: number;
15
18
  createdBy?: string;
16
19
  createdDate?: Date;
@@ -76,6 +79,27 @@ export class mdDownload extends Model<mdDownloadAttributes, mdDownloadAttributes
76
79
  })
77
80
  declare sort?: number;
78
81
 
82
+ @Column({
83
+ field: "has_expire",
84
+ allowNull: true,
85
+ type: DataType.INTEGER
86
+ })
87
+ declare hasExpire?: number;
88
+
89
+ @Column({
90
+ field: "start_date",
91
+ allowNull: true,
92
+ type: DataType.DATE
93
+ })
94
+ declare startDate?: Date;
95
+
96
+ @Column({
97
+ field: "expire_date",
98
+ allowNull: true,
99
+ type: DataType.DATE
100
+ })
101
+ declare expireDate?: Date;
102
+
79
103
  @Column({
80
104
  allowNull: true,
81
105
  type: DataType.INTEGER
@@ -0,0 +1,148 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey, BelongsTo
3
+ } from "sequelize-typescript";
4
+ import { users } from "./users";
5
+
6
+ export interface mdQuestionnaireAttributes {
7
+ id?: number;
8
+ uuid?: string;
9
+ keyName?: string;
10
+ userId?: number;
11
+ title?: string;
12
+ description?: string;
13
+ startDate?: Date;
14
+ expireDate?: Date;
15
+ forms?: object;
16
+ confirmMessage?: string;
17
+ submitter?: string;
18
+ sort?: number;
19
+ status?: number;
20
+ createdBy?: string;
21
+ createdDate?: Date;
22
+ updatedBy?: string;
23
+ updatedDate?: Date;
24
+ }
25
+
26
+ @Table({
27
+ tableName: "md_questionnaire",
28
+ timestamps: false
29
+ })
30
+ export class mdQuestionnaire extends Model<mdQuestionnaireAttributes, mdQuestionnaireAttributes> implements mdQuestionnaireAttributes {
31
+
32
+ @Column({
33
+ primaryKey: true,
34
+ autoIncrement: true,
35
+ type: DataType.INTEGER
36
+ })
37
+ declare id?: number;
38
+
39
+ @Column({
40
+ allowNull: true,
41
+ type: DataType.STRING(60)
42
+ })
43
+ declare uuid?: string;
44
+
45
+ @Column({
46
+ field: "key_name",
47
+ allowNull: true,
48
+ type: DataType.STRING(100)
49
+ })
50
+ declare keyName?: string;
51
+
52
+ @ForeignKey(() => users)
53
+ @Column({
54
+ field: "user_id",
55
+ allowNull: true,
56
+ type: DataType.INTEGER
57
+ })
58
+ declare userId?: number;
59
+
60
+ @Column({
61
+ allowNull: true,
62
+ type: DataType.STRING(255)
63
+ })
64
+ declare title?: string;
65
+
66
+ @Column({
67
+ allowNull: true,
68
+ type: DataType.STRING
69
+ })
70
+ declare description?: string;
71
+
72
+ @Column({
73
+ field: "start_date",
74
+ allowNull: true,
75
+ type: DataType.DATE
76
+ })
77
+ declare startDate?: Date;
78
+
79
+ @Column({
80
+ field: "expire_date",
81
+ allowNull: true,
82
+ type: DataType.DATE
83
+ })
84
+ declare expireDate?: Date;
85
+
86
+ @Column({
87
+ allowNull: true,
88
+ type: DataType.JSON
89
+ })
90
+ declare forms?: object;
91
+
92
+ @Column({
93
+ field: "confirm_message",
94
+ allowNull: true,
95
+ type: DataType.STRING(255)
96
+ })
97
+ declare confirmMessage?: string;
98
+
99
+ @Column({
100
+ allowNull: true,
101
+ type: DataType.STRING(60)
102
+ })
103
+ declare submitter?: string;
104
+
105
+ @Column({
106
+ allowNull: true,
107
+ type: DataType.INTEGER
108
+ })
109
+ declare sort?: number;
110
+
111
+ @Column({
112
+ allowNull: true,
113
+ type: DataType.INTEGER
114
+ })
115
+ declare status?: number;
116
+
117
+ @Column({
118
+ field: "created_by",
119
+ allowNull: true,
120
+ type: DataType.STRING(60)
121
+ })
122
+ declare createdBy?: string;
123
+
124
+ @Column({
125
+ field: "created_date",
126
+ allowNull: true,
127
+ type: DataType.DATE
128
+ })
129
+ declare createdDate?: Date;
130
+
131
+ @Column({
132
+ field: "updated_by",
133
+ allowNull: true,
134
+ type: DataType.STRING(60)
135
+ })
136
+ declare updatedBy?: string;
137
+
138
+ @Column({
139
+ field: "updated_date",
140
+ allowNull: true,
141
+ type: DataType.DATE
142
+ })
143
+ declare updatedDate?: Date;
144
+
145
+ @BelongsTo(() => users)
146
+ declare user?: users;
147
+
148
+ }
@@ -3,6 +3,7 @@ import {
3
3
  } from "sequelize-typescript";
4
4
 
5
5
  export interface oauthAccessTokenAttributes {
6
+ id?: number;
6
7
  accessToken: string;
7
8
  clientId: string;
8
9
  userId?: number;
@@ -17,6 +18,13 @@ export interface oauthAccessTokenAttributes {
17
18
  })
18
19
  export class oauthAccessToken extends Model<oauthAccessTokenAttributes, oauthAccessTokenAttributes> implements oauthAccessTokenAttributes {
19
20
 
21
+ @Column({
22
+ primaryKey: true,
23
+ autoIncrement: true,
24
+ type: DataType.INTEGER
25
+ })
26
+ declare id?: number;
27
+
20
28
  @Column({
21
29
  field: "access_token",
22
30
  type: DataType.STRING(1000)
@@ -3,6 +3,7 @@ import {
3
3
  } from "sequelize-typescript";
4
4
 
5
5
  export interface oauthRefreshTokenAttributes {
6
+ id?: number;
6
7
  refreshToken: string;
7
8
  clientId: string;
8
9
  userId?: number;
@@ -17,6 +18,13 @@ export interface oauthRefreshTokenAttributes {
17
18
  })
18
19
  export class oauthRefreshToken extends Model<oauthRefreshTokenAttributes, oauthRefreshTokenAttributes> implements oauthRefreshTokenAttributes {
19
20
 
21
+ @Column({
22
+ primaryKey: true,
23
+ autoIncrement: true,
24
+ type: DataType.INTEGER
25
+ })
26
+ declare id?: number;
27
+
20
28
  @Column({
21
29
  field: "refresh_token",
22
30
  type: DataType.STRING(1000)
@@ -3,6 +3,7 @@ import {
3
3
  } from "sequelize-typescript";
4
4
  import { authAssignment } from "./authAssignment";
5
5
  import { mdContent } from "./mdContent";
6
+ import { mdQuestionnaire } from "./mdQuestionnaire";
6
7
 
7
8
  export interface usersAttributes {
8
9
  id?: number;
@@ -30,6 +31,7 @@ export interface usersAttributes {
30
31
  updatedDate?: Date;
31
32
  address?: string;
32
33
  other?: string;
34
+ isEmailVerified?: number;
33
35
  }
34
36
 
35
37
  @Table({
@@ -202,6 +204,13 @@ export class users extends Model<usersAttributes, usersAttributes> implements us
202
204
  })
203
205
  declare other?: string;
204
206
 
207
+ @Column({
208
+ field: "is_email_verified",
209
+ allowNull: true,
210
+ type: DataType.INTEGER
211
+ })
212
+ declare isEmailVerified?: number;
213
+
205
214
  @HasMany(() => authAssignment, {
206
215
  sourceKey: "id"
207
216
  })
@@ -212,4 +221,9 @@ export class users extends Model<usersAttributes, usersAttributes> implements us
212
221
  })
213
222
  declare mdContents?: mdContent[];
214
223
 
224
+ @HasMany(() => mdQuestionnaire, {
225
+ sourceKey: "id"
226
+ })
227
+ declare mdQuestionnaires?: mdQuestionnaire[];
228
+
215
229
  }
@@ -0,0 +1,70 @@
1
+ import {
2
+ Model, Table, Column, DataType, Index, Sequelize, ForeignKey
3
+ } from "sequelize-typescript";
4
+
5
+ export interface usersVerifyAttributes {
6
+ id?: number;
7
+ userId?: number;
8
+ type?: number;
9
+ code?: string;
10
+ reference?: string;
11
+ status?: number;
12
+ createdDate?: Date;
13
+ }
14
+
15
+ @Table({
16
+ tableName: "users_verify",
17
+ timestamps: false
18
+ })
19
+ export class usersVerify extends Model<usersVerifyAttributes, usersVerifyAttributes> implements usersVerifyAttributes {
20
+
21
+ @Column({
22
+ primaryKey: true,
23
+ autoIncrement: true,
24
+ type: DataType.INTEGER
25
+ })
26
+ declare id?: number;
27
+
28
+ @Column({
29
+ field: "user_id",
30
+ allowNull: true,
31
+ type: DataType.INTEGER
32
+ })
33
+ declare userId?: number;
34
+
35
+ @Column({
36
+ allowNull: true,
37
+ type: DataType.INTEGER,
38
+ comment: "0 = email",
39
+ defaultValue: "0"
40
+ })
41
+ declare type?: number;
42
+
43
+ @Column({
44
+ allowNull: true,
45
+ type: DataType.STRING(50)
46
+ })
47
+ declare code?: string;
48
+
49
+ @Column({
50
+ allowNull: true,
51
+ type: DataType.STRING(50)
52
+ })
53
+ declare reference?: string;
54
+
55
+ @Column({
56
+ allowNull: true,
57
+ type: DataType.INTEGER,
58
+ comment: "0 = wait, 1 = verified",
59
+ defaultValue: "0"
60
+ })
61
+ declare status?: number;
62
+
63
+ @Column({
64
+ field: "created_date",
65
+ allowNull: true,
66
+ type: DataType.DATE
67
+ })
68
+ declare createdDate?: Date;
69
+
70
+ }
@@ -1,2 +1,2 @@
1
1
  import 'sequelize-typescript';
2
- export { b as authAssignment, a as authAssignmentAttributes } from '../../authAssignment-BUrX9fXX.js';
2
+ export { b as authAssignment, a as authAssignmentAttributes } from '../../authAssignment-CXVzntUT.js';