diff --git a/app/definitions/rest/v1/index.ts b/app/definitions/rest/v1/index.ts index e292cb99b..61f19572e 100644 --- a/app/definitions/rest/v1/index.ts +++ b/app/definitions/rest/v1/index.ts @@ -11,7 +11,6 @@ import { PermissionsEndpoints } from './permissions'; import { RolesEndpoints } from './roles'; import { RoomsEndpoints } from './rooms'; import { OauthCustomConfiguration } from './settings'; -import { UserEndpoints } from './user'; import { UsersEndpoints } from './users'; import { TeamsEndpoints } from './teams'; import { E2eEndpoints } from './e2e'; @@ -30,7 +29,6 @@ export type Endpoints = ChannelsEndpoints & RolesEndpoints & RoomsEndpoints & OauthCustomConfiguration & - UserEndpoints & UsersEndpoints & TeamsEndpoints & E2eEndpoints & diff --git a/app/definitions/rest/v1/user.ts b/app/definitions/rest/v1/user.ts deleted file mode 100644 index 737ed9a58..000000000 --- a/app/definitions/rest/v1/user.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { INotificationPreferences, IUser, IUserPreferences, IUserRegistered } from '../../IUser'; - -export type UserEndpoints = { - 'users.info': { - GET: (params: { userId: IUser['_id'] }) => { - user: IUser; - success: boolean; - }; - POST: (params: { userId: IUser['_id'] }) => { - user: IUser; - success: boolean; - }; - }; - 'users.setPreferences': { - POST: (params: { userId: IUser['_id']; data: Partial }) => { - user: IUserPreferences; - success: boolean; - }; - }; - 'users.register': { - POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered }; - }; -}; diff --git a/app/definitions/rest/v1/users.ts b/app/definitions/rest/v1/users.ts index 337a2182f..7bed1d145 100644 --- a/app/definitions/rest/v1/users.ts +++ b/app/definitions/rest/v1/users.ts @@ -1,5 +1,6 @@ import type { ITeam } from '../../ITeam'; import type { IUser } from '../../IUser'; +import { INotificationPreferences, IUserPreferences, IUserRegistered } from '../../IUser'; export type UsersEndpoints = { 'users.2fa.sendEmailCode': { @@ -11,4 +12,23 @@ export type UsersEndpoints = { 'users.listTeams': { GET: (params: { userId: IUser['_id'] }) => { teams: Array }; }; + 'users.info': { + GET: (params: { userId: IUser['_id'] }) => { + user: IUser; + success: boolean; + }; + POST: (params: { userId: IUser['_id'] }) => { + user: IUser; + success: boolean; + }; + }; + 'users.setPreferences': { + POST: (params: { userId: IUser['_id']; data: Partial }) => { + user: IUserPreferences; + success: boolean; + }; + }; + 'users.register': { + POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered }; + }; };