The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/definition/ITeam.ts

62 lines
1.3 KiB

import { SortOptionObject, FilterQuery, SchemaMember } from 'mongodb';
import { IRocketChatRecord } from './IRocketChatRecord';
import { IUser } from './IUser';
export enum TEAM_TYPE {
PUBLIC = 0,
PRIVATE = 1,
}
export type SortType = -1|1;
export interface ITeam extends IRocketChatRecord {
name: string;
type: TEAM_TYPE;
roomId: string;
createdBy: Pick<IUser, '_id' | 'username' >;
createdAt: Date;
}
export interface ITeamMember extends IRocketChatRecord {
teamId: string;
userId: string;
roles?: Array<string>;
createdBy: Pick<IUser, '_id' | 'username' >;
createdAt: Date;
}
// TODO move this definition to a more broader file
export interface IPaginationOptions {
offset: number;
count: number;
}
// TODO move this definition to a more broader file
export interface IQueryOptions<T> {
sort?: SortOptionObject<T>;
query?: FilterQuery<T>;
fields?: SchemaMember<T, number | boolean>;
}
// TODO move this definition to a more broader file
export interface IRecordsWithTotal<T> {
records: Array<T>;
total: number;
}
export interface ITeamStatData {
teamId: string;
mainRoom: string;
totalRooms: number;
totalMessages: number;
totalPublicRooms: number;
totalPrivateRooms: number;
totalDefaultRooms: number;
totalMembers: number;
}
export interface ITeamStats {
totalTeams: number;
teamStats: Array<ITeamStatData>;
}