import type { IIntegration, IUser } from '@rocket.chat/core-typings'; import type { AggregateOptions, FindCursor, Document } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; import type { DocumentWithProjection, FindOptionsWithProjection } from '../types/DocumentWithProjection'; export type IntegrationsStatistics = { totalIntegrations: number; totalIncoming: number; totalIncomingActive: number; totalOutgoing: number; totalOutgoingActive: number; totalWithScriptEnabled: number; }; export interface IIntegrationsModel extends IBaseModel { disableByUserId(userId: IIntegration['userId']): ReturnType['updateMany']>; findByChannels(channels: IIntegration['channel']): FindCursor; findByUserId(userId: IIntegration['userId']): FindCursor>; findOneByIdAndCreatedByIfExists(params: { _id: IIntegration['_id']; createdBy?: IUser['_id'] }): Promise; removeByIdAndCreatedByIfExists(params: { _id: IIntegration['_id']; createdBy?: IUser['_id'] }): Promise; findOneByUrl(url: string): Promise; updateRoomName(oldRoomName: string, newRoomName: string): ReturnType['updateMany']>; findOneByIdAndToken

= FindOptionsWithProjection

>( id: IIntegration['_id'], token: string, options?: O, ): Promise | null>; getStatistics(options?: AggregateOptions): Promise; }