import { Contact } from '../../models/contact.model'; import { Service } from '../../services/service'; export declare const BOT_SVC = "BotService"; export declare class BotData { id: string; name: string; jid: string; avatarId: string; avatarUrl: string; lastAvatarUpdateDate: string; capabilities: string[]; isRainbowSupportBot: boolean; static createFromData(data: any): BotData; } export declare abstract class AbstractBotService extends Service { abstract getBots(options: any): Promise; abstract getBotById(botId: string): Promise; } export declare class BotService extends AbstractBotService { private authService; private logger; private contactService; private eventService; private errorHelperService; private profileService; private portalURL; private avatarChangeEventHandler; botsList: BotData[]; static getInstance(): BotService; static build(): BotService; protected constructor(); /********************************************************/ /** LIFE CYCLE STUFF */ /********************************************************/ start(): Promise; stop(): Promise; init(): void; /********************************************************/ /** EVENT HANDLING */ /********************************************************/ private startListeners; private onSupportAvatarChange; /********************************************************/ /** COMPANY BOTS */ /********************************************************/ /** * Get the list of bot services. * Used by SDK (public) * Warning when modifying this method * * @param {object} options [optional] configuration object that may contain the following properties: * @property {string} options.format [optional] Allows to retrieve more or less bot services details in response. * - small: id, name, jid, capabilities * - medium: id, name, jid, isRainbowSupportBot, capabilities * - full: id, name, jid, isRainbowSupportBot, capabilities, createdByUserId, avatarId, lastAvatarUpdateDate * Default value: full * @property {number} options.limit [optional] Allows to specify the number of bot services to retrieve. * Default value: 100 * @property {number} options.offset [optional] Allows to specify the position of first bot to retrieve (first bot if not specified). * Warning: if offset > total, no results are returned. * @property {string} options.sortField [optional] Sort bots list based on the given field. * Default value: name * @property {number} options.sortOrder [optional] Allows to specify order when sorting bots list. * Default value: 1 * Allowed values: -1, 1 * } * @returns Promise returns an Object * { * data : {array} // found bots informations with an array * limit : {number} // limit given * offset : {number} // offset given * total : {number} // total returned * } */ getBots(options?: any): Promise; /** * Get the data of a bot service from its id * Used by SDK (public) * Warning when modifying this method * * @param {string} botId Bot Service unique identifier * @returns Promise */ getBotById(botId: string): Promise; /** * Get the Contact associated to a bot service from its jid * The bot service is retrieved first from internal data (botsList) and if not present, a request is sent to server * to retrieve all data associated to this bot. This bot is also added in botsList cache. * * @param jid * @param {string} botJid Bot service's jid, should be like 'emily.rainbow.com'. * @returns Promise */ getBotContactByJid(jid: string): Promise; /********************************************************/ /** COMPANY E-SUPPORT BOT (EMILY) */ /********************************************************/ /** * GET Emily bot data from server * * @returns {object} Emily bot Object (any) */ private getEmilyBot; private storeEmilyBot; /** * SEARCH Emily data in internal cache (and from server in case of shitty situation) * * @returns {object} Emily Bot Data Object (BotData) */ getEmily(): Promise; /********************************************************/ /** COMPANY BOT AVATAR STUFF */ /** * @param {string} avatarId Identifier of the Bot service's avatar. * @param {string} lastAvatarUpdateDate Date of last bot avatar update * @returns {Promise} Promise to get the Avatar (Image format) of the specified Bot */ getBotAvatarImage(avatarId: string, lastAvatarUpdateDate: string): Promise; private getBotAvatarUrl; } //# sourceMappingURL=bot.service.d.ts.map