@@ -5,6 +5,7 @@ import { EmailConfirmationStates } from './email';
55import { ApiKeyDocument } from './apiKey' ;
66import { Error , GenericResponseBody , RouteParam } from './express' ;
77
8+ // -------- MONGOOSE --------
89/** Full User interface */
910export interface IUser extends VirtualId , MongooseTimestamps {
1011 name : string ;
@@ -76,14 +77,13 @@ export interface UserModel extends Model<UserDocument> {
7677 EmailConfirmation ( ) : typeof EmailConfirmationStates ;
7778}
7879
79- // HTTP:
80+ // -------- API --------
8081/**
8182 * Response body used for User related routes
8283 * Contains either the Public (sanitised) User or an Error
8384 */
8485export type PublicUserOrError = PublicUser | Error ;
8586
86- // authManagement:
8787/**
8888 * Note: This type should probably be updated to be removed in the future and use just PublicUserOrError
8989 * - Contains either a GenericResponseBody for when there is no user found or attached to a request
@@ -93,6 +93,7 @@ export type PublicUserOrErrorOrGeneric =
9393 | PublicUserOrError
9494 | GenericResponseBody ;
9595
96+ /** userController.updateSettings - Request */
9697export interface UpdateSettingsRequestBody {
9798 username : string ;
9899 email : string ;
@@ -101,38 +102,39 @@ export interface UpdateSettingsRequestBody {
101102}
102103
103104/**
104- * Response body used for unlinkGithub and unlinkGoogle
105+ * userContoller. unlinkGithub & userContoller. unlinkGoogle - Response
105106 * - If user is not logged in, a GenericResponseBody with 404 is returned
106107 * - If user is logged in, PublicUserOrError is returned
107108 */
108109export type UnlinkThirdPartyResponseBody = PublicUserOrErrorOrGeneric ;
109110
111+ /** userController.resetPasswordInitiate - Request */
110112export interface ResetPasswordInitiateRequestBody {
111113 email : string ;
112114}
113115
114- /**
115- * Request params used for validateResetPasswordToken & updatePassword
116- */
116+ /** userContoller.validateResetPasswordToken & userController.updatePassword - Request */
117117export interface ResetOrUpdatePasswordRequestParams extends RouteParam {
118118 token : string ;
119119}
120+ /** userController.updatePassword - Request */
120121export interface UpdatePasswordRequestBody {
121122 password : string ;
122123}
123-
124- // signup:
124+ /** userController.createUser - Request */
125125export interface CreateUserRequestBody {
126126 username : string ;
127127 email : string ;
128128 password : string ;
129129}
130+ /** userController.duplicateUserCheck - Query */
130131export interface DuplicateUserCheckQuery {
131132 // eslint-disable-next-line camelcase
132133 check_type : 'email' | 'username' ;
133134 email ?: string ;
134135 username ?: string ;
135136}
137+ /** userController.verifyEmail - Query */
136138export interface VerifyEmailQuery {
137139 t : string ;
138140}
0 commit comments