|
|
|
|
@ -1,5 +1,14 @@ |
|
|
|
|
import type { Document, UpdateResult, FindCursor, FindOptions, Filter, InsertOneResult, DeleteResult } from 'mongodb'; |
|
|
|
|
import type { IUser, IRole, IRoom, ILivechatAgent, UserStatus, ILoginToken } from '@rocket.chat/core-typings'; |
|
|
|
|
import type { |
|
|
|
|
IUser, |
|
|
|
|
IRole, |
|
|
|
|
IRoom, |
|
|
|
|
ILivechatAgent, |
|
|
|
|
UserStatus, |
|
|
|
|
ILoginToken, |
|
|
|
|
IPersonalAccessToken, |
|
|
|
|
AtLeast, |
|
|
|
|
} from '@rocket.chat/core-typings'; |
|
|
|
|
|
|
|
|
|
import type { FindPaginated, IBaseModel } from './IBaseModel'; |
|
|
|
|
|
|
|
|
|
@ -213,7 +222,7 @@ export interface IUsersModel extends IBaseModel<IUser> { |
|
|
|
|
}[] |
|
|
|
|
>; |
|
|
|
|
findOneOnlineAgentByUserList( |
|
|
|
|
userList: string[], |
|
|
|
|
userList: string[] | string, |
|
|
|
|
options?: FindOptions<IUser>, |
|
|
|
|
isLivechatEnabledWhenAgentIdle?: boolean, |
|
|
|
|
): Promise<IUser | null>; |
|
|
|
|
@ -224,8 +233,11 @@ export interface IUsersModel extends IBaseModel<IUser> { |
|
|
|
|
addRoomByUserId(userId: string, rid: string): Promise<UpdateResult>; |
|
|
|
|
removeRoomByRoomIds(rids: string[]): Promise<UpdateResult | Document>; |
|
|
|
|
getLoginTokensByUserId(userId: string): FindCursor<ILoginToken>; |
|
|
|
|
addPersonalAccessTokenToUser(data: { userId: string; loginTokenObject: ILoginToken }): Promise<UpdateResult>; |
|
|
|
|
removePersonalAccessTokenOfUser(data: { userId: string; loginTokenObject: ILoginToken }): Promise<UpdateResult>; |
|
|
|
|
addPersonalAccessTokenToUser(data: { userId: string; loginTokenObject: IPersonalAccessToken }): Promise<UpdateResult>; |
|
|
|
|
removePersonalAccessTokenOfUser(data: { |
|
|
|
|
userId: string; |
|
|
|
|
loginTokenObject: AtLeast<IPersonalAccessToken, 'type' | 'name'>; |
|
|
|
|
}): Promise<UpdateResult>; |
|
|
|
|
findPersonalAccessTokenByTokenNameAndUserId(data: { userId: string; tokenName: string }): Promise<IUser | null>; |
|
|
|
|
setOperator(userId: string, operator: boolean): Promise<UpdateResult>; |
|
|
|
|
checkOnlineAgents(agentId: string): Promise<boolean>; |
|
|
|
|
@ -286,6 +298,7 @@ export interface IUsersModel extends IBaseModel<IUser> { |
|
|
|
|
findNotIdUpdatedFrom(userId: string, updatedFrom: Date, options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
findByRoomId(roomId: string, options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
findByUsername(username: string, options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
findByUsernames(usernames: string[], options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
findByUsernamesIgnoringCase(usernames: string[], options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
findActiveByUserIds(userIds: string[], options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
findActiveLocalGuests(idsExceptions: string[], options?: FindOptions<IUser>): FindCursor<IUser>; |
|
|
|
|
|