@@ -5,6 +5,7 @@ import { EmailConfirmationStates } from './email';
5
5
import { ApiKeyDocument } from './apiKey' ;
6
6
import { Error , GenericResponseBody , RouteParam } from './express' ;
7
7
8
+ // -------- MONGOOSE --------
8
9
/** Full User interface */
9
10
export interface IUser extends VirtualId , MongooseTimestamps {
10
11
name : string ;
@@ -76,14 +77,13 @@ export interface UserModel extends Model<UserDocument> {
76
77
EmailConfirmation ( ) : typeof EmailConfirmationStates ;
77
78
}
78
79
79
- // HTTP:
80
+ // -------- API --------
80
81
/**
81
82
* Response body used for User related routes
82
83
* Contains either the Public (sanitised) User or an Error
83
84
*/
84
85
export type PublicUserOrError = PublicUser | Error ;
85
86
86
- // authManagement:
87
87
/**
88
88
* Note: This type should probably be updated to be removed in the future and use just PublicUserOrError
89
89
* - Contains either a GenericResponseBody for when there is no user found or attached to a request
@@ -93,6 +93,7 @@ export type PublicUserOrErrorOrGeneric =
93
93
| PublicUserOrError
94
94
| GenericResponseBody ;
95
95
96
+ /** userController.updateSettings - Request */
96
97
export interface UpdateSettingsRequestBody {
97
98
username : string ;
98
99
email : string ;
@@ -101,38 +102,39 @@ export interface UpdateSettingsRequestBody {
101
102
}
102
103
103
104
/**
104
- * Response body used for unlinkGithub and unlinkGoogle
105
+ * userContoller. unlinkGithub & userContoller. unlinkGoogle - Response
105
106
* - If user is not logged in, a GenericResponseBody with 404 is returned
106
107
* - If user is logged in, PublicUserOrError is returned
107
108
*/
108
109
export type UnlinkThirdPartyResponseBody = PublicUserOrErrorOrGeneric ;
109
110
111
+ /** userController.resetPasswordInitiate - Request */
110
112
export interface ResetPasswordInitiateRequestBody {
111
113
email : string ;
112
114
}
113
115
114
- /**
115
- * Request params used for validateResetPasswordToken & updatePassword
116
- */
116
+ /** userContoller.validateResetPasswordToken & userController.updatePassword - Request */
117
117
export interface ResetOrUpdatePasswordRequestParams extends RouteParam {
118
118
token : string ;
119
119
}
120
+ /** userController.updatePassword - Request */
120
121
export interface UpdatePasswordRequestBody {
121
122
password : string ;
122
123
}
123
-
124
- // signup:
124
+ /** userController.createUser - Request */
125
125
export interface CreateUserRequestBody {
126
126
username : string ;
127
127
email : string ;
128
128
password : string ;
129
129
}
130
+ /** userController.duplicateUserCheck - Query */
130
131
export interface DuplicateUserCheckQuery {
131
132
// eslint-disable-next-line camelcase
132
133
check_type : 'email' | 'username' ;
133
134
email ?: string ;
134
135
username ?: string ;
135
136
}
137
+ /** userController.verifyEmail - Query */
136
138
export interface VerifyEmailQuery {
137
139
t : string ;
138
140
}
0 commit comments